Mathlib.Analysis.Approximation.Chebyshev

Quantitative theory of uniform approximation by real polynomials.

Cosine­Projection 24 core · 35 supporting · 11 submodules This package supplies the normalized cosine basis on the unit interval, its finite uniform-measure projection, an even Jackson approximant, and the constant-five Hölder L² error bound. Jackson 27 core · 32 supporting · 11 submodules Jackson-style approximation bounds assembled from Chebyshev kernels, tensor constructions, coefficient envelopes, and extraction lemmas. Reciprocal 13 core · 12 supporting · 7 submodules This package proves the exact best uniform error for real polynomial approximation of the reciprocal function on a positive compact interval.
Basic 4 core · 4 supporting This module defines the compact-interval uniform approximation problem and proves that a continuous target admits a best real-polynomial approximant under a degree bound. ★ exists_bestPolynomial

Uniform polynomial approximation on compact intervals

This module defines the compact-interval uniform approximation problem and proves that a continuous target admits a best real-polynomial approximant under a degree bound.

def intervalSupNorm reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

The interval supremum norm of a real function for endpoints r and s is the supremum of the function's absolute values over the closed interval from r to s.

Definition (Lean source)
g :
ℝ → ℝ
r s :
ℝ
intervalSupNorm g r s :
ℝ
sSup ((fun x => |g x|) '' Icc r s)
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.intervalSupNorm · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Basic.lean:35
def uniformApproxError reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

The uniform approximation error of a real polynomial against a real target function for endpoints r and s is the interval supremum norm of the target minus the polynomial on the closed interval from r to s.

Definition (Lean source)
f :
ℝ → ℝ
r s :
ℝ
Q :
uniformApproxError f r s Q :
ℝ
intervalSupNorm (fun x => f x - Q.eval x) r s
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.uniformApproxError · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Basic.lean:41
def bestUniformApproxError reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

The best uniform approximation error of a real target function for endpoints r and s and a degree bound L is the infimum of the uniform approximation errors over all real polynomials of degree at most L.

Definition (Lean source)
f :
ℝ → ℝ
r s :
ℝ
L :
ℕ
bestUniformApproxError f r s L :
ℝ
sInf {e : ℝ | ∃ Q : Polynomial ℝ, Q.natDegree ≤ L ∧ e = uniformApproxError f r s Q}
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.bestUniformApproxError · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Basic.lean:48
theorem exists_bestPolynomial reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

For endpoints with r strictly less than s, a target function continuous on the closed interval between them, and any degree bound L, there is a real polynomial of degree at most L whose uniform approximation error equals the best uniform approximation error for that degree bound.

Formal statement
f :
ℝ → ℝ
r s :
ℝ
hrs :
r < s
hf :
L :
ℕ
∃ Q : Polynomial ℝ,
conclusion 1
Q.natDegree ≤ L
conclusion 2
Proof (Lean source)
theorem exists_bestPolynomial {f : ℝ → ℝ} {r s : ℝ} (hrs : r < s) (hf : ContinuousOn f (Icc r s)) (L : ℕ) : ∃ Q : Polynomial ℝ, Q.natDegree ≤ L ∧ uniformApproxError f r s Q = bestUniformApproxError f r s L := by letI : CompactSpace (Icc r s) := isCompact_iff_compactSpace.mp isCompact_Icc letI : Nonempty (Icc r s) := ⟨⟨r, left_mem_Icc.mpr hrs.le⟩⟩ let V := boundedPolynomialFunctions r s L let g := targetOnInterval f r s hf let R : ℝ := 2 * ‖g‖ + 1 let B : Set V := closedBall 0 R have hR : 0 ≤ R := by dsimp [R] positivity have hBcompact : IsCompact B := by exact ProperSpace.isCompact_closedBall 0 R have hzero : (0 : V) ∈ B := by simp [B, hR] have hcontinuous : Continuous (fun q : V => ‖g - (q : C(Icc r s, ℝ))‖) := by fun_prop obtain ⟨q, hqB, hqmin⟩ := hBcompact.exists_isMinOn ⟨0, hzero⟩ hcontinuous.continuousOn have hqzero : ‖g - (q : C(Icc r s, ℝ))‖ ≤ ‖g‖ := by simpa using hqmin hzero have hglobal (u : V) : ‖g - (q : C(Icc r s, ℝ))‖ ≤ ‖g - (u : C(Icc r s, ℝ))‖ := by by_cases hu : u ∈ B · exact hqmin hu · have hunorm : R < ‖u‖ := by simpa [B, Metric.mem_closedBall, dist_zero_left, not_le] using hu have hdiff := norm_sub_norm_le (u : C(Icc r s, ℝ)) g have hlower : ‖g‖ ≤ ‖(u : C(Icc r s, ℝ)) - g‖ := by dsimp [R] at hunorm change ‖(u : C(Icc r s, ℝ))‖ - ‖g‖ ≤ ‖(u : C(Icc r s, ℝ)) - g‖ at hdiff linarith rw [norm_sub_rev] at hlower exact hqzero.trans hlower obtain ⟨p, hpq⟩ := q.property have hpDegreeLE : (p : Polynomial ℝ) ∈ Polynomial.degreeLE ℝ L := by rw [← Polynomial.degreeLT_succ_eq_degreeLE] exact p.property have hpdeg : (p : Polynomial ℝ).natDegree ≤ L := Polynomial.natDegree_le_iff_degree_le.mpr (Polynomial.mem_degreeLE.mp hpDegreeLE) have hpq' : (p : Polynomial ℝ).toContinuousMapOn (Icc r s) = (q : C(Icc r s, ℝ)) := hpq have hminpoly : ∀ u : Polynomial ℝ, u.natDegree ≤ L → uniformApproxError f r s p ≤ uniformApproxError f r s u := by intro u hu have huDegreeLE : u ∈ Polynomial.degreeLE ℝ L := Polynomial.mem_degreeLE.mpr (Polynomial.natDegree_le_iff_degree_le.mp hu) have huDegreeLT : u ∈ Polynomial.degreeLT ℝ (L + 1) := by rw [Polynomial.degreeLT_succ_eq_degreeLE] simpa [Nat.succ_eq_add_one] using huDegreeLE let uv : V := ⟨u.toContinuousMapOn (Icc r s), ⟨⟨u, huDegreeLT⟩, rfl⟩⟩ rw [uniformApproxError_eq_norm hrs.le hf, uniformApproxError_eq_norm hrs.le hf] simpa [g, hpq'] using hglobal uv refine ⟨p, hpdeg, le_antisymm ?_ ?_⟩ · unfold bestUniformApproxError apply le_csInf · exact ⟨uniformApproxError f r s 0, 0, by simp⟩ · rintro e ⟨u, hu, rfl⟩ exact hminpoly u hu · unfold bestUniformApproxError apply csInf_le · refine ⟨0, ?_⟩ rintro e ⟨u, -, rfl⟩ exact uniformApproxError_nonneg u · exact ⟨p, hpdeg, rfl⟩
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.exists_bestPolynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Basic.lean:140 · uses bestUniformApproxError , uniformApproxError
4 supporting declarations (lemmas, instances)
Kernel_Part1 4 core · 13 supporting This module defines the raw and normalized fourth-power Jackson kernels, relates the raw kernel to Chebyshev polynomials, and proves the finite cosine and integral identities needed later. ★ jraw_nonneg

Algebraic and analytic foundations of the order-four Jackson kernel

This module defines the raw and normalized fourth-power Jackson kernels, relates the raw kernel to Chebyshev polynomials, and proves the finite cosine and integral identities needed later. It also establishes continuity, measurability, integrability, nonnegativity, and evenness of the raw kernel. Exact mass, moment bounds, and trigonometric degree are proved in Kernel_Part2.

def jraw reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

A nonnegative integer order and a real argument determine the raw order-four Jackson kernel, obtained from the fourth power of the Dirichlet sine quotient with its removable singularities filled continuously.

Definition (Lean source)
K :
ℕ
t :
ℝ
jraw K t :
ℝ
if sin (t / 2)
= 0 then (K : ℝ) ^ 4 else (sin ((K : ℝ) * t / 2) / sin (t / 2)) ^ 4
Causalean.Mathlib.Analysis.JacksonApproximation.jraw · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:23
def jrawMass reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

An integer order determines the raw Jackson mass, the integral of the raw kernel over the standard period from minus π to π.

Definition (Lean source)
K :
ℕ
jrawMass K :
ℝ
∫ t in Icc (-pi) pi, jraw K t
Causalean.Mathlib.Analysis.JacksonApproximation.jrawMass · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:31
def jackson reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

An integer order and a real argument determine the normalized order-four Jackson kernel, equal to the raw kernel divided by its mass over the standard period. It is normalized for positive order; at order zero the raw kernel and its mass vanish and the value is zero by the division convention.

Definition (Lean source)
K :
ℕ
t :
ℝ
jackson K t :
ℝ
jraw K t / jrawMass K
Causalean.Mathlib.Analysis.JacksonApproximation.jackson · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:37
theorem jraw_nonneg reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

At integer order K and real argument t, the raw Jackson kernel is nonnegative.

Formal statement
K :
ℕ
t :
ℝ
0 ≤ jraw K t
Proof (Lean source)
theorem jraw_nonneg (K : ℕ) (t : ℝ) : 0 ≤ jraw K t := by unfold jraw split_ifs <;> positivity
Causalean.Mathlib.Analysis.JacksonApproximation.jraw_nonneg · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:534 · uses jraw
13 supporting declarations (lemmas, instances)
  • jraw_eq_of_sin_ne_zero theorem — At order K and argument t, if the sine of t / 2 is nonzero, then the raw Jackson kernel equals the fourth power of the ratio of the sine of K t / 2 to the sine of t / 2.
    K :
    ℕ
    t :
    ℝ
    ht :
    sin (t / 2) ≠ 0
    jraw K t = (sin ((K : ℝ) * t / 2) / sin (t / 2)) ^ 4
    Proof (Lean source)
    theorem jraw_eq_of_sin_ne_zero (K : ℕ) {t : ℝ} (ht : sin (t / 2) ≠ 0) : jraw K t = (sin ((K : ℝ) * t / 2) / sin (t / 2)) ^ 4 := by simp [jraw, ht]
    Causalean.Mathlib.Analysis.JacksonApproximation.jraw_eq_of_sin_ne_zero · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:44
  • jraw_eq_of_sin_eq_zero theorem — At order K and argument t, if the denominator sine vanishes, then the raw kernel equals K to the fourth power.
    K :
    ℕ
    t :
    ℝ
    ht :
    sin (t / 2) = 0
    jraw K t = (K : ℝ) ^ 4
    Proof (Lean source)
    theorem jraw_eq_of_sin_eq_zero (K : ℕ) {t : ℝ} (ht : sin (t / 2) = 0) : jraw K t = (K : ℝ) ^ 4 := by simp [jraw, ht]
    Causalean.Mathlib.Analysis.JacksonApproximation.jraw_eq_of_sin_eq_zero · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:51
  • jraw_eq_chebyshev lemma — At a strictly positive kernel order and a real argument, the raw Jackson kernel equals the fourth power of the corresponding Chebyshev polynomial of the second kind evaluated at the half-angle cosine.
    K :
    ℕ
    hK :
    0 < K
    t :
    ℝ
    jraw K t = ((U ℝ ((K - 1 : ℕ) : ℤ)).eval (cos (t / 2))) ^ 4
    Proof (Lean source)
    lemma jraw_eq_chebyshev (K : ℕ) (hK : 0 < K) (t : ℝ) : jraw K t = ((U ℝ ((K - 1 : ℕ) : ℤ)).eval (cos (t / 2))) ^ 4 := by by_cases ht : sin (t / 2) = 0 · rw [jraw_eq_of_sin_eq_zero K ht] rcases Real.sin_eq_zero_iff_cos_eq.mp ht with hc | hc · rw [hc, Polynomial.Chebyshev.U_eval_one] norm_num congr 1 norm_cast omega · rw [hc, Polynomial.Chebyshev.U_eval_neg_one] norm_num have hcast : ((K - 1 : ℕ) : ℝ) + 1 = (K : ℝ) := by norm_cast omega rw [hcast, mul_pow, ← pow_mul] norm_num · rw [jraw_eq_of_sin_ne_zero K ht] congr 1 apply (div_eq_iff ht).2 have hu := Polynomial.Chebyshev.U_real_cos (t / 2) ((K - 1 : ℕ) : ℤ) have hn : K - 1 + 1 = K := by omega have harg : (((((K - 1 : ℕ) : ℤ) : ℝ)) + 1) * (t / 2) = (K : ℝ) * t / 2 := by have hcast : (((((K - 1 : ℕ) : ℤ) : ℝ)) + 1) = (K : ℝ) := by exact_mod_cast hn rw [hcast] ring exact (congrArg sin harg).symm.trans hu.symm
    Causalean.Mathlib.Analysis.JacksonApproximation.jraw_eq_chebyshev · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:58
  • exists_comp_sq_of_eval_neg_eq lemma — If a real polynomial takes the same value at every pair of opposite arguments, then it is a polynomial in the square variable, with the outer polynomial's degree at most half the original degree.
    p :
    hp :
    ∀ x : ℝ, p.eval (-x) = p.eval x
    ∃ q : Polynomial ℝ,
    conclusion 1
    q.natDegree ≤ p.natDegree / 2
    conclusion 2
    p = q.comp (X ^ 2)
    Proof (Lean source)
    lemma exists_comp_sq_of_eval_neg_eq (p : Polynomial ℝ) (hp : ∀ x : ℝ, p.eval (-x) = p.eval x) : ∃ q : Polynomial ℝ, q.natDegree ≤ p.natDegree / 2 ∧ p = q.comp (X ^ 2) := by have hpoly : p.comp (-X) = p := by apply Polynomial.funext intro x simpa [Polynomial.eval_comp] using hp x have hcoeff (i : ℕ) (hi : Odd i) : p.coeff i = 0 := by have h := congrArg (fun q : Polynomial ℝ => q.coeff i) hpoly rw [coeff_comp_neg_X, hi.neg_one_pow] at h linarith have heven (i : ℕ) (hi : i ∈ p.support) : Even i := by rcases Nat.even_or_odd i with h | h · exact h · exact ((Polynomial.mem_support_iff.mp hi) (hcoeff i h)).elim let q : Polynomial ℝ := ∑ i ∈ p.support, C (p.coeff i) * X ^ (i / 2) refine ⟨q, ?_, ?_⟩ · apply (Polynomial.natDegree_sum_le_of_forall_le _ _) intro i hi exact (Polynomial.natDegree_C_mul_X_pow_le _ _).trans (Nat.div_le_div_right (Polynomial.le_natDegree_of_mem_supp i hi) : i / 2 ≤ p.natDegree / 2) · rw [p.as_sum_support_C_mul_X_pow] simp only [q, Polynomial.sum_comp, Polynomial.mul_comp, Polynomial.C_comp, Polynomial.pow_comp, Polynomial.X_comp] apply Finset.sum_congr rfl intro i hi congr 1 rw [← pow_mul] congr 1 exact (Nat.two_mul_div_two_of_even (heven i hi)).symm
    Causalean.Mathlib.Analysis.JacksonApproximation.exists_comp_sq_of_eval_neg_eq · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:121
  • cheb_U_sq_eval lemma — At a nonnegative integer order and a real angle, the square of the corresponding Chebyshev polynomial of the second kind equals its finite cosine expansion.
    n :
    ℕ
    t :
    ℝ
    (U ℝ (n : ℤ)).eval (cos (t / 2)) ^ 2
    = (n + 1 : ℝ) + 2 * ∑ j ∈ range n, (n - j : ℝ) * cos (((j + 1 : ℕ) : ℝ) * t)
    Proof (Lean source)
    lemma cheb_U_sq_eval (n : ℕ) (t : ℝ) : (U ℝ (n : ℤ)).eval (cos (t / 2)) ^ 2 = (n + 1 : ℝ) + 2 * ∑ j ∈ range n, (n - j : ℝ) * cos (((j + 1 : ℕ) : ℝ) * t) := by induction n with | zero => simp | succ n ih => have hd := congrArg (fun p : Polynomial ℝ => p.eval (cos (t / 2))) (cheb_U_sq_sub_real n) simp only [Polynomial.eval_sub, Polynomial.eval_pow] at hd calc (U ℝ ((n + 1 : ℕ) : ℤ)).eval (cos (t / 2)) ^ 2 = (U ℝ (n : ℤ)).eval (cos (t / 2)) ^ 2 + (U ℝ ((2 * n + 2 : ℕ) : ℤ)).eval (cos (t / 2)) := by linarith _ = ((n + 1 : ℝ) + 2 * ∑ j ∈ range n, (n - j : ℝ) * cos (((j + 1 : ℕ) : ℝ) * t)) + (1 + 2 * ∑ j ∈ range (n + 1), cos (((j + 1 : ℕ) : ℝ) * t)) := by rw [ih] convert congrArg (fun z : ℝ => ((n + 1 : ℝ) + 2 * ∑ j ∈ range n, (n - j : ℝ) * cos (((j + 1 : ℕ) : ℝ) * t)) + z) (cheb_U_even_eval (n + 1) t) using 1 <;> congr 3 <;> omega _ = (((n + 1 : ℕ) : ℝ) + 1) + 2 * ∑ j ∈ range (n + 1), ((((n + 1 : ℕ) : ℝ) - (j : ℝ)) * cos (((j + 1 : ℕ) : ℝ) * t)) := by have hcast : ((n + 1 : ℕ) : ℝ) = (n : ℝ) + 1 := by norm_num rw [hcast, Finset.sum_range_succ, Finset.sum_range_succ] have hsum : (∑ j ∈ range n, (n - j : ℝ) * cos (((j + 1 : ℕ) : ℝ) * t)) + ∑ j ∈ range n, cos (((j + 1 : ℕ) : ℝ) * t) = ∑ j ∈ range n, (n + 1 - j : ℝ) * cos (((j + 1 : ℕ) : ℝ) * t) := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro j hj ring linear_combination 2 * hsum
    Causalean.Mathlib.Analysis.JacksonApproximation.cheb_U_sq_eval · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:235
  • integral_cos_nat lemma — For a strictly positive integer frequency, the cosine of that frequency has integral zero over the closed interval from negative π to π.
    n :
    ℕ
    hn :
    0 < n
    (∫ t in Icc (-pi) pi, cos ((n : ℝ) * t)) = 0
    Proof (Lean source)
    lemma integral_cos_nat (n : ℕ) (hn : 0 < n) : (∫ t in Icc (-pi) pi, cos ((n : ℝ) * t)) = 0 := by rw [MeasureTheory.integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (a := -pi) (b := pi) (by linarith [Real.pi_pos] : -pi ≤ pi)] have hn0 : (n : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hn) rw [intervalIntegral.integral_comp_mul_left cos hn0, integral_cos] simp
    Causalean.Mathlib.Analysis.JacksonApproximation.integral_cos_nat · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:279
  • integral_const_Icc lemma — For a real constant, its integral over the closed interval from negative π to π equals twice π times that constant.
    c :
    ℝ
    (∫ _t in Icc (-pi) pi, c) = 2 * pi * c
    Proof (Lean source)
    lemma integral_const_Icc (c : ℝ) : (∫ _t in Icc (-pi) pi, c) = 2 * pi * c := by rw [MeasureTheory.integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (a := -pi) (b := pi) (by linarith [Real.pi_pos] : -pi ≤ pi)] have hc : True ∨ c = 0 := inl trivial simp [hc] ring exact hc
    Causalean.Mathlib.Analysis.JacksonApproximation.integral_const_Icc · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:299
  • integral_sq_cos_sum lemma — Given a number of cosine terms, a constant coefficient, and a sequence of cosine coefficients, the integral over the closed interval from negative π to π of the squared finite cosine sum equals twice π times the squared constant coefficient plus π times the sum of the squared cosine coefficients.
    N :
    ℕ
    c :
    ℝ
    a :
    ℕ → ℝ
    (∫ t in Icc (-pi) pi, (c + ∑ j ∈ range N, a j * cos (((j + 1 : ℕ) : ℝ) * t)) ^ 2)
    = 2 * pi * c ^ 2 + pi * ∑ j ∈ range N, (a j) ^ 2
    Proof (Lean source)
    lemma integral_sq_cos_sum (N : ℕ) (c : ℝ) (a : ℕ → ℝ) : (∫ t in Icc (-pi) pi, (c + ∑ j ∈ range N, a j * cos (((j + 1 : ℕ) : ℝ) * t)) ^ 2) = 2 * pi * c ^ 2 + pi * ∑ j ∈ range N, (a j) ^ 2 := by let S : ℝ → ℝ := fun t => ∑ j ∈ range N, a j * cos (((j + 1 : ℕ) : ℝ) * t) have hcontS : Continuous S := by dsimp [S]; fun_prop have hzero : (∫ t in Icc (-pi) pi, S t) = 0 := by dsimp [S] calc (∫ t in Icc (-pi) pi, ∑ j ∈ range N, a j * cos (((j + 1 : ℕ) : ℝ) * t)) = ∑ j ∈ range N, ∫ t in Icc (-pi) pi, a j * cos (((j + 1 : ℕ) : ℝ) * t) := MeasureTheory.integral_finsetSum (range N) (by intro j hj exact (show Continuous (fun t : ℝ => a j * cos (((j + 1 : ℕ) : ℝ) * t)) by fun_prop).continuousOn |>.integrableOn_compact isCompact_Icc) _ = 0 := by apply Finset.sum_eq_zero intro j hj rw [MeasureTheory.integral_const_mul, integral_cos_nat (j + 1) (by omega)] ring have hsq : (∫ t in Icc (-pi) pi, (S t) ^ 2) = pi * ∑ j ∈ range N, (a j) ^ 2 := by have hterm (i j : ℕ) : IntegrableOn (fun t : ℝ => (a i * a j) * (cos (((i + 1 : ℕ) : ℝ) * t) * cos (((j + 1 : ℕ) : ℝ) * t))) (Icc (-pi) pi) := by exact (show Continuous (fun t : ℝ => (a i * a j) * (cos (((i + 1 : ℕ) : ℝ) * t) * cos (((j + 1 : ℕ) : ℝ) * t))) by fun_prop).continuousOn |>.integrableOn_compact isCompact_Icc have hexpand : (fun t => (S t) ^ 2) = fun t => ∑ i ∈ range N, ∑ j ∈ range N, (a i * a j) * (cos (((i + 1 : ℕ) : ℝ) * t) * cos (((j + 1 : ℕ) : ℝ) * t)) := by funext t dsimp [S] rw [pow_two, Finset.sum_mul] apply Finset.sum_congr rfl intro i hi rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj ring rw [hexpand] calc (∫ t in Icc (-pi) pi, ∑ i ∈ range N, ∑ j ∈ range N, (a i * a j) * (cos (((i + 1 : ℕ) : ℝ) * t) * cos (((j + 1 : ℕ) : ℝ) * t))) = ∑ i ∈ range N, ∫ t in Icc (-pi) pi, ∑ j ∈ range N, (a i * a j) * (cos (((i + 1 : ℕ) : ℝ) * t) * cos (((j + 1 : ℕ) : ℝ) * t)) := MeasureTheory.integral_finsetSum (range N) (by intro i hi exact integrable_finsetSum (range N) (fun j hj => hterm i j)) _ = ∑ i ∈ range N, ∑ j ∈ range N, ∫ t in Icc (-pi) pi, (a i * a j) * (cos (((i + 1 : ℕ) : ℝ) * t) * cos (((j + 1 : ℕ) : ℝ) * t)) := by apply Finset.sum_congr rfl intro i hi exact MeasureTheory.integral_finsetSum (range N) (by intro j hj exact hterm i j) _ = pi * ∑ j ∈ range N, (a j) ^ 2 := by calc ∑ i ∈ range N, ∑ j ∈ range N, ∫ t in Icc (-pi) pi, (a i * a j) * (cos (((i + 1 : ℕ) : ℝ) * t) * cos (((j + 1 : ℕ) : ℝ) * t)) = ∑ i ∈ range N, ∑ j ∈ range N, (a i * a j) * (if i = j then pi else 0) := by apply Finset.sum_congr rfl intro i hi apply Finset.sum_congr rfl intro j hj rw [MeasureTheory.integral_const_mul, integral_cos_mul_cos (i + 1) (j + 1) (by omega) (by omega)] simp _ = pi * ∑ j ∈ range N, (a j) ^ 2 := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj rw [Finset.sum_eq_single j] · simp ring · intro b hb hbj simp [hbj.symm] · exact fun hnot => (hnot hj).elim have hconst : (∫ _t in Icc (-pi) pi, c ^ 2) = 2 * pi * c ^ 2 := by exact integral_const_Icc (c ^ 2) have hpoint : (fun t => (c + S t) ^ 2) = fun t => c ^ 2 + (2 * c) * S t + (S t) ^ 2 := by funext t ring rw [show (fun t => (c + ∑ j ∈ range N, a j * cos (((j + 1 : ℕ) : ℝ) * t)) ^ 2) = fun t => (c + S t) ^ 2 by rfl, hpoint] have hiConst : IntegrableOn (fun _t : ℝ => c ^ 2) (Icc (-pi) pi) := continuous_const.continuousOn.integrableOn_compact isCompact_Icc have hiLin : IntegrableOn (fun t => (2 * c) * S t) (Icc (-pi) pi) := (continuous_const.mul hcontS).continuousOn.integrableOn_compact isCompact_Icc have hiSq : IntegrableOn (fun t => (S t) ^ 2) (Icc (-pi) pi) := (hcontS.pow 2).continuousOn.integrableOn_compact isCompact_Icc calc (∫ t in Icc (-pi) pi, c ^ 2 + (2 * c) * S t + S t ^ 2) = (∫ t in Icc (-pi) pi, c ^ 2 + (2 * c) * S t) + ∫ t in Icc (-pi) pi, S t ^ 2 := by exact MeasureTheory.integral_add (hiConst.add hiLin) hiSq _ = ((∫ _t in Icc (-pi) pi, c ^ 2) + ∫ t in Icc (-pi) pi, (2 * c) * S t) + ∫ t in Icc (-pi) pi, S t ^ 2 := by rw [MeasureTheory.integral_add hiConst hiLin] _ = 2 * pi * c ^ 2 + pi * ∑ j ∈ range N, (a j) ^ 2 := by rw [MeasureTheory.integral_const_mul, hzero, hsq, hconst] ring
    Causalean.Mathlib.Analysis.JacksonApproximation.integral_sq_cos_sum · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:353
  • sum_range_sub_sq lemma — For a nonnegative integer, the sum of the squared integers from one through that integer equals that integer times its successor times one more than twice it, divided by six.
    n :
    ℕ
    ∑ j ∈ range n, ((n : ℝ) - (j : ℝ)) ^ 2 = (n : ℝ) * (n + 1) * (2 * n + 1) / 6
    Proof (Lean source)
    lemma sum_range_sub_sq (n : ℕ) : ∑ j ∈ range n, ((n : ℝ) - (j : ℝ)) ^ 2 = (n : ℝ) * (n + 1) * (2 * n + 1) / 6 := by calc ∑ j ∈ range n, ((n : ℝ) - (j : ℝ)) ^ 2 = ∑ j ∈ range n, (((n - 1 - j : ℕ) : ℝ) + 1) ^ 2 := by apply Finset.sum_congr rfl intro j hj rw [Finset.mem_range] at hj have hnat : n - j = n - 1 - j + 1 := by omega rw [show (n : ℝ) - (j : ℝ) = ((n - j : ℕ) : ℝ) by rw [Nat.cast_sub (le_of_lt hj)]] norm_num [hnat] _ = ∑ j ∈ range n, ((j : ℝ) + 1) ^ 2 := Finset.sum_range_reflect (fun j : ℕ => ((j : ℝ) + 1) ^ 2) n _ = (n : ℝ) * (n + 1) * (2 * n + 1) / 6 := by induction n with | zero => norm_num | succ n ih => rw [Finset.sum_range_succ, ih] push_cast ring
    Causalean.Mathlib.Analysis.JacksonApproximation.sum_range_sub_sq · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:480
  • continuous_jraw theorem — For integer order K, the raw Jackson kernel is continuous on the real line.
    K :
    ℕ
    Proof (Lean source)
    @[fun_prop] theorem continuous_jraw (K : ℕ) : Continuous (jraw K) := by by_cases hK : K = 0 · subst K convert (continuous_const : Continuous (fun _ : ℝ => (0 : ℝ))) using 1 funext t simp [jraw] · have hKpos : 0 < K := Nat.pos_of_ne_zero hK rw [show jraw K = fun t => ((U ℝ ((K - 1 : ℕ) : ℤ)).eval (cos (t / 2))) ^ 4 by funext t exact jraw_eq_chebyshev K hKpos t] fun_prop
    Causalean.Mathlib.Analysis.JacksonApproximation.continuous_jraw · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:506
  • measurable_jraw theorem — For integer order K, the raw Jackson kernel is Borel measurable.
    K :
    ℕ
    Proof (Lean source)
    @[measurability, fun_prop] theorem measurable_jraw (K : ℕ) : Measurable (jraw K) := by exact (continuous_jraw K).measurable
    Causalean.Mathlib.Analysis.JacksonApproximation.measurable_jraw · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:522
  • integrableOn_jraw theorem — For integer order K, the raw Jackson kernel is integrable over the standard period.
    K :
    ℕ
    Proof (Lean source)
    theorem integrableOn_jraw (K : ℕ) : IntegrableOn (jraw K) (Icc (-pi) pi) := by exact (continuous_jraw K).continuousOn.integrableOn_compact isCompact_Icc
    Causalean.Mathlib.Analysis.JacksonApproximation.integrableOn_jraw · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:528
  • jraw_even theorem — For integer order K, the raw Jackson kernel is symmetric about zero.
    K :
    ℕ
    Proof (Lean source)
    theorem jraw_even (K : ℕ) : Even (jraw K) := by intro t by_cases ht : sin (t / 2) = 0 · have hnt : sin (-t / 2) = 0 := by rw [show -t / 2 = -(t / 2) by ring, Real.sin_neg, ht, neg_zero] rw [jraw_eq_of_sin_eq_zero K hnt, jraw_eq_of_sin_eq_zero K ht] · have hnt : sin (-t / 2) ≠ 0 := by rw [show -t / 2 = -(t / 2) by ring, Real.sin_neg, neg_ne_zero] exact ht rw [jraw_eq_of_sin_ne_zero K hnt, jraw_eq_of_sin_ne_zero K ht] rw [show (K : ℝ) * -t / 2 = -((K : ℝ) * t / 2) by ring, show -t / 2 = -(t / 2) by ring, Real.sin_neg] have hs : sin (-(t / 2)) = -sin (t / 2) := Real.sin_neg _ rw [hs] congr 1 field_simp
    Causalean.Mathlib.Analysis.JacksonApproximation.jraw_even · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part1.lean:541
Tensor 6 core · 9 supporting This module tensorizes the normalized Jackson kernel and proves its positivity, normalization, measurability, and product-integration properties on finite period boxes. ★ tensorJackson_integral_eq_one

Finite tensor Jackson convolution

This module tensorizes the normalized Jackson kernel and proves its positivity, normalization, measurability, and product-integration properties on finite period boxes. It also develops the associated convolution and its elementary identities. Polynomial extraction and quantitative approximation bounds are provided by TensorExtraction.

def periodBox reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

A finite dimension determines the standard period box, whose coordinates all lie between minus π and π.

Definition (Lean source)
d :
ℕ
periodBox d :
Set (Fin d → ℝ)
{x | ∀ i, x i ∈ Icc (-pi) pi}
Causalean.Mathlib.Analysis.JacksonApproximation.periodBox · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Tensor.lean:22
def normalizedCube reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

A finite dimension determines the normalized cube, whose coordinates all lie between minus one and one.

Definition (Lean source)
d :
ℕ
normalizedCube d :
Set (Fin d → ℝ)
{x | ∀ i, x i ∈ Icc (-1 : ℝ) 1}
Causalean.Mathlib.Analysis.JacksonApproximation.normalizedCube · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Tensor.lean:28
def tensorJackson reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

An integer kernel order, a finite dimension, and a point in period coordinates determine the tensor Jackson kernel, the product of the one-dimensional kernels across coordinates. For positive order it is a normalized kernel in every dimension. At order zero it inherits the degeneracy of the one-dimensional kernel in positive dimension and vanishes, while in dimension zero it is the empty product, equal to one with unit mass, for every order.

Definition (Lean source)
K d :
ℕ
u :
Fin d → ℝ
tensorJackson K d u :
ℝ
∏ i, jackson K (u i)
Causalean.Mathlib.Analysis.JacksonApproximation.tensorJackson · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Tensor.lean:34
def cosPoint reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

A finite dimension and a point in period coordinates determine the coordinatewise cosine point.

Definition (Lean source)
d :
ℕ
t :
Fin d → ℝ
cosPoint t :
Fin d → ℝ
fun i => cos (t i)
Causalean.Mathlib.Analysis.JacksonApproximation.cosPoint · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Tensor.lean:44
def tensorConvolution reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

A finite dimension, an integer kernel order, a real function on normalized coordinates, and a point in period coordinates determine the tensor Jackson convolution, the kernel-weighted integral of the translated cosine lift over the period box. It is a kernel-weighted average for positive order when that integrand is integrable. The Bochner integral is zero for a non-integrable integrand, and at order zero in positive dimension the kernel vanishes and so does the convolution; in dimension zero the kernel is the empty product, equal to one.

Definition (Lean source)
d :
ℕ
K :
ℕ
f :
(Fin d → ℝ) → ℝ
x :
Fin d → ℝ
tensorConvolution K f x :
ℝ
∫ u in periodBox d, f (cosPoint (x - u)) * tensorJackson K d u
Causalean.Mathlib.Analysis.JacksonApproximation.tensorConvolution · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Tensor.lean:57
theorem tensorJackson_integral_eq_one reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

For a finite dimension and integer order K that is strictly positive, the tensor Jackson kernel has unit mass over the period box.

Formal statement
d K :
ℕ
hK :
0 < K
(∫ u in periodBox d, tensorJackson K d u) = 1
Proof (Lean source)
theorem tensorJackson_integral_eq_one {d K : ℕ} (hK : 0 < K) : (∫ u in periodBox d, tensorJackson K d u) = 1 := by rw [show tensorJackson K d = fun u ↦ ∏ i, jackson K (u i) by rfl, integral_periodBox_prod (fun _ ↦ jackson K)] simp [jackson_integral_eq_one K hK]
Causalean.Mathlib.Analysis.JacksonApproximation.tensorJackson_integral_eq_one · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Tensor.lean:114 · uses periodBox , tensorJackson
9 supporting declarations (lemmas, instances)
Trig­Poly 3 core · 4 supporting A *real trigonometric polynomial of degree ≤ n* is a function f(t) = ∑_{k=0}^{n} (a k · cos (k t) + b k · sin (k t)). ★ card_zeros_le★ card_simple_add_double_le

Real trigonometric polynomials and their zero count

A real trigonometric polynomial of degree ≤ n is a function f(t) = ∑_{k=0}^{n} (a k · cos (k t) + b k · sin (k t)). This file defines the predicate IsTrigPolyLE n f, records elementary closure properties, and proves the zero-count lemmas that drive the Szegő comparison:

* IsTrigPolyLE.card_zeros_le — a nonzero real trigonometric polynomial of degree ≤ n has at most 2 n zeros in any half-open period. * IsTrigPolyLE.card_simple_add_double_le — the multiplicity-refined form used by the sharp Szegő proof: a further double zero is counted twice.

This is the crucial input to Szegő's inequality that is absent from Mathlib. The proof substitutes z = e^{i t} so that f(t) = z^{-n} · P(z) for an algebraic polynomial P : ℂ[X] of degree ≤ 2 n; zeros of f in one period are roots of P on the unit circle, and Polynomial.card_roots_le_degree bounds their number by 2 n.

## Standard reference Borwein–Erdős, Polynomials and Polynomial Inequalities (1995), §5.1; Powell, Approximation Theory and Methods, on trigonometric polynomials.

def IsTrigPolyLE reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

For a nonnegative integer degree bound and a real-valued function of a real argument, the assertion that the function is a real trigonometric polynomial of degree at most the bound means that it has a finite cosine-sine expansion through that degree.

Definition (Lean source)
n :
ℕ
f :
ℝ → ℝ
IsTrigPolyLE n f :
Prop
∃ a b : ℕ → ℝ,
∀ t,
f t
= ∑ k ∈ range (n + 1), (a k * cos ((k : ℝ) * t) + b k * sin ((k : ℝ) * t))
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigPoly.lean:49
theorem card_zeros_le reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE

Zero-count lemma for real trigonometric polynomials. If a real-valued function is a trigonometric polynomial with a chosen degree bound and is not identically zero, then any finite set in a specified half-open period whose points are all zeros has cardinality at most twice the degree bound.

Formal statement
n :
ℕ
f :
ℝ → ℝ
hf :
IsTrigPolyLE n f
hne :
∃ t, f t ≠ 0
c :
ℝ
S :
Finset ℝ
hS :
↑S ⊆ Ico c (c + 2 * pi)
hzero :
∀ t ∈ S, f t = 0
S.card ≤ 2 * n
Proof (Lean source)
theorem IsTrigPolyLE.card_zeros_le {n : ℕ} {f : ℝ → ℝ} (hf : IsTrigPolyLE n f) (hne : ∃ t, f t ≠ 0) {c : ℝ} {S : Finset ℝ} (hS : ↑S ⊆ Ico c (c + 2 * pi)) (hzero : ∀ t ∈ S, f t = 0) : S.card ≤ 2 * n := by rcases hf with ⟨a, b, hf⟩ let P := trigPolyComplexPoly n a b let e : ℝ → ℂ := fun t => exp ((t : ℂ) * I) have hPne : P ≠ 0 := by rcases hne with ⟨t₀, ht₀⟩ intro hP have hprod : e t₀ ^ n * ((f t₀ : ℝ) : ℂ) = 0 := by simpa [P, e, hP] using (trigPolyComplexPoly_eval n a b f hf t₀).symm have hfzeroC : ((f t₀ : ℝ) : ℂ) = 0 := by exact (mul_eq_zero.mp hprod).resolve_left (pow_ne_zero _ (Complex.exp_ne_zero _)) exact ht₀ (Complex.ofReal_eq_zero.mp hfzeroC) have hinj : InjOn e (S : Set ℝ) := by intro s hs t ht hst exact exp_mul_I_injOn_Ico (hS hs) (hS ht) hst have hsubset : S.image e ⊆ P.roots.toFinset := by intro z hz rcases Finset.mem_image.mp hz with ⟨t, htS, rfl⟩ rw [Multiset.mem_toFinset] rw [Polynomial.mem_roots'] refine ⟨hPne, ?_⟩ rw [Polynomial.IsRoot.def] have heval := trigPolyComplexPoly_eval n a b f hf t have hft : ((f t : ℝ) : ℂ) = 0 := by rw [hzero t htS] norm_num simpa [P, e, hft] using heval calc S.card = (S.image e).card := (Finset.card_image_of_injOn hinj).symm _ ≤ P.roots.toFinset.card := Finset.card_le_card hsubset _ ≤ P.roots.card := Multiset.toFinset_card_le _ _ ≤ P.natDegree := Polynomial.card_roots' P _ ≤ 2 * n := trigPolyComplexPoly_natDegree_le n a b
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE.card_zeros_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigPoly.lean:256 · uses IsTrigPolyLE
theorem card_simple_add_double_le reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE

Multiplicity-refined zero-count lemma. Suppose a real-valued function is a trigonometric polynomial with a chosen degree bound and is not identically zero. If a finite set in a specified half-open period consists only of zeros and a further point in that period but outside the set is both a zero and a stationary point, then the size of the finite set plus two for the double zero is at most twice the degree bound.

Formal statement
n :
ℕ
f :
ℝ → ℝ
hf :
IsTrigPolyLE n f
hne :
∃ t, f t ≠ 0
c :
ℝ
S :
Finset ℝ
hS :
↑S ⊆ Ico c (c + 2 * pi)
hzero :
∀ t ∈ S, f t = 0
t₀ :
ℝ
ht₀mem :
t₀ ∈ Ico c (c + 2 * pi)
ht₀S :
t₀ ∉ S
hf0 :
f t₀ = 0
hderiv :
HasDerivAt f 0 t₀
S.card + 2 ≤ 2 * n
Proof (Lean source)
theorem IsTrigPolyLE.card_simple_add_double_le {n : ℕ} {f : ℝ → ℝ} (hf : IsTrigPolyLE n f) (hne : ∃ t, f t ≠ 0) {c : ℝ} {S : Finset ℝ} (hS : ↑S ⊆ Ico c (c + 2 * pi)) (hzero : ∀ t ∈ S, f t = 0) {t₀ : ℝ} (ht₀mem : t₀ ∈ Ico c (c + 2 * pi)) (ht₀S : t₀ ∉ S) (hf0 : f t₀ = 0) (hderiv : HasDerivAt f 0 t₀) : S.card + 2 ≤ 2 * n := by classical rcases hf with ⟨a, b, hf⟩ let P := trigPolyComplexPoly n a b let e : ℝ → ℂ := fun t => exp ((t : ℂ) * Complex.I) have hPne : P ≠ 0 := by rcases hne with ⟨t, ht⟩ intro hP have hprod : e t ^ n * ((f t : ℝ) : ℂ) = 0 := by simpa [P, e, hP] using (trigPolyComplexPoly_eval n a b f hf t).symm have hfzeroC : ((f t : ℝ) : ℂ) = 0 := by exact (mul_eq_zero.mp hprod).resolve_left (pow_ne_zero _ (Complex.exp_ne_zero _)) exact ht (Complex.ofReal_eq_zero.mp hfzeroC) have hroot0 : P.IsRoot (e t₀) := by rw [Polynomial.IsRoot.def] have heval := trigPolyComplexPoly_eval n a b f hf t₀ have hf0C : ((f t₀ : ℝ) : ℂ) = 0 := by rw [hf0] norm_num simpa [P, e, hf0C] using heval have hder0 : P.derivative.IsRoot (e t₀) := by have hcoerce : HasDerivAt (fun t : ℝ => ((t : ℝ) : ℂ)) (1 : ℂ) t₀ := by have h0 := (hasDerivAt_id' (x := t₀)).ofReal_comp have h1 : HasDerivAt (fun t : ℝ => ((t : ℝ) : ℂ)) _ t₀ := h0 simpa using h1 have hinner : HasDerivAt (fun t : ℝ => (t : ℂ) * Complex.I) Complex.I t₀ := by simpa using hcoerce.mul_const Complex.I have he : HasDerivAt e (e t₀ * Complex.I) t₀ := by simpa [e] using hinner.cexp have hpoly : HasDerivAt (fun t : ℝ => P.eval (e t)) (P.derivative.eval (e t₀) * (e t₀ * Complex.I)) t₀ := by have h0 := (P.hasDerivAt (e t₀)).comp t₀ he have h1 : HasDerivAt (fun t : ℝ => P.eval (e t)) _ t₀ := h0 simpa using h1 have hfC : HasDerivAt (fun t : ℝ => ((f t : ℝ) : ℂ)) (0 : ℂ) t₀ := by simpa using hderiv.ofReal_comp have hprod : HasDerivAt (fun t : ℝ => (e t) ^ n * ((f t : ℝ) : ℂ)) 0 t₀ := by have hraw : HasDerivAt (fun t : ℝ => (e t) ^ n * ((f t : ℝ) : ℂ)) _ t₀ := (he.fun_pow n).fun_mul hfC simpa [hf0] using hraw have hsame : HasDerivAt (fun t : ℝ => P.eval (e t)) 0 t₀ := by refine hprod.congr_of_eventuallyEq (Filter.Eventually.of_forall ?_) intro t simpa [P, e] using trigPolyComplexPoly_eval n a b f hf t have hmul : P.derivative.eval (e t₀) * (e t₀ * Complex.I) = 0 := hpoly.unique hsame have hne : e t₀ * Complex.I ≠ 0 := by exact mul_ne_zero (Complex.exp_ne_zero _) Complex.I_ne_zero rw [Polynomial.IsRoot.def] exact (mul_eq_zero.mp hmul).resolve_right hne have hmult2 : 2 ≤ P.rootMultiplicity (e t₀) := by have hlt : 1 < P.rootMultiplicity (e t₀) := (Polynomial.one_lt_rootMultiplicity_iff_isRoot hPne).2 ⟨hroot0, hder0⟩ omega have hinj : InjOn e ((S : Set ℝ) ∪ {t₀}) := by intro s hs t ht hst have hsI : s ∈ Ico c (c + 2 * pi) := by rcases hs with hsS | rfl · exact hS hsS · exact ht₀mem have htI : t ∈ Ico c (c + 2 * pi) := by rcases ht with htS | rfl · exact hS htS · exact ht₀mem exact exp_mul_I_injOn_Ico hsI htI hst let A : Finset ℂ := S.image e have hcardA : A.card = S.card := by have hinjS : InjOn e (S : Set ℝ) := by intro s hs t ht hst exact hinj (inl hs) (inl ht) hst simpa [A] using Finset.card_image_of_injOn hinjS have he0_not_mem_A : e t₀ ∉ A := by intro hmem rcases Finset.mem_image.mp hmem with ⟨t, htS, ht⟩ have ht_eq : t = t₀ := hinj (inl htS) (inr rfl) ht exact ht₀S (ht_eq ▸ htS) have hAroots : A ⊆ P.roots.toFinset := by intro z hz rcases Finset.mem_image.mp hz with ⟨t, htS, rfl⟩ rw [Multiset.mem_toFinset] rw [Polynomial.mem_roots'] refine ⟨hPne, ?_⟩ rw [Polynomial.IsRoot.def] have heval := trigPolyComplexPoly_eval n a b f hf t have hft : ((f t : ℝ) : ℂ) = 0 := by rw [hzero t htS] norm_num simpa [P, e, hft] using heval let T : Multiset ℂ := A.val + Multiset.replicate 2 (e t₀) have hTroots : T ≤ P.roots := by rw [Multiset.le_iff_count] intro z by_cases hz0 : z = e t₀ · subst hz0 have hAcount : A.val.count (e t₀) = 0 := by rw [Multiset.count_eq_zero] simpa using he0_not_mem_A have hrootcount : 2 ≤ P.roots.count (e t₀) := by simpa [Polynomial.count_roots] using hmult2 change (A.val + Multiset.replicate 2 (e t₀)).count (e t₀) ≤ P.roots.count (e t₀) rw [Multiset.count_add, hAcount] simpa using hrootcount · by_cases hzA : z ∈ A · have hAcount : A.val.count z = 1 := by exact Multiset.count_eq_one_of_mem A.nodup hzA have hrepcount : (Multiset.replicate 2 (e t₀)).count z = 0 := by rw [Multiset.count_replicate] simp [show ¬ e t₀ = z by exact fun h => hz0 h.symm] have hrootmem : z ∈ P.roots := by exact Multiset.mem_toFinset.mp (hAroots hzA) have hrootcount : 1 ≤ P.roots.count z := by exact Multiset.count_pos.mpr hrootmem change (A.val + Multiset.replicate 2 (e t₀)).count z ≤ P.roots.count z rw [Multiset.count_add, hAcount, hrepcount] simpa using hrootcount · have hAcount : A.val.count z = 0 := by rw [Multiset.count_eq_zero] simpa using hzA have hrepcount : (Multiset.replicate 2 (e t₀)).count z = 0 := by rw [Multiset.count_replicate] simp [show ¬ e t₀ = z by exact fun h => hz0 h.symm] change (A.val + Multiset.replicate 2 (e t₀)).count z ≤ P.roots.count z rw [Multiset.count_add, hAcount, hrepcount] simp have hTcard : T.card = S.card + 2 := by simp [T, hcardA] calc S.card + 2 = T.card := hTcard.symm _ ≤ P.roots.card := Multiset.card_le_card hTroots _ ≤ P.natDegree := Polynomial.card_roots' P _ ≤ 2 * n := trigPolyComplexPoly_natDegree_le n a b
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE.card_simple_add_double_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigPoly.lean:305 · uses IsTrigPolyLE
4 supporting declarations (lemmas, instances)
  • isTrigPolyLE_const theorem — The constant function with a chosen real value is, for any specified nonnegative degree bound, a real trigonometric polynomial within that bound; it uses only the zero-frequency term.
    n :
    ℕ
    c :
    ℝ
    IsTrigPolyLE n (fun _ => c)
    Proof (Lean source)
    theorem isTrigPolyLE_const (n : ℕ) (c : ℝ) : IsTrigPolyLE n (fun _ => c) := by refine ⟨fun k => if k = 0 then c else 0, fun _ => 0, ?_⟩ intro t simp
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.isTrigPolyLE_const · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigPoly.lean:62
  • mono theorem — A real trigonometric polynomial with one degree bound is, for a second degree bound, also a trigonometric polynomial within that second bound whenever the first bound does not exceed the second; the additional coefficients can be set to zero.
    n m :
    ℕ
    f :
    ℝ → ℝ
    hf :
    IsTrigPolyLE n f
    hnm :
    n ≤ m
    IsTrigPolyLE m f
    Proof (Lean source)
    theorem IsTrigPolyLE.mono {n m : ℕ} {f : ℝ → ℝ} (hf : IsTrigPolyLE n f) (hnm : n ≤ m) : IsTrigPolyLE m f := by rcases hf with ⟨a, b, hf⟩ refine ⟨fun k => if k ≤ n then a k else 0, fun k => if k ≤ n then b k else 0, ?_⟩ intro t rw [hf t] calc (∑ k ∈ range (n + 1), (a k * cos ((k : ℝ) * t) + b k * sin ((k : ℝ) * t))) = ∑ k ∈ range (n + 1), ((if k ≤ n then a k else 0) * cos ((k : ℝ) * t) + (if k ≤ n then b k else 0) * sin ((k : ℝ) * t)) := by apply Finset.sum_congr rfl intro k hk have hk_le : k ≤ n := Nat.lt_succ_iff.mp (Finset.mem_range.mp hk) simp [hk_le] _ = ∑ k ∈ range (m + 1), ((if k ≤ n then a k else 0) * cos ((k : ℝ) * t) + (if k ≤ n then b k else 0) * sin ((k : ℝ) * t)) := by apply Finset.sum_subset · rw [Finset.range_subset_range] exact Nat.succ_le_succ hnm · intro k _ hkn have hle : ¬ k ≤ n := by intro hk exact hkn (Finset.mem_range.mpr (Nat.lt_succ_of_le hk)) simp [hle]
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE.mono · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigPoly.lean:70
  • sub theorem — The pointwise difference of two real trigonometric polynomials with a common degree bound is a real trigonometric polynomial with the same bound, obtained by subtracting their coefficient sequences term by term.
    n :
    ℕ
    f g :
    ℝ → ℝ
    hf :
    IsTrigPolyLE n f
    hg :
    IsTrigPolyLE n g
    IsTrigPolyLE n (fun t => f t - g t)
    Proof (Lean source)
    theorem IsTrigPolyLE.sub {n : ℕ} {f g : ℝ → ℝ} (hf : IsTrigPolyLE n f) (hg : IsTrigPolyLE n g) : IsTrigPolyLE n (fun t => f t - g t) := by rcases hf with ⟨af, bf, hf⟩ rcases hg with ⟨ag, bg, hg⟩ refine ⟨fun k => af k - ag k, fun k => bf k - bg k, ?_⟩ intro t change f t - g t = _ rw [hf t, hg t] rw [← Finset.sum_sub_distrib] apply Finset.sum_congr rfl intro k _ ring
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE.sub · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigPoly.lean:101
  • exp_mul_I_injOn_Ico lemma — In the half-open real interval of one full period beginning at a chosen point, two angles in that interval are equal if their unit-circle complex exponentials agree.
    c s t :
    ℝ
    hs :
    s ∈ Ico c (c + 2 * pi)
    ht :
    t ∈ Ico c (c + 2 * pi)
    h :
    exp ((s : ℂ) * I) = exp ((t : ℂ) * I)
    s = t
    Proof (Lean source)
    lemma exp_mul_I_injOn_Ico {c s t : ℝ} (hs : s ∈ Ico c (c + 2 * pi)) (ht : t ∈ Ico c (c + 2 * pi)) (h : exp ((s : ℂ) * I) = exp ((t : ℂ) * I)) : s = t := by rcases Complex.exp_eq_exp_iff_exists_int.mp h with ⟨m, hm⟩ have him : s = t + (m : ℝ) * (2 * pi) := by have := congrArg im hm simpa [Complex.ofReal_mul, Complex.ofReal_add, Complex.ofReal_intCast] using this have hdiff : s - t = (m : ℝ) * (2 * pi) := by linarith have hlt : -(2 * pi) < s - t ∧ s - t < 2 * pi := by constructor <;> linarith [hs.1, hs.2, ht.1, ht.2] have hpi : 0 < 2 * pi := by positivity have hm0 : m = 0 := by by_contra hmne have hle_abs : 2 * pi ≤ |(m : ℝ) * (2 * pi)| := by rw [abs_mul, abs_of_pos hpi] have : (1 : ℝ) ≤ |(m : ℝ)| := by exact_mod_cast Int.one_le_abs hmne nlinarith have hbounds : |s - t| < 2 * pi := by rw [abs_lt] exact hlt rw [hdiff] at hbounds linarith subst hm0 simpa using him
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.exp_mul_I_injOn_Ico · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigPoly.lean:226
Coefficient­Envelope­Four 2 core · 1 supporting This module bounds the coefficient one-norm of the four-variable polynomial extracted from a uniformly bounded tensor Jackson convolution, while retaining coordinate and total-degree control. ★ tensorConvolution_exists_mvPolynomial_four_coeffBound

A four-dimensional coefficient envelope for Jackson approximation

This module bounds the coefficient one-norm of the four-variable polynomial extracted from a uniformly bounded tensor Jackson convolution, while retaining coordinate and total-degree control.

def mvCoeffL1 reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

A finite dimension and a real multivariate polynomial determine its coefficient one-norm, the sum of the absolute values of all monomial coefficients.

Definition (Lean source)
d :
ℕ
p :
mvCoeffL1 p :
ℝ
∑ m ∈ p.support, |p.coeff m|
Causalean.Mathlib.Analysis.JacksonApproximation.mvCoeffL1 · Causalean/Mathlib/Analysis/Approximation/Chebyshev/CoefficientEnvelopeFour.lean:19
theorem tensorConvolution_exists_mvPolynomial_four_coeffBound reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

For integer order K that is strictly positive, a function on four normalized coordinates that is continuous on the normalized cube, a nonnegative uniform bound B, and the corresponding bound on the function throughout the cube, there is a four-variable polynomial that reproduces the tensor convolution at the coordinatewise cosines of every point, has degree at most 2 (K − 1) in each variable and total degree at most 8 (K − 1), and whose coefficients have absolute values summing to at most 2 to the power 40 K + 20, times B.

Formal statement
K :
ℕ
hK :
0 < K
f :
(Fin 4 → ℝ) → ℝ
B :
ℝ
hB :
0 ≤ B
hbound :
∀ z ∈ normalizedCube 4, |f z| ≤ B
∃ p : MvPolynomial (Fin 4) ℝ,
conclusion 1
x :
Fin 4 → ℝ
eval (cosPoint x) p = tensorConvolution K f x
conclusion 2
m ∈ p.support :
i :
m i ≤ 2 * (K - 1)
conclusion 3
p.totalDegree ≤ 8 * (K - 1)
conclusion 4
mvCoeffL1 p ≤ (2 : ℝ) ^ (40 * K + 20) * B
Proof (Lean source)
theorem tensorConvolution_exists_mvPolynomial_four_coeffBound {K : ℕ} (hK : 0 < K) (f : (Fin 4 → ℝ) → ℝ) (B : ℝ) (hB : 0 ≤ B) (hf : ContinuousOn f (normalizedCube 4)) (hbound : ∀ z ∈ normalizedCube 4, |f z| ≤ B) : ∃ p : MvPolynomial (Fin 4) ℝ, (∀ x : Fin 4 → ℝ, eval (cosPoint x) p = tensorConvolution K f x) ∧ (∀ m ∈ p.support, ∀ i, m i ≤ 2 * (K - 1)) ∧ p.totalDegree ≤ 8 * (K - 1) ∧ mvCoeffL1 p ≤ (2 : ℝ) ^ (40 * K + 20) * B := by /- Proof route: expose the finite cosine coefficients of `jackson K`; expand the four translated factors, integrate their bounded coefficient functions, and discard all sine terms using coordinate evenness. Replace each cosine frequency by `T`, tensor the four univariate polynomials with `toMvPolynomial`, and use `chebyshev_coeffL1_le`. Bounding the finite Fourier coefficients by the kernel mass and counting the at most `(2 * (K - 1) + 1)^4` indices leaves ample room in `2^(40*K+20)`. The same explicit construction supplies the evaluation, coordinate-support, and total-degree conjuncts; do not obtain the coefficient claim from the nonquantitative existence theorem by an arbitrary choice of representative. -/ classical let n := 2 * (K - 1) rcases tensorConvolution_exists_mvPolynomial hK f hf with ⟨p, hp_eval, hp_coord, hp_total⟩ have hcompact : IsCompact (periodBox 4) := by rw [show periodBox 4 = {u | ∀ i, u i ∈ Icc (-pi) pi} by rfl] exact isCompact_pi_infinite fun _ => isCompact_Icc have hfcos (x : Fin 4 → ℝ) : Continuous (fun u : Fin 4 → ℝ => f (cosPoint (x - u))) := by apply hf.comp_continuous · unfold cosPoint fun_prop · exact fun u => cosPoint_mem_normalizedCube (x - u) have hjc : Continuous (tensorJackson K 4) := by unfold tensorJackson fun_prop have hint_f (x : Fin 4 → ℝ) : IntegrableOn (fun u : Fin 4 → ℝ => f (cosPoint (x - u)) * tensorJackson K 4 u) (periodBox 4) := ((hfcos x).mul hjc).continuousOn.integrableOn_compact hcompact have hint_B : IntegrableOn (fun u : Fin 4 → ℝ => B * tensorJackson K 4 u) (periodBox 4) := (continuous_const.mul hjc).continuousOn.integrableOn_compact hcompact have hsub (x : Fin 4 → ℝ) : tensorConvolution K (fun z => B - f z) x = B - tensorConvolution K f x := by unfold tensorConvolution rw [show (fun u : Fin 4 → ℝ => (B - f (cosPoint (x - u))) * tensorJackson K 4 u) = fun u => B * tensorJackson K 4 u - f (cosPoint (x - u)) * tensorJackson K 4 u by funext u; ring, integral_sub hint_B (hint_f x), integral_const_mul, tensorJackson_integral_eq_one hK] ring have hadd (x : Fin 4 → ℝ) : tensorConvolution K (fun z => B + f z) x = B + tensorConvolution K f x := by unfold tensorConvolution rw [show (fun u : Fin 4 → ℝ => (B + f (cosPoint (x - u))) * tensorJackson K 4 u) = fun u => B * tensorJackson K 4 u + f (cosPoint (x - u)) * tensorJackson K 4 u by funext u; ring, integral_add hint_B (hint_f x), integral_const_mul, tensorJackson_integral_eq_one hK] ring have hconv_bound (x : Fin 4 → ℝ) : |tensorConvolution K f x| ≤ B := by rw [abs_le] constructor · have hn := tensorConvolution_nonneg hK (f := fun z : Fin 4 → ℝ => B + f z) (fun z hz => by have := hbound z hz rw [abs_le] at this linarith) x rw [hadd] at hn linarith · have hn := tensorConvolution_nonneg hK (f := fun z : Fin 4 → ℝ => B - f z) (fun z hz => by have := hbound z hz rw [abs_le] at this linarith) x rw [hsub] at hn linarith have hp_bound : ∀ z ∈ normalizedCube 4, |eval z p| ≤ B := by intro z hz let x : Fin 4 → ℝ := fun i => arccos (z i) have hcosx : cosPoint x = z := by funext i exact Real.cos_arccos (hz i).1 (hz i).2 rw [← hcosx, hp_eval] exact hconv_bound x have hp_l1 : mvCoeffL1 p ≤ ((2 : ℝ) * (n + 1) ^ 2 * (3 : ℝ) ^ n) ^ 4 * B := mvCoeffL1_le_bounded p B hB hp_coord hp_bound have hn_factor : (2 : ℝ) * (n + 1) ^ 2 * (3 : ℝ) ^ n ≤ (2 : ℝ) ^ (4 * n + 3) := by have hsucc : (n : ℝ) + 1 ≤ (2 : ℝ) ^ (n + 1) := by simpa using natCast_succ_le_two_pow n have hthree : (3 : ℝ) ^ n ≤ (4 : ℝ) ^ n := pow_le_pow_left₀ (by norm_num) (by norm_num) n calc (2 : ℝ) * (n + 1) ^ 2 * (3 : ℝ) ^ n ≤ 2 * ((2 : ℝ) ^ (n + 1)) ^ 2 * ((4 : ℝ) ^ n) := by gcongr _ = (2 : ℝ) ^ (4 * n + 3) := by rw [← pow_mul, show (4 : ℝ) = 2 ^ 2 by norm_num, ← pow_mul] calc (2 : ℝ) * 2 ^ ((n + 1) * 2) * 2 ^ (2 * n) = (2 : ℝ) ^ ((n + 1) * 2 + 1) * 2 ^ (2 * n) := by rw [pow_add, pow_one] ring _ = (2 : ℝ) ^ (((n + 1) * 2 + 1) + 2 * n) := by rw [pow_add] ring _ = (2 : ℝ) ^ (4 * n + 3) := by congr 1; omega have hn_power : ((2 : ℝ) * (n + 1) ^ 2 * (3 : ℝ) ^ n) ^ 4 ≤ (2 : ℝ) ^ (40 * K + 20) := by calc ((2 : ℝ) * (n + 1) ^ 2 * (3 : ℝ) ^ n) ^ 4 ≤ ((2 : ℝ) ^ (4 * n + 3)) ^ 4 := pow_le_pow_left₀ (by positivity) hn_factor 4 _ = (2 : ℝ) ^ (4 * (4 * n + 3)) := by rw [← pow_mul]; congr 1; omega _ ≤ (2 : ℝ) ^ (40 * K + 20) := by apply pow_le_pow_right₀ (by norm_num) dsimp [n] omega refine ⟨p, hp_eval, hp_coord, ?_, ?_⟩ · simpa [n, Nat.mul_assoc, Nat.mul_left_comm, Nat.mul_comm] using hp_total · exact hp_l1.trans (mul_le_mul_of_nonneg_right hn_power hB)
Causalean.Mathlib.Analysis.JacksonApproximation.tensorConvolution_exists_mvPolynomial_four_coeffBound · Causalean/Mathlib/Analysis/Approximation/Chebyshev/CoefficientEnvelopeFour.lean:363 · uses cosPoint , mvCoeffL1 , normalizedCube , tensorConvolution
1 supporting declaration (lemmas, instances)
  • mvCoeffL1_le_bounded theorem — For a polynomial in finitely many variables, a coordinatewise degree limit, and a nonnegative uniform bound on its normalized-cube values, the coefficient one-norm has an explicit dimension-dependent bound.
    d n :
    ℕ
    p :
    B :
    ℝ
    hB :
    0 ≤ B
    hcoord :
    ∀ m ∈ p.support, ∀ i, m i ≤ n
    hbound :
    ∀ x ∈ normalizedCube d, |eval x p| ≤ B
    mvCoeffL1 p ≤ ((2 : ℝ) * (n + 1) ^ 2 * (3 : ℝ) ^ n) ^ d * B
    Proof (Lean source)
    theorem mvCoeffL1_le_bounded {d n : ℕ} (p : MvPolynomial (Fin d) ℝ) (B : ℝ) (hB : 0 ≤ B) (hcoord : ∀ m ∈ p.support, ∀ i, m i ≤ n) (hbound : ∀ x ∈ normalizedCube d, |eval x p| ≤ B) : mvCoeffL1 p ≤ ((2 : ℝ) * (n + 1) ^ 2 * (3 : ℝ) ^ n) ^ d * B := by induction d generalizing B with | zero => have hx := hbound (fun i => elim0 i) (fun i => elim0 i) have hm (m : Fin 0 →₀ ℕ) : m = 0 := by apply Finsupp.ext intro i exact elim0 i simpa [mvCoeffL1, MvPolynomial.eval_eq, hm] using hx | succ d ih => classical let P := (MvPolynomial.finSuccEquiv ℝ d) p have hPdeg : P.natDegree ≤ n := by dsimp [P] rw [MvPolynomial.natDegree_finSuccEquiv] exact MvPolynomial.degreeOf_le_iff.mpr (fun m hm => hcoord m hm 0) have htail (i : ℕ) : ∀ m ∈ (P.coeff i).support, ∀ j, m j ≤ n := by intro m hm j have := hcoord (Finsupp.cons i m) (by rw [MvPolynomial.mem_support_iff, ← MvPolynomial.finSuccEquiv_coeff_coeff] exact MvPolynomial.mem_support_iff.mp hm) j.succ simpa using this have hcoeff_bound (i : ℕ) (hi : i < n + 1) (y : Fin d → ℝ) (hy : y ∈ normalizedCube d) : |eval y (P.coeff i)| ≤ (2 * (n + 1) * (3 : ℝ) ^ n) * B := by let r : Polynomial ℝ := Polynomial.map (eval y) P have hrdeg : r.natDegree ≤ n := Polynomial.natDegree_map_le.trans hPdeg have hrbound : ∀ x ∈ Icc (-1 : ℝ) 1, |r.eval x| ≤ B := by intro x hx dsimp [r] rw [← MvPolynomial.eval_eq_eval_mv_eval'] apply hbound intro j refine Fin.cases hx (fun k => hy k) j calc |eval y (P.coeff i)| = |r.coeff i| := by dsimp [r] rw [MvPolynomial.coeff_eval_eq_eval_coeff] _ ≤ polyCoeffL1 r := abs_poly_coeff_le_coeffL1 r i _ ≤ (2 * (n + 1) * (3 : ℝ) ^ n) * B := polyCoeffL1_le_bounded n r B hB hrdeg hrbound rw [mvCoeffL1_finSucc p hcoord] calc (∑ i ∈ range (n + 1), mvCoeffL1 (P.coeff i)) ≤ ∑ i ∈ range (n + 1), (((2 : ℝ) * (n + 1) ^ 2 * (3 : ℝ) ^ n) ^ d * ((2 * (n + 1) * (3 : ℝ) ^ n) * B)) := by apply Finset.sum_le_sum intro i hi apply ih (P.coeff i) ((2 * (n + 1) * (3 : ℝ) ^ n) * B) · positivity · exact htail i · exact hcoeff_bound i (Finset.mem_range.mp hi) _ = ((2 : ℝ) * (n + 1) ^ 2 * (3 : ℝ) ^ n) ^ (d + 1) * B := by rw [Finset.sum_const, Finset.card_range, pow_succ] ring
    Causalean.Mathlib.Analysis.JacksonApproximation.mvCoeffL1_le_bounded · Causalean/Mathlib/Analysis/Approximation/Chebyshev/CoefficientEnvelopeFour.lean:287
Heterogeneous­Tensor 6 core · 4 supporting This module defines product Jackson convolution for an arbitrary finite coordinate type with a separate order in every coordinate. ★ convolution_shifted

Heterogeneous tensor Jackson convolution

This module defines product Jackson convolution for an arbitrary finite coordinate type with a separate order in every coordinate. It establishes integrability, parameter measurability, and the period-box translation identity used by the algebraic extraction layer.

def cube reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

The normalized cube is the set of coordinate vectors with every entry between minus one and one. This set is specified coordinatewise.

Definition (Lean source)
ι :
Type u_1
shared
cube :
Set (ι → ℝ)
{x | ∀ i, x i ∈ Icc (-1 : ℝ) 1}
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.cube · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensor.lean:24
def periodBox reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

The period box is the set of angle vectors with every entry between minus π and π. This set is specified coordinatewise.

Definition (Lean source)
ι :
Type u_1
shared
periodBox :
Set (ι → ℝ)
pi univ (fun _ : ι => Icc (-pi) pi)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.periodBox · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensor.lean:28
def cosPoint reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

An angle vector determines its coordinatewise cosine point. The point applies cosine in every coordinate.

Definition (Lean source)
ι :
Type u_1
shared
x :
ι → ℝ
cosPoint x :
ι → ℝ
fun i => cos (x i)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.cosPoint · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensor.lean:33
def kernel reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

A coordinate-specific order map and an angle vector determine the heterogeneous Jackson kernel. The kernel is the finite product of the one-dimensional Jackson kernels.

Definition (Lean source)
ι :
Type u_1
shared
d :
ι → ℕ
u :
ι → ℝ
kernel d u :
ℝ
∏ i, jackson (d i) (u i)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.kernel · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensor.lean:37
def convolution reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

A coordinate-specific order map, a cube target, and a phase vector determine the heterogeneous Jackson convolution. The convolution integrates the translated cosine lift against the product kernel over the period box.

Definition (Lean source)
ι :
Type u_1
shared
d :
ι → ℕ
f :
(ι → ℝ) → ℝ
x :
ι → ℝ
convolution d f x :
ℝ
∫ u in periodBox, f (cosPoint (x - u)) * kernel d u
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.convolution · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensor.lean:42
theorem convolution_shifted reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

For a coordinate-specific positive order map, a measurable cube target, a real bound B such that the target is at most B in absolute value on the cube, and a phase vector x, the heterogeneous Jackson convolution at x equals the integral over the period box of the cosine lift of the target at v times the product kernel at x − v.

Formal statement
ι :
Type u_1
shared
d :
ι → ℕ
hd :
∀ i, 0 < d i
f :
(ι → ℝ) → ℝ
hf :
B :
ℝ
hB :
∀ y ∈ cube, |f y| ≤ B
x :
ι → ℝ
convolution d f x = ∫ v in periodBox, f (cosPoint v) * kernel d (x - v)
Proof (Lean source)
theorem convolution_shifted (d : ι → ℕ) (hd : ∀ i, 0 < d i) (f : (ι → ℝ) → ℝ) (hf : Measurable f) (B : ℝ) (hB : ∀ y ∈ cube, |f y| ≤ B) (x : ι → ℝ) : convolution d f x = ∫ v in periodBox, f (cosPoint v) * kernel d (x - v) := by classical let J (i : ι) : ℝ → ℝ := jackson (d i) have hjp (i : ι) : Periodic (J i) (2 * pi) := by rcases jackson_isTrigPolyLE (d i) (hd i) with ⟨a, b, hab⟩ intro t change jackson (d i) (t + 2 * pi) = jackson (d i) t rw [hab, hab] apply Finset.sum_congr rfl intro k hk have hc : cos ((k : ℝ) * (t + 2 * pi)) = cos ((k : ℝ) * t) := by rw [show (k : ℝ) * (t + 2 * pi) = (k : ℝ) * t + k * (2 * pi) by push_cast; ring, Real.cos_add_nat_mul_two_pi] have hs : sin ((k : ℝ) * (t + 2 * pi)) = sin ((k : ℝ) * t) := by rw [show (k : ℝ) * (t + 2 * pi) = (k : ℝ) * t + k * (2 * pi) by push_cast; ring, Real.sin_add_nat_mul_two_pi] rw [hc, hs] have hjbound : ∀ i, ∃ C : ℝ, ∀ t, |J i t| ≤ C := by intro i obtain ⟨C, hC⟩ := ((hjp i).isBounded_of_continuous (by positivity) (by dsimp [J] exact continuous_jackson _)).exists_norm_le exact ⟨C, fun t => by simpa [Real.norm_eq_abs] using hC _ ⟨t, rfl⟩⟩ choose C hC using hjbound have hCnonneg (i : ι) : 0 ≤ C i := le_trans (abs_nonneg _) (hC i 0) have hkernel (y : ι → ℝ) : |kernel d y| ≤ ∏ i, C i := by simp only [kernel, Finset.abs_prod] exact Finset.prod_le_prod (fun i hi => abs_nonneg _) (fun i hi => hC i (y i)) have hBnonneg : 0 ≤ B := by exact le_trans (abs_nonneg _) (hB (cosPoint (fun _ => 0)) (by intro i exact ⟨Real.neg_one_le_cos _, Real.cos_le_one _⟩)) let F : (ι → ℝ) → ℝ := fun v => f (cosPoint v) * kernel d (x - v) have hFm : Measurable F := by have hcos : Measurable (cosPoint (ι := ι)) := by unfold cosPoint fun_prop have hk : Measurable (fun v : ι → ℝ => kernel d (x - v)) := by unfold kernel fun_prop (disch := exact measurable_jackson _) exact (hf.comp hcos).mul hk have hFb : ∀ y, |F y| ≤ B * ∏ i, C i := by intro y have hfy : |f (cosPoint y)| ≤ B := hB _ (by intro i exact ⟨Real.neg_one_le_cos _, Real.cos_le_one _⟩) calc |F y| = |f (cosPoint y)| * |kernel d (x - y)| := by simp [F, abs_mul] _ ≤ B * |kernel d (x - y)| := mul_le_mul_of_nonneg_right hfy (abs_nonneg _) _ ≤ B * ∏ i, C i := mul_le_mul_of_nonneg_left (hkernel _) hBnonneg have hFp : ∀ (i : ι) (y : ι → ℝ), Periodic (fun t => F (update y i t)) (2 * pi) := by intro i y t dsimp [F, kernel, cosPoint] congr 1 · congr 1 funext j by_cases hji : j = i · subst j simpa [cosPoint] using Real.cos_add_two_pi t · simp [cosPoint, update, hji] · apply Finset.prod_congr rfl intro j hj by_cases hji : j = i · subst j simp only [update, if_pos rfl] change J i (x i - (t + 2 * pi)) = J i (x i - t) convert (hjp i (x i - t - 2 * pi)).symm using 1 <;> ring · simp only [update] split <;> simp_all have ht := periodBox_integral_sub_eq F hFm (B * ∏ i, C i) hFb hFp x dsimp [F] at ht convert ht using 1 · apply integral_congr_ae filter_upwards intro u congr 1 · congr 1 funext i change u i = x i - (x i - u i) ring
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.convolution_shifted · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensor.lean:276 · uses convolution , cosPoint , cube , kernel , periodBox
4 supporting declarations (lemmas, instances)
  • integrableOn_convolution_integrand theorem — For a coordinate-specific order map, a target function that is measurable, a real bound B such that the target is at most B in absolute value on the cube, and a phase vector, the heterogeneous Jackson integrand, the translated cosine lift of the target times the product kernel, is integrable on the period box.
    ι :
    Type u_1
    shared
    d :
    ι → ℕ
    f :
    (ι → ℝ) → ℝ
    hf :
    B :
    ℝ
    hB :
    ∀ x ∈ cube, |f x| ≤ B
    x :
    ι → ℝ
    IntegrableOn (fun u => f (cosPoint (x - u)) * kernel d u) periodBox
    Proof (Lean source)
    theorem integrableOn_convolution_integrand (d : ι → ℕ) (f : (ι → ℝ) → ℝ) (hf : Measurable f) (B : ℝ) (hB : ∀ x ∈ cube, |f x| ≤ B) (x : ι → ℝ) : IntegrableOn (fun u => f (cosPoint (x - u)) * kernel d u) periodBox := by have hcos : Continuous (fun u : ι → ℝ => cosPoint (x - u)) := by unfold cosPoint fun_prop have hk : Continuous (kernel d) := by unfold kernel fun_prop (disch := exact continuous_jackson _) have hbox : IsCompact (periodBox (ι := ι)) := by exact isCompact_univ_pi (fun _ => isCompact_Icc) have hki : IntegrableOn (kernel d) periodBox := hk.continuousOn.integrableOn_compact hbox have hmeas : Measurable (fun u => f (cosPoint (x - u)) * kernel d u) := ((hf.comp hcos.measurable).mul hk.measurable) apply Integrable.mono' (hki.norm.const_mul B) hmeas.aestronglyMeasurable.restrict filter_upwards [ae_restrict_mem hbox.measurableSet] with u hu have hfB : |f (cosPoint (x - u))| ≤ B := hB _ (by intro i exact ⟨Real.neg_one_le_cos _, Real.cos_le_one _⟩) simpa [Real.norm_eq_abs, abs_mul] using mul_le_mul_of_nonneg_right hfB (abs_nonneg (kernel d u))
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.integrableOn_convolution_integrand · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensor.lean:47
  • measurable_convolution theorem — A coordinate-specific order map, a parameter-indexed target, its joint measurability, and a fixed phase vector imply that the heterogeneous convolution is measurable in the parameter.
    ι :
    Type u_1
    shared
    Ω :
    Type u_2
    shared
    d :
    ι → ℕ
    g :
    Ω → (ι → ℝ) → ℝ
    hg :
    Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)
    x :
    ι → ℝ
    Measurable (fun ω => convolution d (g ω) x)
    Proof (Lean source)
    @[fun_prop] theorem measurable_convolution (d : ι → ℕ) (g : Ω → (ι → ℝ) → ℝ) (hg : Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)) (x : ι → ℝ) : Measurable (fun ω => convolution d (g ω) x) := by have hcos : Measurable (fun u : ι → ℝ => cosPoint (x - u)) := by unfold cosPoint fun_prop have hk : Measurable (kernel d) := by unfold kernel fun_prop (disch := exact measurable_jackson _) have hpair : Measurable (fun z : Ω × (ι → ℝ) => (z.1, cosPoint (x - z.2))) := measurable_fst.prodMk (hcos.comp measurable_snd) have h : Measurable (fun z : Ω × (ι → ℝ) => g z.1 (cosPoint (x - z.2)) * kernel d z.2) := (hg.comp hpair).mul (hk.comp measurable_snd) simpa only [convolution] using (h.stronglyMeasurable.integral_prod_right' (ν := (volume.restrict periodBox))).measurable
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.measurable_convolution · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensor.lean:76
  • periodBox_integral_sub_eq_fin theorem — A finite dimension, a function on its phase vectors, its measurability, a uniform bound, the bound on every vector, coordinatewise periodicity, and a translation vector imply that reflection and translation leave the period-box integral unchanged.
    n :
    ℕ
    F :
    (Fin n → ℝ) → ℝ
    hF :
    B :
    ℝ
    hB :
    ∀ y, |F y| ≤ B
    hper :
    ∀ i y, Periodic (fun t => F (update y i t)) (2 * pi)
    x :
    Fin n → ℝ
    (∫ u in periodBox, F (x - u)) = ∫ u in periodBox, F u
    Proof (Lean source)
    theorem periodBox_integral_sub_eq_fin (n : ℕ) (F : (Fin n → ℝ) → ℝ) (hF : Measurable F) (B : ℝ) (hB : ∀ y, |F y| ≤ B) (hper : ∀ i y, Periodic (fun t => F (update y i t)) (2 * pi)) (x : Fin n → ℝ) : (∫ u in periodBox, F (x - u)) = ∫ u in periodBox, F u := by classical have hsplit : ∀ {m : ℕ} (G : (Fin (m + 1) → ℝ) → ℝ), Measurable G → (∀ y, |G y| ≤ B) → (∫ u in periodBox, G u) = ∫ t in Icc (-pi) pi, ∫ v in periodBox, G (Fin.insertNth 0 t v) := by intro m G hG hGb let e : ℝ × (Fin m → ℝ) ≃ᵐ (Fin (m + 1) → ℝ) := (piFinSuccAbove (fun _ => ℝ) 0).symm have hem : MeasurePreserving e := (volume_preserving_piFinSuccAbove (fun _ : Fin (m + 1) => ℝ) 0).symm _ have he : e ⁻¹' periodBox = Icc (-pi) pi ×ˢ periodBox := by ext z simp only [Set.mem_preimage, periodBox, Set.mem_prod] constructor · intro h constructor · simpa [e] using h 0 (Set.mem_univ _) · intro i hi simpa [e] using h i.succ (Set.mem_univ _) · rintro ⟨h0, hs⟩ i intro _ refine Fin.cases ?_ (fun j => ?_) i · simpa [e] using h0 · simpa [e] using hs j (Set.mem_univ _) rw [← hem.setIntegral_preimage_emb e.measurableEmbedding, he, Measure.volume_eq_prod, setIntegral_prod] · rfl · have hm : Measurable (fun z : ℝ × (Fin m → ℝ) => G (Fin.insertNth 0 z.1 z.2)) := hG.comp (by fun_prop) have hc : IsCompact (Icc (-pi) pi ×ˢ periodBox (ι := Fin m)) := isCompact_Icc.prod (isCompact_univ_pi (fun _ => isCompact_Icc)) apply Measure.integrableOn_of_bounded (hc.measure_lt_top.ne) hm.aestronglyMeasurable filter_upwards with z simpa [Real.norm_eq_abs] using hGb (Fin.insertNth 0 z.1 z.2) induction n with | zero => congr 1 funext u congr 1 funext i exact elim0 i | succ m ih => have hsub : Measurable (fun u : Fin (m + 1) → ℝ => x - u) := by fun_prop rw [hsplit (fun u => F (x - u)) (hF.comp hsub) (fun y => hB _)] have hxsub (t : ℝ) (v : Fin m → ℝ) : x - Fin.insertNth 0 t v = Fin.insertNth 0 (x 0 - t) ((x ∘ succ) - v) := by funext i refine Fin.cases ?_ (fun j => ?_) i · simp · simp simp_rw [hxsub] have hinner (t : ℝ) : (∫ v in periodBox, F (Fin.insertNth 0 (x 0 - t) ((x ∘ succ) - v))) = ∫ v in periodBox, F (Fin.insertNth 0 (x 0 - t) v) := by let G : (Fin m → ℝ) → ℝ := fun v => F (Fin.insertNth 0 (x 0 - t) v) apply ih G · exact hF.comp (by fun_prop) · intro y exact hB _ · intro i y have hp := hper i.succ (Fin.insertNth 0 (x 0 - t) y) intro s change G (update y i (s + 2 * pi)) = G (update y i s) dsimp [G] have hu (r : ℝ) : Fin.insertNth 0 (x 0 - t) (update y i r) = (update (Fin.insertNth 0 (x 0 - t) y) i.succ r : Fin (m + 1) → ℝ) := by funext j refine Fin.cases ?_ (fun k => ?_) j · have hne : (0 : Fin (m + 1)) ≠ i.succ := ne_of_lt (Fin.succ_pos i) simp [update, hne] · by_cases hki : k = i · subst k simp · simp [hki] rw [hu, hu] exact hp s simp_rw [hinner] let A : ℝ → ℝ := fun s => ∫ v in periodBox, F (Fin.insertNth 0 s v) have hAp : Periodic A (2 * pi) := by intro s apply integral_congr_ae filter_upwards intro v have hp := hper 0 (Fin.insertNth 0 s v) s simpa using hp rw [show (fun t => ∫ v in periodBox, F (Fin.insertNth 0 (x 0 - t) v)) = fun t => A (x 0 - t) by rfl] rw [show (∫ t in Icc (-pi) pi, A (x 0 - t)) = ∫ t in (-pi)..pi, A (x 0 - t) by rw [intervalIntegral.integral_of_le (neg_le_self Real.pi_pos.le), ← integral_Icc_eq_integral_Ioc]] rw [intervalIntegral.integral_comp_sub_left] have hshift := hAp.intervalIntegral_add_eq (x 0 - pi) (-pi) have heq : (∫ t in (x 0 - pi)..(x 0 - -pi), A t) = ∫ t in (-pi)..pi, A t := by convert hshift using 1 <;> ring rw [heq] rw [intervalIntegral.integral_of_le (neg_le_self Real.pi_pos.le), ← integral_Icc_eq_integral_Ioc] rw [hsplit F hF hB]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.periodBox_integral_sub_eq_fin · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensor.lean:98
  • periodBox_integral_sub_eq theorem — A function on finitely many phase coordinates, its measurability, a uniform bound, the bound on every vector, coordinatewise periodicity, and a translation vector imply that reflection and translation leave the period-box integral unchanged.
    ι :
    Type u_1
    shared
    F :
    (ι → ℝ) → ℝ
    hF :
    B :
    ℝ
    hB :
    ∀ y, |F y| ≤ B
    hper :
    ∀ i y, Periodic (fun t => F (update y i t)) (2 * pi)
    x :
    ι → ℝ
    (∫ u in periodBox, F (x - u)) = ∫ u in periodBox, F u
    Proof (Lean source)
    theorem periodBox_integral_sub_eq (F : (ι → ℝ) → ℝ) (hF : Measurable F) (B : ℝ) (hB : ∀ y, |F y| ≤ B) (hper : ∀ i y, Periodic (fun t => F (update y i t)) (2 * pi)) (x : ι → ℝ) : (∫ u in periodBox, F (x - u)) = ∫ u in periodBox, F u := by classical let e : Fin (card ι) ≃ ι := (Fintype.equivFin ι).symm let p : (Fin (card ι) → ℝ) ≃ᵐ (ι → ℝ) := MeasurableEquiv.piCongrLeft (fun _ : ι => ℝ) e have hp (u : Fin (card ι) → ℝ) (i : Fin (card ι)) : p u (e i) = u i := by simp [p, MeasurableEquiv.coe_piCongrLeft] have hbox : p ⁻¹' periodBox = periodBox := by ext u constructor · intro hu i _ exact hp u i ▸ hu (e i) (Set.mem_univ _) · intro hu i _ obtain ⟨j, rfl⟩ := e.surjective i rw [hp] exact hu j (Set.mem_univ _) have hmp : MeasurePreserving p := volume_measurePreserving_piCongrLeft (fun _ : ι => ℝ) e have htrans (H : (ι → ℝ) → ℝ) : (∫ u in periodBox, H u) = ∫ v in periodBox, H (p v) := by rw [← hmp.setIntegral_preimage_emb p.measurableEmbedding, hbox] let G : (Fin (card ι) → ℝ) → ℝ := fun u => F (p u) have hG : Measurable G := hF.comp p.measurable have hGb : ∀ y, |G y| ≤ B := fun y => hB (p y) have hupdate (y : Fin (card ι) → ℝ) (i : Fin (card ι)) (t : ℝ) : p (update y i t) = update (p y) (e i) t := by funext j obtain ⟨k, rfl⟩ := e.surjective j simp [hp, update, e.injective.eq_iff] have hGp : ∀ i y, Periodic (fun t => G (update y i t)) (2 * pi) := by intro i y t change F (p (update y i (t + 2 * pi))) = F (p (update y i t)) rw [hupdate, hupdate] exact hper (e i) (p y) t let x' : Fin (card ι) → ℝ := p.symm x have hsub (u : Fin (card ι) → ℝ) : p (x' - u) = x - p u := by funext i obtain ⟨j, rfl⟩ := e.surjective i rw [hp] change x' j - u j = x (e j) - p u (e j) rw [hp] congr 1 rw [htrans (fun u => F (x - u)), htrans F] change (∫ u in periodBox, F (x - p u)) = ∫ u in periodBox, G u simp_rw [← hsub] exact periodBox_integral_sub_eq_fin (card ι) G hG B hGb hGp x'
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.periodBox_integral_sub_eq · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensor.lean:218
Pairing­Rearrangement 6 core · 3 supporting This module proves the finite adjacent-pair rearrangement inequality, defines the Chebyshev chord list, and identifies its paired product with the complex root-distance product. ★ adjacentPairProduct_le_of_perm_sorted

Pairing rearrangements and Chebyshev chord products

This module proves the finite adjacent-pair rearrangement inequality, defines the Chebyshev chord list, and identifies its paired product with the complex root-distance product.

def adjacentPairProduct reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

The consecutive-pair product of a list of real numbers with an additive constant t multiplies, over successive pairs of entries a and b of the list, the quantity a b + t; a final unpaired entry contributes no factor, and the empty list gives one.

Definition (Lean source)
t :
ℝ
adjacentPairProduct t :
List ℝ → ℝ
clause 1
| a :: b :: xs => (a * b + t) * adjacentPairProduct t xs
clause 2
| _ => 1
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.adjacentPairProduct · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PairingRearrangement.lean:28
theorem adjacentPairProduct_le_of_perm_sorted reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

For a nonnegative constant t and a list of real numbers that has even length, is sorted in decreasing order, and has only nonnegative entries, every rearrangement of the list has consecutive-pair product at most that of the sorted list itself; the consecutive-pair product multiplies, over successive pairs of entries, the product of the pair plus t.

Formal statement
t :
ℝ
ht :
0 ≤ t
xs ys :
List ℝ
heven :
Even xs.length
hsorted :
xs.Pairwise (fun a b => b ≤ a)
hnonneg :
∀ a ∈ xs, 0 ≤ a
hperm :
ys.Perm xs
Proof (Lean source)
theorem adjacentPairProduct_le_of_perm_sorted {t : ℝ} (ht : 0 ≤ t) {xs ys : List ℝ} (heven : Even xs.length) (hsorted : xs.Pairwise (fun a b => b ≤ a)) (hnonneg : ∀ a ∈ xs, 0 ≤ a) (hperm : ys.Perm xs) : adjacentPairProduct t ys ≤ adjacentPairProduct t xs := by -- Duffin--Schaeffer (1941), Lemma II. Induct on the number of pairs. -- In a nonempty permuted pairing, locate the two largest entries of `xs`. -- If they are not paired together, their partners and the four-term lemmas -- above give an exchange that does not decrease the product. Remove the -- resulting largest adjacent pair and apply the induction hypothesis to the -- remaining sorted tail. Nonnegativity makes multiplication monotone. have heven_ys : Even ys.length := hperm.length_eq ▸ heven rw [← pairedProduct_listPairs t ys] apply pairedProduct_le_of_perm_sorted ht heven hsorted hnonneg rw [pairedEntries_listPairs_of_even heven_ys] exact hperm
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.adjacentPairProduct_le_of_perm_sorted · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PairingRearrangement.lean:244 · uses adjacentPairProduct
def chebyshevRootAngle reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

A degree and index determine the corresponding Chebyshev root angle, equal to the odd multiple (2k+1)π/(2L).

Definition (Lean source)
L k :
ℕ
chebyshevRootAngle L k :
ℝ
(((2 * k + 1 : ℕ) : ℝ) * pi) / (2 * (L : ℝ))
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.chebyshevRootAngle · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PairingRearrangement.lean:269
def chebyshevZero reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

The k-th Chebyshev cosine root for degree L and index k is the cosine of the angle (2k + 1) π / (2L); for k from 0 to L − 1 these are the roots of the degree-L Chebyshev polynomial of the first kind.

Definition (Lean source)
L k :
ℕ
chebyshevZero L k :
ℝ
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.chebyshevZero · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PairingRearrangement.lean:274
def cosineChordSq reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

The squared chord length at an angle θ is two minus twice the cosine of θ, the squared distance from the point 1 to the point of the unit circle with argument θ.

Definition (Lean source)
θ :
ℝ
cosineChordSq θ :
ℝ
2 - 2 * cos θ
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.cosineChordSq · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PairingRearrangement.lean:280
def chebyshevPairedChordList reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

For a degree L and an angle θ, this is the list of 2L squared chord lengths obtained by listing, for each of the L Chebyshev root angles in turn, the squared chord length at θ plus that root angle followed by the squared chord length at θ minus it.

Definition (Lean source)
L :
ℕ
θ :
ℝ
chebyshevPairedChordList L θ :
List ℝ
(range L).val.toList.flatMap fun k
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.chebyshevPairedChordList · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PairingRearrangement.lean:286
3 supporting declarations (lemmas, instances)
  • crossingPairProduct_le_adjacentPairProduct lemma — For four real numbers a, b, c, d that are decreasing, b at most a, c at most b, and d at most c, and a nonnegative constant t, the product (a c + t)(b d + t) from the crossing pairs is at most the product (a b + t)(c d + t) from the adjacent pairs.
    a b c d t :
    ℝ
    ht :
    0 ≤ t
    hab :
    b ≤ a
    hbc :
    c ≤ b
    hcd :
    d ≤ c
    (a * c + t) * (b * d + t) ≤ (a * b + t) * (c * d + t)
    Proof (Lean source)
    lemma crossingPairProduct_le_adjacentPairProduct {a b c d t : ℝ} (ht : 0 ≤ t) (hab : b ≤ a) (hbc : c ≤ b) (hcd : d ≤ c) : (a * c + t) * (b * d + t) ≤ (a * b + t) * (c * d + t) := by have had : d ≤ a := hcd.trans (hbc.trans hab) have hnonneg : 0 ≤ t * (a - d) * (b - c) := mul_nonneg (mul_nonneg ht (sub_nonneg.mpr had)) (sub_nonneg.mpr hbc) calc (a * c + t) * (b * d + t) ≤ (a * c + t) * (b * d + t) + t * (a - d) * (b - c) := le_add_of_nonneg_right hnonneg _ = (a * b + t) * (c * d + t) := by ring
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.crossingPairProduct_le_adjacentPairProduct · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PairingRearrangement.lean:35
  • nestedPairProduct_le_adjacentPairProduct lemma — For four real numbers a, b, c, d that are decreasing, b at most a, c at most b, and d at most c, and a nonnegative constant t, the product (a d + t)(b c + t) from the outer and inner pairs is at most the product (a b + t)(c d + t) from the adjacent pairs.
    a b c d t :
    ℝ
    ht :
    0 ≤ t
    hab :
    b ≤ a
    hbc :
    c ≤ b
    hcd :
    d ≤ c
    (a * d + t) * (b * c + t) ≤ (a * b + t) * (c * d + t)
    Proof (Lean source)
    lemma nestedPairProduct_le_adjacentPairProduct {a b c d t : ℝ} (ht : 0 ≤ t) (hab : b ≤ a) (hbc : c ≤ b) (hcd : d ≤ c) : (a * d + t) * (b * c + t) ≤ (a * b + t) * (c * d + t) := by have hac : c ≤ a := hbc.trans hab have hbd : d ≤ b := hcd.trans hbc have hnonneg : 0 ≤ t * (a - c) * (b - d) := mul_nonneg (mul_nonneg ht (sub_nonneg.mpr hac)) (sub_nonneg.mpr hbd) calc (a * d + t) * (b * c + t) ≤ (a * d + t) * (b * c + t) + t * (a - c) * (b - d) := le_add_of_nonneg_right hnonneg _ = (a * b + t) * (c * d + t) := by ring
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.nestedPairProduct_le_adjacentPairProduct · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PairingRearrangement.lean:52
  • adjacentPairProduct_chebyshevPairedChordList theorem — For a degree L, an angle θ, and a height y, the consecutive-pair product of the paired chord list with additive constant 4y² equals the product, over the L Chebyshev cosine roots, of four times the squared distance from the complex point cos θ + i y to that root.
    L :
    ℕ
    θ y :
    ℝ
    = ∏ k ∈ range L, 4 * ‖((cos θ - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖ ^ 2
    Proof (Lean source)
    theorem adjacentPairProduct_chebyshevPairedChordList (L : ℕ) (θ y : ℝ) : adjacentPairProduct (4 * y ^ 2) (chebyshevPairedChordList L θ) = ∏ k ∈ range L, 4 * ‖((Real.cos θ - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖ ^ 2 := by have pair_identity (α : ℝ) : (2 - 2 * Real.cos (θ + α)) * (2 - 2 * Real.cos (θ - α)) + 4 * y ^ 2 = 4 * ‖((Real.cos θ - Real.cos α : ℝ) : ℂ) + (y : ℂ) * Complex.I‖ ^ 2 := by rw [Complex.sq_norm, Complex.normSq_add_mul_I] rw [Real.cos_add, Real.cos_sub] nlinarith [Real.sin_sq_add_cos_sq θ, Real.sin_sq_add_cos_sq α] rw [chebyshevPairedChordList, adjacentPairProduct_flatMap_pairs] rw [Multiset.prod_map_toList] apply Finset.prod_congr rfl intro k hk rw [cosineChordSq, chebyshevZero] exact pair_identity (chebyshevRootAngle L k)
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.adjacentPairProduct_chebyshevPairedChordList · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PairingRearrangement.lean:305
Parametric­Tensor 4 core · 4 supporting Bounded coordinatewise-degree real multivariate polynomials are represented in one fixed finite monomial basis. ★ continuous_tensorCoeffs_of_grid

Fixed-basis tensor-polynomial coefficients

Bounded coordinatewise-degree real multivariate polynomials are represented in one fixed finite monomial basis. Evaluation at a fixed tensor grid determines every coefficient, so a pointwise polynomial family has continuous coefficients when its grid values are continuous. This applies to a Jackson family even if each representative was initially chosen separately.

def tensorExponent reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A tensor index, assigning each of the d coordinates a degree between 0 and D, determines its monomial exponent: the exponent vector whose entry in each coordinate is the index's value there.

Definition (Lean source)
d D :
ℕ
a :
Fin d → Fin (D + 1)
tensorExponent a :
Fin d →₀ ℕ
Finsupp.equivFunOnFinite.symm (fun i => (a i : ℕ))
Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorExponent · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricTensor.lean:25
def tensorCoeffs reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A multivariate polynomial and tensor index determine the associated fixed-basis coefficient: the coefficient, in the polynomial, of the monomial whose exponent in each coordinate is the index's value there.

Definition (Lean source)
d D :
ℕ
p :
a :
Fin d → Fin (D + 1)
tensorCoeffs p a :
ℝ
p.coeff (tensorExponent a)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorCoeffs · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricTensor.lean:33
def tensorPolynomial reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A finite tensor coefficient vector determines the multivariate polynomial synthesized in the fixed monomial basis: the sum, over all tensor indices with coordinatewise degrees at most D, of the vector's entry times the monomial with those exponents.

Definition (Lean source)
d D :
ℕ
c :
(Fin d → Fin (D + 1)) → ℝ
tensorPolynomial c :
∑ a, monomial (tensorExponent a) (c a)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorPolynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricTensor.lean:40
theorem continuous_tensorCoeffs_of_grid reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A parameter-indexed polynomial family whose members all have degree at most D in each variable, and whose value at every point of the integer tensor grid with coordinates in 0, …, D is continuous in the parameter, has, for each coefficient index, a monomial coefficient that varies continuously with the parameter.

Formal statement
Λ :
d D :
ℕ
p :
Λ → MvPolynomial (Fin d) ℝ
hdeg :
∀ s i, (p s).degreeOf i ≤ D
hgrid :
∀ a : Fin d → Fin (D + 1),
Continuous (fun s => eval (fun i => (a i : ℝ)) (p s))
a :
Fin d → Fin (D + 1)
Continuous (fun s => tensorCoeffs (D := D) (p s) a)
Proof (Lean source)
theorem continuous_tensorCoeffs_of_grid {Λ : Type*} [TopologicalSpace Λ] {d D : ℕ} (p : Λ → MvPolynomial (Fin d) ℝ) (hdeg : ∀ s i, (p s).degreeOf i ≤ D) (hgrid : ∀ a : Fin d → Fin (D + 1), Continuous (fun s => eval (fun i => (a i : ℝ)) (p s))) (a : Fin d → Fin (D + 1)) : Continuous (fun s => tensorCoeffs (D := D) (p s) a) := by classical let V := (Fin d → Fin (D + 1)) → ℝ let E : V →ₗ[ℝ] V := { toFun := fun c b => ∑ a : Fin d → Fin (D + 1), c a * eval (fun i => (b i : ℝ)) (monomial (tensorExponent a) (1 : ℝ)) map_add' := by intro c c' funext b change (∑ a, (c a + c' a) * _) = (∑ a, c a * _) + ∑ a, c' a * _ simp [add_mul, Finset.sum_add_distrib] map_smul' := by intro r c funext b change (∑ a, (r * c a) * _) = r * ∑ a, c a * _ simp [mul_assoc, Finset.mul_sum] } have hEval (c : V) (b : Fin d → Fin (D + 1)) : E c b = eval (fun i => (b i : ℝ)) (tensorPolynomial c) := by change (∑ a, c a * eval (fun i => (b i : ℝ)) (monomial (tensorExponent a) (1 : ℝ))) = _ simp [tensorPolynomial, MvPolynomial.eval_monomial] have hcont : Continuous (fun s => E (tensorCoeffs (D := D) (p s))) := by apply continuous_pi intro b convert hgrid b using 1 ext s rw [hEval, tensorPolynomial_tensorCoeffs (p s) (hdeg s)] have hinj : Injective E := by intro c c' h have hgrid' (b : Fin d → Fin (D + 1)) : eval (fun i => (b i : ℝ)) (tensorPolynomial c) = eval (fun i => (b i : ℝ)) (tensorPolynomial c') := by have hb := congrArg (fun v : V => v b) h simpa only [hEval] using hb have heq := tensorPolynomial_eq_of_grid (tensorPolynomial c) (tensorPolynomial c') (tensorPolynomial_degreeOf_le c) (tensorPolynomial_degreeOf_le c') hgrid' funext b calc c b = tensorCoeffs (tensorPolynomial c) b := (tensorCoeffs_tensorPolynomial c b).symm _ = tensorCoeffs (tensorPolynomial c') b := by rw [heq] _ = c' b := tensorCoeffs_tensorPolynomial c' b let e := LinearEquiv.ofBijective E ⟨hinj, LinearMap.surjective_of_injective hinj⟩ have he : Continuous (e.symm : V → V) := e.symm.continuous_of_finiteDimensional have hcomp := he.comp hcont convert (continuous_apply a).comp hcomp using 1 ext s change tensorCoeffs (p s) a = (e.symm (e (tensorCoeffs (p s)))) a simp
Causalean.Mathlib.Analysis.Approximation.Chebyshev.continuous_tensorCoeffs_of_grid · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricTensor.lean:170 · uses tensorCoeffs
4 supporting declarations (lemmas, instances)
  • tensorPolynomial_tensorCoeffs theorem — A polynomial of coordinatewise degree at most D equals the synthesis of its fixed-basis coefficient vector. The support bound should be converted using degreeOf_le_iff, then as_sum.
    d D :
    ℕ
    p :
    hdeg :
    ∀ i, p.degreeOf i ≤ D
    Proof (Lean source)
    theorem tensorPolynomial_tensorCoeffs {d D : ℕ} (p : MvPolynomial (Fin d) ℝ) (hdeg : ∀ i, p.degreeOf i ≤ D) : tensorPolynomial (tensorCoeffs (D := D) p) = p := by classical have hinj : Injective (tensorExponent (d := d) (D := D)) := by intro a b h funext i apply Fin.ext have hi := congrArg (fun m : Fin d →₀ ℕ => m i) h simpa [tensorExponent] using hi apply MvPolynomial.ext intro m by_cases hb : ∀ i, m i ≤ D · let a : Fin d → Fin (D + 1) := fun i => ⟨m i, Nat.lt_succ_of_le (hb i)⟩ have ha : tensorExponent a = m := by apply Finsupp.ext intro i simp [a, tensorExponent] simp only [tensorPolynomial, tensorCoeffs, MvPolynomial.coeff_sum, MvPolynomial.coeff_monomial] rw [Finset.sum_eq_single a] · simp [ha] · intro b _ hba have hne : tensorExponent b ≠ m := fun h => hba (hinj (h.trans ha.symm)) simp [hne] · intro h exact (h (Finset.mem_univ a)).elim · have hm : m ∉ p.support := by intro hmem apply hb intro i exact (MvPolynomial.degreeOf_le_iff.mp (hdeg i)) m hmem have hc : p.coeff m = 0 := MvPolynomial.notMem_support_iff.mp hm simp only [tensorPolynomial, tensorCoeffs, MvPolynomial.coeff_sum, MvPolynomial.coeff_monomial] rw [Finset.sum_eq_zero] · exact hc.symm · intro a _ have hne : tensorExponent a ≠ m := by intro h apply hb intro i have hi := congrArg (fun n : Fin d →₀ ℕ => n i) h have hi' : (a i : ℕ) = m i := by simpa [tensorExponent] using hi exact hi' ▸ Nat.lt_succ_iff.mp (a i).isLt simp [hne]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorPolynomial_tensorCoeffs · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricTensor.lean:48
  • tensorPolynomial_eq_of_grid theorem — Evaluation on the integer tensor grid determines a polynomial of coordinatewise degree at most D. Prove this by induction on the number of coordinates using univariate root bounds.
    d D :
    ℕ
    p q :
    hp :
    ∀ i, p.degreeOf i ≤ D
    hq :
    ∀ i, q.degreeOf i ≤ D
    hgrid :
    ∀ a : Fin d → Fin (D + 1),
    eval (fun i => (a i : ℝ)) p = eval (fun i => (a i : ℝ)) q
    p = q
    Proof (Lean source)
    theorem tensorPolynomial_eq_of_grid {d D : ℕ} (p q : MvPolynomial (Fin d) ℝ) (hp : ∀ i, p.degreeOf i ≤ D) (hq : ∀ i, q.degreeOf i ≤ D) (hgrid : ∀ a : Fin d → Fin (D + 1), eval (fun i => (a i : ℝ)) p = eval (fun i => (a i : ℝ)) q) : p = q := by classical let S : Fin d → Finset ℝ := fun _ => Finset.univ.image (fun j : Fin (D + 1) => (j : ℝ)) have hcard (i : Fin d) : (S i).card = D + 1 := by dsimp [S] rw [Finset.card_image_of_injective] · simp · intro a b h change (a : ℝ) = (b : ℝ) at h apply Fin.ext exact_mod_cast h have hdeg' (i : Fin d) : (p - q).degreeOf i < (S i).card := by rw [hcard i] exact lt_of_le_of_lt (MvPolynomial.degreeOf_sub_le i p q) (Nat.lt_succ_of_le (max_le (hp i) (hq i))) have hzero : p - q = 0 := MvPolynomial.eq_zero_of_eval_zero_at_prod_finset (p - q) S hdeg' (by intro x hx have hchoice : ∀ i : Fin d, ∃ a : Fin (D + 1), (a : ℝ) = x i := by intro i obtain ⟨a, _, ha⟩ := Finset.mem_image.mp (hx i) exact ⟨a, ha⟩ choose a ha using hchoice have he := hgrid a have hxa : (fun i => (a i : ℝ)) = x := funext ha simpa [MvPolynomial.eval_sub, hxa] using sub_eq_zero.mpr he) exact sub_eq_zero.mp hzero
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorPolynomial_eq_of_grid · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricTensor.lean:98
  • measurable_tensorCoeffs_of_grid theorem — The recovered coefficient of a degree-bounded polynomial family is measurable when its fixed-grid evaluations are continuous.
    d D :
    ℕ
    p :
    Λ → MvPolynomial (Fin d) ℝ
    hdeg :
    ∀ s i, (p s).degreeOf i ≤ D
    hgrid :
    ∀ a : Fin d → Fin (D + 1),
    Continuous (fun s => eval (fun i => (a i : ℝ)) (p s))
    a :
    Fin d → Fin (D + 1)
    Measurable (fun s => tensorCoeffs (D := D) (p s) a)
    Proof (Lean source)
    theorem measurable_tensorCoeffs_of_grid {Λ : Type*} [TopologicalSpace Λ] [MeasurableSpace Λ] [BorelSpace Λ] {d D : ℕ} (p : Λ → MvPolynomial (Fin d) ℝ) (hdeg : ∀ s i, (p s).degreeOf i ≤ D) (hgrid : ∀ a : Fin d → Fin (D + 1), Continuous (fun s => eval (fun i => (a i : ℝ)) (p s))) (a : Fin d → Fin (D + 1)) : Measurable (fun s => tensorCoeffs (D := D) (p s) a) := by exact (continuous_tensorCoeffs_of_grid p hdeg hgrid a).measurable
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.measurable_tensorCoeffs_of_grid · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricTensor.lean:234
  • tensorCoeffs_l1_le_cube_bound theorem — A polynomial bounded by B on the normalized tensor cube has a coefficient one-norm bounded exponentially in its coordinatewise degree. This is the deterministic envelope used for the Jackson coefficient path; the estimate is valid for every polynomial representative.
    d D :
    ℕ
    p :
    B :
    ℝ
    hB :
    0 ≤ B
    hdeg :
    ∀ i, p.degreeOf i ≤ D
    hbound :
    ∀ x ∈ normalizedCube d, |eval x p| ≤ B
    mvCoeffL1 p ≤ ((2 : ℝ) * (D + 1) ^ 2 * (3 : ℝ) ^ D) ^ d * B
    Proof (Lean source)
    theorem tensorCoeffs_l1_le_cube_bound {d D : ℕ} (p : MvPolynomial (Fin d) ℝ) (B : ℝ) (hB : 0 ≤ B) (hdeg : ∀ i, p.degreeOf i ≤ D) (hbound : ∀ x ∈ normalizedCube d, |eval x p| ≤ B) : mvCoeffL1 p ≤ ((2 : ℝ) * (D + 1) ^ 2 * (3 : ℝ) ^ D) ^ d * B := by exact mvCoeffL1_le_bounded p B hB (fun m hm i => (MvPolynomial.degreeOf_le_iff.mp (hdeg i)) m hm) hbound
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorCoeffs_l1_le_cube_bound · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricTensor.lean:246
Polynomial­One­Norm 4 core · 4 supporting The finite sum of absolute monomial coefficients is submultiplicative. ★ polynomialCoeffOneNorm_mul_le★ shiftedCheb_coeffL1_le

Coefficient one-norm of real polynomials

The finite sum of absolute monomial coefficients is submultiplicative. This gives the quantitative algebraic input for equispaced Lagrange basis bounds.

abbrev polynomialCoeffOneNorm reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A real polynomial determines its coefficient one-norm, the sum of the absolute values of all its monomial coefficients.

Definition (Lean source)
p :
polynomialCoeffOneNorm p :
ℝ
Causalean.Mathlib.Analysis.Approximation.Chebyshev.polynomialCoeffOneNorm · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PolynomialOneNorm.lean:22
theorem polynomialCoeffOneNorm_mul_le reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

Two real polynomials have a coefficient one-norm for their product no larger than the product of their coefficient one-norms.

Formal statement
p q :
Proof (Lean source)
theorem polynomialCoeffOneNorm_mul_le (p q : Polynomial ℝ) : polynomialCoeffOneNorm (p * q) ≤ polynomialCoeffOneNorm p * polynomialCoeffOneNorm q := by classical have hadd (r s : Polynomial ℝ) : polynomialCoeffOneNorm (r + s) ≤ polynomialCoeffOneNorm r + polynomialCoeffOneNorm s := by let m := max r.natDegree s.natDegree + 1 have hrange (t : Polynomial ℝ) (ht : t.natDegree < m) : polynomialCoeffOneNorm t = ∑ k ∈ range m, |t.coeff k| := by change t.sum (fun _ c => |c|) = _ exact t.sum_over_range' (fun _ => abs_zero) m ht rw [hrange (r + s) (lt_of_le_of_lt (natDegree_add_le _ _) (lt_succ_self _)), hrange r (lt_of_le_of_lt (le_max_left _ _) (lt_succ_self _)), hrange s (lt_of_le_of_lt (le_max_right _ _) (lt_succ_self _)), ← Finset.sum_add_distrib] exact Finset.sum_le_sum fun i _ => by simpa only [coeff_add] using abs_add_le (r.coeff i) (s.coeff i) have hzero : polynomialCoeffOneNorm (0 : Polynomial ℝ) = 0 := by simp [polynomialCoeffOneNorm, polyCoeffL1] have hsum (s : Finset ℕ) (f : ℕ → Polynomial ℝ) : polynomialCoeffOneNorm (∑ i ∈ s, f i) ≤ ∑ i ∈ s, polynomialCoeffOneNorm (f i) := by induction s using Finset.induction_on with | empty => simp [hzero] | @insert i s hi ih => simp only [Finset.sum_insert hi] exact (hadd _ _).trans (add_le_add_right ih _) have hmono (n : ℕ) (a : ℝ) : polynomialCoeffOneNorm (monomial n a) = |a| := by by_cases ha : a = 0 · simp [ha, polynomialCoeffOneNorm, polyCoeffL1] · simp [polynomialCoeffOneNorm, polyCoeffL1, support_monomial n ha] rw [Polynomial.mul_eq_sum_sum] calc polynomialCoeffOneNorm (∑ i ∈ p.support, q.sum fun j a ↦ monomial (i + j) (p.coeff i * a)) ≤ ∑ i ∈ p.support, polynomialCoeffOneNorm (q.sum fun j a ↦ monomial (i + j) (p.coeff i * a)) := by exact hsum p.support (fun i ↦ q.sum fun j a ↦ monomial (i + j) (p.coeff i * a)) _ ≤ ∑ i ∈ p.support, ∑ j ∈ q.support, polynomialCoeffOneNorm (monomial (i + j) (p.coeff i * q.coeff j)) := by apply Finset.sum_le_sum intro i hi simpa only [Polynomial.sum] using (hsum q.support (fun j ↦ monomial (i + j) (p.coeff i * q.coeff j))) _ = polynomialCoeffOneNorm p * polynomialCoeffOneNorm q := by simp only [hmono, abs_mul] change (∑ i ∈ p.support, ∑ j ∈ q.support, |p.coeff i| * |q.coeff j|) = (∑ i ∈ p.support, |p.coeff i|) * (∑ j ∈ q.support, |q.coeff j|) rw [Finset.sum_mul] simp only [Finset.mul_sum]
Causalean.Mathlib.Analysis.Approximation.Chebyshev.polynomialCoeffOneNorm_mul_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PolynomialOneNorm.lean:30 · uses polynomialCoeffOneNorm
def shiftedCheb reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

For a natural degree r, the shifted first-kind Chebyshev polynomial is the degree-r Chebyshev polynomial of the first kind composed with the affine map x ↦ 1 − 2x, which carries the unit interval onto the interval from −1 to 1 with reversed orientation.

Definition (Lean source)
r :
ℕ
shiftedCheb r :
ℝ[X]
(T ℝ (r : ℤ)).comp (1 - C (2 : ℝ) * X)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.shiftedCheb · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PolynomialOneNorm.lean:116
lemma shiftedCheb_coeffL1_le reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

For a natural degree r, the coefficient one-norm of the shifted first-kind Chebyshev polynomial of degree r is at most 7 to the power r.

Formal statement
r :
ℕ
polynomialCoeffOneNorm (shiftedCheb r) ≤ (7 : ℝ) ^ r
Proof (Lean source)
lemma shiftedCheb_coeffL1_le (r : ℕ) : polynomialCoeffOneNorm (shiftedCheb r) ≤ (7 : ℝ) ^ r := by induction r using Nat.twoStepInduction with | zero => rw [polynomialCoeffOneNorm_range _ (m := 1) (by simp [shiftedCheb])] norm_num [shiftedCheb] | one => rw [polynomialCoeffOneNorm_range _ (m := 2) (by simpa [shiftedCheb] using (lt_of_le_of_lt shiftFactor_natDegree_le (by norm_num : 1 < 2)))] norm_num [shiftedCheb, Finset.sum_range_succ, coeff_sub, coeff_one, coeff_C_mul, coeff_X] | more r hr hr1 => rw [shiftedCheb_recurrence] calc polynomialCoeffOneNorm (2 * (1 - C (2 : ℝ) * X) * shiftedCheb (r + 1) - shiftedCheb r) ≤ polynomialCoeffOneNorm (2 * (1 - C (2 : ℝ) * X) * shiftedCheb (r + 1)) + polynomialCoeffOneNorm (shiftedCheb r) := polynomialCoeffOneNorm_sub_le _ _ _ ≤ polynomialCoeffOneNorm (2 * (1 - C (2 : ℝ) * X) : ℝ[X]) * polynomialCoeffOneNorm (shiftedCheb (r + 1)) + polynomialCoeffOneNorm (shiftedCheb r) := by gcongr exact polynomialCoeffOneNorm_mul_le _ _ _ = 6 * polynomialCoeffOneNorm (shiftedCheb (r + 1)) + polynomialCoeffOneNorm (shiftedCheb r) := by rw [polynomialCoeffOneNorm_two_shift_factor] _ ≤ 6 * (7 : ℝ) ^ (r + 1) + (7 : ℝ) ^ r := by gcongr _ ≤ (7 : ℝ) ^ (r + 2) := by have hp : 0 ≤ (7 : ℝ) ^ r := pow_nonneg (by norm_num) _ calc 6 * (7 : ℝ) ^ (r + 1) + 7 ^ r = 43 * 7 ^ r := by rw [pow_succ] ring _ ≤ 49 * 7 ^ r := mul_le_mul_of_nonneg_right (by norm_num) hp _ = (7 : ℝ) ^ (r + 2) := by rw [pow_add] norm_num ring
Causalean.Mathlib.Analysis.Approximation.Chebyshev.shiftedCheb_coeffL1_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/PolynomialOneNorm.lean:176 · uses polynomialCoeffOneNorm , shiftedCheb
4 supporting declarations (lemmas, instances)
Affine­Four 4 core · 7 supporting This module transports tensor Jackson approximation between the normalized cube and a rectangle with positive radii (the raw normalization and rectangle definitions accept any radii; the transport theorems assume positiv ★ affineJackson_approx_four

Affine Jackson approximation on four-dimensional rectangles

This module transports tensor Jackson approximation between the normalized cube and a rectangle with positive radii (the raw normalization and rectangle definitions accept any radii; the transport theorems assume positivity), preserving evaluation, degree, approximation, and coefficient bounds.

def affinePoint reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

A finite dimension, a rectangle center, coordinate radii, and normalized coordinates determine the corresponding point under the center-plus-radius affine map.

Definition (Lean source)
d :
ℕ
c r z :
Fin d → ℝ
affinePoint c r z :
Fin d → ℝ
fun i => c i + r i * z i
Causalean.Mathlib.Analysis.JacksonApproximation.affinePoint · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFour.lean:18
def normalizedPoint reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

A finite dimension, a rectangle center, coordinate radii, and a point in the rectangle's ambient space determine its normalized coordinates by subtracting the center and dividing coordinatewise by the radii. This is a normalization for positive radii, as assumed by the approximation results; a zero radius gives coordinate zero by the division convention.

Definition (Lean source)
d :
ℕ
c r y :
Fin d → ℝ
normalizedPoint c r y :
Fin d → ℝ
fun i => (y i - c i) / r i
Causalean.Mathlib.Analysis.JacksonApproximation.normalizedPoint · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFour.lean:25
def centeredRectangle reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

A finite dimension, a center, and coordinate radii determine the closed centered rectangle consisting of points whose coordinatewise distance from the center does not exceed the corresponding radius. No sign condition is imposed on the radii; a negative radius makes the set empty, and the approximation results assume positive radii.

Definition (Lean source)
d :
ℕ
c r :
Fin d → ℝ
centeredRectangle c r :
Set (Fin d → ℝ)
{y | ∀ i, |y i - c i| ≤ r i}
Causalean.Mathlib.Analysis.JacksonApproximation.centeredRectangle · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFour.lean:34
theorem affineJackson_approx_four reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

For integer order K that is strictly positive, a rectangle center, positive coordinate radii, a function, a nonnegative Lipschitz constant L, continuity on the centered rectangle, and the bound that the function changes between any two points of the rectangle by at most L times the sum of their coordinate differences divided by the radii, there is a four-variable polynomial of degree at most 2 (K − 1) in each variable and total degree at most 8 (K − 1) that approximates the function throughout the rectangle within one hundred twenty-eight times the Lipschitz constant divided by K.

Formal statement
K :
ℕ
hK :
0 < K
c r :
Fin 4 → ℝ
hr :
∀ i, 0 < r i
f :
(Fin 4 → ℝ) → ℝ
L :
ℝ
hL :
0 ≤ L
hf :
ContinuousOn f (centeredRectangle c r)
hlip :
∀ y ∈ centeredRectangle c r,
∀ z ∈ centeredRectangle c r, |f y - f z| ≤ L * ∑ i, |(y i - z i) / r i|
∃ p : MvPolynomial (Fin 4) ℝ,
conclusion 1
m ∈ p.support :
i :
m i ≤ 2 * (K - 1)
conclusion 2
p.totalDegree ≤ 8 * (K - 1)
conclusion 3
y ∈ centeredRectangle c r :
|eval y p - f y| ≤ 128 * L / (K : ℝ)
Proof (Lean source)
theorem affineJackson_approx_four {K : ℕ} (hK : 0 < K) (c r : Fin 4 → ℝ) (hr : ∀ i, 0 < r i) (f : (Fin 4 → ℝ) → ℝ) (L : ℝ) (hL : 0 ≤ L) (hf : ContinuousOn f (centeredRectangle c r)) (hlip : ∀ y ∈ centeredRectangle c r, ∀ z ∈ centeredRectangle c r, |f y - f z| ≤ L * ∑ i, |(y i - z i) / r i|) : ∃ p : MvPolynomial (Fin 4) ℝ, (∀ m ∈ p.support, ∀ i, m i ≤ 2 * (K - 1)) ∧ p.totalDegree ≤ 8 * (K - 1) ∧ ∀ y ∈ centeredRectangle c r, |eval y p - f y| ≤ 128 * L / (K : ℝ) := by /- Use the same pulled-back function and polynomial extraction/substitution as above. Its cube Lipschitz hypothesis follows from `hlip`: affine coordinate differences divided by a positive radius simplify to `x i - z i`. Apply `tensorConvolution_approx_lipschitz` in dimension four. For a rectangle point `y`, set the phase coordinate to `arccos (normalizedPoint c r y i)`; membership in the normalized cube and `Real.cos_arccos` identify its cosine point with the normalized point. Finally use `affinePoint_normalizedPoint` and normalize the constant `32 * (4 : ℝ) * L / K` to `128 * L / K`. -/ have haff : Continuous (affinePoint c r) := by apply continuous_pi intro i exact continuous_const.add (continuous_const.mul (continuous_apply i)) have hpull : ContinuousOn (fun z => f (affinePoint c r z)) (normalizedCube 4) := hf.comp haff.continuousOn (fun z hz => affinePoint_mem_centeredRectangle c r z hr hz) have hlip_pull : ∀ x ∈ normalizedCube 4, ∀ z ∈ normalizedCube 4, |f (affinePoint c r x) - f (affinePoint c r z)| ≤ L * ∑ i, |x i - z i| := by intro x hx z hz have h := hlip (affinePoint c r x) (affinePoint_mem_centeredRectangle c r x hr hx) (affinePoint c r z) (affinePoint_mem_centeredRectangle c r z hr hz) have hcoord (i : Fin 4) : (affinePoint c r x i - affinePoint c r z i) / r i = x i - z i := by simp only [affinePoint] field_simp [ne_of_gt (hr i)] ring simpa only [hcoord] using h obtain ⟨p, q, hpeval, hqeval, hpcoord, hptotal⟩ := affineJackson_exists_mvPolynomial_four hK c r hr f hf refine ⟨p, hpcoord, hptotal, ?_⟩ intro y hy let x : Fin 4 → ℝ := fun i => arccos (normalizedPoint c r y i) have hn := normalizedPoint_mem_normalizedCube c r y hr hy have hcos : cosPoint x = normalizedPoint c r y := by funext i exact Real.cos_arccos (hn i).1 (hn i).2 have happ := tensorConvolution_approx_lipschitz hK (fun z => f (affinePoint c r z)) L hL hpull hlip_pull x calc |eval y p - f y| = |tensorConvolution K (fun z => f (affinePoint c r z)) x - f (affinePoint c r (cosPoint x))| := by rw [hpeval y, ← hcos, hqeval x, hcos, affinePoint_normalizedPoint c r y hr] _ ≤ 32 * (4 : ℝ) * L / (K : ℝ) := happ _ = 128 * L / (K : ℝ) := by ring
Causalean.Mathlib.Analysis.JacksonApproximation.affineJackson_approx_four · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFour.lean:480 · uses centeredRectangle
7 supporting declarations (lemmas, instances)
  • normalizedPoint_affinePoint theorem — For a finite dimension, a center, coordinate radii, and normalized coordinates, if every radius is positive, then normalizing the affine image recovers the original normalized coordinates.
    d :
    ℕ
    c r z :
    Fin d → ℝ
    hr :
    ∀ i, 0 < r i
    Proof (Lean source)
    theorem normalizedPoint_affinePoint {d : ℕ} (c r z : Fin d → ℝ) (hr : ∀ i, 0 < r i) : normalizedPoint c r (affinePoint c r z) = z := by funext i simp only [normalizedPoint, affinePoint] field_simp [ne_of_gt (hr i)] ring
    Causalean.Mathlib.Analysis.JacksonApproximation.normalizedPoint_affinePoint · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFour.lean:42
  • affinePoint_normalizedPoint theorem — For a finite dimension, a center, coordinate radii, and a point, if every radius is positive, then applying the affine map to the normalized point recovers the original point.
    d :
    ℕ
    c r y :
    Fin d → ℝ
    hr :
    ∀ i, 0 < r i
    Proof (Lean source)
    theorem affinePoint_normalizedPoint {d : ℕ} (c r y : Fin d → ℝ) (hr : ∀ i, 0 < r i) : affinePoint c r (normalizedPoint c r y) = y := by funext i simp only [affinePoint, normalizedPoint] field_simp [ne_of_gt (hr i)] ring
    Causalean.Mathlib.Analysis.JacksonApproximation.affinePoint_normalizedPoint · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFour.lean:53
  • affinePoint_mem_centeredRectangle theorem — For a finite dimension, a center, coordinate radii, and normalized coordinates, if every radius is strictly positive and the normalized point lies in the normalized cube, then its affine image lies in the centered rectangle.
    d :
    ℕ
    c r z :
    Fin d → ℝ
    hr :
    ∀ i, 0 < r i
    hz :
    Proof (Lean source)
    theorem affinePoint_mem_centeredRectangle {d : ℕ} (c r z : Fin d → ℝ) (hr : ∀ i, 0 < r i) (hz : z ∈ normalizedCube d) : affinePoint c r z ∈ centeredRectangle c r := by intro i simp only [affinePoint] rw [add_sub_cancel_left, abs_mul, abs_of_pos (hr i)] exact mul_le_of_le_one_right (le_of_lt (hr i)) (abs_le.mpr (hz i))
    Causalean.Mathlib.Analysis.JacksonApproximation.affinePoint_mem_centeredRectangle · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFour.lean:64
  • normalizedPoint_mem_normalizedCube theorem — For a finite dimension, a center, coordinate radii, and a point, if every radius is positive and the point lies in the centered rectangle, then its normalized coordinates lie in the normalized cube.
    d :
    ℕ
    c r y :
    Fin d → ℝ
    hr :
    ∀ i, 0 < r i
    hy :
    Proof (Lean source)
    theorem normalizedPoint_mem_normalizedCube {d : ℕ} (c r y : Fin d → ℝ) (hr : ∀ i, 0 < r i) (hy : y ∈ centeredRectangle c r) : normalizedPoint c r y ∈ normalizedCube d := by intro i rw [show normalizedPoint c r y i = (y i - c i) / r i by rfl, Set.mem_Icc] apply abs_le.mp rw [abs_div, abs_of_pos (hr i), div_le_one (hr i)] exact hy i
    Causalean.Mathlib.Analysis.JacksonApproximation.normalizedPoint_mem_normalizedCube · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFour.lean:76
  • mvPolynomial_affine_substitution_four theorem — Given a four-variable polynomial, a center, coordinate radii that are strictly positive, a coordinate-degree limit n, and the fact that the polynomial has degree at most n in each variable, there is a four-variable polynomial whose value at every point equals the original polynomial at the normalized coordinates of that point, which has degree at most n in each variable and total degree at most that of the original, and whose coefficients have absolute values summing to at most the original's coefficient sum times the product over coordinates of the n-th power of the larger of one and (1 + |centre|) / radius.
    q :
    c r :
    Fin 4 → ℝ
    n :
    ℕ
    hr :
    ∀ i, 0 < r i
    hqcoord :
    ∀ m ∈ q.support, ∀ i, m i ≤ n
    ∃ p : MvPolynomial (Fin 4) ℝ,
    conclusion 1
    y :
    eval y p = eval (normalizedPoint c r y) q
    conclusion 2
    m ∈ p.support :
    i :
    m i ≤ n
    conclusion 3
    p.totalDegree ≤ q.totalDegree
    conclusion 4
    mvCoeffL1 p ≤ mvCoeffL1 q * ∏ i : Fin 4, (max 1 ((1 + |c i|) / r i)) ^ n
    Proof (Lean source)
    theorem mvPolynomial_affine_substitution_four (q : MvPolynomial (Fin 4) ℝ) (c r : Fin 4 → ℝ) (n : ℕ) (hr : ∀ i, 0 < r i) (hqcoord : ∀ m ∈ q.support, ∀ i, m i ≤ n) : ∃ p : MvPolynomial (Fin 4) ℝ, (∀ y, eval y p = eval (normalizedPoint c r y) q) ∧ (∀ m ∈ p.support, ∀ i, m i ≤ n) ∧ p.totalDegree ≤ q.totalDegree ∧ mvCoeffL1 p ≤ mvCoeffL1 q * ∏ i : Fin 4, (max 1 ((1 + |c i|) / r i)) ^ n := by classical let g : Fin 4 → MvPolynomial (Fin 4) ℝ := fun i => (MvPolynomial.X i - MvPolynomial.C (c i)) * MvPolynomial.C (r i)⁻¹ let p := MvPolynomial.bind₁ g q have hp_sum : p = ∑ m ∈ q.support, MvPolynomial.bind₁ g (monomial m (q.coeff m)) := by dsimp [p] conv_lhs => rw [q.as_sum] simp only [map_sum] have hcoord_term (m : Fin 4 →₀ ℕ) (a : ℝ) (i : Fin 4) : (MvPolynomial.bind₁ g (monomial m a)).degreeOf i ≤ m i := by rw [MvPolynomial.bind₁_monomial] calc (MvPolynomial.C a * ∏ j ∈ m.support, g j ^ m j : MvPolynomial (Fin 4) ℝ).degreeOf i ≤ (MvPolynomial.C a : MvPolynomial (Fin 4) ℝ).degreeOf i + (∏ j ∈ m.support, g j ^ m j : MvPolynomial (Fin 4) ℝ).degreeOf i := MvPolynomial.degreeOf_mul_le _ _ _ _ ≤ 0 + ∑ j ∈ m.support, (g j ^ m j : MvPolynomial (Fin 4) ℝ).degreeOf i := by gcongr · simp · exact MvPolynomial.degreeOf_prod_le _ _ _ _ ≤ ∑ j ∈ m.support, m j * (if i = j then 1 else 0) := by simp only [zero_add] gcongr with j hj exact (MvPolynomial.degreeOf_pow_le _ _ _).trans (Nat.mul_le_mul_left _ (by dsimp [g] exact affineVariable_degreeOf_le c r i j)) _ = m i := by by_cases hi : i ∈ m.support · rw [Finset.sum_eq_single i] · simp · intro j hj hji simp [Ne.symm hji] · exact fun h => (h hi).elim · have hmi : m i = 0 := Finsupp.notMem_support_iff.mp hi rw [hmi] apply Finset.sum_eq_zero intro j hj have hji : i ≠ j := by intro hij subst j exact hi hj simp [hji] have htotal_term (m : Fin 4 →₀ ℕ) (a : ℝ) : (MvPolynomial.bind₁ g (monomial m a)).totalDegree ≤ m.sum fun _ e => e := by rw [MvPolynomial.bind₁_monomial] calc (MvPolynomial.C a * ∏ j ∈ m.support, g j ^ m j : MvPolynomial (Fin 4) ℝ).totalDegree ≤ (MvPolynomial.C a : MvPolynomial (Fin 4) ℝ).totalDegree + (∏ j ∈ m.support, g j ^ m j : MvPolynomial (Fin 4) ℝ).totalDegree := MvPolynomial.totalDegree_mul _ _ _ ≤ 0 + ∑ j ∈ m.support, (g j ^ m j : MvPolynomial (Fin 4) ℝ).totalDegree := by gcongr · simp · exact MvPolynomial.totalDegree_finsetProd _ _ _ ≤ ∑ j ∈ m.support, m j := by simp only [zero_add] gcongr with j hj exact (MvPolynomial.totalDegree_pow _ _).trans (by simpa [g] using Nat.mul_le_mul_left (m j) (affineVariable_totalDegree_le c r j)) _ = m.sum fun _ e => e := by rfl refine ⟨p, ?_, ?_, ?_, ?_⟩ · intro y dsimp [p] rw [← MvPolynomial.aeval_eq_eval, MvPolynomial.aeval_bind₁, MvPolynomial.aeval_eq_eval] apply congrArg (fun z => eval z q) funext i simp [g, normalizedPoint, div_eq_mul_inv] · intro m hm i apply (MvPolynomial.monomial_le_degreeOf i hm).trans rw [hp_sum] refine (MvPolynomial.degreeOf_sum_le i q.support (fun m => MvPolynomial.bind₁ g (monomial m (q.coeff m)))).trans ?_ exact Finset.sup_le fun m hm => (hcoord_term m (q.coeff m) i).trans (hqcoord m hm i) · rw [hp_sum] refine (MvPolynomial.totalDegree_finsetSum q.support (fun m => MvPolynomial.bind₁ g (monomial m (q.coeff m)))).trans ?_ exact Finset.sup_le fun m hm => (htotal_term m (q.coeff m)).trans (MvPolynomial.le_totalDegree hm) · let A : Fin 4 → ℝ := fun i => (1 + |c i|) / r i let M : Fin 4 → ℝ := fun i => max 1 (A i) have hA (i : Fin 4) : 0 ≤ A i := by dsimp [A] exact div_nonneg (by positivity) (le_of_lt (hr i)) have hAM (i : Fin 4) : A i ≤ M i := by exact le_max_right _ _ have hM (i : Fin 4) : 1 ≤ M i := by exact le_max_left _ _ have hg_l1 (i : Fin 4) : mvCoeffL1 (g i) ≤ A i := by dsimp [g, A] calc mvCoeffL1 ((MvPolynomial.X i - MvPolynomial.C (c i)) * MvPolynomial.C (r i)⁻¹ : MvPolynomial (Fin 4) ℝ) ≤ mvCoeffL1 (MvPolynomial.X i - MvPolynomial.C (c i) : MvPolynomial (Fin 4) ℝ) * mvCoeffL1 (MvPolynomial.C (r i)⁻¹ : MvPolynomial (Fin 4) ℝ) := mvCoeffL1_mul_le _ _ _ ≤ (mvCoeffL1 (MvPolynomial.X i : MvPolynomial (Fin 4) ℝ) + mvCoeffL1 (-MvPolynomial.C (c i) : MvPolynomial (Fin 4) ℝ)) * mvCoeffL1 (MvPolynomial.C (r i)⁻¹ : MvPolynomial (Fin 4) ℝ) := by apply mul_le_mul_of_nonneg_right · simpa [sub_eq_add_neg] using mvCoeffL1_add_le (MvPolynomial.X i : MvPolynomial (Fin 4) ℝ) (-MvPolynomial.C (c i)) · unfold mvCoeffL1 positivity _ = (1 + |c i|) / r i := by rw [mvCoeffL1_X, mvCoeffL1_neg, mvCoeffL1_C, mvCoeffL1_C, abs_inv, abs_of_pos (hr i)] simp [div_eq_mul_inv] have hterm_l1 (m : Fin 4 →₀ ℕ) (a : ℝ) : mvCoeffL1 (MvPolynomial.bind₁ g (monomial m a)) ≤ |a| * ∏ i ∈ m.support, A i ^ m i := by rw [MvPolynomial.bind₁_monomial] calc mvCoeffL1 (MvPolynomial.C a * ∏ i ∈ m.support, g i ^ m i) ≤ mvCoeffL1 (MvPolynomial.C a : MvPolynomial (Fin 4) ℝ) * mvCoeffL1 (∏ i ∈ m.support, g i ^ m i) := mvCoeffL1_mul_le _ _ _ ≤ |a| * ∏ i ∈ m.support, mvCoeffL1 (g i ^ m i) := by rw [mvCoeffL1_C] exact mul_le_mul_of_nonneg_left (mvCoeffL1_finsetProd_le _ _) (abs_nonneg a) _ ≤ |a| * ∏ i ∈ m.support, mvCoeffL1 (g i) ^ m i := by apply mul_le_mul_of_nonneg_left _ (abs_nonneg a) apply Finset.prod_le_prod · intro i hi unfold mvCoeffL1 positivity · intro i hi exact mvCoeffL1_pow_le _ _ _ ≤ |a| * ∏ i ∈ m.support, A i ^ m i := by apply mul_le_mul_of_nonneg_left _ (abs_nonneg a) apply Finset.prod_le_prod · intro i hi exact pow_nonneg (by unfold mvCoeffL1; positivity) _ · intro i hi exact pow_le_pow_left₀ (by unfold mvCoeffL1; positivity) (hg_l1 i) _ have hfactor (m : Fin 4 →₀ ℕ) (hm : m ∈ q.support) : (∏ i ∈ m.support, A i ^ m i) ≤ ∏ i : Fin 4, M i ^ n := by calc (∏ i ∈ m.support, A i ^ m i) ≤ ∏ i ∈ m.support, M i ^ n := by apply Finset.prod_le_prod · intro i hi exact pow_nonneg (hA i) _ · intro i hi exact (pow_le_pow_left₀ (hA i) (hAM i) _).trans (pow_le_pow_right₀ (hM i) (hqcoord m hm i)) _ ≤ ∏ i : Fin 4, M i ^ n := by apply Finset.prod_le_prod_of_subset_of_one_le (Finset.subset_univ _) · intro i hi positivity · intro i hi hnot exact one_le_pow₀ (hM i) rw [hp_sum] calc mvCoeffL1 (∑ m ∈ q.support, MvPolynomial.bind₁ g (monomial m (q.coeff m))) ≤ ∑ m ∈ q.support, mvCoeffL1 (MvPolynomial.bind₁ g (monomial m (q.coeff m))) := mvCoeffL1_finsetSum_le _ _ _ ≤ ∑ m ∈ q.support, |q.coeff m| * ∏ i : Fin 4, M i ^ n := by gcongr with m hm exact (hterm_l1 m (q.coeff m)).trans (mul_le_mul_of_nonneg_left (hfactor m hm) (abs_nonneg _)) _ = mvCoeffL1 q * ∏ i : Fin 4, M i ^ n := by rw [← Finset.sum_mul] rfl _ = mvCoeffL1 q * ∏ i : Fin 4, (max 1 ((1 + |c i|) / r i)) ^ n := by rfl
    Causalean.Mathlib.Analysis.JacksonApproximation.mvPolynomial_affine_substitution_four · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFour.lean:243
  • affineJackson_exists_mvPolynomial_four theorem — For integer order K that is strictly positive, a rectangle center, positive coordinate radii, and a function that is continuous on the centered rectangle, there are two four-variable polynomials: one reproduces, at the coordinatewise cosines of every point, the order-K tensor convolution of the function expressed in normalized coordinates; the other equals the first evaluated at the normalized coordinates of its argument, has degree at most 2 (K − 1) in each variable, and has total degree at most 8 (K − 1).
    K :
    ℕ
    hK :
    0 < K
    c r :
    Fin 4 → ℝ
    hr :
    ∀ i, 0 < r i
    f :
    (Fin 4 → ℝ) → ℝ
    ∃ p q : MvPolynomial (Fin 4) ℝ,
    conclusion 1
    y :
    eval y p = eval (normalizedPoint c r y) q
    conclusion 2
    x :
    eval (cosPoint x) q = tensorConvolution K (fun z => f (affinePoint c r z)) x
    conclusion 3
    m ∈ p.support :
    i :
    m i ≤ 2 * (K - 1)
    conclusion 4
    p.totalDegree ≤ 8 * (K - 1)
    Proof (Lean source)
    theorem affineJackson_exists_mvPolynomial_four {K : ℕ} (hK : 0 < K) (c r : Fin 4 → ℝ) (hr : ∀ i, 0 < r i) (f : (Fin 4 → ℝ) → ℝ) (hf : ContinuousOn f (centeredRectangle c r)) : ∃ p q : MvPolynomial (Fin 4) ℝ, (∀ y, eval y p = eval (normalizedPoint c r y) q) ∧ (∀ x, eval (cosPoint x) q = tensorConvolution K (fun z => f (affinePoint c r z)) x) ∧ (∀ m ∈ p.support, ∀ i, m i ≤ 2 * (K - 1)) ∧ p.totalDegree ≤ 8 * (K - 1) := by /- Pull `f` back along `affinePoint`, proving continuity on `normalizedCube 4` with `ContinuousOn.comp` and `affinePoint_mem_centeredRectangle`. Apply `tensorConvolution_exists_mvPolynomial`, then apply `mvPolynomial_affine_substitution_four` to its output with `n = 2 * (K - 1)`. The substitution evaluation identity is exactly the first conjunct; its support and total-degree conclusions, together with `4 * (2 * (K - 1)) = 8 * (K - 1)`, discharge the remaining conjuncts. -/ have haff : Continuous (affinePoint c r) := by apply continuous_pi intro i exact continuous_const.add (continuous_const.mul (continuous_apply i)) have hpull : ContinuousOn (fun z => f (affinePoint c r z)) (normalizedCube 4) := hf.comp haff.continuousOn (fun z hz => affinePoint_mem_centeredRectangle c r z hr hz) obtain ⟨q, hqeval, hqcoord, hqtotal⟩ := tensorConvolution_exists_mvPolynomial hK (fun z => f (affinePoint c r z)) hpull obtain ⟨p, hpeval, hpcoord, hptotal, _⟩ := mvPolynomial_affine_substitution_four q c r (2 * (K - 1)) hr hqcoord refine ⟨p, q, hpeval, hqeval, hpcoord, ?_⟩ omega
    Causalean.Mathlib.Analysis.JacksonApproximation.affineJackson_exists_mvPolynomial_four · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFour.lean:441
  • affineJackson_coeffBound_four theorem — For integer order K that is strictly positive, a rectangle center, positive coordinate radii, a function, a nonnegative uniform bound B, continuity on the centered rectangle, and the corresponding uniform bound throughout the rectangle, there are two four-variable polynomials: one reproduces, at the coordinatewise cosines of every point, the order-K tensor convolution of the function expressed in normalized coordinates; the other equals the first evaluated at the normalized coordinates of its argument, has degree at most 2 (K − 1) in each variable and total degree at most 8 (K − 1), and has coefficients whose absolute values sum to at most 2 to the power 40 K + 20, times B, times the product over coordinates of the 2 (K − 1)-th power of the larger of one and (1 + |centre|) / radius.
    K :
    ℕ
    hK :
    0 < K
    c r :
    Fin 4 → ℝ
    hr :
    ∀ i, 0 < r i
    f :
    (Fin 4 → ℝ) → ℝ
    B :
    ℝ
    hB :
    0 ≤ B
    hbound :
    ∀ y ∈ centeredRectangle c r, |f y| ≤ B
    ∃ p q : MvPolynomial (Fin 4) ℝ,
    conclusion 1
    y :
    eval y p = eval (normalizedPoint c r y) q
    conclusion 2
    x :
    eval (cosPoint x) q = tensorConvolution K (fun z => f (affinePoint c r z)) x
    conclusion 3
    m ∈ p.support :
    i :
    m i ≤ 2 * (K - 1)
    conclusion 4
    p.totalDegree ≤ 8 * (K - 1)
    conclusion 5
    ≤ (2 : ℝ) ^ (40 * K + 20) * B * ∏ i : Fin 4, (max 1 ((1 + |c i|) / r i)) ^ (2 * (K - 1))
    Proof (Lean source)
    theorem affineJackson_coeffBound_four {K : ℕ} (hK : 0 < K) (c r : Fin 4 → ℝ) (hr : ∀ i, 0 < r i) (f : (Fin 4 → ℝ) → ℝ) (B : ℝ) (hB : 0 ≤ B) (hf : ContinuousOn f (centeredRectangle c r)) (hbound : ∀ y ∈ centeredRectangle c r, |f y| ≤ B) : ∃ p q : MvPolynomial (Fin 4) ℝ, (∀ y, eval y p = eval (normalizedPoint c r y) q) ∧ (∀ x, eval (cosPoint x) q = tensorConvolution K (fun z => f (affinePoint c r z)) x) ∧ (∀ m ∈ p.support, ∀ i, m i ≤ 2 * (K - 1)) ∧ p.totalDegree ≤ 8 * (K - 1) ∧ mvCoeffL1 p ≤ (2 : ℝ) ^ (40 * K + 20) * B * ∏ i : Fin 4, (max 1 ((1 + |c i|) / r i)) ^ (2 * (K - 1)) := by /- Pull `f` back along `affinePoint`; rectangle boundedness restricts to cube boundedness by `affinePoint_mem_centeredRectangle`. Obtain `q` from `tensorConvolution_exists_mvPolynomial_four_coeffBound`, then substitute it using `mvPolynomial_affine_substitution_four` at degree `2 * (K - 1)`. Combine the two coefficient inequalities by multiplication with the nonnegative finite product. Reuse the substitution support/total-degree conclusions and the tensor evaluation identity without reconstructing a different representative. -/ have haff : Continuous (affinePoint c r) := by apply continuous_pi intro i exact continuous_const.add (continuous_const.mul (continuous_apply i)) have hpull : ContinuousOn (fun z => f (affinePoint c r z)) (normalizedCube 4) := hf.comp haff.continuousOn (fun z hz => affinePoint_mem_centeredRectangle c r z hr hz) have hbound_pull : ∀ z ∈ normalizedCube 4, |f (affinePoint c r z)| ≤ B := by intro z hz exact hbound (affinePoint c r z) (affinePoint_mem_centeredRectangle c r z hr hz) obtain ⟨q, hqeval, hqcoord, hqtotal, hqcoeff⟩ := tensorConvolution_exists_mvPolynomial_four_coeffBound hK (fun z => f (affinePoint c r z)) B hB hpull hbound_pull obtain ⟨p, hpeval, hpcoord, hptotal, hpcoeff⟩ := mvPolynomial_affine_substitution_four q c r (2 * (K - 1)) hr hqcoord refine ⟨p, q, hpeval, hqeval, hpcoord, ?_, ?_⟩ · omega · have hfactor : 0 ≤ ∏ i : Fin 4, (max 1 ((1 + |c i|) / r i)) ^ (2 * (K - 1)) := by positivity exact hpcoeff.trans (mul_le_mul_of_nonneg_right hqcoeff hfactor)
    Causalean.Mathlib.Analysis.JacksonApproximation.affineJackson_coeffBound_four · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFour.lean:550
Bernstein 5 core · 5 supporting For a real polynomial R of degree ≤ β, the substitution x = -cos t turns R into the *even trigonometric polynomial* czTrig R t = R.eval (-cos t) of degree ≤ β on [0, π]. ★ czTrig_szego_deriv★ czTrig_arccos_lipschitz★ czTrig_maximizer_bound

Bernstein / Szegő analytic core for the Ehlich–Zeller mesh inequality

For a real polynomial R of degree ≤ β, the substitution x = -cos t turns R into the even trigonometric polynomial czTrig R t = R.eval (-cos t) of degree ≤ β on [0, π]. This file isolates the genuinely analytic heart of the Ehlich–Zeller argument, namely Bernstein's / Szegő's differential inequality for trigonometric polynomials and its arccos-Lipschitz consequence.

Main declarations:

* czTrig, czSup — the trigonometric transform of R and its sup-norm on [0, π]. * czTrig_continuous, czSup_attained — soft-analysis facts (continuity and attainment of the sup on the compact interval [0, π]). * czTrig_szego_deriv — Szegő's inequality: `|d/dt czTrig R t| ≤ β · √(M² − (czTrig R t)²) where M = czSup R`. This is the deep input; no such lemma exists in Mathlib, so it is proved here from the trigonometric-polynomial structure of czTrig R. * czTrig_arccos_lipschitz — the Lipschitz reformulation: `t ↦ arccos(czTrig R t / M) is β-Lipschitz on [0, π]`. * czTrig_maximizer_bound — the packaged output consumed by the mesh file: if t₀ is a maximizer (czTrig R t₀ = M) and s is any point with β·|t₀ − s| ≤ π/2, then M · cos(β·|t₀ − s|) ≤ czTrig R s.

These are stated for a general real polynomial R and a general degree bound β; nothing is specialized to the downstream rollout objects.

## Standard reference Ehlich, H. & Zeller, K. (1964), Schwankung von Polynomen zwischen Gitterpunkten, Math. Z. 86, 41–44; Rivlin, The Chebyshev Polynomials (1974).

def czTrig reviewed
Causalean.Mathlib.Analysis.EhlichZellerMesh

For a real polynomial and a real argument, the cosine-parametrized polynomial transform is the polynomial evaluated at −cos⁡(t)-\cos(t). As the argument ranges over [0,π][0,\pi], its evaluation point ranges over all of [−1,1][-1,1].

Definition (Lean source)
R :
t :
ℝ
czTrig R t :
ℝ
R.eval (- cos t)
Causalean.Mathlib.Analysis.EhlichZellerMesh.czTrig · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Bernstein.lean:50
def czSup reviewed
Causalean.Mathlib.Analysis.EhlichZellerMesh

For a real polynomial, the cosine-transform sup norm is the supremum of the absolute value of its cosine-parametrized transform over [0,π][0,\pi]. Equivalently, it is the supremum of the polynomial's absolute value over [−1,1][-1,1].

Definition (Lean source)
R :
czSup R :
ℝ
sSup ((fun t => |czTrig R t|) '' Icc 0 pi)
Causalean.Mathlib.Analysis.EhlichZellerMesh.czSup · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Bernstein.lean:58
theorem czTrig_szego_deriv reviewed
Causalean.Mathlib.Analysis.EhlichZellerMesh

Szegő's differential inequality. The cosine-parametrized transform of a real polynomial whose degree is at most a chosen bound, evaluated at any real angle, has derivative magnitude at most the degree bound times the square root of the sup-norm squared minus the squared transform value.

Formal statement
R :
β :
ℕ
hβ :
R.natDegree ≤ β
t :
ℝ
|deriv (czTrig R) t| ≤ (β : ℝ) * sqrt ((czSup R) ^ 2 - (czTrig R t) ^ 2)
Proof (Lean source)
theorem czTrig_szego_deriv (R : Polynomial ℝ) (β : ℕ) (hβ : R.natDegree ≤ β) (t : ℝ) : |deriv (czTrig R) t| ≤ (β : ℝ) * sqrt ((czSup R) ^ 2 - (czTrig R t) ^ 2) := by let S : Polynomial ℝ := R.comp (-(Polynomial.X : Polynomial ℝ)) have hS_eval (x : ℝ) : S.eval x = R.eval (-x) := by simp [S] have hS_degree : S.natDegree ≤ β := by calc S.natDegree ≤ R.natDegree * (-(Polynomial.X : Polynomial ℝ)).natDegree := by simpa [S] using (Polynomial.natDegree_comp_le (p := R) (q := -(Polynomial.X : Polynomial ℝ))) _ = R.natDegree := by simp _ ≤ β := hβ have hS_bound : ∀ u, |S.eval (cos u)| ≤ czSup R := by intro u let v : ℝ := arccos (cos u) have hv : v ∈ Icc (0 : ℝ) pi := ⟨Real.arccos_nonneg (cos u), Real.arccos_le_pi (cos u)⟩ have hcos : cos v = cos u := by exact Real.cos_arccos (Real.neg_one_le_cos u) (Real.cos_le_one u) calc |S.eval (cos u)| = |R.eval (-cos u)| := by rw [hS_eval] _ = |czTrig R v| := by simp [czTrig, hcos] _ ≤ czSup R := abs_czTrig_le_czSup R hv have hsq := szego_deriv_sq_bound S β hS_degree (czSup R) hS_bound t have hsq' : (deriv (czTrig R) t) ^ 2 + (β : ℝ) ^ 2 * (czTrig R t) ^ 2 ≤ (β : ℝ) ^ 2 * (czSup R) ^ 2 := by have hfun : czTrig R = fun s => S.eval (cos s) := funext fun s => by simp [czTrig, hS_eval] rw [hfun] exact hsq by_cases hβ0 : β = 0 · have hderiv_sq_nonpos : (deriv (czTrig R) t) ^ 2 ≤ 0 := by simpa [hβ0] using hsq' have hderiv_zero : deriv (czTrig R) t = 0 := by nlinarith [sq_nonneg (deriv (czTrig R) t)] simp [hβ0, hderiv_zero] · have hβpos : 0 < (β : ℝ) := by exact_mod_cast Nat.pos_of_ne_zero hβ0 have hrad_nonneg : 0 ≤ (czSup R) ^ 2 - (czTrig R t) ^ 2 := by have hq_le : (β : ℝ) ^ 2 * (czTrig R t) ^ 2 ≤ (β : ℝ) ^ 2 * (czSup R) ^ 2 := by nlinarith [hsq', sq_nonneg (deriv (czTrig R) t)] have hβsq_pos : 0 < (β : ℝ) ^ 2 := sq_pos_of_pos hβpos nlinarith have hsq_bound : (deriv (czTrig R) t) ^ 2 ≤ ((β : ℝ) * sqrt ((czSup R) ^ 2 - (czTrig R t) ^ 2)) ^ 2 := by rw [mul_pow, Real.sq_sqrt hrad_nonneg] nlinarith [hsq'] exact abs_le_of_sq_le_sq hsq_bound (by positivity)
Causalean.Mathlib.Analysis.EhlichZellerMesh.czTrig_szego_deriv · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Bernstein.lean:101 · uses czSup , czTrig
theorem czTrig_arccos_lipschitz reviewed
Causalean.Mathlib.Analysis.EhlichZellerMesh

Arccos-Lipschitz reformulation of Szegő's inequality. The normalized cosine transform of a real polynomial with a chosen degree bound and strictly positive sup norm has arccosine values at any two specified angles in the interval from zero to π whose difference is bounded by the degree times the distance between those angles.

Formal statement
R :
β :
ℕ
hβ :
R.natDegree ≤ β
hM :
0 < czSup R
s t :
ℝ
hs :
s ∈ Icc 0 pi
ht :
t ∈ Icc 0 pi
|arccos (czTrig R t / czSup R) - arccos (czTrig R s / czSup R)|
≤ (β : ℝ) * |t - s|
Proof (Lean source)
theorem czTrig_arccos_lipschitz (R : Polynomial ℝ) (β : ℕ) (hβ : R.natDegree ≤ β) (hM : 0 < czSup R) {s t : ℝ} (hs : s ∈ Icc 0 pi) (ht : t ∈ Icc 0 pi) : |arccos (czTrig R t / czSup R) - arccos (czTrig R s / czSup R)| ≤ (β : ℝ) * |t - s| := by let ε : ℕ → ℝ := fun n => 1 / ((n : ℝ) + 1) let lhsε : ℕ → ℝ := fun n => |arccos (czTrig R t / (czSup R + ε n)) - arccos (czTrig R s / (czSup R + ε n))| have hεpos (n : ℕ) : 0 < ε n := by dsimp [ε] positivity have hineq : ∀ n, lhsε n ≤ (β : ℝ) * |t - s| := by intro n simpa [lhsε, ε] using czTrig_arccos_lipschitz_regularized R β hβ (hδ := hεpos n) hs ht have hε_tendsto : Tendsto ε atTop (nhds 0) := by simpa [ε, Nat.cast_add, Nat.cast_one] using (tendsto_one_div_add_atTop_nhds_zero_nat (𝕜 := ℝ)) have ht_arg_tendsto : Tendsto (fun n => czTrig R t / (czSup R + ε n)) atTop (nhds (czTrig R t / czSup R)) := by have hden : Tendsto (fun n => czSup R + ε n) atTop (nhds (czSup R)) := by simpa using tendsto_const_nhds.add hε_tendsto exact tendsto_const_nhds.div hden (ne_of_gt hM) have hs_arg_tendsto : Tendsto (fun n => czTrig R s / (czSup R + ε n)) atTop (nhds (czTrig R s / czSup R)) := by have hden : Tendsto (fun n => czSup R + ε n) atTop (nhds (czSup R)) := by simpa using tendsto_const_nhds.add hε_tendsto exact tendsto_const_nhds.div hden (ne_of_gt hM) have ht_acos_tendsto : Tendsto (fun n => arccos (czTrig R t / (czSup R + ε n))) atTop (nhds (arccos (czTrig R t / czSup R))) := Real.continuous_arccos.tendsto _ |>.comp ht_arg_tendsto have hs_acos_tendsto : Tendsto (fun n => arccos (czTrig R s / (czSup R + ε n))) atTop (nhds (arccos (czTrig R s / czSup R))) := Real.continuous_arccos.tendsto _ |>.comp hs_arg_tendsto have hlhs_tendsto : Tendsto lhsε atTop (nhds |arccos (czTrig R t / czSup R) - arccos (czTrig R s / czSup R)|) := by simpa [lhsε, Real.norm_eq_abs] using (ht_acos_tendsto.sub hs_acos_tendsto).norm exact le_of_tendsto_of_tendsto hlhs_tendsto tendsto_const_nhds (Filter.Eventually.of_forall hineq)
Causalean.Mathlib.Analysis.EhlichZellerMesh.czTrig_arccos_lipschitz · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Bernstein.lean:283 · uses czSup , czTrig
theorem czTrig_maximizer_bound reviewed
Causalean.Mathlib.Analysis.EhlichZellerMesh

Maximizer node bound. For a real polynomial with a chosen degree bound and strictly positive cosine-transform sup norm, let one angle in the interval from zero to π be a point where the transform attains that norm and another angle in the same interval be close enough that the degree times their distance is at most π/2. Then the transform at the second angle is at least the sup norm times the cosine of the degree-scaled distance.

Formal statement
R :
β :
ℕ
hβ :
R.natDegree ≤ β
hM :
0 < czSup R
t₀ s :
ℝ
ht₀ :
t₀ ∈ Icc 0 pi
hs :
s ∈ Icc 0 pi
hmax :
czTrig R t₀ = czSup R
hclose :
(β : ℝ) * |t₀ - s| ≤ pi / 2
czSup R * cos ((β : ℝ) * |t₀ - s|) ≤ czTrig R s
Proof (Lean source)
theorem czTrig_maximizer_bound (R : Polynomial ℝ) (β : ℕ) (hβ : R.natDegree ≤ β) (hM : 0 < czSup R) {t₀ s : ℝ} (ht₀ : t₀ ∈ Icc 0 pi) (hs : s ∈ Icc 0 pi) (hmax : czTrig R t₀ = czSup R) (hclose : (β : ℝ) * |t₀ - s| ≤ pi / 2) : czSup R * cos ((β : ℝ) * |t₀ - s|) ≤ czTrig R s := by let φ : ℝ → ℝ := fun u => arccos (czTrig R u / czSup R) have hφt₀ : φ t₀ = 0 := by unfold φ rw [hmax] rw [div_self (ne_of_gt hM)] exact Real.arccos_one have hLip := czTrig_arccos_lipschitz R β hβ hM ht₀ hs have hLip' : |φ s - φ t₀| ≤ (β : ℝ) * |s - t₀| := by simpa [φ] using hLip have hφs_le : φ s ≤ (β : ℝ) * |t₀ - s| := by have hnonneg : 0 ≤ φ s := by unfold φ exact Real.arccos_nonneg _ rw [hφt₀, sub_zero, abs_of_nonneg hnonneg] at hLip' rwa [abs_sub_comm] at hLip' have hx_le_pi : (β : ℝ) * |t₀ - s| ≤ pi := by linarith [Real.pi_nonneg] have hcos_le : cos ((β : ℝ) * |t₀ - s|) ≤ cos (φ s) := by exact Real.cos_le_cos_of_nonneg_of_le_pi (by unfold φ; exact Real.arccos_nonneg _) hx_le_pi hφs_le have hratio_abs : |czTrig R s / czSup R| ≤ 1 := by rw [abs_div, abs_of_pos hM] exact (div_le_one hM).2 (abs_czTrig_le_czSup R hs) have hcosφ : cos (φ s) = czTrig R s / czSup R := by unfold φ exact Real.cos_arccos (abs_le.mp hratio_abs).1 (abs_le.mp hratio_abs).2 have hmul := mul_le_mul_of_nonneg_left (hcos_le.trans_eq hcosφ) hM.le calc czSup R * cos ((β : ℝ) * |t₀ - s|) ≤ czSup R * (czTrig R s / czSup R) := hmul _ = czTrig R s := by field_simp [ne_of_gt hM]
Causalean.Mathlib.Analysis.EhlichZellerMesh.czTrig_maximizer_bound · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Bernstein.lean:339 · uses czSup , czTrig
5 supporting declarations (lemmas, instances)
  • czTrig_continuous theorem — The cosine-parametrized transform of a real polynomial is continuous on the real line.
    R :
    Proof (Lean source)
    @[fun_prop] theorem czTrig_continuous (R : Polynomial ℝ) : Continuous (czTrig R) := by unfold czTrig fun_prop
    Causalean.Mathlib.Analysis.EhlichZellerMesh.czTrig_continuous · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Bernstein.lean:66
  • czSup_attained theorem — The cosine-transform sup norm of a real polynomial is attained at some angle between zero and π. This is the extreme-value theorem applied to the continuous absolute transform on that compact interval.
    R :
    ∃ t₀ ∈ Icc (0 : ℝ) pi, |czTrig R t₀| = czSup R
    Proof (Lean source)
    theorem czSup_attained (R : Polynomial ℝ) : ∃ t₀ ∈ Icc (0 : ℝ) pi, |czTrig R t₀| = czSup R := by classical have hK : IsCompact (Icc (0 : ℝ) pi) := isCompact_Icc have hne : (Icc (0 : ℝ) pi).Nonempty := ⟨0, by constructor <;> positivity⟩ have hcont : ContinuousOn (fun t => |czTrig R t|) (Icc (0 : ℝ) pi) := (czTrig_continuous R).abs.continuousOn rcases hK.exists_sSup_image_eq hne hcont with ⟨t₀, ht₀, hsup⟩ exact ⟨t₀, ht₀, hsup.symm⟩
    Causalean.Mathlib.Analysis.EhlichZellerMesh.czSup_attained · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Bernstein.lean:73
  • czSup_nonneg theorem — The cosine-transform sup norm of a real polynomial is nonnegative.
    R :
    0 ≤ czSup R
    Proof (Lean source)
    theorem czSup_nonneg (R : Polynomial ℝ) : 0 ≤ czSup R := by rcases czSup_attained R with ⟨t₀, _ht₀, hsup⟩ rw [← hsup] exact abs_nonneg _
    Causalean.Mathlib.Analysis.EhlichZellerMesh.czSup_nonneg · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Bernstein.lean:86
  • abs_czTrig_le_czSup theorem — At any angle between zero and π, the absolute cosine-parametrized value of a real polynomial is bounded by its cosine-transform sup norm.
    R :
    t :
    ℝ
    ht :
    t ∈ Icc (0 : ℝ) pi
    |czTrig R t| ≤ czSup R
    Proof (Lean source)
    theorem abs_czTrig_le_czSup (R : Polynomial ℝ) {t : ℝ} (ht : t ∈ Icc (0 : ℝ) pi) : |czTrig R t| ≤ czSup R := by classical unfold czSup refine le_csSup ?hbdd ⟨t, ht, rfl⟩ exact isCompact_Icc.bddAbove_image ((czTrig_continuous R).abs.continuousOn)
    Causalean.Mathlib.Analysis.EhlichZellerMesh.abs_czTrig_le_czSup · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Bernstein.lean:92
  • czTrig_arccos_lipschitz_regularized theorem — The arccosine of the cosine transform of a real polynomial with a chosen degree bound, normalized by its sup norm plus a positive regularizer, is evaluated at any two specified angles in the interval from zero to π, with the difference of the resulting arccosine values bounded by the degree times their distance.
    R :
    β :
    ℕ
    hβ :
    R.natDegree ≤ β
    δ :
    ℝ
    hδ :
    0 < δ
    s t :
    ℝ
    hs :
    s ∈ Icc 0 pi
    ht :
    t ∈ Icc 0 pi
    |arccos (czTrig R t / (czSup R + δ)) - arccos (czTrig R s / (czSup R + δ))|
    ≤ (β : ℝ) * |t - s|
    Proof (Lean source)
    theorem czTrig_arccos_lipschitz_regularized (R : Polynomial ℝ) (β : ℕ) (hβ : R.natDegree ≤ β) {δ : ℝ} (hδ : 0 < δ) {s t : ℝ} (hs : s ∈ Icc 0 pi) (ht : t ∈ Icc 0 pi) : |arccos (czTrig R t / (czSup R + δ)) - arccos (czTrig R s / (czSup R + δ))| ≤ (β : ℝ) * |t - s| := by let M : ℝ := czSup R let d : ℝ := M + δ have hM_nonneg : 0 ≤ M := by simpa [M] using czSup_nonneg R have hdpos : 0 < d := by dsimp [d, M]; linarith let f : ℝ → ℝ := fun u => arccos (czTrig R u / d) have hdiff_at (x : ℝ) (hx : x ∈ Icc (0 : ℝ) pi) : DifferentiableAt ℝ f x := by have hq_abs : |czTrig R x| ≤ M := by simpa [M] using abs_czTrig_le_czSup R hx have hinner_abs : |czTrig R x / d| < 1 := by rw [abs_div, abs_of_pos hdpos] exact (div_lt_one hdpos).2 (by dsimp [d, M]; linarith) have hne_neg : czTrig R x / d ≠ -1 := by intro h have : |czTrig R x / d| = 1 := by simp [h] linarith have hne_pos : czTrig R x / d ≠ 1 := by intro h have : |czTrig R x / d| = 1 := by simp [h] linarith have hinner_diff : DifferentiableAt ℝ (fun u => czTrig R u / d) x := by unfold czTrig fun_prop exact ((Real.hasDerivAt_arccos hne_neg hne_pos).comp x (DifferentiableAt.hasDerivAt hinner_diff)).differentiableAt have hderiv_bound (x : ℝ) (hx : x ∈ Icc (0 : ℝ) pi) : ‖deriv f x‖ ≤ (β : ℝ) := by have hq_abs : |czTrig R x| ≤ M := by simpa [M] using abs_czTrig_le_czSup R hx have hinner_abs : |czTrig R x / d| < 1 := by rw [abs_div, abs_of_pos hdpos] exact (div_lt_one hdpos).2 (by dsimp [d, M]; linarith) have hinner_sq_lt : (czTrig R x / d) ^ 2 < 1 := by simpa using (sq_lt_one_iff_abs_lt_one (czTrig R x / d)).2 hinner_abs have hinner_pos : 0 < 1 - (czTrig R x / d) ^ 2 := by linarith have hinner_nonneg : 0 ≤ 1 - (czTrig R x / d) ^ 2 := hinner_pos.le have hne_neg : czTrig R x / d ≠ -1 := by intro h have : |czTrig R x / d| = 1 := by simp [h] linarith have hne_pos : czTrig R x / d ≠ 1 := by intro h have : |czTrig R x / d| = 1 := by simp [h] linarith have hinner_diff : DifferentiableAt ℝ (fun u => czTrig R u / d) x := by unfold czTrig fun_prop have hcz_diff : DifferentiableAt ℝ (czTrig R) x := by unfold czTrig fun_prop have hinner_hasDeriv : HasDerivAt (fun u => czTrig R u / d) (deriv (czTrig R) x / d) x := (DifferentiableAt.hasDerivAt hcz_diff).div_const d have hf_hasDeriv : HasDerivAt f (-(1 / sqrt (1 - (czTrig R x / d) ^ 2)) * (deriv (czTrig R) x / d)) x := by simpa [f, Function.comp_def] using (Real.hasDerivAt_arccos hne_neg hne_pos).comp x hinner_hasDeriv have hderiv_eq : deriv f x = -(1 / sqrt (1 - (czTrig R x / d) ^ 2)) * (deriv (czTrig R) x / d) := hf_hasDeriv.deriv have hsqrtd_pos : 0 < sqrt (1 - (czTrig R x / d) ^ 2) := Real.sqrt_pos_of_pos hinner_pos have hden_eq : d * sqrt (1 - (czTrig R x / d) ^ 2) = sqrt (d ^ 2 - (czTrig R x) ^ 2) := by apply (sq_eq_sq₀ (mul_nonneg hdpos.le (Real.sqrt_nonneg _)) (Real.sqrt_nonneg _)).mp rw [mul_pow, Real.sq_sqrt hinner_nonneg] have hdiff_nonneg : 0 ≤ d ^ 2 - (czTrig R x) ^ 2 := by have hlt : |czTrig R x| < d := by dsimp [d, M]; linarith have hsq_lt : (czTrig R x) ^ 2 < d ^ 2 := by have hlt_abs : |czTrig R x| < |d| := by simpa [abs_of_pos hdpos] using hlt exact (sq_lt_sq (a := czTrig R x) (b := d)).2 hlt_abs linarith rw [Real.sq_sqrt hdiff_nonneg] field_simp [ne_of_gt hdpos] have hderiv_abs : |deriv f x| = |deriv (czTrig R) x| / (d * sqrt (1 - (czTrig R x / d) ^ 2)) := by rw [hderiv_eq, abs_mul, abs_neg, abs_div, abs_one, abs_of_pos hsqrtd_pos, abs_div, abs_of_pos hdpos] field_simp [ne_of_gt hsqrtd_pos, ne_of_gt hdpos] have hrad_le : sqrt (M ^ 2 - (czTrig R x) ^ 2) ≤ d * sqrt (1 - (czTrig R x / d) ^ 2) := by rw [hden_eq] apply Real.sqrt_le_sqrt dsimp [d] nlinarith [hM_nonneg, hδ] have hnum_le : |deriv (czTrig R) x| ≤ (β : ℝ) * (d * sqrt (1 - (czTrig R x / d) ^ 2)) := (czTrig_szego_deriv R β hβ x).trans (mul_le_mul_of_nonneg_left hrad_le (by positivity)) have hden_pos : 0 < d * sqrt (1 - (czTrig R x / d) ^ 2) := mul_pos hdpos hsqrtd_pos rw [Real.norm_eq_abs, hderiv_abs] exact (div_le_iff₀ hden_pos).2 (by simpa [mul_comm, mul_left_comm, mul_assoc] using hnum_le) have hmv := Convex.norm_image_sub_le_of_norm_deriv_le (f := f) (s := Icc (0 : ℝ) pi) (C := (β : ℝ)) hdiff_at hderiv_bound (convex_Icc (0 : ℝ) pi) hs ht simpa [f, d, M, Real.norm_eq_abs, abs_sub_comm] using hmv
    Causalean.Mathlib.Analysis.EhlichZellerMesh.czTrig_arccos_lipschitz_regularized · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Bernstein.lean:164
Heterogeneous­Tensor­Interpolation 7 core · 2 supporting This module gives an explicit finite tensor-grid interpolant for arbitrary finite coordinate types and coordinate-dependent degree bounds, together with coefficient and reproduction identities. ★ interpolate_eval

Heterogeneous tensor interpolation

This module gives an explicit finite tensor-grid interpolant for arbitrary finite coordinate types and coordinate-dependent degree bounds, together with coefficient and reproduction identities.

def interpolationDegree reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

A coordinate-specific degree map determines the uniform interpolation degree. The degree is the sum of the coordinatewise Jackson degree bounds.

Definition (Lean source)
ι :
Type u_1
shared
d :
ι → ℕ
interpolationDegree d :
ℕ
∑ i, 2 * (d i - 1)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.interpolationDegree · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensorInterpolation.lean:25
abbrev GridIndex reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

A coordinate-specific degree map determines the type of bounded tensor interpolation indices. An index chooses one grid position in every coordinate.

Definition (Lean source)
ι :
Type u_1
shared
d :
ι → ℕ
GridIndex d :
Type u_1
ι → Fin (interpolationDegree d + 1)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.GridIndex · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensorInterpolation.lean:29
def gridPoint reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

A coordinate-specific degree map and a tensor interpolation index determine the corresponding tensor-grid point. The point uses the fixed equispaced node in every coordinate.

Definition (Lean source)
ι :
Type u_1
shared
d :
ι → ℕ
b :
gridPoint d b :
ι → ℝ
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.gridPoint · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensorInterpolation.lean:33 · uses GridIndex
def gridWeight reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

A coordinate-specific degree map, a target coefficient index, and a grid-value index determine the tensor interpolation weight. The weight is the product of the one-dimensional recovery weights.

Definition (Lean source)
ι :
Type u_1
shared
d :
ι → ℕ
a b :
gridWeight d a b :
ℝ
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.gridWeight · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensorInterpolation.lean:38 · uses GridIndex
def exponent reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

A coordinate-specific degree map and a tensor interpolation index determine the corresponding finitely supported monomial exponent. The exponent records the selected index in every coordinate.

Definition (Lean source)
ι :
Type u_1
shared
d :
ι → ℕ
a :
exponent d a :
ι →₀ ℕ
Finsupp.equivFunOnFinite.symm (fun i => (a i : ℕ))
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.exponent · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensorInterpolation.lean:43 · uses GridIndex
def interpolate reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

A coordinate-specific degree map and values on its tensor grid determine the explicit tensor interpolation polynomial. The polynomial is the finite monomial sum with fixed-grid recovery coefficients.

Definition (Lean source)
ι :
Type u_1
shared
d :
ι → ℕ
v :
GridIndex d → ℝ
interpolate d v :
∑ a : GridIndex d, monomial (exponent d a) (∑ b : GridIndex d, gridWeight d a b * v b)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.interpolate · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensorInterpolation.lean:48 · uses GridIndex
theorem interpolate_eval reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

A coordinate-specific degree map, a multivariate polynomial, its coordinatewise interpolation-degree bounds, and an evaluation point imply that interpolation from the fixed tensor grid reproduces the polynomial at that point.

Formal statement
ι :
Type u_1
shared
d :
ι → ℕ
p :
hp :
∀ i, p.degreeOf i ≤ interpolationDegree d
x :
ι → ℝ
eval x (interpolate d (fun b => eval (gridPoint d b) p))
= eval x p
Proof (Lean source)
theorem interpolate_eval (d : ι → ℕ) (p : MvPolynomial ι ℝ) (hp : ∀ i, p.degreeOf i ≤ interpolationDegree d) (x : ι → ℝ) : eval x (interpolate d (fun b => eval (gridPoint d b) p)) = eval x p := by classical let D := interpolationDegree d let e : ι ≃ Fin (card ι) := Fintype.equivFin ι let E : GridIndex d ≃ (Fin (card ι) → Fin (D + 1)) := Equiv.piCongrLeft' (fun _ => Fin (D + 1)) e let q : MvPolynomial (Fin (card ι)) ℝ := MvPolynomial.rename e p have hdeg : ∀ j, q.degreeOf j ≤ D := by intro j change degreeOf j (MvPolynomial.rename e p) ≤ interpolationDegree d conv_lhs => rw [← e.apply_symm_apply j, MvPolynomial.degreeOf_rename_of_injective e.injective] exact hp (e.symm j) have hrec (a : GridIndex d) : p.coeff (exponent d a) = ∑ b : GridIndex d, gridWeight d a b * eval (gridPoint d b) p := by have he : (exponent d a).mapDomain e = tensorExponent (E a) := by ext j simp [exponent, tensorExponent, E, Finsupp.mapDomain_equiv_apply] have hc : tensorCoeffs q (E a) = p.coeff (exponent d a) := by rw [tensorCoeffs, ← he] exact MvPolynomial.coeff_rename_mapDomain e e.injective p (exponent d a) rw [← hc, tensorGrid_coeff_recovery q hdeg (E a)] rw [← E.sum_comp] apply Finset.sum_congr rfl intro b _ have hw : tensorGridWeight (E a) (E b) = gridWeight d a b := by simp only [tensorGridWeight, gridWeight] rw [← e.prod_comp] simp [E, D] have hv : eval (tensorGridPoint (E b)) q = eval (gridPoint d b) p := by change eval (tensorGridPoint (E b)) (MvPolynomial.rename e p) = _ rw [MvPolynomial.eval_rename] have hpoint : tensorGridPoint (E b) ∘ e = gridPoint d b := by funext i simp [tensorGridPoint, gridPoint, E, D] rw [hpoint] rw [hw, hv] have hpoly : interpolate d (fun b => eval (gridPoint d b) p) = p := by apply MvPolynomial.ext intro γ by_cases hb : ∀ i, γ i ≤ D · let a : GridIndex d := fun i => ⟨γ i, Nat.lt_succ_of_le (hb i)⟩ have ha : exponent d a = γ := by ext i simp [exponent, a] rw [← ha, coeff_interpolate] exact (hrec a).symm · push Not at hb obtain ⟨i, hi⟩ := hb rw [coeff_interpolate_eq_zero d _ γ ⟨i, hi⟩] symm apply MvPolynomial.notMem_support_iff.mp intro hmem exact (not_le_of_gt hi) ((MvPolynomial.degreeOf_le_iff.mp (hp i)) γ hmem) rw [hpoly]
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.interpolate_eval · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensorInterpolation.lean:92 · uses GridIndex , gridPoint , interpolate , interpolationDegree
2 supporting declarations (lemmas, instances)
Interp 4 core · 2 supporting For the Szegő differential inequality one compares the trigonometric transform Q(t) = R(cos t) with the *comparison interpolant* at a base point t₀, S(t) = Q₀ · cos(β(t − t₀)) + (Q₁/β) · sin(β(t − t₀)), where Q₀ = Q(t₀) ★ szegoInterp_hasDerivAt★ szegoInterp_amplitude★ szegoInterp_abs_le

The Szegő comparison interpolant

For the Szegő differential inequality one compares the trigonometric transform Q(t) = R(cos t) with the comparison interpolant at a base point t₀,

S(t) = Q₀ · cos(β(t − t₀)) + (Q₁/β) · sin(β(t − t₀)),

where Q₀ = Q(t₀) and Q₁ = Q'(t₀). For β ≥ 1 this S matches value and derivative of Q at t₀, has constant amplitude A = √(Q₀² + (Q₁/β)²), and is an "elementary wave" A · cos(β(t − t₀) − φ). This file collects those purely analytic facts (no zero-counting); the trigonometric-polynomial membership of S and the final comparison live in Szego.

  • szegoInterp — the interpolant.
  • szegoInterp_self — S(t₀) = Q₀.
  • szegoInterp_hasDerivAt — S'(t₀) = Q₁ (for β ≥ 1).
  • szegoInterp_amplitude — S(t) = A · cos(β(t − t₀) − φ) for a phase φ.
  • szegoInterp_abs_le — |S(t)| ≤ A.

## Standard reference Szegő's inequality; Rivlin, The Chebyshev Polynomials (1974); DeVore–Lorentz, Constructive Approximation (1993), Ch. 4 (Bernstein–Szegő).

def szegoInterp reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

For a nonnegative integer frequency, a prescribed value, a prescribed derivative, a real base point, and a real argument, the Szegő comparison interpolant is Q0cos⁡(β(t−t0))+(Q1/β)sin⁡(β(t−t0))Q₀\cos(β(t-t₀))+(Q₁/β)\sin(β(t-t₀)).

Definition (Lean source)
β :
ℕ
Q₀ Q₁ t₀ :
ℝ
t :
ℝ
szegoInterp β Q₀ Q₁ t₀ t :
ℝ
Q₀ * cos ((β : ℝ) * (t - t₀)) + (Q₁ / (β : ℝ)) * sin ((β : ℝ) * (t - t₀))
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szegoInterp · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Interp.lean:44
theorem szegoInterp_hasDerivAt reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

The Szegő comparison interpolant built from a frequency, a prescribed value and derivative, and a base point reproduces the prescribed derivative at that base point, provided the frequency is at least one.

Formal statement
β :
ℕ
hβ :
1 ≤ β
Q₀ Q₁ t₀ :
ℝ
HasDerivAt (fun t => szegoInterp β Q₀ Q₁ t₀ t) Q₁ t₀
Proof (Lean source)
theorem szegoInterp_hasDerivAt (β : ℕ) (hβ : 1 ≤ β) (Q₀ Q₁ t₀ : ℝ) : HasDerivAt (fun t => szegoInterp β Q₀ Q₁ t₀ t) Q₁ t₀ := by let c : ℝ := β have hc : c ≠ 0 := by have hβne : β ≠ 0 := Nat.one_le_iff_ne_zero.mp hβ have hβneR : (β : ℝ) ≠ 0 := by exact_mod_cast hβne simpa [c] using hβneR have hu : HasDerivAt (fun t : ℝ => c * (t - t₀)) c t₀ := by simpa [c] using (((hasDerivAt_id t₀).sub_const t₀).const_mul c) have hcos : HasDerivAt (fun t : ℝ => cos (c * (t - t₀))) 0 t₀ := by have h0 := (Real.hasDerivAt_cos (c * (t₀ - t₀))).comp t₀ hu have h : HasDerivAt (fun t : ℝ => cos (c * (t - t₀))) (-sin (c * (t₀ - t₀)) * c) t₀ := h0 simpa using h have hsin : HasDerivAt (fun t : ℝ => sin (c * (t - t₀))) c t₀ := by have h0 := (Real.hasDerivAt_sin (c * (t₀ - t₀))).comp t₀ hu have h : HasDerivAt (fun t : ℝ => sin (c * (t - t₀))) (cos (c * (t₀ - t₀)) * c) t₀ := h0 simpa using h have hsum : HasDerivAt (fun t : ℝ => Q₀ * cos (c * (t - t₀)) + (Q₁ / c) * sin (c * (t - t₀))) Q₁ t₀ := by have h : HasDerivAt (fun t : ℝ => Q₀ * cos (c * (t - t₀)) + (Q₁ / c) * sin (c * (t - t₀))) _ t₀ := (hcos.const_mul Q₀).fun_add (hsin.const_mul (Q₁ / c)) simpa [hc] using h simpa [szegoInterp, c] using hsum
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szegoInterp_hasDerivAt · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Interp.lean:65 · uses szegoInterp
theorem szegoInterp_amplitude reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

For a degree parameter and a prescribed value, derivative, and base point, the Szegő interpolant is a phase-shifted cosine wave whose amplitude is the Euclidean norm of its cosine and sine coefficients.

Formal statement
β :
ℕ
Q₀ Q₁ t₀ :
ℝ
∃ φ : ℝ,
∀ t,
szegoInterp β Q₀ Q₁ t₀ t
= sqrt (Q₀ ^ 2 + (Q₁ / (β : ℝ)) ^ 2) * cos ((β : ℝ) * (t - t₀) - φ)
Proof (Lean source)
theorem szegoInterp_amplitude (β : ℕ) (Q₀ Q₁ t₀ : ℝ) : ∃ φ : ℝ, ∀ t, szegoInterp β Q₀ Q₁ t₀ t = sqrt (Q₀ ^ 2 + (Q₁ / (β : ℝ)) ^ 2) * cos ((β : ℝ) * (t - t₀) - φ) := by simpa [szegoInterp] using szegoInterp_amplitude_core (β : ℝ) Q₀ (Q₁ / (β : ℝ)) t₀
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szegoInterp_amplitude · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Interp.lean:136 · uses szegoInterp
theorem szegoInterp_abs_le reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

For a degree parameter β and values Q₀, Q₁, base point t₀, and evaluation point t, the Szegő interpolant's value is bounded in absolute value by its amplitude A = √(Q₀² + (Q₁/β)²).

Formal statement
β :
ℕ
Q₀ Q₁ t₀ t :
ℝ
|szegoInterp β Q₀ Q₁ t₀ t| ≤ sqrt (Q₀ ^ 2 + (Q₁ / (β : ℝ)) ^ 2)
Proof (Lean source)
theorem szegoInterp_abs_le (β : ℕ) (Q₀ Q₁ t₀ t : ℝ) : |szegoInterp β Q₀ Q₁ t₀ t| ≤ sqrt (Q₀ ^ 2 + (Q₁ / (β : ℝ)) ^ 2) := by obtain ⟨φ, hφ⟩ := szegoInterp_amplitude β Q₀ Q₁ t₀ rw [hφ t, abs_mul] have hA : 0 ≤ sqrt (Q₀ ^ 2 + (Q₁ / (β : ℝ)) ^ 2) := Real.sqrt_nonneg _ calc |sqrt (Q₀ ^ 2 + (Q₁ / (β : ℝ)) ^ 2)| * |cos ((β : ℝ) * (t - t₀) - φ)| ≤ |sqrt (Q₀ ^ 2 + (Q₁ / (β : ℝ)) ^ 2)| * 1 := by apply mul_le_mul_of_nonneg_left (abs_cos_le_one _) (abs_nonneg _) _ = sqrt (Q₀ ^ 2 + (Q₁ / (β : ℝ)) ^ 2) := by rw [mul_one, abs_of_nonneg hA]
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szegoInterp_abs_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Interp.lean:146 · uses szegoInterp
2 supporting declarations (lemmas, instances)
  • szegoInterp_self theorem — For a degree parameter β and a prescribed value, derivative, and base point, the Szegő interpolant reproduces its prescribed value at the base point.
    β :
    ℕ
    Q₀ Q₁ t₀ :
    ℝ
    szegoInterp β Q₀ Q₁ t₀ t₀ = Q₀
    Proof (Lean source)
    theorem szegoInterp_self (β : ℕ) (Q₀ Q₁ t₀ : ℝ) : szegoInterp β Q₀ Q₁ t₀ t₀ = Q₀ := by simp [szegoInterp]
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szegoInterp_self · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Interp.lean:58
  • szegoInterp_amplitude_core theorem — A cosine-sine wave with a real frequency, cosine and sine coefficients, and a base point can be expressed as a phase-shifted cosine wave whose amplitude is the Euclidean norm of the two coefficients.
    ω :
    ℝ
    Q₀ q t₀ :
    ℝ
    ∃ φ : ℝ,
    ∀ t,
    Q₀ * cos (ω * (t - t₀)) + q * sin (ω * (t - t₀))
    = sqrt (Q₀ ^ 2 + q ^ 2) * cos (ω * (t - t₀) - φ)
    Proof (Lean source)
    theorem szegoInterp_amplitude_core (ω : ℝ) (Q₀ q t₀ : ℝ) : ∃ φ : ℝ, ∀ t, Q₀ * cos (ω * (t - t₀)) + q * sin (ω * (t - t₀)) = sqrt (Q₀ ^ 2 + q ^ 2) * cos (ω * (t - t₀) - φ) := by let z : ℂ := ⟨Q₀, q⟩ refine ⟨Complex.arg z, ?_⟩ intro t let x : ℝ := ω * (t - t₀) have hnorm : ‖z‖ = sqrt (Q₀ ^ 2 + q ^ 2) := by simp [z, Complex.norm_def, Complex.normSq_mk, pow_two] have hcos : ‖z‖ * cos (Complex.arg z) = Q₀ := by simp [z] have hsin : ‖z‖ * sin (Complex.arg z) = q := by simp [z] calc Q₀ * cos (ω * (t - t₀)) + q * sin (ω * (t - t₀)) = Q₀ * cos x + q * sin x := by simp [x] _ = (‖z‖ * cos (Complex.arg z)) * cos x + (‖z‖ * sin (Complex.arg z)) * sin x := by rw [hcos, hsin] _ = ‖z‖ * cos (x - Complex.arg z) := by rw [Real.cos_sub] ring _ = sqrt (Q₀ ^ 2 + q ^ 2) * cos (ω * (t - t₀) - Complex.arg z) := by rw [hnorm]
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szegoInterp_amplitude_core · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Interp.lean:102
Trig­Extraction 3 core · 3 supporting This module converts finite even trigonometric polynomials into ordinary polynomials in the cosine coordinate, proves the converse construction, and controls coefficient growth in the Chebyshev basis. ★ even_trigPoly_exists_polynomial

Extracting algebraic polynomials from even trigonometric polynomials

This module converts finite even trigonometric polynomials into ordinary polynomials in the cosine coordinate, proves the converse construction, and controls coefficient growth in the Chebyshev basis.

abbrev IsTrigPolyLE reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

A frequency limit and a real-valued function determine the assertion that the function is a real trigonometric polynomial within that limit. It is an abbreviation of Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE, re-exposed in this namespace.

Definition (Lean source)
n :
ℕ
shared
f :
ℝ → ℝ
shared
IsTrigPolyLE n f :
Prop
Causalean.Mathlib.Analysis.JacksonApproximation.IsTrigPolyLE · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigExtraction.lean:19
def polyCoeffL1 reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

A real polynomial determines its coefficient one-norm, the sum of the absolute values of its nonzero coefficients.

Definition (Lean source)
p :
polyCoeffL1 p :
ℝ
∑ n ∈ p.support, |p.coeff n|
Causalean.Mathlib.Analysis.JacksonApproximation.polyCoeffL1 · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigExtraction.lean:27
theorem even_trigPoly_exists_polynomial reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

Given a frequency limit and a real function, if the function is a trigonometric polynomial within that limit and is symmetric about zero, then it is an ordinary polynomial in the cosine coordinate with degree at most that limit.

Formal statement
n :
ℕ
q :
ℝ → ℝ
hq :
IsTrigPolyLE n q
heven :
∃ p : Polynomial ℝ,
p.natDegree ≤ n
conclusion 1
t :
ℝ
p.eval (cos t) = q t
Proof (Lean source)
theorem even_trigPoly_exists_polynomial {n : ℕ} {q : ℝ → ℝ} (hq : IsTrigPolyLE n q) (heven : Even q) : ∃ p : Polynomial ℝ, p.natDegree ≤ n ∧ ∀ t : ℝ, p.eval (cos t) = q t := by classical rcases hq with ⟨a, b, hq⟩ let p : Polynomial ℝ := ∑ k ∈ range (n + 1), C (a k) * T ℝ (k : ℤ) refine ⟨p, ?_, ?_⟩ · dsimp [p] apply Polynomial.natDegree_sum_le_of_forall_le intro k hk refine (Polynomial.natDegree_C_mul_le _ _).trans ?_ rw [Polynomial.Chebyshev.natDegree_T, Int.natAbs_natCast] exact le_of_lt_succ (Finset.mem_range.mp hk) · intro t have ht := hq t have hnt := hq (-t) rw [heven t] at hnt simp only [mul_neg, Real.cos_neg, Real.sin_neg] at hnt have hnt' : q t = ∑ k ∈ range (n + 1), (a k * cos ((k : ℝ) * t) - b k * sin ((k : ℝ) * t)) := by simpa [sub_eq_add_neg] using hnt -- Averaging the identities at `t` and `-t` cancels every sine term. have hcos : q t = ∑ k ∈ range (n + 1), a k * cos ((k : ℝ) * t) := by calc q t = (q t + q t) / 2 := by ring _ = ((∑ k ∈ range (n + 1), (a k * cos ((k : ℝ) * t) + b k * sin ((k : ℝ) * t))) + (∑ k ∈ range (n + 1), (a k * cos ((k : ℝ) * t) - b k * sin ((k : ℝ) * t)))) / 2 := by rw [← ht, ← hnt'] _ = ∑ k ∈ range (n + 1), a k * cos ((k : ℝ) * t) := by rw [← Finset.sum_add_distrib, Finset.sum_div] apply Finset.sum_congr rfl intro k _ ring rw [hcos] dsimp [p] rw [Polynomial.eval_finsetSum] apply Finset.sum_congr rfl intro k _ rw [Polynomial.eval_C_mul, Polynomial.Chebyshev.T_real_cos] norm_num
Causalean.Mathlib.Analysis.JacksonApproximation.even_trigPoly_exists_polynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigExtraction.lean:100 · uses IsTrigPolyLE
3 supporting declarations (lemmas, instances)
  • polynomial_cos_is_even_trigPoly theorem — Given a frequency limit and a real polynomial whose degree is at most that limit, composition with cosine is an even trigonometric polynomial within the same frequency limit.
    n :
    ℕ
    p :
    hp :
    p.natDegree ≤ n
    conclusion 1
    IsTrigPolyLE n (fun t => p.eval (cos t))
    conclusion 2
    Even (fun t => p.eval (cos t))
    Proof (Lean source)
    theorem polynomial_cos_is_even_trigPoly {n : ℕ} (p : Polynomial ℝ) (hp : p.natDegree ≤ n) : IsTrigPolyLE n (fun t => p.eval (cos t)) ∧ Even (fun t => p.eval (cos t)) := by refine ⟨Causalean.Mathlib.Analysis.BernsteinSzegoTrig.cosComp_isTrigPolyLE p n hp, ?_⟩ intro t simp
    Causalean.Mathlib.Analysis.JacksonApproximation.polynomial_cos_is_even_trigPoly · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigExtraction.lean:151
  • chebyshev_coeffL1_le theorem — For a nonnegative integer index, the coefficient one-norm of the corresponding first-kind Chebyshev polynomial is at most three to that index.
    n :
    ℕ
    polyCoeffL1 (T ℝ (n : ℤ)) ≤ (3 : ℝ) ^ n
    Proof (Lean source)
    theorem chebyshev_coeffL1_le (n : ℕ) : polyCoeffL1 (T ℝ (n : ℤ)) ≤ (3 : ℝ) ^ n := by induction n using Nat.twoStepInduction with | zero => change polyCoeffL1 (T ℝ 0) ≤ 1 rw [Polynomial.Chebyshev.T_zero, polyCoeffL1_eq_sum_range_of_natDegree_lt (1 : Polynomial ℝ) (m := 1) (by simp)] simp | one => norm_num only [Nat.cast_one, pow_one] rw [Polynomial.Chebyshev.T_one, polyCoeffL1_eq_sum_range_of_natDegree_lt X (m := 2) (by simp)] norm_num [Finset.sum_range_succ, Polynomial.coeff_X] | more n hn hn1 => have hT : T ℝ ((n + 2 : ℕ) : ℤ) = (2 : ℝ) • (X * T ℝ ((n + 1 : ℕ) : ℤ)) - T ℝ (n : ℤ) := by convert Polynomial.Chebyshev.T_add_two ℝ (n : ℤ) using 1 · norm_num · simp only [Polynomial.smul_eq_C_mul] norm_num rw [Polynomial.C_ofNat] ring rw [hT] calc polyCoeffL1 ((2 : ℝ) • (X * T ℝ ((n + 1 : ℕ) : ℤ)) - T ℝ (n : ℤ)) ≤ polyCoeffL1 ((2 : ℝ) • (X * T ℝ ((n + 1 : ℕ) : ℤ))) + polyCoeffL1 (T ℝ (n : ℤ)) := polyCoeffL1_sub_le _ _ _ = 2 * polyCoeffL1 (T ℝ ((n + 1 : ℕ) : ℤ)) + polyCoeffL1 (T ℝ (n : ℤ)) := by rw [polyCoeffL1_smul, polyCoeffL1_X_mul] norm_num _ ≤ 2 * (3 : ℝ) ^ (n + 1) + (3 : ℝ) ^ n := by gcongr _ = 7 * (3 : ℝ) ^ n := by rw [pow_succ] ring _ ≤ 9 * (3 : ℝ) ^ n := by gcongr norm_num _ = (3 : ℝ) ^ (n + 2) := by rw [show n + 2 = (n + 1) + 1 by omega, pow_succ, pow_succ] ring
    Causalean.Mathlib.Analysis.JacksonApproximation.chebyshev_coeffL1_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigExtraction.lean:163
  • cosine_sum_exists_polynomial theorem — Given a frequency limit n and real cosine coefficients, there is a real polynomial of degree at most n whose value at the cosine of every angle t equals the cosine sum of the coefficients over frequencies 0 through n at t, and whose coefficients have absolute values summing to at most the sum over frequencies k of the absolute k-th coefficient times 3 to the power k.
    n :
    ℕ
    a :
    ℕ → ℝ
    ∃ p : Polynomial ℝ,
    p.natDegree ≤ n
    conclusion 1
    t :
    ℝ
    p.eval (cos t) = ∑ k ∈ range (n + 1), a k * cos ((k : ℝ) * t)
    conclusion 2
    polyCoeffL1 p ≤ ∑ k ∈ range (n + 1), |a k| * (3 : ℝ) ^ k
    Proof (Lean source)
    theorem cosine_sum_exists_polynomial (n : ℕ) (a : ℕ → ℝ) : ∃ p : Polynomial ℝ, p.natDegree ≤ n ∧ (∀ t : ℝ, p.eval (cos t) = ∑ k ∈ range (n + 1), a k * cos ((k : ℝ) * t)) ∧ polyCoeffL1 p ≤ ∑ k ∈ range (n + 1), |a k| * (3 : ℝ) ^ k := by classical let p : Polynomial ℝ := ∑ k ∈ range (n + 1), C (a k) * T ℝ (k : ℤ) refine ⟨p, ?_, ?_, ?_⟩ · dsimp [p] apply Polynomial.natDegree_sum_le_of_forall_le intro k hk refine (Polynomial.natDegree_C_mul_le _ _).trans ?_ rw [Polynomial.Chebyshev.natDegree_T, Int.natAbs_natCast] exact le_of_lt_succ (Finset.mem_range.mp hk) · intro t dsimp [p] rw [Polynomial.eval_finsetSum] apply Finset.sum_congr rfl intro k _ rw [Polynomial.eval_C_mul, Polynomial.Chebyshev.T_real_cos] norm_num · dsimp [p] calc polyCoeffL1 (∑ k ∈ range (n + 1), C (a k) * T ℝ (k : ℤ)) ≤ ∑ k ∈ range (n + 1), polyCoeffL1 (C (a k) * T ℝ (k : ℤ)) := polyCoeffL1_sum_le _ _ _ = ∑ k ∈ range (n + 1), |a k| * polyCoeffL1 (T ℝ (k : ℤ)) := by apply Finset.sum_congr rfl intro k _ rw [Polynomial.C_mul', polyCoeffL1_smul] _ ≤ ∑ k ∈ range (n + 1), |a k| * (3 : ℝ) ^ k := by exact Finset.sum_le_sum fun k _ => mul_le_mul_of_nonneg_left (chebyshev_coeffL1_le k) (abs_nonneg (a k))
    Causalean.Mathlib.Analysis.JacksonApproximation.cosine_sum_exists_polynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TrigExtraction.lean:215
Absolute­Value 4 core · 10 supporting This module exposes the fixed even Chebyshev polynomial that approximates absolute value on the unit interval, together with its exact error, monomial-coefficient, and even-degree bounds. ★ absChebPoly_error_le★ absChebPoly_halfDegree_error_le★ absChebPoly_halfDegree_coeff_le

Explicit Chebyshev truncation for absolute value

This module exposes the fixed even Chebyshev polynomial that approximates absolute value on the unit interval, together with its exact error, monomial-coefficient, and even-degree bounds. The Fourier-series proof is reused from the general absolute-value approximation infrastructure.

abbrev absChebPoly reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue

A truncation length m determines the explicit even Chebyshev polynomial approximating absolute value on the interval from −1 to 1: the constant 2/π plus the sum over j from 1 to m of (4/π)·(−1)^(j+1)/(4j² − 1) times the first-kind Chebyshev polynomial of degree 2j, that is, the Chebyshev series of |x| truncated after m even modes.

Definition (Lean source)
m :
ℕ
absChebPoly m :
Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.absChebPoly · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:24
theorem absChebPoly_error_le reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue

For a truncation length m and a point x in the closed interval from −1 to 1, the truncated Chebyshev polynomial for absolute value differs from |x| by at most 2/(π(2m + 1)) in absolute value.

Formal statement
m :
ℕ
x :
ℝ
hx :
x ∈ Icc (-1 : ℝ) 1
abs ((absChebPoly m).eval x - abs x) ≤ 2 / (pi * (2 * (m : ℝ) + 1))
Proof (Lean source)
theorem absChebPoly_error_le (m : ℕ) {x : ℝ} (hx : x ∈ Icc (-1 : ℝ) 1) : abs ((absChebPoly m).eval x - abs x) ≤ 2 / (pi * (2 * (m : ℝ) + 1)) := by rw [abs_sub_comm] exact absChebPoly_error_le m hx
Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.absChebPoly_error_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:51 · uses absChebPoly
theorem absChebPoly_halfDegree_error_le reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue

For an even natural degree D and a point x in the closed interval from −1 to 1, the truncated Chebyshev polynomial for absolute value with D/2 even modes differs from |x| by at most 2/(π(D + 1)) in absolute value.

Formal statement
D :
ℕ
hD :
Even D
x :
ℝ
hx :
x ∈ Icc (-1 : ℝ) 1
abs ((absChebPoly (D / 2)).eval x - abs x) ≤ 2 / (pi * ((D : ℝ) + 1))
Proof (Lean source)
theorem absChebPoly_halfDegree_error_le (D : ℕ) (hD : Even D) {x : ℝ} (hx : x ∈ Icc (-1 : ℝ) 1) : abs ((absChebPoly (D / 2)).eval x - abs x) ≤ 2 / (pi * ((D : ℝ) + 1)) := by have hr : (2 : ℝ) * (D / 2 : ℕ) = (D : ℝ) := by exact_mod_cast two_mul_halfDegree D hD simpa only [hr] using absChebPoly_error_le (D / 2) hx
Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.absChebPoly_halfDegree_error_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:204 · uses absChebPoly
theorem absChebPoly_halfDegree_coeff_le reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue

For an even degree D and a monomial index k, the k-th monomial coefficient of the truncated Chebyshev polynomial for absolute value with D/2 even modes is at most 2^(3D/2) in absolute value.

Formal statement
D :
ℕ
hD :
Even D
k :
ℕ
|(absChebPoly (D / 2)).coeff k| ≤ (2 : ℝ) ^ ((3 : ℝ) * (D : ℝ) / 2)
Proof (Lean source)
theorem absChebPoly_halfDegree_coeff_le (D : ℕ) (hD : Even D) (k : ℕ) : |(absChebPoly (D / 2)).coeff k| ≤ (2 : ℝ) ^ ((3 : ℝ) * (D : ℝ) / 2) := by rw [← coefficientConstant_eq_rpow D hD] exact absChebPoly_coeff_le (D / 2) k
Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.absChebPoly_halfDegree_coeff_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:212 · uses absChebPoly
10 supporting declarations (lemmas, instances)
  • absChebPoly_eq theorem — A truncation length gives the constant two over π followed by its first even Chebyshev modes with their exact alternating coefficients.
    m :
    ℕ
    absChebPoly m
    = C (2 / pi)
    + ∑ j ∈ range m, C ((4 / pi) * (-1 : ℝ) ^ j / (4 * ((j + 1 : ℕ) : ℝ) ^ 2 - 1)) * T ℝ (2 * (j + 1) : ℕ)
    Proof (Lean source)
    theorem absChebPoly_eq (m : ℕ) : absChebPoly m = C (2 / pi) + ∑ j ∈ range m, C ((4 / pi) * (-1 : ℝ) ^ j / (4 * ((j + 1 : ℕ) : ℝ) ^ 2 - 1)) * T ℝ (2 * (j + 1) : ℕ) := by simp only [absChebPoly, absChebPoly, Polynomial.smul_eq_C_mul]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.absChebPoly_eq · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:28
  • absChebPoly_eval theorem — A truncation length and argument give the value of the explicit truncation as its finite even Chebyshev expansion.
    m :
    ℕ
    x :
    ℝ
    (absChebPoly m).eval x
    = 2 / pi
    + ∑ j ∈ range m, (4 / pi) * (-1 : ℝ) ^ j * (T ℝ (2 * (j + 1) : ℕ)).eval x / (4 * ((j + 1 : ℕ) : ℝ) ^ 2 - 1)
    Proof (Lean source)
    theorem absChebPoly_eval (m : ℕ) (x : ℝ) : (absChebPoly m).eval x = 2 / pi + ∑ j ∈ range m, (4 / pi) * (-1 : ℝ) ^ j * (T ℝ (2 * (j + 1) : ℕ)).eval x / (4 * ((j + 1 : ℕ) : ℝ) ^ 2 - 1) := by exact absChebPoly_eval m x
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.absChebPoly_eval · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:38
  • absChebPoly_natDegree_le theorem — A truncation length gives a polynomial whose degree is at most twice that length.
    m :
    ℕ
    (absChebPoly m).natDegree ≤ 2 * m
    Proof (Lean source)
    theorem absChebPoly_natDegree_le (m : ℕ) : (absChebPoly m).natDegree ≤ 2 * m := absChebPoly_natDegree_le m
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.absChebPoly_natDegree_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:47
  • absChebPoly_eq_sum_Icc theorem — A truncation length gives the same explicit polynomial written with one-based Chebyshev mode indices.
    m :
    ℕ
    absChebPoly m
    = C (2 / pi)
    + ∑ v ∈ Icc 1 m, C ((4 / pi) * (-1 : ℝ) ^ (v + 1) / (4 * (v : ℝ) ^ 2 - 1)) * T ℝ (2 * v : ℕ)
    Proof (Lean source)
    theorem absChebPoly_eq_sum_Icc (m : ℕ) : absChebPoly m = C (2 / pi) + ∑ v ∈ Icc 1 m, C ((4 / pi) * (-1 : ℝ) ^ (v + 1) / (4 * (v : ℝ) ^ 2 - 1)) * T ℝ (2 * v : ℕ) := by rw [absChebPoly_eq] congr 1 induction m with | zero => simp | succ m ih => rw [Finset.sum_range_succ, Finset.sum_Icc_succ_top (by omega)] rw [ih] have hsign : (-1 : ℝ) ^ (m + 1 + 1) = (-1 : ℝ) ^ m := by rw [pow_succ, pow_succ] ring simp only [hsign]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.absChebPoly_eq_sum_Icc · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:57
  • absChebPoly_coeffOneNorm_le theorem — Any truncation length gives a polynomial whose monomial coefficient one-norm is at most two to the power three times that length.
    m :
    ℕ
    polynomialCoeffOneNorm (absChebPoly m) ≤ (2 : ℝ) ^ (3 * m)
    Proof (Lean source)
    theorem absChebPoly_coeffOneNorm_le (m : ℕ) : polynomialCoeffOneNorm (absChebPoly m) ≤ (2 : ℝ) ^ (3 * m) := by classical have hadd (p q : Polynomial ℝ) : polynomialCoeffOneNorm (p + q) ≤ polynomialCoeffOneNorm p + polynomialCoeffOneNorm q := by let n := max p.natDegree q.natDegree + 1 rw [polynomialCoeffOneNorm_range (p + q) (m := n) (lt_of_le_of_lt (Polynomial.natDegree_add_le _ _) (lt_succ_self _)), polynomialCoeffOneNorm_range p (lt_of_le_of_lt (le_max_left _ _) (lt_succ_self _)), polynomialCoeffOneNorm_range q (lt_of_le_of_lt (le_max_right _ _) (lt_succ_self _)), ← Finset.sum_add_distrib] exact Finset.sum_le_sum fun i _ => by simpa only [Polynomial.coeff_add] using abs_add_le (p.coeff i) (q.coeff i) have hC (c : ℝ) : polynomialCoeffOneNorm (C c) = |c| := by rw [polynomialCoeffOneNorm_range _ (m := 1) (by simp)] simp have hmode (j : ℕ) : polynomialCoeffOneNorm (C ((4 / pi) * (-1 : ℝ) ^ j / (4 * ((j + 1 : ℕ) : ℝ) ^ 2 - 1)) * T ℝ (2 * (j + 1) : ℕ)) ≤ 3 * (8 : ℝ) ^ j := by have hj : (1 : ℝ) ≤ ((j + 1 : ℕ) : ℝ) := by exact_mod_cast Nat.succ_le_succ (zero_le j) have hd : 3 ≤ 4 * ((j + 1 : ℕ) : ℝ) ^ 2 - 1 := by nlinarith have hdpos : 0 < 4 * ((j + 1 : ℕ) : ℝ) ^ 2 - 1 := by linarith have hc : |(4 / pi) * (-1 : ℝ) ^ j / (4 * ((j + 1 : ℕ) : ℝ) ^ 2 - 1)| ≤ (1 / 2 : ℝ) := by rw [abs_div, abs_mul, abs_pow] norm_num only [abs_neg, abs_one, one_pow, mul_one] rw [abs_of_pos (by positivity : (0 : ℝ) < 4 / pi), abs_of_pos hdpos] apply (div_le_iff₀ hdpos).2 have hpi : 4 / pi ≤ (4 / 3 : ℝ) := div_le_div_of_nonneg_left (by norm_num) (by norm_num) Real.pi_gt_three.le linarith have hs : (1 + sqrt 2) ^ 2 ≤ (6 : ℝ) := by have hsq := Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 2) have hnonneg := Real.sqrt_nonneg (2 : ℝ) have hroot : sqrt 2 ≤ (3 / 2 : ℝ) := by nlinarith nlinarith have hpow : (1 + sqrt 2) ^ (2 * (j + 1)) ≤ (6 : ℝ) ^ (j + 1) := by rw [pow_mul] exact pow_le_pow_left₀ (by positivity) hs _ calc polynomialCoeffOneNorm _ ≤ polynomialCoeffOneNorm (C ((4 / pi) * (-1 : ℝ) ^ j / (4 * ((j + 1 : ℕ) : ℝ) ^ 2 - 1))) * polynomialCoeffOneNorm (T ℝ (2 * (j + 1) : ℕ)) := polynomialCoeffOneNorm_mul_le _ _ _ ≤ (1 / 2 : ℝ) * (1 + sqrt 2) ^ (2 * (j + 1)) := by rw [hC] apply mul_le_mul hc (polynomialCoeffOneNorm_chebyshev_le (2 * (j + 1))) · change 0 ≤ ∑ k ∈ (T ℝ (2 * (j + 1) : ℕ)).support, |(T ℝ (2 * (j + 1) : ℕ)).coeff k| exact Finset.sum_nonneg fun _ _ => abs_nonneg _ · norm_num _ ≤ (1 / 2 : ℝ) * 6 ^ (j + 1) := mul_le_mul_of_nonneg_left hpow (by norm_num) _ ≤ 3 * (8 : ℝ) ^ j := by rw [pow_succ] have hp : (6 : ℝ) ^ j ≤ (8 : ℝ) ^ j := pow_le_pow_left₀ (by norm_num) (by norm_num) _ linarith have hall (n : ℕ) : polynomialCoeffOneNorm (absChebPoly n) ≤ (8 : ℝ) ^ n := by induction n with | zero => rw [absChebPoly_eq] simp only [Finset.range_zero, Finset.sum_empty, add_zero, pow_zero, hC] rw [abs_of_pos (by positivity : (0 : ℝ) < 2 / pi)] apply (div_le_iff₀ Real.pi_pos).2 linarith [Real.pi_gt_three] | succ n ih => have heq : absChebPoly (n + 1) = absChebPoly n + C ((4 / pi) * (-1 : ℝ) ^ n / (4 * ((n + 1 : ℕ) : ℝ) ^ 2 - 1)) * T ℝ (2 * (n + 1) : ℕ) := by rw [absChebPoly_eq, absChebPoly_eq, Finset.sum_range_succ] exact (add_assoc _ _ _).symm rw [heq] calc polynomialCoeffOneNorm _ ≤ polynomialCoeffOneNorm (absChebPoly n) + polynomialCoeffOneNorm _ := hadd _ _ _ ≤ (8 : ℝ) ^ n + 3 * (8 : ℝ) ^ n := add_le_add ih (hmode n) _ ≤ (8 : ℝ) ^ (n + 1) := by rw [pow_succ] nlinarith [pow_nonneg (by norm_num : (0 : ℝ) ≤ 8) n] calc polynomialCoeffOneNorm (absChebPoly m) ≤ (8 : ℝ) ^ m := hall m _ = (2 : ℝ) ^ (3 * m) := by rw [pow_mul]; norm_num
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.absChebPoly_coeffOneNorm_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:75
  • absChebPoly_coeff_le theorem — Any truncation length and a monomial index give an absolute coefficient bound of two to the power three times the length.
    m :
    ℕ
    k :
    ℕ
    |(absChebPoly m).coeff k| ≤ (2 : ℝ) ^ (3 * m)
    Proof (Lean source)
    theorem absChebPoly_coeff_le (m : ℕ) (k : ℕ) : |(absChebPoly m).coeff k| ≤ (2 : ℝ) ^ (3 * m) := by classical have hb : |(absChebPoly m).coeff k| ≤ polynomialCoeffOneNorm (absChebPoly m) := by change |(absChebPoly m).coeff k| ≤ ∑ j ∈ (absChebPoly m).support, |(absChebPoly m).coeff j| by_cases hk : k ∈ (absChebPoly m).support · exact Finset.single_le_sum (fun j _ => abs_nonneg ((absChebPoly m).coeff j)) hk · have hzero : (absChebPoly m).coeff k = 0 := by simpa only [Polynomial.mem_support_iff, not_not] using hk rw [hzero, abs_zero] exact Finset.sum_nonneg (fun j _ => abs_nonneg ((absChebPoly m).coeff j)) exact hb.trans (absChebPoly_coeffOneNorm_le m)
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.absChebPoly_coeff_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:166
  • two_mul_halfDegree theorem — An even natural degree has degree equal to twice its half-degree.
    D :
    ℕ
    hD :
    Even D
    2 * (D / 2) = D
    Proof (Lean source)
    theorem two_mul_halfDegree (D : ℕ) (hD : Even D) : 2 * (D / 2) = D := by obtain ⟨m, hm⟩ := hD omega
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.two_mul_halfDegree · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:181
  • halfDegree_pos theorem — A natural degree at least two has a positive half-degree.
    D :
    ℕ
    hD2 :
    2 ≤ D
    1 ≤ D / 2
    Proof (Lean source)
    theorem halfDegree_pos (D : ℕ) (hD2 : 2 ≤ D) : 1 ≤ D / 2 := by omega
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.halfDegree_pos · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:186
  • coefficientConstant_eq_rpow theorem — An even natural degree has equal natural-power and real-power forms of the coefficient constant.
    D :
    ℕ
    hD :
    Even D
    (2 : ℝ) ^ (3 * (D / 2)) = (2 : ℝ) ^ ((3 : ℝ) * (D : ℝ) / 2)
    Proof (Lean source)
    theorem coefficientConstant_eq_rpow (D : ℕ) (hD : Even D) : (2 : ℝ) ^ (3 * (D / 2)) = (2 : ℝ) ^ ((3 : ℝ) * (D : ℝ) / 2) := by have hn := two_mul_halfDegree D hD have hr : (2 : ℝ) * (D / 2 : ℕ) = (D : ℝ) := by exact_mod_cast hn rw [show (3 : ℝ) * (D : ℝ) / 2 = ((3 * (D / 2) : ℕ) : ℝ) by push_cast linarith, Real.rpow_natCast]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.coefficientConstant_eq_rpow · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:190
  • absChebPoly_halfDegree_natDegree_le theorem — An even natural degree gives a half-degree truncation whose degree is at most that degree.
    D :
    ℕ
    hD :
    Even D
    (absChebPoly (D / 2)).natDegree ≤ D
    Proof (Lean source)
    theorem absChebPoly_halfDegree_natDegree_le (D : ℕ) (hD : Even D) : (absChebPoly (D / 2)).natDegree ≤ D := by simpa only [two_mul_halfDegree D hD] using absChebPoly_natDegree_le (D / 2)
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AbsoluteValue.absChebPoly_halfDegree_natDegree_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AbsoluteValue.lean:199
Affine­Four­Boundary 1 core · 4 supporting This module bounds the error of the canonical four-dimensional affine Jackson polynomial by coordinatewise boundary distance. ★ affineJackson_boundary_exists_four

Boundary-adaptive affine Jackson approximation in four dimensions

This module bounds the error of the canonical four-dimensional affine Jackson polynomial by coordinatewise boundary distance. It combines the existing positive-kernel moment estimates with a cosine displacement inequality and affine rectangle transport.

theorem affineJackson_boundary_exists_four reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.AffineFourBoundary

For a positive Jackson order K, a four-dimensional rectangle with center c and positive coordinate radii r, and a function f that is continuous on the rectangle and Lipschitz there with a constant L ≥ 0 with respect to the sum of coordinate distances, there are polynomials p and q in four variables such that: p at any point y equals q at the normalized coordinates (y − c)/r; q at the coordinatewise cosines of any angle vector equals the order-K tensor Jackson convolution of f composed with the affine map z ↦ c + r·z; every monomial of p has degree at most 2(K − 1) in each variable and p has total degree at most 8(K − 1); and at every point y of the rectangle, |p(y) − f(y)| is at most 32·L times the sum over the four coordinates i of √((y_i − (c_i − r_i))·((c_i + r_i) − y_i))/K + r_i/K².

Formal statement
K :
ℕ
hK :
0 < K
c r :
Fin 4 → ℝ
hr :
∀ i, 0 < r i
f :
(Fin 4 → ℝ) → ℝ
hf :
ContinuousOn f (centeredRectangle c r)
L :
ℝ
hL :
0 ≤ L
hlip :
∀ y ∈ centeredRectangle c r,
∀ z ∈ centeredRectangle c r, |f y - f z| ≤ L * ∑ i, |y i - z i|
∃ p q : MvPolynomial (Fin 4) ℝ,
conclusion 1
y :
eval y p = eval (normalizedPoint c r y) q
conclusion 2
x :
eval (cosPoint x) q = tensorConvolution K (fun z => f (affinePoint c r z)) x
conclusion 3
m ∈ p.support :
i :
m i ≤ 2 * (K - 1)
conclusion 4
p.totalDegree ≤ 8 * (K - 1)
conclusion 5
y ∈ centeredRectangle c r :
|eval y p - f y|
≤ 32 * L * ∑ i : Fin 4, (sqrt ((y i - (c i - r i)) * ((c i + r i) - y i)) / (K : ℝ) + r i / (K : ℝ) ^ 2)
Proof (Lean source)
theorem affineJackson_boundary_exists_four {K : ℕ} (hK : 0 < K) (c r : Fin 4 → ℝ) (hr : ∀ i, 0 < r i) (f : (Fin 4 → ℝ) → ℝ) (hf : ContinuousOn f (centeredRectangle c r)) (L : ℝ) (hL : 0 ≤ L) (hlip : ∀ y ∈ centeredRectangle c r, ∀ z ∈ centeredRectangle c r, |f y - f z| ≤ L * ∑ i, |y i - z i|) : ∃ p q : MvPolynomial (Fin 4) ℝ, (∀ y, eval y p = eval (normalizedPoint c r y) q) ∧ (∀ x, eval (cosPoint x) q = tensorConvolution K (fun z => f (affinePoint c r z)) x) ∧ (∀ m ∈ p.support, ∀ i, m i ≤ 2 * (K - 1)) ∧ p.totalDegree ≤ 8 * (K - 1) ∧ ∀ y ∈ centeredRectangle c r, |eval y p - f y| ≤ 32 * L * ∑ i : Fin 4, (sqrt ((y i - (c i - r i)) * ((c i + r i) - y i)) / (K : ℝ) + r i / (K : ℝ) ^ 2) := by obtain ⟨p, q, hpeval, hqeval, hpcoord, hptotal⟩ := affineJackson_exists_mvPolynomial_four hK c r hr f hf refine ⟨p, q, hpeval, hqeval, hpcoord, hptotal, ?_⟩ intro y hy exact affineJackson_boundary_adaptive_four hK c r hr f hf L hL hlip p q hpeval hqeval y hy
Causalean.Mathlib.Analysis.Approximation.Chebyshev.AffineFourBoundary.affineJackson_boundary_exists_four · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFourBoundary.lean:307 · uses affinePoint , centeredRectangle , cosPoint , normalizedPoint , tensorConvolution
4 supporting declarations (lemmas, instances)
  • abs_cos_add_sub_cos_le theorem — A base phase and phase displacement give a bound on the cosine displacement by its sine-weighted linear part and quadratic remainder. The estimate remains valid at endpoints, where the linear term vanishes.
    theta t :
    ℝ
    |cos (theta + t) - cos theta| ≤ |sin theta| * |t| + t ^ 2 / 2
    Proof (Lean source)
    theorem abs_cos_add_sub_cos_le (theta t : ℝ) : |cos (theta + t) - cos theta| ≤ |sin theta| * |t| + t ^ 2 / 2 := by have hcos : |cos t - 1| ≤ t ^ 2 / 2 := by rw [abs_sub_comm, abs_of_nonneg (sub_nonneg.mpr (Real.cos_le_one t))] linarith [Real.one_sub_sq_div_two_le_cos (x := t)] calc |cos (theta + t) - cos theta| = |cos theta * (cos t - 1) - sin theta * sin t| := by rw [Real.cos_add] congr 1 ring _ ≤ |cos theta * (cos t - 1)| + |sin theta * sin t| := by simpa [sub_eq_add_neg] using (abs_add_le (cos theta * (cos t - 1)) (-(sin theta * sin t))) _ = |cos theta| * |cos t - 1| + |sin theta| * |sin t| := by rw [abs_mul, abs_mul] _ ≤ |sin theta| * |t| + t ^ 2 / 2 := by have h1 := mul_le_mul_of_nonneg_left hcos (abs_nonneg (cos theta)) have h2 := mul_le_mul_of_nonneg_left (Real.abs_sin_le_abs (x := t)) (abs_nonneg (sin theta)) have h3 := Real.abs_cos_le_one theta nlinarith [sq_nonneg t]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AffineFourBoundary.abs_cos_add_sub_cos_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFourBoundary.lean:21
  • radius_mul_abs_sin_arccos_eq_boundary theorem — A rectangle center, positive coordinate radii, a point in the ambient space, and a selected coordinate identify the physical sine factor with the square root of the two face distances' product.
    c r y :
    Fin 4 → ℝ
    hr :
    ∀ i, 0 < r i
    i :
    Fin 4
    r i * |sin (arccos (normalizedPoint c r y i))|
    = sqrt ((y i - (c i - r i)) * ((c i + r i) - y i))
    Proof (Lean source)
    theorem radius_mul_abs_sin_arccos_eq_boundary (c r y : Fin 4 → ℝ) (hr : ∀ i, 0 < r i) (i : Fin 4) : r i * |sin (arccos (normalizedPoint c r y i))| = sqrt ((y i - (c i - r i)) * ((c i + r i) - y i)) := by have hrad : (y i - (c i - r i)) * ((c i + r i) - y i) = (r i) ^ 2 * (1 - normalizedPoint c r y i ^ 2) := by simp only [normalizedPoint] field_simp [ne_of_gt (hr i)] ring rw [Real.sin_arccos, abs_of_nonneg (Real.sqrt_nonneg _), hrad, Real.sqrt_mul (sq_nonneg (r i)), Real.sqrt_sq (le_of_lt (hr i))]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AffineFourBoundary.radius_mul_abs_sin_arccos_eq_boundary · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFourBoundary.lean:50
  • tensorConvolution_boundary_adaptive theorem — A positive Jackson order, a function continuous on the normalized cube, nonnegative coordinate weights, and a nonnegative Lipschitz constant with its weighted coordinate bound, evaluated at a phase point, give a tensor Jackson error bound with a boundary-adaptive first-order term and a second-order remainder.
    d K :
    ℕ
    hK :
    0 < K
    g :
    (Fin d → ℝ) → ℝ
    r :
    Fin d → ℝ
    hr :
    ∀ i, 0 ≤ r i
    L :
    ℝ
    hL :
    0 ≤ L
    hlip :
    ∀ x ∈ normalizedCube d, ∀ z ∈ normalizedCube d, |g x - g z| ≤ L * ∑ i, r i * |x i - z i|
    theta :
    Fin d → ℝ
    |tensorConvolution K g theta - g (cosPoint theta)|
    ≤ L * ∑ i : Fin d, (32 * r i * |sin (theta i)| / (K : ℝ) + 32 * r i / (K : ℝ) ^ 2)
    Proof (Lean source)
    theorem tensorConvolution_boundary_adaptive {d K : ℕ} (hK : 0 < K) (g : (Fin d → ℝ) → ℝ) (hg : ContinuousOn g (normalizedCube d)) (r : Fin d → ℝ) (hr : ∀ i, 0 ≤ r i) (L : ℝ) (hL : 0 ≤ L) (hlip : ∀ x ∈ normalizedCube d, ∀ z ∈ normalizedCube d, |g x - g z| ≤ L * ∑ i, r i * |x i - z i|) (theta : Fin d → ℝ) : |tensorConvolution K g theta - g (cosPoint theta)| ≤ L * ∑ i : Fin d, (32 * r i * |sin (theta i)| / (K : ℝ) + 32 * r i / (K : ℝ) ^ 2) := by classical have hcompact : IsCompact (periodBox d) := by rw [show periodBox d = {u | ∀ i, u i ∈ Icc (-pi) pi} by rfl] exact isCompact_pi_infinite fun _ ↦ isCompact_Icc have hcos : Continuous (fun u : Fin d → ℝ ↦ cosPoint (theta - u)) := by apply continuous_pi intro i change Continuous (fun u : Fin d → ℝ ↦ cos (theta i - u i)) fun_prop have hgcos : Continuous (fun u : Fin d → ℝ ↦ g (cosPoint (theta - u))) := by simpa [Function.comp_def] using hg.comp_continuous hcos (fun u ↦ cosPoint_mem_normalizedCube (theta - u)) have hkernel : Continuous (tensorJackson K d) := by unfold tensorJackson fun_prop have hconvInt : IntegrableOn (fun u : Fin d → ℝ ↦ g (cosPoint (theta - u)) * tensorJackson K d u) (periodBox d) := (hgcos.mul hkernel).continuousOn.integrableOn_compact hcompact have hconstInt : IntegrableOn (fun u : Fin d → ℝ ↦ g (cosPoint theta) * tensorJackson K d u) (periodBox d) := (continuous_const.mul hkernel).continuousOn.integrableOn_compact hcompact have hdiffInt : IntegrableOn (fun u : Fin d → ℝ ↦ (g (cosPoint (theta - u)) - g (cosPoint theta)) * tensorJackson K d u) (periodBox d) := ((hgcos.sub continuous_const).mul hkernel).continuousOn.integrableOn_compact hcompact have hfirstInt (i : Fin d) : IntegrableOn (fun u : Fin d → ℝ ↦ |u i| * tensorJackson K d u) (periodBox d) := by exact ((continuous_abs.comp (continuous_apply i)).mul hkernel).continuousOn |>.integrableOn_compact hcompact have hsecondInt (i : Fin d) : IntegrableOn (fun u : Fin d → ℝ ↦ (u i) ^ 2 * tensorJackson K d u) (periodBox d) := by exact (((continuous_apply i).pow 2).mul hkernel).continuousOn |>.integrableOn_compact hcompact have htermInt (i : Fin d) : IntegrableOn (fun u : Fin d → ℝ ↦ (r i * |sin (theta i)| * |u i| + r i / 2 * (u i) ^ 2) * tensorJackson K d u) (periodBox d) := by have hc : Continuous (fun u : Fin d → ℝ ↦ (r i * |sin (theta i)| * |u i| + r i / 2 * (u i) ^ 2) * tensorJackson K d u) := by fun_prop exact hc.continuousOn.integrableOn_compact hcompact have hboundInt : IntegrableOn (fun u : Fin d → ℝ ↦ L * ∑ i, (r i * |sin (theta i)| * |u i| + r i / 2 * (u i) ^ 2) * tensorJackson K d u) (periodBox d) := by have hc : Continuous (fun u : Fin d → ℝ ↦ L * ∑ i, (r i * |sin (theta i)| * |u i| + r i / 2 * (u i) ^ 2) * tensorJackson K d u) := by fun_prop exact hc.continuousOn.integrableOn_compact hcompact have hdiff : tensorConvolution K g theta - g (cosPoint theta) = ∫ u in periodBox d, (g (cosPoint (theta - u)) - g (cosPoint theta)) * tensorJackson K d u := by unfold tensorConvolution calc (∫ u in periodBox d, g (cosPoint (theta - u)) * tensorJackson K d u) - g (cosPoint theta) = (∫ u in periodBox d, g (cosPoint (theta - u)) * tensorJackson K d u) - g (cosPoint theta) * (∫ u in periodBox d, tensorJackson K d u) := by rw [tensorJackson_integral_eq_one hK, mul_one] _ = (∫ u in periodBox d, g (cosPoint (theta - u)) * tensorJackson K d u) - ∫ u in periodBox d, g (cosPoint theta) * tensorJackson K d u := by rw [integral_const_mul] _ = ∫ u in periodBox d, (g (cosPoint (theta - u)) * tensorJackson K d u - g (cosPoint theta) * tensorJackson K d u) := (integral_sub hconvInt hconstInt).symm _ = ∫ u in periodBox d, (g (cosPoint (theta - u)) - g (cosPoint theta)) * tensorJackson K d u := by apply integral_congr_ae filter_upwards intro u ring rw [hdiff] calc |∫ u in periodBox d, (g (cosPoint (theta - u)) - g (cosPoint theta)) * tensorJackson K d u| ≤ ∫ u in periodBox d, |(g (cosPoint (theta - u)) - g (cosPoint theta)) * tensorJackson K d u| := abs_integral_le_integral_abs _ ≤ ∫ u in periodBox d, L * ∑ i, (r i * |sin (theta i)| * |u i| + r i / 2 * (u i) ^ 2) * tensorJackson K d u := by apply setIntegral_mono hdiffInt.abs hboundInt intro u change |(g (cosPoint (theta - u)) - g (cosPoint theta)) * tensorJackson K d u| ≤ L * ∑ i, (r i * |sin (theta i)| * |u i| + r i / 2 * (u i) ^ 2) * tensorJackson K d u rw [abs_mul, abs_of_nonneg (tensorJackson_nonneg hK u)] calc |g (cosPoint (theta - u)) - g (cosPoint theta)| * tensorJackson K d u ≤ (L * ∑ i, r i * |(cosPoint (theta - u)) i - (cosPoint theta) i|) * tensorJackson K d u := by exact mul_le_mul_of_nonneg_right (hlip _ (cosPoint_mem_normalizedCube _) _ (cosPoint_mem_normalizedCube _)) (tensorJackson_nonneg hK u) _ ≤ (L * ∑ i, (r i * |sin (theta i)| * |u i| + r i / 2 * (u i) ^ 2)) * tensorJackson K d u := by apply mul_le_mul_of_nonneg_right _ (tensorJackson_nonneg hK u) apply mul_le_mul_of_nonneg_left _ hL apply Finset.sum_le_sum intro i _ have hi := abs_cos_add_sub_cos_le (theta i) (-u i) simp only [cosPoint, Pi.sub_apply, abs_neg, neg_sq] at hi ⊢ convert mul_le_mul_of_nonneg_left hi (hr i) using 1 <;> ring_nf _ = L * ∑ i, (r i * |sin (theta i)| * |u i| + r i / 2 * (u i) ^ 2) * tensorJackson K d u := by rw [mul_assoc, Finset.sum_mul] _ = L * ∑ i : Fin d, (r i * |sin (theta i)| * (∫ u in periodBox d, |u i| * tensorJackson K d u) + r i / 2 * (∫ u in periodBox d, (u i) ^ 2 * tensorJackson K d u)) := by rw [integral_const_mul] rw [integral_finsetSum univ (fun i _ ↦ htermInt i)] congr 1 apply Finset.sum_congr rfl intro i _ have heq (u : Fin d → ℝ) : (r i * |sin (theta i)| * |u i| + r i / 2 * (u i) ^ 2) * tensorJackson K d u = r i * |sin (theta i)| * (|u i| * tensorJackson K d u) + r i / 2 * ((u i) ^ 2 * tensorJackson K d u) := by ring simp_rw [heq] rw [integral_add, integral_const_mul, integral_const_mul] · exact (hfirstInt i).const_mul _ · exact (hsecondInt i).const_mul _ _ ≤ L * ∑ i : Fin d, (32 * r i * |sin (theta i)| / (K : ℝ) + 32 * r i / (K : ℝ) ^ 2) := by apply mul_le_mul_of_nonneg_left _ hL apply Finset.sum_le_sum intro i _ have hfirst := (tensorJackson_first_moment_eq hK i).le.trans (jackson_first_moment K hK) have hsecond := (tensorJackson_second_moment_eq hK i).le.trans (jackson_second_moment K hK) have hcoef1 : 0 ≤ r i * |sin (theta i)| := mul_nonneg (hr i) (abs_nonneg _) have hcoef2 : 0 ≤ r i / 2 := div_nonneg (hr i) (by norm_num) have h1 := mul_le_mul_of_nonneg_left hfirst hcoef1 have h2 := mul_le_mul_of_nonneg_left hsecond hcoef2 calc _ ≤ r i * |sin (theta i)| * (32 / (K : ℝ)) + r i / 2 * (64 / (K : ℝ) ^ 2) := add_le_add h1 h2 _ = _ := by ring
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AffineFourBoundary.tensorConvolution_boundary_adaptive · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFourBoundary.lean:67
  • affineJackson_boundary_adaptive_four theorem — A positive Jackson order, a centered rectangle with positive coordinate radii, a continuous physical-coordinate Lipschitz function, a polynomial pair realizing the canonical affine tensor convolution, and a point in that rectangle give a boundary-adaptive error bound for that same affine Jackson polynomial.
    K :
    ℕ
    hK :
    0 < K
    c r :
    Fin 4 → ℝ
    hr :
    ∀ i, 0 < r i
    f :
    (Fin 4 → ℝ) → ℝ
    L :
    ℝ
    hL :
    0 ≤ L
    hlip :
    ∀ y ∈ centeredRectangle c r,
    ∀ z ∈ centeredRectangle c r, |f y - f z| ≤ L * ∑ i, |y i - z i|
    p q :
    hpeval :
    ∀ y, eval y p = eval (normalizedPoint c r y) q
    hqeval :
    ∀ x,
    eval (cosPoint x) q = tensorConvolution K (fun z => f (affinePoint c r z)) x
    y :
    Fin 4 → ℝ
    hy :
    |eval y p - f y|
    ≤ 32 * L * ∑ i : Fin 4, (sqrt ((y i - (c i - r i)) * ((c i + r i) - y i)) / (K : ℝ) + r i / (K : ℝ) ^ 2)
    Proof (Lean source)
    theorem affineJackson_boundary_adaptive_four {K : ℕ} (hK : 0 < K) (c r : Fin 4 → ℝ) (hr : ∀ i, 0 < r i) (f : (Fin 4 → ℝ) → ℝ) (hf : ContinuousOn f (centeredRectangle c r)) (L : ℝ) (hL : 0 ≤ L) (hlip : ∀ y ∈ centeredRectangle c r, ∀ z ∈ centeredRectangle c r, |f y - f z| ≤ L * ∑ i, |y i - z i|) (p q : MvPolynomial (Fin 4) ℝ) (hpeval : ∀ y, eval y p = eval (normalizedPoint c r y) q) (hqeval : ∀ x, eval (cosPoint x) q = tensorConvolution K (fun z => f (affinePoint c r z)) x) (y : Fin 4 → ℝ) (hy : y ∈ centeredRectangle c r) : |eval y p - f y| ≤ 32 * L * ∑ i : Fin 4, (sqrt ((y i - (c i - r i)) * ((c i + r i) - y i)) / (K : ℝ) + r i / (K : ℝ) ^ 2) := by have haff : Continuous (affinePoint c r) := by apply continuous_pi intro i exact continuous_const.add (continuous_const.mul (continuous_apply i)) have hpull : ContinuousOn (fun z => f (affinePoint c r z)) (normalizedCube 4) := hf.comp haff.continuousOn (fun z hz => affinePoint_mem_centeredRectangle c r z hr hz) have hlip_pull : ∀ x ∈ normalizedCube 4, ∀ z ∈ normalizedCube 4, |f (affinePoint c r x) - f (affinePoint c r z)| ≤ L * ∑ i, r i * |x i - z i| := by intro x hx z hz have h := hlip (affinePoint c r x) (affinePoint_mem_centeredRectangle c r x hr hx) (affinePoint c r z) (affinePoint_mem_centeredRectangle c r z hr hz) have hcoord (i : Fin 4) : |affinePoint c r x i - affinePoint c r z i| = r i * |x i - z i| := by simp only [affinePoint] convert congrArg abs (show c i + r i * x i - (c i + r i * z i) = r i * (x i - z i) by ring) using 1 rw [abs_mul, abs_of_pos (hr i)] simpa only [hcoord] using h let theta : Fin 4 → ℝ := fun i => arccos (normalizedPoint c r y i) have hn := normalizedPoint_mem_normalizedCube c r y hr hy have hcos : cosPoint theta = normalizedPoint c r y := by funext i exact Real.cos_arccos (hn i).1 (hn i).2 have happ := tensorConvolution_boundary_adaptive hK (fun z => f (affinePoint c r z)) hpull r (fun i => le_of_lt (hr i)) L hL hlip_pull theta calc |eval y p - f y| = |tensorConvolution K (fun z => f (affinePoint c r z)) theta - f (affinePoint c r (cosPoint theta))| := by rw [hpeval y, ← hcos, hqeval theta, hcos, affinePoint_normalizedPoint c r y hr] _ ≤ L * ∑ i : Fin 4, (32 * r i * |sin (theta i)| / (K : ℝ) + 32 * r i / (K : ℝ) ^ 2) := happ _ = 32 * L * ∑ i : Fin 4, (sqrt ((y i - (c i - r i)) * ((c i + r i) - y i)) / (K : ℝ) + r i / (K : ℝ) ^ 2) := by have hterm (i : Fin 4) : 32 * r i * |sin (theta i)| / (K : ℝ) + 32 * r i / (K : ℝ) ^ 2 = 32 * (sqrt ((y i - (c i - r i)) * ((c i + r i) - y i)) / (K : ℝ) + r i / (K : ℝ) ^ 2) := by rw [show 32 * r i * |sin (theta i)| = 32 * (r i * |sin (theta i)|) by ring, radius_mul_abs_sin_arccos_eq_boundary c r y hr i] ring simp_rw [hterm] rw [← Finset.mul_sum] ring
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.AffineFourBoundary.affineJackson_boundary_adaptive_four · Causalean/Mathlib/Analysis/Approximation/Chebyshev/AffineFourBoundary.lean:232
Alternation 8 core · 5 supporting This module constructs normalized signed Lagrange weights, packages the classical alternation theorem as finite moment-dual certificates, and specializes the construction to pole-separated rational targets. ★ exists_alternationDualCertificate★ exists_finiteMomentDual★ exists_rationalFiniteMomentDual

Finite Chebyshev alternation and moment-dual certificates

This module constructs normalized signed Lagrange weights, packages the classical alternation theorem as finite moment-dual certificates, and specializes the construction to pole-separated rational targets.

def normalizedLagrangeWeight reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

The normalized Lagrange weight of a finite family of real nodes at an index i is the barycentric Lagrange weight of the i-th node divided by the sum of the absolute values of all the barycentric weights.

Definition (Lean source)
n :
ℕ
nodes :
Fin n → ℝ
i :
Fin n
normalizedLagrangeWeight nodes i :
ℝ
Lagrange.nodalWeight univ nodes i / ∑ k : Fin n, |Lagrange.nodalWeight univ nodes k|
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.normalizedLagrangeWeight · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:31
structure AlternationDualCertificate reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

An alternation dual certificate for a target on an interval at a chosen degree records a best polynomial, ordered interval nodes, an alternating residual orientation, the associated Lagrange weights, and the facts that those weights alternate and are normalized, annihilate all relevant moments, and give the exact oriented target evaluation.

Definition (Lean source)
f :
ℝ → ℝ
r s :
ℝ
L :
ℕ
approximant :
approximant_degree :
approximant.natDegree ≤ L
approximant_best :
uniformApproxError f r s approximant = bestUniformApproxError f r s L
nodes :
Fin (L + 2) → ℝ
nodes_strictMono :
nodes_mem :
∀ i, nodes i ∈ Icc r s
orientation :
ℝ
orientation_eq :
orientation = 1 ∨ orientation = -1
equioscillation :
∀ i,
f (nodes i) - approximant.eval (nodes i)
= orientation * (-1 : ℝ) ^ (i : ℕ) * bestUniformApproxError f r s L
weights :
Fin (L + 2) → ℝ
weights_eq :
∀ i, weights i = normalizedLagrangeWeight nodes i
weights_alternate :
∀ i, weights i = (-1 : ℝ) ^ (L + 1 - (i : ℕ)) * |weights i|
weights_normalized :
∑ i, |weights i| = 1
moments_zero :
∀ j
if
j ≤ L
then
∑ i, weights i * nodes i ^ j = 0
target_eq :
∑ i, weights i * f (nodes i)
= orientation * (-1 : ℝ) ^ (L + 1) * bestUniformApproxError f r s L
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.AlternationDualCertificate · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:186
theorem exists_alternationDualCertificate reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

For endpoints with r strictly less than s, a target function continuous on the closed interval between them, and any degree bound L, there exists an alternation dual certificate: a best polynomial of degree at most L, L + 2 strictly increasing interval nodes at which its residual equioscillates, and the normalized Lagrange weights of those nodes, which alternate in sign, have absolute values summing to one, annihilate every monomial of degree at most L, and whose weighted sum of target values equals the best uniform error up to sign.

Formal statement
f :
ℝ → ℝ
r s :
ℝ
hrs :
r < s
hf :
L :
ℕ
Nonempty (AlternationDualCertificate f r s L)
Proof (Lean source)
theorem exists_alternationDualCertificate {f : ℝ → ℝ} {r s : ℝ} (hrs : r < s) (hf : ContinuousOn f (Icc r s)) (L : ℕ) : Nonempty (AlternationDualCertificate f r s L) := by classical obtain ⟨E⟩ := exists_equioscillationWitness hrs hf L let w : Fin (L + 2) → ℝ := normalizedLagrangeWeight E.nodes have hwinj : Injective E.nodes := E.nodes_strictMono.injective have hwalt (i : Fin (L + 2)) : w i = (-1 : ℝ) ^ (L + 1 - (i : ℕ)) * |w i| := normalizedLagrangeWeight_alternates E.nodes_strictMono i have hpow (i : Fin (L + 2)) : (-1 : ℝ) ^ (L + 1 - (i : ℕ)) * (-1 : ℝ) ^ (i : ℕ) = (-1 : ℝ) ^ (L + 1) := by rw [← pow_add, Nat.sub_add_cancel] omega have hpoly : ∑ i, w i * E.approximant.eval (E.nodes i) = 0 := sum_normalizedLagrangeWeight_mul_eval_eq_zero hwinj E.approximant_degree have htarget : ∑ i, w i * f (E.nodes i) = E.orientation * (-1 : ℝ) ^ (L + 1) * bestUniformApproxError f r s L := by calc ∑ i, w i * f (E.nodes i) = (∑ i, w i * (f (E.nodes i) - E.approximant.eval (E.nodes i))) + ∑ i, w i * E.approximant.eval (E.nodes i) := by rw [← Finset.sum_add_distrib] apply Finset.sum_congr rfl intro i _ ring _ = ∑ i, w i * (f (E.nodes i) - E.approximant.eval (E.nodes i)) := by rw [hpoly, add_zero] _ = ∑ i, (E.orientation * (-1 : ℝ) ^ (L + 1) * bestUniformApproxError f r s L) * |w i| := by apply Finset.sum_congr rfl intro i _ rw [E.equioscillation i] calc w i * (E.orientation * (-1 : ℝ) ^ (i : ℕ) * bestUniformApproxError f r s L) = E.orientation * ((-1 : ℝ) ^ (L + 1 - (i : ℕ)) * (-1 : ℝ) ^ (i : ℕ)) * bestUniformApproxError f r s L * |w i| := by conv_lhs => rw [hwalt i] ring _ = (E.orientation * (-1 : ℝ) ^ (L + 1) * bestUniformApproxError f r s L) * |w i| := by rw [hpow i] _ = (E.orientation * (-1 : ℝ) ^ (L + 1) * bestUniformApproxError f r s L) * ∑ i, |w i| := by rw [Finset.mul_sum] _ = E.orientation * (-1 : ℝ) ^ (L + 1) * bestUniformApproxError f r s L := by rw [sum_abs_normalizedLagrangeWeight_eq_one hwinj, mul_one] exact ⟨ { approximant := E.approximant approximant_degree := E.approximant_degree approximant_best := E.approximant_best nodes := E.nodes nodes_strictMono := E.nodes_strictMono nodes_mem := E.nodes_mem orientation := E.orientation orientation_eq := E.orientation_eq equioscillation := E.equioscillation weights := w weights_eq := fun _ ↦ rfl weights_alternate := hwalt weights_normalized := sum_abs_normalizedLagrangeWeight_eq_one hwinj moments_zero := fun _ hj ↦ sum_normalizedLagrangeWeight_mul_pow_eq_zero hwinj hj target_eq := htarget }⟩
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.exists_alternationDualCertificate · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:218 · uses AlternationDualCertificate
structure FiniteMomentDual reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

A finite moment dual certificate for a target on an interval at a chosen degree records strictly ordered nodes in the interval and normalized signed weights that annihilate moments through that degree and separate the target by exactly its best uniform approximation error.

Definition (Lean source)
f :
ℝ → ℝ
r s :
ℝ
L :
ℕ
nodes :
Fin (L + 2) → ℝ
nodes_strictMono :
nodes_mem :
∀ i, nodes i ∈ Icc r s
weights :
Fin (L + 2) → ℝ
weights_normalized :
∑ i, |weights i| = 1
moments_zero :
∀ j
if
j ≤ L
then
∑ i, weights i * nodes i ^ j = 0
target_abs_eq :
|∑ i, weights i * f (nodes i)| = bestUniformApproxError f r s L
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.FiniteMomentDual · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:295
def toFiniteMomentDual reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.AlternationDualCertificate

From an alternation dual certificate one obtains a finite moment dual certificate for the same target, interval, and degree by keeping its nodes and weights and forgetting the best polynomial and the orientation.

Definition (Lean source)
f :
ℝ → ℝ
r s :
ℝ
L :
ℕ
toFiniteMomentDual A :
by have hrs : r
≤ s := (A.nodes_mem (0 : Fin (L + 2))).1.trans (A.nodes_mem (0 : Fin (L + 2))).2 have hE : 0 ≤ bestUniformApproxError f r s L := by rw [← A.approximant_best] exact uniformApproxError_nonneg A.approximant refine { nodes := A.nodes nodes_strictMono := A.nodes_strictMono nodes_mem := A.nodes_mem weights := A.weights weights_normalized := A.weights_normalized moments_zero := A.moments_zero target_abs_eq := ?_ } rw [A.target_eq] rcases A.orientation_eq with h | h <;> rw [h] <;> simp [abs_mul, abs_of_nonneg hE]
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.AlternationDualCertificate.toFiniteMomentDual · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:310 · uses AlternationDualCertificate , FiniteMomentDual
theorem exists_finiteMomentDual reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

For endpoints with r strictly less than s, a target function continuous on the closed interval between them, and any degree bound L, there exist L + 2 strictly increasing interval nodes and signed weights whose absolute values sum to one, which annihilate every monomial of degree at most L, and whose weighted sum of target values equals the best degree-L uniform approximation error in absolute value.

Formal statement
f :
ℝ → ℝ
r s :
ℝ
hrs :
r < s
hf :
L :
ℕ
Nonempty (FiniteMomentDual f r s L)
Proof (Lean source)
theorem exists_finiteMomentDual {f : ℝ → ℝ} {r s : ℝ} (hrs : r < s) (hf : ContinuousOn f (Icc r s)) (L : ℕ) : Nonempty (FiniteMomentDual f r s L) := by exact Nonempty.map AlternationDualCertificate.toFiniteMomentDual (exists_alternationDualCertificate hrs hf L)
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.exists_finiteMomentDual · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:334 · uses FiniteMomentDual
def rationalTarget reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

The rational target with parameter a at a point x is x divided by x + a.

Definition (Lean source)
a :
ℝ
x :
ℝ
rationalTarget a x :
ℝ
x / (x + a)
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.rationalTarget · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:349
theorem exists_rationalFiniteMomentDual reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

For endpoints with r strictly less than s, a parameter a such that −a lies outside the closed interval between them, and any degree bound L, there exist L + 2 strictly increasing interval nodes and signed weights whose absolute values sum to one, which annihilate every monomial of degree at most L, and whose weighted sum of values of the rational target equals its best degree-L uniform approximation error in absolute value.

Formal statement
a r s :
ℝ
hrs :
r < s
hpole :
-a ∉ Icc r s
L :
ℕ
Nonempty (FiniteMomentDual (rationalTarget a) r s L)
Proof (Lean source)
theorem exists_rationalFiniteMomentDual {a r s : ℝ} (hrs : r < s) (hpole : -a ∉ Icc r s) (L : ℕ) : Nonempty (FiniteMomentDual (rationalTarget a) r s L) := by exact exists_finiteMomentDual hrs (continuousOn_rationalTarget hpole) L
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.exists_rationalFiniteMomentDual · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:366 · uses FiniteMomentDual , rationalTarget
5 supporting declarations (lemmas, instances)
  • sum_abs_normalizedLagrangeWeight_eq_one theorem — For L + 2 pairwise distinct real nodes, the absolute values of the normalized Lagrange weights sum to one.
    L :
    ℕ
    Fin (L + 2) → ℝ
    hnodes :
    Injective nodes
    ∑ i, |normalizedLagrangeWeight nodes i| = 1
    Proof (Lean source)
    theorem sum_abs_normalizedLagrangeWeight_eq_one {L : ℕ} {nodes : Fin (L + 2) → ℝ} (hnodes : Injective nodes) : ∑ i, |normalizedLagrangeWeight nodes i| = 1 := by classical let Z := ∑ k : Fin (L + 2), |Lagrange.nodalWeight univ nodes k| have hweight : Lagrange.nodalWeight univ nodes (0 : Fin (L + 2)) ≠ 0 := Lagrange.nodalWeight_ne_zero hnodes.injOn (Finset.mem_univ _) have hZ : 0 < Z := by apply Finset.sum_pos' · exact fun k _ ↦ abs_nonneg _ · exact ⟨0, Finset.mem_univ _, abs_pos.mpr hweight⟩ change ∑ i, |Lagrange.nodalWeight univ nodes i / Z| = 1 simp_rw [abs_div, abs_of_pos hZ] simp_rw [div_eq_mul_inv] rw [← Finset.sum_mul] exact mul_inv_cancel₀ (ne_of_gt hZ)
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.sum_abs_normalizedLagrangeWeight_eq_one · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:39
  • normalizedLagrangeWeight_alternates theorem — For L + 2 strictly increasing real nodes and any index i, the normalized Lagrange weight at i equals (−1)^(L + 1 − i) times its own absolute value, so the weights alternate in sign.
    L :
    ℕ
    Fin (L + 2) → ℝ
    hnodes :
    i :
    Fin (L + 2)
    = (-1 : ℝ) ^ (L + 1 - (i : ℕ)) * |normalizedLagrangeWeight nodes i|
    Proof (Lean source)
    theorem normalizedLagrangeWeight_alternates {L : ℕ} {nodes : Fin (L + 2) → ℝ} (hnodes : StrictMono nodes) (i : Fin (L + 2)) : normalizedLagrangeWeight nodes i = (-1 : ℝ) ^ (L + 1 - (i : ℕ)) * |normalizedLagrangeWeight nodes i| := by classical have hfactor (k : Fin (L + 2)) (hk : k ∈ (Finset.univ : Finset (Fin (L + 2))).erase i) : (nodes i - nodes k)⁻¹ = (if i < k then (-1 : ℝ) else 1) * |(nodes i - nodes k)⁻¹| := by by_cases hik : i < k · rw [if_pos hik, abs_of_neg] · ring · exact inv_neg''.mpr (sub_neg.mpr (hnodes hik)) · rw [if_neg hik, one_mul, abs_of_pos] have hki : k < i := lt_of_le_of_ne (le_of_not_gt hik) (Finset.ne_of_mem_erase hk) exact inv_pos.mpr (sub_pos.mpr (hnodes hki)) have hsign : (∏ k ∈ (Finset.univ : Finset (Fin (L + 2))).erase i, if i < k then (-1 : ℝ) else 1) = (-1 : ℝ) ^ (L + 1 - (i : ℕ)) := by rw [Finset.prod_ite] simp only [Finset.prod_const, one_pow, mul_one] have hfilter : ((Finset.univ : Finset (Fin (L + 2))).erase i).filter (fun k ↦ i < k) = Finset.Ioi i := by ext k simp only [mem_filter, Finset.mem_erase, Finset.mem_univ, Finset.mem_Ioi] constructor · exact fun h ↦ h.2 · exact fun h ↦ ⟨⟨ne_of_gt h, trivial⟩, h⟩ rw [hfilter, Fin.card_Ioi] rw [show L + 2 - 1 - (i : ℕ) = L + 1 - (i : ℕ) by omega] have hweight : Lagrange.nodalWeight Finset.univ nodes i = (-1 : ℝ) ^ (L + 1 - (i : ℕ)) * |Lagrange.nodalWeight Finset.univ nodes i| := by rw [Lagrange.nodalWeight] calc (∏ k ∈ Finset.univ.erase i, (nodes i - nodes k)⁻¹) = ∏ k ∈ Finset.univ.erase i, ((if i < k then (-1 : ℝ) else 1) * |(nodes i - nodes k)⁻¹|) := by apply Finset.prod_congr rfl intro k hk exact hfactor k hk _ = (∏ k ∈ Finset.univ.erase i, if i < k then (-1 : ℝ) else 1) * (∏ k ∈ Finset.univ.erase i, |(nodes i - nodes k)⁻¹|) := by rw [Finset.prod_mul_distrib] _ = (-1 : ℝ) ^ (L + 1 - (i : ℕ)) * |∏ k ∈ Finset.univ.erase i, (nodes i - nodes k)⁻¹| := by rw [hsign, Finset.abs_prod] let Z := ∑ k : Fin (L + 2), |Lagrange.nodalWeight Finset.univ nodes k| have hnodeInjective : Injective nodes := hnodes.injective have hweight_ne : Lagrange.nodalWeight Finset.univ nodes i ≠ 0 := Lagrange.nodalWeight_ne_zero hnodeInjective.injOn (Finset.mem_univ _) have hZ : 0 < Z := by apply Finset.sum_pos' · exact fun k _ ↦ abs_nonneg _ · exact ⟨i, Finset.mem_univ _, abs_pos.mpr hweight_ne⟩ change Lagrange.nodalWeight Finset.univ nodes i / Z = (-1 : ℝ) ^ (L + 1 - (i : ℕ)) * |Lagrange.nodalWeight Finset.univ nodes i / Z| rw [abs_div, abs_of_pos hZ] nth_rewrite 1 [hweight] ring
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.normalizedLagrangeWeight_alternates · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:58
  • sum_normalizedLagrangeWeight_mul_pow_eq_zero theorem — For L + 2 pairwise distinct real nodes and an exponent j at most L, the sum over nodes of the normalized Lagrange weight times the j-th power of the node is zero.
    L j :
    ℕ
    Fin (L + 2) → ℝ
    hnodes :
    Injective nodes
    hj :
    j ≤ L
    ∑ i, normalizedLagrangeWeight nodes i * nodes i ^ j = 0
    Proof (Lean source)
    theorem sum_normalizedLagrangeWeight_mul_pow_eq_zero {L j : ℕ} {nodes : Fin (L + 2) → ℝ} (hnodes : Injective nodes) (hj : j ≤ L) : ∑ i, normalizedLagrangeWeight nodes i * nodes i ^ j = 0 := by classical let Z := ∑ k : Fin (L + 2), |Lagrange.nodalWeight Finset.univ nodes k| have hdegree : (X ^ j : Polynomial ℝ).degree < (Finset.univ : Finset (Fin (L + 2))).card := by rw [degree_X_pow] norm_cast simpa using (show j < L + 2 by omega) have hcoeff := Lagrange.coeff_eq_sum (s := (Finset.univ : Finset (Fin (L + 2)))) (v := nodes) hnodes.injOn (P := (X ^ j : Polynomial ℝ)) hdegree have hsum : ∑ i : Fin (L + 2), Lagrange.nodalWeight Finset.univ nodes i * nodes i ^ j = 0 := by simpa [Lagrange.nodalWeight, div_eq_mul_inv, Finset.prod_inv_distrib, mul_comm, ne_of_gt (lt_of_le_of_lt hj (lt_succ_self L))] using hcoeff.symm change ∑ i : Fin (L + 2), (Lagrange.nodalWeight Finset.univ nodes i / Z) * nodes i ^ j = 0 simp_rw [div_mul_eq_mul_div, div_eq_mul_inv] rw [← Finset.sum_mul, hsum, zero_mul]
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.sum_normalizedLagrangeWeight_mul_pow_eq_zero · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:129
  • sum_normalizedLagrangeWeight_mul_eval_eq_zero theorem — For L + 2 pairwise distinct real nodes and a real polynomial of degree at most L, the sum over nodes of the normalized Lagrange weight times the polynomial's value at the node is zero.
    L :
    ℕ
    Fin (L + 2) → ℝ
    hnodes :
    Injective nodes
    Q :
    hQ :
    Q.natDegree ≤ L
    ∑ i, normalizedLagrangeWeight nodes i * Q.eval (nodes i) = 0
    Proof (Lean source)
    theorem sum_normalizedLagrangeWeight_mul_eval_eq_zero {L : ℕ} {nodes : Fin (L + 2) → ℝ} (hnodes : Injective nodes) {Q : Polynomial ℝ} (hQ : Q.natDegree ≤ L) : ∑ i, normalizedLagrangeWeight nodes i * Q.eval (nodes i) = 0 := by classical let Z := ∑ k : Fin (L + 2), |Lagrange.nodalWeight Finset.univ nodes k| have hdegree : Q.degree < (Finset.univ : Finset (Fin (L + 2))).card := by apply lt_of_le_of_lt Q.degree_le_natDegree norm_cast simpa using (show Q.natDegree < L + 2 by omega) have hcoeff := Lagrange.coeff_eq_sum (s := (Finset.univ : Finset (Fin (L + 2)))) (v := nodes) hnodes.injOn (P := Q) hdegree have hcoeffzero : Q.coeff (L + 1) = 0 := Q.coeff_eq_zero_of_natDegree_lt (by omega) have hsum : ∑ i : Fin (L + 2), Lagrange.nodalWeight Finset.univ nodes i * Q.eval (nodes i) = 0 := by simpa [Lagrange.nodalWeight, div_eq_mul_inv, Finset.prod_inv_distrib, mul_comm, hcoeffzero] using hcoeff.symm change ∑ i : Fin (L + 2), (Lagrange.nodalWeight Finset.univ nodes i / Z) * Q.eval (nodes i) = 0 simp_rw [div_mul_eq_mul_div, div_eq_mul_inv] rw [← Finset.sum_mul, hsum, zero_mul]
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.sum_normalizedLagrangeWeight_mul_eval_eq_zero · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:155
  • continuousOn_rationalTarget theorem — If the point −a lies outside the closed interval from r to s, then the rational target with parameter a is continuous on that interval.
    a r s :
    ℝ
    hpole :
    -a ∉ Icc r s
    Proof (Lean source)
    theorem continuousOn_rationalTarget {a r s : ℝ} (hpole : -a ∉ Icc r s) : ContinuousOn (rationalTarget a) (Icc r s) := by unfold rationalTarget apply continuousOn_id.div (continuousOn_id.add continuousOn_const) intro x hx hzero apply hpole change x + a = 0 at hzero have hxa : x = -a := by linarith simpa [hxa] using hx
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.continuousOn_rationalTarget · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Alternation.lean:353
Basic­Bernstein­Szego­Trig 2 core · 0 supporting For a real polynomial R the function t ↦ R(cos t) is the *even trigonometric transform* of R. ★ hasDerivAt_cosComp★ deriv_cosComp

Bernstein / Szegő trigonometric transform: definitions and derivative

For a real polynomial R the function t ↦ R(cos t) is the even trigonometric transform of R. This file records the elementary, fully-proved facts about this transform that feed the sharp Szegő differential inequality (Causalean.Mathlib.Analysis.Approximation.Chebyshev.Szego):

* hasDerivAt_cosComp, deriv_cosComp — the chain-rule derivative d/dt R(cos t) = R'(cos t) · (-sin t).

Everything here is a direct consequence of Polynomial.hasDerivAt, Real.hasDerivAt_cos and the composition rule; no deep input is used.

## Standard reference Szegő's / Bernstein's inequality for trigonometric polynomials; Rivlin, The Chebyshev Polynomials (1974); DeVore–Lorentz, Constructive Approximation Ch. 4.

theorem hasDerivAt_cosComp reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

For any real polynomial R and any point t, the map s ↦ R(cos s) has derivative R'(cos t) · (-sin t) at t.

Formal statement
R :
t :
ℝ
HasDerivAt (fun s => R.eval (cos s)) (R.derivative.eval (cos t) * (-sin t)) t
Proof (Lean source)
theorem hasDerivAt_cosComp (R : Polynomial ℝ) (t : ℝ) : HasDerivAt (fun s => R.eval (cos s)) (R.derivative.eval (cos t) * (-sin t)) t := by have h1 : HasDerivAt (fun x => eval x R) (R.derivative.eval (cos t)) (cos t) := R.hasDerivAt (cos t) have h2 : HasDerivAt cos (-sin t) t := Real.hasDerivAt_cos t exact h1.comp t h2
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.hasDerivAt_cosComp · Causalean/Mathlib/Analysis/Approximation/Chebyshev/BasicBernsteinSzegoTrig.lean:39
theorem deriv_cosComp reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

For any real polynomial R and any point t, the derivative of s ↦ R(cos s) at t equals R'(cos t) · (-sin t).

Formal statement
R :
t :
ℝ
deriv (fun s => R.eval (cos s)) t = R.derivative.eval (cos t) * (-sin t)
Proof (Lean source)
theorem deriv_cosComp (R : Polynomial ℝ) (t : ℝ) : deriv (fun s => R.eval (cos s)) t = R.derivative.eval (cos t) * (-sin t) := (hasDerivAt_cosComp R t).deriv
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.deriv_cosComp · Causalean/Mathlib/Analysis/Approximation/Chebyshev/BasicBernsteinSzegoTrig.lean:52
Chebyshev­Chord­Geometry 1 core · 3 supporting This module centers angles on the odd Chebyshev grid, proves the grid's cyclic symmetry and adjacent ordering, and derives the root-product domination used in the vertical-modulus argument. ★ exists_rootProduct_dominating_abscissa_past_chebyshevZeros

Finite chord geometry for Chebyshev roots

This module centers angles on the odd Chebyshev grid, proves the grid's cyclic symmetry and adjacent ordering, and derives the root-product domination used in the vertical-modulus argument.

theorem exists_rootProduct_dominating_abscissa_past_chebyshevZeros reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

Given a positive degree, a point of the unit interval, and a real height, some abscissa in that interval, weakly to the right of all degree-L Chebyshev roots, has at least as large a vertical root-distance product.

Formal statement
L :
ℕ
hL :
0 < L
x :
ℝ
hx :
x ∈ Icc (-1) 1
y :
ℝ
∃ x₀ ∈ Icc (-1 : ℝ) 1,
conclusion 1
k ∈ Finset.range L :
chebyshevZero L k ≤ x₀
conclusion 2
(∏ k ∈ Finset.range L, ‖((x - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖)
≤ ∏ k ∈ Finset.range L, ‖((x₀ - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖
Proof (Lean source)
theorem exists_rootProduct_dominating_abscissa_past_chebyshevZeros {L : ℕ} (hL : 0 < L) {x : ℝ} (hx : x ∈ Icc (-1) 1) (y : ℝ) : ∃ x₀ ∈ Icc (-1 : ℝ) 1, (∀ k ∈ range L, chebyshevZero L k ≤ x₀) ∧ (∏ k ∈ range L, ‖((x - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖) ≤ ∏ k ∈ range L, ‖((x₀ - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖ := by let θ := arccos x rcases exists_int_abs_sub_mul_pi_div_le hL θ with ⟨m, hm⟩ let φ := θ - (m : ℝ) * (pi / (L : ℝ)) have hφ : |φ| ≤ pi / (2 * (L : ℝ)) := by simpa [φ] using hm have hshift : φ + (m : ℝ) * (pi / (L : ℝ)) = θ := by dsimp [φ] ring have hpermθφ : (chebyshevPairedChordList L θ).Perm (chebyshevPairedChordList L φ) := by rw [← hshift] exact chebyshevPairedChordList_add_int_mul_pi_div_perm hL φ m rcases exists_sorted_chebyshevChordList_with_adjacentPairProduct_eq_of_centered (t := 4 * y ^ 2) hL hφ with ⟨zs, hzsperm, hzssorted, hzsprod⟩ have hlen : (chebyshevPairedChordList L φ).length = 2 * L := by simp [chebyshevPairedChordList, Nat.mul_comm] have hzseven : Even zs.length := by rw [hzsperm.length_eq, hlen] exact ⟨L, by omega⟩ have hchord_nonneg (a : ℝ) : 0 ≤ cosineChordSq a := by unfold cosineChordSq nlinarith [Real.cos_le_one a] have hzsnonneg : ∀ a ∈ zs, 0 ≤ a := by intro a ha have ha' : a ∈ chebyshevPairedChordList L φ := hzsperm.mem_iff.mp ha simp only [chebyshevPairedChordList, List.mem_flatMap, Multiset.mem_toList, Finset.mem_val, Finset.mem_range, List.mem_cons, List.not_mem_nil, or_false] at ha' rcases ha' with ⟨k, hk, rfl | rfl⟩ · exact hchord_nonneg _ · exact hchord_nonneg _ have hadj : adjacentPairProduct (4 * y ^ 2) (chebyshevPairedChordList L θ) ≤ adjacentPairProduct (4 * y ^ 2) (chebyshevPairedChordList L φ) := by have h := adjacentPairProduct_le_of_perm_sorted (t := 4 * y ^ 2) (xs := zs) (ys := chebyshevPairedChordList L θ) (by positivity) hzseven hzssorted hzsnonneg (hpermθφ.trans hzsperm.symm) simpa [hzsprod] using h have hcosθ : cos θ = x := by dsimp [θ] exact Real.cos_arccos hx.1 hx.2 let A : ℝ := ∏ k ∈ range L, ‖((x - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖ let B : ℝ := ∏ k ∈ range L, ‖((cos φ - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖ have hfactor (u : ℕ → ℝ) : (∏ k ∈ range L, 4 * u k ^ 2) = 4 ^ L * (∏ k ∈ range L, u k) ^ 2 := by rw [Finset.prod_mul_distrib, Finset.prod_pow] simp have hsquares : 4 ^ L * A ^ 2 ≤ 4 ^ L * B ^ 2 := by rw [adjacentPairProduct_chebyshevPairedChordList, adjacentPairProduct_chebyshevPairedChordList] at hadj simpa [A, B, hcosθ, hfactor] using hadj have hA : 0 ≤ A := by dsimp [A] positivity have hB : 0 ≤ B := by dsimp [B] positivity have hAB : A ≤ B := by have hfour : 0 < (4 : ℝ) ^ L := pow_pos (by norm_num) L have hsq : A ^ 2 ≤ B ^ 2 := le_of_mul_le_mul_left hsquares hfour exact (sq_le_sq₀ hA hB).mp hsq refine ⟨Real.cos φ, ⟨Real.neg_one_le_cos φ, Real.cos_le_one φ⟩, ?_, ?_⟩ · intro k hk simp only [Finset.mem_range] at hk have hLr : 0 < (L : ℝ) := by exact_mod_cast hL have hkr : (k : ℝ) ≤ (L : ℝ) - 1 := by have : k + 1 ≤ L := by omega have hkr' : (k : ℝ) + 1 ≤ (L : ℝ) := by exact_mod_cast this linarith have hcoef : (((2 * k + 1 : ℕ) : ℝ)) = 2 * (k : ℝ) + 1 := by push_cast ring have hangle0 : 0 ≤ chebyshevRootAngle L k := by rw [chebyshevRootAngle] positivity have hanglepi : chebyshevRootAngle L k ≤ pi := by rw [chebyshevRootAngle] have hk0 : 0 ≤ (k : ℝ) := by positivity rw [hcoef] field_simp nlinarith [Real.pi_pos] have hφangle : |φ| ≤ chebyshevRootAngle L k := by apply hφ.trans rw [chebyshevRootAngle] rw [hcoef] field_simp nlinarith [Real.pi_pos] rw [chebyshevZero, ← Real.cos_abs φ] exact Real.cos_le_cos_of_nonneg_of_le_pi (abs_nonneg φ) hanglepi hφangle · simpa [A, B] using hAB
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.exists_rootProduct_dominating_abscissa_past_chebyshevZeros · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ChebyshevChordGeometry.lean:426 · uses chebyshevZero
3 supporting declarations (lemmas, instances)
  • exists_int_abs_sub_mul_pi_div_le theorem — Every real angle differs from an integer multiple of the step determined by a positive integer by at most half of that step.
    L :
    ℕ
    hL :
    0 < L
    θ :
    ℝ
    ∃ m : ℤ, |θ - (m : ℝ) * (pi / (L : ℝ))| ≤ pi / (2 * (L : ℝ))
    Proof (Lean source)
    theorem exists_int_abs_sub_mul_pi_div_le {L : ℕ} (hL : 0 < L) (θ : ℝ) : ∃ m : ℤ, |θ - (m : ℝ) * (pi / (L : ℝ))| ≤ pi / (2 * (L : ℝ)) := by -- Choose the nearest integer to `θ / (π/L)`. Mathlib's floor/round -- bounds give a remainder in `[-1/2,1/2]`; positivity of `π/L` then -- rescales that bound to the displayed interval. let d : ℝ := pi / (L : ℝ) have hd : 0 < d := div_pos Real.pi_pos (by exact_mod_cast hL) refine ⟨round (θ / d), ?_⟩ have hr : |θ / d - (round (θ / d) : ℝ)| ≤ (1 : ℝ) / 2 := abs_sub_round (θ / d) have heq : θ - (round (θ / d) : ℝ) * d = d * (θ / d - (round (θ / d) : ℝ)) := by field_simp rw [show pi / (L : ℝ) = d by rfl, heq, abs_mul, abs_of_pos hd] calc d * |θ / d - (round (θ / d) : ℝ)| ≤ d * ((1 : ℝ) / 2) := mul_le_mul_of_nonneg_left hr hd.le _ = pi / (2 * (L : ℝ)) := by dsimp [d] field_simp
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.exists_int_abs_sub_mul_pi_div_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ChebyshevChordGeometry.lean:30
  • chebyshevPairedChordList_add_int_mul_pi_div_perm theorem — Shifting a real angle by an integer multiple of the step determined by a positive integer permutes the paired list of Chebyshev chord squares.
    L :
    ℕ
    hL :
    0 < L
    θ :
    ℝ
    m :
    ℤ
    (chebyshevPairedChordList L (θ + (m : ℝ) * (pi / (L : ℝ)))).Perm (chebyshevPairedChordList L θ)
    Proof (Lean source)
    theorem chebyshevPairedChordList_add_int_mul_pi_div_perm {L : ℕ} (hL : 0 < L) (θ : ℝ) (m : ℤ) : (chebyshevPairedChordList L (θ + (m : ℝ) * (pi / (L : ℝ)))).Perm (chebyshevPairedChordList L θ) := by induction m using Int.induction_on with | zero => simp | @succ i ih => have hstep := chebyshevPairedChordList_add_pi_div_perm hL (θ + (i : ℝ) * (pi / (L : ℝ))) have heq : θ + (((i : ℤ) + 1 : ℤ) : ℝ) * (pi / (L : ℝ)) = θ + (i : ℝ) * (pi / (L : ℝ)) + pi / (L : ℝ) := by norm_num ring rw [heq] exact hstep.trans ih | @pred i ih => have hstep := chebyshevPairedChordList_add_pi_div_perm hL (θ + ((-(i : ℤ) - 1 : ℤ) : ℝ) * (pi / (L : ℝ))) have heq : θ + ((-(i : ℤ) - 1 : ℤ) : ℝ) * (pi / (L : ℝ)) + pi / (L : ℝ) = θ + ((-(i : ℤ) : ℤ) : ℝ) * (pi / (L : ℝ)) := by norm_num ring rw [heq] at hstep exact hstep.symm.trans ih
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.chebyshevPairedChordList_add_int_mul_pi_div_perm · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ChebyshevChordGeometry.lean:223
  • exists_sorted_chebyshevChordList_with_adjacentPairProduct_eq_of_centered theorem — For a positive degree L and an angle φ of absolute value at most π / (2L), the list of the 2L squared chord lengths, paired by Chebyshev root angle, can be rearranged into decreasing order in such a way that the product over consecutive pairs of (the product of the pair plus t) is unchanged, for any real additive term t.
    L :
    ℕ
    hL :
    0 < L
    φ t :
    ℝ
    hφ :
    |φ| ≤ pi / (2 * (L : ℝ))
    ∃ zs : List ℝ,
    conclusion 1
    conclusion 2
    zs.Pairwise (fun a b => b ≤ a)
    Proof (Lean source)
    theorem exists_sorted_chebyshevChordList_with_adjacentPairProduct_eq_of_centered {L : ℕ} (hL : 0 < L) {φ t : ℝ} (hφ : |φ| ≤ pi / (2 * (L : ℝ))) : ∃ zs : List ℝ, zs.Perm (chebyshevPairedChordList L φ) ∧ zs.Pairwise (fun a b => b ≤ a) ∧ adjacentPairProduct t zs = adjacentPairProduct t (chebyshevPairedChordList L φ) := by let δ : ℝ := pi / (2 * (L : ℝ)) let u : ℝ := |φ| let a : ℕ → ℝ := fun k => cosineChordSq (chebyshevRootAngle L k + u) let b : ℕ → ℝ := fun k => cosineChordSq (chebyshevRootAngle L k - u) -- Reverse the roots, and put the larger circular distance first in each -- root block. At `u = δ`, neighboring blocks may tie. let zs := (List.range L).reverse.flatMap fun k => [a k, b k] have hLr : 0 < (L : ℝ) := by exact_mod_cast hL have hδ : 0 < δ := by dsimp [δ] positivity have hu0 : 0 ≤ u := abs_nonneg φ have huδ : u ≤ δ := hφ have hangle (k : ℕ) : chebyshevRootAngle L k = ((2 * k + 1 : ℕ) : ℝ) * δ := by simp only [chebyshevRootAngle, δ] ring have hcast (k : ℕ) : ((2 * k + 1 : ℕ) : ℝ) = 2 * (k : ℝ) + 1 := by push_cast ring have hδpi : 2 * (L : ℝ) * δ = pi := by dsimp [δ] field_simp have hbounds (k : ℕ) (hk : k < L) : 0 ≤ chebyshevRootAngle L k - u ∧ chebyshevRootAngle L k + u ≤ pi := by have hkcast : (k : ℝ) ≤ (L : ℝ) - 1 := by have hkn : k + 1 ≤ L := by omega have hkr : (k : ℝ) + 1 ≤ (L : ℝ) := by exact_mod_cast hkn linarith have hk0 : 0 ≤ (k : ℝ) := by positivity rw [hangle, hcast] constructor <;> nlinarith have hwithin (k : ℕ) (hk : k < L) : b k ≤ a k := by dsimp [a, b] apply cosineChordSq_mono_on_zero_pi · exact (hbounds k hk).1 · exact (hbounds k hk).2 · linarith have hcross (j k : ℕ) (hj : j < L) (hk : k < L) (hjk : j < k) : a j ≤ b k := by have hjk' : (j : ℝ) + 1 ≤ (k : ℝ) := by exact_mod_cast hjk dsimp [a, b] apply cosineChordSq_mono_on_zero_pi · have h := (hbounds j hj).1 rw [hangle, hcast] at h ⊢ nlinarith · have h := (hbounds k hk).2 rw [hangle, hcast] at h ⊢ nlinarith · rw [hangle, hangle, hcast, hcast] nlinarith have hsorted : zs.Pairwise (fun x y => y ≤ x) := by dsimp [zs] rw [List.pairwise_flatMap] constructor · intro k hk simp only [List.mem_reverse, List.mem_range] at hk simpa using hwithin k hk · rw [List.pairwise_reverse] have hrangePair : (List.range L).Pairwise (fun j k => j < k ∧ k < L) := by rw [List.pairwise_iff_getElem] intro i j hi hj hij simp only [List.length_range] at hi hj simp only [List.getElem_range] omega apply hrangePair.imp intro j k hjk x hx y hy have hj : j < L := lt_trans hjk.1 hjk.2 have hk : k < L := hjk.2 simp only [List.mem_cons, List.not_mem_nil, or_false] at hx hy rcases hx with rfl | rfl <;> rcases hy with rfl | rfl · exact (hcross j k hj hk hjk.1).trans (hwithin k hk) · exact (hwithin j hj).trans ((hcross j k hj hk hjk.1).trans (hwithin k hk)) · exact hcross j k hj hk hjk.1 · exact (hwithin j hj).trans (hcross j k hj hk hjk.1) -- Replacing `φ` by `|φ|` only swaps the two entries in each root block. have hpairs (k : ℕ) (hk : k < L) : [a k, b k].Perm [cosineChordSq (φ + chebyshevRootAngle L k), cosineChordSq (φ - chebyshevRootAngle L k)] := by by_cases hφ0 : 0 ≤ φ · have hu : u = φ := abs_of_nonneg hφ0 have ha : a k = cosineChordSq (φ + chebyshevRootAngle L k) := by dsimp [a] rw [hu] congr 1 <;> ring have hb : b k = cosineChordSq (φ - chebyshevRootAngle L k) := by dsimp [b] rw [hu] rw [show chebyshevRootAngle L k - φ = -(φ - chebyshevRootAngle L k) by ring] simp only [cosineChordSq] rw [Real.cos_neg] rw [ha, hb] · have hφ0' : φ ≤ 0 := le_of_not_ge hφ0 have hu : u = -φ := abs_of_nonpos hφ0' have ha : a k = cosineChordSq (φ - chebyshevRootAngle L k) := by dsimp [a] rw [hu] rw [show chebyshevRootAngle L k + -φ = -(φ - chebyshevRootAngle L k) by ring] simp only [cosineChordSq] rw [Real.cos_neg] have hb : b k = cosineChordSq (φ + chebyshevRootAngle L k) := by dsimp [b] rw [hu] congr 1 <;> ring rw [ha, hb] exact List.Perm.swap _ _ [] have hrange : (range L).val.toList.Perm (List.range L) := by refine (List.perm_ext_iff_of_nodup ?_ List.nodup_range).2 ?_ · rw [← Multiset.coe_nodup, Multiset.coe_toList] exact (range L).nodup · simp have hperm : zs.Perm (chebyshevPairedChordList L φ) := by dsimp [zs] rw [chebyshevPairedChordList] exact ((List.reverse_perm (List.range L)).flatMap (fun k hk => List.Perm.refl _)).trans <| hrange.symm.flatMap fun k hk => hpairs k (by simpa using hk) refine ⟨zs, hperm, hsorted, ?_⟩ rw [chebyshevPairedChordList] rw [adjacentPairProduct_flatMap_two, adjacentPairProduct_flatMap_two] rw [List.map_reverse, List.prod_reverse] rw [(hrange.symm.map (fun k => a k * b k + t)).prod_eq] congr 1 apply List.map_congr_left intro k hk have hp := (hpairs k (by simpa using hk)).prod_eq simpa [mul_comm, mul_left_comm, mul_assoc] using congrArg (fun z => z + t) hp
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.exists_sorted_chebyshevChordList_with_adjacentPairProduct_eq_of_centered · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ChebyshevChordGeometry.lean:274
Chebyshev­One­Norm 1 core · 0 supporting The Chebyshev recurrence gives the silver-ratio coefficient one-norm estimate used when a tensor Chebyshev expansion is converted to monomial coefficients. ★ polynomialCoeffOneNorm_chebyshev_le

Silver-ratio coefficient one-norm bound for Chebyshev polynomials

The Chebyshev recurrence gives the silver-ratio coefficient one-norm estimate used when a tensor Chebyshev expansion is converted to monomial coefficients.

theorem polynomialCoeffOneNorm_chebyshev_le reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

For a natural-number order n, the sum of the absolute values of the monomial coefficients of the n-th first-kind Chebyshev polynomial is at most (1 + √2)ⁿ.

Formal statement
n :
ℕ
polynomialCoeffOneNorm (T ℝ (n : ℤ)) ≤ (1 + sqrt 2) ^ n
Proof (Lean source)
theorem polynomialCoeffOneNorm_chebyshev_le (n : ℕ) : polynomialCoeffOneNorm (T ℝ (n : ℤ)) ≤ (1 + sqrt 2) ^ n := by let r : ℝ := 1 + sqrt 2 have hr_nonneg : 0 ≤ r := by dsimp [r]; positivity have hr_sq : r ^ 2 = 2 * r + 1 := by dsimp [r] nlinarith [Real.sq_sqrt (by norm_num : (0 : ℝ) ≤ 2)] change polynomialCoeffOneNorm (T ℝ (n : ℤ)) ≤ r ^ n induction n using Nat.twoStepInduction with | zero => change polynomialCoeffOneNorm (T ℝ 0) ≤ 1 rw [Polynomial.Chebyshev.T_zero, oneNorm_range (1 : Polynomial ℝ) (m := 1) (by simp)] simp | one => norm_num only [Nat.cast_one, pow_one] rw [Polynomial.Chebyshev.T_one, oneNorm_range (X : Polynomial ℝ) (m := 2) (by simp)] norm_num [Finset.sum_range_succ, coeff_X, r] | more n hn hn1 => have hT : T ℝ ((n + 2 : ℕ) : ℤ) = (2 : ℝ) • (X * T ℝ ((n + 1 : ℕ) : ℤ)) - T ℝ (n : ℤ) := by convert Polynomial.Chebyshev.T_add_two ℝ (n : ℤ) using 1 · norm_num · simp only [Polynomial.smul_eq_C_mul] norm_num rw [Polynomial.C_ofNat] ring rw [hT] calc polynomialCoeffOneNorm ((2 : ℝ) • (X * T ℝ ((n + 1 : ℕ) : ℤ)) - T ℝ (n : ℤ)) ≤ polynomialCoeffOneNorm ((2 : ℝ) • (X * T ℝ ((n + 1 : ℕ) : ℤ))) + polynomialCoeffOneNorm (T ℝ (n : ℤ)) := oneNorm_sub_le _ _ _ = 2 * polynomialCoeffOneNorm (T ℝ ((n + 1 : ℕ) : ℤ)) + polynomialCoeffOneNorm (T ℝ (n : ℤ)) := by rw [oneNorm_smul, oneNorm_X_mul] norm_num _ ≤ 2 * r ^ (n + 1) + r ^ n := by gcongr _ = r ^ (n + 2) := by calc 2 * r ^ (n + 1) + r ^ n = (2 * r + 1) * r ^ n := by rw [pow_succ] ring _ = r ^ 2 * r ^ n := by rw [hr_sq] _ = r ^ (n + 2) := by rw [pow_add]; ring
Causalean.Mathlib.Analysis.Approximation.Chebyshev.polynomialCoeffOneNorm_chebyshev_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ChebyshevOneNorm.lean:56 · uses polynomialCoeffOneNorm
Duffin­Schaeffer 2 core · 7 supporting This module proves the Chebyshev vertical-modulus and rootwise derivative comparisons, expresses differentiation in Chebyshev interpolation weights, and derives the real first-derivative bound on [-1,1] that follows from ★ duffinSchaeffer_derivative_le

A real first-derivative corollary of the Duffin--Schaeffer inequality

This module proves the Chebyshev vertical-modulus and rootwise derivative comparisons, expresses differentiation in Chebyshev interpolation weights, and derives the real first-derivative bound on [-1,1] that follows from the Duffin--Schaeffer inequality.

def chebyshevDerivativeWeight reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

The Chebyshev differentiation weight for degree L at a point x and node index i is the derivative at x of the Lagrange basis polynomial that equals one at the i-th of the L + 1 extremal Chebyshev nodes and zero at the others.

Definition (Lean source)
L :
ℕ
x :
ℝ
i :
ℕ
chebyshevDerivativeWeight L x i :
ℝ
(basis (range (L + 1)) (node L) i).derivative.eval x
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.chebyshevDerivativeWeight · Causalean/Mathlib/Analysis/Approximation/Chebyshev/DuffinSchaeffer.lean:451
theorem duffinSchaeffer_derivative_le reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

For a real polynomial of degree at most L with L positive and a nonnegative bound C, if the polynomial is at most C in absolute value at each of the L + 1 extremal Chebyshev nodes, then at every point between −1 and 1 its derivative is at most L² times C in absolute value.

Formal statement
Q :
L :
ℕ
hL :
0 < L
hQ :
Q.natDegree ≤ L
C :
ℝ
hC :
0 ≤ C
hnodes :
∀ i
if
i ≤ L
then
|Q.eval (node L i)| ≤ C
x :
ℝ
hx :
x ∈ Icc (-1) 1
|Q.derivative.eval x| ≤ (L : ℝ) ^ 2 * C
Proof (Lean source)
theorem duffinSchaeffer_derivative_le (Q : Polynomial ℝ) {L : ℕ} (hL : 0 < L) (hQ : Q.natDegree ≤ L) {C : ℝ} (hC : 0 ≤ C) (hnodes : ∀ i, i ≤ L → |Q.eval (node L i)| ≤ C) {x : ℝ} (hx : x ∈ Icc (-1) 1) : |Q.derivative.eval x| ≤ (L : ℝ) ^ 2 * C := by rw [eval_derivative_eq_sum_chebyshevDerivativeWeight Q hQ x] calc |∑ i ∈ range (L + 1), Q.eval (node L i) * chebyshevDerivativeWeight L x i| ≤ ∑ i ∈ range (L + 1), |Q.eval (node L i) * chebyshevDerivativeWeight L x i| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ i ∈ range (L + 1), C * |chebyshevDerivativeWeight L x i| := by apply Finset.sum_le_sum intro i hi rw [abs_mul] exact mul_le_mul_of_nonneg_right (hnodes i (le_of_lt_succ (Finset.mem_range.mp hi))) (abs_nonneg _) _ = C * ∑ i ∈ range (L + 1), |chebyshevDerivativeWeight L x i| := by rw [Finset.mul_sum] _ ≤ C * (L : ℝ) ^ 2 := mul_le_mul_of_nonneg_left (sum_abs_chebyshevDerivativeWeight_le_sq hL hx) hC _ = (L : ℝ) ^ 2 * C := by ring
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.duffinSchaeffer_derivative_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/DuffinSchaeffer.lean:539
7 supporting declarations (lemmas, instances)
  • prod_norm_sub_chebyshevZero_le_endpoint theorem — For a positive degree L, a real x between −1 and 1, and any real height y, the product of the distances from the complex point x + i y to the L roots of the degree-L Chebyshev polynomial is at most the corresponding product of distances from the point 1 + i y.
    L :
    ℕ
    hL :
    0 < L
    x :
    ℝ
    hx :
    x ∈ Icc (-1) 1
    y :
    ℝ
    (∏ k ∈ range L, ‖((x - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖)
    ≤ ∏ k ∈ range L, ‖((1 - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖
    Proof (Lean source)
    theorem prod_norm_sub_chebyshevZero_le_endpoint {L : ℕ} (hL : 0 < L) {x : ℝ} (hx : x ∈ Icc (-1) 1) (y : ℝ) : (∏ k ∈ range L, ‖((x - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖) ≤ ∏ k ∈ range L, ‖((1 - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖ := by rcases exists_rootProduct_dominating_abscissa_past_chebyshevZeros hL hx y with ⟨x₀, hx₀, hzeros, hdom⟩ refine hdom.trans ?_ apply Finset.prod_le_prod · intro k hk positivity intro k hk exact vertical_rootDistance_le_endpoint (hzeros k hk) hx₀.2
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.prod_norm_sub_chebyshevZero_le_endpoint · Causalean/Mathlib/Analysis/Approximation/Chebyshev/DuffinSchaeffer.lean:46
  • norm_eval_chebyshev_eq_leadingCoeff_mul_rootProduct theorem — For any degree L and real numbers x and y, the modulus of the degree-L Chebyshev polynomial of the first kind at the complex point x + i y equals the modulus of its leading coefficient times the product of the distances from that point to its L cosine roots.
    L :
    ℕ
    x y :
    ℝ
    ‖(T ℂ (L : ℤ)).eval ((x : ℂ) + (y : ℂ) * I)‖
    = ‖(T ℂ (L : ℤ)).leadingCoeff‖ * ∏ k ∈ range L, ‖((x - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖
    Proof (Lean source)
    theorem norm_eval_chebyshev_eq_leadingCoeff_mul_rootProduct {L : ℕ} (x y : ℝ) : ‖(T ℂ (L : ℤ)).eval ((x : ℂ) + (y : ℂ) * Complex.I)‖ = ‖(T ℂ (L : ℤ)).leadingCoeff‖ * ∏ k ∈ range L, ‖((x - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖ := by let z : ℂ := (x : ℂ) + (y : ℂ) * Complex.I let pR : ℝ[X] := T ℝ (L : ℤ) let pC : ℂ[X] := T ℂ (L : ℤ) have hinj : InjOn (fun k : ℕ => cos ((2 * (k : ℝ) + 1) * pi / (2 * (L : ℝ)))) (range L) := (range L).nodup_map_iff_injOn.mp (Polynomial.Chebyshev.roots_T_real_nodup L) have hcard : pR.roots.card = pR.natDegree := by dsimp [pR] rw [Polynomial.Chebyshev.roots_T_real, Finset.card_val, Finset.card_image_of_injOn hinj, Finset.card_range, Polynomial.Chebyshev.natDegree_T, Int.natAbs_natCast] have hrootsMap : pR.roots.map ofReal = (pR.map Complex.ofRealHom).roots := by simpa using (Polynomial.roots_map_of_injective_of_card_eq_natDegree (p := pR) (f := Complex.ofRealHom) Complex.ofReal_injective hcard) have hmap : pR.map Complex.ofRealHom = pC := by dsimp [pR, pC] exact Polynomial.Chebyshev.map_T Complex.ofRealHom (L : ℤ) have hroots : pC.roots = (range L).val.map (fun k : ℕ => (chebyshevZero L k : ℂ)) := by rw [← hmap, ← hrootsMap] dsimp [pR] rw [Polynomial.Chebyshev.roots_T_real, Finset.image_val_of_injOn hinj, Multiset.map_map] congr 1 funext k apply congrArg ofReal apply congrArg cos norm_num [chebyshevZero, chebyshevRootAngle, Nat.cast_add, Nat.cast_mul] have hcardC : pC.roots.card = pC.natDegree := by rw [hroots, Multiset.card_map, Finset.card_val, Finset.card_range] dsimp [pC] rw [Polynomial.Chebyshev.natDegree_T, Int.natAbs_natCast] have hfac := Polynomial.C_leadingCoeff_mul_prod_multiset_X_sub_C (p := pC) hcardC have heval := congrArg (eval z) hfac rw [eval_mul, eval_C, eval_multiset_prod, hroots] at heval simp only [Multiset.map_map, Function.comp_apply, eval_sub, eval_X, eval_C] at heval change pC.leadingCoeff * (∏ k ∈ range L, (z - (chebyshevZero L k : ℂ))) = pC.eval z at heval rw [← heval, norm_mul, Complex.norm_prod] congr 1 apply Finset.prod_congr rfl intro k hk congr 1 dsimp [z] push_cast ring
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.norm_eval_chebyshev_eq_leadingCoeff_mul_rootProduct · Causalean/Mathlib/Analysis/Approximation/Chebyshev/DuffinSchaeffer.lean:65
  • norm_eval_chebyshev_le_endpoint_vertical theorem — For a real x between −1 and 1 and any real height y, the modulus of the degree-L Chebyshev polynomial of the first kind at the complex point x + i y is at most its modulus at the point 1 + i y.
    L :
    ℕ
    x :
    ℝ
    hx :
    x ∈ Icc (-1) 1
    y :
    ℝ
    ‖(T ℂ (L : ℤ)).eval ((x : ℂ) + (y : ℂ) * I)‖
    ≤ ‖(T ℂ (L : ℤ)).eval ((1 : ℂ) + (y : ℂ) * I)‖
    Proof (Lean source)
    theorem norm_eval_chebyshev_le_endpoint_vertical {L : ℕ} {x : ℝ} (hx : x ∈ Icc (-1) 1) (y : ℝ) : ‖(T ℂ (L : ℤ)).eval ((x : ℂ) + (y : ℂ) * I)‖ ≤ ‖(T ℂ (L : ℤ)).eval ((1 : ℂ) + (y : ℂ) * I)‖ := by by_cases hL : L = 0 · subst L simp have hLpos : 0 < L := Nat.pos_of_ne_zero hL calc ‖(T ℂ (L : ℤ)).eval ((x : ℂ) + (y : ℂ) * I)‖ = ‖(T ℂ (L : ℤ)).leadingCoeff‖ * ∏ k ∈ range L, ‖((x - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖ := norm_eval_chebyshev_eq_leadingCoeff_mul_rootProduct x y _ ≤ ‖(T ℂ (L : ℤ)).leadingCoeff‖ * ∏ k ∈ range L, ‖((1 - chebyshevZero L k : ℝ) : ℂ) + (y : ℂ) * Complex.I‖ := mul_le_mul_of_nonneg_left (prod_norm_sub_chebyshevZero_le_endpoint hLpos hx y) (norm_nonneg _) _ = ‖(T ℂ (L : ℤ)).eval ((1 : ℂ) + (y : ℂ) * I)‖ := by simpa using (norm_eval_chebyshev_eq_leadingCoeff_mul_rootProduct (L := L) (1 : ℝ) y).symm
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.norm_eval_chebyshev_le_endpoint_vertical · Causalean/Mathlib/Analysis/Approximation/Chebyshev/DuffinSchaeffer.lean:132
  • abs_eval_derivative_le_chebyshev_at_root theorem — For a positive degree L and a real polynomial of degree at most L whose absolute value is at most one at each of the L + 1 extremal Chebyshev nodes, at every real root of the degree-L Chebyshev polynomial the derivative of the polynomial is at most the derivative of the Chebyshev polynomial in absolute value.
    L :
    ℕ
    hL :
    0 < L
    Q :
    hQ :
    Q.natDegree ≤ L
    hnodes :
    ∀ i
    if
    i ≤ L
    then
    |Q.eval (node L i)| ≤ 1
    x :
    ℝ
    hx :
    (T ℝ (L : ℤ)).eval x = 0
    |Q.derivative.eval x| ≤ |(T ℝ (L : ℤ)).derivative.eval x|
    Proof (Lean source)
    theorem abs_eval_derivative_le_chebyshev_at_root {L : ℕ} (hL : 0 < L) (Q : Polynomial ℝ) (hQ : Q.natDegree ≤ L) (hnodes : ∀ i, i ≤ L → |Q.eval (Polynomial.Chebyshev.node L i)| ≤ 1) {x : ℝ} (hx : (T ℝ (L : ℤ)).eval x = 0) : |Q.derivative.eval x| ≤ |(T ℝ (L : ℤ)).derivative.eval x| := by classical let s := range (L + 1) let v := Polynomial.Chebyshev.node L let T : ℝ[X] := T ℝ (L : ℤ) let c : ℕ → ℝ := fun i ↦ (basis s v i).derivative.eval x have hQdegree : Q.degree < s.card := by simp only [s, Finset.card_range] exact lt_of_le_of_lt Q.degree_le_natDegree (by exact_mod_cast (Nat.lt_succ_of_le hQ)) have hTdegree : T.degree < s.card := by rw [show T.degree = (L : ℕ) by simp [T], show s.card = L + 1 by simp [s]] exact_mod_cast lt_succ_self L have hQinterp := Lagrange.eq_interpolate (Polynomial.Chebyshev.strictAntiOn_node L).injOn hQdegree have hTinterp := Lagrange.eq_interpolate (Polynomial.Chebyshev.strictAntiOn_node L).injOn hTdegree have hQder : Q.derivative.eval x = ∑ i ∈ s, Q.eval (v i) * c i := by calc Q.derivative.eval x = (Lagrange.interpolate s v (fun i ↦ Q.eval (v i))).derivative.eval x := by rw [← hQinterp] _ = ∑ i ∈ s, Q.eval (v i) * c i := by simp [Lagrange.interpolate_apply, eval_finsetSum, c] have hTder : T.derivative.eval x = ∑ i ∈ s, (-1 : ℝ) ^ i * c i := by calc T.derivative.eval x = (Lagrange.interpolate s v (fun i ↦ T.eval (v i))).derivative.eval x := by rw [← hTinterp] _ = ∑ i ∈ s, (-1 : ℝ) ^ i * c i := by rw [show (Lagrange.interpolate s v (fun i ↦ T.eval (v i))).derivative.eval x = ∑ i ∈ s, T.eval (v i) * c i by simp [Lagrange.interpolate_apply, eval_finsetSum, c]] apply Finset.sum_congr rfl intro i hi have hiL : i ≤ L := by simpa [s] using hi rw [show T.eval (v i) = (-1 : ℝ) ^ i by exact Polynomial.Chebyshev.eval_T_real_node (Finset.mem_Iic.mpr hiL)] have hsign : ∀ i ∈ s, 0 < (-1 : ℝ) ^ i * c i * T.derivative.eval x := by intro i hi have hiL : i ≤ L := by simpa [s] using hi exact negOnePow_mul_derivative_basis_mul_derivative_T_pos hL hx hiL have hD : T.derivative.eval x ≠ 0 := by intro hzero have := hsign 0 (by simp [s]) rw [hzero, mul_zero] at this exact lt_irrefl 0 this have hmass : ∑ i ∈ s, |c i| = |T.derivative.eval x| := by rcases lt_or_gt_of_ne hD with hneg | hpos · rw [abs_of_neg hneg, hTder, ← Finset.sum_neg_distrib] apply Finset.sum_congr rfl intro i hi have hci : (-1 : ℝ) ^ i * c i < 0 := by have := hsign i hi nlinarith calc |c i| = |(-1 : ℝ) ^ i * c i| := by rw [abs_mul, abs_neg_one_pow, one_mul] _ = -((-1 : ℝ) ^ i * c i) := abs_of_neg hci · rw [abs_of_pos hpos, hTder] apply Finset.sum_congr rfl intro i hi have hci : 0 < (-1 : ℝ) ^ i * c i := by have := hsign i hi nlinarith calc |c i| = |(-1 : ℝ) ^ i * c i| := by rw [abs_mul, abs_neg_one_pow, one_mul] _ = (-1 : ℝ) ^ i * c i := abs_of_pos hci calc |Q.derivative.eval x| = |∑ i ∈ s, Q.eval (v i) * c i| := by rw [hQder] _ ≤ ∑ i ∈ s, |Q.eval (v i) * c i| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ i ∈ s, |c i| := by apply Finset.sum_le_sum intro i hi rw [abs_mul] have hiL : i ≤ L := by simpa [s] using hi calc |Q.eval (v i)| * |c i| ≤ 1 * |c i| := mul_le_mul_of_nonneg_right (by simpa [v] using hnodes i hiL) (abs_nonneg _) _ = |c i| := one_mul _ _ = |T.derivative.eval x| := hmass
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.abs_eval_derivative_le_chebyshev_at_root · Causalean/Mathlib/Analysis/Approximation/Chebyshev/DuffinSchaeffer.lean:333
  • abs_eval_derivative_le_sq_of_chebyshev_root_control theorem — For a positive degree L and a real polynomial of degree at most L, if at every real root of the degree-L Chebyshev polynomial the derivative of the polynomial is at most the derivative of the Chebyshev polynomial in absolute value, then at every point between −1 and 1 the derivative of the polynomial is at most L² in absolute value.
    L :
    ℕ
    hL :
    0 < L
    Q :
    hQ :
    Q.natDegree ≤ L
    hroots :
    ∀ z : ℝ
    if
    (T ℝ (L : ℤ)).eval z = 0
    then
    |Q.derivative.eval z| ≤ |(T ℝ (L : ℤ)).derivative.eval z|
    x :
    ℝ
    hx :
    x ∈ Icc (-1) 1
    |Q.derivative.eval x| ≤ (L : ℝ) ^ 2
    Proof (Lean source)
    theorem abs_eval_derivative_le_sq_of_chebyshev_root_control {L : ℕ} (hL : 0 < L) (Q : Polynomial ℝ) (hQ : Q.natDegree ≤ L) (hroots : ∀ z : ℝ, (T ℝ (L : ℤ)).eval z = 0 → |Q.derivative.eval z| ≤ |(T ℝ (L : ℤ)).derivative.eval z|) {x : ℝ} (hx : x ∈ Icc (-1) 1) : |Q.derivative.eval x| ≤ (L : ℝ) ^ 2 := by have hendpoint := abs_eval_derivative_le_chebyshev_endpoint_of_root_control hL Q hQ hroots (fun y ↦ norm_eval_chebyshev_le_endpoint_vertical hx y) rw [Polynomial.Chebyshev.derivative_T_eval_one] at hendpoint simpa [abs_of_nonneg (sq_nonneg (L : ℝ))] using hendpoint
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.abs_eval_derivative_le_sq_of_chebyshev_root_control · Causalean/Mathlib/Analysis/Approximation/Chebyshev/DuffinSchaeffer.lean:430
  • eval_derivative_eq_sum_chebyshevDerivativeWeight theorem — For a real polynomial of degree at most L and any real point x, the derivative of the polynomial at x equals the sum, over the L + 1 extremal Chebyshev nodes, of the polynomial's value at the node times the Chebyshev differentiation weight for that node at x.
    Q :
    L :
    ℕ
    hQ :
    Q.natDegree ≤ L
    x :
    ℝ
    Q.derivative.eval x
    = ∑ i ∈ range (L + 1), Q.eval (node L i) * chebyshevDerivativeWeight L x i
    Proof (Lean source)
    theorem eval_derivative_eq_sum_chebyshevDerivativeWeight (Q : Polynomial ℝ) {L : ℕ} (hQ : Q.natDegree ≤ L) (x : ℝ) : Q.derivative.eval x = ∑ i ∈ range (L + 1), Q.eval (node L i) * chebyshevDerivativeWeight L x i := by classical have hdegree : Q.degree < (range (L + 1)).card := by rw [Finset.card_range] exact lt_of_le_of_lt Q.degree_le_natDegree (by exact_mod_cast (Nat.lt_succ_of_le hQ)) have hinterp := Lagrange.eq_interpolate (Polynomial.Chebyshev.strictAntiOn_node L).injOn hdegree calc Q.derivative.eval x = (Lagrange.interpolate (range (L + 1)) (node L) (fun i ↦ Q.eval (node L i))).derivative.eval x := by rw [← hinterp] _ = ∑ i ∈ range (L + 1), Q.eval (node L i) * chebyshevDerivativeWeight L x i := by simp [Lagrange.interpolate_apply, eval_finsetSum, chebyshevDerivativeWeight]
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.eval_derivative_eq_sum_chebyshevDerivativeWeight · Causalean/Mathlib/Analysis/Approximation/Chebyshev/DuffinSchaeffer.lean:457
  • sum_abs_chebyshevDerivativeWeight_le_sq theorem — For a positive degree L and a point x between −1 and 1, the absolute values of the L + 1 Chebyshev differentiation weights at x sum to at most L².
    L :
    ℕ
    hL :
    0 < L
    x :
    ℝ
    hx :
    x ∈ Icc (-1) 1
    ∑ i ∈ range (L + 1), |chebyshevDerivativeWeight L x i| ≤ (L : ℝ) ^ 2
    Proof (Lean source)
    theorem sum_abs_chebyshevDerivativeWeight_le_sq {L : ℕ} (hL : 0 < L) {x : ℝ} (hx : x ∈ Icc (-1) 1) : ∑ i ∈ range (L + 1), |chebyshevDerivativeWeight L x i| ≤ (L : ℝ) ^ 2 := by classical let s : Finset ℕ := range (L + 1) let v : ℕ → ℝ := Polynomial.Chebyshev.node L let c : ℕ → ℝ := fun i ↦ chebyshevDerivativeWeight L x i let ε : ℕ → ℝ := fun i ↦ if c i < 0 then -1 else 1 let P : Polynomial ℝ := Lagrange.interpolate s v ε have hinj : InjOn v s := Polynomial.Chebyshev.strictAntiOn_node L |>.injOn have hPdeg : P.natDegree ≤ L := by rw [Polynomial.natDegree_le_iff_degree_le] have hdegree := Lagrange.degree_interpolate_le ε hinj simpa [P, s] using hdegree have hPnodes : ∀ i, i ≤ L → |P.eval (Polynomial.Chebyshev.node L i)| ≤ 1 := by intro i hi have his : i ∈ s := by simp [s, hi] rw [show Polynomial.Chebyshev.node L i = v i from rfl] rw [show P.eval (v i) = ε i by exact Lagrange.eval_interpolate_at_node ε hinj his] simp only [ε] split <;> norm_num have hroot : ∀ z : ℝ, (T ℝ (L : ℤ)).eval z = 0 → |P.derivative.eval z| ≤ |(T ℝ (L : ℤ)).derivative.eval z| := by intro z hz exact abs_eval_derivative_le_chebyshev_at_root hL P hPdeg hPnodes hz have hPder : P.derivative.eval x = ∑ i ∈ s, ε i * c i := by rw [eval_derivative_eq_sum_chebyshevDerivativeWeight P hPdeg x] apply Finset.sum_congr rfl intro i hi rw [show P.eval (Polynomial.Chebyshev.node L i) = ε i by exact Lagrange.eval_interpolate_at_node ε hinj hi] have hmass : ∑ i ∈ s, |c i| = P.derivative.eval x := by rw [hPder] apply Finset.sum_congr rfl intro i hi by_cases hci : c i < 0 · simp [ε, hci, abs_of_neg hci] · have hci' : 0 ≤ c i := le_of_not_gt hci simp [ε, hci, abs_of_nonneg hci'] calc ∑ i ∈ range (L + 1), |chebyshevDerivativeWeight L x i| = P.derivative.eval x := by simpa [s, c] using hmass _ ≤ |P.derivative.eval x| := le_abs_self _ _ ≤ (L : ℝ) ^ 2 := abs_eval_derivative_le_sq_of_chebyshev_root_control hL P hPdeg hroot hx
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.sum_abs_chebyshevDerivativeWeight_le_sq · Causalean/Mathlib/Analysis/Approximation/Chebyshev/DuffinSchaeffer.lean:484
Equioscillation 2 core · 1 supporting This module combines strict sign-matching perturbations with extremal sign polynomials to prove the necessity direction of Chebyshev's alternation theorem. ★ exists_equioscillationWitness

Equioscillation of best bounded-degree approximants

This module combines strict sign-matching perturbations with extremal sign polynomials to prove the necessity direction of Chebyshev's alternation theorem.

structure EquioscillationWitness reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

An equioscillation witness for a target on an interval at a chosen degree records a best polynomial, strictly ordered interval nodes, and an orientation under which the residual has the optimal magnitude with alternating signs.

Definition (Lean source)
f :
ℝ → ℝ
r s :
ℝ
L :
ℕ
approximant :
approximant_degree :
approximant.natDegree ≤ L
approximant_best :
uniformApproxError f r s approximant = bestUniformApproxError f r s L
nodes :
Fin (L + 2) → ℝ
nodes_strictMono :
nodes_mem :
∀ i, nodes i ∈ Icc r s
orientation :
ℝ
orientation_eq :
orientation = 1 ∨ orientation = -1
equioscillation :
∀ i,
f (nodes i) - approximant.eval (nodes i)
= orientation * (-1 : ℝ) ^ (i : ℕ) * bestUniformApproxError f r s L
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.EquioscillationWitness · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Equioscillation.lean:161
theorem exists_equioscillationWitness reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

For endpoints with r strictly less than s, a target function continuous on the closed interval between them, and any degree bound L, there exists an equioscillation witness: a best polynomial of degree at most L together with L + 2 strictly increasing points of the interval at which the residual equals the best uniform error in magnitude with alternating signs.

Formal statement
f :
ℝ → ℝ
r s :
ℝ
hrs :
r < s
hf :
L :
ℕ
Nonempty (EquioscillationWitness f r s L)
Proof (Lean source)
theorem exists_equioscillationWitness {f : ℝ → ℝ} {r s : ℝ} (hrs : r < s) (hf : ContinuousOn f (Icc r s)) (L : ℕ) : Nonempty (EquioscillationWitness f r s L) := by classical obtain ⟨Q, hQdegree, hQbest⟩ := exists_bestPolynomial hrs hf L let g : ℝ → ℝ := fun x ↦ f x - Q.eval x have hg : ContinuousOn g (Icc r s) := hf.sub Q.continuous.continuousOn have hgError : intervalSupNorm g r s = bestUniformApproxError f r s L := by simpa [g, uniformApproxError] using hQbest have hErrorNonneg : 0 ≤ bestUniformApproxError f r s L := bestUniformApproxError_nonneg hrs hf L by_cases hErrorZero : bestUniformApproxError f r s L = 0 · let nodes : Fin (L + 2) → ℝ := fun i ↦ r + (i : ℝ) * (s - r) / (L + 1 : ℝ) have hdenom : 0 < (L + 1 : ℝ) := by positivity have hnodesMono : StrictMono nodes := by intro i j hij have hijReal : (i : ℝ) < (j : ℝ) := by exact_mod_cast hij dsimp [nodes] have hlength : 0 < s - r := sub_pos.mpr hrs simpa [add_comm] using add_lt_add_left (div_lt_div_of_pos_right (mul_lt_mul_of_pos_right hijReal hlength) hdenom) r have hnodesMem : ∀ i, nodes i ∈ Icc r s := by intro i have hi : (i : ℕ) ≤ L + 1 := by omega have hiReal : (i : ℝ) ≤ (L + 1 : ℝ) := by exact_mod_cast hi have hiNonneg : (0 : ℝ) ≤ (i : ℝ) := by positivity have hlength : 0 < s - r := sub_pos.mpr hrs dsimp [nodes] constructor · have : 0 ≤ (i : ℝ) * (s - r) / (L + 1 : ℝ) := by positivity linarith · have hfrac : (i : ℝ) / (L + 1 : ℝ) ≤ 1 := by exact (div_le_one hdenom).2 hiReal calc r + (i : ℝ) * (s - r) / (L + 1 : ℝ) = r + ((i : ℝ) / (L + 1 : ℝ)) * (s - r) := by ring _ ≤ r + 1 * (s - r) := by gcongr _ = s := by ring have hgZero : ∀ x ∈ Icc r s, g x = 0 := by intro x hx have hsup : intervalSupNorm g r s ≤ 0 := by rw [hgError, hErrorZero] have habs := (intervalSupNorm_le_iff hg hrs.le).mp hsup x hx exact abs_eq_zero.mp (le_antisymm habs (abs_nonneg _)) exact ⟨ { approximant := Q approximant_degree := hQdegree approximant_best := hQbest nodes := nodes nodes_strictMono := hnodesMono nodes_mem := hnodesMem orientation := 1 orientation_eq := inl rfl equioscillation := by intro i rw [hErrorZero] simp only [mul_zero] exact hgZero (nodes i) (hnodesMem i) }⟩ · have hErrorPos : 0 < bestUniformApproxError f r s L := lt_of_le_of_ne hErrorNonneg (Ne.symm hErrorZero) have hAlternates : ∃ nodes orientation, IsAlternatingExtrema g r s L nodes orientation := by by_contra hno obtain ⟨P, hPdegree, hPsign⟩ := exists_signPolynomial_of_no_alternatingExtrema hrs hg L (by simpa [hgError] using hErrorPos) hno obtain ⟨t, ht, himprove⟩ := exists_strict_uniformImprovement hrs.le hg (by simpa [hgError] using hErrorPos) hPsign let R : Polynomial ℝ := Q + C t * P have hRdegree : R.natDegree ≤ L := by calc R.natDegree ≤ max Q.natDegree (C t * P).natDegree := by dsimp [R] exact natDegree_add_le _ _ _ ≤ L := by apply max_le hQdegree calc (C t * P).natDegree ≤ (C t).natDegree + P.natDegree := natDegree_mul_le _ ≤ L := by simpa using hPdegree have hResidual : uniformApproxError f r s R = intervalSupNorm (fun x ↦ g x - t * P.eval x) r s := by unfold uniformApproxError congr 2 funext x simp [R, g] ring have hRlower := bestUniformApproxError_le (f := f) (r := r) (s := s) hRdegree have hRstrict : uniformApproxError f r s R < bestUniformApproxError f r s L := by rw [hResidual, ← hgError] exact himprove exact (not_lt_of_ge hRlower) hRstrict obtain ⟨nodes, orientation, hmono, hmem, horientation, halternates⟩ := hAlternates exact ⟨ { approximant := Q approximant_degree := hQdegree approximant_best := hQbest nodes := nodes nodes_strictMono := hmono nodes_mem := hmem orientation := orientation orientation_eq := horientation equioscillation := by intro i change g (nodes i) = _ rw [halternates i, hgError] }⟩
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.exists_equioscillationWitness · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Equioscillation.lean:182 · uses EquioscillationWitness
1 supporting declaration (lemmas, instances)
  • exists_strict_uniformImprovement theorem — For a function g continuous on the closed interval from r to s with r at most s whose supremum norm on that interval is strictly positive, if at every point of the interval where the absolute value of g equals that supremum norm, the product of g and a given polynomial is strictly positive, then some strictly positive multiple of the polynomial can be subtracted from g so that the supremum norm on the interval becomes strictly smaller.
    g :
    ℝ → ℝ
    r s :
    ℝ
    hrs :
    r ≤ s
    hg :
    Q :
    hE :
    0 < intervalSupNorm g r s
    hsign :
    ∀ x ∈ Icc r s
    if
    |g x| = intervalSupNorm g r s
    then
    0 < g x * Q.eval x
    ∃ t : ℝ,
    conclusion 1
    0 < t
    conclusion 2
    intervalSupNorm (fun x ↦ g x - t * Q.eval x) r s < intervalSupNorm g r s
    Proof (Lean source)
    theorem exists_strict_uniformImprovement {g : ℝ → ℝ} {r s : ℝ} (hrs : r ≤ s) (hg : ContinuousOn g (Icc r s)) {Q : Polynomial ℝ} (hE : 0 < intervalSupNorm g r s) (hsign : ∀ x ∈ Icc r s, |g x| = intervalSupNorm g r s → 0 < g x * Q.eval x) : ∃ t : ℝ, 0 < t ∧ intervalSupNorm (fun x ↦ g x - t * Q.eval x) r s < intervalSupNorm g r s := by let E := intervalSupNorm g r s let q : ℝ → ℝ := fun x ↦ Q.eval x let p : ℝ → ℝ := fun x ↦ g x * q x have hIcc_ne : (Icc r s).Nonempty := ⟨r, le_rfl, hrs⟩ have hq : Continuous q := Q.continuous have hp : ContinuousOn p (Icc r s) := hg.mul hq.continuousOn have habs_le : ∀ x ∈ Icc r s, |g x| ≤ E := by simpa [E] using (intervalSupNorm_le_iff hg hrs).mp (le_refl (intervalSupNorm g r s)) obtain ⟨xE, hxE, hEmax, -⟩ := isCompact_Icc.exists_sSup_image_eq_and_ge hIcc_ne hg.abs have hxE_eq : |g xE| = E := by simpa [E, intervalSupNorm] using hEmax.symm have hp_xE : 0 < p xE := by exact hsign xE hxE (by simpa [E] using hxE_eq) let B : Set ℝ := {x | x ∈ Icc r s ∧ p x ≤ 0} have hBcompact : IsCompact B := by apply IsCompact.of_isClosed_subset isCompact_Icc (isClosed_Icc.isClosed_le hp continuousOn_const) exact fun _ hx ↦ hx.1 have hc : ∃ c : ℝ, c < E ∧ ∀ x ∈ Icc r s, c ≤ |g x| → 0 < p x := by by_cases hBne : B.Nonempty · obtain ⟨xb, hxb, hxb_max⟩ := hBcompact.exists_isMaxOn hBne (hg.abs.mono (fun _ hx ↦ hx.1)) have hxb_lt : |g xb| < E := by apply lt_of_le_of_ne (habs_le xb hxb.1) intro heq have : 0 < p xb := hsign xb hxb.1 (by simpa [E] using heq) linarith [hxb.2] refine ⟨(|g xb| + E) / 2, by linarith, ?_⟩ intro x hx hcx by_contra hnot have hxB : x ∈ B := ⟨hx, le_of_not_gt hnot⟩ have hmax_le : |g x| ≤ |g xb| := hxb_max hxB linarith · refine ⟨E / 2, by linarith [hE], ?_⟩ intro x hx _ by_contra hnot exact hBne ⟨x, hx, le_of_not_gt hnot⟩ obtain ⟨c, hcE, hc⟩ := hc let A : Set ℝ := {x | x ∈ Icc r s ∧ c ≤ |g x|} have hAcompact : IsCompact A := by apply IsCompact.of_isClosed_subset isCompact_Icc (isClosed_Icc.isClosed_le continuousOn_const hg.abs) exact fun _ hx ↦ hx.1 have hxEA : xE ∈ A := ⟨hxE, by linarith [hxE_eq]⟩ obtain ⟨xm, hxm, hxm_min⟩ := hAcompact.exists_isMinOn ⟨xE, hxEA⟩ (hp.mono (fun _ hx ↦ hx.1)) let m := p xm have hm : 0 < m := by exact hc xm hxm.1 hxm.2 obtain ⟨xM, hxM, hxM_max⟩ := isCompact_Icc.exists_isMaxOn hIcc_ne hq.abs.continuousOn let M := |q xM| have hq_le : ∀ x ∈ Icc r s, |q x| ≤ M := by intro x hx exact hxM_max hx have hM : 0 < M := by have hqE_ne : q xE ≠ 0 := by intro hzero simp [p, hzero] at hp_xE have hqE_pos : 0 < |q xE| := abs_pos.mpr hqE_ne exact lt_of_lt_of_le hqE_pos (hq_le xE hxE) let t := min (m / M ^ 2) ((E - c) / (2 * M)) have ht₁ : 0 < m / M ^ 2 := div_pos hm (sq_pos_of_pos hM) have ht₂ : 0 < (E - c) / (2 * M) := div_pos (sub_pos.mpr hcE) (mul_pos (by norm_num) hM) have ht : 0 < t := lt_min ht₁ ht₂ refine ⟨t, ht, ?_⟩ unfold intervalSupNorm apply (isCompact_Icc.sSup_lt_iff_of_continuous hIcc_ne ((hg.sub (hq.const_mul t).continuousOn).abs) E).2 intro x hx have hgx := habs_le x hx have hqx := hq_le x hx by_cases hhigh : c ≤ |g x| · have hxA : x ∈ A := ⟨hx, hhigh⟩ have hmp : m ≤ p x := hxm_min hxA have htM : t ≤ m / M ^ 2 := min_le_left _ _ have hq_sq : q x ^ 2 ≤ M ^ 2 := by simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg (q x)) (abs_nonneg M)).2 (by simpa [abs_of_pos hM] using hqx) have hmove : t * q x ^ 2 < 2 * p x := by have hM_sq : 0 < M ^ 2 := sq_pos_of_pos hM have ht_bound : t * M ^ 2 ≤ m := by apply (le_div_iff₀ hM_sq).mp simpa [mul_comm] using htM nlinarith [mul_le_mul_of_nonneg_left hq_sq (le_of_lt ht)] have hsquares : (g x - t * q x) ^ 2 < E ^ 2 := by calc (g x - t * q x) ^ 2 = g x ^ 2 - 2 * t * p x + t ^ 2 * q x ^ 2 := by simp only [p] ring _ < g x ^ 2 := by nlinarith _ ≤ E ^ 2 := by simpa only [sq_abs] using (sq_le_sq₀ (abs_nonneg (g x)) (le_of_lt hE)).2 hgx rw [← sq_abs] at hsquares exact (sq_lt_sq₀ (abs_nonneg _) (le_of_lt hE)).mp hsquares · have htM : t ≤ (E - c) / (2 * M) := min_le_right _ _ have ht_bound : t * M ≤ (E - c) / 2 := by have htwoM : 0 < 2 * M := mul_pos (by norm_num) hM have := (le_div_iff₀ htwoM).mp htM nlinarith calc |g x - t * q x| ≤ |g x| + |t * q x| := abs_sub _ _ _ = |g x| + t * |q x| := by rw [abs_mul, abs_of_pos ht] _ ≤ |g x| + t * M := by gcongr _ < E := by have : |g x| < c := lt_of_not_ge hhigh nlinarith [sub_pos.mpr hcE]
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.exists_strict_uniformImprovement · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Equioscillation.lean:28
Equispaced­Distance 1 core · 2 supporting The two sides of a deleted grid point give separate factorial products. ★ equispacedDistance_erase_split

Products of distances on an equispaced finite grid

The two sides of a deleted grid point give separate factorial products. These finite-product identities isolate the arithmetic in the denominator of a Lagrange basis polynomial.

theorem equispacedDistance_erase_split reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

For a grid order D and a grid index j between 0 and D, the product of the distances |j − i| over all grid indices i other than j equals the product of j − i over i below j times the product of i − j over i from j + 1 to D.

Formal statement
D :
ℕ
j :
Fin (D + 1)
(∏ i ∈ (Finset.univ : Finset (Fin (D + 1))).erase j, |(j : ℝ) - (i : ℝ)|)
= (∏ i ∈ range (j : ℕ), ((j : ℝ) - (i : ℝ))) * (∏ i ∈ Ico ((j : ℕ) + 1) (D + 1), ((i : ℝ) - (j : ℝ)))
Proof (Lean source)
theorem equispacedDistance_erase_split (D : ℕ) (j : Fin (D + 1)) : (∏ i ∈ (Finset.univ : Finset (Fin (D + 1))).erase j, |(j : ℝ) - (i : ℝ)|) = (∏ i ∈ range (j : ℕ), ((j : ℝ) - (i : ℝ))) * (∏ i ∈ Ico ((j : ℕ) + 1) (D + 1), ((i : ℝ) - (j : ℝ))) := by classical have hdisj : Disjoint (range (j : ℕ)) (Ico ((j : ℕ) + 1) (D + 1)) := by apply Finset.disjoint_left.mpr intro i hi₁ hi₂ have h₁ := Finset.mem_range.mp hi₁ have h₂ := (Finset.mem_Ico.mp hi₂).1 omega calc (∏ i ∈ (Finset.univ : Finset (Fin (D + 1))).erase j, |(j : ℝ) - (i : ℝ)|) = ∏ i ∈ range (j : ℕ) ∪ Ico ((j : ℕ) + 1) (D + 1), |(j : ℝ) - (i : ℝ)| := by apply Finset.prod_bij (fun (i : Fin (D + 1)) _ => i.val) · intro i hi have hne : i ≠ j := (Finset.mem_erase.mp hi).1 have hlt : (i : ℕ) < D + 1 := i.isLt simp only [mem_union, Finset.mem_range, Finset.mem_Ico] omega · intro i hi k hk heq exact Fin.ext heq · intro k hk have hmem : k < D + 1 := by rcases Finset.mem_union.mp hk with h | h · have hj : (j : ℕ) < D + 1 := j.isLt exact lt_trans (Finset.mem_range.mp h) hj · exact (Finset.mem_Ico.mp h).2 refine ⟨⟨k, hmem⟩, ?_, rfl⟩ simp only [Finset.mem_erase, Finset.mem_univ, and_true] rcases Finset.mem_union.mp hk with h | h · have hlt := Finset.mem_range.mp h exact Fin.ne_of_val_ne (by omega : k ≠ (j : ℕ)) · have hgt := (Finset.mem_Ico.mp h).1 exact Fin.ne_of_val_ne (by omega : k ≠ (j : ℕ)) · intro i hi rfl _ = (∏ i ∈ range (j : ℕ), |(j : ℝ) - (i : ℝ)|) * (∏ i ∈ Ico ((j : ℕ) + 1) (D + 1), |(j : ℝ) - (i : ℝ)|) := by exact Finset.prod_union hdisj _ = (∏ i ∈ range (j : ℕ), ((j : ℝ) - (i : ℝ))) * (∏ i ∈ Ico ((j : ℕ) + 1) (D + 1), ((i : ℝ) - (j : ℝ))) := by congr 1 · apply Finset.prod_congr rfl intro i hi rw [abs_of_nonneg] exact sub_nonneg.mpr (by exact_mod_cast (Finset.mem_range.mp hi).le) · apply Finset.prod_congr rfl intro i hi rw [abs_sub_comm, abs_of_nonneg] exact sub_nonneg.mpr (by exact_mod_cast (le_of_lt (by have hgt := (Finset.mem_Ico.mp hi).1 omega : (j : ℕ) < i)))
Causalean.Mathlib.Analysis.Approximation.Chebyshev.equispacedDistance_erase_split · Causalean/Mathlib/Analysis/Approximation/Chebyshev/EquispacedDistance.lean:60
2 supporting declarations (lemmas, instances)
  • equispacedDistance_lower_factorial theorem — The product of positive integer distances from j to the indices below it is j!.
    j :
    ℕ
    (∏ i ∈ range j, ((j : ℝ) - (i : ℝ))) = (j.factorial : ℝ)
    Proof (Lean source)
    theorem equispacedDistance_lower_factorial (j : ℕ) : (∏ i ∈ range j, ((j : ℝ) - (i : ℝ))) = (j.factorial : ℝ) := by calc (∏ i ∈ range j, ((j : ℝ) - (i : ℝ))) = ∏ i ∈ range j, (((j - 1 - i + 1 : ℕ) : ℝ)) := by apply Finset.prod_congr rfl intro i hi have hij : i < j := Finset.mem_range.mp hi rw [← Nat.cast_sub (le_of_lt hij)] congr 1 omega _ = ∏ i ∈ range j, (((i + 1 : ℕ) : ℝ)) := Finset.prod_range_reflect (fun i : ℕ => ((i + 1 : ℕ) : ℝ)) j _ = (j.factorial : ℝ) := by norm_cast exact Finset.prod_range_add_one_eq_factorial j
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.equispacedDistance_lower_factorial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/EquispacedDistance.lean:19
  • equispacedDistance_upper_factorial theorem — The product of positive integer distances from j to the indices above it through D is (D-j)!.
    D :
    ℕ
    j :
    Fin (D + 1)
    (∏ i ∈ Ico ((j : ℕ) + 1) (D + 1), ((i : ℝ) - (j : ℝ)))
    = ((D - (j : ℕ)).factorial : ℝ)
    Proof (Lean source)
    theorem equispacedDistance_upper_factorial (D : ℕ) (j : Fin (D + 1)) : (∏ i ∈ Ico ((j : ℕ) + 1) (D + 1), ((i : ℝ) - (j : ℝ))) = ((D - (j : ℕ)).factorial : ℝ) := by rw [Finset.prod_Ico_eq_prod_range] have hj : (j : ℕ) ≤ D := Nat.lt_succ_iff.mp j.isLt have hsub : D + 1 - ((j : ℕ) + 1) = D - (j : ℕ) := by omega rw [hsub] calc _ = ∏ i ∈ range (D - (j : ℕ)), (((i + 1 : ℕ) : ℝ)) := by apply Finset.prod_congr rfl intro i hi push_cast ring _ = ((D - (j : ℕ)).factorial : ℝ) := by norm_cast exact Finset.prod_range_add_one_eq_factorial _
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.equispacedDistance_upper_factorial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/EquispacedDistance.lean:39
Equispaced­Lagrange 3 core · 5 supporting Coefficients of a degree-bounded real polynomial are recovered from a fixed grid in the unit interval. ★ equispacedLagrange_coeff_recovery

Quantitative equispaced Lagrange interpolation

Coefficients of a degree-bounded real polynomial are recovered from a fixed grid in the unit interval. The sum of the absolute recovery weights has an exponential degree bound. These one-variable facts are the lower layer for tensor coefficient bounds.

def equispacedLagrangeNode reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A grid order D and node index j between 0 and D determine the equally spaced unit-interval node j/(D + 1).

Definition (Lean source)
D :
ℕ
j :
Fin (D + 1)
equispacedLagrangeNode D j :
ℝ
(j : ℝ) / (D + 1)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.equispacedLagrangeNode · Causalean/Mathlib/Analysis/Approximation/Chebyshev/EquispacedLagrange.lean:27
def equispacedLagrangeWeight reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A grid order D, coefficient index k, and node index j determine the Lagrange coefficient-recovery weight: the coefficient of the k-th power in the Lagrange basis polynomial that equals one at the j-th equally spaced node j/(D + 1) and zero at the other D nodes.

Definition (Lean source)
D :
ℕ
k j :
Fin (D + 1)
equispacedLagrangeWeight D k j :
ℝ
Causalean.Mathlib.Analysis.Approximation.Chebyshev.equispacedLagrangeWeight · Causalean/Mathlib/Analysis/Approximation/Chebyshev/EquispacedLagrange.lean:34
theorem equispacedLagrange_coeff_recovery reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

For a grid order D and a real polynomial of degree at most D, and a coefficient index k between 0 and D, the k-th monomial coefficient of the polynomial equals the sum over the D + 1 equally spaced nodes j/(D + 1) of the Lagrange recovery weight for k and j times the polynomial's value at that node.

Formal statement
D :
ℕ
p :
hp :
p.natDegree ≤ D
k :
Fin (D + 1)
p.coeff k
= ∑ j : Fin (D + 1), equispacedLagrangeWeight D k j * p.eval (equispacedLagrangeNode D j)
Proof (Lean source)
theorem equispacedLagrange_coeff_recovery (D : ℕ) (p : Polynomial ℝ) (hp : p.natDegree ≤ D) (k : Fin (D + 1)) : p.coeff k = ∑ j : Fin (D + 1), equispacedLagrangeWeight D k j * p.eval (equispacedLagrangeNode D j) := by have hnode : Injective (equispacedLagrangeNode D) := by intro a b hab have hden : (D + 1 : ℝ) ≠ 0 := by positivity dsimp [equispacedLagrangeNode] at hab have hab' : (a : ℝ) = (b : ℝ) := by field_simp [hden] at hab exact hab exact Fin.ext (Nat.cast_injective hab') have hdeg : p.degree < (Finset.univ : Finset (Fin (D + 1))).card := by simp only [Finset.card_univ, Fintype.card_fin] exact lt_of_le_of_lt (degree_le_of_natDegree_le hp) (WithBot.coe_lt_coe.mpr (lt_succ_self D)) have hinterp := Lagrange.eq_interpolate (s := Finset.univ) (v := equispacedLagrangeNode D) hnode.injOn hdeg conv_lhs => rw [hinterp, Lagrange.interpolate_apply, finsetSum_coeff] simp only [coeff_C_mul] exact Finset.sum_congr rfl fun j _ => mul_comm _ _
Causalean.Mathlib.Analysis.Approximation.Chebyshev.equispacedLagrange_coeff_recovery · Causalean/Mathlib/Analysis/Approximation/Chebyshev/EquispacedLagrange.lean:120 · uses equispacedLagrangeNode , equispacedLagrangeWeight
5 supporting declarations (lemmas, instances)
  • equispacedLagrange_denominator_abs theorem — The absolute product of distances from one equispaced node to all the other nodes is j! (D-j)! / (D+1)^D.
    D :
    ℕ
    j :
    Fin (D + 1)
    |∏ i ∈ (Finset.univ : Finset (Fin (D + 1))).erase j, (equispacedLagrangeNode D j - equispacedLagrangeNode D i)|
    = (((j : ℕ).factorial : ℝ) * ((D - (j : ℕ)).factorial : ℝ)) / (D + 1 : ℝ) ^ D
    Proof (Lean source)
    theorem equispacedLagrange_denominator_abs (D : ℕ) (j : Fin (D + 1)) : |∏ i ∈ (Finset.univ : Finset (Fin (D + 1))).erase j, (equispacedLagrangeNode D j - equispacedLagrangeNode D i)| = (((j : ℕ).factorial : ℝ) * ((D - (j : ℕ)).factorial : ℝ)) / (D + 1 : ℝ) ^ D := by have hden : (D + 1 : ℝ) ≠ 0 := by positivity have hcard : ((Finset.univ : Finset (Fin (D + 1))).erase j).card = D := by simp calc |∏ i ∈ (Finset.univ : Finset (Fin (D + 1))).erase j, (equispacedLagrangeNode D j - equispacedLagrangeNode D i)| = ∏ i ∈ (Finset.univ : Finset (Fin (D + 1))).erase j, |(j : ℝ) - (i : ℝ)| / (D + 1 : ℝ) := by rw [Finset.abs_prod] apply Finset.prod_congr rfl intro i _ rw [equispacedLagrangeNode, equispacedLagrangeNode, ← sub_div, abs_div, abs_of_nonneg (by positivity : (0 : ℝ) ≤ D + 1)] _ = (∏ i ∈ (Finset.univ : Finset (Fin (D + 1))).erase j, |(j : ℝ) - (i : ℝ)|) / (D + 1 : ℝ) ^ D := by rw [Finset.prod_div_distrib, Finset.prod_const, hcard] _ = _ := by rw [equispacedDistance_erase_split, equispacedDistance_lower_factorial, equispacedDistance_upper_factorial]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.equispacedLagrange_denominator_abs · Causalean/Mathlib/Analysis/Approximation/Chebyshev/EquispacedLagrange.lean:42
  • equispacedLagrange_reciprocal_factorial_sum theorem — The sum of reciprocal factorial pairs over the equispaced grid equals 2^D / D!.
    D :
    ℕ
    (∑ j : Fin (D + 1), 1 / (((j : ℕ).factorial : ℝ) * ((D - (j : ℕ)).factorial : ℝ)))
    = (2 : ℝ) ^ D / (D.factorial : ℝ)
    Proof (Lean source)
    theorem equispacedLagrange_reciprocal_factorial_sum (D : ℕ) : (∑ j : Fin (D + 1), 1 / (((j : ℕ).factorial : ℝ) * ((D - (j : ℕ)).factorial : ℝ))) = (2 : ℝ) ^ D / (D.factorial : ℝ) := by have hterm (k : ℕ) (hk : k ≤ D) : 1 / ((k.factorial : ℝ) * ((D - k).factorial : ℝ)) = (D.choose k : ℝ) / (D.factorial : ℝ) := by have h := Nat.choose_mul_factorial_mul_factorial hk have h' : (D.choose k : ℝ) * (k.factorial : ℝ) * ((D - k).factorial : ℝ) = (D.factorial : ℝ) := by exact_mod_cast h have hfac : (D.factorial : ℝ) ≠ 0 := by positivity have hkfac : (k.factorial : ℝ) ≠ 0 := by positivity have hsubfac : ((D - k).factorial : ℝ) ≠ 0 := by positivity apply (div_eq_div_iff (mul_ne_zero hkfac hsubfac) hfac).2 nlinarith [h'] calc _ = ∑ k ∈ range (D + 1), 1 / ((k.factorial : ℝ) * ((D - k).factorial : ℝ)) := by exact Fin.sum_univ_eq_sum_range (fun k : ℕ => (1 : ℝ) / ((k.factorial : ℝ) * ((D - k).factorial : ℝ))) (D + 1) _ = ∑ k ∈ range (D + 1), (D.choose k : ℝ) / (D.factorial : ℝ) := by apply Finset.sum_congr rfl intro k hk exact hterm k (le_of_lt_succ (Finset.mem_range.mp hk)) _ = _ := by rw [← Finset.sum_div] congr 1 exact_mod_cast Nat.sum_range_choose D
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.equispacedLagrange_reciprocal_factorial_sum · Causalean/Mathlib/Analysis/Approximation/Chebyshev/EquispacedLagrange.lean:73
  • equispacedLagrange_factorial_ratio_le theorem — The factorial ratio from the equispaced grid grows at most exponentially in its degree.
    D :
    ℕ
    (D + 1 : ℝ) ^ D / (D.factorial : ℝ) ≤ (4 : ℝ) ^ D
    Proof (Lean source)
    theorem equispacedLagrange_factorial_ratio_le (D : ℕ) : (D + 1 : ℝ) ^ D / (D.factorial : ℝ) ≤ (4 : ℝ) ^ D := by calc (D + 1 : ℝ) ^ D / (D.factorial : ℝ) ≤ ((2 * D).choose D : ℝ) := by have h : 2 * D + 1 - D = D + 1 := by omega simpa [h, Nat.cast_add] using (Nat.pow_le_choose (α := ℝ) D (2 * D)) _ ≤ (2 : ℝ) ^ (2 * D) := by exact_mod_cast Nat.choose_le_two_pow (2 * D) D _ = (4 : ℝ) ^ D := by rw [show (4 : ℝ) = 2 ^ 2 by norm_num, ← pow_mul]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.equispacedLagrange_factorial_ratio_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/EquispacedLagrange.lean:106
  • equispacedLagrange_basis_oneNorm theorem — At one equispaced node, the coefficient one-norm of the Lagrange basis polynomial is bounded by the factorial denominator of its interpolation formula.
    D :
    ℕ
    j :
    Fin (D + 1)
    (∑ k : Fin (D + 1), |equispacedLagrangeWeight D k j|)
    ≤ (2 : ℝ) ^ D * (D + 1 : ℝ) ^ D / (((j : ℕ).factorial : ℝ) * ((D - (j : ℕ)).factorial : ℝ))
    Proof (Lean source)
    theorem equispacedLagrange_basis_oneNorm (D : ℕ) (j : Fin (D + 1)) : (∑ k : Fin (D + 1), |equispacedLagrangeWeight D k j|) ≤ (2 : ℝ) ^ D * (D + 1 : ℝ) ^ D / (((j : ℕ).factorial : ℝ) * ((D - (j : ℕ)).factorial : ℝ)) := by classical let s := (Finset.univ : Finset (Fin (D + 1))).erase j let v := equispacedLagrangeNode D have hscale (c : ℝ) (p : Polynomial ℝ) : polynomialCoeffOneNorm (C c * p) = |c| * polynomialCoeffOneNorm p := by rw [Polynomial.C_mul'] have hp : p.natDegree < p.natDegree + 1 := Nat.lt_succ_self _ have hcp : (c • p).natDegree < p.natDegree + 1 := lt_of_le_of_lt (Polynomial.natDegree_smul_le _ _) hp change polyCoeffL1 (c • p) = _ rw [show polyCoeffL1 (c • p) = ∑ k ∈ range (p.natDegree + 1), |(c • p).coeff k| from (c • p).sum_over_range' (fun _ => abs_zero) _ hcp, show polynomialCoeffOneNorm p = ∑ k ∈ range (p.natDegree + 1), |p.coeff k| from p.sum_over_range' (fun _ => abs_zero) _ hp] simp only [Polynomial.coeff_smul, smul_eq_mul, abs_mul, Finset.mul_sum] have hnonneg (p : Polynomial ℝ) : 0 ≤ polynomialCoeffOneNorm p := by change 0 ≤ p.sum (fun _ c => |c|) exact Finset.sum_nonneg fun _ _ => abs_nonneg _ have hnode (i : Fin (D + 1)) : 0 ≤ v i ∧ v i ≤ 1 := by have hi : (i : ℕ) ≤ D := Nat.lt_succ_iff.mp i.isLt have hi' : (i : ℝ) ≤ (D : ℝ) := by exact_mod_cast hi constructor · exact div_nonneg (by positivity) (by positivity) · apply (div_le_iff₀ (by positivity : (0 : ℝ) < D + 1)).2 linarith have hfactor (i : Fin (D + 1)) : polynomialCoeffOneNorm (Lagrange.basisDivisor (v j) (v i)) ≤ 2 * |v j - v i|⁻¹ := by rw [Lagrange.basisDivisor, hscale, abs_inv] calc |v j - v i|⁻¹ * polynomialCoeffOneNorm (X - C (v i)) ≤ |v j - v i|⁻¹ * 2 := mul_le_mul_of_nonneg_left (polynomialCoeffOneNorm_X_sub_C_le_two (v i) (hnode i).1 (hnode i).2) (by positivity) _ = _ := by ring have hprod (t : Finset (Fin (D + 1))) : polynomialCoeffOneNorm (∏ i ∈ t, Lagrange.basisDivisor (v j) (v i)) ≤ ∏ i ∈ t, (2 * |v j - v i|⁻¹) := by induction t using Finset.induction_on with | empty => change polynomialCoeffOneNorm (1 : Polynomial ℝ) ≤ 1 rw [show polynomialCoeffOneNorm (1 : Polynomial ℝ) = ∑ k ∈ range 1, |(1 : Polynomial ℝ).coeff k| from (1 : Polynomial ℝ).sum_over_range' (fun _ => abs_zero) 1 (by simp)] simp | @insert i t hi ih => simp only [Finset.prod_insert hi] calc polynomialCoeffOneNorm (Lagrange.basisDivisor (v j) (v i) * ∏ k ∈ t, Lagrange.basisDivisor (v j) (v k)) ≤ polynomialCoeffOneNorm (Lagrange.basisDivisor (v j) (v i)) * polynomialCoeffOneNorm (∏ k ∈ t, Lagrange.basisDivisor (v j) (v k)) := polynomialCoeffOneNorm_mul_le _ _ _ ≤ (2 * |v j - v i|⁻¹) * (∏ k ∈ t, (2 * |v j - v k|⁻¹)) := mul_le_mul (hfactor i) ih (hnonneg _) (by positivity) have hinj : Injective v := by intro a b hab have hden : (D + 1 : ℝ) ≠ 0 := by positivity dsimp [v, equispacedLagrangeNode] at hab have hab' : (a : ℝ) = (b : ℝ) := by field_simp [hden] at hab exact hab exact Fin.ext (Nat.cast_injective hab') have hdeg : (basis Finset.univ v j).natDegree < D + 1 := by rw [Lagrange.natDegree_basis hinj.injOn (Finset.mem_univ j)] simp have hsum : (∑ k : Fin (D + 1), |equispacedLagrangeWeight D k j|) = polynomialCoeffOneNorm (basis Finset.univ v j) := by rw [show polynomialCoeffOneNorm (basis Finset.univ v j) = ∑ k ∈ range (D + 1), |(basis Finset.univ v j).coeff k| from (basis Finset.univ v j).sum_over_range' (fun _ => abs_zero) _ hdeg] simpa only [equispacedLagrangeWeight, v] using (Fin.sum_univ_eq_sum_range (fun k : ℕ => |(basis Finset.univ v j).coeff k|) (D + 1)) rw [hsum] change polynomialCoeffOneNorm (∏ i ∈ s, Lagrange.basisDivisor (v j) (v i)) ≤ _ calc polynomialCoeffOneNorm (∏ i ∈ s, Lagrange.basisDivisor (v j) (v i)) ≤ ∏ i ∈ s, (2 * |v j - v i|⁻¹) := hprod s _ = (2 : ℝ) ^ D / |∏ i ∈ s, (v j - v i)| := by rw [Finset.prod_mul_distrib, Finset.prod_const] have hs : s.card = D := by simp [s] rw [hs, Finset.prod_inv_distrib, ← Finset.abs_prod, div_eq_mul_inv] _ = _ := by rw [equispacedLagrange_denominator_abs] have hfac : (((j : ℕ).factorial : ℝ) * ((D - (j : ℕ)).factorial : ℝ)) ≠ 0 := by positivity have hden : (D + 1 : ℝ) ≠ 0 := by positivity field_simp
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.equispacedLagrange_basis_oneNorm · Causalean/Mathlib/Analysis/Approximation/Chebyshev/EquispacedLagrange.lean:150
  • equispacedLagrange_weight_oneNorm theorem — The sum of the absolute values of all equispaced coefficient-recovery weights is at most 2^(4D+4).
    D :
    ℕ
    (∑ k : Fin (D + 1), ∑ j : Fin (D + 1), |equispacedLagrangeWeight D k j|)
    ≤ (2 : ℝ) ^ (4 * D + 4)
    Proof (Lean source)
    theorem equispacedLagrange_weight_oneNorm (D : ℕ) : (∑ k : Fin (D + 1), ∑ j : Fin (D + 1), |equispacedLagrangeWeight D k j|) ≤ (2 : ℝ) ^ (4 * D + 4) := by rw [Finset.sum_comm] calc (∑ j : Fin (D + 1), ∑ k : Fin (D + 1), |equispacedLagrangeWeight D k j|) ≤ ∑ j : Fin (D + 1), (2 : ℝ) ^ D * (D + 1 : ℝ) ^ D / (((j : ℕ).factorial : ℝ) * ((D - (j : ℕ)).factorial : ℝ)) := by exact Finset.sum_le_sum (fun j _ => equispacedLagrange_basis_oneNorm D j) _ = (2 : ℝ) ^ D * (D + 1 : ℝ) ^ D * (∑ j : Fin (D + 1), 1 / (((j : ℕ).factorial : ℝ) * ((D - (j : ℕ)).factorial : ℝ))) := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j _ ring _ = (2 : ℝ) ^ D * (D + 1 : ℝ) ^ D * ((2 : ℝ) ^ D / (D.factorial : ℝ)) := by rw [equispacedLagrange_reciprocal_factorial_sum] _ = (4 : ℝ) ^ D * ((D + 1 : ℝ) ^ D / (D.factorial : ℝ)) := by rw [show (4 : ℝ) = 2 * 2 by norm_num, mul_pow] ring _ ≤ (4 : ℝ) ^ D * (4 : ℝ) ^ D := by exact mul_le_mul_of_nonneg_left (equispacedLagrange_factorial_ratio_le D) (by positivity) _ ≤ (2 : ℝ) ^ (4 * D + 4) := by rw [show (4 : ℝ) = 2 ^ 2 by norm_num, ← pow_mul, ← pow_add] apply pow_le_pow_right₀ (by norm_num : (1 : ℝ) ≤ 2) omega
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.equispacedLagrange_weight_oneNorm · Causalean/Mathlib/Analysis/Approximation/Chebyshev/EquispacedLagrange.lean:258
Extremal­Sign­Polynomial 2 core · 0 supporting A continuous function g on a compact interval [r, s] with positive supremum norm either attains its norm with alternating signs at L + 2 increasing points, or admits a polynomial Q of degree at most L with g(x)·Q(x) > 0 ★ exists_signPolynomial_of_no_alternatingExtrema

Sign polynomials for extremal residual sets

A continuous function g on a compact interval [r, s] with positive supremum norm either attains its norm with alternating signs at L + 2 increasing points, or admits a polynomial Q of degree at most L with g(x)·Q(x) > 0 at every point where |g| equals its supremum norm. This is the sign-change counting step in the necessity half of Chebyshev's alternation (equioscillation) theorem: such a Q, scaled small, could be subtracted from g to lower its supremum norm.

Main definitions

* IsAlternatingExtrema — g takes the values ±‖g‖, with alternating signs, at L + 2 strictly increasing nodes of the interval.

Main results

* exists_signPolynomial_of_no_alternatingExtrema — if g has no L + 2 alternating extrema, there is a polynomial of degree at most L having the sign of g on the whole extremal set.

def IsAlternatingExtrema reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

A function g on the interval from r to s has alternating extrema of order L at L + 2 nodes with an orientation when the nodes are strictly increasing, all lie in the interval, the orientation is plus or minus one, and the value of g at the i-th node equals the orientation times (−1)^i times the supremum norm of g on the interval.

Definition (Lean source)
g :
ℝ → ℝ
r s :
ℝ
L :
ℕ
nodes :
Fin (L + 2) → ℝ
orientation :
ℝ
IsAlternatingExtrema g r s L nodes orientation :
Prop
clause 1
clause 2
i :
nodes i ∈ Icc r s
clause 3
orientation = 1 ∨ orientation = -1
clause 4
i :
g (nodes i) = orientation * (-1 : ℝ) ^ (i : ℕ) * intervalSupNorm g r s
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.IsAlternatingExtrema · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ExtremalSignPolynomial.lean:259
theorem exists_signPolynomial_of_no_alternatingExtrema reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

For endpoints with r strictly less than s, a function g continuous on the closed interval between them whose supremum norm there is strictly positive, and a degree bound L, if g has no L + 2 alternating extrema, for any nodes and orientation, then there is a polynomial of degree at most L whose product with g is strictly positive at every point of the interval where the absolute value of g equals its supremum norm.

Formal statement
g :
ℝ → ℝ
r s :
ℝ
hrs :
r < s
hg :
ContinuousOn g (Set.Icc r s)
L :
ℕ
hE :
0 < intervalSupNorm g r s
hno :
¬ ∃ nodes orientation, IsAlternatingExtrema g r s L nodes orientation
∃ Q : Polynomial ℝ,
Q.natDegree ≤ L
conclusion 1
x ∈ Set.Icc r s :
|g x| = intervalSupNorm g r s
0 < g x * Q.eval x
Proof (Lean source)
theorem exists_signPolynomial_of_no_alternatingExtrema {g : ℝ → ℝ} {r s : ℝ} (hrs : r < s) (hg : ContinuousOn g (Icc r s)) (L : ℕ) (hE : 0 < intervalSupNorm g r s) (hno : ¬ ∃ nodes orientation, IsAlternatingExtrema g r s L nodes orientation) : ∃ Q : Polynomial ℝ, Q.natDegree ≤ L ∧ ∀ x ∈ Icc r s, |g x| = intervalSupNorm g r s → 0 < g x * Q.eval x := by classical let E := intervalSupNorm g r s let K : Set ℝ := {x | x ∈ Icc r s ∧ |g x| = E} let P : Set ℝ := {x | x ∈ K ∧ g x = E} let N : Set ℝ := {x | x ∈ K ∧ g x = -E} have hKsub : K ⊆ Icc r s := fun _ hx ↦ hx.1 have hKcompact : IsCompact K := by apply isCompact_Icc.of_isClosed_subset · exact isClosed_Icc.isClosed_eq hg.abs continuousOn_const · exact hKsub have hKne : K.Nonempty := by obtain ⟨x, hx, hmax, -⟩ := isCompact_Icc.exists_sSup_image_eq_and_ge (nonempty_Icc.mpr hrs.le) hg.abs exact ⟨x, hx, by simpa [E, intervalSupNorm] using hmax.symm⟩ have hPcompact : IsCompact P := by apply hKcompact.of_isClosed_subset · exact hKcompact.isClosed.isClosed_eq (hg.mono hKsub) continuousOn_const · intro x hx exact hx.1 have hNcompact : IsCompact N := by apply hKcompact.of_isClosed_subset · exact hKcompact.isClosed.isClosed_eq (hg.mono hKsub) continuousOn_const · intro x hx exact hx.1 have hPN : Disjoint P N := by rw [Set.disjoint_left] intro x hxP hxN have : E = -E := hxP.2.symm.trans hxN.2 have : E = 0 := by linarith exact hE.ne' (by simpa [E] using this) have hsignK : ∀ x ∈ K, g x = boolSign (decide (0 < g x)) * E := by intro x hx have hEp : 0 < E := by simpa [E] using hE rcases (abs_eq hEp.le).mp hx.2 with hp | hn · rw [hp] simp [boolSign, hEp] · rw [hn] have hnot : ¬0 < -E := by linarith simp [boolSign, hnot] by_cases hPne : P.Nonempty case neg => refine ⟨C (-1), by simp, ?_⟩ intro x hxI hxE have hxK : x ∈ K := ⟨hxI, by simpa [E] using hxE⟩ have hxsign := hsignK x hxK have hcolor : decide (0 < g x) = false := by by_contra h have ht : decide (0 < g x) = true := Bool.eq_true_of_not_eq_false h have : g x = E := by simpa [boolSign, ht] using hxsign exact hPne ⟨x, hxK, this⟩ have hgx : g x = -E := by simpa [boolSign, hcolor] using hxsign simp only [eval_C] rw [hgx] simpa [E] using hE by_cases hNne : N.Nonempty case neg => refine ⟨C 1, by simp, ?_⟩ intro x hxI hxE have hxK : x ∈ K := ⟨hxI, by simpa [E] using hxE⟩ have hxsign := hsignK x hxK have hcolor : decide (0 < g x) = true := by by_contra h have hf : decide (0 < g x) = false := Bool.eq_false_of_not_eq_true h have : g x = -E := by simpa [boolSign, hf] using hxsign exact hNne ⟨x, hxK, this⟩ have hgx : g x = E := by simpa [boolSign, hcolor] using hxsign simp only [eval_C] rw [hgx] simpa [E] using hE obtain ⟨δ, hδ, hdist⟩ : ∃ δ : ℝ, 0 < δ ∧ ∀ x ∈ P, ∀ y ∈ N, δ < |x - y| := by obtain ⟨d, hd, hd'⟩ := Metric.exists_pos_forall_lt_edist hPcompact hNcompact.isClosed hPN refine ⟨(d : ℝ), by exact_mod_cast hd, ?_⟩ intro x hx y hy simpa [edist_dist, Real.dist_eq] using hd' x hx y hy let ε := δ / 5 have hε : 0 < ε := by dsimp [ε]; positivity obtain ⟨t, ht⟩ := hKcompact.elim_finite_subcover (fun z : K ↦ ball (z : ℝ) ε) (fun _ ↦ Metric.isOpen_ball) (by intro x hx rw [Set.mem_iUnion] exact ⟨⟨x, hx⟩, Metric.mem_ball_self hε⟩) let centers : Finset ℝ := t.map ⟨Subtype.val, Subtype.val_injective⟩ let l : List ℝ := centers.sort let color : ℝ → Bool := fun x ↦ decide (0 < g x) have hlK : ∀ c ∈ l, c ∈ K := by intro c hc have hc' : c ∈ centers := (Finset.mem_sort (· ≤ ·)).mp hc rcases Finset.mem_map.mp hc' with ⟨z, hz, rfl⟩ exact z.2 have hcover : ∀ x ∈ K, ∃ c ∈ l, |x - c| < ε := by intro x hx rcases Set.mem_iUnion₂.mp (ht hx) with ⟨z, hz, hxz⟩ refine ⟨z, ?_, ?_⟩ · apply (Finset.mem_sort (· ≤ ·)).mpr exact Finset.mem_map.mpr ⟨z, hz, rfl⟩ · simpa [Metric.mem_ball, Real.dist_eq] using hxz have hlne : l ≠ [] := by intro hl obtain ⟨x, hx⟩ := hKne obtain ⟨c, hc, -⟩ := hcover x hx simpa [hl] using hc have hlsort : l.Pairwise (· < ·) := by simpa [l] using (Finset.sortedLT_sort centers).pairwise have hlsep : ∀ a ∈ l, ∀ b ∈ l, color a ≠ color b → 4 * ε < |a - b| := by intro a ha b hb hab have haK := hlK a ha have hbK := hlK b hb have hga := hsignK a haK have hgb := hsignK b hbK dsimp [color] at hab ⊢ cases hca : decide (0 < g a) <;> cases hcb : decide (0 < g b) · exfalso apply hab rw [hca, hcb] · have haN : a ∈ N := ⟨haK, by simpa [boolSign, hca] using hga⟩ have hbP : b ∈ P := ⟨hbK, by simpa [boolSign, hcb] using hgb⟩ have hd := hdist b hbP a haN rw [abs_sub_comm] at hd dsimp [ε] linarith · have haP : a ∈ P := ⟨haK, by simpa [boolSign, hca] using hga⟩ have hbN : b ∈ N := ⟨hbK, by simpa [boolSign, hcb] using hgb⟩ have hd := hdist a haP b hbN dsimp [ε] linarith · exfalso apply hab rw [hca, hcb] have hchanges : signChanges color l ≤ L := by by_contra hle have hlt : L < signChanges color l := Nat.lt_of_not_ge hle cases hl : l with | nil => simp [hl, signChanges] at hlt | cons a tail => have hsortCons : (a :: tail).Pairwise (· < ·) := by simpa [hl] using hlsort obtain ⟨w, hwlen, hword, hwchain, hwmem⟩ := exists_alternating_sublist_of_lt_signChanges color hsortCons (by simpa [hl] using hlt) let nodes : Fin (L + 2) → ℝ := fun i ↦ (a :: w).get ⟨i, by simpa [hwlen] using i.isLt⟩ have hnodesK : ∀ i, nodes i ∈ K := by intro i apply hlK _ (by rw [hl]; exact hwmem _ (List.get_mem _ _)) have hnodesMono : StrictMono nodes := by intro i j hij exact hword.rel_get_of_lt hij have hnodeSigns := boolSign_get_eq_of_chain color hwchain apply hno refine ⟨nodes, boolSign (color a), hnodesMono, ?_, ?_, ?_⟩ · intro i exact hKsub (hnodesK i) · cases color a <;> simp [boolSign] · intro i have hgNode := hsignK (nodes i) (hnodesK i) have hsNode := hnodeSigns ⟨i, by simpa [hwlen] using i.isLt⟩ dsimp [nodes] at hgNode ⊢ rw [hgNode] change boolSign (color ((a :: w).get ⟨i, _⟩)) * E = boolSign (color a) * (-1 : ℝ) ^ (i : ℕ) * intervalSupNorm g r s rw [hsNode] cases hl : l with | nil => exact (hlne hl).elim | cons a tail => let Q := listSignPolynomial color (a :: tail) have hchanges' : signChanges color (a :: tail) ≤ L := by simpa [hl] using hchanges have hlsort' : (a :: tail).Pairwise (· < ·) := by simpa [hl] using hlsort have hlsep' : ∀ u ∈ a :: tail, ∀ v ∈ a :: tail, color u ≠ color v → 4 * ε < |u - v| := by simpa [hl] using hlsep refine ⟨Q, (listSignPolynomial_degree color (a :: tail)).trans hchanges', ?_⟩ have hQsign := listSignPolynomial_sign color ε (a :: tail) hε (by simp) hlsort' hlsep' intro x hxI hxE have hxK : x ∈ K := ⟨hxI, by simpa [E] using hxE⟩ obtain ⟨c, hc, hxc⟩ := hcover x hxK have hcK := hlK c hc have hsame : color x = color c := by by_contra hne have hxsign := hsignK x hxK have hcsign := hsignK c hcK dsimp [color] at hne ⊢ cases hcx : decide (0 < g x) <;> cases hcc : decide (0 < g c) · exfalso apply hne rw [hcx, hcc] · have hxN : x ∈ N := ⟨hxK, by simpa [boolSign, hcx] using hxsign⟩ have hcP : c ∈ P := ⟨hcK, by simpa [boolSign, hcc] using hcsign⟩ have hd := hdist c hcP x hxN rw [abs_sub_comm] at hd dsimp [ε] at hxc linarith · have hxP : x ∈ P := ⟨hxK, by simpa [boolSign, hcx] using hxsign⟩ have hcN : c ∈ N := ⟨hcK, by simpa [boolSign, hcc] using hcsign⟩ have hd := hdist x hxP c hcN dsimp [ε] at hxc linarith · exfalso apply hne rw [hcx, hcc] have hc' : c ∈ a :: tail := by simpa [hl] using hc have hpoly := hQsign.2 c hc' x hxc have hxsign := hsignK x hxK dsimp [Q] rw [hxsign] change 0 < boolSign (color x) * E * (listSignPolynomial color (a :: tail)).eval x rw [hsame] have hp := mul_pos (show 0 < E by simpa [E] using hE) hpoly rw [show boolSign (color c) * E * (listSignPolynomial color (a :: tail)).eval x = E * (boolSign (color c) * (listSignPolynomial color (a :: tail)).eval x) by ring] exact hp
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.exists_signPolynomial_of_no_alternatingExtrema · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ExtremalSignPolynomial.lean:273 · uses IsAlternatingExtrema , intervalSupNorm
Half­Plane­Derivative­Comparison 1 core · 2 supporting This module combines root reflection with a half-plane boundary estimate to propagate derivative control at the real roots of a Chebyshev polynomial to a sharp endpoint comparison. ★ abs_eval_derivative_le_chebyshev_endpoint_of_root_control

Half-plane derivative comparison at Chebyshev roots

This module combines root reflection with a half-plane boundary estimate to propagate derivative control at the real roots of a Chebyshev polynomial to a sharp endpoint comparison.

theorem abs_eval_derivative_le_chebyshev_endpoint_of_root_control reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

For a positive degree L and a real polynomial of degree at most L whose derivative is at most that of the degree-L Chebyshev polynomial, in absolute value, at every real root of that Chebyshev polynomial, at a real point x for which the modulus of the Chebyshev polynomial at x + i y is at most its modulus at 1 + i y for every real y, the derivative of the polynomial at x is at most the absolute value of the derivative of the Chebyshev polynomial at one.

Formal statement
L :
ℕ
hL :
0 < L
Q :
hQ :
Q.natDegree ≤ L
hroots :
∀ z : ℝ
if
(T ℝ (L : ℤ)).eval z = 0
then
|Q.derivative.eval z| ≤ |(T ℝ (L : ℤ)).derivative.eval z|
x :
ℝ
hvertical :
∀ y : ℝ,
‖(T ℂ (L : ℤ)).eval ((x : ℂ) + (y : ℂ) * I)‖
≤ ‖(T ℂ (L : ℤ)).eval ((1 : ℂ) + (y : ℂ) * I)‖
|Q.derivative.eval x| ≤ |(T ℝ (L : ℤ)).derivative.eval 1|
Proof (Lean source)
theorem abs_eval_derivative_le_chebyshev_endpoint_of_root_control {L : ℕ} (hL : 0 < L) (Q : Polynomial ℝ) (hQ : Q.natDegree ≤ L) (hroots : ∀ z : ℝ, (T ℝ (L : ℤ)).eval z = 0 → |Q.derivative.eval z| ≤ |(T ℝ (L : ℤ)).derivative.eval z|) {x : ℝ} (hvertical : ∀ y : ℝ, ‖(T ℂ (L : ℤ)).eval ((x : ℂ) + (y : ℂ) * I)‖ ≤ ‖(T ℂ (L : ℤ)).eval ((1 : ℂ) + (y : ℂ) * I)‖) : |Q.derivative.eval x| ≤ |(T ℝ (L : ℤ)).derivative.eval 1| := by obtain ⟨R, hRdeg, hRvertical, hQderiv⟩ := exists_chebyshevRootReflection hL Q hQ hroots x refine hQderiv.trans (norm_eval_derivative_zero_le_chebyshev_endpoint_of_vertical hL R hRdeg ?_) intro y rw [hRvertical y] exact hvertical y
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.abs_eval_derivative_le_chebyshev_endpoint_of_root_control · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HalfPlaneDerivativeComparison.lean:473
2 supporting declarations (lemmas, instances)
  • exists_chebyshevRootReflection theorem — For a positive degree L, a real polynomial of degree at most L whose derivative is at most that of the degree-L Chebyshev polynomial, in absolute value, at every real root of that Chebyshev polynomial, and any real base point x, there is a complex polynomial of degree at most L whose modulus at every purely imaginary point i y equals the modulus of the Chebyshev polynomial at x + i y, and whose derivative at zero is at least the derivative of the original polynomial at x in absolute value.
    L :
    ℕ
    hL :
    0 < L
    Q :
    hQ :
    Q.natDegree ≤ L
    hroots :
    ∀ z : ℝ
    if
    (T ℝ (L : ℤ)).eval z = 0
    then
    |Q.derivative.eval z| ≤ |(T ℝ (L : ℤ)).derivative.eval z|
    x :
    ℝ
    ∃ R : Polynomial ℂ,
    R.natDegree ≤ L
    conclusion 1
    y :
    ℝ
    ‖R.eval ((y : ℂ) * I)‖
    = ‖(T ℂ (L : ℤ)).eval ((x : ℂ) + (y : ℂ) * I)‖
    conclusion 2
    |Q.derivative.eval x| ≤ ‖R.derivative.eval 0‖
    Proof (Lean source)
    theorem exists_chebyshevRootReflection {L : ℕ} (hL : 0 < L) (Q : Polynomial ℝ) (hQ : Q.natDegree ≤ L) (hroots : ∀ z : ℝ, (T ℝ (L : ℤ)).eval z = 0 → |Q.derivative.eval z| ≤ |(T ℝ (L : ℤ)).derivative.eval z|) (x : ℝ) : ∃ R : Polynomial ℂ, R.natDegree ≤ L ∧ (∀ y : ℝ, ‖R.eval ((y : ℂ) * I)‖ = ‖(T ℂ (L : ℤ)).eval ((x : ℂ) + (y : ℂ) * I)‖) ∧ |Q.derivative.eval x| ≤ ‖R.derivative.eval 0‖ := by have hPnat : Q.derivative.natDegree < L := by refine lt_of_le_of_lt ((Polynomial.natDegree_derivative_le Q).trans (Nat.sub_le_sub_right hQ 1)) ?_ exact Nat.sub_lt hL Nat.zero_lt_one have hPdegree : Q.derivative.degree < (L : WithBot ℕ) := by by_cases hP : Q.derivative = 0 · simp [hP] · exact (Polynomial.natDegree_lt_iff_degree_lt hP).mp hPnat have hinterp : Q.derivative = Lagrange.interpolate (range L) (reflectionRoot L) (fun i => Q.derivative.eval (reflectionRoot L i)) := by apply Lagrange.eq_interpolate (reflectionRoot_injOn L) simpa using hPdegree refine ⟨reflectedRootProduct L x, reflectedRootProduct_natDegree_le L x, reflectedRootProduct_vertical_norm L x, ?_⟩ rw [hinterp, Lagrange.interpolate_apply, eval_finsetSum] simp only [eval_mul, eval_C] calc |∑ i ∈ range L, Q.derivative.eval (reflectionRoot L i) * (basis (range L) (reflectionRoot L) i).eval x| ≤ ∑ i ∈ range L, |Q.derivative.eval (reflectionRoot L i) * (basis (range L) (reflectionRoot L) i).eval x| := Finset.abs_sum_le_sum_abs _ _ _ ≤ ∑ i ∈ range L, |(T ℝ (L : ℤ)).derivative.eval (reflectionRoot L i) * (basis (range L) (reflectionRoot L) i).eval x| := by apply Finset.sum_le_sum intro i hi rw [abs_mul, abs_mul] exact mul_le_mul_of_nonneg_right (hroots (reflectionRoot L i) (eval_chebyshev_T_reflectionRoot (Finset.mem_range.mp hi))) (abs_nonneg _) _ = ∑ i ∈ range L, |(T ℝ (L : ℤ)).leadingCoeff| * ∏ j ∈ (range L).erase i, |x - reflectionRoot L j| := by apply Finset.sum_congr rfl intro i hi rw [chebyshev_derivative_mul_lagrangeBasis (Finset.mem_range.mp hi), abs_mul, Finset.abs_prod] _ = |(T ℝ (L : ℤ)).leadingCoeff| * ∑ i ∈ range L, ∏ j ∈ (range L).erase i, |x - reflectionRoot L j| := by rw [Finset.mul_sum] _ = ‖(reflectedRootProduct L x).derivative.eval 0‖ := (reflectedRootProduct_derivative_norm L x).symm
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.exists_chebyshevRootReflection · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HalfPlaneDerivativeComparison.lean:188
  • norm_eval_derivative_zero_le_chebyshev_endpoint_of_vertical theorem — For a positive degree L and a complex polynomial of degree at most L, if at every purely imaginary point i y its modulus is at most the modulus of the degree-L Chebyshev polynomial at 1 + i y, then the modulus of its derivative at zero is at most the absolute value of the derivative of the Chebyshev polynomial at one.
    L :
    ℕ
    hL :
    0 < L
    R :
    hR :
    R.natDegree ≤ L
    hvertical :
    ∀ y : ℝ,
    ‖R.eval ((y : ℂ) * I)‖
    ≤ ‖(T ℂ (L : ℤ)).eval ((1 : ℂ) + (y : ℂ) * I)‖
    ‖R.derivative.eval 0‖ ≤ |(T ℝ (L : ℤ)).derivative.eval 1|
    Proof (Lean source)
    theorem norm_eval_derivative_zero_le_chebyshev_endpoint_of_vertical {L : ℕ} (hL : 0 < L) (R : Polynomial ℂ) (hR : R.natDegree ≤ L) (hvertical : ∀ y : ℝ, ‖R.eval ((y : ℂ) * I)‖ ≤ ‖(T ℂ (L : ℤ)).eval ((1 : ℂ) + (y : ℂ) * I)‖) : ‖R.derivative.eval 0‖ ≤ |(T ℝ (L : ℤ)).derivative.eval 1| := by let S : ℂ[X] := (T ℂ (L : ℤ)).comp (X + C 1) have hSnat : S.natDegree = L := by change ((T ℂ (L : ℤ)).comp (X + C 1)).natDegree = L rw [Polynomial.natDegree_comp, Polynomial.Chebyshev.natDegree_T, Int.natAbs_natCast, Polynomial.natDegree_X_add_C, mul_one] have hSdeg : 0 < S.degree := by rw [← Polynomial.natDegree_pos_iff_degree_pos, hSnat] exact hL have hdeg : R.degree ≤ S.degree := by have hSdegree : S.degree = (L : WithBot ℕ) := by rw [Polynomial.degree_eq_natDegree (ne_zero_of_degree_gt hSdeg), hSnat] rw [hSdegree] exact Polynomial.degree_le_of_natDegree_le hR have hSroots : ∀ z : ℂ, S.eval z = 0 → z.re < 0 := by intro z hz have ht : ((1 : ℂ) + z).re < 1 := by apply chebyshev_root_re_lt_one hL simpa [S, add_comm] using hz simpa using ht have hSderiv : S.derivative.eval 0 ≠ 0 := by simp [S, Polynomial.derivative_comp, Polynomial.Chebyshev.derivative_T_eval_one] exact_mod_cast (Nat.ne_of_gt hL) have hbound := norm_eval_derivative_zero_le_of_left_half_plane_roots R S hSdeg hdeg hSroots hSderiv (by simpa [S, add_comm] using hvertical) simpa [S, Polynomial.derivative_comp, Polynomial.Chebyshev.derivative_T_eval_one] using hbound
    Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.norm_eval_derivative_zero_le_chebyshev_endpoint_of_vertical · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HalfPlaneDerivativeComparison.lean:430
Heterogeneous­Tensor­Extraction 1 core · 3 supporting This module extracts the coordinatewise trigonometric and even structure of heterogeneous product Jackson convolution and converts it into a multivariate polynomial with coordinatewise degree bounds. ★ convolution_exists_polynomial

Heterogeneous tensor Jackson extraction

This module extracts the coordinatewise trigonometric and even structure of heterogeneous product Jackson convolution and converts it into a multivariate polynomial with coordinatewise degree bounds.

theorem convolution_exists_polynomial reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

For a coordinate-specific positive order map, a measurable cube target, and a real bound B such that the target is at most B in absolute value on the cube, there is a multivariate polynomial that reproduces the heterogeneous Jackson convolution at the coordinatewise cosines of every phase vector and whose degree in each variable is at most twice (that coordinate's order minus one).

Formal statement
ι :
Type u_1
shared
d :
ι → ℕ
hd :
∀ i, 0 < d i
f :
(ι → ℝ) → ℝ
hf :
B :
ℝ
hB :
∀ x ∈ cube, |f x| ≤ B
∃ p : MvPolynomial ι ℝ,
conclusion 1
x :
ι → ℝ
eval (cosPoint x) p = convolution d f x
conclusion 2
γ ∈ p.support :
i :
γ i ≤ 2 * (d i - 1)
Proof (Lean source)
theorem convolution_exists_polynomial (d : ι → ℕ) (hd : ∀ i, 0 < d i) (f : (ι → ℝ) → ℝ) (hf : Measurable f) (B : ℝ) (hB : ∀ x ∈ cube, |f x| ≤ B) : ∃ p : MvPolynomial ι ℝ, (∀ x : ι → ℝ, eval (cosPoint x) p = convolution d f x) ∧ (∀ γ ∈ p.support, ∀ i, γ i ≤ 2 * (d i - 1)) := by exact polynomial_of_coord_even_trig d (convolution d f) (fun i x => convolution_coord_trig d hd f hf B hB i x) (fun i x => convolution_coord_even d f i x)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.convolution_exists_polynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensorExtraction.lean:458 · uses convolution , cosPoint , cube
3 supporting declarations (lemmas, instances)
  • convolution_coord_trig theorem — For a coordinate-specific positive order map, a measurable cube target, a real bound B such that the target is at most B in absolute value on the cube, a selected coordinate, and a phase vector fixing the other coordinates, the heterogeneous Jackson convolution, as a function of the selected coordinate alone, is a trigonometric polynomial of degree at most twice (that coordinate's order minus one).
    ι :
    Type u_1
    shared
    d :
    ι → ℕ
    hd :
    ∀ i, 0 < d i
    f :
    (ι → ℝ) → ℝ
    hf :
    B :
    ℝ
    hB :
    ∀ x ∈ cube, |f x| ≤ B
    i :
    ι
    x :
    ι → ℝ
    IsTrigPolyLE (2 * (d i - 1)) (fun t => convolution d f (update x i t))
    Proof (Lean source)
    theorem convolution_coord_trig (d : ι → ℕ) (hd : ∀ i, 0 < d i) (f : (ι → ℝ) → ℝ) (hf : Measurable f) (B : ℝ) (hB : ∀ x ∈ cube, |f x| ≤ B) (i : ι) (x : ι → ℝ) : IsTrigPolyLE (2 * (d i - 1)) (fun t => convolution d f (update x i t)) := by classical let J (j : ι) := jackson (d j) let n := 2 * (d i - 1) rcases jackson_isTrigPolyLE (d i) (hd i) with ⟨a, b, hab⟩ let P : (ι → ℝ) → ℝ := fun v => ∏ j ∈ Finset.univ.erase i, J j (x j - v j) let W : (ι → ℝ) → ℝ := fun v => f (cosPoint v) * P v let A : ℕ → ℝ := fun k => ∫ v in periodBox, W v * (a k * cos ((k : ℝ) * v i) - b k * sin ((k : ℝ) * v i)) let D : ℕ → ℝ := fun k => ∫ v in periodBox, W v * (a k * sin ((k : ℝ) * v i) + b k * cos ((k : ℝ) * v i)) refine ⟨A, D, fun t => ?_⟩ change convolution d f (update x i t) = _ rw [convolution_shifted d hd f hf B hB] have hcompact : IsCompact (periodBox (ι := ι)) := isCompact_univ_pi (fun _ => isCompact_Icc) have hP : Continuous P := by dsimp [P, J] fun_prop (disch := exact continuous_jackson _) obtain ⟨C, hC⟩ := hcompact.exists_bound_of_continuousOn hP.continuousOn have hCnonneg : 0 ≤ C := by apply le_trans (norm_nonneg (P (fun _ => 0))) apply hC intro j _ exact ⟨neg_nonpos.mpr Real.pi_pos.le, Real.pi_pos.le⟩ have hBnonneg : 0 ≤ B := by apply le_trans (abs_nonneg (f (cosPoint (fun _ => 0)))) apply hB intro j exact ⟨Real.neg_one_le_cos _, Real.cos_le_one _⟩ have hWm : Measurable W := by have hc : Measurable (cosPoint (ι := ι)) := by unfold cosPoint fun_prop exact (hf.comp hc).mul hP.measurable have hWbound (v : ι → ℝ) (hv : v ∈ periodBox) : ‖W v‖ ≤ B * C := by have hfbound : ‖f (cosPoint v)‖ ≤ B := by simpa [Real.norm_eq_abs] using hB (cosPoint v) (by intro j exact ⟨Real.neg_one_le_cos _, Real.cos_le_one _⟩) calc ‖W v‖ = ‖f (cosPoint v)‖ * ‖P v‖ := norm_mul _ _ _ ≤ B * ‖P v‖ := mul_le_mul_of_nonneg_right hfbound (norm_nonneg _) _ ≤ B * C := mul_le_mul_of_nonneg_left (hC v hv) hBnonneg have hint (q : (ι → ℝ) → ℝ) (hq : Continuous q) : IntegrableOn (fun v => W v * q v) periodBox := by obtain ⟨E, hE⟩ := hcompact.exists_bound_of_continuousOn hq.continuousOn have hEnonneg : 0 ≤ E := by apply le_trans (norm_nonneg (q (fun _ => 0))) apply hE intro j _ exact ⟨neg_nonpos.mpr Real.pi_pos.le, Real.pi_pos.le⟩ apply Measure.integrableOn_of_bounded (hcompact.measure_lt_top.ne) ((hWm.mul hq.measurable).aestronglyMeasurable) filter_upwards [ae_restrict_mem hcompact.measurableSet] with v hv calc ‖W v * q v‖ = ‖W v‖ * ‖q v‖ := norm_mul _ _ _ ≤ (B * C) * ‖q v‖ := mul_le_mul_of_nonneg_right (hWbound v hv) (norm_nonneg _) _ ≤ (B * C) * E := mul_le_mul_of_nonneg_left (hE v hv) (mul_nonneg hBnonneg hCnonneg) have hq1 (k : ℕ) : Continuous (fun v : ι → ℝ => a k * cos ((k : ℝ) * v i) - b k * sin ((k : ℝ) * v i)) := by fun_prop have hq2 (k : ℕ) : Continuous (fun v : ι → ℝ => a k * sin ((k : ℝ) * v i) + b k * cos ((k : ℝ) * v i)) := by fun_prop calc (∫ v in periodBox, f (cosPoint v) * kernel d (update x i t - v)) = ∫ v in periodBox, W v * J i (t - v i) := by apply integral_congr_ae filter_upwards with v dsimp [W, P, kernel] rw [← Finset.mul_prod_erase _ _ (Finset.mem_univ i)] have herase : (∏ j ∈ Finset.univ.erase i, J j (update x i t j - v j)) = ∏ j ∈ Finset.univ.erase i, J j (x j - v j) := by apply Finset.prod_congr rfl intro j hj have hji : j ≠ i := Finset.ne_of_mem_erase hj simp [update, hji] rw [herase] simp [update] ring _ = ∫ v in periodBox, ∑ k ∈ range (n + 1), (W v * (a k * cos ((k : ℝ) * v i) - b k * sin ((k : ℝ) * v i)) * cos ((k : ℝ) * t) + W v * (a k * sin ((k : ℝ) * v i) + b k * cos ((k : ℝ) * v i)) * sin ((k : ℝ) * t)) := by apply integral_congr_ae filter_upwards with v change W v * jackson (d i) (t - v i) = _ rw [hab (t - v i), Finset.mul_sum] apply Finset.sum_congr rfl intro k hk rw [show (k : ℝ) * (t - v i) = (k : ℝ) * t - (k : ℝ) * v i by ring, Real.cos_sub, Real.sin_sub] ring _ = ∑ k ∈ range (n + 1), (A k * cos ((k : ℝ) * t) + D k * sin ((k : ℝ) * t)) := by have hterm (k : ℕ) : IntegrableOn (fun v : ι → ℝ => W v * (a k * cos ((k : ℝ) * v i) - b k * sin ((k : ℝ) * v i)) * cos ((k : ℝ) * t) + W v * (a k * sin ((k : ℝ) * v i) + b k * cos ((k : ℝ) * v i)) * sin ((k : ℝ) * t)) periodBox := by exact (hint _ (hq1 k)).mul_const _ |>.add ((hint _ (hq2 k)).mul_const _) rw [integral_finsetSum (range (n + 1)) (fun k hk => hterm k)] apply Finset.sum_congr rfl intro k hk dsimp [A, D] rw [integral_add] · rw [integral_mul_const, integral_mul_const] · exact (hint _ (hq1 k)).mul_const _ · exact (hint _ (hq2 k)).mul_const _
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.convolution_coord_trig · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensorExtraction.lean:23
  • convolution_coord_even theorem — For a coordinate-specific order map, a cube target, a selected coordinate, and a phase vector fixing the other coordinates, the heterogeneous Jackson convolution is an even function of the selected coordinate.
    ι :
    Type u_1
    shared
    d :
    ι → ℕ
    f :
    (ι → ℝ) → ℝ
    i :
    ι
    x :
    ι → ℝ
    Even (fun t => convolution d f (update x i t))
    Proof (Lean source)
    theorem convolution_coord_even (d : ι → ℕ) (f : (ι → ℝ) → ℝ) (i : ι) (x : ι → ℝ) : Even (fun t => convolution d f (update x i t)) := by classical let e : (ι → ℝ) ≃ᵐ (ι → ℝ) := MeasurableEquiv.piCongrRight fun j => if j = i then MeasurableEquiv.neg ℝ else MeasurableEquiv.refl ℝ have he_apply (u : ι → ℝ) : e u = update u i (-u i) := by funext j by_cases hji : j = i · subst j simp [e, MeasurableEquiv.piCongrRight, update] · simp [e, MeasurableEquiv.piCongrRight, update, hji] have hem : MeasurePreserving e volume volume := by rw [volume_pi] apply measurePreserving_pi intro j by_cases hji : j = i · subst j simpa [e] using Measure.measurePreserving_neg (volume : Measure ℝ) · simpa [e, hji] using MeasurePreserving.id (volume : Measure ℝ) have he_box : e ⁻¹' periodBox = periodBox (ι := ι) := by ext u simp only [Set.mem_preimage, periodBox, Set.mem_pi, Set.mem_univ, forall_true_left, he_apply, Set.mem_Icc] constructor <;> intro h j · by_cases hji : j = i · subst j have hi := h i simp [update] at hi constructor <;> linarith · simpa [update, hji] using h j · by_cases hji : j = i · subst j have hi := h i simp [update] constructor <;> linarith · simpa [update, hji] using h j intro t unfold convolution calc (∫ u in periodBox, f (cosPoint (update x i (-t) - u)) * kernel d u) = ∫ u in periodBox, f (cosPoint (update x i t - update u i (-u i))) * kernel d (update u i (-u i)) := by apply integral_congr_ae filter_upwards with u congr 1 · congr 1 funext j by_cases hji : j = i · subst j simp only [cosPoint, Pi.sub_apply, Function.update_self] rw [show -t - u i = -(t - -u i) by ring, Real.cos_neg] · simp [cosPoint, hji] · unfold kernel apply Finset.prod_congr rfl intro j hj by_cases hji : j = i · subst j simp only [Function.update_self] exact (jackson_even (d i) (u i)).symm · simp [update, hji] _ = ∫ u in periodBox, f (cosPoint (update x i t - u)) * kernel d u := by simpa only [he_apply, he_box] using (hem.setIntegral_preimage_emb e.measurableEmbedding (fun u => f (cosPoint (update x i t - u)) * kernel d u) periodBox)
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.convolution_coord_even · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensorExtraction.lean:155
  • polynomial_of_coord_even_trig theorem — A coordinate-specific degree map, a phase function, its coordinatewise trigonometric degree bounds, and its coordinatewise evenness imply that the phase function has a multivariate polynomial representation in coordinate cosines with the same bounds.
    ι :
    Type u_1
    shared
    d :
    ι → ℕ
    q :
    (ι → ℝ) → ℝ
    htrig :
    ∀ i x,
    IsTrigPolyLE (2 * (d i - 1)) (fun t => q (update x i t))
    heven :
    ∀ i x, Even (fun t => q (update x i t))
    ∃ p : MvPolynomial ι ℝ,
    conclusion 1
    x :
    ι → ℝ
    eval (cosPoint x) p = q x
    conclusion 2
    γ ∈ p.support :
    i :
    γ i ≤ 2 * (d i - 1)
    Proof (Lean source)
    theorem polynomial_of_coord_even_trig (d : ι → ℕ) (q : (ι → ℝ) → ℝ) (htrig : ∀ i x, IsTrigPolyLE (2 * (d i - 1)) (fun t => q (update x i t))) (heven : ∀ i x, Even (fun t => q (update x i t))) : ∃ p : MvPolynomial ι ℝ, (∀ x : ι → ℝ, eval (cosPoint x) p = q x) ∧ (∀ γ ∈ p.support, ∀ i, γ i ≤ 2 * (d i - 1)) := by classical let D : ι → ℕ := fun i => 2 * (d i - 1) have hfin : ∀ (N : ℕ) (D : Fin N → ℕ) (q : (Fin N → ℝ) → ℝ), (∀ i x, IsTrigPolyLE (D i) (fun t => q (update x i t))) → (∀ i x, Even (fun t => q (update x i t))) → ∃ p : MvPolynomial (Fin N) ℝ, (∀ x, eval (fun i => cos (x i)) p = q x) ∧ (∀ m ∈ p.support, ∀ i, m i ≤ D i) := by intro N induction N with | zero => intro D q ht he refine ⟨MvPolynomial.C (q 0), ?_, ?_⟩ · intro x rw [MvPolynomial.eval_C] exact congrArg q (Subsingleton.elim 0 x) · intro m hm i exact elim0 i | succ N ih => intro D q ht he have hpoly_degree (k : ℕ) (a b : Fin (N + 1)) (r : Polynomial ℝ) (hr : r.natDegree ≤ k) : (r.toMvPolynomial a).degreeOf b ≤ if b = a then k else 0 := by rw [r.as_sum_range_C_mul_X_pow' (lt_of_le_of_lt hr (lt_succ_self k))] simp only [map_sum, map_mul, map_pow, Polynomial.toMvPolynomial_C, Polynomial.toMvPolynomial_X] refine (MvPolynomial.degreeOf_sum_le b (range (k + 1)) (fun l => C (r.coeff l) * X a ^ l)).trans ?_ apply Finset.sup_le intro l hl refine (MvPolynomial.degreeOf_mul_le b _ _).trans ?_ rw [MvPolynomial.degreeOf_C] by_cases hba : b = a · subst b simp only [if_true, zero_add, MvPolynomial.degreeOf_X_self_pow] exact le_of_lt_succ (Finset.mem_range.mp hl) · rw [MvPolynomial.degreeOf_X_pow_of_ne l hba] simp let n := D 0 let node : Fin (n + 1) → ℝ := fun j => (j : ℝ) / (n + 1 : ℝ) let angle : Fin (n + 1) → ℝ := fun j => arccos (node j) have hnode_nonneg (j : Fin (n + 1)) : 0 ≤ node j := by dsimp [node] positivity have hnode_le_one (j : Fin (n + 1)) : node j ≤ 1 := by dsimp [node] rw [div_le_one (by positivity : (0 : ℝ) < n + 1)] exact_mod_cast (le_trans (le_of_lt_succ j.isLt) (le_add_right n 1)) have hcos_angle (j : Fin (n + 1)) : cos (angle j) = node j := by exact Real.cos_arccos (le_trans (by norm_num) (hnode_nonneg j)) (hnode_le_one j) have hnode_inj : Injective node := by intro j k hjk dsimp [node] at hjk have hden : (n + 1 : ℝ) ≠ 0 := by positivity have : (j : ℝ) = (k : ℝ) := (div_left_inj' hden).mp hjk exact Fin.ext (by exact_mod_cast this) let qtail : Fin (n + 1) → (Fin N → ℝ) → ℝ := fun j y => q (cons (angle j) y) have htail_trig (j : Fin (n + 1)) (i : Fin N) (y : Fin N → ℝ) : IsTrigPolyLE (D i.succ) (fun t => qtail j (update y i t)) := by have h := ht i.succ (cons (angle j) y) simpa only [qtail, Fin.cons_update] using h have htail_even (j : Fin (n + 1)) (i : Fin N) (y : Fin N → ℝ) : Even (fun t => qtail j (update y i t)) := by have h := he i.succ (cons (angle j) y) simpa only [qtail, Fin.cons_update] using h have hchoice (j : Fin (n + 1)) := ih (D ∘ succ) (qtail j) (htail_trig j) (htail_even j) let ptail : Fin (n + 1) → MvPolynomial (Fin N) ℝ := fun j => choose (hchoice j) have hptail (j : Fin (n + 1)) : (∀ y, eval (fun i => cos (y i)) (ptail j) = qtail j y) ∧ (∀ m ∈ (ptail j).support, ∀ i, m i ≤ D i.succ) := by exact Classical.choose_spec (hchoice j) let basis : Fin (n + 1) → Polynomial ℝ := fun j => Lagrange.basis Finset.univ node j let p : MvPolynomial (Fin (N + 1)) ℝ := ∑ j, MvPolynomial.rename succ (ptail j) * (basis j).toMvPolynomial 0 have hbdeg (j : Fin (n + 1)) : (basis j).natDegree ≤ n := by dsimp [basis] rw [Lagrange.natDegree_basis hnode_inj.injOn (Finset.mem_univ j), Finset.card_univ, Fintype.card_fin] omega have hrename_degree (j : Fin (n + 1)) (i : Fin (N + 1)) : (MvPolynomial.rename succ (ptail j)).degreeOf i ≤ if i = 0 then 0 else D i := by refine Fin.cases ?_ (fun k => ?_) i · simp only [if_true] apply MvPolynomial.degreeOf_le_iff.mpr intro m hm rw [MvPolynomial.support_rename_of_injective (Fin.succ_injective N)] at hm rcases Finset.mem_image.mp hm with ⟨m', hm', rfl⟩ have hnot : (0 : Fin (N + 1)) ∉ range succ := by rintro ⟨k, hk⟩ exact Fin.ne_of_gt (Fin.succ_pos k) hk rw [Finsupp.mapDomain_of_notMem_range m' 0 hnot] · simp only [Fin.succ_ne_zero, if_false] rw [MvPolynomial.degreeOf_rename_of_injective (Fin.succ_injective N)] exact MvPolynomial.degreeOf_le_iff.mpr (fun m hm => (hptail j).2 m hm k) refine ⟨p, ?_, ?_⟩ · intro x let sec : ℝ → ℝ := fun t => q (cons t (x ∘ succ)) have hu (t : ℝ) : update x 0 t = cons t (x ∘ succ) := by funext k refine Fin.cases ?_ (fun l => ?_) k <;> simp have hs_trig : IsTrigPolyLE n sec := by have h := ht 0 x convert h using 1 funext t dsimp [sec] exact congrArg q (hu t).symm have hs_even : Even sec := by have h := he 0 x intro t dsimp [sec] calc q (cons (-t) (x ∘ succ)) = q (update x 0 (-t)) := congrArg q (hu (-t)).symm _ = q (update x 0 t) := h t _ = q (cons t (x ∘ succ)) := congrArg q (hu t) rcases even_trigPoly_exists_polynomial hs_trig hs_even with ⟨r, hrdeg, hr⟩ have hr_degree : r.degree < (Finset.univ : Finset (Fin (n + 1))).card := by rw [Finset.card_univ, Fintype.card_fin, Nat.cast_add, Nat.cast_one] calc r.degree ≤ (r.natDegree : WithBot ℕ) := Polynomial.degree_le_natDegree _ < ((n + 1 : ℕ) : WithBot ℕ) := by exact_mod_cast (Nat.lt_succ_of_le hrdeg) have hinterp := Lagrange.eq_interpolate (s := (Finset.univ : Finset (Fin (n + 1)))) (v := node) hnode_inj.injOn hr_degree change eval (fun i => cos (x i)) p = q x rw [show q x = sec (x 0) by congr 1 funext k refine Fin.cases ?_ (fun l => ?_) k <;> simp] rw [← hr (x 0), hinterp] simp only [p, MvPolynomial.eval_sum, MvPolynomial.eval_mul, MvPolynomial.eval_rename, MvPolynomial.eval_toMvPolynomial, Lagrange.interpolate_apply, Polynomial.eval_finsetSum, Polynomial.eval_mul, Polynomial.eval_C] apply Finset.sum_congr rfl intro j hj have hcos_tail : (fun i => cos (x i)) ∘ succ = (fun i => cos ((x ∘ succ) i)) := by rfl rw [hcos_tail, (hptail j).1] rw [show qtail j (x ∘ succ) = sec (angle j) by rfl, ← hr (angle j), hcos_angle] · intro m hm i refine (MvPolynomial.monomial_le_degreeOf i hm).trans ?_ dsimp [p] refine (MvPolynomial.degreeOf_sum_le i Finset.univ (fun j => MvPolynomial.rename succ (ptail j) * (basis j).toMvPolynomial 0)).trans ?_ apply Finset.sup_le intro j hj refine (MvPolynomial.degreeOf_mul_le i _ _).trans ?_ have hbd := hpoly_degree n (0 : Fin (N + 1)) i (basis j) (hbdeg j) have hrd := hrename_degree j i refine (add_le_add hrd hbd).trans ?_ refine Fin.cases ?_ (fun k => ?_) i <;> simp [n] let e : ι ≃ Fin (card ι) := Fintype.equivFin ι let q' : (Fin (card ι) → ℝ) → ℝ := fun x => q (x ∘ e) let D' : Fin (card ι) → ℕ := D ∘ e.symm have ht' (i : Fin (card ι)) (x : Fin (card ι) → ℝ) : IsTrigPolyLE (D' i) (fun t => q' (update x i t)) := by convert htrig (e.symm i) (x ∘ e) using 1 · simp [D', D] · funext t change q ((update x i t) ∘ e) = q (update (x ∘ e) (e.symm i) t) apply congrArg q funext j by_cases hji : e j = i · have hj : j = e.symm i := by simp [← hji] subst j simp [update] · have hj : j ≠ e.symm i := by intro h apply hji simpa [h] using e.apply_symm_apply i simp [update, hji, hj] have he' (i : Fin (card ι)) (x : Fin (card ι) → ℝ) : Even (fun t => q' (update x i t)) := by convert heven (e.symm i) (x ∘ e) using 1 funext t change q ((update x i t) ∘ e) = q (update (x ∘ e) (e.symm i) t) apply congrArg q funext j by_cases hji : e j = i · have hj : j = e.symm i := by simp [← hji] subst j simp [update] · have hj : j ≠ e.symm i := by intro h apply hji simpa [h] using e.apply_symm_apply i simp [update, hji, hj] rcases hfin (card ι) D' q' ht' he' with ⟨p', hp', hb'⟩ refine ⟨MvPolynomial.rename e.symm p', ?_, ?_⟩ · intro x rw [MvPolynomial.eval_rename] have hx : (cosPoint x) ∘ e.symm = fun i => cos ((x ∘ e.symm) i) := rfl rw [hx, hp'] exact congrArg q (funext fun i => by simp [e.symm_apply_apply]) · intro m hm i rw [MvPolynomial.support_rename_of_injective e.symm.injective] at hm rcases Finset.mem_image.mp hm with ⟨m', hm', rfl⟩ have h := hb' m' hm' (e i) simpa [D', D, Finsupp.mapDomain_apply e.symm.injective] using h
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.polynomial_of_coord_even_trig · Causalean/Mathlib/Analysis/Approximation/Chebyshev/HeterogeneousTensorExtraction.lean:229
Kernel_Part2 1 core · 13 supporting Building on Kernel_Part1, this module computes the raw kernel's exact mass, proves that the normalized kernel has unit integral at positive order, derives explicit first- and second-moment bounds, and bounds its trigonom ★ jackson_second_moment

Normalization and moment bounds for the order-four Jackson kernel

Building on Kernel_Part1, this module computes the raw kernel's exact mass, proves that the normalized kernel has unit integral at positive order, derives explicit first- and second-moment bounds, and bounds its trigonometric degree.

theorem jackson_second_moment reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

For integer order K that is strictly positive, the normalized second moment is at most sixty-four divided by K squared.

Formal statement
K :
ℕ
hK :
0 < K
(∫ t in Icc (-pi) pi, t ^ 2 * jackson K t) ≤ 64 / (K : ℝ) ^ 2
Proof (Lean source)
theorem jackson_second_moment (K : ℕ) (hK : 0 < K) : (∫ t in Icc (-pi) pi, t ^ 2 * jackson K t) ≤ 64 / (K : ℝ) ^ 2 := by refine (jackson_second_moment_aux K hK).trans ?_ have hKR : (0 : ℝ) < K := by exact_mod_cast hK field_simp nlinarith
Causalean.Mathlib.Analysis.JacksonApproximation.jackson_second_moment · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:380 · uses jackson
13 supporting declarations (lemmas, instances)
  • jrawMass_eq theorem — For integer order K that is strictly positive, the raw Jackson mass equals two π thirds times K times two K squared plus one.
    K :
    ℕ
    hK :
    0 < K
    jrawMass K = (2 * pi / 3) * (K : ℝ) * (2 * (K : ℝ) ^ 2 + 1)
    Proof (Lean source)
    theorem jrawMass_eq (K : ℕ) (hK : 0 < K) : jrawMass K = (2 * pi / 3) * (K : ℝ) * (2 * (K : ℝ) ^ 2 + 1) := by have hcast : ((K - 1 : ℕ) : ℝ) = (K : ℝ) - 1 := by rw [Nat.cast_sub (Nat.one_le_iff_ne_zero.mpr (Nat.ne_of_gt hK))] norm_num have hfun : jraw K = fun t => ((K : ℝ) + ∑ j ∈ range (K - 1), (2 * (((K - 1 : ℕ) : ℝ) - (j : ℝ))) * cos (((j + 1 : ℕ) : ℝ) * t)) ^ 2 := by funext t rw [jraw_eq_chebyshev K hK t] rw [show (U ℝ ((K - 1 : ℕ) : ℤ)).eval (cos (t / 2)) ^ 4 = ((U ℝ ((K - 1 : ℕ) : ℤ)).eval (cos (t / 2)) ^ 2) ^ 2 by ring] congr 1 rw [cheb_U_sq_eval (K - 1) t] have hsucc : K - 1 + 1 = K := by omega rw [hcast] rw [Finset.mul_sum] have hlead : (K : ℝ) - 1 + 1 = (K : ℝ) := by ring rw [hlead] apply congrArg ((K : ℝ) + ·) apply Finset.sum_congr rfl intro j hj ring rw [jrawMass, hfun, integral_sq_cos_sum] have hsum := sum_range_sub_sq (K - 1) have hcoeff : (∑ j ∈ range (K - 1), (2 * (((K - 1 : ℕ) : ℝ) - (j : ℝ))) ^ 2) = 4 * (((K - 1 : ℕ) : ℝ) * ((K - 1 : ℕ) + 1) * (2 * (K - 1 : ℕ) + 1) / 6) := by calc (∑ j ∈ range (K - 1), (2 * (((K - 1 : ℕ) : ℝ) - (j : ℝ))) ^ 2) = 4 * ∑ j ∈ range (K - 1), (((K - 1 : ℕ) : ℝ) - (j : ℝ)) ^ 2 := by rw [Finset.mul_sum] apply Finset.sum_congr rfl intro j hj ring _ = _ := by rw [hsum] rw [hcoeff, hcast] push_cast ring
    Causalean.Mathlib.Analysis.JacksonApproximation.jrawMass_eq · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:23
  • jrawMass_lower theorem — For integer order K that is strictly positive, the raw Jackson mass is at least four π thirds times K cubed.
    K :
    ℕ
    hK :
    0 < K
    (4 * pi / 3) * (K : ℝ) ^ 3 ≤ jrawMass K
    Proof (Lean source)
    theorem jrawMass_lower (K : ℕ) (hK : 0 < K) : (4 * pi / 3) * (K : ℝ) ^ 3 ≤ jrawMass K := by rw [jrawMass_eq K hK] have hpi : 0 < pi := Real.pi_pos have hKR : (1 : ℝ) ≤ K := by exact_mod_cast hK nlinarith [sq_nonneg ((K : ℝ) - 1)]
    Causalean.Mathlib.Analysis.JacksonApproximation.jrawMass_lower · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:73
  • jrawMass_upper theorem — For integer order K that is strictly positive, the raw Jackson mass is at most two π times K cubed.
    K :
    ℕ
    hK :
    0 < K
    jrawMass K ≤ 2 * pi * (K : ℝ) ^ 3
    Proof (Lean source)
    theorem jrawMass_upper (K : ℕ) (hK : 0 < K) : jrawMass K ≤ 2 * pi * (K : ℝ) ^ 3 := by rw [jrawMass_eq K hK] have hpi : 0 < pi := Real.pi_pos have hKR : (1 : ℝ) ≤ K := by exact_mod_cast hK have hsquare : 2 * (K : ℝ) ^ 2 + 1 ≤ 3 * (K : ℝ) ^ 2 := by nlinarith calc (2 * pi / 3) * (K : ℝ) * (2 * (K : ℝ) ^ 2 + 1) ≤ (2 * pi / 3) * (K : ℝ) * (3 * (K : ℝ) ^ 2) := by exact mul_le_mul_of_nonneg_left hsquare (by positivity) _ = 2 * pi * (K : ℝ) ^ 3 := by ring
    Causalean.Mathlib.Analysis.JacksonApproximation.jrawMass_upper · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:83
  • jrawMass_pos theorem — For integer order K that is strictly positive, the raw Jackson mass is strictly positive.
    K :
    ℕ
    hK :
    0 < K
    0 < jrawMass K
    Proof (Lean source)
    theorem jrawMass_pos (K : ℕ) (hK : 0 < K) : 0 < jrawMass K := by have hl := jrawMass_lower K hK have hpi : 0 < pi := Real.pi_pos have hKR : (0 : ℝ) < K := by exact_mod_cast hK exact lt_of_lt_of_le (by positivity) hl
    Causalean.Mathlib.Analysis.JacksonApproximation.jrawMass_pos · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:98
  • continuous_jackson theorem — For integer order K, the normalized Jackson kernel is continuous on the real line.
    K :
    ℕ
    Proof (Lean source)
    @[fun_prop] theorem continuous_jackson (K : ℕ) : Continuous (jackson K) := by unfold jackson fun_prop
    Causalean.Mathlib.Analysis.JacksonApproximation.continuous_jackson · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:107
  • measurable_jackson theorem — For integer order K, the normalized Jackson kernel is Borel measurable.
    K :
    ℕ
    Proof (Lean source)
    @[measurability, fun_prop] theorem measurable_jackson (K : ℕ) : Measurable (jackson K) := by exact (continuous_jackson K).measurable
    Causalean.Mathlib.Analysis.JacksonApproximation.measurable_jackson · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:115
  • integrableOn_jackson theorem — For integer order K, the normalized Jackson kernel is integrable over the standard period.
    K :
    ℕ
    Proof (Lean source)
    theorem integrableOn_jackson (K : ℕ) : IntegrableOn (jackson K) (Icc (-pi) pi) := by exact (continuous_jackson K).continuousOn.integrableOn_compact isCompact_Icc
    Causalean.Mathlib.Analysis.JacksonApproximation.integrableOn_jackson · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:121
  • jackson_nonneg theorem — At integer order K that is strictly positive and real argument t, the normalized Jackson kernel is nonnegative.
    K :
    ℕ
    hK :
    0 < K
    t :
    ℝ
    0 ≤ jackson K t
    Proof (Lean source)
    theorem jackson_nonneg (K : ℕ) (hK : 0 < K) (t : ℝ) : 0 ≤ jackson K t := by exact div_nonneg (jraw_nonneg K t) (jrawMass_pos K hK).le
    Causalean.Mathlib.Analysis.JacksonApproximation.jackson_nonneg · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:128
  • jackson_even theorem — For integer order K, the normalized Jackson kernel is symmetric about zero.
    K :
    ℕ
    Proof (Lean source)
    theorem jackson_even (K : ℕ) : Even (jackson K) := by intro t simp only [jackson, jraw_even K t]
    Causalean.Mathlib.Analysis.JacksonApproximation.jackson_even · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:134
  • jackson_integral_eq_one theorem — For integer order K that is strictly positive, the normalized Jackson kernel has unit mass over the standard period.
    K :
    ℕ
    hK :
    0 < K
    (∫ t in Icc (-pi) pi, jackson K t) = 1
    Proof (Lean source)
    theorem jackson_integral_eq_one (K : ℕ) (hK : 0 < K) : (∫ t in Icc (-pi) pi, jackson K t) = 1 := by rw [show jackson K = fun t => jraw K t / jrawMass K by rfl, MeasureTheory.integral_div, ← jrawMass] exact div_self (jrawMass_pos K hK).ne'
    Causalean.Mathlib.Analysis.JacksonApproximation.jackson_integral_eq_one · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:140
  • jackson_first_moment theorem — For integer order K that is strictly positive, the normalized absolute first moment is at most thirty-two divided by K.
    K :
    ℕ
    hK :
    0 < K
    (∫ t in Icc (-pi) pi, |t| * jackson K t) ≤ 32 / (K : ℝ)
    Proof (Lean source)
    theorem jackson_first_moment (K : ℕ) (hK : 0 < K) : (∫ t in Icc (-pi) pi, |t| * jackson K t) ≤ 32 / (K : ℝ) := by have hKR : (0 : ℝ) < K := by exact_mod_cast hK have hpoint (t : ℝ) : |t| ≤ (K : ℝ) / 4 * t ^ 2 + 1 / (K : ℝ) := by have hs := sq_nonneg ((K : ℝ) * |t| - 2) have ht2 : |t| ^ 2 = t ^ 2 := sq_abs t field_simp nlinarith have hiLeft : IntegrableOn (fun t => |t| * jackson K t) (Icc (-pi) pi) := (show Continuous (fun t => |t| * jackson K t) by fun_prop).continuousOn |>.integrableOn_compact isCompact_Icc have hiRight : IntegrableOn (fun t => ((K : ℝ) / 4 * t ^ 2 + 1 / (K : ℝ)) * jackson K t) (Icc (-pi) pi) := (show Continuous (fun t => ((K : ℝ) / 4 * t ^ 2 + 1 / (K : ℝ)) * jackson K t) by fun_prop).continuousOn |>.integrableOn_compact isCompact_Icc calc (∫ t in Icc (-pi) pi, |t| * jackson K t) ≤ ∫ t in Icc (-pi) pi, ((K : ℝ) / 4 * t ^ 2 + 1 / (K : ℝ)) * jackson K t := by exact MeasureTheory.setIntegral_mono_on hiLeft hiRight measurableSet_Icc (fun t ht => mul_le_mul_of_nonneg_right (hpoint t) (jackson_nonneg K hK t)) _ = (K : ℝ) / 4 * (∫ t in Icc (-pi) pi, t ^ 2 * jackson K t) + (1 / (K : ℝ)) * (∫ t in Icc (-pi) pi, jackson K t) := by have hi₁ : IntegrableOn (fun t => (K : ℝ) / 4 * (t ^ 2 * jackson K t)) (Icc (-pi) pi) := (show Continuous (fun t => (K : ℝ) / 4 * (t ^ 2 * jackson K t)) by fun_prop).continuousOn.integrableOn_compact isCompact_Icc have hi₂ : IntegrableOn (fun t => (1 / (K : ℝ)) * jackson K t) (Icc (-pi) pi) := (show Continuous (fun t => (1 / (K : ℝ)) * jackson K t) by fun_prop).continuousOn.integrableOn_compact isCompact_Icc rw [show (fun t => ((K : ℝ) / 4 * t ^ 2 + 1 / (K : ℝ)) * jackson K t) = fun t => (K : ℝ) / 4 * (t ^ 2 * jackson K t) + (1 / (K : ℝ)) * jackson K t by funext t; ring] rw [MeasureTheory.integral_add hi₁ hi₂, MeasureTheory.integral_const_mul, MeasureTheory.integral_const_mul] _ ≤ (K : ℝ) / 4 * (24 / (K : ℝ) ^ 2) + (1 / (K : ℝ)) * 1 := by gcongr · exact jackson_second_moment_aux K hK · exact (jackson_integral_eq_one K hK).le _ ≤ 32 / (K : ℝ) := by field_simp nlinarith
    Causalean.Mathlib.Analysis.JacksonApproximation.jackson_first_moment · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:327
  • jraw_isTrigPolyLE theorem — For integer order K that is strictly positive, the raw Jackson kernel is a real trigonometric polynomial with frequency at most twice the predecessor of K.
    K :
    ℕ
    hK :
    0 < K
    IsTrigPolyLE (2 * (K - 1)) (jraw K)
    Proof (Lean source)
    theorem jraw_isTrigPolyLE (K : ℕ) (hK : 0 < K) : IsTrigPolyLE (2 * (K - 1)) (jraw K) := by let U : Polynomial ℝ := U ℝ ((K - 1 : ℕ) : ℤ) let p : Polynomial ℝ := U ^ 4 have hpneg : ∀ x : ℝ, p.eval (-x) = p.eval x := by intro x simp only [p, Polynomial.eval_pow, U] rw [Polynomial.Chebyshev.U_eval_neg] rw [mul_pow] have hsign : (((((K - 1 : ℕ) : ℤ)).negOnePow : ℤ) : ℝ) ^ 4 = 1 := by have habs : |(((((K - 1 : ℕ) : ℤ)).negOnePow : ℤ) : ℝ)| = 1 := by norm_cast exact Int.abs_negOnePow _ calc (((((K - 1 : ℕ) : ℤ)).negOnePow : ℤ) : ℝ) ^ 4 = |(((((K - 1 : ℕ) : ℤ)).negOnePow : ℤ) : ℝ) ^ 4| := by rw [abs_of_nonneg (by positivity)] _ = |(((((K - 1 : ℕ) : ℤ)).negOnePow : ℤ) : ℝ)| ^ 4 := by exact abs_pow _ _ _ = 1 := by rw [habs]; norm_num rw [hsign, one_mul] obtain ⟨q, hqdeg, hpq⟩ := exists_comp_sq_of_eval_neg_eq p hpneg let A : Polynomial ℝ := C (1 / 2 : ℝ) * (X + 1) let R : Polynomial ℝ := q.comp A have hAdeg : A.natDegree ≤ 1 := by dsimp [A] compute_degree have hpdeg : p.natDegree = 4 * (K - 1) := by dsimp [p, U] rw [Polynomial.natDegree_pow, Polynomial.Chebyshev.natDegree_U_natCast] have hRdeg : R.natDegree ≤ 2 * (K - 1) := by calc R.natDegree ≤ q.natDegree * A.natDegree := Polynomial.natDegree_comp_le _ ≤ q.natDegree * 1 := Nat.mul_le_mul_left _ hAdeg _ = q.natDegree := Nat.mul_one _ _ ≤ p.natDegree / 2 := hqdeg _ = 2 * (K - 1) := by rw [hpdeg]; omega apply (cosComp_isTrigPolyLE R (2 * (K - 1)) hRdeg).congr intro t rw [jraw_eq_chebyshev K hK t] have hhalf : cos (t / 2) ^ 2 = (cos t + 1) / 2 := by have hcos := Real.cos_two_mul (t / 2) rw [show 2 * (t / 2) = t by ring] at hcos nlinarith calc (U ℝ ((K - 1 : ℕ) : ℤ)).eval (cos (t / 2)) ^ 4 = p.eval (cos (t / 2)) := by simp [p, U] _ = q.eval (cos (t / 2) ^ 2) := by rw [hpq, Polynomial.eval_comp, Polynomial.eval_pow, Polynomial.eval_X] _ = q.eval ((cos t + 1) / 2) := by rw [hhalf] _ = R.eval (cos t) := by simp [R, A, Polynomial.eval_comp] congr 1 ring
    Causalean.Mathlib.Analysis.JacksonApproximation.jraw_isTrigPolyLE · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:391
  • jackson_isTrigPolyLE theorem — For integer order K that is strictly positive, the normalized Jackson kernel is a real trigonometric polynomial with frequency at most twice the predecessor of K.
    K :
    ℕ
    hK :
    0 < K
    IsTrigPolyLE (2 * (K - 1)) (jackson K)
    Proof (Lean source)
    theorem jackson_isTrigPolyLE (K : ℕ) (hK : 0 < K) : IsTrigPolyLE (2 * (K - 1)) (jackson K) := by apply (const_mul (jrawMass K)⁻¹ (jraw_isTrigPolyLE K hK)).congr intro t simp [jackson, div_eq_mul_inv, mul_comm]
    Causalean.Mathlib.Analysis.JacksonApproximation.jackson_isTrigPolyLE · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Kernel_Part2.lean:452
Lobatto­Lagrange 1 core · 4 supporting For the Chebyshev–Lobatto nodes cos(iπ/N), i = 0, …, N, the sum of the absolute values of the Lagrange cardinal polynomials at a point x < −1 outside the grid equals |T_N(x)|, the absolute value of the degree-N Chebyshev ★ calibrated_chebyshev_exterior_le_cosh_two

Exterior Lagrange mass on Chebyshev–Lobatto grids

For the Chebyshev–Lobatto nodes cos(iπ/N), i = 0, …, N, the sum of the absolute values of the Lagrange cardinal polynomials at a point x < −1 outside the grid equals |T_N(x)|, the absolute value of the degree-N Chebyshev polynomial. By affine invariance of the cardinal polynomials, the grid moved to [a, 1] with 0 < a < 1 has cardinal mass |T_N(−(1 + a)/(1 − a))| at zero, and for a = K⁻² and N = K − 1 with K ≥ 2 this value is at most cosh 2. These identities bound how far polynomial extrapolation from [a, 1] to 0 can amplify sampled values.

Main results

* standard_exterior_basis_sign — for x < −1 the i-th cardinal value has sign (−1)^(N + i). * standard_exterior_lagrange_abs_sum — Σ_i |ℓ_i(x)| = |T_N(x)| for x < −1. * lagrange_basis_eval_affine_local — cardinal polynomials are unchanged when nodes and the evaluation point undergo the same affine map with nonzero slope. * shifted_chebyshev_lagrange_abs_sum — the cardinal mass at zero of the grid moved to [a, 1]. * calibrated_chebyshev_exterior_le_cosh_two — |T_(K−1)(−(1 + K⁻²)/(1 − K⁻²))| ≤ cosh 2.

lemma calibrated_chebyshev_exterior_le_cosh_two reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

For an integer scale K at least two, the Chebyshev polynomial of the first kind of degree K − 1, evaluated at the exterior point −(1 + K⁻²) / (1 − K⁻²), which lies to the left of −1, has absolute value at most cosh 2.

Formal statement
K :
ℕ
hK :
2 ≤ K
|(T ℝ ((K - 1 : ℕ) : ℤ)).eval (-(1 + (K : ℝ)⁻¹ ^ 2) / (1 - (K : ℝ)⁻¹ ^ 2))|
≤ cosh 2
Proof (Lean source)
lemma calibrated_chebyshev_exterior_le_cosh_two (K : ℕ) (hK : 2 ≤ K) : |(T ℝ ((K - 1 : ℕ) : ℤ)).eval (-(1 + (K : ℝ)⁻¹ ^ 2) / (1 - (K : ℝ)⁻¹ ^ 2))| ≤ cosh 2 := by let k : ℝ := K let r : ℝ := (k + 1) / (k - 1) let t : ℝ := Real.log r have hk2 : (2 : ℝ) ≤ k := by dsimp [k] exact_mod_cast hK have hk1 : 1 < k := lt_of_lt_of_le (by norm_num) hk2 have hrpos : 0 < r := div_pos (by linarith) (by linarith) have hrone : 1 ≤ r := by dsimp [r] rw [le_div_iff₀ (by linarith : 0 < k - 1)] linarith have ht0 : 0 ≤ t := by dsimp [t] exact Real.log_nonneg hrone have ht_upper : (((K - 1 : ℕ) : ℝ)) * t ≤ 2 := by have hlog := Real.log_le_sub_one_of_pos hrpos have hkreal : ((K - 1 : ℕ) : ℝ) = k - 1 := by dsimp [k] rw [Nat.cast_sub (by omega)] norm_num rw [hkreal] calc (k - 1) * t ≤ (k - 1) * (r - 1) := mul_le_mul_of_nonneg_left hlog (by linarith) _ = 2 := by dsimp [r] field_simp [ne_of_gt (sub_pos.mpr hk1)] ring have hz : -(1 + (K : ℝ)⁻¹ ^ 2) / (1 - (K : ℝ)⁻¹ ^ 2) = -cosh t := by have hk0 : k ≠ 0 := ne_of_gt (lt_trans (by norm_num) hk1) have hkm1 : k - 1 ≠ 0 := ne_of_gt (sub_pos.mpr hk1) have hkp1 : k + 1 ≠ 0 := by linarith have hksq : k ^ 2 - 1 ≠ 0 := by nlinarith change -(1 + k⁻¹ ^ 2) / (1 - k⁻¹ ^ 2) = -cosh t rw [Real.cosh_log hrpos] dsimp [t, r] field_simp [hk0, hkm1, hkp1, hksq] ring rw [hz, Polynomial.Chebyshev.T_eval_neg, Polynomial.Chebyshev.T_real_cosh] simp only [abs_mul, abs_unit_intCast, one_mul, Int.cast_natCast] rw [abs_of_nonneg (Real.cosh_pos _).le] apply (Real.cosh_le_cosh).2 rw [abs_of_nonneg (mul_nonneg (Nat.cast_nonneg _) ht0), abs_of_nonneg (by norm_num : (0 : ℝ) ≤ 2)] exact ht_upper
Causalean.Mathlib.Analysis.Approximation.Chebyshev.calibrated_chebyshev_exterior_le_cosh_two · Causalean/Mathlib/Analysis/Approximation/Chebyshev/LobattoLagrange.lean:246
4 supporting declarations (lemmas, instances)
  • standard_exterior_basis_sign lemma — For a standard Lobatto grid of degree, an evaluation point left of -1, and a grid index, the absolute cardinal-basis value is the value with its common alternating sign exposed. The result is the alternating-sign identity for an exterior Lobatto cardinal value.
    N :
    ℕ
    x :
    ℝ
    hx :
    x < -1
    i :
    Fin (N + 1)
    |(basis univ (fun j : Fin (N + 1) => node N j) i).eval x|
    = (-1 : ℝ) ^ N * ((-1 : ℝ) ^ (i : ℕ) * (basis univ (fun j : Fin (N + 1) => node N j) i).eval x)
    Proof (Lean source)
    lemma standard_exterior_basis_sign (N : ℕ) (x : ℝ) (hx : x < -1) (i : Fin (N + 1)) : |(basis Finset.univ (fun j : Fin (N + 1) => Polynomial.Chebyshev.node N j) i).eval x| = (-1 : ℝ) ^ N * ((-1 : ℝ) ^ (i : ℕ) * (basis Finset.univ (fun j : Fin (N + 1) => Polynomial.Chebyshev.node N j) i).eval x) := by let s := (Finset.univ : Finset (Fin (N + 1))).erase i let v : Fin (N + 1) → ℝ := fun j => Polynomial.Chebyshev.node N j let D : ℝ := ∏ j ∈ s, (v i - v j) let A : ℝ := ∏ j ∈ s, (x - v j) have hi : (i : ℕ) ≤ N := Nat.lt_succ_iff.mp i.isLt have hD : 0 < (-1 : ℝ) ^ (i : ℕ) * D := by have hleft : 0 < ∏ j ∈ Finset.Iio i, ((-1 : ℝ) * (v i - v j)) := by apply Finset.prod_pos intro j hj have hji : j < i := Finset.mem_Iio.mp hj exact mul_pos_of_neg_of_neg (by norm_num) (sub_neg.mpr (Polynomial.Chebyshev.node_lt hi hji)) rw [Finset.prod_mul_distrib, Finset.prod_const, Fin.card_Iio] at hleft have hright : 0 < ∏ j ∈ Finset.Ioi i, (v i - v j) := by apply Finset.prod_pos intro j hj have hij : i < j := Finset.mem_Ioi.mp hj exact sub_pos.mpr (Polynomial.Chebyshev.node_lt (Nat.lt_succ_iff.mp j.isLt) hij) have hunion : s = Finset.Iio i ∪ Finset.Ioi i := by ext j simp only [s, Finset.mem_erase, Finset.mem_univ, and_true, mem_union, Finset.mem_Iio, Finset.mem_Ioi] constructor · exact lt_or_gt_of_ne · exact fun h => h.elim (fun hji => ne_of_lt hji) (fun hij => ne_of_gt hij) have hdisjoint : Disjoint (Finset.Iio i) (Finset.Ioi i) := by exact Finset.disjoint_left.mpr (fun j hji hij => (Finset.mem_Iio.mp hji).asymm (Finset.mem_Ioi.mp hij)) dsimp [D] rw [hunion, Finset.prod_union hdisjoint, ← mul_assoc] exact mul_pos hleft hright have hA : 0 < (-1 : ℝ) ^ N * A := by have hpos : 0 < ∏ j ∈ s, -(x - v j) := by apply Finset.prod_pos intro j hj have hvj : -1 ≤ v j := (Polynomial.Chebyshev.node_mem_Icc).1 linarith have hcard : s.card = N := by simp [s] rw [Finset.prod_neg, hcard] at hpos exact hpos have heval : (basis Finset.univ v i).eval x = D⁻¹ * A := by rw [basis, Polynomial.eval_prod] simp only [Lagrange.basisDivisor, Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_sub, Polynomial.eval_X] rw [Finset.prod_mul_distrib, ← Finset.prod_inv_distrib] have hsign : 0 < ((-1 : ℝ) ^ N * (-1 : ℝ) ^ (i : ℕ)) * (basis Finset.univ v i).eval x := by rw [heval] have hDi : 0 < ((-1 : ℝ) ^ (i : ℕ) * D)⁻¹ := inv_pos.mpr hD have hrewrite : ((-1 : ℝ) ^ (i : ℕ) * D)⁻¹ = (-1 : ℝ) ^ (i : ℕ) * D⁻¹ := by rw [mul_inv_rev] have hpow : ((-1 : ℝ) ^ (i : ℕ))⁻¹ = (-1 : ℝ) ^ (i : ℕ) := by rw [← inv_pow] norm_num rw [hpow] ring rw [hrewrite] at hDi nlinarith have habs := abs_of_pos hsign rw [abs_mul, abs_mul, abs_neg_one_pow, abs_neg_one_pow, one_mul, one_mul] at habs rw [habs, mul_assoc]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.standard_exterior_basis_sign · Causalean/Mathlib/Analysis/Approximation/Chebyshev/LobattoLagrange.lean:41
  • standard_exterior_lagrange_abs_sum lemma — For a standard Lobatto grid of degree and an evaluation point left of -1, the sum of absolute cardinal-basis values equals the absolute value of the corresponding Chebyshev polynomial. The result is the exterior Lobatto cardinal-mass identity.
    N :
    ℕ
    x :
    ℝ
    hx :
    x < -1
    (∑ i : Fin (N + 1), |(basis univ (fun j : Fin (N + 1) => node N j) i).eval x|)
    = |(T ℝ (N : ℤ)).eval x|
    Proof (Lean source)
    lemma standard_exterior_lagrange_abs_sum (N : ℕ) (x : ℝ) (hx : x < -1) : (∑ i : Fin (N + 1), |(basis Finset.univ (fun j : Fin (N + 1) => Polynomial.Chebyshev.node N j) i).eval x|) = |(T ℝ (N : ℤ)).eval x| := by let v : Fin (N + 1) → ℝ := fun j => Polynomial.Chebyshev.node N j have hv : Injective v := by intro i j hij by_contra hne rcases lt_or_gt_of_ne hne with hij' | hji' · exact ne_of_gt (Polynomial.Chebyshev.node_lt (Nat.lt_succ_iff.mp j.isLt) hij') hij · exact ne_of_lt (Polynomial.Chebyshev.node_lt (Nat.lt_succ_iff.mp i.isLt) hji') hij have hdegree : (T ℝ (N : ℤ)).degree < ((Finset.univ : Finset (Fin (N + 1))).card : WithBot ℕ) := by rw [Polynomial.Chebyshev.degree_T, Int.natAbs_natCast] simp exact_mod_cast lt_succ_self N have hinterp := Lagrange.eq_interpolate (f := T ℝ (N : ℤ)) hv.injOn hdegree have heval := congrArg (fun p : ℝ[X] => p.eval x) hinterp have hsigned : (∑ i : Fin (N + 1), (-1 : ℝ) ^ (i : ℕ) * (basis Finset.univ v i).eval x) = (T ℝ (N : ℤ)).eval x := by rw [heval] simp only [Lagrange.interpolate_apply, Polynomial.eval_finsetSum, Polynomial.eval_mul, Polynomial.eval_C] apply Finset.sum_congr rfl intro i _ rw [Polynomial.Chebyshev.eval_T_real_node (Finset.mem_Iic.mpr (Nat.lt_succ_iff.mp i.isLt))] calc (∑ i : Fin (N + 1), |(basis Finset.univ v i).eval x|) = ∑ i : Fin (N + 1), (-1 : ℝ) ^ N * ((-1 : ℝ) ^ (i : ℕ) * (basis Finset.univ v i).eval x) := by apply Finset.sum_congr rfl intro i _ exact standard_exterior_basis_sign N x hx i _ = (-1 : ℝ) ^ N * (∑ i : Fin (N + 1), (-1 : ℝ) ^ (i : ℕ) * (basis Finset.univ v i).eval x) := by rw [Finset.mul_sum] _ = (-1 : ℝ) ^ N * (T ℝ (N : ℤ)).eval x := by rw [hsigned] _ = |(T ℝ (N : ℤ)).eval x| := by have hnonneg : 0 ≤ (-1 : ℝ) ^ N * (T ℝ (N : ℤ)).eval x := by have h := Polynomial.Chebyshev.one_le_negOnePow_mul_eval_T_real (N : ℤ) (show x ≤ -1 by linarith) simpa using (show (0 : ℝ) ≤ (N : ℤ).negOnePow * (T ℝ (N : ℤ)).eval x by linarith) calc (-1 : ℝ) ^ N * (T ℝ (N : ℤ)).eval x = |(-1 : ℝ) ^ N * (T ℝ (N : ℤ)).eval x| := (abs_of_nonneg hnonneg).symm _ = _ := by rw [abs_mul, abs_neg_one_pow, one_mul]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.standard_exterior_lagrange_abs_sum · Causalean/Mathlib/Analysis/Approximation/Chebyshev/LobattoLagrange.lean:117
  • lagrange_basis_eval_affine_local lemma — For nodes that are injective on the interpolation set, a selected node in that set, and a nondegenerate affine change of scale, the transformed cardinal-basis evaluation equals the original evaluation. The result is invariance of the cardinal-basis evaluation under the affine change.
    ι :
    Type*
    ι → ℝ
    hv :
    InjOn v s
    i :
    ι
    hi :
    i ∈ s
    c r z :
    ℝ
    hr :
    r ≠ 0
    (basis s (fun j => c + r * v j) i).eval (c + r * z)
    = (basis s v i).eval z
    Proof (Lean source)
    lemma lagrange_basis_eval_affine_local {ι : Type*} [DecidableEq ι] {s : Finset ι} {v : ι → ℝ} (hv : InjOn v s) {i : ι} (hi : i ∈ s) (c r z : ℝ) (hr : r ≠ 0) : (basis s (fun j => c + r * v j) i).eval (c + r * z) = (basis s v i).eval z := by rw [basis, basis, Polynomial.eval_prod, Polynomial.eval_prod] apply Finset.prod_congr rfl intro j hj have hjmem : j ∈ s := (Finset.mem_erase.mp hj).2 have hji : j ≠ i := (Finset.mem_erase.mp hj).1 have hvne : v i ≠ v j := by intro h exact hji (hv hi hjmem h).symm simp only [Lagrange.basisDivisor, Polynomial.eval_mul, Polynomial.eval_C, Polynomial.eval_sub, Polynomial.eval_X] rw [show c + r * z - (c + r * v j) = r * (z - v j) by ring, show c + r * v i - (c + r * v j) = r * (v i - v j) by ring] field_simp [hr, hvne]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.lagrange_basis_eval_affine_local · Causalean/Mathlib/Analysis/Approximation/Chebyshev/LobattoLagrange.lean:183
  • shifted_chebyshev_lagrange_abs_sum lemma — For a Lobatto degree and a left endpoint strictly between zero and one, the cardinal mass of the grid shifted to [a,1] and evaluated at zero equals the stated exterior Chebyshev value. The result is the shifted-grid cardinal-mass identity at zero.
    N :
    ℕ
    a :
    ℝ
    ha0 :
    0 < a
    ha1 :
    a < 1
    (∑ i : Fin (N + 1), |(basis univ (fun j : Fin (N + 1) => (1 + a) / 2 + (1 - a) / 2 * node N j) i).eval 0|)
    = |(T ℝ (N : ℤ)).eval (-(1 + a) / (1 - a))|
    Proof (Lean source)
    lemma shifted_chebyshev_lagrange_abs_sum (N : ℕ) (a : ℝ) (ha0 : 0 < a) (ha1 : a < 1) : (∑ i : Fin (N + 1), |(basis univ (fun j : Fin (N + 1) => (1 + a) / 2 + (1 - a) / 2 * Polynomial.Chebyshev.node N j) i).eval 0|) = |(T ℝ (N : ℤ)).eval (-(1 + a) / (1 - a))| := by let v : Fin (N + 1) → ℝ := fun j => Polynomial.Chebyshev.node N j let c : ℝ := (1 + a) / 2 let r : ℝ := (1 - a) / 2 let z : ℝ := -(1 + a) / (1 - a) have hr : r ≠ 0 := by dsimp [r]; positivity have hv : Injective v := by intro i j hij by_contra hne rcases lt_or_gt_of_ne hne with hij' | hji' · exact ne_of_gt (Polynomial.Chebyshev.node_lt (Nat.lt_succ_iff.mp j.isLt) hij') hij · exact ne_of_lt (Polynomial.Chebyshev.node_lt (Nat.lt_succ_iff.mp i.isLt) hji') hij have hz : c + r * z = 0 := by dsimp [c, r, z] field_simp [ne_of_gt (sub_pos.mpr ha1)] ring have hzlt : z < -1 := by dsimp [z] rw [div_lt_iff₀ (sub_pos.mpr ha1)] linarith rw [← standard_exterior_lagrange_abs_sum N z hzlt] apply Finset.sum_congr rfl intro i _ rw [← hz] exact congrArg abs (lagrange_basis_eval_affine_local hv.injOn (Finset.mem_univ i) c r z hr)
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.shifted_chebyshev_lagrange_abs_sum · Causalean/Mathlib/Analysis/Approximation/Chebyshev/LobattoLagrange.lean:207
Markov 2 core · 5 supporting This module proves the sharp Markov derivative inequality on [-1,1] from the Duffin--Schaeffer bound and transports it affinely to arbitrary nondegenerate compact intervals. ★ markov_derivative_Icc

Markov's polynomial derivative inequality

This module proves the sharp Markov derivative inequality on [-1,1] from the Duffin--Schaeffer bound and transports it affinely to arbitrary nondegenerate compact intervals.

def pullbackToUnitInterval reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

The pullback to the unit interval of a real polynomial for interval endpoints r and s is the polynomial composed with the affine map t ↦ ((s − r) / 2) t + (r + s) / 2, which carries the interval from −1 to 1 onto the interval from r to s.

Definition (Lean source)
Q :
r s :
ℝ
pullbackToUnitInterval Q r s :
Q.comp (C ((s - r) / 2) * X + C ((r + s) / 2))
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.pullbackToUnitInterval · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Markov.lean:32
theorem markov_derivative_Icc reviewed
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality

For a real polynomial of degree at most L and endpoints with r strictly less than s, the supremum norm of its derivative on the interval from r to s is at most 2 L² / (s − r) times the supremum norm of the polynomial on that interval.

Formal statement
Q :
r s :
ℝ
hrs :
r < s
L :
ℕ
hQ :
Q.natDegree ≤ L
intervalSupNorm (fun x => Q.derivative.eval x) r s
≤ (2 * (L : ℝ) ^ 2 / (s - r)) * intervalSupNorm (fun x => Q.eval x) r s
Proof (Lean source)
theorem markov_derivative_Icc (Q : Polynomial ℝ) {r s : ℝ} (hrs : r < s) (L : ℕ) (hQ : Q.natDegree ≤ L) : intervalSupNorm (fun x => Q.derivative.eval x) r s ≤ (2 * (L : ℝ) ^ 2 / (s - r)) * intervalSupNorm (fun x => Q.eval x) r s := by let P := pullbackToUnitInterval Q r s have hP : P.natDegree ≤ L := (natDegree_pullbackToUnitInterval_le Q r s).trans hQ have hunit := markov_derivative_unitInterval P L hP have hden : 0 < s - r := sub_pos.mpr hrs have hhalf : 0 < (s - r) / 2 := by positivity rw [intervalSupNorm_le_iff Q.derivative.continuous.continuousOn hrs.le] intro x hx let t : ℝ := (2 * x - (r + s)) / (s - r) have ht : t ∈ Icc (-1 : ℝ) 1 := by constructor · apply (le_div_iff₀ hden).2 linarith [hx.1] · apply (div_le_iff₀ hden).2 linarith [hx.2] have hmap : ((s - r) / 2) * t + (r + s) / 2 = x := by dsimp [t] field_simp [ne_of_gt hden] ring have hpoint := ((intervalSupNorm_le_iff P.derivative.continuous.continuousOn (by norm_num : (-1 : ℝ) ≤ 1)).mp hunit) t ht have hpull : |((s - r) / 2) * Q.derivative.eval x| ≤ (L : ℝ) ^ 2 * intervalSupNorm (fun x => Q.eval x) r s := by simpa [P, derivative_eval_pullbackToUnitInterval, hmap, intervalSupNorm_pullbackToUnitInterval Q hrs] using hpoint have hscaled : ((s - r) / 2) * |Q.derivative.eval x| ≤ (L : ℝ) ^ 2 * intervalSupNorm (fun x => Q.eval x) r s := by simpa [abs_mul, abs_of_pos hhalf] using hpull calc |Q.derivative.eval x| ≤ ((L : ℝ) ^ 2 * intervalSupNorm (fun x => Q.eval x) r s) / ((s - r) / 2) := (le_div_iff₀ hhalf).2 (by simpa [mul_comm] using hscaled) _ = (2 * (L : ℝ) ^ 2 / (s - r)) * intervalSupNorm (fun x => Q.eval x) r s := by field_simp [ne_of_gt hden]
Causalean.Mathlib.Analysis.FinitePolynomialAlternationDuality.markov_derivative_Icc · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Markov.lean:142 · uses intervalSupNorm
5 supporting declarations (lemmas, instances)
Mesh 4 core · 9 supporting A real polynomial of degree ≤ β is uniformly controlled on [-1, 1] by its values on the k+1 Chebyshev–Lobatto nodes x_j = -cos(π j / k) (j = 0..k) as soon as the mesh is oversampled (β < k), with a norming constant of th ★ ehlichZeller_mesh_bound★ oversampled_norming

The Ehlich–Zeller Chebyshev–Lobatto mesh (norming) inequality

A real polynomial of degree ≤ β is uniformly controlled on [-1, 1] by its values on the k+1 Chebyshev–Lobatto nodes x_j = -cos(π j / k) (j = 0..k) as soon as the mesh is oversampled (β < k), with a norming constant of the form sec(π β / (2k)) depending only on the oversampling ratio.

Main declarations:

* czNode k j — the j-th Chebyshev–Lobatto node -cos(π j / k) (for positive k, the endpoints are x_0 = -1 and x_k = 1). * ehlichZeller_mesh_bound — the mesh inequality sup_{x∈[-1,1]} |R x| ≤ sec(π β / (2k)) · max_{0≤j≤k} |R(x_j)| for R.natDegree ≤ β and β < k. * oversampled_norming — the oversampling-ratio corollary: for c > 1, β ≥ 1 and k ≥ c·β, the constant K(c) = sec(π / (2c)) works uniformly in β.

Everything is stated for a general real polynomial R and general (β, k), so the module is reusable (Mathlib-shaped) and not gerrymandered to any downstream object. The analytic heart (Bernstein/Szegő) lives in Causalean.Mathlib.Analysis.Approximation.Chebyshev.Bernstein.

## Standard reference Ehlich, H. & Zeller, K. (1964), Schwankung von Polynomen zwischen Gitterpunkten, Math. Z. 86, 41–44.

def czNode reviewed
Causalean.Mathlib.Analysis.EhlichZellerMesh

For a nonnegative mesh order and a nonnegative node index, the Chebyshev–Lobatto node is −cos⁡(πj/k)-\cos(\pi j/k). When the mesh order is positive, the indices from zero through that order give its endpoints −1-1 and 11 as well as its intermediate nodes.

Definition (Lean source)
k :
ℕ
j :
ℕ
czNode k j :
ℝ
- cos (pi * j / k)
Causalean.Mathlib.Analysis.EhlichZellerMesh.czNode · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:44
def czMeshMax reviewed
Causalean.Mathlib.Analysis.EhlichZellerMesh

For a real polynomial and a nonnegative mesh order, the mesh maximum is the largest absolute value of the polynomial over all Chebyshev–Lobatto nodes with indices from zero through that order.

Definition (Lean source)
R :
k :
ℕ
czMeshMax R k :
ℝ
⨆ j ∈ range (k + 1), |R.eval (czNode k j)|
Causalean.Mathlib.Analysis.EhlichZellerMesh.czMeshMax · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:52
theorem ehlichZeller_mesh_bound reviewed
Causalean.Mathlib.Analysis.EhlichZellerMesh

Ehlich–Zeller mesh inequality. The supremum absolute value on the unit interval of a real polynomial with a chosen degree bound is at most the secant of half the degree-to-mesh angle times its maximum absolute value on the Chebyshev–Lobatto mesh, provided the mesh order strictly exceeds the degree bound.

Formal statement
R :
β k :
ℕ
hβ :
R.natDegree ≤ β
hk :
β < k
sSup ((fun x => |R.eval x|) '' Icc (-1 : ℝ) 1)
≤ (1 / cos (pi * β / (2 * k))) * czMeshMax R k
Proof (Lean source)
theorem ehlichZeller_mesh_bound (R : Polynomial ℝ) (β k : ℕ) (hβ : R.natDegree ≤ β) (hk : β < k) : sSup ((fun x => |R.eval x|) '' Icc (-1 : ℝ) 1) ≤ (1 / cos (pi * β / (2 * k))) * czMeshMax R k := by refine (czMeshLHS_le_czSup R).trans ?_ by_cases hzero : czSup R = 0 · rw [hzero] exact mul_nonneg (one_div_nonneg.mpr (mesh_cos_pos hk).le) (czMeshMax_nonneg R k) · have hM : 0 < czSup R := lt_of_le_of_ne (czSup_nonneg R) (by exact fun h => hzero h.symm) obtain ⟨t₀, ht₀, habs⟩ := czSup_attained R rcases abs_choice (czTrig R t₀) with hpos | hneg · have hmax : czTrig R t₀ = czSup R := by linarith exact ehlichZeller_mesh_bound_of_pos_max R β k hβ hk hM ht₀ hmax · have hmax_neg : czTrig (-R) t₀ = czSup (-R) := by rw [czTrig_neg, czSup_neg] linarith have hβneg : (-R).natDegree ≤ β := by simpa [Polynomial.natDegree_neg] using hβ have hMneg : 0 < czSup (-R) := by simpa [czSup_neg] using hM have hbound := ehlichZeller_mesh_bound_of_pos_max (-R) β k hβneg hk hMneg ht₀ hmax_neg simpa [czSup_neg, czMeshMax_neg] using hbound
Causalean.Mathlib.Analysis.EhlichZellerMesh.ehlichZeller_mesh_bound · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:278 · uses czMeshMax
theorem oversampled_norming reviewed
Causalean.Mathlib.Analysis.EhlichZellerMesh

Oversampled Chebyshev–Lobatto norming. For an oversampling ratio greater than one, a positive degree bound, and a real polynomial satisfying that bound, any mesh order at least the ratio times the degree bound gives a unit-interval sup norm bounded by the mesh maximum times the secant of π divided by twice the ratio. Thus the norming constant depends only on the oversampling ratio.

Formal statement
R :
β k :
ℕ
c :
ℝ
hc :
1 < c
hβ :
1 ≤ β
hβR :
R.natDegree ≤ β
hk :
(c * β) ≤ k
sSup ((fun x => |R.eval x|) '' Icc (-1 : ℝ) 1)
≤ (1 / cos (pi / (2 * c))) * czMeshMax R k
Proof (Lean source)
theorem oversampled_norming (R : Polynomial ℝ) (β k : ℕ) (c : ℝ) (hc : 1 < c) (hβ : 1 ≤ β) (hβR : R.natDegree ≤ β) (hk : (c * β) ≤ k) : sSup ((fun x => |R.eval x|) '' Icc (-1 : ℝ) 1) ≤ (1 / cos (pi / (2 * c))) * czMeshMax R k := by have hβposℝ : 0 < (β : ℝ) := by exact_mod_cast (lt_of_lt_of_le Nat.zero_lt_one hβ) have hβ_lt_cβ : (β : ℝ) < c * β := by nlinarith [hc, hβposℝ] have hβ_lt_kℝ : (β : ℝ) < k := hβ_lt_cβ.trans_le hk have hk' : β < k := by exact_mod_cast hβ_lt_kℝ refine (ehlichZeller_mesh_bound R β k hβR hk').trans ?_ have hk_nat : 0 < k := by omega have hkℝ : 0 < (k : ℝ) := by exact_mod_cast hk_nat have hcpos : 0 < c := lt_trans zero_lt_one hc have hangle_le : pi * β / (2 * k) ≤ pi / (2 * c) := by field_simp [ne_of_gt hkℝ, ne_of_gt hcpos] nlinarith [Real.pi_pos, hk] have hsmall_lt : pi / (2 * c) < pi / 2 := by field_simp [ne_of_gt hcpos] nlinarith [Real.pi_pos, hc] have hsmall_nonneg : 0 ≤ pi / (2 * c) := by positivity have hsmall_le_pi : pi / (2 * c) ≤ pi := by linarith [hsmall_lt, Real.pi_pos] have hangle_nonneg : 0 ≤ pi * β / (2 * k) := by positivity have hcos_order : cos (pi / (2 * c)) ≤ cos (pi * β / (2 * k)) := Real.cos_le_cos_of_nonneg_of_le_pi hangle_nonneg hsmall_le_pi hangle_le have hcos_small_pos : 0 < cos (pi / (2 * c)) := Real.cos_pos_of_mem_Ioo ⟨by linarith [hsmall_nonneg, Real.pi_pos], hsmall_lt⟩ have hcoef : 1 / cos (pi * β / (2 * k)) ≤ 1 / cos (pi / (2 * c)) := one_div_le_one_div_of_le hcos_small_pos hcos_order exact mul_le_mul_of_nonneg_right hcoef (czMeshMax_nonneg R k)
Causalean.Mathlib.Analysis.EhlichZellerMesh.oversampled_norming · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:314 · uses czMeshMax
9 supporting declarations (lemmas, instances)
  • czTrig_at_meshParam theorem — Evaluating the cosine transform of a real polynomial at the parameter determined by a mesh order and node index recovers the polynomial's value at that mesh node.
    R :
    k j :
    ℕ
    czTrig R (pi * j / k) = R.eval (czNode k j)
    Proof (Lean source)
    theorem czTrig_at_meshParam (R : Polynomial ℝ) (k j : ℕ) : czTrig R (pi * j / k) = R.eval (czNode k j) := by simp only [czTrig, czNode]
    Causalean.Mathlib.Analysis.EhlichZellerMesh.czTrig_at_meshParam · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:60
  • exists_meshParam_close theorem — Node-selection lemma. For a positive mesh order and an angle between zero and π, some mesh parameter is within half a mesh step of that angle. The mesh parameters partition the interval into equal subintervals, so every point is within a half-step of a node.
    k :
    ℕ
    hk :
    0 < k
    t₀ :
    ℝ
    ht₀ :
    t₀ ∈ Icc (0 : ℝ) pi
    ∃ j ∈ range (k + 1), |t₀ - pi * j / k| ≤ pi / (2 * k)
    Proof (Lean source)
    theorem exists_meshParam_close (k : ℕ) (hk : 0 < k) {t₀ : ℝ} (ht₀ : t₀ ∈ Icc (0 : ℝ) Real.pi) : ∃ j ∈ range (k + 1), |t₀ - Real.pi * j / k| ≤ Real.pi / (2 * k) := by let x : ℝ := t₀ * k / Real.pi let n : ℤ := round x let j : ℕ := n.toNat have hkℝ : 0 < (k : ℝ) := by exact_mod_cast hk have hπpos : 0 < Real.pi := Real.pi_pos have hπne : Real.pi ≠ 0 := ne_of_gt hπpos have hkne : (k : ℝ) ≠ 0 := ne_of_gt hkℝ have hx_nonneg : 0 ≤ x := by dsimp [x] exact div_nonneg (mul_nonneg ht₀.1 hkℝ.le) hπpos.le have hx_le : x ≤ k := by dsimp [x] calc t₀ * (k : ℝ) / Real.pi ≤ Real.pi * (k : ℝ) / Real.pi := by gcongr exact ht₀.2 _ = k := by field_simp [hπne] have hn_nonneg : (0 : ℤ) ≤ n := by change (0 : ℤ) ≤ round x rw [round_eq] exact (Int.floor_nonneg).2 (by linarith) have hn_le : n ≤ (k : ℤ) := by change round x ≤ (k : ℤ) rw [round_eq, Int.floor_le_iff] change x + 1 / 2 < (k : ℝ) + 1 linarith have hj_le : j ≤ k := by dsimp [j] omega have hj_mem : j ∈ range (k + 1) := by rw [Finset.mem_range] exact Nat.lt_succ_of_le hj_le refine ⟨j, hj_mem, ?_⟩ have hj_cast : (j : ℝ) = (n : ℝ) := by dsimp [j] exact_mod_cast (Int.toNat_of_nonneg hn_nonneg) have hround : |x - (j : ℝ)| ≤ (1 : ℝ) / 2 := by simpa [hj_cast] using (abs_sub_round x) have hscale : t₀ - Real.pi * (j : ℝ) / k = (Real.pi / k) * (x - (j : ℝ)) := by dsimp [x] field_simp [hπne, hkne] calc |t₀ - Real.pi * (j : ℝ) / k| = |Real.pi / k| * |x - (j : ℝ)| := by rw [hscale, abs_mul] _ = (Real.pi / k) * |x - (j : ℝ)| := by rw [abs_of_nonneg (div_nonneg hπpos.le hkℝ.le)] _ ≤ (Real.pi / k) * ((1 : ℝ) / 2) := by exact mul_le_mul_of_nonneg_left hround (div_nonneg hπpos.le hkℝ.le) _ = Real.pi / (2 * k) := by field_simp [hkne]
    Causalean.Mathlib.Analysis.EhlichZellerMesh.exists_meshParam_close · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:66
  • czMeshLHS_le_czSup theorem — Sup transfer. The supremum absolute value of a real polynomial on the unit interval is bounded above by the sup norm of its cosine-parametrized transform on the interval from zero to π. This follows because the negative cosine maps that angle interval onto the unit interval.
    R :
    sSup ((fun x => |R.eval x|) '' Icc (-1 : ℝ) 1) ≤ czSup R
    Proof (Lean source)
    theorem czMeshLHS_le_czSup (R : Polynomial ℝ) : sSup ((fun x => |R.eval x|) '' Icc (-1 : ℝ) 1) ≤ czSup R := by refine Real.sSup_le ?_ (czSup_nonneg R) rintro y ⟨x, hx, rfl⟩ let t := arccos (-x) have ht : t ∈ Icc (0 : ℝ) pi := ⟨Real.arccos_nonneg (-x), Real.arccos_le_pi (-x)⟩ have hcos : -cos t = x := by have hx₁ : -1 ≤ -x := by linarith [hx.2] have hx₂ : -x ≤ 1 := by linarith [hx.1] simp [t, Real.cos_arccos hx₁ hx₂] simpa [czTrig, hcos] using abs_czTrig_le_czSup R ht
    Causalean.Mathlib.Analysis.EhlichZellerMesh.czMeshLHS_le_czSup · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:126
  • eval_node_le_czMeshMax theorem — For a real polynomial and mesh order and any indexed mesh node, the absolute value at that node is at most the mesh maximum.
    R :
    k :
    ℕ
    j :
    ℕ
    hj :
    j ∈ range (k + 1)
    |R.eval (czNode k j)| ≤ czMeshMax R k
    Proof (Lean source)
    theorem eval_node_le_czMeshMax (R : Polynomial ℝ) (k : ℕ) {j : ℕ} (hj : j ∈ range (k + 1)) : |R.eval (czNode k j)| ≤ czMeshMax R k := by let s := range (k + 1) let f : ℕ → ℝ := fun j => |R.eval (czNode k j)| have hsne : s.Nonempty := ⟨0, by simp [s]⟩ let M : ℝ := max 0 (s.sup' hsne f) have hM_nonneg : 0 ≤ M := le_max_left _ _ have hval_le_M {i : ℕ} (hi : i ∈ s) : f i ≤ M := by exact (Finset.le_sup' f hi).trans (le_max_right _ _) have hinner_bound (i : ℕ) : (⨆ (_ : i ∈ s), f i) ≤ M := by exact Real.iSup_le (fun hi => hval_le_M hi) hM_nonneg have houter_bdd : BddAbove (range (fun i => ⨆ (_ : i ∈ s), f i)) := ⟨M, by rintro _ ⟨i, rfl⟩; exact hinner_bound i⟩ have hinner_bdd : BddAbove (range (fun _ : j ∈ s => f j)) := ⟨f j, by rintro _ ⟨hj, rfl⟩; rfl⟩ have hinner : f j ≤ ⨆ (_ : j ∈ s), f j := le_ciSup hinner_bdd hj have houter : f j ≤ ⨆ i, ⨆ (_ : i ∈ s), f i := le_ciSup_of_le houter_bdd j hinner simpa [czMeshMax, s, f] using houter
    Causalean.Mathlib.Analysis.EhlichZellerMesh.eval_node_le_czMeshMax · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:143
  • czMeshMax_nonneg lemma — The mesh maximum for a real polynomial at a chosen mesh order is nonnegative.
    R :
    k :
    ℕ
    0 ≤ czMeshMax R k
    Proof (Lean source)
    lemma czMeshMax_nonneg (R : Polynomial ℝ) (k : ℕ) : 0 ≤ czMeshMax R k := by have hmem : 0 ∈ range (k + 1) := by simp exact (abs_nonneg (R.eval (czNode k 0))).trans (eval_node_le_czMeshMax R k hmem)
    Causalean.Mathlib.Analysis.EhlichZellerMesh.czMeshMax_nonneg · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:166
  • czTrig_neg lemma — Negating a real polynomial at any chosen angle negates the value of its cosine-parametrized transform.
    R :
    t :
    ℝ
    czTrig (-R) t = -czTrig R t
    Proof (Lean source)
    lemma czTrig_neg (R : Polynomial ℝ) (t : ℝ) : czTrig (-R) t = -czTrig R t := by simp [czTrig, Polynomial.eval_neg]
    Causalean.Mathlib.Analysis.EhlichZellerMesh.czTrig_neg · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:173
  • czSup_neg lemma — Negating a real polynomial leaves its cosine-transform sup norm unchanged.
    R :
    czSup (-R) = czSup R
    Proof (Lean source)
    lemma czSup_neg (R : Polynomial ℝ) : czSup (-R) = czSup R := by apply congrArg sSup ext y constructor · rintro ⟨t, ht, rfl⟩ exact ⟨t, ht, by simp [czTrig_neg]⟩ · rintro ⟨t, ht, rfl⟩ exact ⟨t, ht, by simp [czTrig_neg]⟩
    Causalean.Mathlib.Analysis.EhlichZellerMesh.czSup_neg · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:179
  • czMeshMax_neg lemma — Negating a real polynomial leaves its maximum absolute value on a chosen mesh for any mesh order.
    R :
    k :
    ℕ
    czMeshMax (-R) k = czMeshMax R k
    Proof (Lean source)
    lemma czMeshMax_neg (R : Polynomial ℝ) (k : ℕ) : czMeshMax (-R) k = czMeshMax R k := by simp [czMeshMax, Polynomial.eval_neg]
    Causalean.Mathlib.Analysis.EhlichZellerMesh.czMeshMax_neg · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:190
  • meshParam_mem_Icc lemma — At a positive mesh order, every valid node index determines a Chebyshev–Lobatto mesh parameter between zero and π.
    k :
    ℕ
    hk :
    0 < k
    j :
    ℕ
    hj :
    j ∈ range (k + 1)
    pi * j / k ∈ Icc (0 : ℝ) pi
    Proof (Lean source)
    lemma meshParam_mem_Icc (k : ℕ) (hk : 0 < k) {j : ℕ} (hj : j ∈ range (k + 1)) : pi * j / k ∈ Icc (0 : ℝ) pi := by have hkℝ : 0 < (k : ℝ) := by exact_mod_cast hk have hkne : (k : ℝ) ≠ 0 := ne_of_gt hkℝ have hj_le : j ≤ k := le_of_lt_succ (Finset.mem_range.mp hj) constructor · positivity · calc pi * (j : ℝ) / k ≤ pi * (k : ℝ) / k := by gcongr _ = pi := by field_simp [hkne]
    Causalean.Mathlib.Analysis.EhlichZellerMesh.meshParam_mem_Icc · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Mesh.lean:196
Parametric­Heterogeneous­Tensor 2 core · 6 supporting This module constructs a canonical finite polynomial from a jointly measurable, bounded cube target and proves its convolution, coefficient, support, and finite-lift measurability APIs. ★ eval_polynomial

Parametric heterogeneous tensor Jackson polynomials

This module constructs a canonical finite polynomial from a jointly measurable, bounded cube target and proves its convolution, coefficient, support, and finite-lift measurability APIs.

def polynomial reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

A coordinate-specific order map, a parameter-indexed target, and a parameter value determine the canonical heterogeneous Jackson polynomial. The polynomial is the fixed tensor-grid interpolation polynomial built from the values, at the coordinatewise arccosines of the grid points, of the heterogeneous Jackson convolution of the target at that parameter value; it is an explicit formula, not an existentially chosen witness.

Definition (Lean source)
ι :
Type u_1
shared
Ω :
Type u_2
shared
d :
ι → ℕ
g :
Ω → (ι → ℝ) → ℝ
ω :
Ω
polynomial d g ω :
interpolate d (fun b => convolution d (g ω) (fun i => arccos (gridPoint d b i)))
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.polynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricHeterogeneousTensor.lean:24
theorem eval_polynomial reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor

For a coordinate-specific positive order map, a jointly measurable target, a real bound B such that the target is at most B in absolute value on the cube for every parameter, a parameter value, and a point of the cube, evaluating the canonical polynomial at that point gives the heterogeneous Jackson convolution at the phase vector of coordinatewise arccosines of the point.

Formal statement
ι :
Type u_1
shared
Ω :
Type u_2
shared
d :
ι → ℕ
hd :
∀ i, 0 < d i
g :
Ω → (ι → ℝ) → ℝ
hg :
Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)
B :
ℝ
hB :
∀ ω x
if
x ∈ cube
then
|g ω x| ≤ B
ω :
Ω
θ :
ι → ℝ
hθ :
θ ∈ cube
eval θ (polynomial d g ω) = convolution d (g ω) (fun i => arccos (θ i))
Proof (Lean source)
theorem eval_polynomial (d : ι → ℕ) (hd : ∀ i, 0 < d i) (g : Ω → (ι → ℝ) → ℝ) (hg : Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)) (B : ℝ) (hB : ∀ ω x, x ∈ cube → |g ω x| ≤ B) (ω : Ω) (θ : ι → ℝ) (hθ : θ ∈ cube) : eval θ (polynomial d g ω) = convolution d (g ω) (fun i => arccos (θ i)) := by have hcos : cosPoint (fun i => arccos (θ i)) = θ := by funext i exact Real.cos_arccos (hθ i).1 (hθ i).2 calc eval θ (polynomial d g ω) = eval (cosPoint (fun i => arccos (θ i))) (polynomial d g ω) := by rw [hcos] _ = _ := eval_cosPoint_polynomial d hd g hg B hB ω _
Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.eval_polynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricHeterogeneousTensor.lean:84 · uses convolution , cube , polynomial
6 supporting declarations (lemmas, instances)
  • eval_cosPoint_polynomial theorem — For a coordinate-specific positive order map, a jointly measurable target, a real bound B such that the target is at most B in absolute value on the cube for every parameter, a parameter value, and a phase vector, evaluating the canonical polynomial at the coordinatewise cosines of the phase vector gives the heterogeneous Jackson convolution of the target at that parameter and phase.
    ι :
    Type u_1
    shared
    Ω :
    Type u_2
    shared
    d :
    ι → ℕ
    hd :
    ∀ i, 0 < d i
    g :
    Ω → (ι → ℝ) → ℝ
    hg :
    Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)
    B :
    ℝ
    hB :
    ∀ ω x
    if
    x ∈ cube
    then
    |g ω x| ≤ B
    ω :
    Ω
    x :
    ι → ℝ
    eval (cosPoint x) (polynomial d g ω) = convolution d (g ω) x
    Proof (Lean source)
    theorem eval_cosPoint_polynomial (d : ι → ℕ) (hd : ∀ i, 0 < d i) (g : Ω → (ι → ℝ) → ℝ) (hg : Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)) (B : ℝ) (hB : ∀ ω x, x ∈ cube → |g ω x| ≤ B) (ω : Ω) (x : ι → ℝ) : eval (cosPoint x) (polynomial d g ω) = convolution d (g ω) x := by classical have hf : Measurable (g ω) := by exact hg.comp (measurable_const.prodMk measurable_id) obtain ⟨p, hp, hbound⟩ := convolution_exists_polynomial d hd (g ω) hf B (hB ω) have hdegree : ∀ i, p.degreeOf i ≤ interpolationDegree d := by intro i apply MvPolynomial.degreeOf_le_iff.mpr intro γ hγ calc γ i ≤ 2 * (d i - 1) := hbound γ hγ i _ ≤ interpolationDegree d := by simpa only [interpolationDegree] using (Finset.single_le_sum (s := univ) (f := fun j => 2 * (d j - 1)) (fun j hj => zero_le _) (Finset.mem_univ i)) have hgrid (b : GridIndex d) : cosPoint (fun i => arccos (gridPoint d b i)) = gridPoint d b := by funext i have hbi : (b i : ℝ) ≤ interpolationDegree d := by exact_mod_cast le_of_lt_succ (b i).isLt have hlo : -1 ≤ gridPoint d b i := by dsimp [gridPoint, equispacedLagrangeNode] have hn : (0 : ℝ) ≤ (b i : ℝ) / (interpolationDegree d + 1) := by positivity linarith have hhi : gridPoint d b i ≤ 1 := by dsimp [gridPoint, equispacedLagrangeNode] rw [div_le_one (by positivity : (0 : ℝ) < interpolationDegree d + 1)] linarith exact Real.cos_arccos hlo hhi have hpoly : polynomial d g ω = interpolate d (fun b => eval (gridPoint d b) p) := by change interpolate d (fun b => convolution d (g ω) (fun i => arccos (gridPoint d b i))) = _ congr 1 funext b calc convolution d (g ω) (fun i => arccos (gridPoint d b i)) = eval (cosPoint (fun i => arccos (gridPoint d b i))) p := (hp _).symm _ = eval (gridPoint d b) p := by rw [hgrid] rw [hpoly, interpolate_eval d p hdegree, hp]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.eval_cosPoint_polynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricHeterogeneousTensor.lean:31
  • coeff_polynomial theorem — A coordinate-specific order map, a parameter-indexed target, a parameter value, and a tensor coefficient index imply that the canonical coefficient is its explicit finite weighted convolution sum.
    ι :
    Type u_1
    shared
    Ω :
    Type u_2
    shared
    d :
    ι → ℕ
    g :
    Ω → (ι → ℝ) → ℝ
    ω :
    Ω
    a :
    coeff (exponent d a) (polynomial d g ω)
    = ∑ b : GridIndex d, gridWeight d a b * convolution d (g ω) (fun i => arccos (gridPoint d b i))
    Proof (Lean source)
    theorem coeff_polynomial (d : ι → ℕ) (g : Ω → (ι → ℝ) → ℝ) (ω : Ω) (a : GridIndex d) : coeff (exponent d a) (polynomial d g ω) = ∑ b : GridIndex d, gridWeight d a b * convolution d (g ω) (fun i => arccos (gridPoint d b i)) := by exact coeff_interpolate d _ a
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.coeff_polynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricHeterogeneousTensor.lean:105
  • measurable_coeff_polynomial theorem — A coordinate-specific order map, a parameter-indexed target, its joint measurability, and a monomial exponent imply that the corresponding canonical-polynomial coefficient is measurable in the parameter.
    ι :
    Type u_1
    shared
    Ω :
    Type u_2
    shared
    d :
    ι → ℕ
    g :
    Ω → (ι → ℝ) → ℝ
    hg :
    Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)
    γ :
    ι →₀ ℕ
    Measurable (fun ω => coeff γ (polynomial d g ω))
    Proof (Lean source)
    @[fun_prop] theorem measurable_coeff_polynomial (d : ι → ℕ) (g : Ω → (ι → ℝ) → ℝ) (hg : Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)) (γ : ι →₀ ℕ) : Measurable (fun ω => coeff γ (polynomial d g ω)) := by classical simp only [polynomial, interpolate, MvPolynomial.coeff_sum, MvPolynomial.coeff_monomial] apply Finset.measurable_sum intro a _ split_ifs · apply Finset.measurable_sum intro b _ exact measurable_const.mul (measurable_convolution d g hg _) · exact measurable_const
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.measurable_coeff_polynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricHeterogeneousTensor.lean:113
  • support_polynomial theorem — For a coordinate-specific positive order map, a jointly measurable target, a real bound B such that the target is at most B in absolute value on the cube for every parameter, a parameter value, a monomial exponent appearing in the canonical polynomial, and a selected coordinate, the exponent in that coordinate is at most twice (that coordinate's order minus one).
    ι :
    Type u_1
    shared
    Ω :
    Type u_2
    shared
    d :
    ι → ℕ
    hd :
    ∀ i, 0 < d i
    g :
    Ω → (ι → ℝ) → ℝ
    hg :
    Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)
    B :
    ℝ
    hB :
    ∀ ω x
    if
    x ∈ cube
    then
    |g ω x| ≤ B
    ω :
    Ω
    γ :
    ι →₀ ℕ
    hγ :
    γ ∈ (polynomial d g ω).support
    i :
    ι
    γ i ≤ 2 * (d i - 1)
    Proof (Lean source)
    theorem support_polynomial (d : ι → ℕ) (hd : ∀ i, 0 < d i) (g : Ω → (ι → ℝ) → ℝ) (hg : Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)) (B : ℝ) (hB : ∀ ω x, x ∈ cube → |g ω x| ≤ B) (ω : Ω) (γ : ι →₀ ℕ) (hγ : γ ∈ (polynomial d g ω).support) (i : ι) : γ i ≤ 2 * (d i - 1) := by classical have hf : Measurable (g ω) := by exact hg.comp (measurable_const.prodMk measurable_id) obtain ⟨p, hp, hbound⟩ := convolution_exists_polynomial d hd (g ω) hf B (hB ω) have hdegree : ∀ j, p.degreeOf j ≤ interpolationDegree d := by intro j apply MvPolynomial.degreeOf_le_iff.mpr intro δ hδ calc δ j ≤ 2 * (d j - 1) := hbound δ hδ j _ ≤ interpolationDegree d := by simpa only [interpolationDegree] using (Finset.single_le_sum (s := univ) (f := fun k => 2 * (d k - 1)) (fun k hk => zero_le _) (Finset.mem_univ j)) have hgrid (b : GridIndex d) : cosPoint (fun j => arccos (gridPoint d b j)) = gridPoint d b := by funext j have hb : (b j : ℝ) ≤ interpolationDegree d := by exact_mod_cast le_of_lt_succ (b j).isLt have hlo : -1 ≤ gridPoint d b j := by dsimp [gridPoint, equispacedLagrangeNode] have hn : (0 : ℝ) ≤ (b j : ℝ) / (interpolationDegree d + 1) := by positivity linarith have hhi : gridPoint d b j ≤ 1 := by dsimp [gridPoint, equispacedLagrangeNode] rw [div_le_one (by positivity : (0 : ℝ) < interpolationDegree d + 1)] linarith exact Real.cos_arccos hlo hhi have hpoly : polynomial d g ω = interpolate d (fun b => eval (gridPoint d b) p) := by change interpolate d (fun b => convolution d (g ω) (fun j => arccos (gridPoint d b j))) = _ congr 1 funext b calc convolution d (g ω) (fun j => arccos (gridPoint d b j)) = eval (cosPoint (fun j => arccos (gridPoint d b j))) p := (hp _).symm _ = eval (gridPoint d b) p := by rw [hgrid] have heq : polynomial d g ω = p := by apply MvPolynomial.funext intro x rw [hpoly, interpolate_eval d p hdegree] rw [heq] at hγ exact hbound γ hγ i
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.support_polynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricHeterogeneousTensor.lean:130
  • measurable_coeff_sum theorem — A coordinate-specific order map, a parameter-indexed target, its joint measurability, a finite monomial set, parameter-dependent weights, and their measurability on that set imply that the finite weighted canonical-coefficient sum is measurable.
    ι :
    Type u_1
    shared
    Ω :
    Type u_2
    shared
    d :
    ι → ℕ
    g :
    Ω → (ι → ℝ) → ℝ
    hg :
    Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)
    S :
    Finset (ι →₀ ℕ)
    w :
    (ι →₀ ℕ) → Ω → ℝ
    hw :
    ∀ γ ∈ S, Measurable (w γ)
    Measurable (fun ω => ∑ γ ∈ S, coeff γ (polynomial d g ω) * w γ ω)
    Proof (Lean source)
    theorem measurable_coeff_sum (d : ι → ℕ) (g : Ω → (ι → ℝ) → ℝ) (hg : Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)) (S : Finset (ι →₀ ℕ)) (w : (ι →₀ ℕ) → Ω → ℝ) (hw : ∀ γ ∈ S, Measurable (w γ)) : Measurable (fun ω => ∑ γ ∈ S, coeff γ (polynomial d g ω) * w γ ω) := by classical apply Finset.measurable_sum intro γ hγ exact (measurable_coeff_polynomial d g hg γ).mul (hw γ hγ)
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.measurable_coeff_sum · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricHeterogeneousTensor.lean:187
  • measurable_eval_polynomial theorem — A coordinate-specific order map, a parameter-indexed target, its joint measurability, a parameter-dependent evaluation point, and its measurability imply that canonical-polynomial evaluation is measurable in the parameter.
    ι :
    Type u_1
    shared
    Ω :
    Type u_2
    shared
    d :
    ι → ℕ
    g :
    Ω → (ι → ℝ) → ℝ
    hg :
    Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)
    x :
    Ω → ι → ℝ
    hx :
    Measurable (fun ω => eval (x ω) (polynomial d g ω))
    Proof (Lean source)
    @[fun_prop] theorem measurable_eval_polynomial (d : ι → ℕ) (g : Ω → (ι → ℝ) → ℝ) (hg : Measurable (fun z : Ω × (ι → ℝ) => g z.1 z.2)) (x : Ω → ι → ℝ) (hx : Measurable x) : Measurable (fun ω => eval (x ω) (polynomial d g ω)) := by classical simp only [polynomial, interpolate, MvPolynomial.eval_sum, MvPolynomial.eval_monomial] apply Finset.measurable_sum intro a _ have hc : Measurable (fun ω : Ω => ∑ b : GridIndex d, gridWeight d a b * convolution d (g ω) (fun i => arccos (gridPoint d b i))) := by apply Finset.measurable_sum intro b _ exact measurable_const.mul (measurable_convolution d g hg _) have hm : Measurable (fun ω : Ω => (exponent d a).prod fun i n => x ω i ^ n) := by simpa only [MvPolynomial.eval_monomial, one_mul, Function.comp_def] using ((MvPolynomial.continuous_eval (monomial (exponent d a) (1 : ℝ))).measurable.comp hx) exact hc.mul hm
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.HeterogeneousTensor.measurable_eval_polynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/ParametricHeterogeneousTensor.lean:200
Szego 3 core · 5 supporting For a real polynomial R of degree ≤ β the even trigonometric polynomial Q(t) = R(cos t) satisfies the sharp Szegő inequality Q'(t)² + β² Q(t)² ≤ β² ‖Q‖∞², equivalently |Q'(t)| ≤ β · √(‖Q‖∞² − Q(t)²). ★ szegoInterp_isTrigPolyLE★ cosComp_isTrigPolyLE★ szego_deriv_sq_bound

The sharp Bernstein / Szegő differential inequality

For a real polynomial R of degree ≤ β the even trigonometric polynomial Q(t) = R(cos t) satisfies the sharp Szegő inequality

Q'(t)² + β² Q(t)² ≤ β² ‖Q‖∞²,

equivalently |Q'(t)| ≤ β · √(‖Q‖∞² − Q(t)²). The deliverable is

* szego_deriv_sq_bound — with M any sup-bound of Q on the whole period, (d/dt R(cos t))² + β² R(cos t)² ≤ β² M².

The proof is the classical Szegő comparison argument built on the zero-count IsTrigPolyLE.card_zeros_le from TrigPoly. Fix t₀. The degree-β trigonometric interpolant S(t) = Q(t₀)·cos(β(t−t₀)) + (Q'(t₀)/β)·sin(β(t−t₀)) (szegoInterp) matches Q and Q' at t₀ and has amplitude A = √(Q(t₀)² + (Q'(t₀)/β)²). If the inequality failed at t₀, then A > M ≥ ‖Q‖∞, so Q − S (a degree-≤β trig polynomial by IsTrigPolyLE.sub) would change sign at the 2β extrema of S, producing > 2β zeros on a period and contradicting card_zeros_le.

## Standard reference Szegő's inequality; Rivlin, The Chebyshev Polynomials (1974); DeVore–Lorentz, Constructive Approximation (1993), Ch. 4 (Bernstein–Szegő).

theorem szegoInterp_isTrigPolyLE reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

For a degree parameter and a prescribed value, derivative, and base point, the Szegő interpolant is a real trigonometric polynomial of at most that degree.

Formal statement
β :
ℕ
Q₀ Q₁ t₀ :
ℝ
IsTrigPolyLE β (szegoInterp β Q₀ Q₁ t₀)
Proof (Lean source)
theorem szegoInterp_isTrigPolyLE (β : ℕ) (Q₀ Q₁ t₀ : ℝ) : IsTrigPolyLE β (szegoInterp β Q₀ Q₁ t₀) := by let A : ℝ := Q₀ * cos ((β : ℝ) * t₀) - (Q₁ / (β : ℝ)) * sin ((β : ℝ) * t₀) let B : ℝ := Q₀ * sin ((β : ℝ) * t₀) + (Q₁ / (β : ℝ)) * cos ((β : ℝ) * t₀) refine ⟨fun k => if k = β then A else 0, fun k => if k = β then B else 0, ?_⟩ intro t rw [Finset.sum_eq_single β] · simp only [szegoInterp, A, B, ↓reduceIte] have harg : (β : ℝ) * (t - t₀) = (β : ℝ) * t - (β : ℝ) * t₀ := by ring rw [harg, Real.cos_sub, Real.sin_sub] ring · intro k _ hne simp only [hne, ↓reduceIte, zero_mul, zero_add] · intro hnot exact False.elim (hnot (Finset.mem_range.mpr (lt_succ_self β)))
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szegoInterp_isTrigPolyLE · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Szego.lean:48 · uses IsTrigPolyLE , szegoInterp
theorem cosComp_isTrigPolyLE reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

The cosine-parametrized transform of a real polynomial is a real trigonometric polynomial with a chosen degree bound whenever the polynomial satisfies that degree bound.

Formal statement
R :
β :
ℕ
hβ :
R.natDegree ≤ β
IsTrigPolyLE β (fun t => R.eval (cos t))
Proof (Lean source)
theorem cosComp_isTrigPolyLE (R : Polynomial ℝ) (β : ℕ) (hβ : R.natDegree ≤ β) : IsTrigPolyLE β (fun t => R.eval (cos t)) := by classical revert R induction β with | zero => intro R hR obtain ⟨c, rfl⟩ := Polynomial.natDegree_eq_zero.mp (Nat.le_zero.mp hR) simpa using isTrigPolyLE_const 0 c | succ β ih => intro R hRβ by_cases hR : R.natDegree ≤ β · exact (ih R hR).mono (le_succ β) · have hRdeg : R.natDegree = β + 1 := by exact le_antisymm hRβ (succ_le_of_lt (Nat.lt_of_not_ge hR)) let T : Polynomial ℝ := T ℝ (((β + 1 : ℕ) : ℤ)) let P : Polynomial ℝ := T.cancelLeads R have hTdeg : T.natDegree = β + 1 := by dsimp [T] rw [Polynomial.Chebyshev.natDegree_T] apply Nat.cast_injective (R := ℤ) rw [Int.natCast_natAbs] have hnonneg : 0 ≤ ((β : ℤ) + 1) := by omega rw [abs_of_nonneg hnonneg] norm_num have hPdeg : P.natDegree ≤ β := by have hlt : P.natDegree < R.natDegree := by exact Polynomial.natDegree_cancelLeads_lt_of_natDegree_le_natDegree (by simp [hTdeg, hRdeg]) (by simp [hRdeg]) omega have hPtrig : IsTrigPolyLE (β + 1) (fun t => P.eval (cos t)) := (ih P hPdeg).mono (le_succ β) have hcostrig : IsTrigPolyLE (β + 1) (fun t => R.leadingCoeff * cos (((β + 1 : ℕ) : ℝ) * t)) := IsTrigPolyLE.const_mul R.leadingCoeff (cos_nat_mul_isTrigPolyLE (β + 1)) have hsum : IsTrigPolyLE (β + 1) (fun t => P.eval (cos t) + R.leadingCoeff * cos (((β + 1 : ℕ) : ℝ) * t)) := hPtrig.add hcostrig have hTlc_ne : T.leadingCoeff ≠ 0 := by simp [T] have hscaled : IsTrigPolyLE (β + 1) (fun t => (T.leadingCoeff)⁻¹ * (P.eval (cos t) + R.leadingCoeff * cos (((β + 1 : ℕ) : ℝ) * t))) := IsTrigPolyLE.const_mul (T.leadingCoeff)⁻¹ hsum refine hscaled.congr ?_ intro t have hTeval : T.eval (cos t) = cos (((β + 1 : ℕ) : ℝ) * t) := by simp [T] have hPeval : P.eval (cos t) = T.leadingCoeff * R.eval (cos t) - R.leadingCoeff * T.eval (cos t) := by simp [P, Polynomial.cancelLeads, hTdeg, hRdeg] rw [hPeval, hTeval] field_simp [hTlc_ne] ring
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.cosComp_isTrigPolyLE · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Szego.lean:126 · uses IsTrigPolyLE
theorem szego_deriv_sq_bound reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

The sharp Bernstein/Szegő differential inequality. If a real polynomial satisfies a chosen degree bound and its cosine-parametrized transform is uniformly bounded in absolute value by a real constant, then at every real angle, the squared derivative plus the degree squared times the squared transform value is at most the degree squared times the squared uniform bound.

Formal statement
R :
β :
ℕ
hβ :
R.natDegree ≤ β
M :
ℝ
hM :
∀ t, |R.eval (cos t)| ≤ M
t :
(deriv (fun s => R.eval (cos s)) t) ^ 2 + (β : ℝ) ^ 2 * (R.eval (cos t)) ^ 2
≤ (β : ℝ) ^ 2 * M ^ 2
Proof (Lean source)
theorem szego_deriv_sq_bound (R : Polynomial ℝ) (β : ℕ) (hβ : R.natDegree ≤ β) (M : ℝ) (hM : ∀ t, |R.eval (cos t)| ≤ M) : ∀ t, (deriv (fun s => R.eval (cos s)) t) ^ 2 + (β : ℝ) ^ 2 * (R.eval (cos t)) ^ 2 ≤ (β : ℝ) ^ 2 * M ^ 2 := by intro t₀ by_cases hβ0 : β = 0 · subst β obtain ⟨c, hRc⟩ := Polynomial.natDegree_eq_zero.mp (Nat.le_zero.mp hβ) subst R have hderiv0 : deriv (fun s => eval (cos s) (C c)) t₀ = 0 := by rw [deriv_cosComp] simp rw [hderiv0] simp · have hβ1 : 1 ≤ β := succ_le_of_lt (Nat.pos_of_ne_zero hβ0) let Q : ℝ → ℝ := fun t => R.eval (cos t) let Q₀ : ℝ := Q t₀ let Q₁ : ℝ := deriv Q t₀ let A : ℝ := sqrt (Q₀ ^ 2 + (Q₁ / (β : ℝ)) ^ 2) have hM_nonneg : 0 ≤ M := by exact (abs_nonneg (Q t₀)).trans (hM t₀) have hβR_ne : (β : ℝ) ≠ 0 := by exact_mod_cast hβ0 have hA_nonneg : 0 ≤ A := Real.sqrt_nonneg _ have hrad_nonneg : 0 ≤ Q₀ ^ 2 + (Q₁ / (β : ℝ)) ^ 2 := by nlinarith [sq_nonneg Q₀, sq_nonneg (Q₁ / (β : ℝ))] have hamp_sq : A ^ 2 = Q₀ ^ 2 + (Q₁ / (β : ℝ)) ^ 2 := by dsimp [A] rw [Real.sq_sqrt hrad_nonneg] have hAmpBound : A ^ 2 ≤ M ^ 2 := by by_contra hnot have hgt : M ^ 2 < A ^ 2 := lt_of_not_ge hnot have hA_gt_M : M < A := by nlinarith [sq_lt_sq.mp hgt, hA_nonneg, hM_nonneg] let Sfun : ℝ → ℝ := szegoInterp β Q₀ Q₁ t₀ let g : ℝ → ℝ := fun t => Q t - Sfun t have hg_trig : IsTrigPolyLE β g := by exact (cosComp_isTrigPolyLE R β hβ).sub (szegoInterp_isTrigPolyLE β Q₀ Q₁ t₀) have hg_t₀ : g t₀ = 0 := by dsimp [g, Sfun, Q₀, Q] rw [szegoInterp_self] ring have hQ_hasDeriv : HasDerivAt Q Q₁ t₀ := by dsimp [Q₁, Q] simpa [deriv_cosComp] using (hasDerivAt_cosComp R t₀) have hS_hasDeriv : HasDerivAt Sfun Q₁ t₀ := by dsimp [Sfun] exact szegoInterp_hasDerivAt β hβ1 Q₀ Q₁ t₀ have hg_deriv : HasDerivAt g 0 t₀ := by have h := hQ_hasDeriv.fun_sub hS_hasDeriv rw [sub_self] at h exact h have hg_nonzero : ∃ t, g t ≠ 0 := by obtain ⟨φ, hφ⟩ := szegoInterp_amplitude β Q₀ Q₁ t₀ let u : ℝ := t₀ + φ / (β : ℝ) refine ⟨u, ?_⟩ have hS_u : Sfun u = A := by dsimp [Sfun] rw [hφ u] have harg : (β : ℝ) * (u - t₀) - φ = 0 := by dsimp [u] field_simp [hβR_ne] ring rw [harg, Real.cos_zero, mul_one] have hQ_le : |Q u| ≤ M := hM u intro hg0 have hQu_eq : Q u = A := by have := congrArg (fun x => x + Sfun u) hg0 simpa [g, hS_u] using this have : A ≤ M := by rw [← hQu_eq] exact le_trans (le_abs_self _) hQ_le linarith -- The remaining classical Szegő step: the interpolant `Sfun` has amplitude -- `A` (`szegoInterp_amplitude`, phase `φ`), attaining `±A` at the extrema -- `u_k = t₀ + (φ + kπ)/β`, where `Sfun (u_k) = A·(-1)^k`. Since `A > M ≥ |Q|` -- the continuous degree-≤`β` trig polynomial `g = Q − Sfun` has strictly -- alternating sign `g(u_k)·(-1)^k < 0` at the `2β + 1` consecutive extrema -- `u_m, …, u_{m+2β}` (with `m` the integer such that `t₀ ∈ (u_m, u_{m+1})`), -- so by the IVT it has a zero in each of the `2β` open gaps `(u_j, u_{j+1})`. -- Dropping the first gap (the only one containing the double zero `t₀`) -- leaves `2β − 1` distinct zeros counted once and all `≠ t₀`, packaged as a -- finset `S ⊆ [u_m, u_m + 2π)` with `card = 2β − 1`. Applying the generalized -- multiplicity count `IsTrigPolyLE.card_simple_add_double_le` (period -- `[c, c+2π)`, `c = u_m`; `hg_trig`, `hg_nonzero`, `hg_t₀`, `hg_deriv`) gives -- `(2β − 1) + 2 ≤ 2β`, whence `omega` derives the contradiction. have hcount : (2 * β - 1) + 2 ≤ 2 * β := by classical obtain ⟨φ, hφ⟩ := szegoInterp_amplitude β Q₀ Q₁ t₀ have hβR_pos : 0 < (β : ℝ) := by exact_mod_cast hβ1 let u : ℤ → ℝ := fun k => t₀ + φ / (β : ℝ) + (k : ℝ) * (pi / (β : ℝ)) let m : ℤ := ⌊(-φ) / Real.pi⌋ have hu_mono : StrictMono u := by simpa [u] using szegoExtrema_strictMono hβR_pos t₀ φ have hgap_pos : ∀ k : ℤ, u k < u (k + 1) := fun k => hu_mono (by omega) have hS_ext : ∀ k : ℤ, Sfun (u k) = A * ((-1 : ℝ) ^ k) := by intro k dsimp [Sfun] rw [hφ (u k)] rw [szegoExtrema_arg hβR_ne t₀ φ k] rw [Real.cos_int_mul_pi] have hg_cont : Continuous g := by have hQ_cont : Continuous Q := by dsimp [Q] fun_prop have hS_cont : Continuous Sfun := by dsimp [Sfun] exact szegoInterp_continuous β Q₀ Q₁ t₀ dsimp [g] exact hQ_cont.sub hS_cont have hsign : ∀ k : ℤ, g (u k) * ((-1 : ℝ) ^ k) < 0 := by intro k let s : ℝ := (-1 : ℝ) ^ k have hs_abs : |s| = 1 := by simp [s] have hs_sq : s * s = 1 := by have hs_sq_abs : |s| ^ 2 = 1 := by rw [hs_abs] norm_num rw [sq_abs] at hs_sq_abs nlinarith [hs_sq_abs] have hQs_le : Q (u k) * s ≤ M := by calc Q (u k) * s ≤ |Q (u k) * s| := le_abs_self _ _ = |Q (u k)| * |s| := by rw [abs_mul] _ = |Q (u k)| := by rw [hs_abs, mul_one] _ ≤ M := hM (u k) have hS := hS_ext k calc g (u k) * s = (Q (u k) - A * s) * s := by dsimp [g] rw [hS] _ = Q (u k) * s - A := by rw [show (Q (u k) - A * s) * s = Q (u k) * s - A * (s * s) by ring] rw [hs_sq, mul_one] _ < 0 := by linarith have hzero_exists : ∀ k : ℤ, ∃ x, x ∈ Ioo (u k) (u (k + 1)) ∧ g x = 0 := by intro k let s : ℝ := (-1 : ℝ) ^ k let F : ℝ → ℝ := fun x => g x * s have hs_ne : s ≠ 0 := by have hs_abs : |s| = 1 := by simp [s] intro hs0 rw [hs0, abs_zero] at hs_abs norm_num at hs_abs have hleft : F (u k) < 0 := by simpa [F, s] using hsign k have hright : 0 < F (u (k + 1)) := by have hnext := hsign (k + 1) have hs_next : ((-1 : ℝ) ^ (k + 1) : ℝ) = -s := by rw [zpow_add₀] · norm_num [s] · norm_num rw [hs_next] at hnext dsimp [F] nlinarith have hF_cont : ContinuousOn F (Icc (u k) (u (k + 1))) := by exact (hg_cont.mul continuous_const).continuousOn have hzero_mem : (0 : ℝ) ∈ Ioo (F (u k)) (F (u (k + 1))) := ⟨hleft, hright⟩ rcases intermediate_value_Ioo (le_of_lt (hgap_pos k)) hF_cont hzero_mem with ⟨x, hx, hFx⟩ refine ⟨x, hx, ?_⟩ have hgxs : g x * s = 0 := by simpa [F] using hFx exact (mul_eq_zero.mp hgxs).resolve_right hs_ne let v : ℤ → ℝ := fun k => choose (hzero_exists k) have hv_mem : ∀ k : ℤ, v k ∈ Ioo (u k) (u (k + 1)) := by intro k exact (Classical.choose_spec (hzero_exists k)).1 have hv_zero : ∀ k : ℤ, g (v k) = 0 := by intro k exact (Classical.choose_spec (hzero_exists k)).2 have hv_mono : StrictMono v := by intro k l hkl have hk1le : k + 1 ≤ l := by omega exact (lt_of_lt_of_le (hv_mem k).2 (hu_mono.monotone hk1le)).trans (hv_mem l).1 let N : ℕ := 2 * β - 1 let w : Fin N → ℝ := fun j => v (m + 1 + (j : ℤ)) let S : Finset ℝ := (Finset.univ : Finset (Fin N)).image w have hS_zero : ∀ x ∈ S, g x = 0 := by intro x hx rcases Finset.mem_image.mp hx with ⟨j, _hj, hjx⟩ rw [← hjx] dsimp [w] exact hv_zero (m + 1 + (j : ℤ)) have hS_sub : ↑S ⊆ Ico (u m) (u m + 2 * pi) := by intro x hx rcases Finset.mem_image.mp hx with ⟨j, _hj, hjx⟩ rw [← hjx] dsimp [w] constructor · have hm_lt : m < m + 1 + (j : ℤ) := by omega exact ((hu_mono hm_lt).trans (hv_mem (m + 1 + (j : ℤ))).1).le · have hidx : m + 1 + (j : ℤ) + 1 ≤ m + (2 * β : ℤ) := by have hjlt : (j : ℕ) < N := j.isLt dsimp [N] at hjlt omega have hu_le : u (m + 1 + (j : ℤ) + 1) ≤ u (m + (2 * β : ℤ)) := hu_mono.monotone hidx have hper : u (m + (2 * β : ℤ)) = u m + 2 * pi := by simpa [u] using szegoExtrema_period hβR_ne t₀ φ m exact (hv_mem (m + 1 + (j : ℤ))).2.trans_le (hu_le.trans (le_of_eq hper)) have ht₀_gap : t₀ ∈ Ico (u m) (u (m + 1)) := by simpa [u, m] using szegoExtrema_floor_mem hβR_pos t₀ φ have ht₀_mem : t₀ ∈ Ico (u m) (u m + 2 * pi) := by constructor · exact ht₀_gap.1 · have hidx : m + 1 < m + (2 * β : ℤ) := by omega have hper : u (m + (2 * β : ℤ)) = u m + 2 * pi := by simpa [u] using szegoExtrema_period hβR_ne t₀ φ m exact ht₀_gap.2.trans (by simpa [hper] using hu_mono hidx) have ht₀_not_mem : t₀ ∉ S := by intro ht₀S rcases Finset.mem_image.mp ht₀S with ⟨j, _hj, hj⟩ have hidx : m + 1 ≤ m + 1 + (j : ℤ) := by omega have hut : u (m + 1) ≤ u (m + 1 + (j : ℤ)) := hu_mono.monotone hidx have ht_lt : t₀ < w j := by dsimp [w] exact ht₀_gap.2.trans_le (hut.trans (le_of_lt (hv_mem (m + 1 + (j : ℤ))).1)) -- … truncated; follow the source link for the rest …
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szego_deriv_sq_bound · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Szego.lean:250
5 supporting declarations (lemmas, instances)
  • add theorem — The pointwise sum of two real trigonometric polynomials with a common degree bound is a real trigonometric polynomial with the same degree bound.
    n :
    ℕ
    f g :
    ℝ → ℝ
    hf :
    IsTrigPolyLE n f
    hg :
    IsTrigPolyLE n g
    IsTrigPolyLE n (fun t => f t + g t)
    Proof (Lean source)
    theorem IsTrigPolyLE.add {n : ℕ} {f g : ℝ → ℝ} (hf : IsTrigPolyLE n f) (hg : IsTrigPolyLE n g) : IsTrigPolyLE n (fun t => f t + g t) := by rcases hf with ⟨a, b, ha⟩ rcases hg with ⟨c, d, hg⟩ refine ⟨fun k => a k + c k, fun k => b k + d k, ?_⟩ intro t change f t + g t = ∑ k ∈ range (n + 1), ((a k + c k) * cos ((k : ℝ) * t) + (b k + d k) * sin ((k : ℝ) * t)) rw [ha t, hg t, ← Finset.sum_add_distrib] refine Finset.sum_congr rfl ?_ intro k hk ring
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE.add · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Szego.lean:73
  • const_mul theorem — Multiplying a real trigonometric polynomial with a chosen degree bound by a real scalar preserves that degree bound.
    n :
    ℕ
    f :
    ℝ → ℝ
    c :
    ℝ
    hf :
    IsTrigPolyLE n f
    IsTrigPolyLE n (fun t => c * f t)
    Proof (Lean source)
    theorem IsTrigPolyLE.const_mul {n : ℕ} {f : ℝ → ℝ} (c : ℝ) (hf : IsTrigPolyLE n f) : IsTrigPolyLE n (fun t => c * f t) := by rcases hf with ⟨a, b, ha⟩ refine ⟨fun k => c * a k, fun k => c * b k, ?_⟩ intro t change c * f t = ∑ k ∈ range (n + 1), (c * a k * cos ((k : ℝ) * t) + c * b k * sin ((k : ℝ) * t)) rw [ha t, Finset.mul_sum] refine Finset.sum_congr rfl ?_ intro k hk ring
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE.const_mul · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Szego.lean:89
  • congr theorem — A real-valued function pointwise equal to a real trigonometric polynomial with a chosen degree bound is itself a trigonometric polynomial with that bound.
    n :
    ℕ
    f g :
    ℝ → ℝ
    hf :
    IsTrigPolyLE n f
    hfg :
    ∀ t, g t = f t
    IsTrigPolyLE n g
    Proof (Lean source)
    theorem IsTrigPolyLE.congr {n : ℕ} {f g : ℝ → ℝ} (hf : IsTrigPolyLE n f) (hfg : ∀ t, g t = f t) : IsTrigPolyLE n g := by rcases hf with ⟨a, b, ha⟩ exact ⟨a, b, fun t => by rw [hfg t, ha t]⟩
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE.congr · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Szego.lean:104
  • cos_nat_mul_isTrigPolyLE theorem — The cosine wave at a nonnegative integer frequency is a real trigonometric polynomial whose degree is at most that frequency.
    n :
    ℕ
    IsTrigPolyLE n (fun t => cos ((n : ℝ) * t))
    Proof (Lean source)
    theorem cos_nat_mul_isTrigPolyLE (n : ℕ) : IsTrigPolyLE n (fun t => cos ((n : ℝ) * t)) := by classical refine ⟨fun k => if k = n then 1 else 0, fun _ => 0, ?_⟩ intro t rw [Finset.sum_eq_single n] · simp · intro k hk hkn simp [hkn] · intro hn exact (hn (Finset.mem_range.mpr (lt_succ_self n))).elim
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.cos_nat_mul_isTrigPolyLE · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Szego.lean:112
  • szegoInterp_continuous theorem — The Szegő interpolant determined by a frequency, prescribed value and derivative, and base point is continuous as a function of its argument.
    β :
    ℕ
    Q₀ Q₁ t₀ :
    ℝ
    Continuous (szegoInterp β Q₀ Q₁ t₀)
    Proof (Lean source)
    @[fun_prop] theorem szegoInterp_continuous (β : ℕ) (Q₀ Q₁ t₀ : ℝ) : Continuous (szegoInterp β Q₀ Q₁ t₀) := by unfold szegoInterp fun_prop
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szegoInterp_continuous · Causalean/Mathlib/Analysis/Approximation/Chebyshev/Szego.lean:193
Tensor­Chebyshev 4 core · 7 supporting Tensor products of first-kind Chebyshev polynomials in four variables: the basis, the polynomial with prescribed tensor coefficients, and the integral coefficient functional against the normalized product cosine kernel. ★ tensorChebyshev_coeff_recovery

Four-variable tensor Chebyshev polynomials

Tensor products of first-kind Chebyshev polynomials in four variables: the basis, the polynomial with prescribed tensor coefficients, and the integral coefficient functional against the normalized product cosine kernel. The file proves one-variable cosine orthogonality and finite spanning, recovery of the tensor coefficients of a coordinatewise degree-bounded polynomial, the factorization of monomial coefficients of a basis polynomial, and the resulting coefficient one-norm bound.

def tensorChebyshevBasis reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A degree bound and tensor index determine the corresponding four-variable tensor Chebyshev basis polynomial: the product, over the four variables, of the first-kind Chebyshev polynomial in that variable whose degree is the index's entry for that variable.

Definition (Lean source)
D :
ℕ
k :
Fin 4 → Fin (D + 1)
tensorChebyshevBasis D k :
∏ i : Fin 4, (T ℝ ((k i : ℕ) : ℤ)).toMvPolynomial i
Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorChebyshevBasis · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorChebyshev.lean:30
def tensorChebyshevPolynomial reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A degree bound and tensor coefficient vector determine their tensor Chebyshev polynomial: the sum, over all tensor indices, of the vector's entry times the corresponding tensor Chebyshev basis polynomial.

Definition (Lean source)
D :
ℕ
c :
(Fin 4 → Fin (D + 1)) → ℝ
tensorChebyshevPolynomial D c :
∑ k, C (c k) * tensorChebyshevBasis D k
Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorChebyshevPolynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorChebyshev.lean:39
def tensorChebyshevCoefficient reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A degree bound, multivariate polynomial, and tensor index determine the matching product-cosine integral coefficient: the integral, over the box of four angles each between −π and π, of the polynomial evaluated at the cosines of the angles times the product over coordinates of the cosine of the index entry times the angle, multiplied by a normalizing factor of 1/(2π) for each zero index entry and 1/π for each nonzero one.

Definition (Lean source)
D :
ℕ
p :
k :
Fin 4 → Fin (D + 1)
tensorChebyshevCoefficient D p k :
ℝ
(∏ i : Fin 4, if (k i : ℕ) = 0 then (1 / (2 * pi) : ℝ) else 1 / pi) * ∫ u in periodBox 4, (∏ i : Fin 4, cos ((k i : ℕ) * u i)) * eval (fun i => cos (u i)) p
Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorChebyshevCoefficient · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorChebyshev.lean:47
theorem tensorChebyshev_coeff_recovery reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

Every four-variable polynomial of coordinatewise degree at most D equals the tensor Chebyshev expansion of its explicit product-cosine integral coefficients.

Formal statement
D :
ℕ
p :
hdeg :
∀ i, p.degreeOf i ≤ D
Proof (Lean source)
theorem tensorChebyshev_coeff_recovery (D : ℕ) (p : MvPolynomial (Fin 4) ℝ) (hdeg : ∀ i, p.degreeOf i ≤ D) : p = tensorChebyshevPolynomial D (tensorChebyshevCoefficient D p) := by classical obtain ⟨c, hc⟩ := tensorChebyshevBasis_finite_span D p hdeg have hcompact : IsCompact (periodBox 4) := by change IsCompact {u : Fin 4 → ℝ | ∀ i, u i ∈ Icc (-pi) pi} exact isCompact_pi_infinite fun _ => isCompact_Icc have hlin (k : Fin 4 → Fin (D + 1)) : tensorChebyshevCoefficient D (tensorChebyshevPolynomial D c) k = ∑ m, c m * tensorChebyshevCoefficient D (tensorChebyshevBasis D m) k := by have hint (m : Fin 4 → Fin (D + 1)) : IntegrableOn (fun u : Fin 4 → ℝ => (∏ i : Fin 4, cos ((k i : ℕ) * u i)) * (c m * eval (fun i => cos (u i)) (tensorChebyshevBasis D m))) (periodBox 4) := by have hcos : Continuous (fun u : Fin 4 → ℝ => fun i => cos (u i)) := by fun_prop have hcont : Continuous (fun u : Fin 4 → ℝ => (∏ i : Fin 4, cos ((k i : ℕ) * u i)) * (c m * eval (fun i => cos (u i)) (tensorChebyshevBasis D m))) := by have heval := ((tensorChebyshevBasis D m).continuous_eval).comp hcos fun_prop (disch := assumption) exact hcont.continuousOn.integrableOn_compact hcompact unfold tensorChebyshevCoefficient tensorChebyshevPolynomial simp only [MvPolynomial.eval_sum, MvPolynomial.eval_mul, MvPolynomial.eval_C, Finset.mul_sum] rw [integral_finsetSum univ (fun m _ => hint m)] simp_rw [show ∀ (m : Fin 4 → Fin (D + 1)) (u : Fin 4 → ℝ), (∏ i : Fin 4, cos ((k i : ℕ) * u i)) * (c m * eval (fun i => cos (u i)) (tensorChebyshevBasis D m)) = c m * ((∏ i : Fin 4, cos ((k i : ℕ) * u i)) * eval (fun i => cos (u i)) (tensorChebyshevBasis D m)) from fun m u => by ring] simp_rw [integral_const_mul] rw [Finset.mul_sum] congr 1 ext m ring have hcoeff : tensorChebyshevCoefficient D p = c := by funext k rw [hc, hlin] simp [tensorChebyshevCoefficient_basis] simpa [hcoeff] using hc
Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorChebyshev_coeff_recovery · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorChebyshev.lean:259 · uses tensorChebyshevCoefficient , tensorChebyshevPolynomial
7 supporting declarations (lemmas, instances)
  • chebyshev_one_variable_cosine_orthogonality theorem — Normalized cosine integration on the full period recovers the coefficient of a single one-variable Chebyshev basis polynomial. The zero frequency has normalization 1/(2π), and every positive frequency has normalization 1/π.
    k m :
    ℕ
    (if k = 0 then (1 / (2 * pi) : ℝ) else 1 / pi) * (∫ u in Icc (-pi) pi, cos (k * u) * eval (cos u) (T ℝ (m : ℤ)))
    = if k = m then 1 else 0
    Proof (Lean source)
    theorem chebyshev_one_variable_cosine_orthogonality (k m : ℕ) : (if k = 0 then (1 / (2 * pi) : ℝ) else 1 / pi) * (∫ u in Icc (-pi) pi, cos (k * u) * eval (cos u) (T ℝ (m : ℤ))) = if k = m then 1 else 0 := by let f : ℝ → ℝ := fun u => cos (k * u) * eval (cos u) (T ℝ (m : ℤ)) have hf : Continuous f := by fun_prop have heven (u : ℝ) : f (-u) = f u := by simp [f, mul_neg, Real.cos_neg] have hleft : (∫ u in -Real.pi..0, f u) = ∫ u in 0..pi, f u := by simpa only [neg_zero, neg_neg] using (intervalIntegral.integral_comp_neg (f := f) (a := 0) (b := pi)).symm.trans (intervalIntegral.integral_congr (fun u hu => heven u)) have hfull : (∫ u in Icc (-pi) pi, f u) = 2 * ∫ u in 0..pi, f u := by rw [MeasureTheory.integral_Icc_eq_integral_Ioc, ← intervalIntegral.integral_of_le (by linarith [Real.pi_pos])] rw [← intervalIntegral.integral_add_adjacent_intervals (hf.intervalIntegrable _ _) (hf.intervalIntegrable _ _), hleft] ring have hmeasure : (∫ u in 0..pi, f u) = ∫ x, (T ℝ (k : ℤ)).eval x * (T ℝ (m : ℤ)).eval x ∂Polynomial.Chebyshev.measureT := by rw [Polynomial.Chebyshev.integral_measureT_eq_integral_cos] apply intervalIntegral.integral_congr intro u hu simp only [f, Polynomial.Chebyshev.T_real_cos] congr 1 change (if k = 0 then (1 / (2 * pi) : ℝ) else 1 / pi) * (∫ u in Icc (-pi) pi, f u) = if k = m then 1 else 0 rw [hfull, hmeasure] by_cases hkm : k = m · subst m by_cases hk : k = 0 · subst k simp only [Nat.cast_zero] rw [Polynomial.Chebyshev.integral_eval_T_real_mul_self_measureT_zero] simp only [if_true] field_simp · rw [Polynomial.Chebyshev.integral_T_real_mul_self_measureT_of_ne_zero hk] simp only [if_neg hk] field_simp simp · simp [hkm, Polynomial.Chebyshev.integral_eval_T_real_mul_eval_T_real_measureT_of_ne hkm]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.chebyshev_one_variable_cosine_orthogonality · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorChebyshev.lean:60
  • chebyshev_one_variable_finite_span theorem — A real polynomial of degree at most D is a finite linear combination of the first D+1 first-kind Chebyshev polynomials, with constant real coefficients.
    D :
    ℕ
    p :
    hdeg :
    p.natDegree ≤ D
    ∃ c : Fin (D + 1) → ℝ,
    p = ∑ k : Fin (D + 1), C (c k) * T ℝ ((k : ℕ) : ℤ)
    Proof (Lean source)
    theorem chebyshev_one_variable_finite_span (D : ℕ) (p : Polynomial ℝ) (hdeg : p.natDegree ≤ D) : ∃ c : Fin (D + 1) → ℝ, p = ∑ k : Fin (D + 1), C (c k) * T ℝ ((k : ℕ) : ℤ) := by let S := Polynomial.Chebyshev.chebyshevTsequence ℝ have hcoeff : ∀ i < D + 1, IsUnit (S i).leadingCoeff := by intro i hi change IsUnit (T ℝ (i : ℤ)).leadingCoeff rw [Polynomial.Chebyshev.leadingCoeff_T] exact isUnit_iff_ne_zero.mpr (pow_ne_zero _ (by norm_num)) have hp : p ∈ span ℝ (S '' Iio (D + 1)) := by rw [S.span_degreeLT hcoeff, Polynomial.mem_degreeLT] by_cases hp0 : p = 0 · simp [hp0] · exact (Polynomial.natDegree_lt_iff_degree_lt hp0).mp (Nat.lt_succ_of_le hdeg) obtain ⟨c, hc⟩ := (Fintype.mem_span_image_iff_exists_fun ℝ).mp hp let e : Fin (D + 1) ≃ (Iio (D + 1) : Set ℕ) := (Fin.orderIsoSubtype).toEquiv refine ⟨fun k => c (e k), ?_⟩ rw [← hc] have he (k : Fin (D + 1)) : (e k).1 = k.1 := rfl simpa only [he, S, Polynomial.Chebyshev.chebyshevTsequence, Polynomial.smul_eq_C_mul] using (Fintype.sum_equiv e (fun k : Fin (D + 1) => c (e k) • S (e k).1) (fun i => c i • S i.1) (fun k => rfl)).symm
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.chebyshev_one_variable_finite_span · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorChebyshev.lean:116
  • tensorChebyshevCoefficient_basis theorem — Integrating a four-coordinate tensor Chebyshev basis against the normalized product cosine kernel yields one at the matching multi-index and zero at every other index.
    D :
    ℕ
    k m :
    Fin 4 → Fin (D + 1)
    tensorChebyshevCoefficient D (tensorChebyshevBasis D m) k = if k = m then 1 else 0
    Proof (Lean source)
    theorem tensorChebyshevCoefficient_basis (D : ℕ) (k m : Fin 4 → Fin (D + 1)) : tensorChebyshevCoefficient D (tensorChebyshevBasis D m) k = if k = m then 1 else 0 := by have heval (u : Fin 4 → ℝ) : eval (fun i => cos (u i)) (tensorChebyshevBasis D m) = ∏ i : Fin 4, eval (cos (u i)) (T ℝ ((m i : ℕ) : ℤ)) := by simp [tensorChebyshevBasis, MvPolynomial.eval_toMvPolynomial] unfold tensorChebyshevCoefficient simp_rw [heval, ← Finset.prod_mul_distrib] rw [integral_periodBox_prod (fun (i : Fin 4) (u : ℝ) => cos ((k i : ℕ) * u) * eval (cos u) (T ℝ ((m i : ℕ) : ℤ))), ← Finset.prod_mul_distrib] simp_rw [chebyshev_one_variable_cosine_orthogonality] by_cases hkm : k = m · subst m simp · have hi : ∃ i : Fin 4, k i ≠ m i := by by_contra h apply hkm funext i exact of_not_not (not_exists.mp h i) obtain ⟨i, hi⟩ := hi rw [if_neg hkm] apply Finset.prod_eq_zero (Finset.mem_univ i) simp [Fin.val_ne_of_ne hi]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorChebyshevCoefficient_basis · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorChebyshev.lean:148
  • tensorChebyshevBasis_monomial_span theorem — Each bounded-degree tensor monomial is a finite real linear combination of the tensor Chebyshev basis polynomials with indices at most D in every coordinate.
    D :
    ℕ
    a :
    Fin 4 → Fin (D + 1)
    ∃ c : (Fin 4 → Fin (D + 1)) → ℝ,
    Proof (Lean source)
    theorem tensorChebyshevBasis_monomial_span (D : ℕ) (a : Fin 4 → Fin (D + 1)) : ∃ c : (Fin 4 → Fin (D + 1)) → ℝ, monomial (tensorExponent a) (1 : ℝ) = tensorChebyshevPolynomial D c := by classical have hdeg (i : Fin 4) : (X ^ (a i : ℕ) : Polynomial ℝ).natDegree ≤ D := by simpa only [Polynomial.natDegree_X_pow] using (Nat.lt_succ_iff.mp (a i).isLt) choose c hc using fun i => chebyshev_one_variable_finite_span D (X ^ (a i : ℕ)) (hdeg i) refine ⟨fun k => ∏ i, c i (k i), ?_⟩ have hexp : (∑ i : Fin 4, Finsupp.single i (a i : ℕ)) = tensorExponent a := by ext i simp [tensorExponent, Finsupp.single_apply] have hmon : monomial (tensorExponent a) (1 : ℝ) = ∏ i : Fin 4, (X ^ (a i : ℕ) : Polynomial ℝ).toMvPolynomial i := by calc _ = monomial (∑ i : Fin 4, Finsupp.single i (a i : ℕ)) (∏ _i : Fin 4, (1 : ℝ)) := by simp [hexp] _ = ∏ i : Fin 4, monomial (Finsupp.single i (a i : ℕ)) (1 : ℝ) := by rw [MvPolynomial.monomial_sum_prod] _ = _ := by simp [MvPolynomial.X_pow_eq_monomial] rw [hmon] have hcoord (i : Fin 4) : (X ^ (a i : ℕ) : Polynomial ℝ).toMvPolynomial i = ∑ j : Fin (D + 1), C (c i j) * (T ℝ ((j : ℕ) : ℤ)).toMvPolynomial i := by have h := congrArg (fun p : Polynomial ℝ => p.toMvPolynomial i) (hc i) simpa only [map_sum, map_mul, Polynomial.toMvPolynomial_C] using h simp_rw [hcoord] rw [Fintype.prod_sum] simp only [Finset.prod_mul_distrib, ← map_prod] rfl
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorChebyshevBasis_monomial_span · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorChebyshev.lean:183
  • tensorChebyshevBasis_finite_span theorem — Every four-variable polynomial of coordinatewise degree at most D lies in the span of the tensor Chebyshev basis indexed by (Fin (D+1))^4.
    D :
    ℕ
    p :
    hdeg :
    ∀ i, p.degreeOf i ≤ D
    ∃ c : (Fin 4 → Fin (D + 1)) → ℝ, p = tensorChebyshevPolynomial D c
    Proof (Lean source)
    theorem tensorChebyshevBasis_finite_span (D : ℕ) (p : MvPolynomial (Fin 4) ℝ) (hdeg : ∀ i, p.degreeOf i ≤ D) : ∃ c : (Fin 4 → Fin (D + 1)) → ℝ, p = tensorChebyshevPolynomial D c := by classical choose c hc using fun a : Fin 4 → Fin (D + 1) => tensorChebyshevBasis_monomial_span D a refine ⟨fun k => ∑ a, tensorCoeffs (D := D) p a * c a k, ?_⟩ have hscale (a : Fin 4 → Fin (D + 1)) : monomial (tensorExponent a) (tensorCoeffs (D := D) p a) = C (tensorCoeffs (D := D) p a) * tensorChebyshevPolynomial D (c a) := by rw [← hc a] rw [MvPolynomial.C_mul_monomial] simp calc p = tensorPolynomial (tensorCoeffs (D := D) p) := (tensorPolynomial_tensorCoeffs p hdeg).symm _ = tensorChebyshevPolynomial D (fun k => ∑ a, tensorCoeffs (D := D) p a * c a k) := by unfold tensorPolynomial tensorChebyshevPolynomial simp_rw [hscale] simp only [tensorChebyshevPolynomial, Finset.mul_sum, ← mul_assoc, ← map_mul] rw [Finset.sum_comm] simp only [← Finset.sum_mul, ← map_sum]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorChebyshevBasis_finite_span · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorChebyshev.lean:225
  • tensorChebyshevBasis_coeff_factorization theorem — Each fixed monomial coefficient of a four-variable tensor Chebyshev basis polynomial is the product of the corresponding one-variable Chebyshev coefficients.
    D :
    ℕ
    k a :
    Fin 4 → Fin (D + 1)
    = ∏ i : Fin 4, (T ℝ ((k i : ℕ) : ℤ)).coeff (a i : ℕ)
    Proof (Lean source)
    theorem tensorChebyshevBasis_coeff_factorization (D : ℕ) (k a : Fin 4 → Fin (D + 1)) : tensorCoeffs (D := D) (tensorChebyshevBasis D k) a = ∏ i : Fin 4, (T ℝ ((k i : ℕ) : ℤ)).coeff (a i : ℕ) := by classical let p : Fin 4 → Polynomial ℝ := fun i => T ℝ ((k i : ℕ) : ℤ) have hpdeg (i : Fin 4) : (p i).natDegree < D + 1 := by simp only [p, Polynomial.Chebyshev.natDegree_T, Int.natAbs_natCast] exact (k i).isLt have hto (i : Fin 4) : (p i).toMvPolynomial i = ∑ j : Fin (D + 1), C ((p i).coeff (j : ℕ)) * X i ^ (j : ℕ) := by have h := Polynomial.as_sum_range_C_mul_X_pow' (p i) (hpdeg i) have h' := congrArg (fun q : Polynomial ℝ => q.toMvPolynomial i) h simpa only [map_sum, map_mul, map_pow, Polynomial.toMvPolynomial_C, Polynomial.toMvPolynomial_X, ← Fin.sum_univ_eq_sum_range] using h' have hexp (b : Fin 4 → Fin (D + 1)) : (∑ i : Fin 4, Finsupp.single i (b i : ℕ)) = tensorExponent b := by ext i simp [tensorExponent, Finsupp.single_apply] have hmon (b : Fin 4 → Fin (D + 1)) : (∏ i : Fin 4, C ((p i).coeff (b i : ℕ)) * X i ^ (b i : ℕ)) = monomial (tensorExponent b) (∏ i : Fin 4, (p i).coeff (b i : ℕ)) := by calc _ = ∏ i : Fin 4, monomial (Finsupp.single i (b i : ℕ)) ((p i).coeff (b i : ℕ)) := by apply Finset.prod_congr rfl intro i hi simp [MvPolynomial.X_pow_eq_monomial, MvPolynomial.C_mul_monomial] _ = monomial (∑ i : Fin 4, Finsupp.single i (b i : ℕ)) (∏ i : Fin 4, (p i).coeff (b i : ℕ)) := by rw [MvPolynomial.monomial_sum_prod] _ = _ := by rw [hexp] have hinj : Injective (tensorExponent (d := 4) (D := D)) := by intro b c h funext i apply Fin.ext have hi := congrArg (fun m : Fin 4 →₀ ℕ => m i) h simpa [tensorExponent] using hi change (∏ i : Fin 4, (p i).toMvPolynomial i).coeff (tensorExponent a) = ∏ i : Fin 4, (p i).coeff (a i : ℕ) simp_rw [hto] rw [Fintype.prod_sum] simp_rw [hmon] simp only [MvPolynomial.coeff_sum] rw [Finset.sum_eq_single a] · simp · intro b hb hba have hne : tensorExponent b ≠ tensorExponent a := fun h => hba (hinj h) simp [MvPolynomial.coeff_monomial, hne] · intro ha exact (ha (Finset.mem_univ a)).elim
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorChebyshevBasis_coeff_factorization · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorChebyshev.lean:315
  • tensorChebyshevBasis_coeff_oneNorm_le theorem — The sum of the absolute monomial coefficients of one four-variable tensor Chebyshev basis polynomial is at most (1+√2)^(4D) for every index bounded by D.
    D :
    ℕ
    k :
    Fin 4 → Fin (D + 1)
    (∑ a : Fin 4 → Fin (D + 1), |tensorCoeffs (D := D) (tensorChebyshevBasis D k) a|)
    ≤ (1 + sqrt 2) ^ (4 * D)
    Proof (Lean source)
    theorem tensorChebyshevBasis_coeff_oneNorm_le (D : ℕ) (k : Fin 4 → Fin (D + 1)) : (∑ a : Fin 4 → Fin (D + 1), |tensorCoeffs (D := D) (tensorChebyshevBasis D k) a|) ≤ (1 + sqrt 2) ^ (4 * D) := by classical let r : ℝ := 1 + sqrt 2 have hr : 1 ≤ r := by dsimp [r]; linarith [Real.sqrt_nonneg 2] have hsum (i : Fin 4) : (∑ j : Fin (D + 1), |(T ℝ ((k i : ℕ) : ℤ)).coeff (j : ℕ)|) ≤ r ^ D := by let p := T ℝ ((k i : ℕ) : ℤ) have hdeg : p.natDegree < D + 1 := by simp only [p, Polynomial.Chebyshev.natDegree_T, Int.natAbs_natCast] exact (k i).isLt have heq : (∑ j : Fin (D + 1), |p.coeff (j : ℕ)|) = polynomialCoeffOneNorm p := by change _ = p.sum (fun _ c => |c|) rw [p.sum_over_range' (fun _ => abs_zero) (D + 1) hdeg] simp only [← Fin.sum_univ_eq_sum_range] calc _ = polynomialCoeffOneNorm p := heq _ ≤ r ^ (k i : ℕ) := polynomialCoeffOneNorm_chebyshev_le _ _ ≤ r ^ D := pow_le_pow_right₀ hr (le_of_lt_succ (k i).isLt) calc (∑ a : Fin 4 → Fin (D + 1), |tensorCoeffs (D := D) (tensorChebyshevBasis D k) a|) = ∑ a : Fin 4 → Fin (D + 1), ∏ i : Fin 4, |(T ℝ ((k i : ℕ) : ℤ)).coeff (a i : ℕ)| := by simp_rw [tensorChebyshevBasis_coeff_factorization, Finset.abs_prod] _ = ∏ i : Fin 4, ∑ j : Fin (D + 1), |(T ℝ ((k i : ℕ) : ℤ)).coeff (j : ℕ)| := by rw [Fintype.prod_sum] _ ≤ ∏ _i : Fin 4, r ^ D := by apply Finset.prod_le_prod · intro i hi positivity · intro i hi exact hsum i _ = r ^ (4 * D) := by simp only [Finset.prod_const, Finset.card_univ, Fintype.card_fin] rw [← pow_mul, Nat.mul_comm]
    Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorChebyshevBasis_coeff_oneNorm_le · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorChebyshev.lean:382
Tensor­Extraction 1 core · 1 supporting This module proves the periodic translation and coordinatewise trigonometric structure of tensor Jackson convolution, extracts a multivariate algebraic polynomial, and derives its Lipschitz approximation error. ★ tensorConvolution_approx_lipschitz

Coordinatewise extraction of tensor Jackson convolutions

This module proves the periodic translation and coordinatewise trigonometric structure of tensor Jackson convolution, extracts a multivariate algebraic polynomial, and derives its Lipschitz approximation error.

theorem tensorConvolution_approx_lipschitz reviewed
Causalean.Mathlib.Analysis.JacksonApproximation

For a strictly positive integer order K, a function of d variables, a nonnegative Lipschitz constant L, continuity on the normalized cube, the bound that the function changes between any two points of the cube by at most L times the sum of their absolute coordinate differences, and a point in period coordinates, tensor Jackson convolution approximates the cosine lift there within thirty-two times dimension times the Lipschitz constant divided by K.

Formal statement
d K :
ℕ
hK :
0 < K
f :
(Fin d → ℝ) → ℝ
L :
ℝ
hL :
0 ≤ L
hlip :
∀ x ∈ normalizedCube d, ∀ y ∈ normalizedCube d, |f x - f y| ≤ L * ∑ i, |x i - y i|
x :
Fin d → ℝ
|tensorConvolution K f x - f (cosPoint x)| ≤ 32 * (d : ℝ) * L / (K : ℝ)
Proof (Lean source)
theorem tensorConvolution_approx_lipschitz {d K : ℕ} (hK : 0 < K) (f : (Fin d → ℝ) → ℝ) (L : ℝ) (hL : 0 ≤ L) (hf : ContinuousOn f (normalizedCube d)) (hlip : ∀ x ∈ normalizedCube d, ∀ y ∈ normalizedCube d, |f x - f y| ≤ L * ∑ i, |x i - y i|) (x : Fin d → ℝ) : |tensorConvolution K f x - f (cosPoint x)| ≤ 32 * (d : ℝ) * L / (K : ℝ) := by classical have hcompact : IsCompact (periodBox d) := by rw [show periodBox d = {u | ∀ i, u i ∈ Icc (-pi) pi} by rfl] exact isCompact_pi_infinite fun _ ↦ isCompact_Icc have hcos : Continuous (fun u : Fin d → ℝ ↦ cosPoint (x - u)) := by apply continuous_pi intro i change Continuous (fun u : Fin d → ℝ ↦ cos (x i - u i)) fun_prop have hfcos : Continuous (fun u : Fin d → ℝ ↦ f (cosPoint (x - u))) := by simpa [Function.comp_def] using hf.comp_continuous hcos (fun u ↦ cosPoint_mem_normalizedCube (x - u)) have hkernel : Continuous (tensorJackson K d) := by unfold tensorJackson fun_prop have hconvInt : IntegrableOn (fun u : Fin d → ℝ ↦ f (cosPoint (x - u)) * tensorJackson K d u) (periodBox d) := (hfcos.mul hkernel).continuousOn.integrableOn_compact hcompact have hconstInt : IntegrableOn (fun u : Fin d → ℝ ↦ f (cosPoint x) * tensorJackson K d u) (periodBox d) := (continuous_const.mul hkernel).continuousOn.integrableOn_compact hcompact have hdiffInt : IntegrableOn (fun u : Fin d → ℝ ↦ (f (cosPoint (x - u)) - f (cosPoint x)) * tensorJackson K d u) (periodBox d) := ((hfcos.sub continuous_const).mul hkernel).continuousOn.integrableOn_compact hcompact have hmomentInt (i : Fin d) : IntegrableOn (fun u : Fin d → ℝ ↦ |u i| * tensorJackson K d u) (periodBox d) := by exact ((continuous_abs.comp (continuous_apply i)).mul hkernel).continuousOn |>.integrableOn_compact hcompact have hboundInt : IntegrableOn (fun u : Fin d → ℝ ↦ L * ∑ i, |u i| * tensorJackson K d u) (periodBox d) := by exact (continuous_const.mul (continuous_finsetSum _ fun i _ ↦ (continuous_abs.comp (continuous_apply i)).mul hkernel)).continuousOn |>.integrableOn_compact hcompact have hdiff : tensorConvolution K f x - f (cosPoint x) = ∫ u in periodBox d, (f (cosPoint (x - u)) - f (cosPoint x)) * tensorJackson K d u := by unfold tensorConvolution calc (∫ u in periodBox d, f (cosPoint (x - u)) * tensorJackson K d u) - f (cosPoint x) = (∫ u in periodBox d, f (cosPoint (x - u)) * tensorJackson K d u) - f (cosPoint x) * (∫ u in periodBox d, tensorJackson K d u) := by rw [tensorJackson_integral_eq_one hK, mul_one] _ = (∫ u in periodBox d, f (cosPoint (x - u)) * tensorJackson K d u) - ∫ u in periodBox d, f (cosPoint x) * tensorJackson K d u := by rw [integral_const_mul] _ = ∫ u in periodBox d, (f (cosPoint (x - u)) * tensorJackson K d u - f (cosPoint x) * tensorJackson K d u) := (integral_sub hconvInt hconstInt).symm _ = ∫ u in periodBox d, (f (cosPoint (x - u)) - f (cosPoint x)) * tensorJackson K d u := by apply integral_congr_ae filter_upwards intro u ring rw [hdiff] calc |∫ u in periodBox d, (f (cosPoint (x - u)) - f (cosPoint x)) * tensorJackson K d u| ≤ ∫ u in periodBox d, |(f (cosPoint (x - u)) - f (cosPoint x)) * tensorJackson K d u| := abs_integral_le_integral_abs _ ≤ ∫ u in periodBox d, L * ∑ i, |u i| * tensorJackson K d u := by apply setIntegral_mono hdiffInt.abs hboundInt intro u change |(f (cosPoint (x - u)) - f (cosPoint x)) * tensorJackson K d u| ≤ L * ∑ i, |u i| * tensorJackson K d u rw [abs_mul, abs_of_nonneg (tensorJackson_nonneg hK u)] calc |f (cosPoint (x - u)) - f (cosPoint x)| * tensorJackson K d u ≤ (L * ∑ i, |u i|) * tensorJackson K d u := by apply mul_le_mul_of_nonneg_right _ (tensorJackson_nonneg hK u) refine (hlip _ (cosPoint_mem_normalizedCube _) _ (cosPoint_mem_normalizedCube _)).trans ?_ apply mul_le_mul_of_nonneg_left _ hL apply Finset.sum_le_sum intro i _ simpa [cosPoint] using Real.abs_cos_sub_cos_le ((x - u) i) (x i) _ = L * ∑ i, |u i| * tensorJackson K d u := by rw [mul_assoc, Finset.sum_mul] _ = L * ∑ i, ∫ u in periodBox d, |u i| * tensorJackson K d u := by rw [integral_const_mul] rw [integral_finsetSum univ (fun i _ ↦ hmomentInt i)] _ ≤ L * ∑ _i : Fin d, 32 / (K : ℝ) := by apply mul_le_mul_of_nonneg_left _ hL apply Finset.sum_le_sum intro i _ rw [tensorJackson_first_moment_eq hK i] exact jackson_first_moment K hK _ = 32 * (d : ℝ) * L / (K : ℝ) := by simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] ring
Causalean.Mathlib.Analysis.JacksonApproximation.tensorConvolution_approx_lipschitz · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorExtraction.lean:627 · uses cosPoint , normalizedCube , tensorConvolution
1 supporting declaration (lemmas, instances)
  • tensorConvolution_exists_mvPolynomial theorem — For a strictly positive integer order K and a function of d variables that is continuous on the normalized cube, there is a multivariate polynomial that reproduces the tensor Jackson convolution at the coordinatewise cosines of every point, has degree at most 2 (K − 1) in each variable, and has total degree at most d times 2 (K − 1).
    d K :
    ℕ
    hK :
    0 < K
    f :
    (Fin d → ℝ) → ℝ
    ∃ p : MvPolynomial (Fin d) ℝ,
    conclusion 1
    x :
    Fin d → ℝ
    eval (cosPoint x) p = tensorConvolution K f x
    conclusion 2
    m ∈ p.support :
    i :
    m i ≤ 2 * (K - 1)
    conclusion 3
    p.totalDegree ≤ d * (2 * (K - 1))
    Proof (Lean source)
    theorem tensorConvolution_exists_mvPolynomial {d K : ℕ} (hK : 0 < K) (f : (Fin d → ℝ) → ℝ) (hf : ContinuousOn f (normalizedCube d)) : ∃ p : MvPolynomial (Fin d) ℝ, (∀ x : Fin d → ℝ, eval (cosPoint x) p = tensorConvolution K f x) ∧ (∀ m ∈ p.support, ∀ i, m i ≤ 2 * (K - 1)) ∧ p.totalDegree ≤ d * (2 * (K - 1)) := by apply exists_mvPolynomial_of_coord_even_trig (q := tensorConvolution K f) · exact fun i x => tensorConvolution_coord_trig hK f hf x i · intro i x t have h := tensorConvolution_coord_even (K := K) f hf (update x i t) i simpa [update] using h
    Causalean.Mathlib.Analysis.JacksonApproximation.tensorConvolution_exists_mvPolynomial · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorExtraction.lean:610
Tensor­Grid­Weights 3 core · 2 supporting The tensor product of the equispaced one-variable Lagrange formulas recovers every coefficient of a bounded coordinatewise degree polynomial from values at one fixed grid. ★ tensorGrid_coeff_recovery

Fixed tensor interpolation grid

The tensor product of the equispaced one-variable Lagrange formulas recovers every coefficient of a bounded coordinatewise degree polynomial from values at one fixed grid. The total absolute weight is controlled by the corresponding one-variable bound.

def tensorGridPoint reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A tensor-grid index determines the corresponding point in the unit cube, whose coordinate in each direction is the index's entry there divided by D + 1.

Definition (Lean source)
d D :
ℕ
b :
Fin d → Fin (D + 1)
tensorGridPoint b :
Fin d → ℝ
fun i => equispacedLagrangeNode D (b i)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorGridPoint · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorGridWeights.lean:22
def tensorGridWeight reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A target coefficient index and a tensor-grid index determine the corresponding tensor interpolation weight: the product, over coordinates, of the one-variable equispaced Lagrange coefficient-recovery weights for the two indices' entries in that coordinate.

Definition (Lean source)
d D :
ℕ
a b :
Fin d → Fin (D + 1)
tensorGridWeight a b :
ℝ
∏ i : Fin d, equispacedLagrangeWeight D (a i) (b i)
Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorGridWeight · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorGridWeights.lean:29
theorem tensorGrid_coeff_recovery reviewed
Causalean.Mathlib.Analysis.Approximation.Chebyshev

A multivariate polynomial, a coordinatewise degree bound, and a monomial index give an exact recovery of that coefficient from fixed tensor-grid evaluations.

Formal statement
d D :
ℕ
p :
hdeg :
∀ i, p.degreeOf i ≤ D
a :
Fin d → Fin (D + 1)
tensorCoeffs (D := D) p a
= ∑ b : Fin d → Fin (D + 1), tensorGridWeight a b * eval (tensorGridPoint b) p
Proof (Lean source)
theorem tensorGrid_coeff_recovery {d D : ℕ} (p : MvPolynomial (Fin d) ℝ) (hdeg : ∀ i, p.degreeOf i ≤ D) (a : Fin d → Fin (D + 1)) : tensorCoeffs (D := D) p a = ∑ b : Fin d → Fin (D + 1), tensorGridWeight a b * eval (tensorGridPoint b) p := by classical have hone (k m : Fin (D + 1)) : (∑ j : Fin (D + 1), equispacedLagrangeWeight D k j * equispacedLagrangeNode D j ^ (m : ℕ)) = if k = m then 1 else 0 := by have hm : (X ^ (m : ℕ) : Polynomial ℝ).natDegree ≤ D := by simpa using le_of_lt_succ m.isLt have h := equispacedLagrange_coeff_recovery D (X ^ (m : ℕ) : Polynomial ℝ) hm k simpa only [Polynomial.coeff_X_pow, Polynomial.eval_pow, Polynomial.eval_X, Fin.ext_iff] using h.symm have hmonomial (c : Fin d → Fin (D + 1)) : (∑ b : Fin d → Fin (D + 1), tensorGridWeight a b * eval (tensorGridPoint b) (monomial (tensorExponent c) (1 : ℝ))) = if a = c then 1 else 0 := by simp_rw [MvPolynomial.eval_monomial, one_mul, Finsupp.prod_pow, tensorGridWeight] have hpow (b : Fin d → Fin (D + 1)) : (∏ i : Fin d, tensorGridPoint b i ^ tensorExponent c i) = ∏ i : Fin d, equispacedLagrangeNode D (b i) ^ (c i : ℕ) := by apply Finset.prod_congr rfl intro i _ rfl simp_rw [hpow, ← Finset.prod_mul_distrib] rw [← Fintype.prod_sum (fun i : Fin d => fun j : Fin (D + 1) => equispacedLagrangeWeight D (a i) j * equispacedLagrangeNode D j ^ (c i : ℕ))] simp_rw [hone] by_cases h : a = c · subst c simp · have hi : ∃ i : Fin d, a i ≠ c i := by by_contra hn push Not at hn exact h (funext hn) obtain ⟨i, hi⟩ := hi simp only [if_neg h] apply Finset.prod_eq_zero (Finset.mem_univ i) simp [hi] simp only [MvPolynomial.eval_monomial, one_mul] at hmonomial conv_rhs => rw [← tensorPolynomial_tensorCoeffs p hdeg] simp only [tensorPolynomial, MvPolynomial.eval_sum] simp_rw [Finset.mul_sum] rw [Finset.sum_comm] simp_rw [MvPolynomial.eval_monomial] have hswap (c : Fin d → Fin (D + 1)) : (∑ b : Fin d → Fin (D + 1), tensorGridWeight a b * (tensorCoeffs p c * (tensorExponent c).prod fun n e => tensorGridPoint b n ^ e)) = tensorCoeffs p c * (if a = c then 1 else 0) := by rw [← hmonomial c, Finset.mul_sum] apply Finset.sum_congr rfl intro b _ ring simp_rw [hswap] simp
Causalean.Mathlib.Analysis.Approximation.Chebyshev.tensorGrid_coeff_recovery · Causalean/Mathlib/Analysis/Approximation/Chebyshev/TensorGridWeights.lean:50 · uses tensorCoeffs , tensorGridPoint , tensorGridWeight
2 supporting declarations (lemmas, instances)