Definition (Orthogonal polynomials and quadrature rules). For a positive measure \mu with the required finite moments, polynomials p_i,p_j are orthogonal when \int p_i(t)p_j(t)\,d\mu(t)=0 for i\ne j. A quadrature rule replaces an integral by \sum_i w_i f(t_i). Gauss, Radau, and Lobatto rules differ in whether endpoint nodes are prescribed; exactness and error statements require the hypotheses given in each result.
Orthogonal polynomials and quadrature
A measure defines an inner product on polynomials. Orthogonalizing this sequence produces recurrences whose small Jacobi matrices connect polynomial zeros, quadrature nodes, and Lanczos coefficients.
Results
Theorem (Gauss–Lobatto quadrature).
for a finite measure \mu supported in [a, b], a < b, and every k, the Lobatto rule with k free nodes matches the first 2k + 2 moments of \mu: it integrates every real polynomial of degree at most 2k + 1 exactly. [Gautschi2004, Theorem 3.6]; [GolubMeurant2010, Ch. 6] (locators to check); there for \mu with more than k interior support points; otherwise the rule is \mu itself.
Lean statement and details
NLAlib.matchesMoments_lobattoQuadrature {μ : Measure ℝ} [IsFiniteMeasure μ] {a b : ℝ}
(hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b) (hab : a < b) (k : ℕ) :
MatchesMoments μ (lobattoQuadrature μ a b k) (2 * k + 2)Theorem (The Gauss–Lobatto remainder).
for a finite measure \mu supported in [a, b], a < b, every k, and f continuous on [a, b] and C^{2k+2} on (a, b), there is \xi \in (a, b) with \int f\,d\mu - \int f\,d\,\mathsf{lobattoQuadrature}(\mu, a, b, k) = \frac{f^{(2k+2)}(\xi)}{(2k+2)!}\int(x - a)(x - b)\,\hat\pi_k(x)^2\,d\mu(x)\,, \hat\pi_k the monic orthogonal polynomial of degree k of lobattoMeasure μ a b. [Gautschi2004, Theorem 3.7]; [GolubMeurant2010, Ch. 6] (locators to check).
Lean statement and details
NLAlib.exists_integral_sub_integral_lobattoQuadrature_eq {μ : Measure ℝ} [IsFiniteMeasure μ]
{a b : ℝ} (hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b) (hab : a < b) (k : ℕ) {f : ℝ → ℝ}
(hf : ContinuousOn f (Set.Icc a b)) (hf' : ContDiffOn ℝ (↑(2 * k + 2)) f (Set.Ioo a b)) :
∃ ξ ∈ Set.Ioo a b,
∫ (x : ℝ), f x ∂μ - ∫ (x : ℝ), f x ∂lobattoQuadrature μ a b k =
iteratedDeriv (2 * k + 2) f ξ / ↑(2 * k + 2).factorial *
∫ (x : ℝ),
(x - a) * (x - b) *
Polynomial.eval x (orthogonalPolynomial (lobattoMeasure μ a b) k) ^ 2 ∂μTheorem (Gauss quadrature).
if the nodal polynomial \pi_s of distinct real nodes s is orthogonal in L^2(\mu) to the polynomials of degree less than \lvert s\rvert, for a finite measure \mu supported in [a, b], then \int p\,d\mu = \sum_{x\in s}\Bigl(\int\ell_x\,d\mu\Bigr)p(x) for every real polynomial p of degree less than 2\lvert s\rvert, \ell_x the Lagrange basis polynomial of x. [Gautschi2004, Theorems 1.45 and 1.46]; [GolubMeurant2010, Ch. 6]; there at the zeros of the orthogonal polynomial of a positive measure; here at any nodes whose nodal polynomial is orthogonal.
Lean statement and details
NLAlib.IsOrthogonalPolynomial.integral_eval_eq_sum {μ : Measure ℝ} {s : Finset ℝ}
(hs : IsOrthogonalPolynomial μ s.card (Lagrange.nodal s id)) [IsFiniteMeasure μ] {a b : ℝ}
(hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b) {p : Polynomial ℝ} (hp : p.degree < 2 * ↑s.card) :
∫ (x : ℝ), Polynomial.eval x p ∂μ =
∑ x ∈ s, (∫ (t : ℝ), Polynomial.eval t (Lagrange.basis s id x) ∂μ) * Polynomial.eval x pTheorem (The Gauss quadrature remainder).
for a finite measure \mu supported in [a, b], a < b, k > 0, and f continuous on [a, b] and C^{2k} on (a, b), there is \xi \in (a, b) with \int f\,d\mu - \int f\,d\,\mathsf{gaussQuadrature}(\mu, k) = \frac{f^{(2k)}(\xi)}{(2k)!}\int\pi_k^2\,d\mu\,, \pi_k the monic orthogonal polynomial of degree k. When \mu has at most k support points both sides are 0. [Gautschi2004, Theorem 1.48]; [GolubMeurant2010, Ch. 6] (locators to check); there for f \in C^{2k}[a, b].
Lean statement and details
NLAlib.exists_integral_sub_integral_gaussQuadrature_eq {μ : Measure ℝ} [IsFiniteMeasure μ] {a b : ℝ}
(hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b) (hab : a < b) {k : ℕ} (hk : 0 < k) {f : ℝ → ℝ}
(hf : ContinuousOn f (Set.Icc a b)) (hf' : ContDiffOn ℝ (↑(2 * k)) f (Set.Ioo a b)) :
∃ ξ ∈ Set.Ioo a b,
∫ (x : ℝ), f x ∂μ - ∫ (x : ℝ), f x ∂gaussQuadrature μ k =
iteratedDeriv (2 * k) f ξ / ↑(2 * k).factorial *
∫ (x : ℝ), Polynomial.eval x (orthogonalPolynomial μ k) ^ 2 ∂μTheorem (Uniqueness of the Gauss rule).
if a finite measure \nu carried by a set of at most k points matches the first 2k moments of a finite measure \mu supported in [a, b], then \nu is the k-point Gauss rule of \mu. [Gautschi2004, §1.4] (locator to check); there among interpolatory rules with k distinct nodes and positive weights; here any measure on at most k points.
Lean statement and details
NLAlib.MatchesMoments.eq_gaussQuadrature {μ ν : Measure ℝ} [IsFiniteMeasure μ] {a b : ℝ}
[IsFiniteMeasure ν] {k : ℕ} (h : MatchesMoments μ ν (2 * k)) (hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b)
{s : Finset ℝ} (hν : ∀ᵐ (x : ℝ) ∂ν, x ∈ s) (hs : s.card ≤ k) : ν = gaussQuadrature μ kTheorem (Golub–Welsch for the Radau rule).
for a finite measure \mu supported in [a, b], positive definite up to degree k + 1, and c \in \{a, b\}, the Radau rule of \mu with prescribed node c and k free nodes is the spectral measure of the Radau Jacobi matrix \tilde{\mathbf{J}} of order k + 1 and \sqrt{\mu(\mathbb{R})}\,\mathbf{e}_0: its nodes are the eigenvalues of \tilde{\mathbf{J}} (one of them c) and its weights \mu(\mathbb{R}) times the squared first eigenvector components. [Golub1973, §7]; [GolubMeurant2010, Ch. 6] (locators to check).
Lean statement and details
NLAlib.spectralMeasure_radauJacobiMatrix (μ : Measure ℝ) [IsFiniteMeasure μ] {a b c : ℝ}
(hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b) (hc : c = a ∨ c = b) {k : ℕ}
(h : IsMomentPosDef μ (k + 1)) :
spectralMeasure (radauJacobiMatrix μ c k) (√(μ.real Set.univ) • Pi.single 0 1) =
radauQuadrature μ c kTheorem (Gauss–Radau quadrature).
for a finite measure \mu supported in [a, b], c \in \{a, b\} and every k, the Radau rule with prescribed node c and k free nodes matches the first 2k + 1 moments of \mu: it integrates every real polynomial of degree at most 2k exactly. [Gautschi2004, Theorem 3.2]; [GolubMeurant2010, Ch. 6] (locators to check); there for \mu with more than k support points; otherwise the rule is \mu itself.
Lean statement and details
NLAlib.matchesMoments_radauQuadrature {μ : Measure ℝ} [IsFiniteMeasure μ] {a b c : ℝ}
(hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b) (hc : c = a ∨ c = b) (k : ℕ) :
MatchesMoments μ (radauQuadrature μ c k) (2 * k + 1)Theorem (Uniqueness of the Radau rule).
if a finite measure \nu carried by c and at most k further points matches the first 2k + 1 moments of a finite measure \mu supported in [a, b], c \in \{a, b\}, then \nu is the Radau rule of \mu with prescribed node c and k free nodes. [Gautschi2004, §3.1.1] (locator to check); there among rules with positive weights.
Lean statement and details
NLAlib.MatchesMoments.eq_radauQuadrature {μ ν : Measure ℝ} [IsFiniteMeasure μ] {a b c : ℝ}
[IsFiniteMeasure ν] {k : ℕ} (h : MatchesMoments μ ν (2 * k + 1))
(hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b) (hc : c = a ∨ c = b) {s : Finset ℝ}
(hν : ∀ᵐ (x : ℝ) ∂ν, x ∈ insert c s) (hs : s.card ≤ k) : ν = radauQuadrature μ c kTheorem (The Gauss–Radau remainder).
for a finite measure \mu supported in [a, b], a < b, c \in \{a, b\}, every k, and f continuous on [a, b] and C^{2k+1} on (a, b), there is \xi \in (a, b) with \int f\,d\mu - \int f\,d\,\mathsf{radauQuadrature}(\mu, c, k) = \frac{f^{(2k+1)}(\xi)}{(2k+1)!}\int(x - c)\,\tilde\pi_k(x)^2\,d\mu(x)\,, \tilde\pi_k the monic orthogonal polynomial of degree k of radauMeasure μ c. [Gautschi2004, Theorem 3.3]; [GolubMeurant2010, Ch. 6] (locators to check).
Lean statement and details
NLAlib.exists_integral_sub_integral_radauQuadrature_eq {μ : Measure ℝ} [IsFiniteMeasure μ]
{a b c : ℝ} (hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b) (hab : a < b) (hc : c = a ∨ c = b) (k : ℕ)
{f : ℝ → ℝ} (hf : ContinuousOn f (Set.Icc a b))
(hf' : ContDiffOn ℝ (↑(2 * k + 1)) f (Set.Ioo a b)) :
∃ ξ ∈ Set.Ioo a b,
∫ (x : ℝ), f x ∂μ - ∫ (x : ℝ), f x ∂radauQuadrature μ c k =
iteratedDeriv (2 * k + 1) f ξ / ↑(2 * k + 1).factorial *
∫ (x : ℝ), (x - c) * Polynomial.eval x (orthogonalPolynomial (radauMeasure μ c) k) ^ 2 ∂μTheorem (Golub–Welsch).
for a finite measure \mu supported in [a, c] and every k, the (k+1)-point Gauss rule of \mu is the spectral measure of its Jacobi matrix and \sqrt{\mu(\mathbb{R})}\,\mathbf{e}_0: its nodes are the eigenvalues of \mathbf{J}_{k+1}(\mu) and its weights \mu(\mathbb{R}) times the squared first components of the eigenvectors. Past the support size of \mu the matrix has zero rows, and the extra eigenvalues carry no weight. [Gautschi2004, Theorem 3.1]; [GolubWelsch1969, §2] (labels to check).
Lean statement and details
NLAlib.spectralMeasure_jacobiMatrix (μ : Measure ℝ) [IsFiniteMeasure μ] {a c : ℝ}
(hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a c) (k : ℕ) :
spectralMeasure (jacobiMatrix μ (k + 1)) (√(μ.real Set.univ) • Pi.single 0 1) =
gaussQuadrature μ (k + 1)Theorem (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].
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) qTheorem (Existence of the orthogonal polynomials).
for a finite measure \mu supported in [a, b] and every k, the monic polynomial \pi_k of degree k is orthogonal in L^2(\mu) to every real polynomial of degree less than k. No nondegeneracy is needed: past the number of support points, \pi_k vanishes on the support. [Gautschi2004, Theorems 1.6 and 1.27] (which of Theorems 1.6–1.8 states existence is to check); there for k below the number of support points.
Lean statement and details
NLAlib.isOrthogonalPolynomial_orthogonalPolynomial {μ : Measure ℝ} [IsFiniteMeasure μ] {a b : ℝ}
(hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b) (k : ℕ) :
IsOrthogonalPolynomial μ k (orthogonalPolynomial μ k)Theorem (The three-term recurrence).
for every measure \mu on \mathbb{R} and every k, \pi_{k+2} = (x - \alpha_{k+1})\pi_{k+1} - \beta_{k+1}\pi_k\,, with \alpha_k = \int x\pi_k^2\,d\mu/\int\pi_k^2\,d\mu and \beta_k = \int\pi_k^2\,d\mu/\int\pi_{k-1}^2\,d\mu (zero when the denominator is). [Gautschi2004, Theorem 1.27]; [Szego1975, Theorem 3.2.1] (locator to check); there as a theorem about the orthogonal polynomials, here the definition.
Lean statement and details
NLAlib.orthogonalPolynomial_add_two (μ : Measure ℝ) (k : ℕ) :
orthogonalPolynomial μ (k + 2) =
(Polynomial.X - Polynomial.C (jacobiAlpha μ (k + 1))) * orthogonalPolynomial μ (k + 1) -
Polynomial.C (jacobiBeta μ (k + 1)) * orthogonalPolynomial μ kTheorem (The zeros of the orthogonal polynomial are real).
if \mu, finite and supported in [a, b], is positive definite up to degree k, then \pi_k has k real zeros counted with multiplicity. [Gautschi2004, Theorem 1.19]; [Szego1975, Theorem 3.3.1] (locators to check).
Lean statement and details
NLAlib.IsMomentPosDef.card_roots_orthogonalPolynomial {μ : Measure ℝ} [IsFiniteMeasure μ] {a b : ℝ}
{k : ℕ} (h : IsMomentPosDef μ k) (hμ : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc a b) :
(orthogonalPolynomial μ k).roots.card = kFormal definitions
- NLAlib.IsMomentPosDef
- NLAlib.IsOrthogonalPolynomial
- NLAlib.MatchesMoments
- NLAlib.gaussNodes
- NLAlib.gaussQuadrature
- NLAlib.interpolatoryQuadrature
- NLAlib.isFiniteMeasure_gaussQuadrature
- NLAlib.isFiniteMeasure_interpolatoryQuadrature
- NLAlib.isFiniteMeasure_lanczosQuadrature
- NLAlib.isFiniteMeasure_lobattoQuadrature
- NLAlib.isFiniteMeasure_radauQuadrature
- NLAlib.jacobiAlpha
- NLAlib.jacobiBeta
- NLAlib.jacobiMatrix
- NLAlib.lanczosQuadrature
- NLAlib.lobattoMeasure
- NLAlib.lobattoNodes
- NLAlib.lobattoQuadrature
- NLAlib.orthogonalPolynomial
- NLAlib.radauJacobiAlpha
- NLAlib.radauJacobiMatrix
- NLAlib.radauMeasure
- NLAlib.radauNodes
- NLAlib.radauQuadrature
Used by algorithms
Lanczos process
Build a Krylov basis and a tridiagonal compression of a symmetric operator.
Lanczos quadrature
Use the Lanczos compression to approximate a quadratic form \mathbf{b}^{\mathsf{T}}f(\mathbf{A})\mathbf{b}.
Stochastic Lanczos quadrature
Average Lanczos-based quadrature over random probes to estimate spectral quantities.
Probe spectral estimation
Estimate a Hermitian matrix spectral measure with isotropic random probes.