Documentation

Mathlib.Analysis.Polynomial.SignRight

The sign of a polynomial immediately to the right of a point #

A nonzero real polynomial has finitely many roots, so its sign is constant on a small interval (x, x + ε) to the right of any point x. This file defines that sign, Polynomial.signRight x p, as the sign of the trailing coefficient of the taylor polynomial of p around x, and develops its basic properties: it vanishes only for p = 0, it is multiplicative, and it is computed by the recursion signRight x p = sign (p.eval x) if p.eval x ≠ 0 and signRight x p = signRight x (derivative p) otherwise.

This is the local invariant behind Sturm's theorem, where it determines the direction in which the sign of a Sturm sequence changes across a root.

Main definitions #

Main results #

noncomputable def Polynomial.signRight {R : Type u_1} [CommRing R] [LinearOrder R] (x : R) (p : Polynomial R) :

The sign of p immediately to the right of x: the sign of the trailing coefficient of the Taylor polynomial of p centered at x.

Equations
Instances For
    @[simp]
    theorem Polynomial.signRight_zero {R : Type u_1} [CommRing R] [LinearOrder R] (x : R) :
    signRight x 0 = 0
    @[simp]
    theorem Polynomial.signRight_eq_zero_iff {R : Type u_1} [CommRing R] [LinearOrder R] {x : R} {p : Polynomial R} :
    signRight x p = 0 ↔ p = 0

    signRight x p can only be 0 if p is 0.

    @[deprecated Polynomial.signRight_eq_zero_iff (since := "2026-11-16")]
    theorem Polynomial.signRight_ne_zero {R : Type u_1} [CommRing R] [LinearOrder R] {x : R} {p : Polynomial R} (hp : p ≠ 0) :
    @[simp]
    theorem Polynomial.signRight_C {R : Type u_1} [CommRing R] [LinearOrder R] (x c : R) :

    signRight of a constant equals the sign of the constant.

    theorem Polynomial.signRight_neg {R : Type u_1} [CommRing R] [LinearOrder R] [IsOrderedRing R] (x : R) (p : Polynomial R) :

    signRight commutes with negation.

    theorem Polynomial.signRight_X_sub_C_pow {R : Type u_1} [CommRing R] [LinearOrder R] [IsOrderedRing R] [Nontrivial R] (a : R) (n : ℕ) :
    signRight a ((X - C a) ^ n) = 1
    theorem Polynomial.signRight_mul {R : Type u_1} [CommRing R] [LinearOrder R] [IsStrictOrderedRing R] (x : R) (p q : Polynomial R) :
    signRight x (p * q) = signRight x p * signRight x q

    signRight is a multiplicative function.

    theorem Polynomial.signRight_mul_self {R : Type u_1} [CommRing R] [LinearOrder R] [IsStrictOrderedRing R] {x : R} {p : Polynomial R} (hp : p ≠ 0) :
    signRight x (p * p) = 1
    theorem Polynomial.signRight_of_eval_ne_zero {R : Type u_1} [CommRing R] [LinearOrder R] {x : R} {p : Polynomial R} (h : eval x p ≠ 0) :

    Away from its roots, the sign of p to the right of x is the sign of p x.

    At a root of p, the sign of p to the right of x is that of derivative p.

    theorem Polynomial.signRight_derivative_mul {R : Type u_1} [CommRing R] [LinearOrder R] [IsStrictOrderedRing R] {x : R} {p : Polynomial R} (hp : p ≠ 0) (hev : eval x p = 0) :
    theorem Polynomial.signRight_eq_of_eval_eq {R : Type u_1} [CommRing R] [LinearOrder R] {x : R} {p q : Polynomial R} (h : eval x p = eval x q) (hq : eval x q ≠ 0) :

    Away from the roots, signRight x only depends on the value at x.

    theorem Polynomial.signRight_add {R : Type u_1} [CommRing R] [LinearOrder R] {x : R} {p q : Polynomial R} (hp : eval x p = 0) (hq : eval x q ≠ 0) :
    signRight x (p + q) = signRight x q
    theorem Polynomial.signRight_mod {K : Type u_2} [Field K] [LinearOrder K] {x : K} {p q : Polynomial K} (hp : eval x p = 0) (hq : eval x q ≠ 0) :
    signRight x (q % p) = signRight x q

    The equation sign (eval y p) = signRight x p holds for all y in some interval (x, x + ε).

    Immediately to the right of x, a polynomial has a constant sign.

    signRight x p is the unique sign s such that sign (eval y p) = s for all y in some interval (x, x + ε).