Learning to Repair Lean Proofs from Compiler Feedback
Evan Wang, Simon Chess, Daniel Lee, Siyuan Ge, Ajit Mallavarapu, Vasily Ilin
TL;DR
This paper tackles Lean proof repair by leveraging compiler feedback to train models that both fix failing proofs and generate grounded explanations. It introduces APRIL, a 260K-example dataset created by systematically mutating correct proofs to produce realistic errors, each paired with compiler diagnostics, a corrected proof, and human-readable explanations and fixes. Finetuning of multiple models on APRIL yields substantial gains in single-shot repair accuracy, with small to mid-size models approaching or matching larger baselines, illustrating the value of error-centered supervision for interactive theorem proving. The work also shows that explanations can aid human-in-the-loop use, while maintaining strong repair capability, and provides a public dataset to drive future research in feedback-conditioned proof repair for Lean 4.
Abstract
As neural theorem provers become increasingly agentic, the ability to interpret and act on compiler feedback is critical. However, existing Lean datasets consist almost exclusively of correct proofs, offering little supervision for understanding and repairing failures. We study Lean proof repair as a supervised learning problem: given an erroneous proof and compiler feedback, predict both a corrected proof and a natural-language diagnosis grounded in the same feedback. We introduce APRIL (Automated Proof Repair in Lean), a dataset of 260,000 supervised tuples pairing systematically generated proof failures with compiler diagnostics and aligned repair and explanation targets. Training language models on APRIL substantially improves repair accuracy and feedback-conditioned reasoning; in our single-shot repair evaluation setting, a finetuned 4B-parameter model outperforms the strongest open-source baseline. We view diagnostic-conditioned supervision as a complementary training signal for feedback-using provers. Our dataset is available at \href{https://huggingface.co/datasets/uw-math-ai/APRIL}{this link}.
