The spectral theorem diagonalizes symmetric matrices with orthonormal eigenvectors. The singular value decomposition does something like it for every matrix, square or not: it finds orthonormal input directions that $A$ sends to orthogonal output directions.
Key idea
Why it works
Worked example: An SVD by hand
- $A^{T}A = \begin{bmatrix} 25 & 20 \\ 20 & 25 \end{bmatrix}$: trace $50$, determinant $625 - 400 = 225$, so $\lambda^{2} - 50\lambda + 225 = (\lambda - 45)(\lambda - 5)$.
- $\sigma_1 = \sqrt{45} = 3\sqrt{5}$ and $\sigma_2 = \sqrt{5}$. Check: $\sigma_1\sigma_2 = 15 = |\det A|$.
- Eigenvectors of $A^{T}A$: $\mathbf{v}_1 = \frac{1}{\sqrt{2}}(1, 1)$ for $45$ and $\mathbf{v}_2 = \frac{1}{\sqrt{2}}(-1, 1)$ for $5$.
- $A\mathbf{v}_1 = \frac{1}{\sqrt{2}}(3, 9)$, so $\mathbf{u}_1$ $= \dfrac{A\mathbf{v}_1}{3\sqrt{5}}$ $= \frac{1}{\sqrt{10}}(1, 3)$. $A\mathbf{v}_2 = \frac{1}{\sqrt{2}}(-3, 1)$, so $\mathbf{u}_2 = \frac{1}{\sqrt{10}}(-3, 1)$.
- $U = \frac{1}{\sqrt{10}}\begin{bmatrix} 1 & -3 \\ 3 & 1 \end{bmatrix}$, $\Sigma = \begin{bmatrix} 3\sqrt{5} & 0 \\ 0 & \sqrt{5} \end{bmatrix}$, $V = \frac{1}{\sqrt{2}}\begin{bmatrix} 1 & -1 \\ 1 & 1 \end{bmatrix}$.
Answer: $\sigma_1 = 3\sqrt{5}$, $\sigma_2 = \sqrt{5}$
What the SVD tells you at a glance: $\operatorname{rank} A$ is the number of nonzero singular values; $\mathbf{u}_1, \dots, \mathbf{u}_r$ are an orthonormal basis of $\operatorname{Col} A$ and $\mathbf{v}_{r+1}, \dots, \mathbf{v}_n$ of $\operatorname{Nul} A$; and $\sigma_1$ is the largest stretch, $\max \lVert A\mathbf{x}\rVert$ over unit vectors $\mathbf{x}$.
Worked example: Eigenvalues are not singular values
- $A^{T}A = \begin{bmatrix} 1 & 2 \\ 2 & 5 \end{bmatrix}$, with $\lambda^{2} - 6\lambda + 1 = 0$, so $\lambda = 3 \pm 2\sqrt{2}$.
- $3 + 2\sqrt{2} = (1 + \sqrt{2})^{2}$, so $\sigma_1 = 1 + \sqrt{2} \approx 2.414$ and $\sigma_2 = \sqrt{2} - 1 \approx 0.414$.
- This shear stretches some vectors by $2.4$ and shrinks others to $0.4$ of their length, even though both eigenvalues are $1$.
Answer: $1 + \sqrt{2}$ and $\sqrt{2} - 1$
Common mistake