NLA-lib Explorer

Singular values

Singular values describe how a matrix stretches vectors. They organize rank, conditioning, and low-rank approximation without requiring the matrix to be square or Hermitian.

Definition (Singular values). The singular values of \mathbf{A} are the nonnegative square roots of the eigenvalues of \mathbf{A}^{\mathsf{H}}\mathbf{A}, listed in decreasing order and with the appropriate zero padding. Equivalently, they are the diagonal values in a singular-value decomposition. A positive singular value represents an active direction; small singular values identify directions sensitive to perturbation or truncation.

Copy link

Background

Mathematical guarantees

Theorem (Perturbation of singular values). For matrices \mathbf{A},\mathbf{B} of the same shape and every singular-value index j,

|\sigma_j(\mathbf{A})-\sigma_j(\mathbf{B})|\le\|\mathbf{A}-\mathbf{B}\|_2.

A spectral-norm perturbation therefore bounds the change of each ordered singular value by the same amount.

Lean statement and details
NLAlib.abs_singularValues_sub_le_specNorm.{u_1, u_3, u_4} {𝕜 : Type u_1} [RCLike 𝕜] {m : Type u_3}
  {n : Type u_4} [Fintype m] [Fintype n] (A B : Matrix m n 𝕜) (k : ℕ) :
  |singularValues A k - singularValues B k| ≤ specNorm (A - B)

Full source on GitHub

Copy link

Further results

Theorem (The Frobenius norm of a deflation by top right singular vectors).

for an orthonormal frame \mathbf{W} \in \Bbbk^{n \times r} with \mathbf{A}^{\mathsf{H}}\mathbf{A}\mathbf{W} = \mathbf{W}\operatorname{diag}(\sigma_0(\mathbf{A})^2, \dots, \sigma_{r-1}(\mathbf{A})^2), \|\mathbf{A} - \mathbf{A}\mathbf{W}\mathbf{W}^{\mathsf{H}}\|_{\mathsf{F}}^2 = \|\mathbf{A} - \llbracket\mathbf{A}\rrbracket_r\|_{\mathsf{F}}^2\,, although \mathbf{A}\mathbf{W}\mathbf{W}^{\mathsf{H}} need not be \llbracket\mathbf{A}\rrbracket_r under ties. No printed source.

Lean statement and details
NLAlib.HasOrthonormalCols.frobNorm_sub_mul_mul_conjTranspose_sq_eq_truncatedSVD.{u_1, u_2, u_3}
  {𝕜 : Type u_1} [RCLike 𝕜] {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {r : ℕ}
  {A : Matrix m n 𝕜} {W : Matrix n (Fin r) 𝕜} (hW : HasOrthonormalCols W)
  (hAW : Aᴴ * A * W = W * diagonal fun i ↦ ↑(singularValues A ↑i ^ 2)) :
  frobNorm (A - A * W * Wᴴ) ^ 2 = frobNorm (A - truncatedSVD A r) ^ 2

Full source on GitHub

Copy link

Theorem (Interlacing under a low-rank perturbation, upper).

For Hermitian \mathbf{A}, \mathbf{B} with \operatorname{rank} \mathbf{B} \le r and k + r < \lvert n \rvert, \lambda_{k+r}(\mathbf{A} + \mathbf{B}) \le \lambda_k(\mathbf{A}). [HornJohnson2013, Corollary 4.3.5].

General form: sizes are index types

Lean statement and details
Matrix.IsHermitian.eigenvalue_add_le_of_rank_le.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2}
  [Fintype n] {A B : Matrix n n 𝕜} (hA : A.IsHermitian) (hB : B.IsHermitian) {r : ℕ}
  (hr : B.rank ≤ r) {k : ℕ} (hk : k + r < Fintype.card n) :
  eigenvalue (A + B) (k + r) ≤ eigenvalue A k

Full source on GitHub

Copy link

Theorem (Interlacing for deleted columns).

