TRANSMISSION // 2611.41820v1

An AI Agent Rewrites Lean Proofs Under a 48-Hour Clock

Source published

A self-hosted agent used an open-weight model and Lean’s checker to shorten proofs and reduce checking work in a 60-problem benchmark. The authors report a 79.25 Combined score, though two proofs did not pass every required Lean version.

AI-generated conceptual illustration for An AI Agent Rewrites Lean Proofs Under a 48-Hour Clock
AI-generated conceptual illustration; not documentary evidence.

Can an AI system make existing mathematical proofs shorter and cheaper to check without changing their theorems? This competition entry combines an open-weight language model, proof-editing tools and Lean’s formal checker. The results are promising, but the final configuration was evaluated in one run, and the benchmark covers a limited set of tasks.

Rewriting proofs, not changing theorems

Formal proof assistants such as Lean let mathematicians encode a theorem and a proof in a language that software can check. Proofs of the same statement can differ: one may use fewer source tokens, or require less work from Lean’s elaborator—the component that processes proof text.

The authors describe an entry in the open track of the Lean Refactor Arena. The challenge was to replace existing Lean 4 proofs while keeping theorem statements unchanged, reducing proof length and checking work, and maintaining compatibility with specified Lean versions. The paper presents a general agent system, not a model trained specifically for proof refactoring. Its prompts contained no proof content written for particular problems.

A model proposes; Lean checks

The system ran one tool-using agent per problem, with all sessions sharing a server. Its sole open-weight model was Qwen3.8-Flash-Next in an FP8 release, without fine-tuning, served through vLLM on four A100 80 GB GPUs. CPUs handled Lean compilation, scoring and model-free cleanup.

Agents started from each benchmark problem’s reference proof. They could inspect Lean goals and declarations, search project libraries, edit proof text and compile proposed replacements. Every valid candidate was saved and scored. The runner organized work into discovery, to explore different approaches, and refinement, to improve promising candidates. It periodically condensed long conversations into checkpoints. At the end, model-free passes attempted further improvements.

For final selection, the runner ranked candidates by their score and checked them on the problem’s other listed Lean versions as needed. It continued until no unchecked candidate could beat the best one that had passed all required versions. This means not every saved candidate received checks across every version.

Lean’s kernel provides a rigorous check that a proof is accepted for its formal statement in a particular project and toolchain. That does not establish that the encoded statement captures every intended real-world interpretation. Nor does kernel acceptance mean every submitted proof passed every required toolchain: two did not.

Results—and a demanding systems problem

The submitted run covered 60 final problems and finished within the 48-hour limit, including setup. The authors report 47.8 hours from the first setup step through selection. The official Combined score was 79.25. The paper reports a 62.48% reduction in proof length and a 76.96% reduction in heartbeats, Lean’s measure of elaboration work. It also reports a 98.3% zero-shot metric. Separately, 58 of the 60 submitted proofs compiled on every listed Lean version; the other two compiled on only one of their two required versions.

The computing setup was part of the challenge. The authors found that long model contexts could overwhelm the GPU’s key-value cache when 60 sessions ran concurrently, sharply reducing output throughput. They chose a 60,000-token context-rebuild threshold and CPU offloading to balance context length and serving speed. The final run produced 53,972 candidate proofs, of which 15,032 were valid, according to the paper.

What the result does—and does not—show

The result comes from one submitted final run on a particular benchmark, model configuration, hardware setup and deadline. The authors tested design choices on 15 warm-up problems and report variation between development runs. But the final configuration ran only once, so its run-to-run spread was not measured. They also note that slower hardware could process fewer requests and achieve lower scores. The result demonstrates a working competition system; it does not establish a stable expected score across repeated runs or hardware.

The benchmark concerns refactoring existing proofs in six Mathlib-based repositories, not automatically discovering new mathematics or formalizing arbitrary informal arguments. Performance here is not evidence that the system can prove any theorem or make proofs easier for people to read. Length and checking improvements are benchmark metrics, not direct measures of maintainability or mathematical insight.

This article is based on the authors’ arXiv preprint, which may not have undergone peer review. The paper provides method details and reports limitations, but independent replication would help establish how reliably the system performs. The authors provide code and reproduction instructions; they report testing the submitted archive end to end on four problems, not repeating the full 48-hour evaluation with that archive.

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 systems use a locally served Qwen model to propose Lean proof refactorings and retain verified improvements. Their acceptance rules and workflows differ: Zhang et al. describe scored candidates and a time-budgeted run, while Milikic et al. require improvement above a threshold on every required Lean version and add scheduled CPU cleanup; their reported scores should not be treated as 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.41820v1 — Original paper

      Excerpt reference: static/papers/2611.41820v1.md:13-105
      Basis: Paper text
      Source file SHA-256: c59ff871e2ff7f20f9beb00e909759e945a4c92724cb011b868edb9c08d1e67c

    • 2611.31762v1 — Original paper

      Excerpt reference: static/papers/2611.31762v1.md:13-98
      Basis: Paper text
      Source file SHA-256: bc462e1216bb01263394d2da735706a82133e84929d1683ea7e90e62173ae6c8

    • 2611.31762v1 — Original paper

      Excerpt reference: static/papers/2611.31762v1.md:99-159
      Basis: Paper text
      Source file SHA-256: bc462e1216bb01263394d2da735706a82133e84929d1683ea7e90e62173ae6c8

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.