LeanFun RevOLVER

3.5 Approximation in Jacobi and ultraspherical series

Chebyshev approximation bounds also control projections in other weighted polynomial bases. Kernel estimates then turn weighted norm bounds into uniform bounds for Jacobi and Gegenbauer expansions.

3.5.1 Partial sums and weighted best approximation

The finite coefficient domain \(\mathcal A_{\mu ,P,\le N}^{\mathbb {R}}\) consists of real functions for which every product \(fP_n\) and square \(P_n^2\) is integrable and \(h_n{\gt}0\), for \(n\le N\) (Definition 3.1.44). The partial sum is the best polynomial approximation in the weighted \(L^2\) norm.

Definition 3.5.1 Polynomial partial sums and kernel vectors
✓ 🤖

A kernel cutoff is a natural number \(N\) together with \(h_n{\gt}0\) for every \(0\le n\le N\). For \(f\in \mathcal A_{\mu ,P,\le N}^{\mathbb {R}}\), write \(S_Nf=\sum _{n=0}^Na_n(f)P_n\) as a polynomial, and let \(v_{N,x}=\sum _{n=0}^NP_n(x)h_n^{-1/2}q_n\) be the kernel vector in weighted L2, where \(q_n=P_n/\sqrt{h_n}\) and the kernel vector is defined only at a kernel cutoff.

Lean Formalisation
def Polynomial.Sequence.partialSum (P : Polynomial.Sequence ℝ) (μ : MeasureTheory.Measure ℝ) {N : ℕ}
  (f : Polynomial.IntegralCoefficientFamilyInput ℝ μ (↑P) N) : Polynomial ℝ
Lean definition
/-- The degree-N integral-coefficient partial sum, in the original normalization. -/
@[expose] noncomputable def partialSum (μ : Measure ℝ) {N : ℕ}
    (f : IntegralCoefficientFamilyInput ℝ μ P N) : ℝ[X] :=
  ∑ i : Fin (N + 1), P.integralCoefficient μ (f.at i) • P i
source

Let \(P_n\) be orthogonal for \(\mu \), with finite polynomial moments and positive definite polynomial integral. For \(f\in L^2(\mu ;\mathbb {R})\), let \(S_Nf=\sum _{n=0}^Na_n(f)P_n\) use the integral coefficients in the original normalisation. Every real polynomial \(p\) of degree at most \(N\) satisfies

\[ \| f-S_Nf\| _{L^2(\mu )}\le \| f-p\| _{L^2(\mu )}. \]

If \(|f-p|\le \varepsilon \) almost everywhere, with \(\varepsilon \ge 0\), the error is at most \(\sqrt{\mu (\mathbb {R})}\, \varepsilon \). No density or support condition is assumed.

Reference: [DLMF, 18.2(viii)].

Lean Formalisation
theorem Polynomial.Sequence.inner_normalizedToL2_smul {μ : MeasureTheory.Measure ℝ} {P : Polynomial.Sequence ℝ}
  (hμ : Polynomial.HasFiniteMoments μ) (hpos : Polynomial.HasPositiveDefiniteIntegral μ) (f : ↥(MeasureTheory.Lp ℝ 2 μ))
  (n : ℕ) :
  inner ℝ (P.normalizedToL2 hμ ⟨n, ⋯⟩) f • P.normalizedToL2 hμ ⟨n, ⋯⟩ =
    P.integralCoefficient μ (Polynomial.IntegralCoefficientInput.ofL2 hμ hpos (↑P n) ⋯ f) •
      (Polynomial.polynomialToL2 hμ) (↑P n)
Lean proof
/-- A normalized inner-product term is the usual integral-coefficient term. -/
theorem inner_normalizedToL2_smul (hpos : HasPositiveDefiniteIntegral μ)
    (f : Lp ℝ 2 μ) (n : ℕ) :
    inner ℝ (P.normalizedToL2 hμ ⟨n, squaredNorm_pos hpos P n⟩) f • P.normalizedToL2 hμ ⟨n, squaredNorm_pos hpos P n⟩ =
      P.integralCoefficient μ (IntegralCoefficientInput.ofL2 hμ hpos (P n) (P.ne_zero n) f) • polynomialToL2 hμ (P n) := by
  rw [normalizedToL2, inner_smul_left, inner_polynomialToL2_left]
  simp only [conj_trivial, smul_smul]
  congr 1
  calc
    _ = ((√(P.squaredNorm μ n (Polynomial.Sequence.IntegrableSquare.of _ _)))⁻¹ * (√(P.squaredNorm μ n (Polynomial.Sequence.IntegrableSquare.of _ _)))⁻¹) *
        (∫ x, f x * (P n).eval x ∂μ) := by ring
    _ = _ := by
      rw [← mul_inv, Real.mul_self_sqrt (squaredNorm_pos hpos P n).le]
      rfl
source
Theorem 3.5.3 Geometric weighted L2 approximation
✓ 🤖

Under the weighted best-approximation hypotheses, assume additionally that \(\mu \) is supported almost everywhere on \([-1,1]\). For \(\rho {\gt}1\), let \(F\) be analytic and bounded by \(M\) in \(E_\rho \), and let \(f\in L^2(\mu ;\mathbb {R})\) agree almost everywhere with \(\operatorname {Re}F\). Then

\[ \| f-S_Nf\| _{L^2(\mu )}\le \sqrt{\mu (\mathbb {R})}\, \frac{2M}{\rho ^N(\rho -1)}. \]

The support may be disconnected.

Reference: the competitor of [ATAP, Theorem 8.2].

Lean Formalisation
theorem Polynomial.Sequence.IsOrthogonal.norm_sub_sum_integralCoefficient_le_of_analytic {μ : MeasureTheory.Measure ℝ}
  {P : Polynomial.Sequence ℝ} (hμ : Polynomial.HasFiniteMoments μ) (hP : P.IsOrthogonal μ)
  (hpos : Polynomial.HasPositiveDefiniteIntegral μ) (hsupp : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc (-1) 1) {F : ℂ → ℂ} {ρ M : ℝ}
  (hρ : 1 < ρ) (hF : AnalyticOnNhd ℂ F (Complex.bernsteinEllipse ⟨ρ, hρ⟩))
  (hM : ∀ z ∈ Complex.bernsteinEllipse ⟨ρ, hρ⟩, ‖F z‖ ≤ M) (f : ↥(MeasureTheory.Lp ℝ 2 μ))
  (hf : ∀ᵐ (x : ℝ) ∂μ, ↑↑f x = (F ↑x).re) (N : ℕ) :
  ‖f -
        ∑ i ∈ Finset.range (N + 1),
          P.integralCoefficient μ (Polynomial.IntegralCoefficientInput.ofL2 hμ hpos (↑P i) ⋯ f) •
            (Polynomial.polynomialToL2 hμ) (↑P i)‖ ≤
    √(μ.real Set.univ) * (2 * M / (ρ ^ N * (ρ - 1)))
Lean proof
/-- The real part of a bounded analytic function has geometrically accurate
weighted orthogonal projections. The measure need not have connected support. -/
theorem IsOrthogonal.norm_sub_sum_integralCoefficient_le_of_analytic
    (hP : P.IsOrthogonal μ) (hpos : HasPositiveDefiniteIntegral μ)
    (hsupp : ∀ᵐ x ∂μ, x ∈ Icc (-1 : ℝ) 1)
    {F : ℂ → ℂ} {ρ M : ℝ} (hρ : 1 < ρ)
    (hF : AnalyticOnNhd ℂ F (bernsteinEllipse ⟨ρ, hρ⟩))
    (hM : ∀ z ∈ bernsteinEllipse ⟨ρ, hρ⟩, ‖F z‖ ≤ M)
    (f : Lp ℝ 2 μ) (hf : ∀ᵐ x ∂μ, f x = (F x).re) (N : ℕ) :
    ‖f - ∑ i ∈ Finset.range (N + 1),
      P.integralCoefficient μ (IntegralCoefficientInput.ofL2 hμ hpos (P i) (P.ne_zero i) f) • polynomialToL2 hμ (P i)‖ ≤
      √(μ.real univ) * (2 * M / (ρ ^ N * (ρ - 1))) := by
  obtain ⟨p, hp, he⟩ := Chebyshev.exists_real_polynomial_approximation_of_analytic hρ hF hM N
  have hM0 : 0 ≤ M := (norm_nonneg (F 0)).trans
    (hM 0 (by simpa using (ofReal_mem_bernsteinEllipse hρ
      (show (0 : ℝ) ∈ Icc (-1 : ℝ) 1 by constructor <;> norm_num))))
  apply hP.norm_sub_sum_integralCoefficient_le_of_ae_bound hμ hpos f N p hp
    (by positivity)
  filter_upwards [hf, hsupp] with x hfx hx
  rw [hfx]
  exact he x hx
source

Let \(\alpha ,\beta {\gt}-1\), \(f\in L^2(\mu _{\alpha ,\beta };\mathbb {R})\), and \(S_Nf=\sum _{n=0}^N a_n(f)P_n^{(\alpha ,\beta )}\). For every real polynomial \(p\) of degree at most \(N\),

\[ \| f-S_Nf\| _{L^2(\mu _{\alpha ,\beta })}\le \| f-p\| _{L^2(\mu _{\alpha ,\beta })}. \]

If \(\rho {\gt}1\), \(F\) is analytic on \(E_\rho \), \(|F|\le M\) there, and \(f=\operatorname {Re}F\) almost everywhere for \(\mu _{\alpha ,\beta }\), then

\[ \| f-S_Nf\| _{L^2(\mu _{\alpha ,\beta })}\le \sqrt{\mu _{\alpha ,\beta }(\mathbb {R})}\frac{2M}{\rho ^N(\rho -1)}. \]

The original Jacobi measure is used, including singular endpoint weights.

Lean Formalisation
theorem Polynomial.norm_sub_sum_jacobiCoefficient_le {α β : ℝ} (hα : -1 < α) (hβ : -1 < β)
  (f : ↥(MeasureTheory.Lp ℝ 2 (Polynomial.jacobiMeasure α β))) (N : ℕ) (p : Polynomial ℝ) (hp : p.degree ≤ ↑N) :
  ‖f -
        ∑ i ∈ Finset.range (N + 1),
          Polynomial.jacobiCoefficient α β (Polynomial.IntegralCoefficientInput.ofJacobiL2 hα hβ f i) •
            (Polynomial.polynomialToL2 ⋯) (Polynomial.jacobi α β i)‖ ≤
    ‖f - (Polynomial.polynomialToL2 ⋯) p‖
