refactor(real-roots-mathlib): use Mathlib list sign variations - #10273
Merged
Merged
Conversation
kim-em
enabled auto-merge (squash)
September 15, 2026 04:15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Sturm development now uses
List.signVariationsfrom mathlib PR #43783. Bump Lean and Verso to v4.34.0 and Mathlib to1cf325a0cf67aca2b04d76b5380ff6a9e410aefa, then synchronize the seven shared library/test modules with mathlib #43512 at237738a03f8be551ca847d12f8a31d3a7ffe0e6c.Replace the duplicate Sturm counters and sign-congruence proofs with the shared list API, including the tactic's integer computation and generated proofs.
Prove
Hex.signVaragrees directly withList.signVariations, use its filter/map/congruence lemmas, and reduce the Descartes bridge to reversal invariance. The computational libraries remain Mathlib-free.Adapt the other Mathlib bridges to the bump: polynomial coefficients, power-series derivatives, product inequalities,
norm_num, and explicit qualification of Hex's dyadic-to-real names where the new Mathlib name would shadow them.Refresh the full 392-input Hex factorization sweep and graph-isomorphism executable/tactic measurements for Lean v4.34.0, retaining timeouts and regenerating the published figures.
API migration
Use
List.signVariationsand its recursion/congruence lemmas in place of the removedSturm.signVariations,Sturm.countSignChanges, and their helpers.signVar_eq_listgives the direct integer correspondence;signVar_eqremains the real-cast correspondence.HexRealRootsMathlib.signVariations_reversenow works for any linearly ordered type with zero.Mathlib is pinned to a commit because the shared list API landed after the v4.34.0 release tag. The existing Hex dyadic conversion definitions and their simp behavior are retained, with explicit names where needed to distinguish them from Mathlib's new definitions.
Validation
lake build, including the aggregate and Verso manual: 14,384 jobs, successful.HexRealRootsMathlib/*Tests.leanandHexRCF/*Tests.leanregression modules; matrix literal tests.lake build HexConformance: 13,695 jobs, successful. This also covers the interval experiment modules; remove fouromegasteps that are redundant after the new simplifications.check_sturm_sync.py: all seven modules match mathlib #43512.propext,Classical.choice, andQuot.sound.