Skip to content

feat: isolation semantics and driver completeness#8748

Merged
kim-em merged 3 commits into
mainfrom
real-roots-s7-drivers
Jul 11, 2026
Merged

feat: isolation semantics and driver completeness#8748
kim-em merged 3 commits into
mainfrom
real-roots-s7-drivers

Conversation

@kim-em

@kim-em kim-em commented Jul 11, 2026

Copy link
Copy Markdown
Owner

This PR add HexRealRootsMathlib/Isolations.lean and HexRealRootsMathlib/Drivers.lean, the isolation-semantics and driver-completeness theorems of the hex-real-roots companion, all sorry-free. RealRootIsolation.exists_unique_root shows a certified isolation names exactly one real root of toPolyℝ p in its half-open interval; RealRootIsolations.isolates shows a complete run names every real root exactly once (injective root map plus the rootCount cardinality); refine1_isolates_same shows one bisection refinement preserves the isolated root and halves the width exactly, with the fallback branch unreachable; isolateSturm?_isSome and isolate?_isSome show the Sturm engine and the top-level driver succeed on nonzero squarefree input, via the worklist-drain induction sturmVisit_spec (an interval no wider than 2^(-sepPrec p) holds at most one root by sepPrec_separates', so the depth budget always suffices).

Three SPEC statements gain an explicit p ≠ 0 hypothesis (RealRootIsolations.isolates, isolateSturm?_isSome, isolate?_isSome): the SquareFreeRat p-only forms are unsound because SquareFreeRat 0 holds while all three fail at p = 0 (every real is a root of the zero polynomial, but complete forces zero isolations and the engine returns none). Same precedent as #8738/#8741/#8745. The nonzero-constant case is genuinely covered: the driver's degree? = some 0 branch certifies through the empty chain (rootCount = 0), and isolates is vacuous there, so downstream consumers (hex-rcf calling isolation on squareFreeCore output) need no degree case split. exists_unique_root keeps the SPEC signature verbatim by deriving positive degree from its count_one certificate (a Sturm count of 1 forces a nonempty chain).

One correctness question got resolved along the way: the engine's completeness check compares the sturmVisit totals seeded at ±rootBound p against rootCount p computed from ±∞ leading-coefficient variations, and one might worry a chain element (a remainder of (p, p'), whose roots rootBound p does not bound) could break the match. There is no gap: sturmVar_neg_pos_sub proves the ±rootBound variation difference equals rootCount p outright, because sturmCount_eq_card_roots is a statement about p's roots only — the chain elements' own zeros are already absorbed by Sturm's theorem, and Cauchy's bound puts all of p's roots inside (-R, R].

🤖 Prepared with Claude Code

Kim Morrison and others added 3 commits July 11, 2026 18:18
Add HexRealRootsMathlib/Isolations.lean and HexRealRootsMathlib/Drivers.lean,
proving isolation soundness and driver completeness for the executable real-root
isolation library. `RealRootIsolation.exists_unique_root` and
`RealRootIsolations.isolates` establish that a certified isolation names exactly
one real root and that a complete run names every real root once;
`refine1_isolates_same` shows one bisection preserves the root and halves the
width; `isolateSturm?_isSome` and `isolate?_isSome` show the Sturm engine and the
top-level driver succeed on positive-degree squarefree input.

The `±rootBound`-versus-`±∞` question is resolved: `sturmVar_neg_pos_sub` proves
the variation gap between `-rootBound p` and `rootBound p` equals `rootCount p`,
a statement about `p`'s roots only, so chain-element zeros beyond the bound never
disturb the count. One structural lemma (`sturmVisit_spec`, the worklist-drain
induction) remains a `sorry` with its full invariant and proof plan documented;
everything downstream (`isolateSturm?_isSome`, `isolate?_isSome`, the
`assemble?` discharge) is complete modulo it.

Two SPEC theorems (`RealRootIsolations.isolates`, `isolateSturm?_isSome`) gain an
explicit `1 ≤ (p.degree?).getD 0` hypothesis: the SquareFreeRat-only forms are
unsound because `SquareFreeRat 0` holds while the statements fail at `p = 0`.
`exists_unique_root` keeps the SquareFreeRat-only form by deriving positive
degree from its `count_one` certificate.

Progress file: progress/2026-07-11T18-17-37Z-isolations-drivers.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NUB5EStJpJ8CPqMkNw7Qjz
Discharge the worklist-drain induction `sturmVisit_spec`, the last remaining
sorry in the driver-completeness tranche: structural induction on the depth
budget with truthful memoised counts, using `sturmCount_le_one` (an interval no
wider than 2^(-sepPrec p) holds at most one root, by `sepPrec_separates'` on
real pairs) to refute the count-≥-2-at-depth-0 branch, exact dyadic midpoint
halving for the bisection step, and the containment invariants to keep the
left ++ right emission ordered. `isolateSturm?_isSome` and `isolate?_isSome`
are now fully proven.

Progress file: progress/2026-07-11T18-37-39Z-drivers-sorry-free.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NUB5EStJpJ8CPqMkNw7Qjz
Weaken the hypothesis of `isolateSturm?_isSome`, `isolate?_isSome`, and
`RealRootIsolations.isolates` from `1 ≤ (p.degree?).getD 0` to `p ≠ 0`: the
driver's nonzero-constant branch genuinely succeeds (the empty Sturm chain
certifies `rootCount = 0` through `assemble?`), and hex-rcf will call isolation
on constants after `squareFreeCore`, so the degree form would force artificial
downstream case splits. The positive-degree proofs stay as private helpers; the
public theorems case-split on `degree?` (`none` refuted by the new
`degree?_ne_none`, `some 0` via the empty-chain certification or vacuity,
`some (n+1)` the existing content).

Progress file: progress/2026-07-11T18-46-00Z-drivers-ne-zero-shape.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NUB5EStJpJ8CPqMkNw7Qjz
@kim-em kim-em merged commit 59a07b3 into main Jul 11, 2026
1 check passed
@kim-em kim-em deleted the real-roots-s7-drivers branch July 11, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant