Mathlib.Analysis.Bernstein­Szego­Trig

Trigonometric-polynomial infrastructure for Bernstein-Szegő comparisons: degree bounds, zero counting, cosine composition, and Szegő interpolation.

Interp 5 core · 1 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_self★ 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_selfS(t₀) = Q₀.
  • szegoInterp_hasDerivAtS'(t₀) = Q₁ (for β ≥ 1).
  • szegoInterp_amplitudeS(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

The Szegő comparison interpolant at base point t₀ matching prescribed value Q₀ and derivative Q₁: S(t) = Q₀ · cos(β(t − t₀)) + (Q₁/β) · sin(β(t − t₀)). For β ≥ 1 it satisfies S(t₀) = Q₀, S'(t₀) = Q₁, and is a trigonometric wave with constant amplitude √(Q₀² + (Q₁/β)²). The degree-≤ β trigonometric-polynomial statement is proved later as szegoInterp_isTrigPolyLE in Szego.

Definition (Lean source)
noncomputable def szegoInterp (β : ℕ) (Q₀ Q₁ t₀ : ℝ) (t : ℝ) : ℝ := Q₀ * cos ((β : ℝ) * (t - t₀)) + (Q₁ / (β : ℝ)) * sin ((β : ℝ) * (t - t₀))
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szegoInterp · Causalean/Mathlib/Analysis/BernsteinSzegoTrig/Interp.lean:40
theorem szegoInterp_self reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

For a degree parameter β and [values Q₀, Q₁ and base point t₀] (hyp:Q₀,Q₁,t₀), the Szegő interpolant reproduces its prescribed value at the base point: S(t₀) = Q₀.

Formal statement
β :
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/BernsteinSzegoTrig/Interp.lean:50 · uses szegoInterp
theorem szegoInterp_hasDerivAt reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

The Szegő comparison interpolant S built at base point t₀ from a prescribed value Q₀ and derivative Q₁ reproduces the prescribed derivative there: provided the degree parameter β is at least 1, the derivative of S at t₀ equals Q₁.

Formal statement
β :
:
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/BernsteinSzegoTrig/Interp.lean:57 · uses szegoInterp
theorem szegoInterp_amplitude reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

For a degree parameter β and [values Q₀, Q₁ and base point t₀] (hyp:Q₀,Q₁,t₀), the Szegő interpolant is an elementary cosine wave of amplitude A = √(Q₀² + (Q₁/β)²): there is a phase φ with S(t) = A · cos(β(t − t₀) − φ) for every t.

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/BernsteinSzegoTrig/Interp.lean:129 · 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/BernsteinSzegoTrig/Interp.lean:140 · uses szegoInterp
1 supporting declaration (lemmas, instances)
  • szegoInterp_amplitude_core theorem — A cosine-sine wave is an elementary wave of amplitude A = √(Q₀² + q²): for every real frequency ω, there is a phase φ with Q₀ cos(ω(t − t₀)) + q sin(ω(t − t₀)) = A cos(ω(t − t₀) − φ) for all t.
    ω :
    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/BernsteinSzegoTrig/Interp.lean:95
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

IsTrigPolyLE n f means f is a real trigonometric polynomial of degree at most n, i.e. there are coefficient sequences a b : ℕ → ℝ with f t = ∑_{k=0}^{n} (a k · cos (k t) + b k · sin (k t)) for all t.

Definition (Lean source)
def 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/BernsteinSzegoTrig/TrigPoly.lean:45
theorem card_zeros_le reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE

Zero-count lemma for real trigonometric polynomials (the load-bearing input to Szegő's inequality; not in Mathlib). If f is a real trigonometric polynomial of degree at most n that is not identically zero, then, for a finite set S of zeros of f contained in a half-open period [c, c + 2π), the cardinality of S is at most 2 n.

Formal statement
n :
f :
ℝ → ℝ
hf :
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/BernsteinSzegoTrig/TrigPoly.lean:243 · uses IsTrigPolyLE
theorem card_simple_add_double_le reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.IsTrigPolyLE

Multiplicity-refined zero-count lemma for real trigonometric polynomials (the sharp input to Szegő's inequality; not in Mathlib). Suppose f is a real trigonometric polynomial of degree at most n that is not identically zero, S is a finite set of zeros of f lying in the half-open period [c, c + 2π), and there is a further point t₀ in that same period and not belonging to S that is itself a zero of f at which the derivative of f also vanishes, i.e. t₀ is a zero of order at least 2. Then the cardinality of S, plus 2 for the double zero at t₀, is at most 2 n.

Formal statement
n :
f :
ℝ → ℝ
hf :
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/BernsteinSzegoTrig/TrigPoly.lean:294 · uses IsTrigPolyLE
4 supporting declarations (lemmas, instances)
  • isTrigPolyLE_const theorem — Constant functions are trigonometric polynomials of degree ≤ n (they use only the k = 0 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/BernsteinSzegoTrig/TrigPoly.lean:53
  • mono theorem — A degree-≤n trig polynomial is also a degree-≤m trig polynomial when n ≤ m (pad the higher coefficients with zeros).
    n m :
    f :
    ℝ → ℝ
    hf :
    hnm :
    n ≤ m
    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/BernsteinSzegoTrig/TrigPoly.lean:60
  • sub theorem — The difference of two degree-≤n trig polynomials is a degree-≤n trig polynomial (subtract the coefficient sequences termwise).
    n :
    f g :
    ℝ → ℝ
    hf :
    hg :
    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/BernsteinSzegoTrig/TrigPoly.lean:90
  • exp_mul_I_injOn_Ico lemma — On any half-open real interval spanning one full period, the complex exponential evaluated at an imaginary real input is injective.
    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/BernsteinSzegoTrig/TrigPoly.lean:214
Basic 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.BernsteinSzegoTrig.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/BernsteinSzegoTrig/Basic.lean:35
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/BernsteinSzegoTrig/Basic.lean:48
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 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 [values Q₀, Q₁ and base point t₀] (hyp:Q₀,Q₁,t₀), the Szegő interpolant is a real trigonometric polynomial of degree at most β.

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 elim (hnot (Finset.mem_range.mpr (Nat.lt_succ_self β)))
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szegoInterp_isTrigPolyLE · Causalean/Mathlib/Analysis/BernsteinSzegoTrig/Szego.lean:44 · uses IsTrigPolyLE , szegoInterp
theorem cosComp_isTrigPolyLE reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

For a real polynomial R, if its degree is at most β, then the even trigonometric transform t ↦ R(cos t) is a real trigonometric polynomial of degree at most β.

Formal statement
R :
β :
:
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 (Nat.le_succ β) · have hRdeg : R.natDegree = β + 1 := by exact le_antisymm hRβ (Nat.succ_le_of_lt (Nat.lt_of_not_ge hR)) let T : Polynomial ℝ := Polynomial.Chebyshev.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 (Nat.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/BernsteinSzegoTrig/Szego.lean:121 · uses IsTrigPolyLE
theorem szego_deriv_sq_bound reviewed
Causalean.Mathlib.Analysis.BernsteinSzegoTrig

The sharp Bernstein/Szegő differential inequality (the deliverable; not available in Mathlib). For a real polynomial R, if its degree is at most β and the even trigonometric transform t ↦ R(cos t) is bounded in absolute value by M at every t, then at every t the squared derivative of that transform plus β² times its squared value is at most β² · M², equivalently |d/dt R(cos t)| ≤ β · √(M² − R(cos t)²).

Formal statement
R :
β :
:
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) (Polynomial.C c)) t₀ = 0 := by rw [deriv_cosComp] simp rw [hderiv0] simp · have hβ1 : 1 ≤ β := Nat.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 -- … truncated; follow the source link for the rest …
Causalean.Mathlib.Analysis.BernsteinSzegoTrig.szego_deriv_sq_bound · Causalean/Mathlib/Analysis/BernsteinSzegoTrig/Szego.lean:243
5 supporting declarations (lemmas, instances)
  • add theorem — The sum of two real trigonometric polynomials of degree at most n is again a real trigonometric polynomial of degree at most n.
    n :
    f g :
    ℝ → ℝ
    hf :
    hg :
    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/BernsteinSzegoTrig/Szego.lean:69
  • const_mul theorem — Multiplying a real trigonometric polynomial of degree at most n by a scalar preserves the degree bound.
    n :
    f :
    ℝ → ℝ
    c :
    hf :
    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/BernsteinSzegoTrig/Szego.lean:85
  • congr theorem — A function pointwise equal to a real trigonometric polynomial of degree at most n is itself a real trigonometric polynomial of degree at most n.
    n :
    f g :
    ℝ → ℝ
    hf :
    hfg :
    ∀ t, g t = f t
    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/BernsteinSzegoTrig/Szego.lean:100
  • cos_nat_mul_isTrigPolyLE theorem — The function t ↦ cos(n t) is a real trigonometric polynomial of degree at most n.
    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 (Nat.lt_succ_self n))).elim
    Causalean.Mathlib.Analysis.BernsteinSzegoTrig.cos_nat_mul_isTrigPolyLE · Causalean/Mathlib/Analysis/BernsteinSzegoTrig/Szego.lean:107
  • szegoInterp_continuous theorem — The Szegő interpolant is continuous as a function of its argument.
    β :
    Q₀ Q₁ t₀ :
    Continuous (szegoInterp β Q₀ Q₁ t₀)
    Proof (Lean source)
    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/BernsteinSzegoTrig/Szego.lean:188