r/formalmethods • u/Sunpunggi1 • 20h ago
CertMat: A zero-Mathlib Lean 4 verification kernel (51 theorems, 0 sorry) auditing 1.31M inorganic crystal stability evaluations
I wrote a self-contained Lean 4 (`v4.16.0`, zero Mathlib dependencies, 0 `sorry`, standard axioms only) certificate checker to formally verify phase stability (convex hull) and Born elastic stability across GNoME, NIST JARVIS-DFT 3D, and Matbench Discovery WBM.
The architecture decouples fast floating-point search (HiGHS LP + Z3 exact rational fallback) from a compact, independently compiled Lean 4 kernel (`certmat-check`).
Mechanized theorem families: 1. Exact Farkas primal-dual soundness with non-negative margin enforcement. 2. Exact algebraic cancellation of correlated elemental reference-state errors. 3. Universal worst-case interval robustness over heterogeneous energy boxes (with Charnes-Cooper exact critical radius). 4. Exact rational LDL^T Born positive-definiteness, constructive strain counterexamples, and bidirectional pure-rational SO(3)-invariant Mandel/Kelvin Frobenius-Weyl robustness/fragility (avoiding irrational sqrt(2) via reciprocal weights).
Across the audit, 95,348 serialized rational TSV certificates pass the compiled `certmat-check` binary (0 failures), and the audit uncovered an upstream `ehull` double-division bug affecting 63,386 materials in NIST JARVIS-DFT 3D (reported upstream: https://github.com/usnistgov/jarvis/issues/343).
GitHub: https://github.com/sunpunggi1/certmat ChemRxiv preprint: https://chemrxiv.org/doi/full/10.26434/chemrxiv.15012737/v1