Documentation

CslibFrontier.Foundations.Algebra.Polynomial.RealRoot.TotalIsolation

Certified Real-Root Isolation with Disjoint Closed Isolating Intervals #

This module refines the Sturm-bisection isolator isolateRoots into isolateRootsTotal (together with the Polynomial ℚ wrapper isolatePolyRootsTotal), separating any adjacent isolating intervals that share a non-root midpoint (separateTouching) so that consecutive intervals satisfy strict separation J₁.upper < J₂.lower and define pairwise disjoint closed real intervals Set.Icc (J.lower : ℝ) (J.upper : ℝ).

For every squarefree p : ℚ[X] (represented computably by any cs : List ℚ with ofCoeffList cs = p, or via isolatePolyRootsTotal p), the returned intervals are in strictly monotone bijection with {x : ℝ // Polynomial.aeval x p = 0}, and every endpoint satisfies explicit polynomial dyadic numerator and denominator bit bounds under HasCoeffBitBound B cs.

Main definitions #

Main results #

References #

separateTouching, isolateRootsTotal (refining isolateRoots, which may return touching intervals, into strictly separated pairwise-disjoint closed intervals on squarefree input, with dyadic endpoint bit bounds under HasCoeffBitBound B cs), and the polynomial-time certification in CslibFrontier.Computability.Complexity.RealAlgebraic.RootIsolation are this library's own construction, distinct from the mathematical Sturm-counting and root-separation ingredients below; [BPR06], §10.2, Algorithm 10.4 (pp. 373–374, over integer coefficients using Bernstein coefficient variation and returning open rational intervals and singleton rational roots) is related work.

Boundary separation into strictly disjoint closed intervals #

def Cslib.RealRoot.separateMidLoop (seq : List (List ℚ)) :
ℕ → ℚ → ℚ → ℚ → ℕ → ℚ × ℚ

Bisect (a, m] and (m, b] around a non-root midpoint m until finding (u₁', l₂') with u₁' < l₂', no roots in (u₁', m], and no roots in (m, l₂'].

theorem Cslib.RealRoot.separateMidLoop_dyadicBounded (seq : List (List ℚ)) (fuel B e : ℕ) (a m b : ℚ) (vm : ℕ) :
DyadicBounded B e a → DyadicBounded B e m → DyadicBounded B e b → have p := separateMidLoop seq fuel a m b vm; DyadicBounded B (e + fuel) p.1 ∧ DyadicBounded B (e + fuel) p.2

Dyadic bound for separateMidLoop: fuel steps increase the dyadic exponent by at most fuel.

def Cslib.RealRoot.separatePair (t : List ℚ) (seq : List (List ℚ)) (depth : ℕ) (I₁ I₂ : RootInterval) :

Separate the boundary between two consecutive isolating intervals I₁ and I₂, returning (u₁', l₂') with I₁.lower ≤ u₁' ≤ I₁.upper, I₂.lower ≤ l₂' ≤ I₂.upper, and u₁' < l₂'.

theorem Cslib.RealRoot.separatePair_dyadicBounded (t : List ℚ) (seq : List (List ℚ)) (depth B e : ℕ) (I₁ I₂ : RootInterval) (h1l : DyadicBounded B e I₁.lower) (h1u : DyadicBounded B e I₁.upper) (h2l : DyadicBounded B e I₂.lower) (h2u : DyadicBounded B e I₂.upper) :
have p := separatePair t seq depth I₁ I₂; DyadicBounded B (e + depth) p.1 ∧ DyadicBounded B (e + depth) p.2

Dyadic bound for separatePair.

def Cslib.RealRoot.separateChain (t : List ℚ) (seq : List (List ℚ)) (depth : ℕ) (curLower : ℚ) :

Walk a chain of isolating intervals carrying an updated curLower endpoint and separating every adjacent pair.

Separate all touching adjacent boundaries in a list of isolating intervals.

theorem Cslib.RealRoot.separateChain_dyadicBounded (t : List ℚ) (seq : List (List ℚ)) (depth B e : ℕ) (L : List RootInterval) (curLower : ℚ) :
DyadicBounded B (e + depth) curLower → (∀ I ∈ L, DyadicBounded B e I.lower ∧ DyadicBounded B e I.upper) → ∀ J ∈ separateChain t seq depth curLower L, DyadicBounded B (e + depth) J.lower ∧ DyadicBounded B (e + depth) J.upper

Dyadic bound for separateChain.

Computable isolator returning strictly disjoint closed intervals #

Computable Sturm-bisection real-root isolator on List ℚ returning strictly disjoint closed rational intervals (J₁.upper < J₂.lower).

isolateRootsTotal cs has the exact same length as isolateRoots cs.

Unconditional dyadic numerator and denominator bounds on every endpoint in isolateRootsTotal cs.

Soundness: every interval in isolateRootsTotal cs isolates a unique real root of (ofCoeffList cs).map (algebraMap ℚ ℝ).

Soundness in Polynomial.aeval form: every interval J ∈ isolateRootsTotal cs satisfies J.lower ≤ J.upper and contains a unique x : ℝ with Polynomial.aeval x (ofCoeffList cs) = 0.

Strict separation: every pair of intervals in isolateRootsTotal cs satisfies J₁.upper < J₂.lower.

Closed-interval disjointness: the closed intervals Set.Icc (J.lower : ℝ) (J.upper : ℝ) of isolateRootsTotal cs are pairwise disjoint.

The unique real root x : ℝ with Polynomial.aeval x (ofCoeffList cs) = 0 inside the i-th interval of isolateRootsTotal cs.

totalIsolatedRoot hsep i lies in the i-th closed interval of isolateRootsTotal cs.

The real roots indexed by totalIsolatedRoot hsep are strictly increasing.

Bijection between Fin (isolateRootsTotal cs).length and {x : ℝ // Polynomial.aeval x (ofCoeffList cs) = 0} for separable ofCoeffList cs.

theorem Cslib.RealRoot.isolateRootsTotal_endpoint_bounds_of_bitBound {B : ℕ} {cs : List ℚ} (hB : HasCoeffBitBound B cs) (J : RootInterval) :
J ∈ isolateRootsTotal cs → have E := 3 * (cs.length + 2) ^ 2 * (B + 2); J.lower.den ≤ 2 ^ E ∧ J.upper.den ≤ 2 ^ E ∧ J.lower.num.natAbs ≤ 3 * 2 ^ (2 * B + E) ∧ J.upper.num.natAbs ≤ 3 * 2 ^ (2 * B + E)

Explicit polynomial endpoint numerator and denominator bounds in (cs.length, B) under HasCoeffBitBound B cs: every returned endpoint has denominator ≤ 2 ^ E and numerator natAbs ≤ 3 * 2 ^ (2 * B + E), where E = 3 * (cs.length + 2) ^ 2 * (B + 2).

theorem Cslib.RealRoot.isolateRootsTotal_spec_of_eq {B : ℕ} {cs : List ℚ} {p : Polynomial ℚ} (hp : Polynomial.ofCoeffList cs = p) (hsq : Squarefree p) (hB : HasCoeffBitBound B cs) :
(∀ J ∈ isolateRootsTotal cs, J.lower ≤ J.upper ∧ ∃! x : ℝ, x ∈ Set.Icc ↑J.lower ↑J.upper ∧ (Polynomial.aeval x) p = 0) ∧ List.Pairwise (fun (J₁ J₂ : RootInterval) => J₁.upper < J₂.lower) (isolateRootsTotal cs) ∧ List.Pairwise (Function.onFun Disjoint fun (J : RootInterval) => Set.Icc ↑J.lower ↑J.upper) (isolateRootsTotal cs) ∧ (∃ (f : Fin (isolateRootsTotal cs).length → { x : ℝ // (Polynomial.aeval x) p = 0 }), Function.Bijective f ∧ (StrictMono fun (i : Fin (isolateRootsTotal cs).length) => ↑(f i)) ∧ ∀ (i : Fin (isolateRootsTotal cs).length), have J := (isolateRootsTotal cs)[i]; ↑(f i) ∈ Set.Icc ↑J.lower ↑J.upper) ∧ ∀ J ∈ isolateRootsTotal cs, have E := 3 * (cs.length + 2) ^ 2 * (B + 2); J.lower.den ≤ 2 ^ E ∧ J.upper.den ≤ 2 ^ E ∧ J.lower.num.natAbs ≤ 3 * 2 ^ (2 * B + E) ∧ J.upper.num.natAbs ≤ 3 * 2 ^ (2 * B + E)

Combined specification of the computable isolator isolateRootsTotal cs for any squarefree p : ℚ[X] represented by cs : List ℚ (ofCoeffList cs = p) with coefficient bit bound B: isolating aeval soundness, strict separation J₁.upper < J₂.lower, pairwise disjoint closed real intervals Set.Icc, strictly monotone bijection onto {x : ℝ // Polynomial.aeval x p = 0}, and polynomial dyadic endpoint numerator/denominator bounds.

Polynomial ℚ wrappers #

Pure list of strictly disjoint isolating rational intervals for p : ℚ[X].

Recovering p.coeffsBelow (p.natDegree + 1) from a coefficient list cs of length p.natDegree + 1 representing p.

Strict separation J₁.upper < J₂.lower for isolatePolyRootsTotal p.

Pairwise disjointness of closed intervals Set.Icc (J.lower : ℝ) (J.upper : ℝ) for isolatePolyRootsTotal p.

The unique real root x : ℝ with Polynomial.aeval x p = 0 inside the i-th interval of isolatePolyRootsTotal p.

Membership of polyTotalIsolatedRoot hsq i in the i-th closed interval of isolatePolyRootsTotal p.

polyTotalIsolatedRoot hsq is strictly increasing across Fin (isolatePolyRootsTotal p).length.

For every squarefree p : ℚ[X], polyTotalIsolatedRoot hsq is a bijection onto {x : ℝ // Polynomial.aeval x p = 0}.

theorem Cslib.RealRoot.isolatePolyRootsTotal_endpoint_bounds_of_bitBound {B : ℕ} {p : Polynomial ℚ} (hB : ∀ i ≤ p.natDegree, (p.coeff i).num.natAbs ≤ 2 ^ B ∧ (p.coeff i).den ≤ 2 ^ B) (J : RootInterval) :
J ∈ isolatePolyRootsTotal p → have E := 3 * (p.natDegree + 3) ^ 2 * (B + 2); J.lower.den ≤ 2 ^ E ∧ J.upper.den ≤ 2 ^ E ∧ J.lower.num.natAbs ≤ 3 * 2 ^ (2 * B + E) ∧ J.upper.num.natAbs ≤ 3 * 2 ^ (2 * B + E)

Polynomial dyadic numerator/denominator bounds on all endpoints of isolatePolyRootsTotal p given a bit-length bound B on p's coefficients.