WorksComputer Science
Learning to Disprove: Formal Counterexample Generation with Large Language Models
Abstract
Mathematical reasoning demands two critical, complementary skills: constructing rigorous proofs for true statements and discovering counterexamples that disprove false ones. However, current AI efforts in mathematics focus almost exclusively on proof construction, often neglecting the equally important task of finding counterexamples. In this paper, we address this gap by fine-tuning large language models (LLMs) to reason about and generate counterexamples. We formalize this task as formal counterexample generation, which requires LLMs not only to propose candidate counterexamples but also to produce formal proofs that can be automatically verified in the Lean 4 theorem prover. To enable effective learning, we introduce a symbolic mutation strategy that constructs candidate counterexample-generation tasks by systematically extracting theorems and removing selected hypotheses. Together with curated datasets, this strategy enables a multi-reward expert iteration framework that substantially enhances both the effectiveness and efficiency of training LLMs for counterexample generation and theorem proving. Experiments on three newly collected benchmarks validate the advantages of our approach, showing that the mutation strategy and training framework yield substantial performance gains.
Introduction
Endowing machines with mathematical reasoning capabilities has long represented one of the most fundamental and challenging frontiers in artificial intelligence research [1]. In recent years, with the emergence of reasoning large language models (LLMs) such as OpenAI-o1 [44], DeepSeek-R1 [22], and Gemini-2.5-Pro [16], significant advances have been achieved in this area. Furthermore, several formal reasoning LLMs, including Seed prover [14], Kimina prover [62], and Goedel prover [39], have also demonstrated strong performance in generating formal proofs and interacting with theorem provers [17, 7, 46]. The impressive capabilities exhibited by these models open up new avenues for addressing advanced and complex mathematical problems. However, existing studies often emphasize the logical deduction of LLMs; their capability to find counterexamples remains underexplored [36].
In mathematics, counterexamples are far more than mere exceptions [6]; they play a vital role in theory development [32], conjecture refinement [24], and educational enhancement [80]. For instance, since a conjecture must hold for all possible inputs, identifying anomalous examples and special cases is a crucial step for formulating valuable conjectures. Moreover, for LLM reasoning, its effectiveness largely depends on how well models can reflect upon and evaluate their intermediate reasoning steps [52]. Hence, counterexample generation becomes equally vital: it equips models with the ability to self-verify their logical processes, thereby strengthening both their reasoning reliability and explanatory power.
In this paper, we focus on training LLMs to generate formal counterexamples. Although casting the task into a formal setting requires the LLM to additionally provide a formal proof for each counterexample, it allows for the automatic evaluation of the proposed counterexample via the Lean 4 theorem prover. Two significant challenges arise in this task: First, there is a severe scarcity of training data. Currently, CounterMath [36] stands as the sole dataset specifically curated for benchmarking counterexample generation, comprising only 1,216 natural language problems. This limited size renders it inadequate for practical LLM training. Second, the reward signals during training are exceptionally sparse. When LLMs fail to produce correct counterexamples for complex problems, the training reward vanishes, hindering further improvement in model performance and resulting in a plateau at a low success rate.
To address these challenges, we propose an integrated framework illustrated in Figure 1. We design a new mutation strategy that drops selected hypotheses from provable theorems to construct candidate counterexample problems. Through this mutation strategy, we synthesize a large problem dataset for counterexample search. Furthermore, we introduce a multi-reward function based on verified proofs of the counterexample target and the negation of the discarded hypothesis, which can provide auxiliary feedback even when the main counterexample target remains unsolved.
Figure 1. Framework of counterexample training. In the data synthesis stage, the symbolic mutation drops the hypothesis of a provable theorem, creating candidate counterexample problems. In the subsequent expert stage, two rewards are introduced based on whether proofs establish the counterexample target and the negation of the dropped hypothesis, boosting training effectiveness and efficiency.
Experiments on three newly collected benchmarks demonstrate the effectiveness of our framework. Leveraging the proposed mutation strategy, we synthesized 575K candidate counterexample problems for fine-tuning. Together with a curated large-scale dataset and a multi-reward training scheme, this allows us to train a model specialized for counterexample generation. We further establish three applicable tasks: counterexample search, verification of autoformalized results, and verification of reasoning steps. Experimental results show that our fine-tuned model achieves substantial improvements on these tasks over current LLMs. Notably, our fine-tuned model achieves a relative improvement of 47% to 74% in pass@1 success rate compared to the strongest baseline.
Formal Counterexample Generation
The counterexample problem arises in disproving a universal mathematical conjecture of the form . By identifying a counterexample , the conjecture can be invalidated through its negation , which is established by proving the instantiated negation . A classic example is the conjecture “all continuous functions are differentiable.” To refute this claim, one must demonstrate the existence of a function that is continuous but non-differentiable, e.g., the absolute value function . Recently, automated mathematical research and knowledge discovery have garnered increasing attention [11, 54, 43].
As a result, the counterexample generation, as a specific yet crucial step in judging the correctness and completeness of newly proposed statements, has also evolved from being merely an incremental improvement to becoming pivotal in shaping the future of mathematical inquiry.
There are several symbolic tools designed for finding counterexamples to conjectures, such as nitpick in Isabelle [10] and plausible in Lean 4 [34]. They often rely on sophisticated software engineering techniques like random testing or SAT/SMT solving [9, 2]. Nonetheless, mathematics is fundamentally different from program proving, and the inherent complexity of higher-order logic hinders the effectiveness of these tools in both formulating problems and generating solutions. A promising alternative lies in LLM-based counterexample generation. LLMs offer substantial expressiveness and strong reasoning capabilities, albeit with some sacrifice in soundness compared to symbolic tools.
In addition to using LLM-based counterexample generation as a powerful tool for examining mathematical conjectures, training LLMs to generate counterexamples offers a new perspective for boosting the LLM’s reasoning capabilities. Unlike traditional mathematical proofs that are typically derived through logical deduction, aligning well with existing chain-of-thought models [67, 15], counterexample generation involves a guess-and-check paradigm [77, 50]; the LLM first proposes a potential counterexample and then verifies its validity.
Formal counterexample generation aims to establish a two-stage, informal-to-formal process. As illustrated in Figure 2, given a formal problem, the LLM is first prompted to find a counterexample through informal reasoning. It then produces a formal proof for the theorem based on this derived counterexample. Finally, the validity of the proposed counterexample is confirmed if its corresponding formal proof is successfully verified by the Lean 4 theorem prover [17].
Figure 2. Task of formal counterexample generation. This task requires the LLM first to perform informal reasoning to identify a valid counterexample for the given problem, and then generate the corresponding formal proof, which is automatically verified by theorem provers (e.g., Lean 4).
This approach differs from other informal-to-formal reasoning methods, which mainly focus on creating an informal sketch followed by its formalization and completion [28, 51, 12]. In those methods, informal and formal reasoning are consistent and congruous with one another. In contrast, formal counterexample generation necessitates a sequential pattern of informal-to-formal reasoning. Specifically, the initial natural language reasoning serves as a counterexample proposal, transforming the abstract challenge of proving an existential statement into the more concrete task of formally verifying a specific instance.
Nevertheless, both stages of formal counterexample generation pose distinct challenges for current LLMs. The “guess” phase requires models to propose effective counterexamples by analyzing various edge scenarios, including corner cases and limit values. This particular capability remains an undeveloped aspect of their training [36]. In the “check” phase, LLMs generate formal proofs, an endeavor complicated by the scarcity of training data for existential theorems [76], which significantly hinders the models’ performance. By addressing these challenges, counterexample generation can become a powerful tool to enhance the reasoning capabilities of LLMs and assist mathematicians in verifying conjectures.
The Proposed Framework
Our proposed approach consists of two stages: (1) counterexample problem synthesis and (2) multi-reward guided training. The first stage is devoted to creating a large-sized unlabeled dataset, i.e., the counterexample problem without a ground-truth answer and a formal proof. In the second stage, we carry out the expert iteration, where the LLM repeatedly generates counterexamples and formal proofs and then is fine-tuned on the successful ones. We will outline each stage as follows.
Counterexample Problem Synthesis
We first collect a substantial number of formal theorems to serve as foundational seeds. These seed theorems must meet two criteria: they should be (1) formally provable and (2) expressed in a universal format (e.g., ). In addition to sourcing these from existing Lean 4 formal libraries, like Mathlib, we extract intermediate subgoals or lemmas from formal proofs generated by LLMs. Specifically, given a formal proof, we decompose it into a series of proof steps, and categorize each proof step by its proving style. If a proof step is stated in declarative style (i.e., using have or suffices tactic), we directly transform it into a new theorem. Conversely, for a proof step stated in a procedural style (using tactics such as simp and rw), we analyze and compare the proof states before and after applying such a tactic to establish a new theorem.
Next, we design a mutation-based data synthesis method. To elaborate, let us start with a formally provable, universally stated theorem, which can be represented as
theorem original_version (x : X) : H₁ x → H₂ x → C x
Here, and are two hypotheses, and is the conclusion. This theorem asserts that for any element in the space , if both and hold true, then follows.
Discarding one of the hypotheses (for example, ) yields the universally quantified conjecture . If is essential to the validity of the original theorem, this conjecture is false. Its negation is classically equivalent to : a counterexample must satisfy the retained hypothesis and falsify the conclusion. We formalize this counterexample target as
theorem mutated_version : ∃ x : X, H₂ x ∧ ¬ C x
Before mutation, we use Lean 4 to identify and remove hypotheses unused in the original proof ([35]). This is a heuristic filter: a hypothesis used in a particular proof need not be logically necessary for the theorem. Mutation therefore does not guarantee that the resulting conjecture is false or that a counterexample exists. A generated target is confirmed satisfiable only when a witness is verified. Compared with LLM-based problem augmentation ([64, 78, 25]), this symbolic strategy provides a scalable way to generate candidate counterexample problems for training.
Multi-reward Guided Training
We follow the standard expert iteration pipeline ([3]) to train the LLMs with unlabeled data. In this framework, the model is repeatedly applied to perform large-scale inference on counterexample problems, from which candidate solutions and formal proofs are collected. The correct ones are then used to further refine the model through supervised fine-tuning. A key limitation, noted in prior work, is that LLMs often fail to produce correct results on difficult problems ([48, 70, 18]), restricting training to a cycle of generating and fine-tuning only on simpler examples. This issue is essentially the sparse reward problem in classic reinforcement learning ([23, 53]), commonly alleviated through techniques such as reward shaping ([33]) or curriculum learning ([8]).
Rather than adopting these conventional approaches, we propose using a multi-reward strategy to effectively address this limitation. A witness for the counterexample target must also satisfy : otherwise, the original theorem and would imply , a contradiction. This leads to the formation of a new theorem
theorem dropped_hypothesis : ∃ x : X, ¬ H₁ x
To score a candidate , the LLM is prompted to prove dropped_hypothesis and mutated_version using that candidate as the witness. These proofs are subsequently verified by the theorem prover, which yields two distinct rewards for the counterexample. When the generated proofs use the proposed witness, the auxiliary reward corresponds to proving , while the main reward corresponds to proving . The auxiliary condition alone does not establish a counterexample. Although the prompts request the same proposed witness, verifying a proof of an existential target alone does not guarantee that the proof uses that witness. This is a limitation of the feedback mechanism, discussed further under limited model capability in the Limitations section. The auxiliary target can provide a training signal when its proof succeeds even if the main target remains unsolved; it does not guarantee a nonzero reward or a valid counterexample. Ultimately, we combine these two rewards as the final sample weight for the supervised fine-tuning.
Additionally, we include the training of LLMs for generating formal proofs of counterexamples in the expert iteration. Besides collecting the formal proof of mutated_version, the formal proof of dropped_hypothesis can also be used for fine-tuning. However, since formally proving the necessary condition is often easier, the model might fall into a low-difficulty trap, frequently generating shorter proofs. To mitigate this, the sample weight of the auxiliary proof should be reduced, and other techniques, e.g., group relative policy optimization (GRPO) [56], can also be employed to encourage the generation of longer formal proofs.
Overall Framework
Formally, let us define the seed dataset as , where stands for a seed theorem. For every theorem , mutation yields the counterexample target and the auxiliary target expressing the negation of the dropped hypothesis. We introduce two LLMs, represented as and , for generating counterexamples and formal proofs, respectively. For a given counterexample problem , we first prompt the LLM to propose a counterexample . Next, the formal proof is constructed by integrating the problem and the proposed counterexample, i.e., . In addition, the LLM provides the formal proof for the auxiliary target, given by .
We utilize the indicator function to signify the theorem prover’s verification. Through verifying the two formal proofs and , we establish the combined reward for the counterexample as , where , , and is a trade-off coefficient. Then, the supervised fine-tuning of counterexample generation is conducted on the weighted dataset . We continue to use these two rewards as the weights for the supervised fine-tuning of formal proof generation. The corresponding weighted dataset is derived from the formal proofs of two theorems and structured as .
The overall framework is accordingly summarized in Algorithm 1.
Experiments
This section presents the experimental results. Specifically, our study aims to address the following research questions (RQs):
RQ1 (Efficacy and efficiency of data mutation): What is the success rate and time consumption of data mutation for generating new theorems from a single seed theorem?
RQ2 (Efficacy and efficiency of multi-reward training): Compared to single-reward training, does multi-reward training improve the performance and training efficiency?
RQ3 (Performance improvement of integrated workflow): Compared with baselines, does our proposed framework achieve better performance in generating formal counterexamples?
Algorithm 1 The Integrated Workflow of Data Mutation and Multi-Reward Training
Input: A seed dataset , with each formally provable and expressed in a universal format. Output: Two LLMs, and , for generating counterexamples and formal proofs.
Phase 1: Dataset Mutation
for do
Mutate , collecting the counterexample target and the auxiliary target .
end for
Phase 2: Expert Iteration
for do
Step 2.1: Large-scale Inference and Verification
for do
Generate a counterexample using : .
Generate formal proofs for the counterexample and auxiliary targets:
and .
Compute rewards based on proof correctness:
, , and .
end for
Step 2.2: Supervised Model Fine-tuning
Update the model based on the weighted dataset .
Update the model on the dataset .
end for
All experiments were conducted on a Linux server featuring two AMD EPYC 7C13 64-core processors equipped with eight high-end GPUs. The code, together with the experimental data, is available at https://figshare.com/s/02e05a2c2945ee10dcc4.
RQ1: Efficacy and Efficiency of Data Mutation
Leveraging the proposed mutation strategy, we can curate a substantial number of counterexample problems as training materials for LLMs. To obtain the seed theorems, we aggregated all theorems and lemmas from the Lean 4 formal library Mathlib (mathlib Community, 2020) and the popular formal dataset Leanworkbook ([76]). We also extracted intermediate subgoals or lemmas from formal proofs generated by LLMs (Goedel prover v2 ([39]) and DSP+ ([12])) on the MiniF2F ([84]) and PutnamBench ([58]). These four data sources originate from diverse mathematical domains and varying levels of difficulty. Mathlib encompasses a broad spectrum of mathematical concepts and foundational lemmas, while Leanworkbook comprises formalized content from approximately ten distinct categories (e.g., algebra, number theory, combinatorics). MiniF2F and PutnamBench focus on competition-level problems, with the former targeting high-school-level challenges and the latter undergraduate-level tasks, potentially involving more complex concepts.
We implemented a Lean 4 tactic, mutate, to perform the symbolic mutation. Before applying it, we utilized the Lean 4 theorem prover to analyze the formal proof of the seed theorem, identifying and eliminating hypotheses unused in that proof. Following the execution of the mutate operator, the theorem prover was invoked again to ensure the grammatical correctness of the newly generated problem.
The results of the mutation process on the four data sources are presented in Table 1. In total, we collected approximately 575K candidate counterexample problems, which constitute a sufficiently large dataset to support LLM fine-tuning. The efficacy and efficiency of the mutation procedure are illustrated in Figure 3. The proposed method yields a mutation ratio in the approximate range of 1.6–2.5, while the average execution time per seed theorem remains between 0.3 and 0.71 seconds. Note that the execution time on Mathlib is comparatively lower because this formal library is pre-compiled.
| Source | # of seed theorems | # of mutated problems |
| Mathlib | 43,990 | 88,217 |
| Leanworkbook | 17,061 | 42,480 |
| MiniF2F | 48,415 | 94,215 |
| PutnamBench | 212,463 | 350,127 |
| Total | 321,929 | 575,039 |
Table 1. Overall results of data mutation. Applied to a set of seed theorems, our mutation method generates a diverse collection of candidate counterexample problems.
Figure 3. Results of mutation ratio and average execution time. Evaluated across multiple data sources, our method maintains a high mutation ratio while remaining computationally efficient.
RQ2: Efficacy and efficiency of multi-reward training
To evaluate the proposed multi-reward training, we conducted an ablation study by comparing training with and without the multi-reward function. To elaborate, we selected Qwen3 8B as the base model (Qwen Team, [49]) for informal reasoning, which is responsible for proposing counterexamples, and DeepSeek-Prover-v2 7B (Ren et al., [51]) as the base model for formal reasoning, which generates proofs for the proposed counterexamples. Both models were trained under the framework described in Algorithm 1, with the sole difference between the single-reward and multi-reward settings being the choice of coefficient . In the single-reward setting, was fixed at 1.0, whereas in the multi-reward setting, it was set to 0.8 to ensure that both rewards contribute effectively. We also adapted Dr.GRPO (Liu et al., [40]), a normalized variant of GRPO, to regulate proof length, thereby preventing proofs from being excessively short (overfitting) or unnecessarily long (overthinking).
From the collected dataset of 575K instances, we reserved 3K for validation. Due to limited computational resources, training was limited to 56 iterations with a batch size of 10K. In each iteration, large-scale inference and verification were conducted, after which both models were updated accordingly.
We compute pass@ rates for on the validation set and plot the pass@ rate curves in Figure 4. Compared with the single-reward training, the multi-reward approach achieves both faster convergence and higher final performance. Specifically, at convergence, multi-reward training reaches approximately 49%, 52%, and 54% for pass@1, pass@4, and pass@9, respectively, whereas the single-reward baseline attains only 43%, 46%, and 47%. For reference, we also report the pass@ results of existing LLM-based theorem provers in Appendix § 18.
Figure 4. Pass@ () rate curves on the validation set. Compared with the single-reward baseline, multi-reward training converges faster and yields superior final performance.
RQ3: Performance improvement of integrated workflow
We establish three tasks to evaluate our fine-tuned model: the identification of counterexamples, as well as the verification of autoformalized results and reasoning steps. For the counterexample identification, we employ Kimina-Autoformalizer 7B (Wang et al., [62]) to formalize CounterMath (Li et al., [36]), which is constructed from four classic counterexample textbooks. This yields 1,058 formal counterexample problems, forming our benchmark (denoted as For-COUNTER). Furthermore, we assess the effectiveness of counterexample generation by identifying potential errors in the formalization of correct theorems and in the reasoning steps of proving theorems. Therefore, we construct VERI-FORMALIZE, which comprises 3K unprovable problems generated by formalizing FormalMath [79], and another 3K dataset VERI-REASON obtained when applying DSP+ [12] to solve the problems from FormalMath.
The pass@ () results are summarized in Table 2. Instead of reporting pass@ rates, we present the absolute number of correctly solved problems, since the established benchmark contains inaccuracies. The results show that the model fine-tuned with our framework substantially outperforms existing state-of-the-art LLMs. Overall, open-source neural provers demonstrate stronger performance than general-purpose LLMs. Our fine-tuned model further advances the state of the art: for pass@1, it solves 95, 69, and 63 more problems than the strongest baseline across the three benchmarks. Similar gains are observed for pass@4 and pass@9, further confirming the superiority of our model. We also conduct an ablation study in Appendix § 18 to evaluate the contribution of each component (i.e., informal and formal reasoning models).
Table 2: Numbers of solved problems on three counterexample-generation tasks under pass@ (). Relative percentage improvements in the row are rounded down to the nearest integer. Our fine-tuned model achieves the best performance on all three benchmarks and all three values, outperforming both general-purpose LLMs and open-source neural theorem provers.
| Dataset | FOR-COUNTER | VERI-REASON | VERI-FORMALIZE | ||||||
| @1 | @4 | @9 | @1 | @4 | @9 | @1 | @4 | @9 | |
| GENERAL-PURPOSE LLMS | |||||||||
| Gemini-2.5-Flash | 21 | 66 | 82 | 5 | 9 | 15 | 2 | 8 | 13 |
| Grok-3-mini | 30 | 74 | 101 | 4 | 10 | 19 | 2 | 8 | 19 |
| GPT-4.1-mini | 19 | 65 | 103 | 54 | 97 | 150 | 31 | 87 | 137 |
| Deepseek-R1 | 61 | 135 | 158 | 51 | 75 | 105 | 27 | 72 | 102 |
| OPEN-SOURCED NEURAL PROVERS | |||||||||
| Leanabell-prover | 106 | 159 | 181 | 144 | 210 | 231 | 111 | 198 | 228 |
| STP-prover | 101 | 157 | 179 | 131 | 151 | 170 | 99 | 150 | 171 |
| Kimina-prover-distill | 31 | 109 | 165 | 66 | 114 | 156 | 18 | 141 | 249 |
| Goedel-prover-v2 | 89 | 177 | 215 | 88 | 147 | 200 | 63 | 165 | 201 |
| Deepseek-prover-v2 | 127 | 200 | 224 | 144 | 203 | 234 | 69 | 135 | 186 |
| Ours | 222 | 274 | 302 | 213 | 260 | 295 | 174 | 255 | 313 |
| 95 | 74 | 78 | 69 | 50 | 61 | 63 | 57 | 64 | |
Table 2. Numbers of solved problems on three counterexample-generation tasks under pass@ (). Relative percentage improvements in the row are rounded down to the nearest integer. Our fine-tuned model achieves the best performance on all three benchmarks and all three values, outperforming both general-purpose LLMs and open-source neural theorem provers.
Related Work
Formal counterexample generation is generally related to LLM-based counterexample generation and formal reasoning (a.k.a neural theorem proving). We provide a brief overview of related work in these directions and highlight the connections and differences between our work and theirs.
LLM-based Counterexample Generation
Counterexample finding is essential for both advancing mathematical research and strengthening the reasoning capabilities of LLMs. Despite its importance, there has been relatively little work on incorporating counterexample generation and AI techniques. Early attempts (Wagner, 2021; Ghebleh et al., 2024a;b; Roucairol & Cazenave, 2022; Vito & Stefanus, 2023) employed reinforcement learning and Monte Carlo tree search to identify counterexamples in combinatorics and graph theory, later extending this line of work with transformer-based models to improve search performance [13]. More recently, some studies have begun to explore the potential of LLMs in proposing counterexamples. For example, CounterMath [36] introduced a benchmark in this direction, demonstrating that current LLMs still face significant challenges. However, this benchmark is established purely in natural language, making it difficult to rigorously verify the correctness of counterexample candidates. MathConstruct [5], by contrast, evaluates constructive proof generation and integrates symbolic methods for validation. Compared with our work, it is confined to competition-level problems, whereas our work grounds the task in Lean 4 formal language and focuses on undergraduate-level settings.
LLM-based Formal Reasoning
The mathematical reasoning capability of LLMs is widely regarded as a key indicator of their overall intelligence [1, 4, 45]. Formal reasoning requires an LLM to express its thought process in a formal language, with theorem provers verifying each step [74, 37]. Leveraging advanced techniques such as autoformalization [69], premise retrieval [73], library learning [61], and proof search [31], LLM-based formal reasoning has achieved remarkable progress [26, 12, 51, 39], culminating in silver-medal level performance at the 2025 International Mathematical Olympiad [14].
However, to the best of our knowledge, systematic investigations into the formal proof of counterexample problems remain extremely limited. Although some methods involve disproving the newly collected theorem when it cannot be successfully proved [29, 39, 51], the majority of available data do not fall into this category. As a result, existing LLM-based theorem provers perform poorly on counterexample-guided formal reasoning. Our work explicitly targets this gap by synthesizing counterexample problems and fine-tuning the LLMs. Additionally, our work follows the informal-to-formal paradigm for formal proof generation. Different from prior approaches that tightly align informal and formal reasoning [27], we adopt a sequential scheme: the LLM first engages in informal reasoning to search for counterexamples, while formal reasoning is employed to verify the validity of the candidate results through proof.
Formal Data Synthesis
Data plays a crucial role in enhancing the reasoning capability of LLMs [81, 74, 19]. Beyond manual collection and annotation, formal data synthesis methods are typically categorized into two categories: neural and symbolic. Neural methods employ LLMs to either autoformalize existing informal problems or directly generate formal ones. For instance, Minimo [47] and STP [18] use an LLM conjecturer to propose new theorems, while DeepSeek-Prover [72], Kimi-Prover [62], and GoedeI [38] fine-tune autoformalization models to translate math competition problems into Lean theorems. Symbolic methods often employ a precise and controllable mutation mechanism to ensure the validity of the generated problems. MetaGen [65] mutates Metamath theorems via substitution, and works such as LeanNavigator [75] and Alchemy [68] extend this to Lean 4 by applying tactics like apply or rw. Although broadly applicable, these operators often fail to produce sufficiently hard problems. Thus, some focus on domain-specific strategies, e.g., geometry [57], inequalities [66], or TCS [83], yielding stronger training performance.
Our proposed method falls into the second category; we target the counterexample problem, devise a dedicated mutation strategy, and implement it as a new Lean 4 tactic. This generates syntactically valid candidate problems and can be applied to neural-generated theorems as well; the existence of a counterexample still requires verification. Based on the mutation strategy, we further design a multi-reward function compatible with popular reinforcement learning methods like GRPO [56] and its variants [82].
Limitations
While our proposed framework demonstrates strong potential in counterexample search and formal proof generation, several directions remain for further improvement and extension.
Data quality of synthetic data. Compared with manually collecting and labeling problems and solutions, symbolic mutation can generate large volumes of data at extremely low cost. However, data quality remains an extensive concern, as the generated data often lacks careful selection. This results in the downgrade of training efficiency. For instance, as shown in our training curves Figure 4, LLM fine-tuning converges within roughly half an epoch, suggesting that a substantial portion of the generated data is redundant. Although prior studies have explored methods to improve synthetic data quality [42, 71, 63], effectively incorporating these techniques into formal counterexample generation remains an open challenge.
Limited budget of model training. We provide additional case studies in Appendix § 19, which demonstrate that the limited capability (or size) of the LLM significantly compromises the performance of our framework. First, the 8B informal reasoning model frequently fails to produce correct results, even for simple calculations. Employing a larger model or incorporating tool-use strategies could help alleviate this issue. Second, the 7B formal reasoning model often struggles to follow instructions and fails to utilize the provided counterexamples when deriving formal proofs. This leads to inaccurate feedback rewards that undermine overall performance. While these limitations could likely be mitigated by using larger LLMs, resource constraints prevent us from exploring this direction at present. We leave it for future work and further investigation.
Conclusion
In this work, we investigated the crucial yet largely underexplored problem of formal counterexample generation with reasoning large language models. We identified and discussed two key challenges, data scarcity and sparse reward signals, that hinder the development of models specialized for this task. To address these issues, we introduced an integrated framework that combines a symbolic mutation strategy for large-scale counterexample synthesis with a multi-reward scheme for more effective and efficient model training. Experiments on three newly constructed benchmarks demonstrate that our approach substantially outperforms existing state-of-the-art LLMs in counterexample generation. We believe that our proposed framework opens up a promising direction for enhancing the self-reflective and self-corrective reasoning capabilities of LLMs, while also providing a practical copilot for validating mathematical conjectures.
Acknowledgments
We thank Terry Ding for pointing out an error in our formulation of the counterexample target.
Ethics Statement
This work focuses on formal counterexample generation and does not involve human subjects or sensitive data. The datasets employed are publicly available and widely used in prior research. We do not anticipate any ethical concerns or harmful applications arising from this study.
Reproducibility Statement
We provide detailed descriptions of the training and inference setup in the main text (§ 4) and Appendix § 17. All datasets and preprocessing steps are thoroughly documented. Source code is available at https://doi.org/10.6084/m9.figshare.31741879 to ensure full reproducibility.
Usage of LLMs in Paper Writing
We used GPT-4o solely for grammar checking and minor language polishing. The LLM was not involved in research ideation, data analysis, or substantive writing. The authors take full responsibility for the content of this paper.
Illustrative Examples
We further illustrate our framework using a concrete example in Figure 5. Starting from the original theorem aimeII_2001_p3_g4_extracted_54, we discard . The counterexample target aimeII_2001_p3_mut_54_drop4 retains the recurrence and the values of , but negates the conclusion to require . The auxiliary target aimeII_2001_p3_54_drop4 negates the dropped hypothesis to require . Figure 5 gives a single witness satisfying both targets.
Figure 5. A corrected mathematical illustration of our counterexample training framework. The seed theorem is an intermediate subgoal extracted from DSP+’s proof of AIME-II 2001 Problem 3 in miniF2F. The witness is an explicit construction, not a recorded model response.
Experimental Setting
In our expert iteration framework, we employ two LLMs; Qwen3 8B (Qwen Team [49]) for generating candidate counterexamples and Deepseek-Prover-V2 7B (Ren et al. [51]) for producing formal proofs. We fix the maximum generation length to 4,096 tokens and set the sampling temperature to 0.9 for both models. For weighted training, we adapt LLaMA-Factory (Zheng et al. [85]), using its default configuration (Adam optimizer (Kingma [30]) with a learning rate of and cosine learning rate schedule). Following prior work ([18, 39]), we perform an additional re-training step on the collected dataset paired with verified correct answers.
During evaluation, for each problem, we prompt Qwen3 to generate three counterexample candidates, and for each candidate, Deepseek-Prover-V2 produces three corresponding formal proofs. For verification, we employ lean-repl with a 60-second timeout and an 8GB memory limit per proof.
Regarding the prompt setting, for the baseline methods, we adopt the official prompt templates provided in their respective repositories. In our method, the prompts are designed for Qwen3 and Deepseek-Prover-V2, and are detailed in the following.
Prompt of Informal Reasoning for Counterexample Search
Find a concrete example to prove the following existential problem. Note that:
Please reason the problem and give the final answer in Natural Language.
The final answer should be in the format \boxed{{...}}. The problem is: {formal_statement}
Prompts of Formal Reasoning for Proof Generation
Complete the following Lean 4 code using the given concrete example {example}:
{header}
{formal_statement}
Additional Results
Table 3: Pass@ () rates on the validation set. The results demonstrate that our framework enables the fine-tuned model to substantially outperform baselines.
| Model | Leanabell | STP | Kimina-distill | Goedel-v2 | Deepseek-v2 | Ours | (pp) |
| ✓@1 | 25.4% | 23.7% | 9.8% | 14.0% | 14.1% | 49.8% | 24.4↑ |
| ✓@4 | 36.0% | 33.2% | 25.3% | 31.1% | 30.0% | 52.7% | 16.7↑ |
| ✓@9 | 39.9% | 37.5% | 35.8% | 38.2% | 36.2% | 54.1% | 14.2↑ |
Table 3. Pass@ () rates on the validation set. The results demonstrate that our framework enables the fine-tuned model to substantially outperform baselines.
We also evaluate the performance of our fine-tuned model against existing neural theorem provers on the split-out validation set. As shown in Table 3, the fine-tuned model substantially outperforms the existing approaches by a large margin (14.2 to 24.4 percentage points). This improvement can be attributed to our synthesized dataset and the effectiveness of multi-reward training.
We plot the pass@ curves in Figure 6 to explain why we select only in our empirical evaluation. The results show that the performance of the five existing neural theorem provers nearly converges once approaches 10. Therefore, using is sufficient to capture the performance differences in our comparison.
Figure 6. Pass@ curves of five neural theorem provers. The results are derived from the evaluation of FOR-COUNTER and show that the performance nearly converges when .
We conduct an ablation study to evaluate the contribution of each component to the overall performance. Specifically, our method first employs the fine-tuned Qwen3 to propose a candidate counterexample, and then leverages Deepseek-prover-v2 (denoted as Ds-prv-v2) to generate the formal proof based on this counterexample. To examine the necessity and effectiveness of each component, we replace the fine-tuned Qwen3 with its original version, and Ds-prv-v2 with its original version, respectively. We also include the evaluation results for the combination of the original Qwen3 and the original Ds-prv-v2 as a reference.
The overall results are presented in Table 4. They demonstrate that fine-tuning both modules contributes to performance, and combining our two fine-tuned models yields the best performance. Compared to the gains from fine-tuning the formal reasoning model, the improvements from fine-tuning the informal reasoning model are relatively marginal. We therefore conduct case studies in the next section to analyze the underlying reasons.
| Model | Pass@ | Qwen3 Ds-prv-v2 | Ours Ds-prv-v2 | Qwen3 Ours | Ours |
| Validation Set | ✓ @1 | 26.2% | 30.9% | 47.2% | 49.8% |
| Validation Set | ✓ @4 | 36.2% | 38.7% | 50.3% | 52.7% |
| Validation Set | ✓ @9 | 40.4% | 43.7% | 51.0% | 54.1% |
| FOR-COUNTER | ✓ @1 | 14.1% | 15.2% | 19.1% | 20.9% |
| FOR-COUNTER | ✓ @4 | 18.9% | 20.1% | 24.3% | 25.8% |
| FOR-COUNTER | ✓ @9 | 21.0% | 21.5% | 27.7% | 28.5% |
Table 4. Pass@ () rates for different module combinations. Results evaluated on the validation set and FOR-COUNTER show that both modules (informal reasoning and formal reasoning models) are successfully improved by fine-tuning with our framework.
Case Studies
We revisit the validation-set seed theorem used in Figure 5. We first state the corrected counterexample target, then review the earlier draft’s model-output excerpts and their limitations. The original theorem, as well as its corresponding proof, is shown below.
theorem aimeII_2001_p3_g4_extracted_54
(x : ℕ → ℤ)
(h₁ : ∀ n ≥ 5, x n = x (n - 1) - x (n - 2) + x (n - 3) - x (n - 4))
(h₂ : x 10 = -267)
(h₃ : x 11 = 211)
(h₄ : x 12 = 375)
(h₅ : x 13 ≠ 420) :
x 14 ≠ 523 := by
have h₆ : x 13 = x 12 - x 11 + x 10 - x 9 := by
rw [h₁ 13 (by omega)]
have h₇ : x 14 = x 13 - x 12 + x 11 - x 10 := by
rw [h₁ 14 (by omega)]
rw [h₇]
rw [h₂, h₃, h₄]
simp
intro h
have : x 13 = 420 := by
linarith
exact h₅ this
Dropping the last hypothesis h₅ : x 13 ≠ 420 and negating the remaining universal conjecture gives the following counterexample target. The original conclusion above remains unchanged.
theorem aimeII_2001_p3_mut_54_drop4 :
∃ (x : ℕ → ℤ),
(∀ n ≥ 5, x n = x (n - 1) - x (n - 2) + x (n - 3) - x (n - 4))
∧ x 10 = -267 ∧ x 11 = 211 ∧ x 12 = 375 ∧ x 14 = 523 := by
sorry
A concrete witness is the period-10 integer sequence with
Checking the ten residue classes verifies the recurrence. This gives , , , , and , satisfying both the counterexample and auxiliary targets.
Earlier model-output excerpts. The prompts and responses below are retained from the earlier draft. Their displayed target incorrectly used , so they must not be read as verified runs on the corrected target. These excerpts illustrate arithmetic and instruction-following errors; they do not establish performance on the corrected target. We preserve their formulas verbatim to distinguish recorded text from the corrected construction above.
Earlier Informal Prompt (Incorrect Target)
Find a concrete example to prove the following existential problem. Note that:
Please reason the problem and give the final answer in Natural Language.
The final answer should be in the format \boxed{{...}}. The problem is:
theorem aimeII_2001_p3_mut_54_drop4 :
∃ (x : ℕ → ℤ),
(∀ n ≥ 5, x n = x (n - 1) - x (n - 2) + x (n - 3) - x (n - 4))
∧ x 10 = -267 ∧ x 11 = 211 ∧ x 12 = 375 ∧ x 14 ≠ 523 := by
sorry
Response of Informal Reasoning Model (Incorrect)
We are given the recurrence relation
together with the constraints
Step 1. Characteristic polynomial. The recurrence has characteristic equation
with roots . Thus the general solution is
Step 2. Apply conditions. For we compute:
From the first and third equations: , and . Substituting into the second gives
Step 3. Check . Since and ,
Plugging in yields
which is not a real number and in particular . Conclusion. A valid function exists. One explicit example is
This satisfies the recurrence, the given values, and .
This response is incorrect: the required sequence is integer-valued, and the characteristic polynomial of the stated recurrence is , not the polynomial in the excerpt. The next response satisfies the earlier, incorrectly stated target, but it is not a counterexample to the conjecture we intend to refute.
Earlier Informal Response (Previously Mislabeled Correct)
We can explicitly construct such a sequence by fixing the first four values and then extending by the recurrence. Define
and for all set
Step 1. Compute terms. Applying the recurrence successively:
Step 2. Verify conditions.
All required conditions are satisfied.
Remark. This sequence is in fact periodic with period 10. In Lean, one can constructively define either by recursion from the initial values, or directly by cases depending on mod 10.
This sequence satisfies the recurrence and the retained values, but does not satisfy the corrected target . Its also fails the auxiliary target . Thus, although it solves the earlier displayed problem, it cannot be used as a counterexample to the intended conjecture. The following earlier formal response additionally changes the proposed sequence and fails the recurrence (for example at ). It is an erroneous attempt, not a verified proof.
Earlier Formal Prompt and Response (Incorrect Target and Proof)
Complete the following Lean 4 code using the given concrete example , , , :
theorem aimeII_2001_p3_mut_54_drop4 :
∃ (x : ℕ → ℤ),
(∀ n ≥ 5, x n = x (n - 1) - x (n - 2) + x (n - 3) - x (n - 4))
∧ x 10 = -267 ∧ x 11 = 211 ∧ x 12 = 375 ∧ x 14 ≠ 523 := by
/-
We need to find a function \( x : \mathbb{N} \to \mathbb{Z} \) that satisfies
the recurrence relation \( x(n) = x(n - 1) - x(n - 2) + x(n - 3) - x(n - 4)
\) for \( n \geq 5 \), and also satisfies \( x(10) = -267 \), \( x(11) = 211
\), \( x(12) = 375 \), and \( x(14) \neq 523 \).
We can define such a function by specifying its values at each integer up to \(
n = 14 \), ensuring that the recurrence relation is satisfied for \( n \geq 5
\). We then verify that the specific values for \( x(10) \) to \( x(14) \)
meet the given conditions.
-/
use fun n => if n = 10 then -267 else if n = 11 then 211 else if n = 12 then 375
else if n = 13 then 523 else 0
constructor
· intro n hn
simp [Nat.le_of_lt_succ, Nat.le_of_lt_succ] at hn
split_ifs <;> omega
constructor
· simp
constructor
· simp
constructor
· simp
simp
<;> norm_num
<;> omegaReferences
- [1]Janice Ahn, Rishu Verma, Renze Lou, Di Liu, Rui Zhang, and Wenpeng Yin. Large language models for mathematical reasoning: Progresses and challenges. arXiv preprint arXiv:2402.00157, 2024.arxiv.org/abs/2402.00157
- [2]Paul Ammann and Jeff Offutt. Introduction to software testing. Cambridge University Press, 2017.
- [3]Thomas Anthony, Zheng Tian, and David Barber. Thinking fast and slow with deep learning and tree search. Advances in neural information processing systems, 30, 2017.arxiv.org/abs/1705.08439
- [4]Andrea Asperti, Alberto Naibo, and Claudio Sacerdoti Coen. Thinking machines: Mathematical reasoning in the age of llms. arXiv preprint arXiv:2508.00459, 2025.DOI
- [5]Mislav Balunović, Jasper Dekoninck, Nikola Jovanović, Ivo Petrov, and Martin Vechev. Mathconstruct: Challenging llm reasoning with constructive proofs. arXiv preprint arXiv:2502.10197, 2025.arxiv.org/abs/2502.10197
- [6]Ali Barahmand. On mathematical conjectures and counterexamples. Journal of Humanistic Mathematics, 9(1):295–303, 2019. doi: 10.5642/jhummath.201901.17. URL https://scholarship.claremont.edu/jhm/vol9/iss1/17.DOI
- [7]Bruno Barras, Samuel Boutin, Cristina Cornes, Judicaël Courant, Yann Coscoy, David Delahaye, Daniel de Rauglaudre, Jean-Christophe Filliâtre, Eduardo Giménez, Hugo Herbelin, et al. The coq proof assistant reference manual. INRIA, version, 6(11):17–21, 1999.
- [8]Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In Proceedings of the 26th annual international conference on machine learning, pp. 41–48, 2009.DOI
- [9]Béatrice Bérard, Michel Bidoit, Alain Finkel, François Laroussinie, Antoine Petit, Laure Petrucci, and Philippe Schnoebelen. Systems and software verification: model-checking techniques and tools. Springer Science & Business Media, 2013.
- [10]Jasmin Christian Blanchette and Tobias Nipkow. Nitpick: A counterexample generator for higher-order logic based on a relational model finder. In International conference on interactive theorem proving, pp. 131–146. Springer, 2010.DOI
- [11]Daniil A Boiko, Robert MacKnight, Ben Kline, and Gabe Gomes. Autonomous chemical research with large language models. Nature, 624(7992):570–578, 2023.DOI
- [12]Chenrui Cao, Liangcheng Song, Zenan Li, Xinyi Le, Xian Zhang, Hui Xue, and Fan Yang. Reviving dsp for advanced theorem proving in the era of reasoning models. arXiv preprint arXiv:2506.11487, 2025.arxiv.org/abs/2506.11487
- [13]François Charton, Jordan S Ellenberg, Adam Zsolt Wagner, and Geordie Williamson. Patternboost: Constructions in mathematics with a little help from ai. arXiv preprint arXiv:2411.00566, 2024.arxiv.org/abs/2411.00566
- [14]Luoxin Chen, Jiming Gu, Liankai Huang, Wenhao Huang, Zhicheng Jiang, Allan Jie, Xiaoran Jin, Xing Jin, Chenggang Li, Xiajing Ma, et al. Seed-prover: Deep and broad reasoning for automated theorem proving. arXiv preprint arXiv:2507.23726, 2025a.arxiv.org/abs/2507.23726
- [15]Qiguang Chen, Libo Qin, Jinhao Liu, Dengyun Peng, Jiannan Guan, Peng Wang, Mengkang Hu, Yuhang Zhou, Te Gao, and Wanxiang Che. Towards reasoning era: A survey of long chain-of-thought for reasoning large language models. arXiv preprint arXiv:2503.09567, 2025b.arxiv.org/abs/2503.09567
- [16]Gheorghe Comanici, Eric Bieber, Mike Schaeekermann, Ice Pasupat, Noveen Sachdeva, Inderjit Dhillon, Marcel Blistein, Ori Ram, Dan Zhang, Evan Rosen, et al. Gemini 2.5: Pushing the frontier with advanced reasoning, multimodality, long context, and next generation agentic capabilities. arXiv preprint arXiv:2507.06261, 2025.arxiv.org/abs/2507.06261
- [17]Leonardo De Moura, Soonho Kong, Jeremy Avigad, Floris Van Doorn, and Jakob von Raumer. The lean theorem prover (system description). In International Conference on Automated Deduction, pp. 378–388. Springer, 2015.
- [18]Kefan Dong and Tengyu Ma. Stp: Self-play llm theorem provers with iterative conjecturing and proving. arXiv preprint arXiv:2502.00212, 2025.arxiv.org/abs/2502.00212
- [19]Yann Fleureau, Jia Li, Edward Beeching, Lewis Tunstall, Ben Lipkin, Roman Soletsky, Shengyi Costa Huang, and Kashif Rasul. How numinamath won the 1st aimo progress prize, 2024.
- [22]Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang, Xiao Bi, et al. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning. arXiv preprint arXiv:2501.12948, 2025.DOI
- [23]Joshua Hare. Dealing with sparse rewards in reinforcement learning. arXiv preprint arXiv:1910.09281, 2019.arxiv.org/abs/1910.09281
- [24]Colin Brian Haselgrove. A disproof of a conjecture of pólya. Mathematika, 5(2):141–145, 1958.DOI
- [25]Yingya Huang, Xiaohan Lin, Zhengying Liu, Qingxing Cao, Huajian Xin, Haiming Wang, Zhenguo Li, Linqi Song, and Xiaodan Liang. Mustard: Mastering uniform synthesis of theorem and proof data. arXiv preprint arXiv:2402.08957, 2024.arxiv.org/abs/2402.08957
- [26]Xingguang Ji, Yahui Liu, Qi Wang, Jingyuan Zhang, Yang Yue, Rui Shi, Chenxi Sun, Fuzheng Zhang, Guorui Zhou, and Kun Gai. Leanabell-prover-v2: Verifier-integrated reasoning for formal theorem proving via reinforcement learning. arXiv preprint arXiv:2507.08649, 2025.arxiv.org/abs/2507.08649
- [27]Albert Q Jiang, Sean Welleck, Jin Peng Zhou, Wenda Li, Jiacheng Liu, Mateja Jamnik, Timothée Lacroix, Yuhuai Wu, and Guillaume Lample. Draft, sketch, and prove: Guiding formal theorem provers with informal proofs. arXiv preprint arXiv:2210.12283, 2022.arxiv.org/abs/2210.12283
- [28]Albert Qiaochu Jiang, Sean Welleck, Jin Peng Zhou, Timothee Lacroix, Jiacheng Liu, Wenda Li, Mateja Jamnik, Guillaume Lample, and Yuhuai Wu. Draft, sketch, and prove: Guiding formal theorem provers with informal proofs. In The Eleventh International Conference on Learning Representations, 2023.arxiv.org/abs/2210.12283
- [29]Dongwei Jiang, Marcio Fonseca, and Shay B Cohen. Leanreasoner: Boosting complex logical reasoning with lean. arXiv preprint arXiv:2403.13312, 2024.arxiv.org/abs/2403.13312
- [30]Diederik P Kingma. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.arxiv.org/abs/1412.6980
- [31]Guillaume Lample, Timothee Lacroix, Marie-Anne Lachaux, Aurelien Rodriguez, Amaury Hayat, Thibaut Lavril, Gabriel Ebner, and Xavier Martinet. Hypertree proof search for neural theorem proving. Advances in neural information processing systems, 35:26337–26349, 2022.arxiv.org/abs/2205.11491
- [32]Leon J Lander, Thomas R Parkin, and John L Selfridge. A survey of equal sums of like powers. Mathematics of Computation, 21(99):446–459, 1967.DOI
- [33]Adam Daniel Laud. Theory and application of reward shaping in reinforcement learning. University of Illinois at Urbana-Champaign, 2004.
- [34]Lean Prover Community. plausible. https://github.com/leanprover-community/plausible, 2024. GitHub repository.
- [35]Lean Prover Community. Unused variables linter documentation. https://leanprover-community.github.io/con-nf/doc/Lean/Linter/UnusedVariables.html, 2025.
- [36]Yinghui Li, Jiayi Kuang, Haojing Huang, Zhikun Xu, Xinnian Liang, Yi Yu, Wenlian Lu, Yangning Li, Xiaoyu Tan, Chao Qu, et al. One example shown, many concepts known! counterexample-driven conceptual reasoning in mathematical llms. In Forty-second International Conference on Machine Learning, 2025.arxiv.org/abs/2502.10454
- [37]Zhaoyu Li, Jialiang Sun, Logan Murphy, Qidong Su, Zenan Li, Xian Zhang, Kaiyu Yang, and Xujie Si. A survey on deep learning for theorem proving. arXiv preprint arXiv:2404.09939, 2024.arxiv.org/abs/2404.09939
- [38]Yong Lin, Shange Tang, Bohan Lyu, Jiayun Wu, Hongzhou Lin, Kaiyu Yang, Jia Li, Mengzhou Xia, Danqi Chen, Sanjeev Arora, et al. Goedel-prover: A frontier model for open-source automated theorem proving. arXiv preprint arXiv:2502.07640, 2025a.arxiv.org/abs/2502.07640
- [39]Yong Lin, Shange Tang, Bohan Lyu, Ziran Yang, Jui-Hui Chung, Haoyu Zhao, Lai Jiang, Yihan Geng, Jiawei Ge, Jingruo Sun, et al. Goedel-prover-v2: Scaling formal theorem proving with scaffolded data synthesis and self-correction. arXiv preprint arXiv:2508.03613, 2025b.arxiv.org/abs/2508.03613
- [40]Zichen Liu, Changyu Chen, Wenjun Li, Penghui Qi, Tianyu Pang, Chao Du, Wee Sun Lee, and Min Lin. Understanding rl-zero-like training: A critical perspective. arXiv preprint arXiv:2503.20783, 2025.
- [42]Niklas Muennighoff, Zitong Yang, Weijia Shi, Xiang Lisa Li, Li Fei-Fei, Hannaneh Hajishirzi, Luke Zettlemoyer, Percy Liang, Emmanuel Candès, and Tatsunori Hashimoto. s1: Simple test-time scaling. arXiv preprint arXiv:2501.19393, 2025.arxiv.org/abs/2501.19393
- [43]Alexander Novikov, Ngân Vũ, Marvin Eisenberger, Emilien Dupont, Po-Sen Huang, Adam Zsolt Wagner, Sergey Shirobokov, Borislav Kozlovskii, Francisco JR Ruiz, Abbas Mehrabian, et al. Alphaevolve: A coding agent for scientific and algorithmic discovery. arXiv preprint arXiv:2506.13131, 2025.
- [44]OpenAI. Introducing openai o1 preview. Technical report, OpenAI, 2023. URL https://openai.com/index/introducing-openai-o1-preview/.
- [45]Markus Pantsar. How to recognize artificial mathematical intelligence in theorem proving. Topoi, pp. 1–14, 2025.
- [46]Lawrence C Paulson et al. The isabelle reference manual. Technical report, University of Cambridge, Computer Laboratory, 1993.
- [47]Gabriel Poesia, David Broman, Nick Haber, and Noah Goodman. Learning formal mathematics from intrinsic motivation. Advances in Neural Information Processing Systems, 37:43032–43057, 2024.arxiv.org/abs/2407.00695
- [48]Stanislas Polu, Jesse Michael Han, Kunhao Zheng, Mantas Baksys, Igor Babuschkin, and Ilya Sutskever. Formal mathematics statement curriculum learning. arXiv preprint arXiv:2202.01344, 2022.arxiv.org/abs/2202.01344
- [49]Qwen Team. Qwen3 technical report, 2025. URL https://arxiv.org/abs/2505.09388.
- [50]A David Redish. Vicarious trial and error. Nature Reviews Neuroscience, 17(3):147–159, 2016.DOI
- [51]ZZ Ren, Zhihong Shao, Junxiao Song, Huajian Xin, Haocheng Wang, Wanjia Zhao, Liyue Zhang, Zhe Fu, Qihao Zhu, Dejian Yang, et al. Deepseek-prover-v2: Advancing formal mathematical reasoning via reinforcement learning for subgoal decomposition. arXiv preprint arXiv:2504.21801, 2025.
- [52]Matthew Renze and Erhan Guven. Self-reflection in llm agents: Effects on problem-solving performance. arXiv preprint arXiv:2405.06682, 2024.DOI
- [53]Martin Riedmiller, Roland Hafner, Thomas Lampe, Michael Neunert, Jonas Degrave, Tom Wiele, Vlad Mnih, Nicolas Heess, and Jost Tobias Springenberg. Learning by playing solving sparse reward tasks from scratch. In International conference on machine learning, pp. 4344–4353. PMLR, 2018.
- [54]Bernardino Romera-Paredes, Mohammadamin Barekatain, Alexander Novikov, Matej Balog, M Pawan Kumar, Emilien Dupont, Francisco JR Ruiz, Jordan S Ellenberg, Pengming Wang, Omar Fawzi, et al. Mathematical discoveries from program search with large language models. Nature, 625(7995):468–475, 2024.
- [56]Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, YK Li, Yang Wu, et al. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300, 2024.
- [57]Trieu H Trinh, Yuhai Wu, Quoc V Le, He He, and Thang Luong. Solving olympiad geometry without human demonstrations. Nature, 625(7995):476–482, 2024.DOI
- [58]George Tsoukalas, Jasper Lee, John Jennings, Jimmy Xin, Michelle Ding, Michael Jennings, Amitayush Thakur, and Swarat Chaudhuri. Putnambench: Evaluating neural theorem-provers on the putnam mathematical competition. Advances in Neural Information Processing Systems, 37:11545–11569, 2024.arxiv.org/abs/2407.11214
- [61]Haiming Wang, Huajian Xin, Chuanyang Zheng, Lin Li, Zhengying Liu, Qingxing Cao, Yinya Huang, Jing Xiong, Han Shi, Enze Xie, et al. Lego-prover: Neural theorem proving with growing libraries. arXiv preprint arXiv:2310.00656, 2023.arxiv.org/abs/2310.00656
- [62]Haiming Wang, Mert Unsal, Xiaohan Lin, Mantas Baksy, Junqi Liu, Marco Dos Santos, Flood Sung, Marina Vinyes, Zhenzhe Ying, Zekai Zhu, et al. Kimina-prover preview: Towards large formal reasoning models with reinforcement learning. arXiv preprint arXiv:2504.11354, 2025.arxiv.org/abs/2504.11354
- [63]Jiachen Tianhao Wang, Tong Wu, Dawn Song, Prateek Mittal, and Ruoxi Jia. Greats: Online selection of high-quality data for llm training in every iteration. Advances in Neural Information Processing Systems, 37:131197–131223, 2024a.DOI
- [64]Ke Wang, Jiahui Zhu, Minjie Ren, Zeming Liu, Shiwei Li, Zongye Zhang, Chenkai Zhang, Xiaoyu Wu, Qiqi Zhan, Qingjie Liu, et al. A survey on data synthesis and augmentation for large language models. arXiv preprint arXiv:2410.12896, 2024b.arxiv.org/abs/2410.12896
- [65]Mingzhe Wang and Jia Deng. Learning to prove theorems by learning to generate theorems. Advances in neural information processing systems, 33:18146–18157, 2020.arxiv.org/abs/2002.07019
- [66]Chenrui Wei, Mengzhou Sun, and Wei Wang. Proving olympiad algebraic inequalities without human demonstrations. Advances in Neural Information Processing Systems, 37:82811–82822, 2024.arxiv.org/abs/2406.14219
- [67]Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Fei Xia, Ed Chi, Quoc V Le, Denny Zhou, et al. Chain-of-thought prompting elicits reasoning in large language models. Advances in neural information processing systems, 35:24824–24837, 2022.arxiv.org/abs/2201.11903
- [68]Shaonan Wu, Shuai Lu, Yeyun Gong, Nan Duan, and Ping Wei. Alchemy: Amplifying theorem-proving capability through symbolic mutation. arXiv preprint arXiv:2410.15748, 2024a.arxiv.org/abs/2410.15748
- [69]Yuhui Wu, Albert Qiaochu Jiang, Wenda Li, Markus Rabe, Charles Staats, Mateja Jamnik, and Christian Szegedy. Autoformalization with large language models. Advances in neural information processing systems, 35:32353–32368, 2022.arxiv.org/abs/2205.12615
- [70]Zijian Wu, Suozhi Huang, Zhejian Zhou, Huaiyuan Ying, Jiayu Wang, Dahua Lin, and Kai Chen. Internlm2. 5-stepprover: Advancing automated theorem proving via expert iteration on large-scale lean problems. arXiv preprint arXiv:2410.15700, 2024b.
- [71]Mengzhou Xia, Sadhika Malladi, Suchin Gururangan, Sanjeev Arora, and Danqi Chen. Less: Selecting influential data for targeted instruction tuning. arXiv preprint arXiv:2402.04333, 2024.arxiv.org/abs/2402.04333
- [72]Huajian Xin, Daya Guo, Zhihong Shao, Zhizhou Ren, Qihao Zhu, Bo Liu, Chong Ruan, Wenda Li, and Xiaodan Liang. Deepseek-prover: Advancing theorem proving in llms through large-scale synthetic data. arXiv preprint arXiv:2405.14333, 2024.arxiv.org/abs/2405.14333
- [73]Kaiyu Yang, Aidan Swope, Alex Gu, Rahul Chalamala, Peiyang Song, Shixing Yu, Saad Godil, Ryan J Prenger, and Animashree Anandkumar. Leandojo: Theorem proving with retrieval-augmented language models. Advances in Neural Information Processing Systems, 36:21573–21612, 2023.arxiv.org/abs/2306.15626
- [74]Kaiyu Yang, Gabriel Poesia, Jingxuan He, Wenda Li, Kristin Lauter, Swarat Chaudhuri, and Dawn Song. Formal mathematical reasoning: A new frontier in ai. arXiv preprint arXiv:2412.16075, 2024.arxiv.org/abs/2412.16075
- [75]David Yin and Jing Gao. Generating millions of lean theorems with proofs by exploring state transition graphs. arXiv preprint arXiv:2503.04772, 2025.arxiv.org/abs/2503.04772
- [76]Huaiyuan Ying, Zijian Wu, Yihan Geng, Jiayu Wang, Dahua Lin, and Kai Chen. Lean workbook: A large-scale lean problem set formalized from natural language math problems. Advances in Neural Information Processing Systems, 37:105848–105863, 2024.arxiv.org/abs/2406.03847
- [77]H Peyton Young. Learning by trial and error. Games and economic behavior, 65(2):626–643, 2009.
- [78]Longhui Yu, Weisen Jiang, Han Shi, Jincheng Yu, Zhengying Liu, Yu Zhang, James T Kwok, Zhenguo Li, Adrian Weller, and Weiyang Liu. Metamath: Bootstrap your own mathematical questions for large language models. arXiv preprint arXiv:2309.12284, 2023.arxiv.org/abs/2309.12284
- [79]Zhouliang Yu, Ruotian Peng, Keyi Ding, Yizhe Li, Zhongyuan Peng, Minghao Liu, Yifan Zhang, Zheng Yuan, Huajian Xin, Wenhao Huang, et al. Formalmath: Benchmarking formal mathematical reasoning of large language models. arXiv preprint arXiv:2505.02735, 2025.arxiv.org/abs/2505.02735
- [80]Rina Zazkis and Egan J Chernoff. What makes a counterexample exemplary? Educational Studies in Mathematics, 68(3):195–208, 2008.DOI
- [81]Liang Zeng, Liangjun Zhong, Liang Zhao, Tianwen Wei, Liu Yang, Jujie He, Cheng Cheng, Rui Hu, Yang Liu, Shuicheng Yan, et al. Skywork-math: Data scaling laws for mathematical reasoning in large language models–the story goes on. arXiv preprint arXiv:2407.08348, 2024.arxiv.org/abs/2407.08348
- [82]Kaiyan Zhang, Yuxin Zuo, Bingxiang He, Youbang Sun, Runze Liu, Che Jiang, Yuchen Fan, Kai Tian, Guoli Jia, Pengfei Li, et al. A survey of reinforcement learning for large reasoning models. arXiv preprint arXiv:2509.08827, 2025a.arxiv.org/abs/2509.08827
- [83]Terry Jingchen Zhang, Wenyu an Jiang, Rongchuan Liu, Yisong Wang, Junran Yang, Ning Wang, Nicole Ni, Yinyua Huang, and Mrinmaya Sachan. Lean meets theoretical computer science: Scalable synthesis of theorem proving challenges in formal-informal pairs. arXiv preprint arXiv:2508.15878, 2025b.arxiv.org/abs/2508.15878
- [84]Kunhao Zheng, Jesse Michael Han, and Stanislas Polu. Minif2f: a cross-system benchmark for formal olympiad-level mathematics. arXiv preprint arXiv:2109.00110, 2021.arxiv.org/abs/2109.00110
- [85]Yaowei Zheng, Richong Zhang, Junhao Zhang, Yanhan Ye, Zheyan Luo, Zhangchi Feng, and Yongqiang Ma. Llamafactory: Unified efficient fine-tuning of 100+ language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations), Bangkok, Thailand, 2024. Association for Computational Linguistics. URL http://arxiv.org/abs/2403.13372.





