cs.LGMar 20, 2026
SavePutnam 2025 Problems in Rocq using Opus 4.6 and Rocq-MCP
Organizations: IRIF, Université Paris Cité, Inria, CNRS · DI ENS, PSL University, Inria · PRGM DEV
Abstract
We report on an experiment in which Claude Opus~4.6, equipped with a suite of Model Context Protocol (MCP) tools for the Rocq proof assistant, autonomously proved 10 of 12 problems from the 2025 Putnam Mathematical Competition. The MCP tools, designed with Claude by analyzing logs from a prior experiment on miniF2F-Rocq, encode a "compile-first, interactive-fallback" strategy. Running on an isolated VM with no internet access, the agent deployed 141 subagents over 17.7 hours of active compute (51.6h wall-clock), consuming approximately 1.9 billion tokens. All proofs are publicly available.
Figures & tables
| Problem | Status | Lines | Time | Axioms | Domain |
|---|---|---|---|---|---|
| A1 | ✓ | 305 | 51m | classical | Number theory |
| A2 | ✓ | 308 | 1h 33m | Reals | Real analysis |
| A3 | ✓ | 110 | 1h 07m | None | Combinatorics |
| A4 | ✓ | 531 | 4h 58m | Reals | Linear algebra |
| A5 | ✗ | 2294 | – | – | Enum. combinatorics |
| A6 | ✓ | 897 | 19h 56m | None | Number theory |
Table 1: Per-problem results. Lines = lines of Rocq code. Time = wall-clock from experiment start to successful compilation. ✓ = exploited a loophole in the A3 formalization (later fixed by the agent). Bold None = fully constructive (zero axioms).
Figure 1: Cumulative problems solved over wall-clock time. Solid green segments indicate active compute; dashed red segments indicate inactivity (API rate limits or user absence). Shaded regions mark the 7 detected gaps ( 30 min). The first 4 problems were solved within 2 hours; B5 was not solved until 46 hours into the experiment.
Figure 2: Cumulative problems solved vs. cumulative tokens consumed (log scale). The first 5 problems required 100M tokens; the last 5 required 10 more, illustrating sharp diminishing returns on harder problems.
| Tool | Calls | Role |
|---|---|---|
| rocq_compile | 3,100 | Compilation |
| rocq_verify | 120 | Axiom checking |
| rocq_auto_solve | 20 | Quick automation |
| rocq_query | 80 | Library search |
| rocq_step | 450 | Interactive debug |
Table 2: MCP tool usage.
| Role | Agents | Tokens | Tool calls |
|---|---|---|---|
| Lemma Prover | 55 | 738M | 4,845 |
| Bug Fixer | 36 | 538M | 3,409 |
| General | 21 | 253M | 1,588 |
| Verifier | 15 | 65M | 639 |
| Proof Completer | 13 | 185M | 1,257 |
| Compiler | 1 | 1M | 14 |
Table 3: Subagent roles. Roles are inferred from each agent’s initial prompt.
Figure 3: Subagent efficiency. Each bubble represents one subagent (141 total, filtered to those with 10 tool calls). Position: tokens consumed vs. tool calls (both log scale). Size: duration. Color: problem assignment.
| Category | Tokens | % | Cost | % Cost |
|---|---|---|---|---|
| Input | 1M | 0.0% | $1 | 0.1% |
| Output | 16M | 0.9% | $406 | 23.1% |
| Cache creation | 72M | 3.8% | $448 | 25.5% |
| Cache read | 1,809M | 95.4% | $905 | 51.4% |
| Total | 1,897M | 100% | $1,760 | 100% |
Table 4: Token economics.
| Group | Problems | Active time | Est. tokens |
|---|---|---|---|
| Easy (A1, A2, A3, B4) | 4 | 2h | 100M |
| Medium (A4, B1, B2, B3) | 4 | 5h | 400M |
| Hard (A6, B5) | 2 | 11h | 600M |
| Unsolved (A5, B6) | 2 | – | 800M |
Table 5: Scaling behavior by problem difficulty. The unsolved problems consumed the most resources.
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, ROCQ-MCP-EVOLVE, a new MCP server for the Rocq prover. On the held-out test split of miniF2F-Rocq, an agent equipped with ROCQ-MCP-EVOLVE 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 ROCQ-MCP-EVOLVE and its port to Lean.
SCOPE: Certified Theorem Proving with a Language Model as the Policy Planner
In proof assistants such as Lean, a generated proof must pass machine compilation checks, so evaluation needs no human scoring. Direct generation fails on multi-step numeric propositions: a proof is valid only if every content integer is correct, so the pass rate is bounded by the k-th power of the per-integer accuracy. Controlled corruption across 2,617 reference proofs confirms this power law. SCOPE (State-Conditioned Operator Planning and Execution) enforces the natural division of labor: the model plans over an operator vocabulary, a symbolic engine executes the numerics, and a compiler renders the proof. On a 218-problem suite it certifies 191/218 (87.6%) with a 135M backbone; the 7B DeepSeek-Prover-V1.5-RL certifies 18/218 at 27.5 times the tokens and 37.5 times the wall-clock, and DeepSeek-Prover-V2-7B certifies zero on a bidirectional dual suite. Multi-step thinking costs 6.12 discrete decision actions per problem and produces no natural-language thinking text. Replacing the lagged engine state in the decision frame with the current one lifts the pass rate from 117/218 to 191/218, while up-weighting the chain-end loss hurts. On the public Lean-Workbook library, 2,132 of 3,536 gradeable admissible problems certify (60.29%) with zero regression on the main suite. All readings come from a version-frozen review with independent rechecks and reverse verification. Restricting free generation and keeping decision-time information visible is a more direct route than enlarging the model.
PrologMCP: A Standardized Prolog Tool Interface for LLM Agents
Frontier reasoning-tuned language models still fail on deductive tasks at depth, and the cost of improved performance through extended internal reasoning scales poorly. Symbolic delegation offers a complementary route: a language model translates the problem, while a solver performs the inference. However, current autoformalization pipelines for logic programming are typically bespoke integrations tied to particular tasks or agents. We introduce PrologMCP, a task-agnostic, open-source server that exposes Prolog as a stateful tool through the Model Context Protocol (MCP). Its compact tool interface, structured error reporting, and per-session isolation make the translate-run-inspect-repair loop a reusable primitive for MCP-capable agents. We evaluate a formalizer agent enhanced with PrologMCP against standard and reasoning LLMs (Claude Sonnet 4.6, GPT-4.1, and o4-mini) on two subsets of PARARULE-Plus: a general-purpose sample and a more challenging one targeting a specific failure mode of natural-language reasoning. On the general sample, the formalizer matches or exceeds reasoning LLMs (accuracy 1.00 vs.\ 1.00 / 0.998), with the largest gains over standard models (0.762 for GPT-4.1). On the challenging subset, the formalizer remains near-perfect (1.00 / 0.99) while reasoning LLMs drop to 0.95 / 0.94. These results suggest that delegating inference to Prolog via MCP is a robust and inspectable alternative to extended natural-language reasoning.