Finishing the SVD Derivation, and Truncation
Math 123: Mathematical Aspects of Data Analysis – Fall 2026
Cleaning up the SVD
Last time we set up the derivation of the singular value decomposition and stated, without proof, the lemma building the left singular vectors from the right ones. See the last set of lecture notes for the setup. Throughout, \(\bfA\in\Rbb^{m\times n}\) has rank \(r\), \(p=\min\{m,n\}\), and \(\bfv_1,\ldots,\bfv_n\) are the eigenvectors of \(\bfA^\top\bfA\) from the spectral theorem, with corresponding singular values \(\sigma_1\geq\cdots\geq\sigma_r>0=\sigma_{r+1}=\cdots=\sigma_p\) (singular values).
Proof. For \(i,j\leq r\), using \(\bfA^\top\bfA\bfv_j=\sigma_j^2\bfv_j\), \[ \bfu_i^\top\bfu_j =\frac{\bfv_i^\top\bfA^\top\bfA\bfv_j}{\sigma_i\sigma_j} =\frac{\sigma_j^2}{\sigma_i\sigma_j}\,\bfv_i^\top\bfv_j =\begin{cases} 1, & i=j,\\ 0, & i\neq j, \end{cases} \] since the \(\bfv_i\) are orthonormal. This proves 1.
The first identity in 2 is the definition of \(\bfu_i\). For the second, \[ \bfA^\top\bfu_i =\frac{\bfA^\top\bfA\bfv_i}{\sigma_i} =\frac{\sigma_i^2\bfv_i}{\sigma_i} =\sigma_i\bfv_i. \]
For 3, the computation above gives \(\|\bfA\bfv_i\|_2^2=\lambda_i=0\) when \(i>r\).
For 4, apply 2 twice: \(\bfA\bfA^\top\bfu_i=\bfA(\sigma_i\bfv_i)=\sigma_i\bfA\bfv_i=\sigma_i^2\bfu_i\).
Proof. Since \(\bfv_1,\ldots,\bfv_n\) is a basis, there are scalars \(c_1,\ldots,c_n\) with \(\bfx=\sum_{i=1}^n c_i\bfv_i\). For each \(j=1,\ldots,n\), multiply on the left by \(\bfv_j^\top\) and use orthonormality: \[ \bfv_j^\top\bfx =\sum_{i=1}^n c_i\,\bfv_j^\top\bfv_i =c_j, \] since \(\bfv_j^\top\bfv_i=0\) for \(i\neq j\) and \(\bfv_j^\top\bfv_j=1\).
Proof. Take \(\bfv_1,\ldots,\bfv_n\) and \(\sigma_1,\ldots,\sigma_r\) from the setup above, and \(\bfu_1,\ldots,\bfu_r\) from Lemma 1. Since \(\bfv_1,\ldots,\bfv_n\) is an orthonormal basis of \(\Rbb^n\), every \(\bfx\in\Rbb^n\) can be written \(\bfx=\sum_{i=1}^n c_i\bfv_i\) with \(c_i=\bfv_i^\top\bfx\) (Lemma 2). Then \[ \bfA\bfx =\sum_{i=1}^n c_i\bfA\bfv_i =\sum_{i=1}^r c_i\bfA\bfv_i =\sum_{i=1}^r \sigma_i c_i\bfu_i =\left(\sum_{i=1}^r\sigma_i\bfu_i\bfv_i^\top\right)\bfx, \] using \(\bfA\bfv_i=\mathbf{0}\) for \(i>r\) and \(\bfA\bfv_i=\sigma_i\bfu_i\) for \(i\leq r\) (Lemma 1). Since this holds for every \(\bfx\in\Rbb^n\), \[ \bfA=\sum_{i=1}^r\sigma_i\bfu_i\bfv_i^\top =\bfU_r\Sigma_r\bfV_r^\top. \]
This is exactly the decomposition the greyscale image example asked for. Each term \(\sigma_i\bfu_i\bfv_i^\top\) is a rank-one image: \(\bfu_i\) is a unit-length column profile, \(\bfv_i\) is a unit-length row profile, and \(\sigma_i\) says how much that piece contributes; as a linear map, \(\bfu_i\bfv_i^\top\bfx=(\bfv_i^\top\bfx)\bfu_i\).
Reading Theorem 1 (or Lemma 1) shows that singular vectors come in matched pairs: \[ \bfA\bfv_i=\sigma_i\bfu_i, \qquad \bfA^\top\bfu_i=\sigma_i\bfv_i, \qquad 1\leq i\leq r. \]
The matrices \(\bfU_r\) and \(\bfV_r\) above are rectangular (unless \(m=n=r\)), so Theorem 1 is often called the compact or rank-\(r\) SVD. It is all we will ever need, but it is worth knowing that a version with square orthogonal matrices also exists, since that version is sometimes more convenient to reason with (e.g. for orthogonality arguments).
For a data matrix with \(n=10^6\) observations and \(d=10^4\) features, the full \(\bfU\) is \(10^6\times10^6\) and the full \(\bfV\) is \(10^4\times10^4\), while the compact \(\bfU_r,\bfV_r\) have only \(r\leq10^4\) columns each. This is why, from here on, we work directly with the compact SVD \(\bfU_r\Sigma_r\bfV_r^\top\).
Proof. Substitute: \(\bfA^\top\bfA=\bfV_r\Sigma_r^\top\bfU_r^\top\bfU_r\Sigma_r\bfV_r^\top=\bfV_r\Sigma_r^2\bfV_r^\top\), using \(\bfU_r^\top\bfU_r=\bfI_r\); the computation for \(\bfA\bfA^\top\) is identical, using \(\bfV_r^\top\bfV_r=\bfI_r\). Since \(\bfU_r\) has orthonormal columns and \(\Sigma_r^2\) is an invertible \(r\times r\) diagonal matrix, \(\bfA\bfA^\top=\bfU_r\Sigma_r^2\bfU_r^\top\) has rank \(r\), so it has exactly \(r\) nonzero eigenvalues, namely \(\sigma_1^2,\ldots,\sigma_r^2\) with eigenvectors \(\bfu_1,\ldots,\bfu_r\); every other eigenvalue of \(\bfA\bfA^\top\) is zero. The same argument applies to \(\bfA^\top\bfA=\bfV_r\Sigma_r^2\bfV_r^\top\).
Replacing \((\bfu_1,\bfv_1)\) by \((-\bfu_1,-\bfv_1)\) gives the same term \(\sigma_1\bfu_1\bfv_1^\top\), so singular vectors are at best determined up to sign. When an eigenvalue of \(\bfA^\top\bfA\) is repeated (like the zero eigenvalue above, with eigenspace spanned by the vectors orthogonal to \(\bfw\)), any orthonormal basis of the corresponding eigenspace works, though only eigenvectors with \(\sigma_i>0\) ever become singular vectors of \(\bfA\) (Definition 1). What is determined is the list of singular values and the subspaces.
This is also why the proof of Theorem 1 built \(\bfu_i\) from \(\bfv_i\) instead of eigendecomposing \(\bfA\bfA^\top\) separately: independently chosen unit eigenvectors of \(\bfA^\top\bfA\) and \(\bfA\bfA^\top\) need not satisfy \(\bfA\bfv_i=\sigma_i\bfu_i\) (flip the sign of just one of them).
Truncating & Low Rank Approximation
Since the singular values are sorted, the natural way to approximate \(\bfA\) is to keep only the first few terms of the rank-one sum.
Storing \(\bfA_k\) requires \(k(m+n+1)\) numbers instead of \(mn\). For a photograph, the singular values typically decay quickly: a few are large and most are small. Then \(\bfA_k\) with modest \(k\) keeps the large terms and throws away the small ones, which is the idea behind SVD-based image compression.
This answers question 1 from the start of lecture, and raises question 2 again in sharper form: is \(\bfA_k\) the best rank-\(k\) approximation of \(\bfA\), and how large is the error? The answer is the Eckart–Young theorem: the error is controlled exactly by the discarded singular values \(\sigma_{k+1},\sigma_{k+2},\ldots\).
To say that \(\bfA_k\) is best, we first need a way to measure the size of the error matrix \(\bfA-\bfB\). Two norms are standard. The first ignores that a matrix is a linear map and simply treats it as a long vector of entries.
That is, \(\|\bfM\|_F\) is the Euclidean norm of \(\bfM\) reshaped into a vector in \(\Rbb^{mn}\). For an image, \(\|\bfA-\bfB\|_F^2\) is the total squared pixel error. The second norm instead measures what \(\bfM\) does to vectors.
The spectral norm is the largest factor by which \(\bfM\) can stretch a vector. Equivalently, it is the smallest constant \(C\) with \[ \|\bfM\bfx\|_2\leq C\|\bfx\|_2 \qquad\text{for all }\bfx\in\Rbb^n. \] Some intuition on the idea is in the setting of worst case error. If \(\|\bfA-\bfB\|_2\leq\varepsilon\), then \(\|\bfA\bfx-\bfB\bfx\|_2\leq\varepsilon\|\bfx\|_2\) for every input \(\bfx\). A small spectral error is a uniform guarantee that \(\bfB\) acts like \(\bfA\), whereas a small Frobenius error only says the entries are close on average.
The two norms can differ considerably: \(\|\bfI_n\|_2=1\), while \(\|\bfI_n\|_F=\sqrt{n}\). In general \(\|\bfM\|_2\leq\|\bfM\|_F\leq\sqrt{\operatorname{rank}(\bfM)}\,\|\bfM\|_2\).
The same truncation is also optimal in the Frobenius norm.
So the singular values are key components in both building the approximation and in reporting its error. A quickly decaying sequence \(\sigma_1,\sigma_2,\ldots\) means a small \(k\) already captures almost all of \(\bfA\).