ImProver: Agent-Based Automated Proof Optimization

Riyaz Ahuja, Jeremy Avigad, Prasad Tetali, Sean J. Welleck
2/12/2026

No official code found. Best implementation: riyazahuja/ImProver (42 stars, last commit 2026-04-18).

Abstract

Large language models (LLMs) have been used to generate formal proofs of mathematical theorems in proofs assistants such as Lean. However, we often want to optimize a formal proof with respect to various criteria, depending on its downstream use. For example, we may want a proof to adhere to a certain style, or to be readable, concise, or modularly structured. Having suitably optimized proofs is also important for learning tasks, especially since human-written proofs may not optimal for that purpose. To this end, we study a new problem of automated proof optimization: rewriting a proof so that it is correct and optimizes for an arbitrary criterion, such as length or readability. As a first method for automated proof optimization, we present ImProver, a large-language-model agent that rewrites proofs to optimize arbitrary user-defined metrics in Lean. We find that naively applying LLMs to proof optimization falls short, and we incorporate various improvements into ImProver, such as the use of symbolic Lean context in a novel Chain-of-States technique, as well as error-correction and retrieval. We test ImProver on rewriting real-world undergraduate, competition, and research-level mathematics theorems, finding that ImProver is capable of rewriting proofs so that they are substantially shorter, more modular, and more readable.

View on arXivView PDF

Code Implementations(1)

riyazahuja/ImProverCommunity100%

ImProver: Agent-Based Automated Proof Optimization

428Lean, PythonJun 10, 20246 months ago

Similar Papers

Cite this paper

@article{ahuja2026improver,
  title  = {ImProver: Agent-Based Automated Proof Optimization},
  author = {Riyaz Ahuja and Jeremy Avigad and Prasad Tetali and Sean J. Welleck},
  year   = {2026},
  eprint = {2410.04753},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2410.04753},
  journal = {ICLR 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.04753.svg)](https://codeofpaper.com/paper/2410.04753)

Discussion