If the injective c : p \to n selects \lvert p \rvert of the \lvert p \rvert + d columns of \mathbf{A}, then \sigma_{k+d}(\mathbf{A}) \le \sigma_k(\mathbf{A}') for every k, where \mathbf{A}' is A.submatrix id c. [HornJohnson1991, Corollary 3.1.3].

General form: sizes are index types

Lean statement and details
NLAlib.singularValues_le_singularValues_submatrix_cols.{u_1, u_3, u_4, u_5} {𝕜 : Type u_1}
  [RCLike 𝕜] {m : Type u_3} {n : Type u_4} {p : Type u_5} [Fintype m] [Fintype n] [Fintype p]
  (A : Matrix m n 𝕜) {c : p → n} (hc : Function.Injective c) {d : ℕ}
  (hd : Fintype.card p + d = Fintype.card n) (k : ℕ) :
  singularValues A (k + d) ≤ singularValues (A.submatrix id c) k

Full source on GitHub

Copy link

Theorem (Existence of the singular value decomposition).

For every k between the rank of \mathbf{A} and its smaller dimension, \mathbf{A} = \mathbf{U} \operatorname{diag}\bigl(\sigma_0(\mathbf{A}), \dots, \sigma_{k-1}(\mathbf{A})\bigr) \mathbf{V}^{\mathsf{H}} with \mathbf{U}, \mathbf{V} having k orthonormal columns. With k = \operatorname{rank} \mathbf{A} this is the compact SVD and with k = \min(\lvert m \rvert, \lvert n \rvert) the thin SVD. [HornJohnson2013, Theorem 2.6.3]; [GolubVanLoan2013, Theorem 2.4.1].

General form: sizes are index types

Lean statement and details
NLAlib.exists_isSVD.{u_1, u_3, u_4} {𝕜 : Type u_1} [RCLike 𝕜] {m : Type u_3} {n : Type u_4}
  [Fintype m] [Fintype n] (A : Matrix m n 𝕜) {k : ℕ} (hk : A.rank ≤ k) (hkm : k ≤ Fintype.card m)
  (hkn : k ≤ Fintype.card n) : ∃ U V, IsSVD A U (fun i ↦ singularValues A ↑i) V

Full source on GitHub

Copy link

Theorem (Uniqueness of the singular values).

In an SVD with columns indexed by Fin k and \boldsymbol{\sigma} non-increasing, \boldsymbol{\sigma} is the sequence of singular values: \sigma_i(\mathbf{A}) = \boldsymbol{\sigma}_i for i < k.

Lean statement and details
NLAlib.IsSVD.singularValues_eq.{u_1, u_3, u_4} {𝕜 : Type u_1} [RCLike 𝕜] {m : Type u_3}
  {n : Type u_4} [Fintype m] [Fintype n] {A : Matrix m n 𝕜} {k : ℕ} {U : Matrix m (Fin k) 𝕜}
  {σ : Fin k → ℝ} {V : Matrix n (Fin k) 𝕜} (h : IsSVD A U σ V) (hσ : Antitone σ) (i : Fin k) :
  singularValues A ↑i = σ i

Full source on GitHub

Copy link

Theorem (Singular values of a product).

\sigma_{i+j}(\mathbf{A}\mathbf{B}) \le \sigma_i(\mathbf{A}) \, \sigma_j(\mathbf{B}) for all indices from 0. [HornJohnson1991, Theorem 3.3.16].

Lean statement and details
NLAlib.singularValues_mul_add_le.{u_1, u_3, u_4, u_5} {𝕜 : Type u_1} [RCLike 𝕜] {m : Type u_3}
  {n : Type u_4} {p : Type u_5} [Fintype m] [Fintype n] [Fintype p] (A : Matrix m p 𝕜)
  (B : Matrix p n 𝕜) (i j : ℕ) :
  singularValues (A * B) (i + j) ≤ singularValues A i * singularValues B j

Full source on GitHub

Copy link

Formal definitions

Used by algorithms

Broader topics