Lean proof
/-- Jacobi truncation is a best weighted L² approximation among polynomials of
at most the same degree. -/
theorem norm_sub_sum_jacobiCoefficient_le (f : Lp ℝ 2 (jacobiMeasure α β))
    (N : ℕ) (p : ℝ[X]) (hp : p.degree ≤ N) :
    ‖f - ∑ i ∈ Finset.range (N + 1), (jacobiCoefficient α β (IntegralCoefficientInput.ofJacobiL2 hα hβ f i)) •
      polynomialToL2 (hasFiniteMoments_jacobiMeasure hα hβ) (jacobi α β i)‖ ≤
      ‖f - polynomialToL2 (hasFiniteMoments_jacobiMeasure hα hβ) p‖ := by
  simpa only [Sequence.integralCoefficient, squaredNorm_jacobiSequence, jacobiSequence_apply,
    jacobiCoefficient, IntegralCoefficientInput.ofJacobiL2, IntegralCoefficientInput.ofL2] using
    (isOrthogonal_jacobiSequence hα hβ).norm_sub_sum_integralCoefficient_le
      (hasFiniteMoments_jacobiMeasure hα hβ)
      (hasPositiveDefiniteIntegral_jacobiMeasure hα hβ) f N p hp
source

Example (Julia).

For \(F(z)=1/(1+25z^2)\) choose \(\rho =1.2\). Put \(b=(\rho -\rho ^{-1})/2{\lt}1/5\). On \(E_\rho \), \(\Re (1+25z^2)\ge 1-25b^2{\gt}0\), so \(M=(1-25b^2)^{-1}\) is an upper bound for \(|F|\). The Gauss–Legendre rule of Chapter 3.6 estimates the coefficients and weighted errors below; these computed norms are numerical estimates, not certified integrals.


using LinearAlgebra
n = 200                             # Gauss-Legendre nodes
b = [k / sqrt(4k^2 - 1) for k in 1:n-1]
E = eigen(SymTridiagonal(zeros(n), b))
x, w = E.values, 2 .* E.vectors[1, :].^2
P = ones(n, 62); P[:, 2] = x        # Legendre P_k at the nodes, k <= 61
for k in 1:60
    P[:, k+2] = ((2k+1) .* x .* P[:, k+1] .- k .* P[:, k]) ./ (k+1)
end
f = 1 ./ (1 .+ 25x.^2)
a = [(2k+1)/2 * dot(w, f .* P[:, k+1]) for k in 0:61]
L2err(N) = sqrt(dot(w, (f .- P[:, 1:N+1]*a[1:N+1]).^2))
rho = 1.2                           # poles lie on the ellipse rho = 1.2198...
bminor = (rho - 1/rho) / 2
M = 1 / (1 - 25bminor^2)             # analytic upper bound on the ellipse
[L2err(N) / (sqrt(2)*2M/(rho^N*(rho - 1))) for N in 10:10:60]
                                    # compare estimated errors with the analytic bound
Partial-sum and kernel-vector formulas
Theorem 3.5.5 Classical finite kernel-vector formula
✓ 🤖

For a kernel cutoff \(N\) and \(x\in \mathbb {R}\), \(v_{N,x}=\sum _{n=0}^N P_n(x)h_n^{-1/2}e_n\). Every summand uses its positive-norm index.

