LeanFun RevOLVER

4.1 Coefficients, bases and operators

ApproxFun [AF, OT14] represents operators by infinite banded matrices acting on coefficient vectors. We first define operators as linear maps on polynomials and take their matrices in specified source and target bases. On finitely supported coefficients the action involves only finite sums. Bandwidth records which entries vanish. Analytic extensions to convergent series or \(\ell ^2\) require the additional hypotheses stated later.

Reference details: Polynomial maps and basis matrices
Definition 4.1.1 Polynomial maps and basis matrices Mathlib
✓

Consider the linear maps \(p\mapsto Xp\), \(p\mapsto p'\), and \(p\mapsto p\). For a target basis \(c\) and any family \(v\), the basis matrix is \((c.\mathrm{toMatrix}(v))_{ij}=(c.\mathrm{repr}(v_j))_i\), the \(i\)th coordinate of \(v_j\). This construction allows infinite index sets.

Reference: [OT13, §2].

Lean Formalisation
def LinearMap.mulLeft.{u_14, u_15} (R : Type u_14) {A : Type u_15} [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A]
  [SMulCommClass R A A] (a : A) : A →ₗ[R] A
Mathlib source
Definition 4.1.2 Operators between polynomial bases
✓ 🤖

For source and target bases \(b,c\) and a linear map \(L\), define the coefficient map \(c.\mathrm{repr}\circ L\circ b.\mathrm{repr}^{-1}\) on finitely supported coefficients. Its matrix is \(A_{ij}=(c.\mathrm{repr}(L(b_j)))_i\). For natural indices, lower bandwidth \(\ell \) and upper bandwidth \(u\) mean \(A_{ij}=0\) whenever \(j+\ell {\lt}i\) or \(i+u{\lt}j\). Parameter conversion uses the identity map with different source and target bases.

Reference: [OT13, §2].

Lean Formalisation
def Module.Basis.coefficientMap.{u_1, u_2, u_3, u_5, u_6} {R : Type u_1} {M : Type u_2} {N : Type u_3} {ι : Type u_5}
  {κ : Type u_6} [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] (b : Module.Basis ι R M)
  (c : Module.Basis κ R N) (L : M →ₗ[R] N) : (ι →₀ R) →ₗ[R] κ →₀ R
Lean definition
/-- Express a linear map in its source and target basis coordinates
(Olver--Townsend 2013, §2). -/
noncomputable def coefficientMap (b : Basis ι R M) (c : Basis κ R N) (L : M →ₗ[R] N) :
    (ι →₀ R) →ₗ[R] (κ →₀ R) :=
  c.repr.toLinearMap.comp (L.comp b.repr.symm.toLinearMap)
source
Reference details: Enlarging bandwidths
Theorem 4.1.3 Enlarging bandwidths
✓ 🤖
#

If a matrix has bandwidths \((\ell ,u)\), \(\ell \le \ell '\) and \(u\le u'\), then it has bandwidths \((\ell ',u')\).

Lean Formalisation
theorem Matrix.IsBanded.mono.{u_1} {R : Type u_1} [Zero R] {A : Matrix ℕ ℕ R} {l u l' u' : ℕ} (h : A.IsBanded l u) (hl : l ≤ l')
  (hu : u ≤ u') : A.IsBanded l' u'
Lean proof
/-- Increasing either bandwidth preserves bandedness (Olver--Townsend 2013, §2). -/
theorem IsBanded.mono {A : Matrix ℕ ℕ R} {l u l' u' : ℕ}
    (h : A.IsBanded l u) (hl : l ≤ l') (hu : u ≤ u') : A.IsBanded l' u' := by
  intro i j hij
  apply h
  omega
source

The coefficient map sends the unit column at \(j\) to \(c.\mathrm{repr}(L(b_j))\). For finitely supported \(v\), its \(i\)th output is \(\sum _{j\in \operatorname {supp}(v)} A_{ij}v_j\); reconstruction in \(c\) equals \(L\) applied to reconstruction in \(b\). Composition agrees exactly with composition of the underlying linear maps. No infinite matrix sum is required.

Reference: [OT13, §2].

Lean Formalisation
theorem Module.Basis.repr_symm_coefficientMap.{u_1, u_2, u_3, u_5, u_6} {R : Type u_1} {M : Type u_2} {N : Type u_3}
  {ι : Type u_5} {κ : Type u_6} [CommSemiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N]
  (b : Module.Basis ι R M) (c : Module.Basis κ R N) (L : M →ₗ[R] N) (v : ι →₀ R) :
  c.repr.symm ((b.coefficientMap c L) v) = L (b.repr.symm v)
Lean proof
/-- Coefficient action reconstructs exactly the image of a finite expansion
(Olver--Townsend 2013, §2). -/
theorem repr_symm_coefficientMap (b : Basis ι R M) (c : Basis κ R N)
    (L : M →ₗ[R] N) (v : ι →₀ R) :
    c.repr.symm (b.coefficientMap c L v) = L (b.repr.symm v) := by
  simp [coefficientMap]
source
Theorem 4.1.5 Exact rectangular coefficient sections
✓ 🤖

Let \(L\) be a linear map with natural-indexed source and target bases and matrix \(A\). For an input coefficient vector \(v\) supported on indices \(j{\lt}N\),

\[ (Lv)_i=\sum _{j=0}^{N-1}A_{ij}v_j \]

for every output index \(i\). If \(A\) has bandwidths \((\ell ,u)\), all output coefficients with \(i\ge N+\ell \) vanish. Thus \(N+\ell \) rows suffice to retain the entire result; a square truncation is not assumed exact. Here \(Lv\) denotes the coefficient map, and the statements hold over a commutative ring without finite-dimensional basis assumptions.

Reference: [OT13, Section 3].

Lean Formalisation
theorem Module.Basis.coefficientMap_apply_range.{u_1, u_2, u_3} {R : Type u_1} {M : Type u_2} {P : Type u_3} [CommRing R]
  [AddCommGroup M] [Module R M] [AddCommGroup P] [Module R P] (b : Module.Basis ℕ R M) (c : Module.Basis ℕ R P)
  (L : M →ₗ[R] P) (v : ℕ →₀ R) {N : ℕ} (hv : ∀ j ∈ v.support, j < N) (i : ℕ) :
  ((b.coefficientMap c L) v) i = ∑ j ∈ Finset.range N, c.toMatrix (fun j => L (b j)) i j * v j
Lean proof
/-- For input supported in the first `N` columns, every output coefficient is an
ordinary finite matrix sum. This also describes any chosen rectangular section. -/
theorem coefficientMap_apply_range (b : Basis ℕ R M) (c : Basis ℕ R P)
    (L : M →ₗ[R] P) (v : ℕ →₀ R) {N : ℕ}
    (hv : ∀ j ∈ v.support, j < N) (i : ℕ) :
    b.coefficientMap c L v i = ∑ j ∈ Finset.range N, c.toMatrix (fun j ↦ L (b j)) i j * v j := by
  classical
  rw [coefficientMap_apply, Finsupp.sum]
  apply Finset.sum_subset (fun j hj ↦ Finset.mem_range.mpr (hv j hj))
  intro j _ hj
  rw [Finsupp.notMem_support_iff.mp hj, mul_zero]
source

Matrix entries depend on the choice and normalisation of each basis. The following definitions fix the Chebyshev, Jacobi and Gegenbauer coordinates used below.

Reference details: Chebyshev polynomial coordinate basis and related results
Definition 4.1.6 Chebyshev polynomial coordinate basis
✓ 🤖
#

Let the Chebyshev coordinate basis of \(\mathbb {R}[X]\) be \((T_n)_{n\in \mathbb {N}}\), in the polynomial normalisation \(T_n(1)=1\). It differs from the normalised weighted Hilbert basis.

Reference: [OT13, Sections 2–3].

Lean Formalisation
def Polynomial.chebyshevBasis : Module.Basis ℕ ℝ (Polynomial ℝ)
Lean definition
/-- The canonical real Chebyshev polynomial basis, reusing Mathlib's sequence. -/
@[expose] noncomputable def chebyshevBasis : Basis ℕ ℝ ℝ[X] :=
  (Chebyshev.chebyshevTsequence ℝ).basis (Chebyshev.chebyshevTsequence ℝ).isUnit_leadingCoeff
source
Definition 4.1.7 Jacobi polynomial basis
✓ 🤖
#

For real \(\alpha ,\beta {\gt}-1\), let the Jacobi basis of \(\mathbb {R}[X]\) be the basis built from the Jacobi sequence, in the original normalisation. This is an algebraic polynomial basis, distinct from the weighted L2 Hilbert basis.

Reference: [DLMF, Table 18.3.1].

Lean Formalisation
def Polynomial.jacobiBasis {α β : ℝ} (hα : -1 < α) (hβ : -1 < β) : Module.Basis ℕ ℝ (Polynomial ℝ)
Lean definition
/-- The Jacobi basis of the polynomial space in its original normalisation
(DLMF Table 18.3.1). -/
@[expose] noncomputable def jacobiBasis : Basis ℕ ℝ ℝ[X] :=
  (jacobiSequence hα hβ).basis (fun n ↦
    (jacobiSequence hα hβ).isUnit_leadingCoeff n)
source
Definition 4.1.8 Gegenbauer polynomial basis
✓ 🤖
#

For real \(\lambda {\gt}-1/2\), \(\lambda \ne 0\), let the Gegenbauer basis of \(\mathbb {R}[X]\) be the basis built from the sequence \(C_n^{(\lambda )}\) in its original normalisation. Theorem 4.1.9 identifies the vectors of all three bases.

Reference: [DLMF, Table 18.3.1].

Lean Formalisation
def Polynomial.gegenbauerBasis {lam : ℝ} (hlam : -(1 / 2) < lam) (hzero : lam ≠ 0) : Module.Basis ℕ ℝ (Polynomial ℝ)
Lean definition
/-- The Gegenbauer basis of polynomials, without Hilbert-space normalisation
(DLMF Table 18.3.1). -/
@[expose] noncomputable def gegenbauerBasis : Basis ℕ ℝ ℝ[X] :=
  (gegenbauerSequence hlam hzero).basis (fun n ↦ isUnit_iff_ne_zero.mpr
    (leadingCoeff_ne_zero.mpr ((gegenbauerSequence hlam hzero).ne_zero n)))
source

For every \(n\), the \(n\)th vectors of the Chebyshev, Jacobi (\(\alpha ,\beta {\gt}-1\)) and Gegenbauer (\(\lambda {\gt}-1/2\), \(\lambda \ne 0\)) coordinate bases are \(T_n\), \(P_n^{(\alpha ,\beta )}\) and \(C_n^{(\lambda )}\).

Lean Formalisation
theorem Polynomial.chebyshevBasis_apply (n : ℕ) : Polynomial.chebyshevBasis n = Polynomial.Chebyshev.T ℝ ↑n
Lean proof
@[simp] theorem chebyshevBasis_apply (n : ℕ) : chebyshevBasis n = Chebyshev.T ℝ n := by
  simp [chebyshevBasis, Sequence.basis_eq_self, Chebyshev.chebyshevTsequence]
source

Multiplication by \(x\) in an orthogonal basis is the tridiagonal Jacobi operator \(J\) of Chapter 3.1. Multiplication by any polynomial \(a\) is then \(a(J)\), and it can be evaluated by running Clenshaw’s recurrence in the operator algebra.

For an orthogonal polynomial sequence with finite moments and positive definite integral, the multiplication matrix is tridiagonal. Column \(n+1\) has entries \(A_{n+1},B_{n+1},C_n\) in rows \(n+2,n+1,n\), with the recurrence coefficients already defined. Column zero has entries \(A_0,B_0\) in rows one and zero. No interval-support hypothesis is imposed.

Reference: [DLMF, 18.2(iv)].

Lean Formalisation
theorem Polynomial.Sequence.IsOrthogonal.mul_matrix_succ {μ : MeasureTheory.Measure ℝ} (hμ : Polynomial.HasFiniteMoments μ)
  (hpos : Polynomial.HasPositiveDefiniteIntegral μ) {P : Polynomial.Sequence ℝ} (hP : P.IsOrthogonal μ)
  (hu : ∀ (i : ℕ), IsUnit (↑P i).leadingCoeff) (n i : ℕ) :
  (P.basis hu).toMatrix (fun j => Polynomial.X * ↑P j) i (n + 1) =
    ((if i = n + 2 then P.recurrenceA (n + 1) else 0) + if i = n + 1 then P.recurrenceB μ (n + 1) ⋯ else 0) +
      if i = n then P.recurrenceC μ n ⋯ else 0
Lean proof
/-- Entries of multiplication in the positive-index columns (DLMF 18.2(iv)). -/
theorem IsOrthogonal.mul_matrix_succ (n i : ℕ) :
    (P.basis hu).toMatrix (fun j ↦ X * P j) i (n + 1) =
      (if i = n + 2 then P.recurrenceA (n + 1) else 0) +
      (if i = n + 1 then P.recurrenceB μ (n + 1) (Sequence.RecurrenceBInput.of _ _ _) else 0) +
      (if i = n then P.recurrenceC μ n (Sequence.RecurrenceCInput.of _ _ _) else 0) := by
  have hb (k : ℕ) : (P.basis hu).repr (P k) = Finsupp.single k 1 := by
    rw [← P.basis_eq_self hu k]
    exact (P.basis hu).repr_self k
  rw [Basis.toMatrix_apply, hP.three_term hμ hpos]
  simp [hb, Finsupp.single_apply, eq_comm]
source
Theorem 4.1.11 Multiplication as polynomial functional calculus
✓ 🤖

Over any commutative semiring, let \(J\) be multiplication by \(X\) on polynomials. For every polynomial \(p\), multiplication by \(p\) is exactly \(p(J)\). In any polynomial basis \(b\), the coefficient maps satisfy the same identity \(M[p]=p(J_b)\), and reconstruct \(p\, b^{-1}(v)\) for every finitely supported coefficient vector \(v\). Here \(p(J)\) is the evaluation of \(p\) at \(J\) in the algebra of linear endomorphisms.

Reference: [OT13, Sections 2–3].

Lean Formalisation
theorem Polynomial.aeval_mulLeft_X.{u_1} {R : Type u_1} [CommSemiring R] (p : Polynomial R) :
  (Polynomial.aeval (LinearMap.mulLeft R Polynomial.X)) p = LinearMap.mulLeft R p
Lean proof
/-- Multiplication by `p` is `p(J)`, where `J` multiplies by `X`.
This is an identity of endomorphisms of the full polynomial module. -/
theorem aeval_mulLeft_X (p : R[X]) :
    aeval (LinearMap.mulLeft R (X : R[X])) p = LinearMap.mulLeft R p := by
  have he (q : R[X]) : Algebra.lmul R R[X] q = LinearMap.mulLeft R q := by
    ext r
    rfl
  simpa only [he, aeval_X_left_apply] using
    (aeval_algHom_apply (Algebra.lmul R R[X]) (X : R[X]) p)
source

No finite-section matrix functional calculus is asserted.

Clenshaw state and evaluation commute with ring homomorphisms; the recurrence itself is defined for rings without requiring commutativity. Let \(R\) be commutative, \(A\) any \(R\)-algebra, and \(J\in A\). Apply the backward recurrence with \(a_k=2J\), \(b_k=-1\), scalar coefficients \(c_k1_A\) and initial values \(1_A,J\). The result is

\[ \left(\sum _{k=0}^{n-1}c_kT_k\right)(J). \]

In particular it computes the exact multiplication operator, or its coefficient map in any polynomial basis. The full constant coefficient is retained.

References: [Cle55]; [OT13, Sections 2–3].

Lean Formalisation
theorem Polynomial.clenshawState_map.{u_1, u_2} {R : Type u_1} [Ring R] {S : Type u_2} [Ring S] (f : R →+* S) (a b c : ℕ → R)
  (n k : ℕ) :
  Polynomial.clenshawState (⇑f ∘ a) (⇑f ∘ b) (⇑f ∘ c) n k =
    (f (Polynomial.clenshawState a b c n k).1, f (Polynomial.clenshawState a b c n k).2)
Lean proof
/-- Clenshaw state commutes with ring homomorphisms. This transports polynomial
recurrences to operators without assuming that all operators commute. -/
theorem clenshawState_map {S : Type*} [Ring S] (f : R →+* S)
    (a b c : ℕ → R) (n k : ℕ) :
    clenshawState (f ∘ a) (f ∘ b) (f ∘ c) n k =
      (f (clenshawState a b c n k).1, f (clenshawState a b c n k).2) := by
  induction n generalizing k with
  | zero => simp [clenshawState]
  | succ n ih => simp [clenshawState, ih]
source

No commutativity of the entire endomorphism algebra is required: the proof transports a polynomial identity by evaluation at a single \(J\).

For convergent expansions the same matrices act on infinite coefficient sequences, provided the reconstruction converges absolutely.

Reference details: Coefficient maps on infinite sequences and related results
Definition 4.1.13 Coefficient maps on infinite sequences
✓ 🤖

Let \(b,c\) be polynomial bases over a commutative ring \(R\), let \(L:R[x]\to R[x]\) be \(R\)-linear, and let \(\sigma :R\to \mathbb C\) be a ring map. Write \(M_{ij}=[Lb_j]_{c,i}\). At index \(i\), an admissible input is a complex sequence \(a\) for which \(\sum _j a_j\sigma (M_{ij})\) converges unconditionally. Define \(\beta _i\) only for such an input, as this sum.

Reference: [OT13, Sections 2–3].

Lean Formalisation
def Module.Basis.SeriesCoefficientInput.{u_1} {R : Type u_1} [CommRing R] (b c : Module.Basis ℕ R (Polynomial R))
  (L : Polynomial R →ₗ[R] Polynomial R) (σ : R →+* ℂ) (i : ℕ) : Type
Lean definition
/-- Input whose selected matrix row converges classically. -/
abbrev SeriesCoefficientInput (b c : Basis ℕ R R[X])
    (L : R[X] →ₗ[R] R[X]) (σ : R →+* ℂ) (i : ℕ) :=
  {a : ℕ → ℂ // Summable (fun j ↦ a j * σ (c.repr (L (b j)) i))}
source
Theorem 4.1.14 Classical matrix-row sum
✓ 🤖

For every admissible input at row \(i\), the series \(\sum _j a_j\sigma (M_{ij})\) converges unconditionally to \(\beta _i\).

Lean Formalisation
theorem Module.Basis.hasSum_seriesCoefficientMap_row.{u_1} {R : Type u_1} [CommRing R] (b c : Module.Basis ℕ R (Polynomial R))
  (L : Polynomial R →ₗ[R] Polynomial R) (σ : R →+* ℂ) {i : ℕ} (a : b.SeriesCoefficientInput c L σ i) :
  HasSum (fun j => ↑a j * σ ((c.repr (L (b j))) i)) (b.seriesCoefficientMap c L σ a)
Lean proof
/-- Characterization by the classical row sum. -/
theorem hasSum_seriesCoefficientMap_row (b c : Basis ℕ R R[X])
    (L : R[X] →ₗ[R] R[X]) (σ : R →+* ℂ) {i : ℕ}
    (a : SeriesCoefficientInput b c L σ i) :
    HasSum (fun j ↦ a.val j * σ (c.repr (L (b j)) i))
      (b.seriesCoefficientMap c L σ a) := a.property.hasSum
source

At a complex point \(z\), suppose \(\sum _{j,i}|a_j\sigma (M_{ij})c_i(z)|{\lt}\infty \), with evaluation through \(\sigma \). The convergent weighted contributions \(\gamma _i=\sum _j a_j\sigma (M_{ij})c_i(z)\) then satisfy

\[ \sum _i\gamma _i=\sum _j a_j(Lb_j)(z). \]

If \(a\) also supplies an admissible coefficient input at every row, then \(\gamma _i=\beta _i c_i(z)\) and the left side is \(\sum _i\beta _i c_i(z)\). A sufficient condition for weighted reconstruction is \(|c_i(z)|\le w_i\) and

\[ \sum _j |a_j|\sum _{i\in \operatorname {supp}[Lb_j]_c}|\sigma (M_{ij})|w_i{\lt}\infty . \]

Each inner sum is finite.

Lean Formalisation
theorem Module.Basis.hasSum_repr_eval₂.{u_1} {R : Type u_1} [CommRing R] (c : Module.Basis ℕ R (Polynomial R)) (σ : R →+* ℂ)
  (p : Polynomial R) (z : ℂ) : HasSum (fun i => σ ((c.repr p) i) * Polynomial.eval₂ σ z (c i)) (Polynomial.eval₂ σ z p)
Lean proof
/-- Finite basis reconstruction is also an unconditional evaluation series. -/
theorem hasSum_repr_eval₂ (c : Basis ℕ R R[X]) (σ : R →+* ℂ) (p : R[X]) (z : ℂ) :
    HasSum (fun i ↦ σ (c.repr p i) * (c i).eval₂ σ z) (p.eval₂ σ z) := by
  classical
  have he := congrArg (fun q : R[X] ↦ q.eval₂ σ z) (c.linearCombination_repr p)
  simp only [Finsupp.linearCombination_apply, Finsupp.sum, eval₂_finsetSum, eval₂_smul] at he
  rw [← he]
  apply hasSum_sum_of_ne_finset_zero
  intro i hi
  rw [Finsupp.notMem_support_iff.mp hi, map_zero, zero_mul]
source

Weighted convergence alone does not assert convergence of a coefficient row whose output mode vanishes at \(z\).

Supporting results: finite rows of banded series maps

If \(M\) has bandwidths \((\ell ,u)\), each row sum \(\sum _j a_j\sigma (M_{ij})\) is finite for every sequence \(a\), and \(\beta _i=\sum _{j{\lt}i+u+1}a_j\sigma (M_{ij})\) for every sequence \(a\). On finitely supported sequences embedded from \(R\), this agrees exactly with the existing finite coefficient map. Neither coordinate identity needs an analytic convergence hypothesis.

Lean Formalisation
theorem Module.Basis.seriesCoefficientMap_eq_sum_of_isBanded.{u_1} {R : Type u_1} [CommRing R]
  (b c : Module.Basis ℕ R (Polynomial R)) (L : Polynomial R →ₗ[R] Polynomial R) (σ : R →+* ℂ) (a : ℕ → ℂ) {l u : ℕ}
  (hL : (c.toMatrix fun j => L (b j)).IsBanded l u) (i : ℕ) :
  b.seriesCoefficientMap c L σ (Module.Basis.SeriesCoefficientInput.ofBanded b c L σ a hL i) =
    ∑ j ∈ Finset.range (i + u + 1), a j * σ (c.toMatrix (fun j => L (b j)) i j)
Lean proof
/-- Banded matrix rows define finite sums even on an infinite input sequence.
No convergence hypothesis is needed for this coordinate identity. -/
theorem seriesCoefficientMap_eq_sum_of_isBanded (b c : Basis ℕ R R[X])
    (L : R[X] →ₗ[R] R[X]) (σ : R →+* ℂ) (a : ℕ → ℂ) {l u : ℕ}
    (hL : (c.toMatrix (fun j ↦ L (b j))).IsBanded l u) (i : ℕ) :
    b.seriesCoefficientMap c L σ (.ofBanded b c L σ a hL i) =
      ∑ j ∈ Finset.range (i + u + 1), a j * σ (c.toMatrix (fun j ↦ L (b j)) i j) := by
  classical
  simp only [seriesCoefficientMap, SeriesCoefficientInput.ofBanded, toMatrix_apply]
  apply tsum_eq_sum
  intro j hj
  have hz := hL i j (Or.inr (by simp only [Finset.mem_range] at hj; omega))
  change c.repr (L (b j)) i = 0 at hz
  rw [hz, map_zero, mul_zero]
source

We next compute these matrices in the classical bases, including their nonzero bands.