RealRooted is a Lean 4 library about real-rooted univariate polynomials and
the tools used to prove real-rootedness: interlacing, compatibility and common
interleavers, Pólya-frequency sequences, stability, and linear preservers. It
also contains many combinatorial applications.
Browse the theorem catalog for readable statements of the completed results, with their Lean names, references, and source links.
It is a research formalization workspace rather than a polished Mathlib contribution. Every named theorem is checked by Lean. We aim to upstream stable, reusable pieces to Mathlib over time.
PROOF_STATUS.mdlists proof assumptions, open statement targets, and refuted legacy interfaces.ARCHITECTURE.mddescribes the module layers, import budgets, and module-splitting rules.
The project uses Lean 4.34.0 and Mathlib v4.34.0.
lake exe cache get
lake build # default target, as in CI
lake build RealRooted.Production # library without tactic regressions
lake build RealRooted.Tactic.Examples # tactic regression suite
lake build RealRooted.Hadamard # any single moduleThe default build covers the broad RealRooted umbrella, Production, and the
tactic regressions. For an independent kernel re-check and axiom audit of the
comparator theorem surface, run ./verify.sh on x86_64 Linux or
./verify_docker.sh elsewhere. Pinned tool versions are in
comparator/versions.env. These scripts complement lake build; they do not
replace it.
RealRooted.leanis the broad compatibility umbrella.RealRooted/Production.leanimports every non-regression module, andRealRooted/Tactic/Examples.leanis the mandatory tactic regression umbrella.RealRooted/Mathlib/holds upstream-shaped lemmas.RealRooted.Mathlib.Xis meant for Mathlib'sMathlib.X.RealRooted/Challenges/holds short entry points, one per completed result. They feed the public catalog (see Documentation).RealRooted/Tactic/holds the real-rootedness and interlacing tactics.Tactic/OEIS_COVERAGE.mdis the generated ledger of OEIS certificate coverage.- Theory lives in topic directories such as
CommonInterleaver/,Hadamard/,BorceaBranden/,MultiplierSequence/,LGV/, andWronskian/. Concrete families live inCombinatorialExamples/andApplications/.
Interlaces f g,StrictInterl f g,Interl f g: interlacing in the strict, oriented, and zero-aware forms.p = 0 ∨ p.Splits: the zero-aware real-rootedness convention for closure statements.IsGeneralizedSturmSeq,IsInterlacingSeq,IsInterlacingSeq0: list-level Sturm and interlacing sequences.Compatible,PairwiseCompatible,FamilyCompatible: compatibility in the sense of Chudnovsky and Seymour.HasCommonInterleaver,HasCommonLeftInterleaver: common interleavers of finite families.AllComboRealRooted f g: every real linear combination is zero or real-rooted.IsPolyaFreqSeq a: the Toeplitz matrix ofais totally nonnegative.
The catalog is the full, curated list. Some representative checked theorems:
- Interlacing basics. Rolle (
derivative_interlaces), Wagner's lemmas (Challenges.Wagner), Obreschkoff's theorem (allComboRealRooted_of_strictInterl,strictInterl_of_allComboRealRooted), and Favard sequences (favardInterlacing). - Matrices. Cauchy interlacing (
cauchy_interlacing), principal interlacing for totally nonnegative matrices (Matrix.IsTotallyNonneg.leading_charpoly_interlaces), and the Bezoutian criterion (strictInterlSameDegree_iff_bezoutMatrix_posDef). - Preservers. Interlacing preservers (
operatorPreservesInterlacingPairsUpToOrder), matrix preservers (matrix_preserves_interlacing_seq), the finite Borcea–Brändén classification (Challenges.BorceaBranden), Garloff–Wagner Hadamard products (Challenges.Hadamard.interl_hadamardProduct_of_strictInterl), and the Mao–Wang Narayana transformation (narayanaTransformPreservesPF). - Pólya frequency. The reverse Aissen–Schoenberg–Whitney theorem
(
aissenSchoenbergWhitney_reverse), Veronese sections (isRealRootedOrZero_veroneseSectionPolynomial_of_realRooted_nonneg_matrix), and the Type-I Pólya–Schur classification (isPFMultiplierSequence_iff_isLaguerrePolyaTypeI_complexExpGeneratingFunction). - Compatibility. Liu's opposite-leading-sign theorem
(
compatible_iff_rootCountBranchesWithCommon) and the Chudnovsky–Seymour common-interleaver theory (Challenges.ChudnovskySeymour). - Graphs. Claw-free independence polynomials
(
Graph.clawFree_indepPoly_splits), acyclic sink polynomials (UnitIntervalGraph.acyclicSinkPolynomial_splits,Graph.allOrientationSinkPolynomial_splits_of_clawFree), and minima polynomials (Graph.minimaPolynomial_splits). - Combinatorial families. Eulerian and type-B Eulerian polynomials
(
Challenges.Eulerian), generalized snake posets (snakeInterlacing_generalizedSnakeRookModel), peak-value enumerators (peakValuePolynomial_mvRealStable), the A16634x gamma pencil (gammaU_strictInterl_gammaV), the Jacobi deformation and OEIS A132885 (JacobiDeformation.polynomial_strict_package), and the weighted deco Eulerian transform (Challenges.DecoEulerian.weightedDecoTransform_splits_hasSimpleRoots_roots_neg).
Open problems and proof tasks are tracked in GitHub issues, not in this file.
sorry,admit, and sourceaxiomcommands are not accepted as proofs. Track an unproved result in a GitHub issue.- A temporary
...Statement : Propinterface is allowed only when it is genuinely useful. List it inPROOF_STATUS.md, document that it is an unproved target, and keep it out of production theorem dependencies. - Keep a known-false candidate interface only when it helps diagnosis, and then only next to its checked negation. Any reduction through such an interface must take it as an explicit hypothesis and document that the route is uninhabited.
- Follow the Lean community style guide and Mathlib naming conventions. Keep declarations explicit, prefer small reusable lemmas, and keep top-level declarations flush-left.
- Code on the default branch must build without warnings. The lakefile sets
warningAsError. set_optionis forbidden. Fix warnings, lint errors, and resource limits in the proofs and definitions instead of suppressing them.try,all_goals, andany_goalsare forbidden in proofs. They remain allowed insidemacro,macro_rules,elab, andelab_rulestactic implementations. Use structured case analysis or sequential composition.simp +decideandsimp_all +decideare forbidden.- Use
lia, notomega. A goal thatliacannot close may useomegaonly when its declaration is listed inALLOWED_OMEGAinscripts/check_proof_status.py. - Keep
lakefile.tomlandlake-manifest.jsonfree of absolute paths. The relative.lake/packagesand.lake/buildpaths must keep working out of the box.
python3 scripts/check_root_imports.py --fix # register a new module (imports stay sorted)
python3 scripts/check_import_architecture.py # import graph, layers, budgets
python3 scripts/check_proof_status.py --self-test
python3 scripts/check_proof_status.py # sorry/axiom/tactic rules, open statementsThe import guards check the broad, production, and regression umbrellas
separately, and reject production closures that contain tactic examples. The
proof-status guard also reports low-use theorem-shaped propositions that still
need an explicit entry in PROOF_STATUS.md.
- A small, independently owned change may use a CI-first draft PR: run the applicable source checks, push the branch, and open a draft PR so GitHub compiles it. A local full build is not required for that draft. State which checks have and have not run. A draft commit is not a verified theorem milestone.
- Parallel workers use isolated branches or worktrees with disjoint file ownership. Builds against a shared local Lake cache must be serialized. GitHub runners can validate PRs independently. One integrator reviews the statements, assumptions, source changes, and verification results.
- Before merging, the exact candidate revision must pass all source guards,
the ordinary default build (including
Productionand the tactic regressions), and the applicable transitive-axiom checks. The Comparator audit covers only its listed theorem surface. - After a rebase or integration change, rerun the relevant checks. Cancelled, skipped, stale, or missing checks never count as success. Fix failed draft checks before marking a PR ready.
- Do not push unverified changes directly to the default branch, and do not enable automatic merging to bypass review.
Routine CI does not generate full API documentation. Public documentation is
curated in the RealRooted/Challenges/ entry points and rendered by
scripts/build_challenge_pages.py. Pull requests get a review artifact.
- Every challenge module needs an unconditional checked witness. Incomplete targets belong in GitHub issues, not in challenge modules.
- An explicit metadata block opts a module into the catalog. Only selected definitions and checked theorems are published, never conjectures, examples, or statement scaffolds.
- Each catalog metadata block requires
formalized = "YYYY-MM-DD", the date its selected headline result (or first theorem) was first formalized. - The bounded module comment holds the explanatory prose and the primary references.
- After the ordinary build,
scripts/audit_challenge_catalog.pyverifies the selected declaration kinds and transitive axioms. Only that validatedmainrevision deploys to GitHub Pages. Documentation never replaces proof validation, and the requiredbuildcheck does not depend on publication.
- Do not commit build logs (
*.log), patch files (*.patch), backups (*~), or scratch files. Keep new kinds of temporary files local, or add them to.gitignore. - Keep issue-specific notes local.
.gitignoreignores new Markdown files by default. It allows only the maintained top-level guides, the architecture and status ledgers, the generated tactic coverage, and the publicSuperEulerian/subtree.
Apache License, Version 2.0. See LICENSE.
Related surveys: the Symmetric Functions Catalog pages on real-rooted polynomials, interlacing, Pólya frequency, and real-rooted words.