Lean Formalisation
theorem Polynomial.Sequence.kernelVector_apply {μ : MeasureTheory.Measure ℝ} (hμ : Polynomial.HasFiniteMoments μ)
  (P : Polynomial.Sequence ℝ) (N : { N // ∀ i ≤ N, 0 < P.squaredNorm μ i ⋯ }) (x : ℝ) :
  Polynomial.Sequence.kernelVector hμ P N x =
    ∑ i, (Polynomial.eval x (↑P ↑i) / √(P.squaredNorm μ ↑i ⋯)) • P.normalizedToL2 hμ ⟨↑i, ⋯⟩
Lean proof
/-- Classical finite kernel-vector formula (DLMF 18.2(v)). -/
theorem kernelVector_apply (P : Sequence ℝ)
    (N : {N : ℕ // ∀ i ≤ N, 0 < P.squaredNorm μ i (Polynomial.Sequence.IntegrableSquare.of _ _)}) (x : ℝ) :
    P.kernelVector hμ N x =
      ∑ i : Fin (N.val + 1), ((P i).eval x / √(P.squaredNorm μ i (Polynomial.Sequence.IntegrableSquare.of _ _))) •
        P.normalizedToL2 hμ ⟨i, N.property i (Nat.le_of_lt_succ i.isLt)⟩ := rfl
source
Theorem 3.5.6 Classical finite partial sum formula
✓ 🤖

For \(f\in \mathcal A_{\mu ,P,\le N}^{\mathbb {R}}\),

\[ S_Nf=\sum _{n=0}^N\frac{\int fP_n\, d\mu }{h_n}P_n, \qquad h_n=\int P_n^2\, d\mu {\gt}0. \]

Each term uses the same function \(f\) in its index-\(n\) coefficient domain.

Lean Formalisation
theorem Polynomial.Sequence.partialSum_apply (P : Polynomial.Sequence ℝ) (μ : MeasureTheory.Measure ℝ) {N : ℕ}
  (f : Polynomial.IntegralCoefficientFamilyInput ℝ μ (↑P) N) :
  P.partialSum μ f = ∑ i, P.integralCoefficient μ (f.at i) • ↑P ↑i
Lean proof
/-- The finite polynomial formula on the classical input domain. -/
theorem partialSum_apply (μ : Measure ℝ) {N : ℕ}
    (f : IntegralCoefficientFamilyInput ℝ μ P N) :
    P.partialSum μ f = ∑ i : Fin (N + 1), P.integralCoefficient μ (f.at i) • P i := rfl
source

3.5.2 From weighted error to uniform error

A weighted norm does not determine a point value. The Christoffel kernel bounds evaluation of a finite polynomial projection and supplies the extra factor needed for a uniform estimate.

The hypotheses here are finite polynomial moments, a positive-definite polynomial pairing and orthogonality of \(P\), as in the weighted best-approximation theorem. The kernel is \(K_N(x,y)=\sum _{n=0}^N P_n(x)P_n(y)/h_n\) from Definition 3.1.22.

The existing Christoffel kernel satisfies \(\langle v_{N,x},f\rangle =(S_Nf)(x)\) and \(\| v_{N,x}\| _2^2=K_N(x,x)\). Consequently, for \(\deg p\le N\), \(|p(x)|\le \sqrt{K_N(x,x)}\| p\| _2\). If \(|f-p|\le \varepsilon \) almost everywhere and \(|y-p(x)|\le \varepsilon \), then

\[ |y-(S_Nf)(x)|\le (1+\sqrt{K_N(x,x)}\sqrt{\mu (\mathbb {R})})\varepsilon . \]

Here \(f\) is a real L2 class and \(y\) specifies the desired pointwise value; no point evaluation of an L2 equivalence class is assumed.

Reference: [DLMF, 18.2(v), (viii)].

Lean Formalisation
theorem Polynomial.Sequence.inner_kernelVector {μ : MeasureTheory.Measure ℝ} {P : Polynomial.Sequence ℝ}
  (hμ : Polynomial.HasFiniteMoments μ) (hpos : Polynomial.HasPositiveDefiniteIntegral μ) (N : ℕ) (x : ℝ)
  (f : ↥(MeasureTheory.Lp ℝ 2 μ)) :
  inner ℝ (Polynomial.Sequence.kernelVector hμ P ⟨N, ⋯⟩ x) f =
    Polynomial.eval x (P.partialSum μ (Polynomial.IntegralCoefficientFamilyInput.ofL2 hμ hpos P f N))
Lean proof
/-- The kernel vector reproduces the polynomial partial sum. -/
theorem inner_kernelVector (hpos : HasPositiveDefiniteIntegral μ)
    (N : ℕ) (x : ℝ) (f : Lp ℝ 2 μ) :
    inner ℝ (P.kernelVector hμ ⟨N, fun i _ ↦ squaredNorm_pos hpos P i⟩ x) f = (P.partialSum μ (IntegralCoefficientFamilyInput.ofL2 hμ hpos P f N)).eval x := by
  simp only [kernelVector_of_positive hμ P hpos, partialSum_ofL2, sum_inner, inner_smul_left, conj_trivial,
    normalizedToL2, inner_smul_left, inner_polynomialToL2_left,
    eval_finsetSum, eval_smul, smul_eq_mul, integralCoefficient, IntegralCoefficientInput.ofL2]
  apply Finset.sum_congr rfl
  intro i _
  calc
    _ = (P i).eval x * ((√(P.squaredNorm μ i (Polynomial.Sequence.IntegrableSquare.of _ _)))⁻¹ * (√(P.squaredNorm μ i (Polynomial.Sequence.IntegrableSquare.of _ _)))⁻¹) *
        (∫ t, f t * (P i).eval t ∂μ) := by ring
    _ = _ := by
      rw [← mul_inv, Real.mul_self_sqrt (squaredNorm_pos hpos P i).le]
      ring
source
Definition 3.5.8 Explicit Jacobi growth constants
✓ 🤖

For \(a+1\notin \{ 0,-1,-2,\ldots \} \), \(\alpha ,\beta {\gt}-1\), and an integer \(k\ge 0\), define

\begin{align*} E_k(a)& =1+|a+1|+(k+1)^k/\Gamma (a+1),\\ B_k(\alpha ,\beta )& =1+h_0^{-1}+h_1^{-1}+h_2^{-1} +\frac{(2+|\alpha +\beta +3|)(k+1)^k}{2^{\alpha +\beta +1}},\\ C_k(\alpha ,\beta )& =[1+2(E_k(\alpha +1)+E_k(\beta ))]^2B_k(\alpha ,\beta ), \end{align*}

where \(h_n=\int (P_n^{(\alpha ,\beta )})^2\, d\mu _{\alpha ,\beta }\). The constants depend on \(k\) and the parameters, not on \(n\).

Lean Formalisation
def Polynomial.jacobiEndpointBound (a : { a // ∀ (n : ℕ), a + 1 ≠ -↑n }) (k : ℕ) : ℝ
Lean definition
/-- An explicit endpoint-growth constant; the argument type excludes exactly the shifted Gamma poles. -/
noncomputable def jacobiEndpointBound (a : {a : ℝ // ∀ n : ℕ, a + 1 ≠ -(n : ℝ)}) (k : ℕ) : ℝ :=
  1 + |a.val + 1| + ((k : ℝ) + 1) ^ k / GammaOn ⟨a.val + 1, a.property⟩
source

For \(\alpha ,\beta {\gt}-1\), \(\rho {\gt}1\), \(F\) analytic and bounded by \(M\) on \(E_\rho \), and a real weighted L2 class \(f=\operatorname {Re}F\) almost everywhere,

\[ |\operatorname {Re}F(x)-S_Nf(x)|\le [1+\sqrt{C_k(\alpha ,\beta )}(N+1)^{3k+3}\sqrt{\mu _{\alpha ,\beta }(\mathbb {R})}] \frac{2M}{\rho ^N(\rho -1)} \]

for every \(x\in [-1,1]\) and any integer \(k\ge \max (\alpha +1,\beta ,\alpha +\beta +1)\). Such an integer always exists, and the Jacobi partial sums converge uniformly on the closed interval, including both endpoints. No boundary regularity of \(F\) on the ellipse is assumed.

Lean Formalisation
theorem Polynomial.norm_sub_sum_jacobiCoefficient_le_uniform_of_analytic {α β : ℝ} (hα : -1 < α) (hβ : -1 < β) {F : ℂ → ℂ}
  {ρ M : ℝ} (hρ : 1 < ρ) (hF : AnalyticOnNhd ℂ F (Complex.bernsteinEllipse ⟨ρ, hρ⟩))
  (hM : ∀ z ∈ Complex.bernsteinEllipse ⟨ρ, hρ⟩, ‖F z‖ ≤ M) (f : ↥(MeasureTheory.Lp ℝ 2 (Polynomial.jacobiMeasure α β)))
  (hf : ∀ᵐ (x : ℝ) ∂Polynomial.jacobiMeasure α β, ↑↑f x = (F ↑x).re) (k : ℕ) (hkα : α + 1 ≤ ↑k) (hkβ : β ≤ ↑k)
  (hks : α + β + 1 ≤ ↑k) (N : ℕ) {x : ℝ} (hx : x ∈ Set.Icc (-1) 1) :
  ‖(F ↑x).re -
        ∑ i ∈ Finset.range (N + 1),
          Polynomial.jacobiCoefficient α β (Polynomial.IntegralCoefficientInput.ofJacobiL2 hα hβ f i) *
            Polynomial.eval x (Polynomial.jacobi α β i)‖ ≤
    (1 +
        √(Polynomial.jacobiKernelBound ⟨α, hα⟩ ⟨β, hβ⟩ k) * (↑N + 1) ^ (3 * k + 3) *
          √((Polynomial.jacobiMeasure α β).real Set.univ)) *
      (2 * M / (ρ ^ N * (ρ - 1)))
Lean proof
/-- Uniform geometric approximation with an explicit nonsharp polynomial factor.
Every alpha,beta > -1 is covered by choosing a sufficiently large integer k. -/
theorem norm_sub_sum_jacobiCoefficient_le_uniform_of_analytic {F : ℂ → ℂ} {ρ M : ℝ}
    (hρ : 1 < ρ) (hF : AnalyticOnNhd ℂ F (bernsteinEllipse ⟨ρ, hρ⟩))
    (hM : ∀ z ∈ bernsteinEllipse ⟨ρ, hρ⟩, ‖F z‖ ≤ M)
    (f : Lp ℝ 2 (jacobiMeasure α β))
    (hf : ∀ᵐ x ∂jacobiMeasure α β, f x = (F x).re)
    (k : ℕ) (hkα : α + 1 ≤ k) (hkβ : β ≤ k) (hks : α + β + 1 ≤ k)
    (N : ℕ) {x : ℝ} (hx : x ∈ Icc (-1 : ℝ) 1) :
    ‖(F x).re - ∑ i ∈ Finset.range (N + 1),
        (jacobiCoefficient α β (IntegralCoefficientInput.ofJacobiL2 hα hβ f i)) * (jacobi α β i).eval x‖ ≤
      (1 + √(jacobiKernelBound ⟨α, hα⟩ ⟨β, hβ⟩ k) * ((N : ℝ) + 1) ^ (3 * k + 3) *
        √((jacobiMeasure α β).real univ)) * (2 * M / (ρ ^ N * (ρ - 1))) := by
  have h := (isOrthogonal_jacobiSequence hα hβ).norm_sub_eval_partialSum_le_kernel_of_analytic
    (hasFiniteMoments_jacobiMeasure hα hβ) (hasPositiveDefiniteIntegral_jacobiMeasure hα hβ)
    ((ae_mem_Ioo_jacobiMeasure α β).mono (fun _ hx ↦ Ioo_subset_Icc_self hx)) hρ hF hM f hf N hx
  simp only [Sequence.partialSum_ofL2, eval_finsetSum, eval_smul, smul_eq_mul,
    Sequence.integralCoefficient, squaredNorm_jacobiSequence, jacobiSequence_apply,
    IntegralCoefficientInput.ofL2] at h
  have hM0 : 0 ≤ M := (norm_nonneg (F x)).trans (hM x (ofReal_mem_bernsteinEllipse hρ hx))
  apply h.trans
  gcongr
  exact sqrt_jacobi_kernel_le_polynomial hα hβ k hkα hkβ hks N hx
source

For \(\lambda {\gt}-1/2\), \(\lambda \ne 0\), the Gegenbauer kernel equals the Jacobi kernel at \(\alpha =\beta =\lambda -1/2\). Let \(\rho {\gt}1\), let \(F\) be analytic and bounded by \(M\) on \(E_\rho \), and let \(f\in L^2(\mu _\lambda ;\mathbb {R})\) agree almost everywhere with \(\operatorname {Re}F\). Its Gegenbauer partial sums satisfy

\[ \| f-S_Nf\| _2\le \sqrt{\mu _\lambda (\mathbb {R})}\frac{2M}{\rho ^N(\rho -1)}. \]

The preceding uniform Jacobi error bound also holds, with \(C_k(\lambda -1/2,\lambda -1/2)\) and the Gegenbauer mass, whenever \(k\ge \max (\lambda +1/2,2\lambda )\) is an integer. Consequently the expansions converge uniformly on \([-1,1]\). Negative admissible parameters are included; \(\lambda =0\) is excluded because it does not give a polynomial basis.

Lean Formalisation
theorem Polynomial.gegenbauer_kernel_eq_jacobi {lam : ℝ} (hlam : -(1 / 2) < lam) (hzero : lam ≠ 0) (N : ℕ) (x y : ℝ) :
  (Polynomial.gegenbauerSequence hlam hzero).kernel (Polynomial.gegenbauerMeasure lam) N x y ⋯ =
    (Polynomial.jacobiSequence ⋯ ⋯).kernel (Polynomial.jacobiMeasure (lam - 1 / 2) (lam - 1 / 2)) N x y ⋯
Lean proof
/-- The Gegenbauer reproducing kernel is the symmetric Jacobi kernel. -/
theorem gegenbauer_kernel_eq_jacobi (N : ℕ) (x y : ℝ) :
    (gegenbauerSequence hlam hzero).kernel (gegenbauerMeasure lam) N x y (Polynomial.Sequence.KernelInput.of _ _ _ (hi := fun _ => (hasFiniteMoments_gegenbauerMeasure hlam).integrable_mul _ _)) =
      (jacobiSequence (show -1 < lam - 1 / 2 by linarith)
        (show -1 < lam - 1 / 2 by linarith)).kernel
        (jacobiMeasure (lam - 1 / 2) (lam - 1 / 2)) N x y (Polynomial.Sequence.KernelInput.of _ _ _ (hi := fun _ => (hasFiniteMoments_jacobiMeasure (by linarith) (by linarith)).integrable_mul _ _) (_hn := fun k => (Sequence.squaredNorm_pos
            (hasPositiveDefiniteIntegral_jacobiMeasure (by linarith) (by linarith)) _ k).ne')) := by
  rw [Sequence.kernel_of_positive (hasPositiveDefiniteIntegral_gegenbauerMeasure hlam)
    (gegenbauerSequence hlam hzero),
    Sequence.kernel_of_positive (hasPositiveDefiniteIntegral_jacobiMeasure
      (show -1 < lam - 1 / 2 by linarith) (show -1 < lam - 1 / 2 by linarith))
      (jacobiSequence (show -1 < lam - 1 / 2 by linarith) (show -1 < lam - 1 / 2 by linarith))]
  simp only [gegenbauerSequence_apply, jacobiSequence_apply,
    squaredNorm_gegenbauerSequence, squaredNorm_jacobiSequence]
  apply Finset.sum_congr rfl
  intro n _
  rw [integral_sq_gegenbauer_eq_jacobi hlam, gegenbauer_eq_jacobi_mul hlam]
  simp only [eval_mul, eval_C]
  have hc := gegenbauer_jacobi_factor_ne_zero hlam hzero n
  have hn := (integral_sq_jacobi_pos (by linarith : -1 < lam - 1 / 2)
    (by linarith : -1 < lam - 1 / 2) n).ne'
  generalize (ascPochhammer ℝ n).eval (2 * lam) /
    (ascPochhammer ℝ n).eval (lam + 1 / 2) = c at *
  field_simp [hc, hn]
source
Positivity of explicit growth constants

For \(a,\alpha ,\beta {\gt}-1\), every squared norm \(h_n\) is strictly positive, \(E_k(a){\gt}0\), \(B_k(\alpha ,\beta ){\gt}0\), and \(C_k(\alpha ,\beta )\ge 0\). Thus the reciprocals appearing in these constants are reciprocals of genuine nonzero values, and the Gamma argument \(a+1\) lies in the positive half-line.

Lean Formalisation
theorem Polynomial.jacobiEndpointBound_pos {a : ℝ} (ha : -1 < a) (k : ℕ) : 0 < Polynomial.jacobiEndpointBound ⟨a, ⋯⟩ k
Lean proof
/-- The endpoint-growth constant is positive throughout the integrable range. -/
theorem jacobiEndpointBound_pos {a : ℝ} (ha : -1 < a) (k : ℕ) :
    0 < jacobiEndpointBound ⟨a, (GammaPoint.ofPos (a + 1) (by linarith)).property⟩ k := by
  have hg := Gamma_pos_of_pos (show 0 < a + 1 by linarith)
  unfold jacobiEndpointBound
  change 0 < 1 + |a + 1| + ((k : ℝ) + 1) ^ k / Gamma (a + 1)
  positivity
source

3.5.3 Complex data and differentiation

Complex coefficients use the same real orthogonal basis. Differentiating Jacobi expansions shifts both parameters; normal convergence justifies the termwise formulas.

The domains \(\mathcal A_{\mu ,p}^{\mathbb K}\) and \(\mathcal A_{\mu ,P,\le N}^{\mathbb K}\) require an integrable numerator and a finite positive squared norm for each coefficient being taken (Definitions 3.1.37 and 3.1.44).

For \(\mathbb K=\mathbb {R}\) or \(\mathbb {C}\), embed the existing real polynomial functions and normalized vectors in \(L^2(\mu ;\mathbb K)\) at positive-norm indices. The scalar kernel vector is the real kernel vector embedded into this space, at a cutoff with positive squared norms throughout. For \(f\in \mathcal A_{\mu ,P_n}^{\mathbb K}\) and \(f\in \mathcal A_{\mu ,P,\le N}^{\mathbb K}\), respectively, define

\[ a_n^{\mathbb K}(f)=h_n^{-1}\int f(x)P_n(x)\, d\mu (x),\qquad S_N^{\mathbb K}f(x)=\sum _{n=0}^N a_n^{\mathbb K}(f)P_n(x). \]

For \(f\) in the respective domains \(\mathcal A_{\mu _{\alpha ,\beta },P_n^{(\alpha ,\beta )}}^{\mathbb {C}}\) and \(\mathcal A_{\mu _\lambda ,C_n^{(\lambda )}}^{\mathbb {C}}\), define the complex Jacobi and Gegenbauer coefficients \(h_n^{-1}\int fP_n^{(\alpha ,\beta )}\, d\mu _{\alpha ,\beta }\) and \(h_n^{-1}\int fC_n^{(\lambda )}\, d\mu _\lambda \), with \(h_n\) the corresponding squared norms, in the original polynomial normalizations.

Reference: [DLMF, 18.18].

Lean Formalisation
def Polynomial.polynomialToL2Scalar.{u_1} (𝕂 : Type u_1) [RCLike 𝕂] {μ : MeasureTheory.Measure ℝ}
  (hμ : Polynomial.HasFiniteMoments μ) : Polynomial ℝ →ₗ[ℝ] ↥(MeasureTheory.Lp 𝕂 2 μ)
Lean definition
/-- Real polynomial evaluation as a real-linear map into real or complex L². -/
@[expose] noncomputable def polynomialToL2Scalar : ℝ[X] →ₗ[ℝ] Lp 𝕂 2 μ :=
  ((@RCLike.ofRealCLM 𝕂 _).compLpₗ 2 μ).comp (polynomialToL2 hμ)
source

Let \(P\) be orthogonal for a positive-definite measure with finite moments and almost-everywhere support in \([-1,1]\). Let \(\rho {\gt}1\), let \(F\) be analytic on the open ellipse \(E_\rho \) with \(|F|\le M\), and let \(f\in L^2(\mu ;\mathbb {C})\) equal \(F\) almost everywhere on the real axis. With \(\varepsilon _N=2M/[\rho ^N(\rho -1)]\),

\[ \| f-S_N^{\mathbb {C}}f\| _2\le \sqrt{\mu (\mathbb {R})}\varepsilon _N,\qquad |F(x)-S_N^{\mathbb {C}}f(x)|\le (1+\sqrt{K_N(x,x)}\sqrt{\mu (\mathbb {R})})\varepsilon _N \]

for \(x\in [-1,1]\). No connected-support or density hypothesis is needed.

Reference: [ATAP, Theorem 8.2].

Lean Formalisation
theorem Polynomial.Sequence.IsOrthogonal.norm_sub_sum_integralCoefficientScalar_le_of_analytic {μ : MeasureTheory.Measure ℝ}
  {P : Polynomial.Sequence ℝ} (hμ : Polynomial.HasFiniteMoments μ) (hP : P.IsOrthogonal μ)
  (hpos : Polynomial.HasPositiveDefiniteIntegral μ) (hsupp : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc (-1) 1) {F : ℂ → ℂ} {ρ M : ℝ}
  (hρ : 1 < ρ) (hF : AnalyticOnNhd ℂ F (Complex.bernsteinEllipse ⟨ρ, hρ⟩))
  (hM : ∀ z ∈ Complex.bernsteinEllipse ⟨ρ, hρ⟩, ‖F z‖ ≤ M) (f : ↥(MeasureTheory.Lp ℂ 2 μ))
  (hf : ∀ᵐ (x : ℝ) ∂μ, ↑↑f x = F ↑x) (N : ℕ) :
  ‖f -
        ∑ i ∈ Finset.range (N + 1),
          Polynomial.Sequence.integralCoefficientScalar ℂ P μ
              (Polynomial.IntegralCoefficientInput.ofL2 hμ hpos (↑P i) ⋯ f) •
            (Polynomial.polynomialToL2Scalar ℂ hμ) (↑P i)‖ ≤
    √(μ.real Set.univ) * (2 * M / (ρ ^ N * (ρ - 1)))
Lean proof
/-- Complex orthogonal partial sums inherit the geometric weighted L² bound
from the complex Chebyshev competitor. -/
theorem IsOrthogonal.norm_sub_sum_integralCoefficientScalar_le_of_analytic
    (hP : P.IsOrthogonal μ) (hpos : HasPositiveDefiniteIntegral μ)
    (hsupp : ∀ᵐ x ∂μ, x ∈ Icc (-1 : ℝ) 1) {F : ℂ → ℂ} {ρ M : ℝ}
    (hρ : 1 < ρ) (hF : AnalyticOnNhd ℂ F (bernsteinEllipse ⟨ρ, hρ⟩))
    (hM : ∀ z ∈ bernsteinEllipse ⟨ρ, hρ⟩, ‖F z‖ ≤ M)
    (f : Lp ℂ 2 μ) (hf : ∀ᵐ x ∂μ, f x = F x) (N : ℕ) :
    ‖f - ∑ i ∈ Finset.range (N + 1), P.integralCoefficientScalar ℂ μ (IntegralCoefficientInput.ofL2 hμ hpos (P i) (P.ne_zero i) f) •
      polynomialToL2Scalar ℂ hμ (P i)‖ ≤
      √(μ.real univ) * (2 * M / (ρ ^ N * (ρ - 1))) := by
  have hb := (hP.orthonormal_normalizedToL2Scalar ℂ hμ hpos).norm_sub_sum_inner_le_of_mem_span
    (Finset.range (N + 1)) f (complexChebyshevToL2 hμ ⟨(fun x : ℝ ↦ F x), Chebyshev.integrable_classicalMeasureT_complex (Chebyshev.continuousOn_real_of_analytic hρ hF)⟩ N)
    (complexChebyshevToL2_mem_span hμ hpos ⟨(fun x : ℝ ↦ F x), Chebyshev.integrable_classicalMeasureT_complex (Chebyshev.continuousOn_real_of_analytic hρ hF)⟩ N)
  simp only [inner_normalizedToL2Scalar_smul ℂ hμ hpos] at hb
  exact hb.trans (norm_sub_complexChebyshevToL2_le_of_analytic hμ hsupp hρ hF hM f hf N)
source
Theorem 3.5.14 Jacobi series differentiation with parameter shift
✓ 🤖

For complex \(\alpha ,\beta \), suppose \(a_nP_n^{(\alpha ,\beta )}\) has a summable uniform majorant on an open set \(U\). Then throughout \(U\),

\[ \frac{d}{dz}\sum _{n\ge 0}a_nP_n^{(\alpha ,\beta )}(z) =\sum _{n\ge 0}\frac{n+\alpha +\beta +2}{2}\, a_{n+1} P_n^{(\alpha +1,\beta +1)}(z). \]

No real-weight parameter restrictions are required for this identity.

Reference: [DLMF, 18.9.15].

Lean Formalisation
theorem Polynomial.hasSum_derivative_jacobi_series (α β : ℂ) {a : ℕ → ℂ} {u : ℕ → ℝ} {U : Set ℂ} (hU : IsOpen U)
  (hu : Summable u) (hb : ∀ (n : ℕ), ∀ z ∈ U, ‖a n * Polynomial.eval z (Polynomial.jacobi α β n)‖ ≤ u n) {z : ℂ}
  (hz : z ∈ U) :
  HasSum (fun n => a (n + 1) * (↑n + α + β + 2) / 2 * Polynomial.eval z (Polynomial.jacobi (α + 1) (β + 1) n))
    (deriv (fun w => ∑' (n : ℕ), a n * Polynomial.eval w (Polynomial.jacobi α β n)) z)
Lean proof
/-- Jacobi differentiation shifts both parameters, under an explicit summable
uniform bound on the original series. The parameters may be complex. -/
theorem hasSum_derivative_jacobi_series (α β : ℂ) {a : ℕ → ℂ} {u : ℕ → ℝ}
    {U : Set ℂ} (hU : IsOpen U) (hu : Summable u)
    (hb : ∀ n z, z ∈ U → ‖a n * (jacobi α β n).eval z‖ ≤ u n)
    {z : ℂ} (hz : z ∈ U) :
    HasSum (fun n ↦ a (n + 1) * ((n : ℂ) + α + β + 2) / 2 *
      (jacobi (α + 1) (β + 1) n).eval z)
      (deriv (fun w ↦ ∑' n, a n * (jacobi α β n).eval w) z) := by
  have h := hasSum_derivative_series hU hu hb hz
  have ht := (hasSum_nat_add_iff' 1).2 h
  simp only [Finset.sum_range_one, jacobi_zero, derivative_one, eval_zero, mul_zero,
    sub_zero] at ht
  convert ht using 1
  ext n
  rw [derivative_jacobi_succ]
  simp only [eval_mul, eval_C, map_div₀, map_one, map_ofNat]
  ring
source
Theorem 3.5.15 Higher derivatives of Jacobi series
✓ 🤖

For complex \(\alpha ,\beta \), let \(U\subset \mathbb {C}\) be open and suppose \(\sum _n u_n{\lt}\infty \) with \(|a_nP_n^{(\alpha ,\beta )}(z)|\le u_n\) for every \(z\in U\). For \(S(z)=\sum _n a_nP_n^{(\alpha ,\beta )}(z)\),

\[ S^{(k)}(z)=\sum _{n\ge 0}a_{n+k} \left[\prod _{j=0}^{k-1}\frac{n+k+\alpha +\beta +j+1}{2}\right] P_n^{(\alpha +k,\beta +k)}(z). \]

Reference: [DLMF, 18.9.15], iterated.

Lean Formalisation
theorem Polynomial.hasSum_iterated_derivative_jacobi_series (α β : ℂ) {a : ℕ → ℂ} {u : ℕ → ℝ} {U : Set ℂ} (hU : IsOpen U)
  (hu : Summable u) (hb : ∀ (n : ℕ), ∀ z ∈ U, ‖a n * Polynomial.eval z (Polynomial.jacobi α β n)‖ ≤ u n) (k : ℕ) {z : ℂ}
  (hz : z ∈ U) :
  HasSum
    (fun n =>
      (a (n + k) * ∏ j ∈ Finset.range k, 1 / 2 * (↑n + ↑k + α + β + ↑j + 1)) *
        Polynomial.eval z (Polynomial.jacobi (α + ↑k) (β + ↑k) n))
    (iteratedDeriv k (fun w => ∑' (n : ℕ), a n * Polynomial.eval w (Polynomial.jacobi α β n)) z)
Lean proof
/-- Differentiating k times removes the first k modes and shifts both Jacobi
parameters by k, with the finite-product rising-factorial coefficient. -/
theorem hasSum_iterated_derivative_jacobi_series (α β : ℂ) {a : ℕ → ℂ} {u : ℕ → ℝ}
    {U : Set ℂ} (hU : IsOpen U) (hu : Summable u)
    (hb : ∀ n z, z ∈ U → ‖a n * (jacobi α β n).eval z‖ ≤ u n)
    (k : ℕ) {z : ℂ} (hz : z ∈ U) :
    HasSum (fun n ↦ a (n + k) *
      (∏ j ∈ Finset.range k, (1 / 2 : ℂ) * ((n + k : ℂ) + α + β + j + 1)) *
        (jacobi (α + k) (β + k) n).eval z)
      (iteratedDeriv k (fun w ↦ ∑' n, a n * (jacobi α β n).eval w) z) := by
  have hs := hasSum_iterated_derivative_series (P := jacobi α β) (a := a) hU hu hb k hz
  have ht := (hasSum_nat_add_iff' k).2 hs
  have hz0 : ∑ n ∈ Finset.range k, a n * (derivative^[k] (jacobi α β n)).eval z = 0 := by
    apply Finset.sum_eq_zero
    intro n hn
    rw [iterate_derivative_jacobi_eq_zero α β (Finset.mem_range.mp hn), eval_zero, mul_zero]
  rw [hz0, sub_zero] at ht
  simpa only [iterate_derivative_jacobi, eval_mul, eval_C, map_div₀, map_one,
    map_ofNat, mul_assoc] using ht
source
Projection constructions, kernel estimates and growth proofs
Theorem 3.5.16 Scalar normalization and kernel-vector formulas
✓ 🤖

Let \(\mathbb K=\mathbb R\) or \(\mathbb C\). At a positive-norm index, the scalar normalized vector is \(h_n^{-1/2}J_\mu ^{\mathbb K}P_n\). At a kernel cutoff, the scalar kernel vector is the scalar embedding of \(v_{N,x}\).

Lean Formalisation
theorem Polynomial.Sequence.normalizedToL2Scalar_eq.{u_1} (𝕂 : Type u_1) [RCLike 𝕂] {μ : MeasureTheory.Measure ℝ}
  (hμ : Polynomial.HasFiniteMoments μ) (P : Polynomial.Sequence ℝ) (n : { n // 0 < P.squaredNorm μ n ⋯ }) :
  Polynomial.Sequence.normalizedToL2Scalar 𝕂 hμ P n =
    ↑(√(P.squaredNorm μ ↑n ⋯))⁻¹ • (Polynomial.polynomialToL2Scalar 𝕂 hμ) (↑P ↑n)
Lean proof
/-- Scalar extension retains the original square-root normalization. -/
theorem normalizedToL2Scalar_eq (n : {n : ℕ // 0 < P.squaredNorm μ n (Polynomial.Sequence.IntegrableSquare.of _ _)}) :
    P.normalizedToL2Scalar 𝕂 hμ n =
      (((√(P.squaredNorm μ n (Polynomial.Sequence.IntegrableSquare.of _ _)))⁻¹ : ℝ) : 𝕂) • polynomialToL2Scalar 𝕂 hμ (P n) := by
  change ((@RCLike.ofRealCLM 𝕂 _).compLpₗ 2 μ)
    ((√(P.squaredNorm μ n (Polynomial.Sequence.IntegrableSquare.of _ _)))⁻¹ • polynomialToL2 hμ (P n)) = _
  rw [map_smul, RCLike.real_smul_eq_coe_smul (K := 𝕂)]
  rfl
source
Theorem 3.5.17 Classical scalar coefficient and partial sum formulas
✓ 🤖

Let \(\mathbb K=\mathbb R\) or \(\mathbb C\). For \(f\in \mathcal A_{\mu ,P_n}^{\mathbb K}\), \(a_n^{\mathbb K}(f)=(\int P_n^2\, d\mu )^{-1}\int fP_n\, d\mu \), with the real denominator embedded in \(\mathbb K\). For \(f\in \mathcal A_{\mu ,P,\le N}^{\mathbb K}\), \(S_N^{\mathbb K}f(x)=\sum _{n=0}^N a_n^{\mathbb K}(f)P_n(x)\).

Lean Formalisation
theorem Polynomial.Sequence.integralCoefficientScalar_apply.{u_1} (𝕂 : Type u_1) [RCLike 𝕂] (P : Polynomial.Sequence ℝ)
  (μ : MeasureTheory.Measure ℝ) {n : ℕ} (f : Polynomial.IntegralCoefficientInput 𝕂 μ (↑P n)) :
  Polynomial.Sequence.integralCoefficientScalar 𝕂 P μ f =
    (↑(∫ (x : ℝ), Polynomial.eval x (↑P n) ^ 2 ∂μ))⁻¹ * ∫ (x : ℝ), f.val x * ↑(Polynomial.eval x (↑P n)) ∂μ
Lean proof
/-- The classical scalar coefficient formula (DLMF 18.2(viii)). -/
theorem integralCoefficientScalar_apply (μ : Measure ℝ) {n : ℕ}
    (f : IntegralCoefficientInput 𝕂 μ (P n)) :
    P.integralCoefficientScalar 𝕂 μ f = ((∫ x, (P n).eval x ^ 2 ∂μ : ℝ) : 𝕂)⁻¹ *
      ∫ x, f.val x * (((P n).eval x : ℝ) : 𝕂) ∂μ := by
  simp only [integralCoefficientScalar, squaredNorm, integralInner_self]
source

For \(f\in \mathcal A_{\mu _{\alpha ,\beta },P_n^{(\alpha ,\beta )}}^{\mathbb {C}}\), the complex Jacobi coefficient is

\[ \frac{\int fP_n^{(\alpha ,\beta )}\, d\mu _{\alpha ,\beta }}{\int (P_n^{(\alpha ,\beta )})^2\, d\mu _{\alpha ,\beta }}. \]

For \(f\in \mathcal A_{\mu _\lambda ,C_n^{(\lambda )}}^{\mathbb {C}}\), the complex Gegenbauer coefficient is

\[ \frac{\int fC_n^{(\lambda )}\, d\mu _\lambda }{\int (C_n^{(\lambda )})^2\, d\mu _\lambda }. \]

Both numerators are integrals of integrable functions and both denominators are finite and positive. For real-valued \(f\) these equal the real coefficients viewed in \(\mathbb {C}\).

Lean Formalisation
theorem Polynomial.jacobiComplexCoefficient_apply (α β : ℝ) {n : ℕ}
  (f : Polynomial.IntegralCoefficientInput ℂ (Polynomial.jacobiMeasure α β) (Polynomial.jacobi α β n)) :
  Polynomial.jacobiComplexCoefficient α β f =
    (↑(∫ (x : ℝ), Polynomial.eval x (Polynomial.jacobi α β n) ^ 2 ∂Polynomial.jacobiMeasure α β))⁻¹ *
      ∫ (x : ℝ), f.val x * ↑(Polynomial.eval x (Polynomial.jacobi α β n)) ∂Polynomial.jacobiMeasure α β
Lean proof
/-- The classical complex weighted formula (DLMF 18.18). -/
theorem jacobiComplexCoefficient_apply (α β : ℝ) {n : ℕ}
    (f : IntegralCoefficientInput ℂ (jacobiMeasure α β) (jacobi α β n)) :
    jacobiComplexCoefficient α β f =
      ((∫ x, (jacobi α β n).eval x ^ 2 ∂jacobiMeasure α β : ℝ) : ℂ)⁻¹ *
        ∫ x, f.val x * (((jacobi α β n).eval x : ℝ) : ℂ) ∂jacobiMeasure α β := rfl
source
Definition 3.5.19 Complex Chebyshev truncation in a weighted space
✓ 🤖

Let \(\mu \) have all moments finite and let \(f\in \mathcal L^1_T(\mathbb {C})\). The degree-\(N\) Chebyshev truncation in \(L^2(\mu ;\mathbb {C})\) is

\[ q_N=\sum _{n=0}^N a_n(f)[T_n], \]

where \([T_n]\) denotes the polynomial’s \(L^2(\mu ;\mathbb {C})\) class. Reference: [ATAP, Theorem 8.2].

Lean Formalisation
def Polynomial.complexChebyshevToL2 {μ : MeasureTheory.Measure ℝ} (hμ : Polynomial.HasFiniteMoments μ)
  (F : Polynomial.Chebyshev.ComplexIntegrableInput) (N : ℕ) : ↥(MeasureTheory.Lp ℂ 2 μ)
Lean definition
/-- The complex Chebyshev truncation, viewed in an arbitrary weighted L² space. -/
@[expose] noncomputable def complexChebyshevToL2 (F : Chebyshev.ComplexIntegrableInput) (N : ℕ) : Lp ℂ 2 μ :=
  ∑ n ∈ Finset.range (N + 1), Chebyshev.complexCoefficient (Chebyshev.ComplexCoefficientInput.ofL1 F n) •
    polynomialToL2Scalar ℂ hμ (Chebyshev.T ℝ n)
source
Theorem 3.5.20 Weighted Chebyshev truncation representation
✓ 🤖

For \(f\in \mathcal L^1_T(\mathbb {C})\), the weighted truncation is represented \(\mu \)-almost everywhere by \(\sum _{n=0}^N a_n(f)T_n(x)\).

Lean Formalisation
theorem Polynomial.coe_complexChebyshevToL2 {μ : MeasureTheory.Measure ℝ} (hμ : Polynomial.HasFiniteMoments μ)
  (F : Polynomial.Chebyshev.ComplexIntegrableInput) (N : ℕ) :
  ↑↑(Polynomial.complexChebyshevToL2 hμ F N) =ᵐ[μ] fun x =>
    ∑ n ∈ Finset.range (N + 1),
      Polynomial.Chebyshev.complexCoefficient (Polynomial.Chebyshev.ComplexCoefficientInput.ofL1 F n) *
        ↑(Polynomial.eval x (Polynomial.Chebyshev.T ℝ ↑n))
Lean proof
/-- The finite polynomial formula represents the weighted L² competitor. -/
theorem coe_complexChebyshevToL2 (F : Chebyshev.ComplexIntegrableInput) (N : ℕ) :
    complexChebyshevToL2 hμ F N =ᵐ[μ] fun x : ℝ ↦
      ∑ n ∈ Finset.range (N + 1), Chebyshev.complexCoefficient (Chebyshev.ComplexCoefficientInput.ofL1 F n) *
        (((Chebyshev.T ℝ n).eval x : ℝ) : ℂ) := by
  have hterm (n : ℕ) :
      (Chebyshev.complexCoefficient (Chebyshev.ComplexCoefficientInput.ofL1 F n) •
        polynomialToL2Scalar ℂ hμ (Chebyshev.T ℝ n) : Lp ℂ 2 μ) =ᵐ[μ]
      fun x : ℝ ↦ Chebyshev.complexCoefficient (Chebyshev.ComplexCoefficientInput.ofL1 F n) *
        (((Chebyshev.T ℝ n).eval x : ℝ) : ℂ) := by
    filter_upwards [Lp.coeFn_smul (Chebyshev.complexCoefficient (Chebyshev.ComplexCoefficientInput.ofL1 F n))
      (polynomialToL2Scalar ℂ hμ (Chebyshev.T ℝ n)),
      coe_polynomialToL2Scalar ℂ hμ (Chebyshev.T ℝ n)] with x hs hp
    rw [hs]
    exact congrArg (fun z : ℂ ↦ Chebyshev.complexCoefficient (Chebyshev.ComplexCoefficientInput.ofL1 F n) * z) hp
  have hsum := eventuallyEq_sum (s := Finset.range (N + 1)) (fun n _ ↦ hterm n)
  apply (Lp.coeFn_finsetSum _ _).trans
  apply hsum.trans
  exact Filter.Eventually.of_forall (fun x ↦ by simp only [Finset.sum_apply])
source

For an orthonormal family \(v_i\) in a real or complex inner-product space and a finite index set \(s\), the sum \(Q_s f=\sum _{i\in s}\langle v_i,f\rangle v_i\) minimises \(\| f-y\| \) over the span of the selected vectors. Its residual is orthogonal to that span. No completeness or Hilbert-basis hypothesis is needed.

Reference: the Hilbert-space best-approximation theorem.

Lean Formalisation
theorem Orthonormal.inner_sub_sum_inner_sum_eq_zero.{u_1, u_2, u_3} {𝕂 : Type u_1} {E : Type u_2} {ι : Type u_3} [RCLike 𝕂]
  [NormedAddCommGroup E] [InnerProductSpace 𝕂 E] {v : ι → E} (hv : Orthonormal 𝕂 v) (s : Finset ι) (x : E) (c : ι → 𝕂) :
  inner 𝕂 (x - ∑ i ∈ s, inner 𝕂 (v i) x • v i) (∑ i ∈ s, c i • v i) = 0
Lean proof
/-- The residual of a finite orthonormal expansion is orthogonal to every
linear combination of the selected vectors. -/
theorem Orthonormal.inner_sub_sum_inner_sum_eq_zero {v : ι → E}
    (hv : Orthonormal 𝕂 v) (s : Finset ι) (x : E) (c : ι → 𝕂) :
    inner 𝕂 (x - ∑ i ∈ s, inner 𝕂 (v i) x • v i) (∑ i ∈ s, c i • v i) = 0 := by
  rw [inner_sum]
  apply Finset.sum_eq_zero
  intro i hi
  rw [inner_smul_right]
  have h : inner 𝕂 (v i) (x - ∑ j ∈ s, inner 𝕂 (v j) x • v j) = 0 := by
    rw [inner_sub_right, hv.inner_right_sum _ hi, sub_self]
  rw [inner_eq_zero_symm.mp h, mul_zero]
source
Theorem 3.5.22 Real analytic polynomial competitors
✓ 🤖

If \(\rho {\gt}1\) and \(F\) is analytic and bounded in norm by \(M\) in the open ellipse \(E_\rho \), there is a real polynomial \(p_N\) of degree at most \(N\) satisfying

\[ |\operatorname {Re}F(x)-p_N(x)|\le \frac{2M}{\rho ^N(\rho -1)} \qquad (-1\le x\le 1). \]

No boundary regularity is needed.

Reference: [ATAP, Theorem 8.2].

Lean Formalisation
theorem Polynomial.Chebyshev.exists_real_polynomial_approximation_of_analytic {f : ℂ → ℂ} {ρ M : ℝ} (hρ : 1 < ρ)
  (hf : AnalyticOnNhd ℂ f (Complex.bernsteinEllipse ⟨ρ, hρ⟩)) (hb : ∀ z ∈ Complex.bernsteinEllipse ⟨ρ, hρ⟩, ‖f z‖ ≤ M)
  (N : ℕ) : ∃ p, p.degree ≤ ↑N ∧ ∀ x ∈ Set.Icc (-1) 1, ‖(f ↑x).re - Polynomial.eval x p‖ ≤ 2 * M / (ρ ^ N * (ρ - 1))
Lean proof
/-- A real polynomial competitor for the real part of an analytic function,
with the usual geometric error bound and no boundary regularity hypothesis. -/
theorem exists_real_polynomial_approximation_of_analytic {f : ℂ → ℂ} {ρ M : ℝ}
    (hρ : 1 < ρ) (hf : AnalyticOnNhd ℂ f (bernsteinEllipse ⟨ρ, hρ⟩))
    (hb : ∀ z ∈ bernsteinEllipse ⟨ρ, hρ⟩, ‖f z‖ ≤ M) (N : ℕ) :
    ∃ p : ℝ[X], p.degree ≤ N ∧ ∀ x ∈ Icc (-1 : ℝ) 1,
      ‖(f x).re - p.eval x‖ ≤ 2 * M / (ρ ^ N * (ρ - 1)) := by
  let c := fun n ↦ (complexCoefficient (ComplexCoefficientInput.ofContinuousOn (fun t : ℝ ↦ f t) (continuousOn_real_of_analytic hρ hf) n))
  let p : ℝ[X] := ∑ n ∈ Finset.range (N + 1), (c n).re • T ℝ n
  refine ⟨p, ?_, ?_⟩
  · apply (degree_sum_le _ _).trans
    apply Finset.sup_le
    intro n hn
    apply (degree_smul_le _ _).trans
    simpa only [degree_T, Int.natAbs_natCast, Nat.cast_le] using
      (Nat.lt_succ_iff.mp (Finset.mem_range.mp hn))
  · intro x hx
    have he : (f x).re - p.eval x =
        (f x - ∑ n ∈ Finset.range (N + 1), c n * (((T ℝ n).eval x : ℝ) : ℂ)).re := by
      simp [p, eval_finsetSum, mul_re]
    rw [he, Real.norm_eq_abs]
    exact (abs_re_le_norm _).trans (norm_sub_sum_complexCoefficient_le_of_analytic hρ hf hb hx N)
source

Under finite moments, positive definiteness, and orthogonality, the polynomial map into L2 is injective, \(\deg S_Nf\le N\), and \(S_N\) reproduces every polynomial of degree at most \(N\). It respects subtraction and has weighted L2 norm at most one. These statements impose no support or density hypothesis.

Lean Formalisation
theorem Polynomial.polynomialToL2_injective {μ : MeasureTheory.Measure ℝ} (hμ : Polynomial.HasFiniteMoments μ)
  (hpos : Polynomial.HasPositiveDefiniteIntegral μ) : Function.Injective ⇑(Polynomial.polynomialToL2 hμ)
Lean proof
/-- Positive definiteness makes polynomial evaluation into L² injective. -/
theorem polynomialToL2_injective (hpos : HasPositiveDefiniteIntegral μ) :
    Function.Injective (polynomialToL2 hμ) := by
  have hz (p : ℝ[X]) (hp : polynomialToL2 hμ p = 0) : p = 0 := by
    by_contra hn
    have h := hpos p hn
    have he := inner_polynomialToL2 hμ p p
    rw [hp, inner_zero_left] at he
    have he' : (∫ x, p.eval x ^ 2 ∂μ) = 0 := by
      simpa only [pow_two] using he.symm
    rw [he'] at h
    exact (lt_irrefl 0) h
  intro p q he
  exact sub_eq_zero.mp (hz (p - q) (by rw [map_sub, he, sub_self]))
source
Theorem 3.5.24 Analytic projection error with kernel factor
✓ 🤖

Let \(P\) be orthogonal for a measure \(\mu \) with finite polynomial moments and positive definite polynomial pairing, supported almost everywhere on \([-1,1]\). Let \(\rho {\gt}1\), let \(F\) be analytic on \(E_\rho \) with \(|F|\le M\) there, and let \(f\in L^2(\mu ;\mathbb {R})\) agree almost everywhere with \(\operatorname {Re}F\). Then for every \(x\in [-1,1]\),

\[ |\operatorname {Re}F(x)-(S_Nf)(x)|\le (1+\sqrt{K_N(x,x)}\sqrt{\mu (\mathbb {R})}) \frac{2M}{\rho ^N(\rho -1)}. \]
Lean Formalisation
theorem Polynomial.Sequence.IsOrthogonal.norm_sub_eval_partialSum_le_kernel_of_analytic {μ : MeasureTheory.Measure ℝ}
  {P : Polynomial.Sequence ℝ} (hμ : Polynomial.HasFiniteMoments μ) (hP : P.IsOrthogonal μ)
  (hpos : Polynomial.HasPositiveDefiniteIntegral μ) (hsupp : ∀ᵐ (x : ℝ) ∂μ, x ∈ Set.Icc (-1) 1) {F : ℂ → ℂ} {ρ M : ℝ}
  (hρ : 1 < ρ) (hF : AnalyticOnNhd ℂ F (Complex.bernsteinEllipse ⟨ρ, hρ⟩))
  (hM : ∀ z ∈ Complex.bernsteinEllipse ⟨ρ, hρ⟩, ‖F z‖ ≤ M) (f : ↥(MeasureTheory.Lp ℝ 2 μ))
  (hf : ∀ᵐ (x : ℝ) ∂μ, ↑↑f x = (F ↑x).re) (N : ℕ) {x : ℝ} (hx : x ∈ Set.Icc (-1) 1) :
  ‖(F ↑x).re - Polynomial.eval x (P.partialSum μ (Polynomial.IntegralCoefficientFamilyInput.ofL2 hμ hpos P f N))‖ ≤
    (1 + √(P.kernel μ N x x ⋯) * √(μ.real Set.univ)) * (2 * M / (ρ ^ N * (ρ - 1)))
Lean proof
/-- The analytic competitor also gives a pointwise bound for the actual
orthogonal partial sum, with its Christoffel kernel factor displayed. -/
theorem IsOrthogonal.norm_sub_eval_partialSum_le_kernel_of_analytic
    (hP : P.IsOrthogonal μ) (hpos : HasPositiveDefiniteIntegral μ)
    (hsupp : ∀ᵐ x ∂μ, x ∈ Icc (-1 : ℝ) 1)
    {F : ℂ → ℂ} {ρ M : ℝ} (hρ : 1 < ρ)
    (hF : AnalyticOnNhd ℂ F (bernsteinEllipse ⟨ρ, hρ⟩))
    (hM : ∀ z ∈ bernsteinEllipse ⟨ρ, hρ⟩, ‖F z‖ ≤ M)
    (f : Lp ℝ 2 μ) (hf : ∀ᵐ x ∂μ, f x = (F x).re)
    (N : ℕ) {x : ℝ} (hx : x ∈ Icc (-1 : ℝ) 1) :
    ‖(F x).re - (P.partialSum μ (IntegralCoefficientFamilyInput.ofL2 hμ hpos P f N)).eval x‖ ≤
      (1 + √(P.kernel μ N x x (Polynomial.Sequence.KernelInput.of _ _ _)) * √(μ.real univ)) *
        (2 * M / (ρ ^ N * (ρ - 1))) := by
  obtain ⟨p, hp, he⟩ := Chebyshev.exists_real_polynomial_approximation_of_analytic hρ hF hM N
  have hM0 : 0 ≤ M := (norm_nonneg (F x)).trans
    (hM x (ofReal_mem_bernsteinEllipse hρ hx))
  apply hP.norm_sub_eval_partialSum_le_kernel hμ hpos f N p hp (by positivity) _ x (F x).re
    (he x hx)
  filter_upwards [hf, hsupp] with t hft ht
  rw [hft]
  exact he t ht
source

A growth estimate on the kernel is still needed to infer uniform convergence.

Theorem 3.5.25 Elementary Gamma and rising-factorial growth bounds
✓ 🤖

For \(a{\gt}0\), \(\Gamma (a+n)=(a)_n\Gamma (a)\). If \(a\le k+1\) and \(n+a\ge 2\), \(\Gamma (n+a)\le n!(n+k)^k\). If \(n\ge 1\) and \(a\ge 1\), \(\Gamma (n+a)\ge n!\). For \(a{\gt}0\) and \(a\le k+1\), all \(n\ge 0\) satisfy

\[ \frac{(a)_n}{n!}\le \left(1+|a|+\frac{(k+1)^k}{\Gamma (a)}\right)(n+1)^k. \]

These bounds are nonsharp.

Reference: [DLMF, 5.5.1, 5.6].

Lean Formalisation
theorem Real.Gamma_add_nat_eq_ascPochhammer_mul {a : ℝ} (ha : 0 < a) (n : ℕ) :
  Real.GammaOn (Real.GammaPoint.ofPos (a + ↑n) ⋯) =
    Polynomial.eval a (ascPochhammer ℝ n) * Real.GammaOn (Real.GammaPoint.ofPos a ha)
Lean proof
/-- Gamma at a positive argument shifted by a natural number, within its domain. -/
theorem Gamma_add_nat_eq_ascPochhammer_mul {a : ℝ} (ha : 0 < a) (n : ℕ) :
    GammaOn (GammaPoint.ofPos (a + n) (by positivity)) =
      (ascPochhammer ℝ n).eval a * GammaOn (GammaPoint.ofPos a ha) :=
  Gamma_add_nat_eq_ascPochhammer_mul_raw ha n
source
Theorem 3.5.26 Jacobi endpoint control from the differential equation
✓ 🤖

For \(p=P_n^{(\alpha ,\beta )}\) and \(c=n(n+\alpha +\beta +1)\), the energy \(E(x)=cp(x)^2+(1-x^2)p'(x)^2\) satisfies \(E'(x)=2[\alpha -\beta +(\alpha +\beta +1)x]p'(x)^2\). If \(\alpha +\beta +1\ge 0\), then \(|p(x)|\le \max (|p(-1)|,|p(1)|)\) on \([-1,1]\). For every \(\alpha ,\beta {\gt}-1\), parameter raising instead bounds \(|P_{n+1}^{(\alpha ,\beta )}(x)|\) by the sum of the endpoint maxima of \(P_{n+1}^{(\alpha +1,\beta )}\) and \(P_n^{(\alpha +1,\beta )}\). Thus the final estimate covers the whole orthogonality range.

References: [DLMF, Table 18.8.1 and 18.9(ii)]; cf. [DLMF, 18.14(i)].

Lean Formalisation
theorem Polynomial.hasDerivAt_jacobiSoninEnergy (α β : ℝ) (n : ℕ) (x : ℝ) :
  HasDerivAt
    (fun t =>
      ↑n * (↑n + α + β + 1) * Polynomial.eval t (Polynomial.jacobi α β n) ^ 2 +
        (1 - t ^ 2) * Polynomial.eval t (Polynomial.derivative (Polynomial.jacobi α β n)) ^ 2)
    (2 * (α - β + (α + β + 1) * x) * Polynomial.eval x (Polynomial.derivative (Polynomial.jacobi α β n)) ^ 2) x
Lean proof
/-- The derivative of the Jacobi Sonin energy, with no division by the eigenvalue. -/
theorem hasDerivAt_jacobiSoninEnergy (α β : ℝ) (n : ℕ) (x : ℝ) :
    HasDerivAt (fun t : ℝ ↦ (n : ℝ) * (n + α + β + 1) * (jacobi α β n).eval t ^ 2 +
      (1 - t ^ 2) * (jacobi α β n).derivative.eval t ^ 2)
      (2 * (α - β + (α + β + 1) * x) * (jacobi α β n).derivative.eval x ^ 2) x := by
  let p := jacobi α β n
  have he := congrArg (fun q : ℝ[X] ↦ q.eval x) (jacobi_differentialEquation α β n)
  simp only [eval_add, eval_mul, eval_sub, eval_one, eval_pow, eval_X, eval_C, eval_zero] at he
  have hd := (((p.hasDerivAt x).pow 2).const_mul ((n : ℝ) * (n + α + β + 1))).add
    (((hasDerivAt_const x (1 : ℝ)).sub ((hasDerivAt_id x).pow 2)).mul
      ((p.derivative.hasDerivAt x).pow 2))
  convert hd using 1
  · rfl
  · dsimp [p]
    norm_num only [Nat.cast_ofNat, Nat.reduceSub, pow_one]
    linear_combination (-2 * ((jacobi α β n).derivative.eval x)) * he
source

Let \(\alpha ,\beta {\gt}-1\) and choose an integer \(k\ge \max (\alpha +1,\beta ,\alpha +\beta +1)\). For every \(n\ge 0\) and \(x\in [-1,1]\),

\begin{align*} |P_n^{(\alpha ,\beta )}(x)| & \le [1+2(E_k(\alpha +1)+E_k(\beta ))](n+1)^k,\\ h_n^{-1}& \le B_k(\alpha ,\beta )(n+1)^{k+2}. \end{align*}

The norms and the constants \(E_k\) and \(B_k\) are positive in this range.

Lean Formalisation
theorem Polynomial.abs_eval_jacobi_one_le_polynomial {α : ℝ} (hα : -1 < α) (β : ℝ) (k : ℕ) (hk : α ≤ ↑k) (n : ℕ) :
  |Polynomial.eval 1 (Polynomial.jacobi α β n)| ≤ Polynomial.jacobiEndpointBound ⟨α, ⋯⟩ k * (↑n + 1) ^ k
Lean proof
/-- Polynomial growth of the endpoint value, with any integer exponent k ≥ alpha. -/
theorem abs_eval_jacobi_one_le_polynomial {α : ℝ} (hα : -1 < α) (β : ℝ)
    (k : ℕ) (hk : α ≤ k) (n : ℕ) :
    |(jacobi α β n).eval 1| ≤ jacobiEndpointBound ⟨α, (GammaPoint.ofPos (α + 1) (by linarith)).property⟩ k * ((n : ℝ) + 1) ^ k := by
  have hp := ascPochhammer_pos n (α + 1) (by linarith : 0 < α + 1)
  rw [eval_jacobi_one]
  norm_num only [map_inv₀, map_natCast, Rat.cast_natCast]
  rw [abs_of_nonneg (mul_nonneg (inv_nonneg.mpr (Nat.cast_nonneg _)) hp.le)]
  simpa only [jacobiEndpointBound, GammaOn, GammaPoint.ofPos, div_eq_mul_inv, mul_comm] using
    ascPochhammer_div_factorial_le_polynomial (by linarith : 0 < α + 1) k (by linarith) n
source

For \(\alpha ,\beta {\gt}-1\) and an integer \(k\ge \max (\alpha +1,\beta ,\alpha +\beta +1)\), with \(C_k\) as in Theorem 3.5.11,

\[ K_N(x,x)\le C_k(\alpha ,\beta )(N+1)^{3k+3},\qquad \sqrt{K_N(x,x)}\le \sqrt{C_k(\alpha ,\beta )}(N+1)^{3k+3} \]

uniformly for \(x\in [-1,1]\).

Lean Formalisation
theorem Polynomial.jacobi_kernel_term_le_polynomial {α β : ℝ} (hα : -1 < α) (hβ : -1 < β) (k : ℕ) (hkα : α + 1 ≤ ↑k)
  (hkβ : β ≤ ↑k) (hks : α + β + 1 ≤ ↑k) (n : ℕ) {x : ℝ} (hx : x ∈ Set.Icc (-1) 1) :
  Polynomial.eval x (Polynomial.jacobi α β n) * Polynomial.eval x (Polynomial.jacobi α β n) /
      ∫ (t : ℝ), Polynomial.eval t (Polynomial.jacobi α β n) ^ 2 ∂Polynomial.jacobiMeasure α β ≤
    Polynomial.jacobiKernelBound ⟨α, hα⟩ ⟨β, hβ⟩ k * (↑n + 1) ^ (3 * k + 2)
Lean proof
/-- Each diagonal kernel summand has a uniform polynomial bound. -/
theorem jacobi_kernel_term_le_polynomial {α β : ℝ} (hα : -1 < α) (hβ : -1 < β)
    (k : ℕ) (hkα : α + 1 ≤ k) (hkβ : β ≤ k) (hks : α + β + 1 ≤ k)
    (n : ℕ) {x : ℝ} (hx : x ∈ Icc (-1 : ℝ) 1) :
    (jacobi α β n).eval x * (jacobi α β n).eval x /
        (∫ t, (jacobi α β n).eval t ^ 2 ∂jacobiMeasure α β) ≤
      jacobiKernelBound ⟨α, hα⟩ ⟨β, hβ⟩ k * ((n : ℝ) + 1) ^ (3 * k + 2) := by
  have hv := abs_eval_jacobi_le_polynomial hα hβ k hkα hkβ n hx
  have hi := inv_integral_sq_jacobi_le_polynomial hα hβ k hks n
  have hp := (integral_sq_jacobi_pos hα hβ n).le
  calc
    _ = |(jacobi α β n).eval x| ^ 2 *
        (∫ t, (jacobi α β n).eval t ^ 2 ∂jacobiMeasure α β)⁻¹ := by
      rw [sq_abs]
      ring
    _ ≤ ((1 + 2 * (jacobiEndpointBound ⟨α + 1, (GammaPoint.ofPos (α + 1 + 1) (by linarith)).property⟩ k + jacobiEndpointBound ⟨β, (GammaPoint.ofPos (β + 1) (by linarith)).property⟩ k)) *
          ((n : ℝ) + 1) ^ k) ^ 2 *
        (jacobiReciprocalNormBound ⟨α, hα⟩ ⟨β, hβ⟩ k * ((n : ℝ) + 1) ^ (k + 2)) :=
      mul_le_mul (pow_le_pow_left₀ (abs_nonneg _) hv 2) hi (inv_nonneg.mpr hp) (sq_nonneg _)
    _ = _ := by
      simp only [jacobiKernelBound, mul_pow, ← pow_mul]
      rw [show 3 * k + 2 = k * 2 + (k + 2) by omega, pow_add]
      ring
source

Let \(\mathbb K=\mathbb R\) or \(\mathbb C\). The real orthonormal vectors remain orthonormal after scalar extension. Degree-at-most-\(N\) real polynomials belong to their first \(N+1\)-dimensional \(\mathbb K\)-span. The lifted kernel vector represents \(S_N^{\mathbb K}\) and has norm \(\sqrt{K_N(x,x)}\). It reproduces degree-at-most-\(N\) real polynomials. The named complex classical coefficients agree with the real coefficients on admissible real inputs, and for \(\alpha ,\beta {\gt}-1\), respectively \(\lambda {\gt}-1/2\), \(\lambda \ne 0\), they are the scalar coefficients \(a_n^{\mathbb C}\) of the Jacobi, respectively Gegenbauer, sequence, on the coefficient domains of Definition 3.5.12.

Reference: [DLMF, 18.2(viii), 18.18].

Lean Formalisation
theorem inner_ofReal_compLp.{u_1} (𝕂 : Type u_1) [RCLike 𝕂] {μ : MeasureTheory.Measure ℝ} (f g : ↥(MeasureTheory.Lp ℝ 2 μ)) :
  inner 𝕂 (RCLike.ofRealCLM.compLp f) (RCLike.ofRealCLM.compLp g) = ↑(inner ℝ f g)
Lean proof
/-- Extending real-valued L² classes preserves their inner products. -/
theorem inner_ofReal_compLp (f g : Lp ℝ 2 μ) :
    inner 𝕂 ((@RCLike.ofRealCLM 𝕂 _).compLp f) ((@RCLike.ofRealCLM 𝕂 _).compLp g) =
      (inner ℝ f g : 𝕂) := by
  rw [L2.inner_def, L2.inner_def, ← integral_ofReal]
  apply integral_congr_ae
  filter_upwards [(@RCLike.ofRealCLM 𝕂 _).coeFn_compLp f,
    (@RCLike.ofRealCLM 𝕂 _).coeFn_compLp g] with x hf hg
  simp [hf, hg, RCLike.inner_apply]
source
Theorem 3.5.30 Iterated Jacobi differentiation
✓ 🤖

Over a commutative \(\mathbb Q\)-algebra, for \(n,k\ge 0\),

\[ D^kP_{n+k}^{(\alpha ,\beta )}= \left[\prod _{j=0}^{k-1}\frac{n+k+\alpha +\beta +j+1}{2}\right] P_n^{(\alpha +k,\beta +k)}. \]

Also \(D^kP_n^{(\alpha ,\beta )}=0\) when \(n{\lt}k\). There are no positivity restrictions on the parameters.

Reference: [DLMF, 18.9.15], iterated.

Lean Formalisation
theorem Polynomial.iterate_derivative_jacobi.{u_1} {R : Type u_1} [CommRing R] [Algebra ℚ R] (α β : R) (k n : ℕ) :
  (⇑Polynomial.derivative)^[k] (Polynomial.jacobi α β (n + k)) =
    Polynomial.C (∏ j ∈ Finset.range k, (algebraMap ℚ R) (1 / 2) * (↑n + ↑k + α + β + ↑j + 1)) *
      Polynomial.jacobi (α + ↑k) (β + ↑k) n
Lean proof
/-- Iterating the Jacobi derivative shifts both parameters by the derivative
order. The index n+k includes every surviving mode. -/
theorem iterate_derivative_jacobi (α β : R) (k n : ℕ) :
    derivative^[k] (jacobi α β (n + k)) =
      C (∏ j ∈ Finset.range k, algebraMap ℚ R (1 / 2) *
        ((n + k : R) + α + β + j + 1)) * jacobi (α + k) (β + k) n := by
  induction k generalizing α β with
  | zero => simp
  | succ k ih =>
    rw [show n + (k + 1) = (n + k) + 1 by omega,
      Function.iterate_succ_apply, derivative_jacobi_succ, iterate_derivative_C_mul, ih]
    simp only [Finset.prod_range_succ', Nat.cast_add, Nat.cast_one]
    rw [← mul_assoc, ← map_mul]
    congr 1
    · congr 1
      rw [mul_comm]
      congr 1
      · apply Finset.prod_congr rfl
        intro j _
        ring
      · simp only [Nat.cast_zero]; ring
    · congr 1 <;> ring
source

Both real and complex analytic Jacobi and Gegenbauer expansions satisfy weighted L2 error bounds and converge uniformly on \([-1,1]\). The complex bounds have exactly the constants of the real-valued theorems above, with \(|F-S_Nf|\) replacing \(|\operatorname {Re}F-S_Nf|\). They hold for every \(\alpha ,\beta {\gt}-1\) and every \(\lambda {\gt}-1/2\), \(\lambda \ne 0\), respectively, under the open-ellipse hypotheses \(\rho {\gt}1\), analyticity and \(|F|\le M\). The uniform polynomial factors are explicit and nonsharp; no boundary regularity on the ellipse is assumed.

References: [DLMF, 18.18] and [ATAP, Chapter 8].

Lean Formalisation
theorem Polynomial.norm_sub_sum_jacobiComplexCoefficient_le_of_analytic {α β : ℝ} (hα : -1 < α) (hβ : -1 < β) {F : ℂ → ℂ}
  {ρ M : ℝ} (hρ : 1 < ρ) (hF : AnalyticOnNhd ℂ F (Complex.bernsteinEllipse ⟨ρ, hρ⟩))
  (hM : ∀ z ∈ Complex.bernsteinEllipse ⟨ρ, hρ⟩, ‖F z‖ ≤ M) (f : ↥(MeasureTheory.Lp ℂ 2 (Polynomial.jacobiMeasure α β)))
  (hf : ∀ᵐ (x : ℝ) ∂Polynomial.jacobiMeasure α β, ↑↑f x = F ↑x) (N : ℕ) :
  ‖f -
        ∑ i ∈ Finset.range (N + 1),
          Polynomial.jacobiComplexCoefficient α β (Polynomial.IntegralCoefficientInput.ofJacobiL2 hα hβ f i) •
            (Polynomial.polynomialToL2Scalar ℂ ⋯) (Polynomial.jacobi α β i)‖ ≤
    √((Polynomial.jacobiMeasure α β).real Set.univ) * (2 * M / (ρ ^ N * (ρ - 1)))
Lean proof
/-- Geometric weighted L² error for complex analytic Jacobi expansions. -/
theorem norm_sub_sum_jacobiComplexCoefficient_le_of_analytic {F : ℂ → ℂ} {ρ M : ℝ}
    (hρ : 1 < ρ) (hF : AnalyticOnNhd ℂ F (bernsteinEllipse ⟨ρ, hρ⟩))
    (hM : ∀ z ∈ bernsteinEllipse ⟨ρ, hρ⟩, ‖F z‖ ≤ M)
    (f : Lp ℂ 2 (jacobiMeasure α β)) (hf : ∀ᵐ x ∂jacobiMeasure α β, f x = F x) (N : ℕ) :
    ‖f - ∑ i ∈ Finset.range (N + 1), (jacobiComplexCoefficient α β (IntegralCoefficientInput.ofJacobiL2 hα hβ f i)) •
      polynomialToL2Scalar ℂ (hasFiniteMoments_jacobiMeasure hα hβ) (jacobi α β i)‖ ≤
      √((jacobiMeasure α β).real univ) * (2 * M / (ρ ^ N * (ρ - 1))) := by
  simpa only [Sequence.integralCoefficientScalar, squaredNorm_jacobiSequence, jacobiSequence_apply,
    jacobiComplexCoefficient, IntegralCoefficientInput.ofJacobiL2, IntegralCoefficientInput.ofL2, RCLike.ofReal_eq_complex_ofReal] using
    (isOrthogonal_jacobiSequence hα hβ).norm_sub_sum_integralCoefficientScalar_le_of_analytic
      (hasFiniteMoments_jacobiMeasure hα hβ) (hasPositiveDefiniteIntegral_jacobiMeasure hα hβ)
      ((ae_mem_Ioo_jacobiMeasure α β).mono (fun _ hx ↦ Ioo_subset_Icc_self hx)) hρ hF hM f hf N
source