TRANSMISSION // 2611.31762v1

How AI Refactored Lean Proofs Without Changing Their Claims

Source published

A Qwen-and-Codex system searched for shorter, less costly Lean proofs, with a Lean checker vetting candidates across required software versions.

AI-generated conceptual illustration for How AI Refactored Lean Proofs Without Changing Their Claims
AI-generated conceptual illustration; not documentary evidence.

Lean 4 proofs can vary in source length and in how much work the software takes to check them. A new preprint tests whether an AI-assisted workflow can improve those measures while preserving each theorem statement.

A formal proof in Lean is a precise object that software can check against a theorem statement. For the same claim, there may be multiple valid proofs, with different source lengths or different costs for Lean to check. A proof may also work in one Lean version but fail in another.

Lazar Milikic, Gordan Đurić and Viktor Kunčak describe a system for searching for alternative proofs. Their paper, Verified Proof Refactoring with Codex and Qwen, asks whether a language model can help revise existing Lean 4 proofs without changing their theorem statements, while retaining compatibility with the Lean versions required by the benchmark.

A search process with a checker in charge

The system pairs a locally served Qwen model with the open-source Codex command-line interface. Codex provides an interaction loop for inspecting and editing files and using tools. The researchers’ host program supplies the tasks, source-search tools and, crucially, a Lean checker that tests proposed replacements.

The model can inspect surrounding source and retrieve relevant declarations before submitting a replacement proof. The host measures proof length and checking cost, then checks whether the proof compiles in every required version. A candidate replaces the current best proof only if it passes all those checks and improves the combined score by more than 0.02 points. In other words, the model proposes edits, but Lean’s checks and the host’s scoring rules determine which ones are kept.

After model search, a separate CPU-based stage tries a fixed sequence of edits, including simplifying tactic calls and removing redundant steps. Those edits must also pass the version checks and improve the score. This cleanup stage makes no additional model calls.

The score averages three components: proof-body token length relative to a reference, Lean’s heartbeat count, and the share of required Lean versions that accept the proof. Heartbeats measure work involved in elaborating the complete declaration; the benchmark uses the first listed Lean version for that component. These measures assess specified properties of the proofs, not their clarity to human readers.

What the benchmark showed

The evaluation used 60 problems from Lean Refactor Arena. Model search achieved a reported local mean combined score of 82.07. CPU cleanup improved 28 proofs and raised the mean to 82.18. The model-stage proofs and the final proofs each passed all 127 required proof–version checks.

The authors report that their system placed first in the arena’s open-source LLM track at a NeurIPS 2026 workshop. This is a result in that competition and benchmark; it does not establish that the system is best for every Lean task or outperforms every proof-refactoring approach in general.

The workflow is designed to keep the theorem statement fixed and evaluate replacements in their original source context. It rejects candidates that fail on any required version. These safeguards mean the accepted results are not merely model-generated suggestions: they were checked by Lean under the benchmark’s specified conditions.

What remains uncertain

The reported results concern this benchmark’s 60 tasks, reference measurements and scoring formula. They do not establish how well the method transfers to other proof collections, projects or version requirements. Nor does the score show whether people would find the resulting proofs easier to understand or maintain. A combined score of 82.18 is not a general percentage reduction in proof length or checking time.

The paper labels itself a preprint. Its findings should be treated as reported research results, not as settled conclusions or evidence of independent confirmation. The paper describes one system and evaluation, rather than a comprehensive comparison with every alternative.

The narrower finding is that, on these 60 tasks, model-guided search followed by deterministic cleanup improved the system’s combined benchmark score, and all final proofs passed the required version checks. The work demonstrates one way to use a language model for proof editing while relying on a formal checker to screen proposed changes.

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 a Budgeted AI Pipeline Refactored Lean Proofs

    Shared method: Both studies use Lean-checked, score-gated proof replacement on the 60-problem Lean Refactor Arena benchmark: Milikic et al. retain candidates that pass every required Lean version and improve their combined score, while Cheng describes checking compatibility across listed toolchains and measuring candidate improvements against a local meter. This is a methodological connection, not a direct comparison of performance: the systems, scoring details and reported outcomes differ.

    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.31762v1 — Original paper

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

    • 2611.13011v1 — Original paper

      Excerpt reference: static/papers/2611.13011v1.md:80-123
      Basis: Paper text
      Source SHA-256: 4200fd74856007eedde6455238ddac563ea82fe002783dc497d7ed17383ee93c

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