← All papers
First page of Growing an Agent/Prover Interface: Evolutionary Tool Design for Cost-Efficient Theorem Proving in Rocq and Lean

Growing an Agent/Prover Interface: Evolutionary Tool Design for Cost-Efficient Theorem Proving in Rocq and Lean

Jules Viennot, Guillaume Baudart, Marc Lelarge

cs.AI Sep 30, 2026 · v1
Ports the Rocq-evolved MCP tools to Lean (lean-mcp-evolve) and evaluates them on a PutnamBench subset against lean-lsp-mcp.
Recent achievements in AI-assisted mathematics require intensive interaction of agents with proof assistants to generate machine-checked proof certificates. Agents interact with proof assistants such as Rocq or Lean through an interface that controls what the agent receives from the prover and the cost of these interactions. Today, these interfaces are adapted from tools designed for humans and not optimized for agents. We propose an evolutionary method where a frontier model incrementally proposes new features and only keeps the ones that improve the overall performance of smaller models. We demonstrate the effectiveness of our method by growing, on a curated set of mathematical problems, \rme, a new MCP server for the Rocq prover. On the held-out test split of miniF2F-Rocq, an agent equipped with \rme outperforms both the baseline that only exposes the Rocq compiler and an established MCP server, across four models from two families, in success rate, cost per solve, and time per solve. Although evolved for Rocq, the resulting server transfers to Lean, improving cost and time per solve on a subset of PutnamBench. We release \rme and its port to Lean.

Agents interact with proof assistants like Rocq and Lean through interfaces adapted from human-oriented tools rather than designed for agents. These interfaces drive both the cost and the success of AI-assisted proving.

An evolutionary process starts from an MCP server that exposes only the Rocq compiler. At each step, a frontier orchestrator model (Claude Fable 5) proposes one feature, and the feature is kept only if it improves smaller tester models' accuracy, with cost and wall time as secondary objectives. The result is rocq-mcp-evolve, written in OCaml on the Rocq runtime. Its tools are also ported to Lean as lean-mcp-evolve.

Figure 2: A step of the evolutionary process. The mutation designed by the orchestrator is denoted by the dark red color. The purple dotted box represents rocq-mcp-evolve , the blue dotted box represents the evaluation of the mutation. The light gray circle shows the process is iterative: a new step starts at the end of the previous one.

On the miniF2F-Rocq test split, rocq-mcp-evolve outperforms the compiler-only control and the established rocq-mcp server in accuracy, cost, and wall time across four models. It also does better on project-scale autoformalization tasks. On a PutnamBench subset, lean-mcp-evolve lowers cost and time per solve relative to lean-lsp-mcp, but its solve rate is lower.

MCP serverAccuracyCost ($)Wall time (s)
control.33.1282
lean-lsp-mcp.42.1486
lean-mcp-evolve.33.1164
Lean transfer on a PutnamBench subset (overall accuracy, cost per solve, wall time per solve)