Theorem (Matrix.IsHermitian.lanczosFA_inv_eq_cgIterate).CG is Lanczos-FA for the inverse, for every Hermitian \mathbf{A}: \mathsf{lanczosFA}(\mathbf{A}, \mathbf{x} \mapsto \mathbf{x}^{-1}, \mathbf{b}, q) = \mathsf{cgIterate}(\mathbf{A}, \mathbf{b}, \mathbf{0}, q) (CG from the zero start), with Lean's 0^{-1} = 0 matching the pseudoinverse junk value of galerkinInverse. [ChenPersson2026, §1.1]; [Saad2003, §6.7].
Headline
Lean statement and details
Matrix.IsHermitian.lanczosFA_inv_eq_cgIterate.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜] {n : Type u_2}
[Fintype n] [DecidableEq n] {A : Matrix n n 𝕜} (hA : A.IsHermitian) (b : n → 𝕜) (q : ℕ) :
lanczosFA A (fun x ↦ x⁻¹) b q = cgIterate A b 0 q
Theorem (Matrix.IsHermitian.compressedCfc_inv_eq_galerkinInverse).The compressed inverse is the Galerkin inverse, for Hermitian \mathbf{A}: \mathsf{compressedCfc}(\mathbf{A}, \mathbf{x} \mapsto \mathbf{x}^{-1}, \mathbf{X}) = \mathsf{galerkinInverse}(\mathbf{A}, \mathbf{X}), through Matrix.IsHermitian.cfc_inv_eq_pinv on the compression to an orthonormal basis. No printed source: a bridge between two of the library's definitions.
Lean statement and details
Matrix.IsHermitian.compressedCfc_inv_eq_galerkinInverse.{u_1, u_2, u_3} {𝕜 : Type u_1} [RCLike 𝕜]
{n : Type u_2} {p : Type u_3} [Fintype n] [DecidableEq n] [Fintype p] {A : Matrix n n 𝕜}
(hA : A.IsHermitian) (X : Matrix n p 𝕜) : compressedCfc A (fun x ↦ x⁻¹) X = galerkinInverse A X
Theorem (Matrix.IsHermitian.lanczosFA_inv_add_eq_cgIterate).Shifted CG is Lanczos-FA for a shifted inverse, for Hermitian \mathbf{A} and real s: \mathsf{lanczosFA}(\mathbf{A}, \mathbf{x} \mapsto (\mathbf{x} + s)^{-1}, \mathbf{b}, q) = \mathsf{cgIterate}(\mathbf{A} + s\mathbf{I}, \mathbf{b}, \mathbf{0}, q), by shift invariance of the Krylov space (krylovSpace_add_smul_one) and the frame forms. [Saad2003, §6.7.1]; (6.86) there writes the CG iterate as \mathbf{x}_0 + \mathbf{V}_m\mathbf{T}_m^{-1}(\beta\mathbf{e}_1) with the Lanczos basis \mathbf{V}_m, \beta = \|\mathbf{r}_0\|, which at \mathbf{x}_0 = \mathbf{0} is the Lanczos-FA approximation for f(\mathbf{x}) = \mathbf{x}^{-1}; the shift s and the singular case are the library's.
Lean statement and details
Matrix.IsHermitian.lanczosFA_inv_add_eq_cgIterate.{u_1, u_2} {𝕜 : Type u_1} [RCLike 𝕜]
{n : Type u_2} [Fintype n] [DecidableEq n] {A : Matrix n n 𝕜} (hA : A.IsHermitian) (s : ℝ)
(b : n → 𝕜) (q : ℕ) : lanczosFA A (fun x ↦ (x + s)⁻¹) b q = cgIterate (A + s • 1) b 0 q