Compile-Gated Lean Proof Refactoring with Enterprise Agent Practices: A Model per Step under a US\$3 Cap, Followed by Programmatic Rewrite Rules
The Lean Refactor Arena asks entrants to produce better proofs of 60 existing Lean 4 theorems drawn from ArkLib, CSLib, LeanPool, PhysLib, Strata and PutnamBench/Mathlib. Better means fewer tokens, fewer heartbeats, and compiling unchanged on every listed toolchain. The closed track caps spending at US$3 per problem at list prices.
A harness runs budgeted agent sessions with a different hosted model per step: GPT-6.1 Sol for early sessions, GPT-6.1 Terra for later sessions, and Gemini 4 Argon for review and repair. Every candidate passes a gate that reads it on a local copy of the Arena meter, back to back with the proof it would replace, across all toolchains. Knowledge from development runs is shipped as model-free, compiler-checked rewrite rules rather than prompt text. Examples include projection paths, leading-dot constructors, and grind?/simp? closer substitution. Every call is priced against the cap before sending and recorded.
The entry raised the 60-problem score from 33.33 (reference proofs) to 86.31, placing 8th at the deadline (top score 92.57), at US$166.33 total (mean US$2.772 per problem). Most of the gain came from the first Sol stage. Rule passes added about 0.9 points before the release, plus in-sample gains of about 0.26 and 0.30 from passes added after it. Board scores stayed within -0.063 to +0.015 points of the local meter's prediction.
| Stage | Run 1 | Run 2 | Run 3 |
|---|---|---|---|
| Reference proof (score) | 33.33 | 33.33 | 33.33 |
| Sessions to $1.25 (Sol) | 48.28 | 48.13 | 47.81 |
| End of run (our meter) | 85.709 | 85.785 | 86.009 |
| Board | 85.66 | 85.80 | 86.31 |
