Eigenvalue decomposition mainly concerns square matrices. Singular value decomposition applies to every m×nm\times n matrix and uses separate orthogonal bases in the domain and codomain to describe one linear map.

Every matrix is orthogonal change, scaling, and orthogonal change

For every real matrix AA, there are orthogonal matrices U,VU,V and a nonnegative diagonal-shaped matrix Σ\Sigma such that

A=UΣVT.A=U\Sigma V^{\mathsf T}.

VTV^{\mathsf T} expresses inputs in the right-singular-vector basis, Σ\Sigma scales perpendicular directions, and UU places them in the output space. The positive entries

σ1≥σ2≥⋯≥σr>0\sigma_1\ge\sigma_2\ge\cdots\ge\sigma_r>0

are the singular values. Their count rr is rank⁡(A)\operatorname{rank}(A).

Check dimensions in a rectangular factorization

In the full SVD, UU is m×mm\times m, Σ\Sigma is m×nm\times n, and VV is n×nn\times n. Keeping only positive modes gives the compact form A=UrΣrVrTA=U_r\Sigma_rV_r^{\mathsf T}, with rr columns on each side. Orthogonal transformations can include reflections, so they are not always rotations.

Singular values come from symmetric matrices

The matrix ATAA^{\mathsf T}A is symmetric positive semidefinite. The spectral theorem gives

ATAvi=σi2vi.A^{\mathsf T}A\mathbf v_i=\sigma_i^2\mathbf v_i.

For σi>0\sigma_i>0, define ui=Avi/σi\mathbf u_i=A\mathbf v_i/\sigma_i. These vectors are orthonormal and satisfy Avi=σiuiA\mathbf v_i=\sigma_i\mathbf u_i. Completing bases on both sides produces the full SVD.

Eigenvalues may be negative or complex; singular values are always nonnegative real numbers. SVD exists even when a square matrix is not diagonalizable.

Symmetry follows by transposition, and positive semidefiniteness follows from zTATAz=∥Az∥2≥0\mathbf z^{\mathsf T}A^{\mathsf T}A\mathbf z=\|A\mathbf z\|^2\ge0. For the completed bases, the equations on every vi\mathbf v_i give AV=UΣAV=U\Sigma, so right multiplication by VTV^{\mathsf T} proves the factorization. The rank is rr because multiplication by invertible basis matrices preserves the image dimension and Σ\Sigma has exactly rr independent nonzero columns. When r=0r=0, A=0A=0 and any orthogonal bases work.

Why the constructed left vectors are orthonormal

For positive singular values,

uiTuj=viTATAvjσiσj=σj2σiσjδij=δij.\mathbf u_i^{\mathsf T}\mathbf u_j =\frac{\mathbf v_i^{\mathsf T}A^{\mathsf T}A\mathbf v_j}{\sigma_i\sigma_j} =\frac{\sigma_j^2}{\sigma_i\sigma_j}\delta_{ij} =\delta_{ij}.

A zero eigenvalue gives ∥Av∥2=0\|A\mathbf v\|^2=0, hence Av=0A\mathbf v=0. These two cases complete the construction from the spectral theorem.

SVD aligns the four fundamental subspaces

Right singular vectors with positive singular values span the row space; those with zero singular value span ker⁡A\ker A. Positive left singular vectors span the column space; the remaining ones span ker⁡AT\ker A^{\mathsf T}. Thus

row⁡(A)=(ker⁡A)⊥,col⁡(A)=(ker⁡AT)⊥.\operatorname{row}(A)=(\ker A)^\perp, \qquad \operatorname{col}(A)=(\ker A^{\mathsf T})^\perp.

This places the row, column, and null spaces computed in vector spaces and bases into one orthogonal structure.

Proof

