arXiv:2610.11605cs.LGOct 2026

Manuscript Offprint

arXiv:2610.11605

NanoProof: Open and Efficient Automated Theorem Proving in Lean 4

Matěj Kripner, Milan Straka

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

We introduce NanoProof, to our knowledge the first factorized execution-guided theorem prover in Lean 4 whose training data, extraction tooling, training pipeline, and weights are all released, making it end-to-end reproducible using open-source resources. To this end, we build and release a dataset of structured proof trees, as well as a tool for programmatic interaction and data extraction within the Lean 4 formal verifier. To support sustainable research, we focus on compute efficiency to facilitate accessible training and evaluation. NanoProof achieves 50.8% pass@16 on MiniF2F-Test, exceeding the two closest systems of its class, HyperTree Proof Search and ABEL, at roughly 90× and 7× less compute, and using more than four orders of magnitude less compute than AlphaProof. Stronger open-weight provers exist, but they are fine-tuned from large pretrained language models and release neither training data nor pipeline; NanoProof shows that the factorized execution-guided class of provers can be rebuilt from scratch with modest resources.

1 Introduction

In automated theorem proving (ATP), the task at hand consists of generating a valid proof to a mathematical statement. We focus our attention on formal ATP, where both the statement and the proof are expressed in a formal language such as Lean 4 [29]. In this setting, the correctness of a generated proof can be verified automatically, providing clear feedback to an ATP system, which can be used for training using reinforcement learning (RL).

Formal methods have found applications in the formalization of mathematics [36], physics [34], and chemistry [3], as well as software verification [2], cryptography [8], and general reasoning [16]. With the current and anticipated rise of AI-generated code, proofs, and other artifacts, we expect human verification to become the bottleneck to innovation, making formal methods essential for their ability to automatically filter out incorrect solutions. For example, mathematicians already benefit from expediting the review process in frontier research by submitting a formalization of their results [12]. Similarly, formal verification enables massively collaborative mathematical projects without the need for extensive human moderation [4].

On an implementation level, ATP systems can be divided along several axes. First, in an execution-guided proof search, a prover interleaves proof search with verification, leveraging feedback from the formal verifier after each proof step and generating steps conditioned on the true internal proof state. For example, in Lean 4, an execution-guided prover observes the list of currently open goals and is informed on any proof steps that resulted in an error. In contrast, execution-agnostic provers only use the formal verifier to verify the final proof, generating proof steps with no feedback about the validity of preceding steps or the current internal proof state. Thus, in execution-agnostic search, it falls upon the proof step generator to deduce the evolving proof state, as this is a necessary precondition to determine the validity of subsequent proof steps. This coupling of a policy model and a world model increases the complexity of proof generation.

Second, in a factorized proof search, the prover is allowed to split proof states into separate branches that can be explored independently. An illustrative example is mathematical induction, where factorized search considers the base case and the inductive case independently, enabling parallelization and dynamic allocation of search budget between the two branches. The utility of node re-use and parallelization enabled by factorization has been verified by Lample et al. [22] and Hubert et al. [14] and we do not reiterate it in this work. In contrast, in a linear proof search, the proof state consists of all the context necessary to complete the proof.

Finally, in an any-time proof search, the prover performance grows when time or compute budget is increased, while a one-shot prover can only be scaled by running multiple instances in parallel, without the possibility of utilizing results across searches.

Proof search can be treated as a generic text-to-text language modeling problem of generating a proof given a statement, resulting in a linear one-shot execution-agnostic method. Such methods have directly benefited from the recent rapid rise in capabilities of large language models (LLMs). In contrast, factorized any-time execution-guided provers require careful pre-processing of training data and tight integration with the verification framework. The existing systems of this class, HyperTree Proof Search [22], ABEL [11], and AlphaProof [14], released neither their data nor runnable code. Open execution-guided provers such as InternLM2.5-StepProver [40], BFS-Prover [43], and

∗^{*}Corresponding author: kripner@ufal.mff.cuni.cz.

BFS-Prover-V2 [44] perform linear best-first search over monolithic proof states and release at most model weights. The factorized class has therefore been out of reach for the open-source community, both in terms of data availability and compute requirements. We identify this as a major roadblock to advancing Machine Learning-based ATP in the age of large models, particularly since recent approaches like AlphaProof [14] and HyperTree Proof Search [22] demonstrated the viability of this paradigm.

Since the inception of this work, text-to-text and agentic provers built on large language models have become extremely strong, with Seed-Prover [5] and Goedel-Prover-V2 [25] saturating MiniF2F. We do not take this as evidence that search-based approaches are obsolete. Casting proving as plain text generation means that a frontier LLM can be applied without adaptation, whereas factorized search-based provers require structured training data, verifier integration, and search infrastructure before they can run at all, and until now this machinery existed only inside closed systems. Whether classical search with small models remains competitive with large generic LLMs at equal compute is an open question, and it can only be studied if this class of system exists in an open and reproducible form. Moreover, the strongest approach may turn out to be a combination of the two, LLM reasoning with verifier-grounded search, a direction that the heavy use of Lean feedback in Seed-Prover already explores. Factorized search also offers concrete advantages independent of model size: node re-use across branches, independent allocation of search budget to subgoals, and distance-to-proof-end labels that directly supervise the critic. This is why we consider open, reproducible tooling for the search-based side worth building.

In this work, we address this reproducibility barrier by introducing NanoProof, an end-to-end ATP system that leverages existing open resources and provides the novel components necessary to complete the Lean 4 pipeline. Specifically, our contributions are as follows.

• Data, Tooling, and Environment We release LeanTree, a dataset of 92,927 independently verified structured proof trees extracted from Mathlib, the extraction tool that produces such trees from any Lean 4 project, and a Lean interface with incremental kernel verification and a distributed environment pool for reinforcement learning.

• ATP System We introduce a factorized any-time execution-guided prover called NanoProof and release all the tooling necessary to reproduce it and build on top of it. 1^{1}

• Performance Evaluation We demonstrate the efficacy of NanoProof through an end-to-end training run, achieving 50.8% pass@16 on MiniF2F-Test [50] using more than four orders of magnitude less compute than AlphaProof.

• Search-Level Techniques We describe practical train-time and inference-time techniques, namely proof simplification and augmentation, cycle detection, and diverse tactic sampling, and quantify their effect where our compute budget allowed.

In Section 3, we present the training pipeline and the search algorithm of NanoProof. In Section 4, we describe the algorithm for extracting proof trees from human-authored Lean projects and the resulting LeanTree dataset, a necessary component for pre-training a factorized execution-guided prover. Finally, in Section 5, we present a training run of NanoProof using openly available datasets and LeanTree. The necessary background in Lean and proof search is available in Appendix A.

References (25)