Mutating the Mathematician: Evolving Lean Workflows via Coevolution
Self-Modifying Lean Proof Agents with Verifier-Grounded Benchmark Coevolution
This paper introduces a self-evolving Lean proof agent that improves its own mathematical workflows, tools, and proof-context representations through code-level modification. By pairing the agent with a "champion-driven" coevolving benchmark that hardens difficulty as the agent improves, the system achieves a 45.1% solve rate on the miniF2F test split, a significant jump from the 12.7% seed baseline.
TL;DR
In formal mathematics, the how of proving is just as important as the what. This paper shifts focus from making models smarter to making workflows more adaptable. By allowing an agent to rewrite its own code and tools while being strictly judged by the Lean compiler, and by making the math problems get harder as the agent gets smarter, the researchers achieved a massive performance leap in formal theorem proving without manual prompt engineering.
The Workflow Bottleneck: Why Manual Design Fails
Most AI mathematicians (like Lean-oriented LLMs) operate within a rigid, hand-designed framework: "First decompose into lemmas, then try tactics, then repair." But is this always the optimal path? As proof obligations become more complex (e.g., IMO-level problems), these static workflows often break.
The authors argue that the "agentic workflow"—how the model uses tools, handles compiler errors, and structures its internal "scratchpad"—should be the subject of evolution, not just the model weights.
The Solution: Coevolution & Grounded Evolution
The researchers introduced two breakthrough mechanisms to prevent the agent from getting stuck or "cheating":
- Champion-Driven Coevolution: Instead of a fixed test, the benchmark is a "living" curriculum. When the best agent (the "champion") masters 70% of a level, the system retires those problems and swaps in harder ones (e.g., from PutnamBench).
- The Verifier-Grounded Loop: Since the agent can modify its own code, it could theoretically "write itself a high score." To prevent this, a fixed, trusted runtime re-verifies every proof in a clean Lean environment. If Lean doesn't say "Proof Verified," the modification is discarded.

Methodology: How an Agent Rewrites Itself
The agent evolves through a "Hyperagent" approach. It manages a mutable workspace that includes:
- Python Logic: The actual code that calls the LLM.
- Tools: Search functions, lemma checkers, and error parsers.
- Prompts: The strategies used to talk to the underlying model.
As generations progress, the agent discovered that compact repair loops (iteratively fixing proofs based on Lean's error messages) were more effective than complex "decomposition" strategies, which proved too fragile to assemble.
The Mastery-Throttled Update
To keep scores comparable while the benchmark hardens, the authors used Single-Anchor Recalibration. If the champion scores 60% on an easy set but only 40% on the new harder set, its "difficulty coefficient" increases, effectively "scaling" its score to reflect the increased complexity.
Results: Breaking the 40% Barrier
The results confirm that the "moving target" of a coevolving benchmark is superior to a static one.
| Generation | Benchmark Difficulty | Held-out Solve Rate (miniF2F) |
|---|---|---|
| Seed (Gen 0) | 1.00 | 12.7% |
| Gen 5 | 1.40 | 29.9% |
| Gen 15 | 3.17 | 45.1% |
The "Fixed Benchmark" baseline hit a plateau at 32.0%. Without new challenges, the evolution ran out of "selection pressure," resulting in local optimizations that didn't generalize.
Deep Insight: Repair vs. Decomposition
Interestingly, the "evolved" winner (Agent c144) favored a Repair-Centered workflow. While "Decomposition" (breaking a theorem into a tree of sub-lemmas) sounds more "mathematical," the agent found it difficult to re-assemble those parts into a final proof. The evolved agent instead focused on building better tools to detect hallucinated lemma names and using Lean's compiler feedback to perform "local surgery" on proof scripts.
Critical Analysis & Future Outlook
While 45.1% is a record for a self-evolved agent, it still trails behind elite hand-designed systems like Goedel-Architect (99.2%). This gap suggests that:
- Assembly is Hard: Agents need better "glue logic" to connect verified sub-lemmas.
- Selection Objective: Currently, agents are only rewarded for the final proof. If we explicitly reward "interpretable mathematical trees," we might see more sophisticated reasoning structures emerge.
Takeaway: This work proves that we don't need to hand-code the "logic" of an AI agent. If we provide a rigorous environment (Lean) and a challenging curriculum, the agent can "invent" its own path to mathematical discovery.
