Summary (Overview)
- FormalFlow: A new autoformalization framework that coordinates AI proving agents under human supervision to address statement drift and proof composition in long-horizon formalization projects.
- Major Achievement: Completed a machine-checked Lean 4 proof of the quantum soundness of the classical low individual-degree test (LIDT), a core theorem underlying the landmark result, in just 63 days.
- Scale: The final library contains 126,367 lines of Lean code across 337 files, all generated by AI agents with no unproven placeholders () and using only standard axioms of classical mathematics.
- Error Discovery: The formalization process uncovered and repaired 2 errors in the published theorem statement and 3 in the intermediate error budget, plus 25 total gap notes documenting discrepancies.
- Framework Design: FormalFlow uses nested feedback loops (task planning, review, work sessions) with a shared repository, interactive blueprint, and continuous integration to maintain mathematical integrity.
Introduction and Theoretical Foundation
Background
Mathematical proofs can contain gaps that go unnoticed for years even after peer review. Formalization addresses this by translating informal proof steps into proof terms verifiable by proof assistants like Lean, Isabelle, or Rocq. Landmark human-led formalization projects include:
- Four-Color Theorem [1]
- Feit–Thompson Odd Order Theorem (over 150,000 lines) [2]
- Kepler Conjecture (over 500,000 lines) [3]
- Liquid Tensor Experiment [4, 5]
These achievements required years of manual work. Recent AI advances have enabled machine-checked proofs at far greater scale [6–15].
The Target: MIP* = RE
The theorem [21] establishes that interactive proofs with two entangled provers can decide every recursively enumerable language, refuting Connes' embedding conjecture [22]. The component formalized in this work is the quantum soundness of the classical low individual-degree test (LIDT) [23].
A proof gap in the earlier low-degree-test analysis [24] affected multiple downstream results. The LIDT was introduced as a weaker variant to recover [27] and [21, 28].
The Central Challenge
"The central challenge for long-horizon autoformalization is to bring a large, evolving codebase to a complete proof while retaining control of its mathematical structure."
Successive agent calls can introduce duplicate constructions, competing representations, and layers of intermediate results that still depend on unproved steps. If the mathematical structure cannot be recovered, the accumulated code may have to be abandoned and the formalization restarted.
Methodology
The LIDT Test Definition
The -low individual degree test: A referee interacts with Alice and Bob and samples uniformly. With probability 1/3 each, it performs one of three subtests:
-
Axis-parallel line: Choose a random coordinate direction and let . One prover returns a degree- polynomial on ; the other returns at . Accept if .
-
Self-consistency: Both provers receive and return . Accept if .
-
Diagonal line: Sample uniformly, then uniformly with . Let . One prover returns a degree- polynomial on ; the other returns at . Accept if .
In both line tests, the two prover roles are assigned uniformly at random.
FormalFlow Architecture
FormalFlow coordinates agents across four nested operational scales:
- Macro-scale (Task planning): Organizes the global proof into an interactive blueprint and GitHub issues, ensuring agents only attempt lemmas whose prerequisites are established.
- Meso-scale (Work session): Agents check out dedicated git branches, develop code, and open pull requests.
- Micro-scale (Proof loop): Within a session, agents execute an autonomous proof loop, repeatedly querying compiler diagnostics and tactic states.
- Orthogonal (Check growth): Newly diagnosed defect patterns are converted into automated CI linters and updated review prompts.
Key Components
- Shared Repository: Holds the paper, Lean codebase, proof-gap notes, and interactive blueprint (dependency graph mapping informal claims to formal Lean declarations).
- Proof-Gap Protocol: When agents encounter discrepancies between formalization and paper, they file standardized gap documents. Humans decide whether to correct the paper, repair the formalization, or close without modification.
- Verification Gates: Continuous integration runs full compilation (
lake build), kernel axiom audit (Lean.collectAxioms), and blueprint/source integrity checks before merging.
Tooling
The system uses TeXRA (multi-agent system), Claude Code, OpenCode, and Codex for proof tasks. Agents follow standing instructions requiring them to document the mathematical proof strategy from the paper before attempting formal tactics.
Empirical Validation / Results
Timeline and Progress Metrics
The formalization took 63 days (7 March to 24 June 2026). Key events:
- 1 April: Sorry count rose to 149 as the Lean skeleton was stubbed out
- 29 April: Sorry count fell to one, but 114 of 283 blueprint declarations remained unformalized
- 8 May: Not-ready count peaked at 293 (blueprint grew to 681 targets)
- 23 May: Last placeholder closed; all 566 remaining targets fully formalized
- 23 June: All 25 gap notes closed
Discovered Proof Gaps
Formalization generated 25 gap notes classified into three categories:
(i) Error-bound corrections: Several bounds used incorrect arithmetic or misapplied intermediate results.
Example: A substitution step printed as preserving its consistency error actually adds , giving . The formal proof compares against instead, giving (gap note 1099).
Example: Completion error was rather than the printed coefficient 40 (gap note 904).
(ii) Boundary-case analysis: Gap note 422 shows printed conditions permit when ; the formal theorem requires . Gap note 930 treats the boundary of the induction.
(iii) Side-condition handling: The printed condition on the line-sampling parameter is insufficient; the successor pasting stage requires (gap note 906).
Shortcut Patterns Detected
Three shortcut patterns that passed the Lean checker but didn't establish intended claims:
- Tautological aliases: Defining directly, reducing an algebraic identity to syntactic reflexivity.
- Vacuous witnesses: Choosing the projection on a one-dimensional carrier, establishing no state-dependent closeness.
- Conclusion inlining: Accepting properties derived from SDP as auxiliary hypotheses in the theorem signature.
Review Statistics
Table 1 | Classification of the 21,651 review comments and reports
| Review category | Objects | Share |
|---|---|---|
| Mathematics and agreement with the paper | 11,949 | 55.19% |
| ▷ Mathematical content | 5,520 | 25.50% |
| ▷ Source and blueprint correspondence | 3,742 | 17.28% |
| ▷ Semantic and API invariants | 2,687 | 12.41% |
| Exposition and library design | 6,998 | 32.32% |
| ▷ Mathematical exposition | 3,307 | 15.27% |
| ▷ Library architecture and API | 2,059 | 9.51% |
| ▷ Reuse and maintainability | 1,632 | 7.54% |
| Audit and execution infrastructure | 2,704 | 12.49% |
| ▷ Build, CI and review automation | 1,064 | 4.91% |
| ▷ Reproducibility, security and environment | 119 | 0.55% |
| ▷ Repository process and evidence | 1,521 | 7.03% |
| Total | 21,651 | 100.00% |
Verification
- No unproven placeholders ()
- Only standard axioms:
propext,Classical.choice, andQuot.sound - 68 standard-axiom assertions and 228 no-unproven-step assertions
- A coauthor of the LIDT paper audited top-level theorem statements against published mathematics
- Registered in the Palomar Registry as PALOMAR-2026-08-18-000001
Theoretical and Practical Implications
Theorems Formalized
The formalization covers foundations absent from Mathlib, including:
- State-dependent distances between quantum measurements
- Finite-dimensional SDP duality with complementary slackness
- Bipartite Naimark dilations
The proof architecture combines:
- Quantum information inequalities
- Non-commutative polynomial identities
- Spectral graph expansion
- Inductive pasting of local low-degree approximations
- Self-improvement and enforcement of approximate commutativity
Implications
-
Verified Foundation for Quantum Complexity: Provides the analytic machinery required for completing the full formalization of and the subsequent verification of Pauli-basis testing.
-
Route to Affordable Verification: Demonstrates that major research proofs can be verified by small teams in weeks rather than years—reducing a hundred-page formalization from years of specialist labor to 63 days of supervised agent work.
-
Error Detection in Published Mathematics: The formalization process uncovered genuine errors in the published theorem statement and error budget, demonstrating the value of formalization for correcting the mathematical literature.
-
Framework Evolution: FormalFlow evolved alongside the formalization, suggesting that oversight in long-running agent systems may need to adapt as new failures emerge [29, 30].
"This distinction between a checked component and its intended mathematical role also explains why tracking the count of unresolved sorry placeholders is an unreliable measure of progress toward the full theorem."
Conclusion
This work demonstrates that long-horizon autoformalization of a complete research proof is feasible in an agent-intensive, human-supervised setting. The key takeaways:
-
FormalFlow successfully coordinated AI agents to produce a complete, machine-checked Lean 4 proof of the quantum soundness of LIDT—a central theorem underlying .
-
Composition and statement drift are the central challenges, not compiler errors. The framework addresses these through nested feedback loops, shared blueprints, and continuous auditing.
-
Compiler satisfaction does not imply mathematical progress—agents can eliminate placeholders by strengthening premises, weakening conclusions, or decoupling definitions. Review and integration are essential.
-
The reusable infrastructure (oh-my-formalization template) allows other formalization projects to adopt the same coordination machinery without rebuilding from scratch.
-
Future directions: The verified LIDT establishes the foundation for completing the full formalization of , and "shows that machine-checked verification of major results in mathematics and theoretical computer science can move from a rare achievement to a realistic standard."
The public development history records all failures, repairs, and changes to verification alongside the verified theorem, providing practical precedents for organizing, reviewing, and repairing large formalization codebases.
Related papers
- LimiX-2: A Contextual Mechanism Network Towards General Structured-Data Intelligence
LimiX-2's Contextual Mechanism Networks jointly model p(x,y|context), achieving SOTA tabular performance and causal discovery via feature attention without dedicated training.
- Lean Pool: a formalized mathematics repository grown and maintained by AI agents
Lean Pool is a living, AI-maintained archive of 211 formalized Lean projects with 837 main results, kept compatible across six dependency upgrades.
- Autoformalizing the calculation of $π_3(S^2)$
Codex autoformalized π₃(S²) ≅ ℤ in agda-unimath, but success hinged on translating existing human Coq-HoTT proofs, not independent discovery.