Singular Value Decomposition
Statement
Let be an real matrix. Then there exist orthogonal matrices , and a rectangular diagonal matrix with non-negative diagonal entries (the singular values of ) such that
The singular values are the square roots of the eigenvalues of the symmetric positive semidefinite matrix .
Visualization
Let .
Step 1 — form (symmetric):
Step 2 — eigenvalues of : Characteristic polynomial or .
| eigenvector (normalized) | ||
|---|---|---|
| 16 | ||
| 4 |
Step 3 — result:
(Here is symmetric positive definite, so .)
Proof Sketch
- Spectral theorem on . The matrix is symmetric and positive semidefinite, so the Spectral TheoremSpectral TheoremEvery real symmetric matrix is orthogonally diagonalizableRead more → applies: with orthogonal and .
- Define from . Set for . These vectors are orthonormal: .
- Complete to orthonormal basis. Extend to a full orthonormal basis of . The extra columns of correspond to the null space of .
- Verify factorization. Compute column by column: , so on all of .
Connections
SVD rests on the Spectral TheoremSpectral TheoremEvery real symmetric matrix is orthogonally diagonalizableRead more → applied to and generalizes it to non-square matrices. The orthonormal bases produced are the output of Gram–Schmidt OrthogonalizationGram–Schmidt OrthogonalizationAny linearly independent sequence can be transformed into an orthogonal sequence spanning the same subspace.Read more →. The diagonal relates directly to the Rank–Nullity TheoremRank–Nullity TheoremThe dimensions of image and kernel of a linear map sum to the domain dimensionRead more →: number of nonzero singular values.
Lean4 Proof
-- Mathlib has IsHermitian.eigenvalues for real symmetric matrices (spectral theorem).
-- We prove the key ingredient: A^T A is positive semidefinite, so its eigenvalues are nonneg.
-- Mathlib: Analysis.Matrix.PosDef -- eigenvalues_nonneg
open Matrix in
theorem AtA_posSemidef (m n : Type*) [Fintype m] [Fintype n] [DecidableEq m]
(A : Matrix m n ℝ) : (A.transpose * A).PosSemidef := by
constructor
· exact isHermitian_transpose_mul_self A
· intro x
have : 0 ≤ ‖A.mulVec x‖ ^ 2 := sq_nonneg _
rwa [← inner_self_eq_norm_sq, ← Matrix.inner_mul_transpose_apply,
Matrix.mul_assoc] at this
rfl
-- Consequence: singular values (sqrt of eigenvalues of A^T A) are nonneg.
open Matrix in
theorem singular_values_nonneg (n : Type*) [Fintype n] [DecidableEq n]
(A : Matrix n n ℝ) :
let hH := isHermitian_transpose_mul_self A
∀ i, 0 ≤ hH.eigenvalues i :=
fun i => eigenvalues_nonneg (AtA_posSemidef n n A) i