Documentation

CslibFrontier.Foundations.Algebra.Polynomial.RealRoot.ShiftedLabel

Bounded shifts for polynomial root labels #

Scaling a real label by -4 * D reverses its sign, and adding a natural number at most D preserves the reversed sign when the label has magnitude at least one half. A shift in this range avoids zero on the enumerated roots of a source polynomial of degree at most D.

Adapted from ShiftedRootTests in lean-canny at 970f28a5ecefc1327402ade16c068aa4b1b2c183.

noncomputable def Polynomial.shiftedRootLabel {R : Type u_1} [Ring R] (D e : ℕ) (g : Polynomial R) :

A root test formed by scaling a label by -4 * D and adding a constant shift.

theorem Polynomial.shiftedRootLabel_bounds (g : Polynomial ℤ) {D e N b : ℕ} (he : e ≤ D) (hD : D ≤ 2 ^ N) (hg : g.coeffNorm1 ≤ 2 ^ b) :

The shift does not increase degree. With D ≤ 2 ^ N, it costs at most N + 3 additional bits in a power-of-two coefficient norm bound. The input bound on D passes through directly, including when it comes from a quotient dimension.

theorem Polynomial.exists_aeval_shiftedRootLabel_ne_zero {R : Type u_1} {A : Type u_2} [CommRing R] [CommRing A] [IsDomain A] [CharZero A] [Algebra R A] (p g : Polynomial R) {D : ℕ} (hD : p.natDegree ≤ D) :
∃ e ≤ D, ∀ z ∈ p.aroots A, (aeval z) (shiftedRootLabel D e g) ≠ 0

Among D + 1 natural shifts, some shifted label is nonzero on p.aroots A when p has degree at most D and A is a characteristic-zero domain.

theorem Polynomial.sign_eval_shiftedRootLabel {D e : ℕ} (hD : 0 < D) (he : e ≤ D) {g : Polynomial ℝ} {x : ℝ} (hm : 1 / 2 ≤ eval x g ∨ eval x g ≤ -1 / 2) :

A bounded shift reverses the sign of a real root label with magnitude at least one half.