NLA-lib Explorer

Lanczos quadrature is the Gauss rule of the spectral measure

Library Β· Result group

Theorem (Matrix.IsHermitian.lanczosQuadrature_eq_gaussQuadrature). Lanczos quadrature is the Gauss rule of the spectral measure: for Hermitian \mathbf{A} and every q, \mathsf{lanczosQuadrature}(\mathbf{A}, \mathbf{b}, q) is the q-point Gauss rule of \mu_{\mathbf{A},\mathbf{b}}, for every RCLike field (complex Hermitian included). [GolubMeurant2010, Ch. 6].

Headline (provisional)

Lean statement and details
Matrix.IsHermitian.lanczosQuadrature_eq_gaussQuadrature.{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 : β„•) : lanczosQuadrature A b q = gaussQuadrature (spectralMeasure A b) q

Full source on GitHub

Copy link

Other forms

Theorem (Matrix.IsHermitian.lanczosQuadrature_succ_eq_sum). Golub–Welsch: for Hermitian \mathbf{A}, every q, and a unitary diagonalisation \mathbf{T} = \mathbf{U}\operatorname{diag}(\mathbf{d})\mathbf{U}^{\mathsf{H}} of the tridiagonal matrix of q + 1 steps of the Lanczos recurrence, \mathsf{lanczosQuadrature}(\mathbf{A}, \mathbf{b}, q + 1) = \sum_i \|\mathbf{b}\|^2\lvert\mathbf{U}_{0,i}\rvert^2\,\delta_{\mathbf{d}_i}\,: the nodes are the eigenvalues of \mathbf{T}, the weights the squared first entries of its eigenvectors. [GolubMeurant2010, Ch. 6] (locator to check).

Lean statement and details
Matrix.IsHermitian.lanczosQuadrature_succ_eq_sum.{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 : β„•)
  {U : Matrix (Fin (q + 1)) (Fin (q + 1)) π•œ} (hU : HasOrthonormalCols U) {d : Fin (q + 1) β†’ ℝ}
  (hT : lanczosTridiagonal A b (q + 1) = (U * diagonal fun i ↦ ↑(d i)) * Uα΄΄) :
  lanczosQuadrature A b (q + 1) =
    βˆ‘ i, ENNReal.ofReal (β€–WithLp.toLp 2 bβ€– ^ 2 * β€–U 0 iβ€– ^ 2) β€’ Measure.dirac (d i)

Full source on GitHub

Copy link

Theorem (Matrix.IsHermitian.matchesMoments_lanczosQuadrature). Lanczos quadrature matches the first 2q moments of the spectral measure: for Hermitian \mathbf{A}, every \mathbf{b} and every q, \int p\,d\mu_{\mathbf{A},\mathbf{b}} = \int p\,d\,\mathsf{lanczosQuadrature}(\mathbf{A}, \mathbf{b}, q) for every real polynomial p of degree less than 2q. [GolubMeurant2010, Ch. 6]. Chen, Trogdon and Ubaru (2022) start their spectrum-approximation bounds from this form; locator to check.

Lean statement and details
Matrix.IsHermitian.matchesMoments_lanczosQuadrature.{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 : β„•) : MatchesMoments (spectralMeasure A b) (lanczosQuadrature A b q) (2 * q)

Full source on GitHub

Copy link

