Manuscript Offprint

arXiv:2610.34490

Efficient Proof Generation for Lean Statements with Multiple Candidate Answers

Pengzhen Lin, Ke Zhang, Maziar Raissi, Zhouxing Shi

Abstract

In formal systems such as Lean 4, efficiently finding answers to mathematical problems and generating verifiable proofs is an important task in automated mathematical reasoning. In the traditional way where an upstream solver provides multiple candidate answers, the common workflow requires searching for proofs for each candidate separately, incurring redundant computational cost. To this end, we propose a joint proof framework that integrates candidate answer selection, answer supplementation, and formal proof generation into a unified reasoning process. At its core is a trained prover that selects given or proposes new answers and generates a proof for at least one answer in a single call. Joint proof can also reuse generated proofs to check for faithfulness errors. For problems with a unique answer, if two distinct answers both obtain verifiable proofs under the same formal statement, this confirms the statement does not faithfully preserve the original problem semantics. On MATH-500, AMC 2023, and AIME 2024/2025/2026, our framework achieves the same formal proof success rate as per-candidate proof generation with about one sixth of the token cost, and identifies at least 6.1% of the formalized statements as unfaithful without requiring additional judges. Our model and code are available at https://github.com/Linppz/Gobble-Prover.

1 Introduction

Large language models (LLMs) are increasingly capable of mathematical reasoning. This has sparked growing interest in proofs that can be formally verified (Ren et al., 2025; Wang et al., 2025; Lin et al., 2025c; OpenAI, 2026). In a proof assistant such as Lean 4 (Moura and Ullrich, 2021), statements and proofs are written in a formal language. Any proof that passes Lean's type check is guaranteed to be sound. This offers a path toward reliably verifying LLM reasoning.

Many mathematical problems, however, ask for an answer that is not known in advance (Cobbe et al., 2021; Hendrycks et al.). We call these answer-construction problems. Most work on formal proof generation assumes that such answers are known (Zheng et al., 2022; Tsoukalas et al., 2024). Each theorem statement then already contains the ground-truth answer. The realistic setting, where the answer is unknown, remains understudied (Liu et al., 2026; Feng and Shi, 2026).

In this setting, Lean can be used to select the answer (Yao et al., 2025). An upstream LLM first samples multiple candidate answers. An autoformalizer then translates each problem–answer pair into a formal statement. A prover finally attempts a proof, which Lean checks. If the formalization is correct, only the correct candidate can be proved. This pipeline, however, calls the autoformalizer, prover, and Lean once per candidate. These repeated calls are costly and limit applications where efficiency matters. Feng and Shi (2026) reuse one formal statement across candidates to cut the formalization cost. Yet the harder step, proof generation, still runs once per candidate.

In this work, we make proof generation efficient for multiple candidate answers. We propose a joint proof framework (Figure 1), in which our trained prover handles all candidates in one call. The prover learns to select the candidates it can prove. When no candidate works, it proposes new provable answers. It also learns to write one proof that covers several candidates. Alongside the proof, it declares which candidates should pass Lean. Lean then checks only these declared values, which saves verification cost. Beyond efficiency, a shared proof can also expose unfaithful autoformalization. If a problem has a unique answer, two distinct values that both pass Lean show that the formal statement is wrong.

We train this prover with supervised fine-tuning (SFT) followed by reinforcement learning (RL).

smallest n > 0 with 7 | 2^n - 1? choices: 3 · 6 · 7 · 21

Figure

Figure 1: Our joint proof framework versus the original per-candidate pipeline. For k candidates, the number of prover and Lean calls drops from O(k)O(k) to O(1)O(1), and the prover can explore a larger space (answer E). Left: each formal statement is specific to a candidate answer for answer-construction problems. Right: candidates combined.

For SFT, we take the prover’s original outputs and append the list of answers it endorses. This teaches the prover to list provable answers and prove them in one response. For RL, we fill each listed answer into the formal statement and verify it with the proof from the same response. The reward is higher when two or more distinct answers pass. This encourages the prover to declare more provable answers and to write reusable proofs.

In summary, our contributions are as follows:

• We propose a joint proof framework, in which a trained prover handles all candidate answers of an answer-construction problem in a single call.

• We train the prover to write proofs that can support several candidates at once. When the problem has a unique answer, such proofs expose unfaithful formalization.

• On common math benchmarks, joint proof matches the proof success rate of per-candidate proof generation with about one sixth of the prover output tokens. It also flags at least 6.1% of formal statements from autoformalizers of various sizes as unfaithful.

References (24)