REFACTOR: Learning to Extract Theorems from Proofs
Jin Peng Zhou, Yuhuai Wu, Qiyang Li, Roger Baker Grosse
Abstract
Human mathematicians are often good at recognizing modular and reusable theorems that make complex mathematical results within reach. In this paper, we propose a novel method called theoREm-from-prooF extrACTOR (REFACTOR) for training neural networks to mimic this ability in formal mathematical theorem proving. We show on a set of unseen proofs, REFACTOR is able to extract 19.6% of the theorems that humans would use to write the proofs. When applying the model to the existing Metamath library, REFACTOR extracted 16 new theorems. With newly extracted theorems, we show that the existing proofs in the MetaMath database can be refactored. The new theorems are used very frequently after refactoring, with an average usage of 733.5 times, and help shorten the proof lengths. Lastly, we demonstrate that the prover trained on the new-theorem refactored dataset proves more test theorems and outperforms state-of-the-art baselines by frequently leveraging a diverse set of newly extracted theorems. Code can be found at https://github.com/jinpz/refactor .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext abba5a93-9638-4b82-bf88-28cdaddee55bCited by top-tier papers5
- ProofOptimizer: Training Language Models to Simplify Proofs without Human DemonstrationsAlex Gu, Bartosz Piotrowski, Fabian Gloeckle, Kaiyu Yang et al.ICLR 2026 · 11 citations
- Varying Shades of Wrong: Aligning LLMs with Wrong Answers OnlyJihan Yao, Wenxuan Ding, Shangbin Feng, Lucy Lu Wang et al.ICLR 2025
- Automated Discovery of Tactic Libraries for Interactive Theorem ProvingYutong Xin, Jimmy Xin, Gabriel Poesia, Noah D. Goodman et al.OOPSLA 2025
- BC-Prover: Backward Chaining Prover for Formal Theorem ProvingYuhang He, Jihai Zhang, Jianzhu Bao, Fangquan Lin et al.EMNLP 2024
- Divide and Abstract: Autoformalization via Decomposition and Abstraction LearningMarcus J. Min, Yeqi Gao, Wilson Sy, Zhaoyu Li et al.ICLR 2026
Builds on8
- Deep Learning For Symbolic MathematicsGuillaume Lample, François ChartonICLR 2020 · 477 citations
- IsarStep: a Benchmark for High-level Mathematical ReasoningWenda Li, Lei Yu, Yuhuai Wu, Lawrence C. PaulsonICLR 2021 · 69 citations
- Mathematical Reasoning via Self-supervised Skip-tree TrainingMarkus Norman Rabe, Dennis Lee, Kshitij Bansal, Christian SzegedyICLR 2021 · 65 citations
- Compositional generalization through abstract representations in human and artificial neural networksTakuya Ito, Tim Klinger, Douglas Schultz, John Murray et al.NeurIPS 2022 · 65 citations
- Learning to Prove Theorems by Learning to Generate TheoremsMingzhe Wang, Jia DengNeurIPS 2020 · 60 citations
Related papers
- HyperTree Proof Search for Neural Theorem ProvingGuillaume Lample, Timothée Lacroix, Marie-Anne Lachaux, Aurélien Rodriguez et al.NeurIPS 2022 · 271 citations
- NaturalProver: Grounded Mathematical Proof Generation with Language ModelsSean Welleck, Jiacheng Liu, Ximing Lu, Hannaneh Hajishirzi et al.NeurIPS 2022 · 108 citations
- ImProver: Agent-Based Automated Proof OptimizationRiyaz Ahuja, Jeremy Avigad, Prasad Tetali, Sean WelleckICLR 2025
- LEGO-Prover: Neural Theorem Proving with Growing LibrariesHaiming Wang, Huajian Xin, Chuanyang Zheng, Zhengying Liu et al.ICLR 2024 · 125 citations
- Mathesis: Towards Formal Theorem Proving from Natural LanguagesXuejun Yu, Jianyuan Zhong, Zijin Feng, Pengyi Zhai et al.ICLR 2026 · 15 citations