Theorem (Matrix.IsHermitian.norm_star_dotProduct_cfc_mulVec_sub_lanczosFA_le_of_continuousOn). Lanczos quadrature and the minimax error: for Hermitian \mathbf{A} with spectrum in [a, a'] and f continuous on [a, a'], q + 1 Lanczos steps give \bigl\lvert\mathbf{b}^{\mathsf{H}}\bigl(f(\mathbf{A})\mathbf{b} - \mathsf{lanczosFA}(\mathbf{A}, f, \mathbf{b}, q + 1)\bigr)\bigr\rvert \le 2E_{2q + 1}(f; [a, a'])\|\mathbf{b}\|^2\,, E_{2q + 1} the error of the best uniform approximation of f on [a, a'] by polynomials of degree at most 2q + 1 (minimaxError), the degree of exactness of the Gauss rule. [GolubMeurant2010, Ch. 6], the exactness it rests on.

Lean statement and details
Matrix.IsHermitian.norm_star_dotProduct_cfc_mulVec_sub_lanczosFA_le_of_continuousOn.{u_1, u_2}
  {π•œ : Type u_1} [RCLike π•œ] {n : Type u_2} [Fintype n] [DecidableEq n] {A : Matrix n n π•œ}
  (hA : A.IsHermitian) {a a' : ℝ} (hs : spectrum ℝ A βŠ† Set.Icc a a') {f : ℝ β†’ ℝ}
  (hf : ContinuousOn f (Set.Icc a a')) (b : n β†’ π•œ) (q : β„•) :
  β€–star b ⬝α΅₯ (cfc f A *α΅₯ b - lanczosFA A f b (q + 1))β€– ≀
    2 * minimaxError f (Set.Icc a a') (2 * q + 1) * β€–WithLp.toLp 2 bβ€– ^ 2

Full source on GitHub

Copy link

Theorem (Matrix.IsHermitian.norm_star_dotProduct_cfc_mulVec_sub_lanczosFA_le_of_differentiableOn). Lanczos quadrature for analytic functions: let \mathbf{A} be Hermitian with spectrum in [a, a'], a < a', and let f on [a, a'], pulled back to [-1, 1] by t \mapsto ((a' - a)t + a' + a)/2, extend to a function holomorphic and bounded by \mathbf{M} on the open Bernstein ellipse E_\rho, \rho > 1. Then q + 1 steps give \bigl\lvert\mathbf{b}^{\mathsf{H}}\bigl(f(\mathbf{A})\mathbf{b} - \mathsf{lanczosFA}(\mathbf{A}, f, \mathbf{b}, q + 1)\bigr)\bigr\rvert \le \frac{4\mathbf{M}}{\rho^{2q + 1}(\rho - 1)}\|\mathbf{b}\|^2\,, twice the rate of Lanczos-FA in the exponent, from the Chebyshev truncation of degree 2q + 1. [Trefethen2019, Theorem 8.2] (locator to check), the approximation rate; constants composed here.

Lean statement and details
Matrix.IsHermitian.norm_star_dotProduct_cfc_mulVec_sub_lanczosFA_le_of_differentiableOn.{u_1, u_2}
  {π•œ : Type u_1} [RCLike π•œ] {n : Type u_2} [Fintype n] [DecidableEq n] {A : Matrix n n π•œ}
  (hA : A.IsHermitian) {a a' : ℝ} (haa : a < a') (hs : spectrum ℝ A βŠ† Set.Icc a a') {f : ℝ β†’ ℝ}
  {F : β„‚ β†’ β„‚} {ρ M : ℝ} (hρ : 1 < ρ) (hFd : DifferentiableOn β„‚ F (openBernsteinEllipse ρ))
  (hM : Metric.IsUniformApproxOn F (fun x ↦ 0) (openBernsteinEllipse ρ) M)
  (hExt : Set.EqOn (fun t ↦ ↑(f (((a' - a) * t + a' + a) / 2))) (fun t ↦ F ↑t) (Set.Icc (-1) 1))
  (b : n β†’ π•œ) (q : β„•) :
  β€–star b ⬝α΅₯ (cfc f A *α΅₯ b - lanczosFA A f b (q + 1))β€– ≀
    4 * M / (ρ ^ (2 * q + 1) * (ρ - 1)) * β€–WithLp.toLp 2 bβ€– ^ 2

Full source on GitHub

Copy link

Theorem (Matrix.IsHermitian.norm_star_dotProduct_cfc_mulVec_sub_lanczosFA_le_of_lipschitzOnWith). Lanczos quadrature for Lipschitz functions: for Hermitian \mathbf{A} with spectrum in [a, a'], a < a', and f L-Lipschitz on [a, a'], q + 1 steps give <!-- value jacksonApproximationConstant --> \bigl\lvert\mathbf{b}^{\mathsf{H}}\bigl(f(\mathbf{A})\mathbf{b} - \mathsf{lanczosFA}(\mathbf{A}, f, \mathbf{b}, q + 1)\bigr)\bigr\rvert \le \frac{\pi L(a' - a)}{2q + 3}\|\mathbf{b}\|^2\,, from Jackson's theorem on [a, a'] in degree 2q + 1 (the constant is jacksonApproximationConstant). The approximation step is [ChenTrogdonUbaru2022, Appendix C, Theorem 38]; constants composed here.

Lean statement and details
Matrix.IsHermitian.norm_star_dotProduct_cfc_mulVec_sub_lanczosFA_le_of_lipschitzOnWith.{u_1, u_2}
  {π•œ : Type u_1} [RCLike π•œ] {n : Type u_2} [Fintype n] [DecidableEq n] {A : Matrix n n π•œ}
  (hA : A.IsHermitian) {a a' : ℝ} (haa : a < a') (hs : spectrum ℝ A βŠ† Set.Icc a a') {f : ℝ β†’ ℝ}
  {L : ℝβ‰₯0} (hf : LipschitzOnWith L f (Set.Icc a a')) (b : n β†’ π•œ) (q : β„•) :
  β€–star b ⬝α΅₯ (cfc f A *α΅₯ b - lanczosFA A f b (q + 1))β€– ≀
    jacksonApproximationConstant * ↑L * (a' - a) / (2 * ↑q + 3) * β€–WithLp.toLp 2 bβ€– ^ 2

Full source on GitHub

Copy link

Theorem (Matrix.IsHermitian.star_dotProduct_lanczosFA_eval). Gauss (Lanczos) quadrature is exact through degree 2q - 1: for Hermitian \mathbf{A} and a real polynomial p with \deg p < 2q, \mathbf{b}^{\mathsf{H}}\mathsf{lanczosFA}(\mathbf{A}, p, \mathbf{b}, q) = \mathbf{b}^{\mathsf{H}}p(\mathbf{A})\mathbf{b}; Lanczos-FA itself is exact only through degree q - 1. [GolubMeurant2010, Ch. 6].

Lean statement and details
Matrix.IsHermitian.star_dotProduct_lanczosFA_eval.{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 : β„•} {p : Polynomial ℝ} (hp : p.degree < 2 * ↑q) :
  star b ⬝α΅₯ lanczosFA A (fun x ↦ Polynomial.eval x p) b q = quadForm ((Polynomial.aeval A) p) b

Full source on GitHub

Copy link

Theorem (HasOrthonormalCols.lanczosQuadrature_eq_interpolatoryQuadrature). Lanczos quadrature is the Gauss rule of the spectral measure: for Hermitian \mathbf{A}, \mathbf{Q} with orthonormal columns spanning \mathcal{K}_q(\mathbf{A}, \mathbf{b}) and every q, \mathsf{lanczosQuadrature}(\mathbf{A}, \mathbf{b}, q) is the interpolatory rule of \mu_{\mathbf{A},\mathbf{b}} at the set s of the distinct Ritz values (the eigenvalues of \mathbf{Q}^{\mathsf{H}}\mathbf{A}\mathbf{Q}), q of them when q is at most the grade of \mathbf{b}. Past the grade both sides are \mu_{\mathbf{A},\mathbf{b}} itself. [GolubMeurant2010, Ch. 6].

Lean statement and details
NLAlib.HasOrthonormalCols.lanczosQuadrature_eq_interpolatoryQuadrature.{u_1, u_2, u_3}
  {π•œ : Type u_1} [RCLike π•œ] {n : Type u_2} {r : Type u_3} [Fintype n] [DecidableEq n] [Fintype r]
  [DecidableEq r] {Q : Matrix n r π•œ} (hQ : HasOrthonormalCols Q) {A : Matrix n n π•œ}
  (hA : A.IsHermitian) {b : n β†’ π•œ} {q : β„•} (hK : Q.mulVecLin.range = krylovSpace A b q)
  {s : Finset ℝ} (hs : ↑s = spectrum ℝ (Qα΄΄ * A * Q)) :
  lanczosQuadrature A b q = interpolatoryQuadrature (spectralMeasure A b) s

Full source on GitHub

Copy link