LeanFlow: A Case Study in Workflow-Driven Lean Autoformalization
Verifier-in-the-loop systems can produce large Lean artifacts from mathematical documents. It is unclear which runtime mechanisms affect completion, auditability, and efficiency when a whole paper is formalized into a buildable project.
LeanFlow runs a deterministic source preflight and builds a blueprint mapping source spans to planned Lean declarations. A statement/source gate checks faithfulness before proof search. A programmatic workflow manager then assigns one proof obligation at a time, keeps failed-attempt memory, and accepts an edit only after Lean/Lake verification and a hygiene scan for sorry and axioms. LeanProbe supplies low-latency cached checks, and ablations remove the queue and swap the full toolset for CLI-only access, using Kimi-K2.6 and GPT-5.5.
With Kimi-K2.6, the full workflow completed both previously unformalized papers (a number-theory paper on Pythagorean polynomials and a measure-theory paper on Cramer–Wold) within the 2000-call budget, while no-queue variants exhausted the budget. With GPT-5.5, all document-level variants completed, and the full workflow had the lowest or tied-lowest input-token cost. LeanFlow reached 75.7% BEq+ on the PFR slice of RLM25 and solved all five ICML 2026 AI for Math TCS challenge projects.
| Source | Workflow | Outcome | Calls | In tok. |
|---|---|---|---|---|
| Pythagorean | Full | success | 1043 | 46.9M |
| Pythagorean | NoQ+Tools | failure | 2000 | 160.2M |
| Cramer–Wold | Full | success | 1278 | 66.0M |
| Cramer–Wold | NoQ+Tools | failure | 2000 | 127.8M |
| Workflow | Proof succ. | BEq | BEq+ | Calls |
|---|---|---|---|---|
| LeanFlow | 81.2% | 70.8% | 75.7% | 3541 |
| terminal-only agent | 80.6% | 68.1% | 72.9% | 4053 |
