Mathlib.Analysis.BernsteinSzegoTrig
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_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ő).
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)
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
Proof (Lean source)
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
Proof (Lean source)
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
Proof (Lean source)
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
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
szegoInterp_amplitude_coretheorem — 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.hypothesesω :ℝQ₀ q 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]
TrigPoly 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.
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)
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
Proof (Lean source)
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
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
isTrigPolyLE_consttheorem — Constant functions are trigonometric polynomials of degree ≤ n (they use only the k = 0 term).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 -
monotheorem — A degree-≤n trig polynomial is also a degree-≤m trig polynomial when n ≤ m (pad the higher coefficients with zeros).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] -
subtheorem — The difference of two degree-≤n trig polynomials is a degree-≤n trig polynomial (subtract the coefficient sequences termwise).hypothesesconclusionIsTrigPolyLE 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 -
exp_mul_I_injOn_Icolemma — On any half-open real interval spanning one full period, the complex exponential evaluated at an imaginary real input is injective.hypothesesc s t :ℝconclusions = tProof (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
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.
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
Proof (Lean source)
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
Proof (Lean source)
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ő).
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
Proof (Lean source)
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
Proof (Lean source)
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
Proof (Lean source)
5 supporting declarations (lemmas, instances)
-
addtheorem — The sum of two real trigonometric polynomials of degree at most n is again a real trigonometric polynomial of degree at most n.hypothesesconclusionIsTrigPolyLE 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 -
const_multheorem — Multiplying a real trigonometric polynomial of degree at most n by a scalar preserves the degree bound.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 -
congrtheorem — 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.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]⟩ -
cos_nat_mul_isTrigPolyLEtheorem — The function t ↦ cos(n t) is a real trigonometric polynomial of degree at most n.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 -
szegoInterp_continuoustheorem — The Szegő interpolant is continuous as a function of its argument.Proof (Lean source)
theorem szegoInterp_continuous (β : ℕ) (Q₀ Q₁ t₀ : ℝ) : Continuous (szegoInterp β Q₀ Q₁ t₀) := by unfold szegoInterp fun_prop