TRANSMISSION // 2611.36985v1
How AI Shrunk Lean Proofs for Less Checking Cost
Source published
An AI agent rewrote existing Lean proofs to reduce their length and checking effort, keeping only compiler-verified improvements that worked across required toolchains.

Can an AI make formal proofs shorter and cheaper to check without changing what they prove? In a 60-problem Lean benchmark, a budget-limited agent searched for rewrites and let the compiler judge each one.
Lean is a programming language and proof assistant: people can state mathematical claims in it, then have software check whether a proposed proof follows the rules. But two proofs of the same claim may differ greatly in length and in the work Lean needs to check them. This paper asks whether an AI agent can improve those measures while preserving correctness and compatibility across Lean versions, under a strict API budget.
The authors entered the closed track of the Lean Refactor Arena, which supplied 60 existing proofs drawn from Lean software projects and PutnamBench. The scoring system rewarded three things: fewer Lean-lexer tokens in the proof, fewer “heartbeats” spent elaborating it, and successful compilation on every additional toolchain listed for that problem. Heartbeats are Lean’s measure of computational work during checking; they are not elapsed time. The theorem statements were meant to remain unchanged, and failed or disallowed submissions could not earn a score.
The system treated proof improvement as a measured search. A frontier model, gpt-6.1-sol, proposed edits to proof bodies. Lean metaprograms counted tokens, measured heartbeats, and provided information such as tactic goals and per-step costs. Candidates that compiled on the default toolchain were checked for compatibility, and the system kept a candidate only if its full score strictly improved on the best so far. A deterministic optimizer then tried local, compiler-verified rewrites, such as deleting unnecessary steps or simplifying tactic blocks. A separate judging process rechecked the final proofs using a reproduction of the arena’s scoring procedure.
This setup matters because shorter text is not automatically cheaper to check. A compact tactic can require more work than a longer proof, and a rewrite that works in one Lean version may fail in another. The authors therefore measured both length and checking cost with Lean itself rather than estimating them from the text. They also report that the final benchmark did not provide reference heartbeat values, so their heartbeat reductions use the team’s own measurements of the original proofs.
On the final benchmark, the entry received an official combined score of 87.88. Its proofs were, on average, 80.2% shorter and required 83.4% fewer heartbeats by the authors’ measurements; all 67 listed cross-toolchain checks passed. The system spent an average of $2.83 in API costs per problem, with a maximum of $2.97, below the $3 cap. The team’s own reproduced judge gave a slightly different combined score, 87.99. The paper attributes that small gap to a scoring-count discrepancy, including a case where the arena counted a single token twice.
The results were not uniform across problem types. PutnamBench proofs compressed especially well, while PhysLib scored lower; three very short decide +kernel proofs remained difficult to improve because their checking cost came from kernel reduction. A representative rewrite reduced one Putnam proof from 1,754 tokens to 27 and lowered its measured heartbeat count, after the agent found a relevant Mathlib theorem. That example illustrates the role of library knowledge, but it does not mean every proof can be shortened so dramatically.
The authors’ experiments suggest that, in their setup, the number of verified candidates bought with the API budget mattered more than adding more information or imposing more structure on the search. A cheaper model per turn, spending more of the available allowance, and lower-cost Flex service each improved scores in the reported tests. Several alternatives—including forced-diversity phases and a planner-worker split—did not help and sometimes reduced scores. These are findings from this system and benchmark, not a general rule about AI agents.
There are important limits. The full final benchmark was run once with the submitted configuration, and the authors say provider behavior and sampling make exact reproduction unlikely; warm-up runs and development experiments offer some evidence of variation, but not a broad estimate across independent systems. The final set has only 60 problems, and most development decisions used a 15-problem warm-up set, 13 of whose problems reappeared in the final benchmark. The paper says it cannot separate possible warm-up exposure from differences in corpus difficulty. It also notes that the remaining weakness is proof length: many final tokens were lemma names or structural choices that local polishing did not remove.
The work is a preprint describing a competition entry, not evidence that proof compression improves mathematical understanding or software performance in general. Its API-cost accounting excludes the cloud compute used for the compiler farm, and reproducing the run requires substantial infrastructure and access to the named models. The reported compiler checks are a strong check of the submitted Lean proofs under the benchmark’s conditions; they do not establish that the approach will work equally well on other projects or budgets.
- Lean 4
- formal verification
- AI proof refactoring
- theorem proving
- compiler feedback
- Lean Refactor Arena
Reviewed cross-references
These connections were reviewed by a model, not independently fact-checked by a human. Similarity does not imply agreement; consult the original papers and the evidence below.
How AI Refactored Lean Proofs Without Changing Their Claims
Shared method: Both papers use Lean-checked candidate proof rewrites and retain verified improvements, followed by deterministic cleanup. Their implementations and reported scores differ, so this is a shared workflow pattern, not a direct performance comparison.
Model review: · openai-codex/gpt-6-luna
Evidence and provenance
Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.
2611.36985v1 — Original paper
Excerpt reference:
static/papers/2611.36985v1.md:13-74
Basis: Paper text
Source file SHA-256:fcd03ef9d99920e637041f475af2c897318b3b1f3c1cef150e7bff06686a93232611.31762v1 — Original paper
Excerpt reference:
static/papers/2611.31762v1.md:13-98
Basis: Paper text
Source file SHA-256:bc462e1216bb01263394d2da735706a82133e84929d1683ea7e90e62173ae6c82611.31762v1 — Original paper
Excerpt reference:
static/papers/2611.31762v1.md:99-159
Basis: Paper text
Source file SHA-256:bc462e1216bb01263394d2da735706a82133e84929d1683ea7e90e62173ae6c8
VERITAS Turns Lean’s Errors Into Clues for AI Proof Search
Shared method: Both approaches use compiler feedback during iterative proof search: the refactoring paper measures and keeps improving complete replacements, while VERITAS feeds Lean errors and verified partial proofs into search. They address different tasks—optimizing existing proofs versus proving benchmark theorems—so their outcomes are not directly comparable.
Model review: · openai-codex/gpt-6-luna
Evidence and provenance
Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.
2611.36985v1 — Original paper
Excerpt reference:
static/papers/2611.36985v1.md:13-74
Basis: Paper text
Source file SHA-256:fcd03ef9d99920e637041f475af2c897318b3b1f3c1cef150e7bff06686a93232606.19399v2 — Original paper
Excerpt reference:
static/papers/2606.19399v2.md:13-89
Basis: Paper text
Source file SHA-256:eb772593686ad591531d520abf95fccbe3e54110eb44b2d7c2a9252a10ace5532606.19399v2 — Original paper
Excerpt reference:
static/papers/2606.19399v2.md:90-188
Basis: Paper text
Source file SHA-256:eb772593686ad591531d520abf95fccbe3e54110eb44b2d7c2a9252a10ace553
The Hidden Work Behind AI Proofs
Shared method: Both papers use Lean acceptance to verify generated proof work, but the tasks differ substantially: AutoformBench requires building missing formal infrastructure for advanced mathematics, whereas the refactoring study shortens already-compiling proofs under a cost objective. The shared verifier does not establish comparable capabilities or results.
Model review: · openai-codex/gpt-6-luna
Evidence and provenance
Selected excerpts, not complete papers. PDF extraction can omit figures or damage equations, tables and reading order; sources may be preprints.
2611.36985v1 — Original paper
Excerpt reference:
static/papers/2611.36985v1.md:13-74
Basis: Paper text
Source file SHA-256:fcd03ef9d99920e637041f475af2c897318b3b1f3c1cef150e7bff06686a93232611.33165v1 — Original paper
Excerpt reference:
static/papers/2611.33165v1.md:121-176
Basis: Paper text
Source file SHA-256:f75c12433bb9cdb281511adb3747ec2d561e1f9b806e86d823c763ee81aa3d0d2611.33165v1 — Original paper
Excerpt reference:
static/papers/2611.33165v1.md:257-311
Basis: Paper text
Source file SHA-256:f75c12433bb9cdb281511adb3747ec2d561e1f9b806e86d823c763ee81aa3d0d
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
How AI Refactored Lean Proofs Without Changing Their Claims
Source published
Shared keywords: formal verification, lean refactor arena
How AI Agents Build Formal Proofs for Complex Chips
Source published
Shared keywords: formal verification, theorem proving
How a Budgeted AI Pipeline Refactored Lean Proofs
Source published
Shared keywords: formal verification
When coding agents must prove their work
Source published
Shared keywords: formal verification, theorem proving
When AI Learns from Math’s Lean Translations
Source published
Shared keywords: theorem proving