Writing x=∑iyivi\mathbf x=\sum_i y_i\mathbf v_i gives Ax=∑i≤rσiyiuiA\mathbf x=\sum_{i\le r}\sigma_i y_i\mathbf u_i. Orthogonality makes this zero exactly when y1=⋯=yr=0y_1=\cdots=y_r=0, and it shows that the image is exactly the span of u1,…,ur\mathbf u_1,\ldots,\mathbf u_r. Apply the same argument to AT=VΣTUTA^{\mathsf T}=V\Sigma^{\mathsf T}U^{\mathsf T} to identify its kernel and image. The row space is the image of ATA^{\mathsf T}, proving both orthogonal-complement identities.

The pseudoinverse unifies exact and least-squares solutions

Invert each positive singular value to form Σ+\Sigma^+. The Moore–Penrose pseudoinverse is

A+=VΣ+UT.A^+=V\Sigma^+U^{\mathsf T}.

The vector x^=A+b\widehat{\mathbf x}=A^+\mathbf b is the minimum-norm least-squares solution. For a consistent system it is the shortest exact solution, and for an invertible matrix it equals A−1A^{-1}.

A small singular value amplifies data error by roughly 1/σi1/\sigma_i. Truncating very small singular values sacrifices some fit in exchange for stability.

General proof of the minimum-norm property

For the full SVD A=UΣVTA=U\Sigma V^{\mathsf T}, put y=VTx\mathbf y=V^{\mathsf T}\mathbf x and c=UTb\mathbf c=U^{\mathsf T}\mathbf b. Orthogonal transformations preserve norms, giving

∥Ax−b∥2=∑i=1r(σiyi−ci)2+∑i=r+1mci2.\|A\mathbf x-\mathbf b\|^2 =\sum_{i=1}^r(\sigma_i y_i-c_i)^2+\sum_{i=r+1}^m c_i^2.

The final sum is independent of the input. Each term in the first sum vanishes precisely when yi=ci/σiy_i=c_i/\sigma_i. The remaining n−rn-r input coordinates are free and describe the kernel. Since ∥x∥2=∑iyi2\|\mathbf x\|^2=\sum_i y_i^2, setting every free coordinate to zero gives the unique minimum norm. This is exactly VΣ+UTbV\Sigma^+U^{\mathsf T}\mathbf b.

All solutions of a rectangular example

For the single-row matrix A=(1  1)A=(1\ \ 1), a compact SVD is Ur=(1)U_r=(1), Σr=(2)\Sigma_r=(\sqrt2), and Vr=(1,1)T/2V_r=(1,1)^{\mathsf T}/\sqrt2. Thus

A+=(1/21/2).A^+=\begin{pmatrix}1/2\\1/2\end{pmatrix}.

For b=2b=2, it returns (1,1)(1,1). Every exact solution is (1+t,1−t)(1+t,1-t), with squared length 2+2t22+2t^2. The pseudoinverse selects the unique shortest one.

Truncated SVD gives the best low-rank approximation

Write SVD as an outer-product sum:

A=∑i=1rσiuiviT.A=\sum_{i=1}^r\sigma_i\mathbf u_i\mathbf v_i^{\mathsf T}.

Keeping the first kk terms gives AkA_k. The Eckart–Young theorem states that AkA_k is a closest matrix of rank at most kk in the operator or Frobenius norm. The discarded singular values determine the error exactly.

Precise low-rank errors and PCA conventions

The operator two-norm is the largest output norm from a unit input. The Frobenius norm is the square root of the sum of squared entries. For 0≤k<r0\le k<r,

∥A−Ak∥2=σk+1,∥A−Ak∥F2=∑i>kσi2.\|A-A_k\|_2=\sigma_{k+1}, \qquad \|A-A_k\|_F^2=\sum_{i>k}\sigma_i^2.

For operator-norm optimality, any rank-at-most-kk matrix BB has a unit null vector z\mathbf z in the span of the first k+1k+1 right singular vectors. Therefore ∥(A−B)z∥=∥Az∥≥σk+1\|(A-B)\mathbf z\|=\|A\mathbf z\|\ge\sigma_{k+1}. Truncation attains this lower bound.

