Linear Transformations and Reconstruction: Choosing a Decoder Basis

ECE 57000 — September 11, 2026

David I. Inouye

Wednesday made the SVD a way to read a linear transformation

  • Orthogonal factors preserve lengths; singular values set directional scalings.
  • The largest singular value bounds how much any input can stretch.
  • Rank counts the nonzero singular values: how many independent directions survive.

Next question: When can we recover an input from its transformed output?

Rank counts the independent directions that survive

\[ \operatorname{rank}(A)=\#\{j:\sigma_j>0\}\le\min(m,d) \]

For example:

\[ \Sigma=\begin{bmatrix}3&0&0\\0&1&0\\0&0&0\end{bmatrix} \qquad\Longrightarrow\qquad \operatorname{rank}(A)=2 \]

  • Two independent input directions produce nonzero output directions.
  • The third input direction disappears: \(A\boldsymbol{v}_3=\boldsymbol{0}\).
  • Rotations and reflections change which directions these are, but not the rank.

A null direction makes different inputs indistinguishable

The null space contains all directions that map to zero:

\[ \operatorname{null}(A)=\{\boldsymbol{h}:A\boldsymbol{h}=\boldsymbol{0}\}. \]

For any nonzero \(\boldsymbol{h}\in\operatorname{null}(A)\):

\(\displaystyle A(\boldsymbol{x}+\boldsymbol{h})\)

\(=\)

\(\displaystyle A\boldsymbol{x}+A\boldsymbol{h}\)

(Distributivity)

\(\,\)

\(=\)

\(\displaystyle A\boldsymbol{x}\)

(Null direction)

A square operator is invertible when no direction collapses

In 1D, \(y=ax\) can be undone by \(x=y/a\) exactly when \(a\ne0\).

For square \(A=U\Sigma V^T\in\mathbb{R}^{d\times d}\):

\[ \text{all }\sigma_j>0 \quad\Longrightarrow\quad A^{-1}=V\Sigma^{-1}U^T, \qquad \Sigma^{-1}=\operatorname{diag}(1/\sigma_1,\ldots,1/\sigma_d). \]

\(\displaystyle A^{-1}A\)

\(=\)

\(\displaystyle (V\Sigma^{-1}U^T)(U\Sigma V^T)\)

(Substitute)

\(\,\)

\(=\)

\(\displaystyle V\Sigma^{-1}\Sigma V^T\)

(\(U^TU=I_d\))

\(\,\)

\(=\)

\(\displaystyle VV^T\)

(\(\Sigma^{-1}\Sigma=I_d\))

\(\,\)

\(=\)

\(\displaystyle I_d\)

(\(VV^T=I_d\))

Recovery depends on preserving every input direction

\(\boldsymbol{y}=A\boldsymbol{x}\) maps \(d\) input coordinates to \(m\) output coordinates.

Three labeled matrix diagrams compare m less than d, m equal to d, and m greater than d. A has m rows and d columns. Recovering every input is impossible in the first case and requires rank d in the other two.

Recovering every \(\boldsymbol{x}\in\mathbb{R}^d\) requires \(\operatorname{rank}(A)=d\).

The pseudoinverse undoes every nonzero scaling

For any \(A=U\Sigma V^T\in\mathbb{R}^{m\times d}\), define:

\[ \underbrace{A^\dagger}_{d\times m} =\underbrace{V}_{d\times d}\underbrace{\Sigma^\dagger}_{d\times m}\underbrace{U^T}_{m\times m}. \]

\(\Sigma^\dagger\) has the transposed shape of \(\Sigma\), with zero off-diagonal entries:

\[ (\Sigma^\dagger)_{jj}= \begin{cases} 1/\sigma_j, & \sigma_j>0,\\ 0, & \sigma_j=0. \end{cases} \]

  • Reverse the output reorientation, undo nonzero scalings, then reorient back.
  • A zero scaling destroyed information; leaving it zero cannot restore it.
  • The Moore–Penrose pseudoinverse exists even when \(A\) has no inverse.

The pseudoinverse recovers inputs exactly when no input direction is lost

For \(\boldsymbol{y}=A\boldsymbol{x}\), recovery of every input means:

\[ \widehat{\boldsymbol{x}}=A^\dagger\boldsymbol{y}=\boldsymbol{x} \ \text{for all }\boldsymbol{x}\in\mathbb{R}^d \quad\Longleftrightarrow\quad A^\dagger A=I_d. \]

Let \(r=\operatorname{rank}(A)\) and \(V_r=[\boldsymbol{v}_1\;\cdots\;\boldsymbol{v}_r]\) contain its surviving input directions.

\(\displaystyle A^\dagger A\)

\(=\)

\(\displaystyle V\Sigma^\dagger U^TU\Sigma V^T\)

(Substitute)

\(\,\)

\(=\)

\(\displaystyle V(\Sigma^\dagger\Sigma)V^T\)

(\(U^TU=I_m\))

\(\,\)

\(=\)

\(\displaystyle V_rV_r^T\)

(Keep nonzero directions)

\(\Sigma^\dagger\Sigma\) has \(r\) diagonal ones and \(d-r\) zeros. Thus \(A^\dagger A=I_d\) exactly when \(r=d\): full column rank, requiring \(m\ge d\).

A restricted input subspace can be recovered exactly

Inputs: \(\boldsymbol{x}=t\boldsymbol{u}\in\mathbb{R}^2\), \(\|\boldsymbol{u}\|_2=1\). Encoder: \(A=\boldsymbol{v}^T\), with \(\alpha=\boldsymbol{v}^T\boldsymbol{u}\ne0\).

Five colored inputs lie exactly on a line through the origin in 2D. An encoder direction v is not perpendicular to the line direction u. Five distinct outputs y = alpha t retain every point's position along the line.

Decode with \(B=\boldsymbol{u}/\alpha\): knowing the line lets us undo its nonzero scaling.

\[ \widehat{\boldsymbol{x}}=By=\frac{\boldsymbol{u}}{\alpha}(\alpha t)=t\boldsymbol{u}=\boldsymbol{x}. \]

If \(\boldsymbol{v}=\boldsymbol{u}\), then \(\alpha=1\), \(y=t\), and \(B=A^\dagger=\boldsymbol{u}\). In general, \(B\ne A^\dagger\).

Read what an operator does from its singular values

A sensor-processing system uses \(A=U\operatorname{diag}(4,1,0)V^T\).

Can you recover every sensor input? What is the largest possible stretching factor? Could this operator preserve every pairwise distance? Explain which input direction is invisible to the system.

Rank \(2\); recovery is impossible in general; maximum scaling is \(4\). The direction \(\boldsymbol{v}_3\) disappears. All distances cannot be preserved.

Data near a subspace can have small reconstruction error

What if the inputs are close to a line, but do not lie exactly on it?

Five points near a line are connected to their reconstructions on the line by orange perpendicular residuals. The residual is the information discarded when encoding with one coordinate.

\[ y=\boldsymbol{u}^T\boldsymbol{x},\qquad \widehat{\boldsymbol{x}}=\boldsymbol{u}y,\qquad \text{error}=\|\boldsymbol{x}-\widehat{\boldsymbol{x}}\|_2^2. \]

Which direction minimizes total reconstruction error?

Reconstruction and Principal Component Analysis

David I. Inouye

Dynamic Content · Last Updated: September 11, 2026

A useful reduction should reconstruct the observed data well

Return to the cells described by many measured features.

  • Fewer coordinates cannot preserve every possible input exactly.
  • The observed data may nevertheless lie near a lower-dimensional subspace.
  • We will judge a representation by how well it reconstructs those observations.

What reconstruction error are we willing to accept in exchange for fewer features?

Four steps lead to the PCA formulation

We will turn “reconstruct the data well” into a problem involving one matrix.

1. Define what a good reconstruction means — Next

Choose a representation size and measure reconstruction error.

2. Choose a convenient decoder basis.

An orthonormal basis can represent the same reconstruction subspace.

3. Find the best encoder for that decoder.

The closest point in the subspace determines the coordinates.

4. Formulate the subspace choice.

Combine these results into the PCA optimization problem.

Centering separates the mean from variation

For notation simplicity, we now call the raw data \(\widetilde X\) and the centered data \(X\).

\[ \boldsymbol{\mu}=\frac1n\sum_{i=1}^n\widetilde{\boldsymbol{x}}_i, \qquad X=\widetilde X-\boldsymbol{1}_n\boldsymbol{\mu}^T. \]

  • Each row is \(\boldsymbol{x}_i^T=(\widetilde{\boldsymbol{x}}_i-\boldsymbol{\mu})^T\).
  • Every feature column of \(X\) has mean zero.
  • From here on, \(X\) and \(\boldsymbol{x}_i\) always denote centered data.

Add the mean back to reconstruct raw measurements: \(\widehat{\widetilde{\boldsymbol{x}}}_i=\boldsymbol{\mu}+\widehat{\boldsymbol{x}}_i\).

A linear encoder and decoder make reconstruction explicit

For one centered observation, use the same operator convention as \(\boldsymbol{y}=A\boldsymbol{x}\):

\[ \boldsymbol{z}_i=\underbrace{E}_{k\times d}\boldsymbol{x}_i, \qquad \widehat{\boldsymbol{x}}_i=\underbrace{D}_{d\times k}\boldsymbol{z}_i. \]

Stacking observations as rows gives:

\[ \underbrace{Z}_{n\times k} =\underbrace{X}_{n\times d}\underbrace{E^T}_{d\times k}, \qquad \underbrace{\widehat X}_{n\times d} =\underbrace{Z}_{n\times k}\underbrace{D^T}_{k\times d}. \]

The batch reconstruction is \(\widehat X=XE^TD^T\), with rank at most \(k\).

Reconstruction error formalizes one meaning of preservation

Choose a linear encoder and decoder to minimize squared reconstruction error:

\[ \min_{E,D}\|X-XE^TD^T\|_F^2. \]

The Frobenius norm measures the error across every entry:

\[ \|M\|_F^2=\sum_{i,j}M_{ij}^2, \qquad \|X-\widehat X\|_F^2 =\sum_{i=1}^n\|\boldsymbol{x}_i-\widehat{\boldsymbol{x}}_i\|_2^2. \]

Four steps lead to the PCA formulation

We have an error measure. Now consider which reconstructions the decoder can produce.

1. Define what a good reconstruction means — Established

Choose a representation size and measure reconstruction error.

2. Choose a convenient decoder basis — Next

An orthonormal basis can represent the same reconstruction subspace.

3. Find the best encoder for that decoder.

The closest point in the subspace determines the coordinates.

4. Formulate the subspace choice.

Combine these results into the PCA optimization problem.

Matrix–vector multiplication combines the matrix’s columns

For a \(3\times2\) decoder, the familiar row dot products can be regrouped by column:

\[ \begin{bmatrix}d_{11}&d_{12}\\d_{21}&d_{22}\\d_{31}&d_{32}\end{bmatrix} \begin{bmatrix}z_1\\z_2\end{bmatrix} = \underbrace{\begin{bmatrix}d_{11}z_1+d_{12}z_2\\d_{21}z_1+d_{22}z_2\\d_{31}z_1+d_{32}z_2\end{bmatrix}}_{\text{one dot product per row}} = z_1\underbrace{\begin{bmatrix}d_{11}\\d_{21}\\d_{31}\end{bmatrix}}_{\boldsymbol{d}_1} +z_2\underbrace{\begin{bmatrix}d_{12}\\d_{22}\\d_{32}\end{bmatrix}}_{\boldsymbol{d}_2}. \]

For any number of columns: \(\widehat{\boldsymbol{x}}=D\boldsymbol{z}=\sum_{j=1}^k z_j\boldsymbol{d}_j\).

  • Let \(\boldsymbol{z}\) be arbitrary for now. Every reconstruction lies in \(\mathcal{S}=\operatorname{span}\{\boldsymbol{d}_1,\ldots,\boldsymbol{d}_k\}\).
  • First choose how \(D\) describes that subspace; then choose the best coordinates.

Scaling a decoder direction only changes its coordinates

A line can use a unit vector \(\boldsymbol{u}\) or the scaled vector \(3\boldsymbol{u}\).

\[ \underbrace{\boldsymbol{u}}_{\text{unit basis}}\underbrace{t}_{\text{coordinate}} = \underbrace{(3\boldsymbol{u})}_{\text{scaled basis}}\underbrace{(t/3)}_{\text{adjusted coordinate}}. \]

Both describe the same point on the same line.

  • A nonzero column can be normalized if we rescale its coordinate to compensate.
  • Unit columns remove an arbitrary scale choice; no reconstruction is lost.
  • Next: can we choose perpendicular columns while keeping the same subspace?

Perpendicular unit directions can describe the same subspace

Both unit-vector pairs span the plane: either represents every \(\boldsymbol{x}=[x_1,x_2]^T\).

The same point in a retained plane has coordinates [1,sqrt(2)]^T in a unit skew basis and (2,1) in an orthonormal basis. Both pairs of basis vectors span the same plane.

For \(\boldsymbol{b}_1=[1,0]^T\), \(\boldsymbol{b}_2=[1,1]^T/\sqrt2\):

\[ \boldsymbol{x}=(x_1-x_2)\boldsymbol{b}_1+\sqrt2\,x_2\boldsymbol{b}_2. \]

For \(\boldsymbol{w}_1=[1,0]^T\), \(\boldsymbol{w}_2=[0,1]^T\):

\[ \boldsymbol{x}=(\boldsymbol{w}_1^T\boldsymbol{x})\boldsymbol{w}_1 +(\boldsymbol{w}_2^T\boldsymbol{x})\boldsymbol{w}_2. \]

Same plane; simpler coordinates: an orthonormal basis gives each coefficient by a dot product.

QR lets us choose an orthonormal decoder without changing reconstruction

Start with any encoder \(E_0\in\mathbb{R}^{k\times d}\) and decoder \(D_0\in\mathbb{R}^{d\times k}\), where \(k\le d\). Suppose \(D_0\) does not have orthonormal columns.

The thin QR decomposition writes \(D_0=WR\): \(W^TW=I_k\) and \(R\) is upper triangular. Here \(W\in\mathbb{R}^{d\times k}\) and \(R\in\mathbb{R}^{k\times k}\).

Can we choose \(D=W\) and a new \(E\) to keep every reconstruction the same?

\(\displaystyle D_0E_0\boldsymbol{x}\)

\(=\)

\(\displaystyle (WR)E_0\boldsymbol{x}\)

(QR of the original decoder)

\(\,\)

\(=\)

\(\displaystyle W(RE_0)\boldsymbol{x}\)

(Regroup the factors)

\(\,\)

\(=\)

\(\displaystyle DE\boldsymbol{x}\)

(Choose \(D=W\), \(E=RE_0\))

Same reconstruction for every input: an orthonormal decoder is without loss of generality. Next, fix \(D=W\) and find its best encoder.