Documentation

CslibFrontier.Foundations.Algebra.Polynomial.RealRoot.SparseIntegerRootLabel

Integer polynomial labels for sparse real-root selectors #

A fixed-width family contains a distinguished positive test and a short list of derivative signs. An integer polynomial realizes these tests at every real root. Its degree and coefficient norm have uniform bounds. If a qualifying root exists and the source degree is at most 2 ^ N, a list of at most N derivative tests makes the label positive at one qualifying root and negative at every other real root.

Adapted from DerivativeRootLabels and SparseIntegerRootLabels in lean-canny at commit 970f28a5ecefc1327402ade16c068aa4b1b2c183.

noncomputable def Polynomial.sparseRootLabelTests {D : ℕ} (p q : Polynomial ℤ) (N : ℕ) (L : List (Fin D × SignType)) :

The qualifying polynomial and its positive target occupy slot zero. The next N slots contain derivatives of p and their targets from L. Missing slots test zero.

noncomputable def Polynomial.sparseIntegerRootLabel {D : ℕ} (p q : Polynomial ℤ) (N b : ℕ) (L : List (Fin D × SignType)) :

The integer polynomial encoding the qualifying test and the first N derivative tests.

The degree and norm bounds are uniform over the list and its target signs.

theorem Polynomial.eval₂_sparseIntegerRootLabel_margin {D N b : ℕ} {p q : Polynomial ℤ} (hp : p ≠ 0) (L : List (Fin D × SignType)) (hL : L.length ≤ N) (hpD : p.natDegree ≤ D) (hqD : q.natDegree ≤ D) (hpb : p.coeffNorm1 ≤ 2 ^ b) (hqb : q.coeffNorm1 ≤ 2 ^ b) {x : ℝ} (hx : eval₂ (Int.castRingHom ℝ) x p = 0) :
have y := eval₂ (Int.castRingHom ℝ) x (p.sparseIntegerRootLabel q N b L); (1 / 2 ≤ y ∨ y ≤ -1 / 2) ∧ (0 < y ↔ 0 < eval₂ (Int.castRingHom ℝ) x q ∧ ∀ c ∈ L, (map (Int.castRingHom ℝ) p).derivativeSign x (↑c.1 + 1) = c.2)

At a real root, the label has magnitude at least one half and is positive exactly when the qualifying test is positive and every listed derivative sign matches.

theorem Polynomial.exists_sparseIntegerRootLabel {D N b : ℕ} {p q : Polynomial ℤ} (hp : p ≠ 0) (hpD : p.natDegree ≤ D) (hDN : D ≤ 2 ^ N) (hqD : q.natDegree ≤ D) (hpb : p.coeffNorm1 ≤ 2 ^ b) (hqb : q.coeffNorm1 ≤ 2 ^ b) (hex : ∃ (x : ℝ), eval₂ (Int.castRingHom ℝ) x p = 0 ∧ 0 < eval₂ (Int.castRingHom ℝ) x q) :

If some real root has a positive qualifying test, a label from at most N derivative tests is positive at one such root and negative at every other real root.