To verify the error formulas, write a unit input in the right singular basis. The squared output under A−AkA-A_k is ∑i>kσi2yi2≤σk+12\sum_{i>k}\sigma_i^2 y_i^2\le\sigma_{k+1}^2, attained at vk+1\mathbf v_{k+1}. For the Frobenius norm, orthogonal left multiplication preserves each column length, and orthogonal right multiplication preserves each row length. Thus it preserves the sum of squared entries, reducing the computation to the discarded diagonal entries of Σ\Sigma.

Proof of Frobenius-norm low-rank optimality

Let WW be the column space of BB, of dimension at most kk, and let PP be its orthogonal projector. Apply Pythagoras column by column:

∥A−B∥F2=∥(I−P)A∥F2+∥PA−B∥F2≥∥A∥F2−∥PA∥F2.\|A-B\|_F^2 =\|(I-P)A\|_F^2+\|PA-B\|_F^2 \ge\|A\|_F^2-\|PA\|_F^2.

For a full left singular basis, set αi=∥Pui∥2\alpha_i=\|P\mathbf u_i\|^2. Then 0≤αi≤10\le\alpha_i\le1 and ∑iαi=dim⁡W≤k\sum_i\alpha_i=\dim W\le k: expand PP using an orthonormal basis of WW and sum over the complete basis. Orthogonality in the outer-product expansion gives

∥PA∥F2=∑i=1rσi2αi≤∑i=1kσi2.\|PA\|_F^2=\sum_{i=1}^r\sigma_i^2\alpha_i \le\sum_{i=1}^k\sigma_i^2.

The inequality assigns at most kk units of weight to the largest coefficients. Moving weight from a smaller coefficient to an unfilled larger one never decreases the sum. Thus every BB has squared error at least ∑i>kσi2\sum_{i>k}\sigma_i^2, attained by truncated SVD. For k≥rk\ge r, taking B=AB=A gives zero error.

PCA also requires a centering decision

Place mean-centered samples in a data matrix. Right singular vectors give principal directions, and squared singular values are proportional to variance along them. The existing expectation and variance chapter supplies the probabilistic language. If feature units differ greatly, one must also decide whether to standardize, since raw scale can dominate the components.

For PCA, explicitly put N>1N>1 samples in rows of centered X∈RN×dX\in\mathbb R^{N\times d}. The sample covariance is

C=XTXN−1=VΣTΣN−1VT.C=\frac{X^{\mathsf T}X}{N-1} =V\frac{\Sigma^{\mathsf T}\Sigma}{N-1}V^{\mathsf T}.

Principal directions are right singular vectors and their variances are σi2/(N−1)\sigma_i^2/(N-1). Putting samples in columns exchanges the roles of left and right singular vectors.

For a unit feature direction v\mathbf v, the projected sample column is XvX\mathbf v, with mean zero and sample variance ∥Xv∥2/(N−1)=vTCv\|X\mathbf v\|^2/(N-1)=\mathbf v^{\mathsf T}C\mathbf v. The Rayleigh bound therefore proves maximal variance at the top right singular vector. Restricting to its orthogonal complement and repeating proves the successive principal directions; tied eigenvalues allow any orthonormal basis within the tied eigenspace.

Exercises

ExerciseA rank-one matrix

Explain why A=(1224)A=\begin{pmatrix}1&2\\2&4\end{pmatrix} has exactly one positive singular value.

Solution

The second column is twice the first, so the rank is one. The number of positive singular values equals the rank.

ExercisePseudoinverse of an invertible matrix

Use SVD to show that A+=A−1A^+=A^{-1} when AA is invertible.

Solution

All singular values are positive, so A+=VΣ−1UT=(UΣVT)−1A^+=V\Sigma^{-1}U^{\mathsf T}=(U\Sigma V^{\mathsf T})^{-1}.

ExerciseError after truncation

If the singular values are 5,2,0.15,2,0.1, what is the operator-norm error of the best rank-one approximation?

Solution

The error is the first discarded singular value, which is 22.