NLA-lib Explorer

NLAlib.truncatedSVD_def

Library · theorem

The truncated SVD is the chosen SVD with the singular values \sigma_i(\mathbf{A}), i \ge k, set to zero: \llbracket\mathbf{A}\rrbracket_k = \mathsf{svdU}(\mathbf{A})\, \operatorname{diag}\bigl(\sigma_0(\mathbf{A}), \dots, \sigma_{k-1}(\mathbf{A}), 0, \dots, 0\bigr)\, \mathsf{svdV}(\mathbf{A})^{\mathsf{H}}\,.

NLAlib.truncatedSVD_def.{u_1, u_2, u_3} {𝕜 : Type u_1} [RCLike 𝕜] {m : Type u_2} {n : Type u_3}
  [Fintype m] [Fintype n] (A : Matrix m n 𝕜) (k : ℕ) :
  truncatedSVD A k =
    (svdU A * diagonal fun i ↦ if ↑i < k then ↑(singularValues A ↑i) else 0) * (svdV A)ᴴ

Full source on GitHub

Import NLAlib.Matrix.Spectral.LowRank.