TL;DR
General-purpose LLMs are surprisingly great at sketching out clever mathematical arguments in plain English, yet notoriously terrible at writing rigorous, machine-checkable proofs in formal languages like Lean. This paper introduces LEAP, an agentic framework that lets standard foundation models prove Olympiad- and research-level theorems—without any specialized fine-tuning—simply by teaching them to plan, decompose problems, and iterate like human mathematicians.
What Problem Does This Paper Address?
Checking complex mathematical proofs in natural language is exhausting and error-prone. When Thomas Hales proved the Kepler conjecture in 2005, referees spent four years reviewing it only to declare themselves "99% certain" it was right, sparking a decade-long effort to verify it by computer.
Formal languages like Lean solve this verification bottleneck: if a proof compiles, a strict software kernel guarantees it is 100% mathematically sound. However, getting AI to write valid Lean code is brutally hard. Because general-purpose LLMs usually fail when asked to spit out a complete formal proof in one go, the prevailing wisdom has been that we must train specialized, fine-tuned prover models on massive formal math datasets. The authors challenge this assumption, asking: is the bottleneck really that general LLMs don't understand formal math, or is it just that nobody—human or AI—writes complex proofs in a single pass?
Methods
Inspired by the "Lean Blueprint" workflow human mathematicians use to coordinate massive projects (like formalizing Fermat’s Last Theorem), LEAP (LLM-in-Lean Environment Agentic Prover) wraps an off-the-shelf foundation model (Gemini 3.1 Pro) in a structured planning loop.
Instead of generating a monolithic wall of code, LEAP relies on three tightly coupled ideas:
- Interleaved Informal–Formal Planning: Given a goal, LEAP first attempts a direct proof—writing a natural-language argument, translating it to Lean, and using compiler errors and a semantic search tool (
LeanSearch) to iteratively fix bugs. If that fails, it shifts to decomposition: drafting an informal roadmap ("blueprint") of intermediate helper theorems (lemmas) and translating that into a Lean proof sketch where only the new subgoals usesorryplaceholders (temporary "IOUs" accepted by the compiler). - Hierarchical Memoization via an AND–OR DAG: Rather than exploring isolated search trees, LEAP stores its evolving plan as a Directed Acyclic Graph (DAG). OR nodes represent open goals (solvable by any valid strategy), while AND nodes represent decompositions (requiring all child lemmas to be proved). Because lemmas are stored globally, different branches can reuse proven results without rediscovering them, and the agent can even propose "anticipatory" helper lemmas that might come in handy downstream.
- Dual Verification: The Lean compiler checks syntax and type-safety, while a separate LLM Reviewer acts as a sanity check on decompositions. It rejects syntactically valid sketches that are mathematically circular or fail to actually make the problem simpler.
Datasets
Because standard benchmarks like MiniF2F are increasingly saturated, the authors evaluate LEAP—without any task-specific training—on two tough testbeds and research-level case studies:
- Putnam 2025: All 12 problems from the notoriously difficult 2025 undergraduate competition (where the human median score was just 2 out of 120).
- Lean-IMO-Bench (New): Introduced by the authors, this dataset manually formalizes 60 expert-vetted Olympiad problems (30 Basic, 30 Advanced) across algebra, combinatorics, geometry, and number theory. Unlike undergraduate benchmarks testing broad textbook knowledge, these problems have elementary setups that demand deep, non-routine, multi-step insights.
Key Insights and Ideas
- It’s the workflow, not the weights: Even when Gemini 3.1 Pro is handed a correct natural-language proof on Lean-IMO-Bench, its one-shot translation success barely budges. Yet give it 20 turns of Lean compiler feedback, and its Basic solve rate nearly doubles (from 20.0% to 36.6%), whereas a specialized prover model (
Goedel-Prover-V2-32B) actually degrades under iterative feedback. General LLMs shine when allowed to read errors, reason over long contexts, and self-correct. - Compilers check validity, not progress: Without the LLM Reviewer, the agent falls into a clever trap: unfolding definitions into an intermediate lemma and folding them right back into a subgoal identical to the original theorem. Lean happily compiles this—it's logically valid!—causing the agent to loop until its budget runs out. Semantic LLM review prunes these dead ends early.
- Global memory pays off on hard problems: Swapping a naive tree search for the shared AND–OR DAG boosts Advanced problem accuracy from 40.0% to 56.7%, proving that cross-branch lemma reuse is critical for long-horizon math.
Key Results
- Perfect Putnam Score: LEAP solves 12/12 (100%) of the Putnam 2025 problems, matching frontier agentic systems (Axiom and Numina-Lean-Agent) while requiring substantially less aggregate runtime (822 minutes vs. 2,682 and 3,889 minutes, respectively). Meanwhile, one-shot baselines solve 0%.
- Crushing Lean-IMO-Bench: LEAP lifts general-purpose LLM solve rates from under 10% (one-shot) to 70% overall (83.3% Basic, 56.7% Advanced), outperforming specialized IMO-gold-level systems like Aristotle (48% overall) and achieving a 100% solve rate in both Algebra and Number Theory across all difficulty tiers.
- Research-Level Math: LEAP autonomously synthesized over 5,000 lines of verified Lean 4 code to formalize a dense, 20-page combinatorial subproblem for Donald Knuth’s even-order Cayley graph Hamiltonian decomposition, and formally verified Erdős Problem 457.
Limitations and Future Work
- Olympiad Geometry remains a wall: Across nearly all evaluated methods, Geometry performance hovers near zero (LEAP scores 16.7% Basic, 12.5% Advanced), reflecting the notorious difficulty of expressing synthetic Euclidean geometry in Lean without specialized domain libraries.
- Smarter Search & Hybrid Models: LEAP currently navigates its DAG using a basic depth-first search with backtracking. As decompositions grow deeper, the search space explodes; future work aims to use LLMs as heuristic value functions to guide tree exploration, as well as pairing general foundation models (as high-level architects) with small, fine-tuned provers (as fast local step-generators).
Summary updated