Documentation

CslibFrontier.Foundations.Algebra.Polynomial.RealRoot.Sturm

Sturm's theorem for real polynomials #

This file proves Sturm's theorem over ℝ[X] on top of Mathlib's Polynomial.sturmSeq and List.signVariations (see [BPR06]).

For any nonzero real polynomial p with g = EuclideanDomain.gcd p (derivative p), dividing out g yields the coprime pair (p / g, derivative p / g), whose Sturm sign-variation count Polynomial.sturmReducedVariations p x agrees with Polynomial.sturmVariations p x at every point where g.eval x ≠ 0 (while sturmVariations p x = 0 at roots of g). Across any point x, sturmReducedVariations p is locally constant away from roots of p, constant on a right neighborhood (x, x + δ), and increases by 1 on a left neighborhood (x - δ, x) precisely when x is a root of p (of any multiplicity). Consequently, sturmReducedVariations p x + #{r ∈ p.roots.toFinset | r ≤ x} is locally constant on ℝ, hence constant, yielding Sturm's root-counting identity on (a, b] both for general nonzero polynomials (away from multiple-root endpoints) and unconditionally for separable (squarefree) polynomials.

Main definitions #

Main results #

References #

theorem Polynomial.sturmSeq_map {K : Type u_1} {L : Type u_2} [Field K] [DecidableEq K] [Field L] [DecidableEq L] (f : K →+* L) (p q : Polynomial K) :
(map f p).sturmSeq (map f q) = List.map (map f) (p.sturmSeq q)

Polynomial.sturmSeq commutes with Polynomial.map along any ring homomorphism between fields.

noncomputable def Polynomial.sturmVariations (p : Polynomial ℝ) (x : ℝ) :

The number of sign variations of the canonical Sturm sequence sturmSeq p (derivative p) evaluated at x : ℝ.

noncomputable def Polynomial.sturmReducedVariations (p : Polynomial ℝ) (x : ℝ) :

Sign variations of the reduced coprime Sturm sequence sturmSeq (p / gcd p (derivative p)) (derivative p / gcd p (derivative p)) at x : ℝ.

At any point x where gcd p (derivative p) vanishes, sturmVariations p x = 0.

Wherever gcd p (derivative p) does not vanish at x, sturmVariations p x equals sturmReducedVariations p x.

General Sturm's theorem via reduced coprime Sturm variations: for any nonzero p : ℝ[X] and a ≤ b, sturmReducedVariations p a - sturmReducedVariations p b equals the number of distinct real roots of p in (a, b] (counted without multiplicity).

sturmReducedVariations p is antitone on ℝ for every nonzero p : ℝ[X].

General Sturm's theorem on (a, b] for any nonzero p : ℝ[X] whose multiple-root divisor gcd p (derivative p) does not vanish at a or b (after [BPR06], Theorem 2.50, p. 52, adapted to finite real endpoints on (a, b]).

Sturm's theorem on half-open intervals (a, b] for separable p : ℝ[X] (after [BPR06], Theorem 2.50, p. 52, adapted to finite real endpoints on (a, b]): the drop sturmVariations p a - sturmVariations p b equals the number of distinct real roots of p in (a, b], with no nonvanishing assumption on the endpoints.

sturmVariations p is antitone on ℝ for separable p : ℝ[X].

Squarefree version of Sturm's theorem on (a, b] over ℝ[X].

theorem Polynomial.sturmVariations_sub_eq_card_roots_Ioo {p : Polynomial ℝ} (hp : p.Separable) {a b : ℝ} (hab : a ≤ b) (hb : eval b p ≠ 0) :
p.sturmVariations a - p.sturmVariations b = {r ∈ p.roots.toFinset | a < r ∧ r < b}.card

Open-interval form of Sturm's theorem when b is not a root.

theorem Polynomial.sturmVariations_sub_eq_card_roots_Icc {p : Polynomial ℝ} (hp : p.Separable) {a b : ℝ} (hab : a ≤ b) (ha : eval a p ≠ 0) :

Closed-interval form of Sturm's theorem when the left endpoint is not a root.