Theorem (exists_isSVD). 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].
Headline 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