← Module 04 / SVD & matrix tools

Lesson 04.4 · §3.15

How much can you discard?

Use truncated SVD and prove its spectral-norm optimality.

In this lesson 5 ideas
  1. Keep the largest effects
  2. Source proof for the spectral norm
  3. Energy, error, and storage
  4. Transfer
  5. Explore the relationship

Source scope: §3.15, PDF pages 24, 25. Numerical examples, experiments, added derivations, and practice are teaching supplements unless identified as source results.

Keep the largest effects

Suppose a matrix has singular values 4,2,14,2,1. Keeping only the first term gives a rank-one approximation. Its largest omitted stretch is 22; its squared Frobenius error is 22+12=52^2+1^2=5. Keeping the second term reduces those errors to 11 and 11.

Theorem 5 (Eckart–Young–Mirsky). Let ∥⋅∥\|\cdot\| be a unitarily invariant matrix norm. Suppose A∈Rm×nA\in\mathbb R^{m\times n} with m≥nm\ge n has SVD A=∑i=1nσiuiviTA=\sum_{i=1}^n\sigma_i u_iv_i^T. For an integer 0≤k≤rank⁡(A)0\le k\le\operatorname{rank}(A), define

Ak=∑i=1kσiuiviT.A_k=\sum_{i=1}^k\sigma_i u_iv_i^T.

Then ∥A−Ak∥≤∥A−A~∥\|A-A_k\|\le\|A-\widetilde A\| for every m×nm\times n matrix A~\widetilde A with rank at most kk. “Best rank-kk” means an allowed rank of at most kk, not a claim of uniqueness. Repeated singular values can yield multiple best approximations. The source omits the general proof and proves only the spectral-norm case. For m<nm<n, apply the result to ATA^T and transpose back (teaching extension).

Source proof for the spectral norm

For k<nk<n, the omitted SVD terms give

∥A−Ak∥2=∥∑i=k+1nσiuiviT∥2=σk+1.\|A-A_k\|_2=\left\|\sum_{i=k+1}^n\sigma_i u_iv_i^T\right\|_2=\sigma_{k+1}.

Let rank⁡(A~)≤k\operatorname{rank}(\widetilde A)\le k. Rank–nullity gives dim⁡null⁡(A~)≥n−k\dim\operatorname{null}(\widetilde A)\ge n-k. The space S=span⁡(v1,…,vk+1)S=\operatorname{span}(v_1,\ldots,v_{k+1}) has dimension k+1k+1. Their dimensions sum to at least n+1n+1, so their intersection cannot be zero in Rn\mathbb R^n. Choose a unit vector zz in that intersection. Write z=∑i=1k+1αiviz=\sum_{i=1}^{k+1}\alpha_i v_i; orthonormality gives ∑iαi2=1\sum_i\alpha_i^2=1.

Since A~z=0\widetilde Az=0 and viTz=αiv_i^Tz=\alpha_i for i≤k+1i\le k+1, we get

∥A−A~∥2≥∥(A−A~)z∥2=∥Az∥2=∥∑i=1k+1σiαiui∥2=∑i=1k+1σi2αi2≥σk+1∑i=1k+1αi2=σk+1=∥A−Ak∥2.\begin{aligned} \|A-\widetilde A\|_2 &\ge\|(A-\widetilde A)z\|_2=\|Az\|_2\\ &=\left\|\sum_{i=1}^{k+1}\sigma_i\alpha_i u_i\right\|_2\\ &=\sqrt{\sum_{i=1}^{k+1}\sigma_i^2\alpha_i^2} \ge\sigma_{k+1}\sqrt{\sum_{i=1}^{k+1}\alpha_i^2} =\sigma_{k+1}=\|A-A_k\|_2. \end{aligned}

The first inequality tests one unit input in a maximum over all inputs. Pythagoras gives the next square root; ordering the singular values gives the lower bound. This completes the proof. At k=nk=n the intersection argument is unnecessary: Ak=AA_k=A and its error is zero. This boundary clarification avoids referring to a nonexistent vn+1v_{n+1}.

Energy, error, and storage

The source measures retained squared Frobenius energy by

∥Ak∥F2∥A∥F2=σ12+⋯+σk2σ12+⋯+σr2.\frac{\|A_k\|_F^2}{\|A\|_F^2} =\frac{\sigma_1^2+\cdots+\sigma_k^2}{\sigma_1^2+\cdots+\sigma_r^2}.

For 4,2,14,2,1, rank one retains 16/2116/21, while rank two retains 20/2120/21. For the zero matrix this ratio is 0/00/0 and is undefined; its reconstruction error is still zero.

Teaching supplement. Storing UkU_k, the kk singular values, and VkV_k uses k(m+n+1)k(m+n+1) scalar entries instead of mnmn. Small matrices may take more storage in factor form. The experiment reconstructs an original synthetic grayscale image with a known SVD; its cells are matrix entries, not samples from an external photograph. Squared Frobenius error equals omitted energy, while spectral error is the largest omitted singular value. High energy retention does not guarantee that every visually important feature survives.

Transfer

For singular values 5,5,05,5,0, rank one retains half the energy and has spectral error 55. The repeated leading values explain why selecting a particular first singular direction need not give the only optimum.

Explore the relationship

Explore it yourself

Reconstruct a small image

Predict whether the next singular value improves energy, worst-direction error, and storage by the same amount.

Preparing interactive controls…

Original 8 × 8 matrix
Rank-1 reconstruction

Singular values: 4, 1.2, 0.6, 0.25. Retained energy = 89.5731%.

Spectral error = 1.2; Frobenius error = 1.3647. Factor storage = 17 scalars; full matrix = 64 scalars.

Each pixel is one entry. The constant grayscale component is the first singular term; later cosine patterns add detail. The image has rank four, so k = 4 is exact. Factor storage can exceed full storage on this small example.