Variations of a Sturm sequence at a point #
The variation of a signed Euclidean remainder sequence is the number used in
Sturm's root-counting formula. Mathlib's Polynomial.sturmSeq supplies the
sequence and TauCeti.Sturm.signVariationsAt counts its evaluated sign changes.
At a zero of the nonzero second polynomial where the first is nonzero, the first and third
values are opposite, so deleting the zero reveals exactly one sign change. This file
records that local calculation alongside the sequence recurrence. The existing
empty-list and singleton variation lemmas supply the zero cases. The calculation works over
any ordered field; it does not require real closedness.
Negating both inputs or multiplying them by a polynomial nonzero at the
evaluation point leaves the variation unchanged, while a common root makes it zero.
The evaluated variation uses the existing TauCeti.Sturm.signVariationsAt API
on Polynomial.sturmSeq p q.
A zero first value is deleted when counting Sturm variations.
When the first two evaluations are nonzero, a Sturm variation step adds one exactly when their signs differ.
At a zero of the nonzero second polynomial that is not a zero of the first, the first Sturm variation step contributes exactly one sign change.
Multiplying both inputs by a common polynomial does not alter their Sturm variation away from its roots.
Negating both inputs preserves their Sturm variation.
A common root of the two input polynomials annihilates every entry of their Sturm sequence, so its variation at that point is zero.