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 limit of sign (p.eval y) as y → x from the right, 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 #
Polynomial.signRight x p: the sign ofpimmediately to the right ofx.
Main results #
Polynomial.eventually_sign_eq_signRight,Polynomial.signRight_eq_iff: the defining property,sign (p.eval y) = signRight x pfor allyin some interval(x, x + ε).Polynomial.signRight_eq_zero_iff:signRight x p = 0if and only ifp = 0.Polynomial.signRight_mul,Polynomial.signRight_neg,Polynomial.signRight_C:signRight xis multiplicative and compatible with negation and constants.Polynomial.signRight_of_eval_ne_zero: away from the roots ofp,signRight x pis the sign ofp.eval x.Polynomial.signRight_of_eval_eq_zero: at a root ofp,signRight x pissignRight xof the derivative ofp.
Implementation notes #
The definition and all results are stated over ℝ, but they hold over any real closed field, and
should eventually be generalised to IsRealClosed. Two ingredients stand in the way: the
intermediate value theorem for polynomials over a real closed field, which Mathlib does not have
yet and which is needed for exists_eventually_sign_eq (the proof here uses connectedness of
intervals in ℝ), and the mean value theorem, used in signRight_of_eval_eq_zero, which can be
replaced by an algebraic argument factoring the root out of p.
Immediately to the right of x, a polynomial has a constant sign.
The sign of p immediately to the right of x: the eventual value of sign (eval y p) as
y → x from the right.
Equations
- Polynomial.signRight x p = (nhdsWithin x (Set.Ioi x)).limUnder fun (y : ℝ) => SignType.sign (Polynomial.eval y p)
Instances For
The equation sign (eval y p) = signRight x p holds for all y in some interval
(x, x + ε).
signRight x p is the unique sign s such that sign (eval y p) = s for all y in some
interval (x, x + ε).
signRight x p can only be 0 if p is 0.
signRight of a constant equals the sign of the constant.
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.