Real-Rootedness, IVT Root Counting, Rolle's Theorem, Alternating Signs #
This file establishes that polynomials with enough real roots are fully real-rooted, applies the IVT to count roots from alternating signs, proves Rolle's theorem for polynomials, and constructs roots from sign conditions.
Main theorems #
all_roots_real_of_enough_real_roots: n distinct real roots imply all roots realpoly_ivt_opp_sign: IVT gives a root between points of opposite signderivative_zeros_between_roots: Rolle's theorem for polynomial rootsderivative_sign_at_ordered_root: Sign of derivative at ordered rootsmonic_alternating_has_real_roots: Alternating signs imply n real roots
Sub-goals for real-rootedness preservation (Theorem 4.4) #
The proof of Theorem 4.4 (real-rootedness preservation under ⊞_n) proceeds by strong induction on n. The three main sub-goals are:
- Rolle: rPoly n p = p'/n is real-rooted when p is (derivative roots lie between consecutive roots of p).
- IVT root counting: A monic polynomial whose values alternate in sign at n-1 ordered points has n real roots.
- Alternating sign: At the zeros μ_i of r = r_p ⊞_{n-1} r_q, the values (p ⊞_n q)(μ_i) alternate in sign (via transport identity + positive w-vectors).
If p is a real polynomial of positive degree with all complex roots real, then p.derivative has the same property. Proof: Gauss-Lucas says roots of the derivative lie in the convex hull of roots of p. Since all roots of p are real and the real line is convex, the conclusion follows.
If all complex roots of p are real, then all complex roots of rPoly n p
are also real.
Helper lemmas for IVT root counting (Sub-goal 2) #
If a real polynomial of degree n has n distinct real roots,
then every complex root of the mapped polynomial is real.
Proof by counting: the roots multiset has card ≤ n (by card_roots'),
and we exhibit n distinct real elements in it via injectivity of algebraMap ℝ ℂ,
so every root must be one of them.
IVT for polynomials: if f(a) * f(b) < 0 with a < b, there exists a root
strictly between a and b. Uses intermediate_value_Icc from Mathlib.
For a monic polynomial with positive degree, eval → +∞ at +∞.
If f(b) < 0, there exists c > b with f.IsRoot c.
Root below a point using monic polynomial behavior at -∞.
If f is monic of degree n > 0 and (-1)^{n-1} · f(a) > 0, then f has a root below a.
The key idea: f(a-x) has leading coefficient (-1)^n, which has opposite sign from
(-1)^{n-1} (the sign of f(a)), so by IVT there is a root of f(a-·) at some t > 0,
giving a root of f at a - t < a.
The alternating sign condition implies consecutive evaluation points have opposite sign.
From (-1)^{n-1-i} · f(μᵢ) > 0 and (-1)^{n-1-(i+1)} · f(μᵢ₊₁) > 0,
since the exponents differ by 1, the signs of f(μᵢ) and f(μᵢ₊₁) are opposite.
From the alternating sign condition, construct n strictly ordered real roots of f
via IVT: one below μ₀, one between each consecutive pair, one above μ_{n-2}.
Shared by monic_alternating_has_real_roots and monic_alternating_squarefree.
Sub-goal 2 (IVT root counting): A monic polynomial of degree n ≥ 2 whose values at n-1 strictly ordered points alternate in sign has all roots real.
Helper lemmas for alternating sign at critical points #
The sign of the derivative of a monic polynomial at its i-th strictly ordered root: For a monic poly of degree m with m simple ordered roots μ₀ < ... < μ_{m-1}, sign(q'(μ_i)) = (-1)^{m-1-i}. Concretely: 0 < (-1)^{m-1-i} * q'(μ_i).
Proof: q'(μ_i) = ∏_{j≠i} (μ_i - μ_j). Among the m-1 factors:
- The i factors with j < i satisfy μ_i - μ_j > 0 (positive)
- The (m-1-i) factors with j > i satisfy μ_i - μ_j < 0 (negative) So the product has sign (-1)^{m-1-i}, i.e. (-1)^{m-1-i} * q'(μ_i) > 0.
At a root μ of rPoly n f (where μ is a zero of (1/n)·f'), we have f.eval μ = -criticalValue f n μ * (rPoly n f).derivative.eval μ. This is the algebraic unfolding of the definition of criticalValue.
Rolle's theorem for polynomials: between two distinct roots a < b of a polynomial p, the derivative p.derivative has at least one root c ∈ (a, b).
For a polynomial with n distinct ordered real roots, the derivative has at least n-1 zeros, one between each consecutive pair of roots.