Papers
Topics
Authors
Recent
Search
2000 character limit reached

DreamProver: Evolving Transferable Lemma Libraries via a Wake-Sleep Theorem-Proving Agent

Published 29 Apr 2026 in cs.AI | (2604.26311v1)

Abstract: We introduce DreamProver, an agentic framework that leverages a "wake-sleep" program induction paradigm to discover reusable lemmas for formal theorem proving. Existing approaches either rely on fixed lemma libraries, which limit adaptability, or synthesize highly specific intermediate lemmas tailored to individual theorems, thereby lacking generality. DreamProver addresses this gap through an iterative two-stage process. In the wake stage, DreamProver attempts to prove theorems from a training set using the current lemma library while proposing new candidate lemmas. In the "sleep" stage, it abstracts, refines, and consolidates these candidates to compress and optimize the library. Through this alternating cycle, DreamProver progressively evolves a compact set of high-level, transferable lemmas that can be effectively used to prove unseen theorems in related domains. Experimental results demonstrate that DreamProver substantially improves proof success rates across a diverse set of mathematical benchmarks, while also producing more concise proofs and reducing computational cost.

Summary

  • The paper introduces an iterative wake-sleep framework that evolves reusable lemma libraries, significantly boosting theorem-proving success rates.
  • It employs semantic clustering and ablation analysis to abstract and prune intermediate lemmas, thereby enhancing proof efficiency and transferability.
  • Empirical results show up to 61% increase in solved theorems and 48% token reduction per proof, underscoring both practical effectiveness and theoretical innovation.

DreamProver: Iterative Wake-Sleep Lemma Library Learning for Automated Theorem Proving

Introduction

"DreamProver: Evolving Transferable Lemma Libraries via a Wake-Sleep Theorem-Proving Agent" (2604.26311) introduces a novel agentic framework for automating the induction and refinement of reusable lemma libraries in formal theorem proving. Distinct from existing approaches that either leverage fixed repositories or resort to generating ad hoc intermediate lemmas per problem, DreamProver employs an iterative wake-sleep algorithmic paradigm, facilitating continual abstraction and consolidation of lemmas into a compact, high-utility, and transferable knowledge base. This directly addresses the deficiency of cross-theorem lemma reuse found in prior work, especially as emphasized by empirical failures in existing “library learning” baselines. Figure 1

Figure 1: Schematic illustration of DreamProver’s wake–sleep cycles for lemma library evolution by alternating between proof construction and semantic abstraction/pruning.

Methodological Framework

DreamProver’s algorithmic pipeline is structured as alternating “wake” and “sleep” phases. In the wake stage, the system, equipped with its current lemma library, attempts to prove a suite of target theorems using LLMs capable of subgoal decomposition and proof synthesis. Subgoals and intermediate theorems arising in failed or nontrivial proofs are recursively surfaced for further analysis. The sleep stage then performs semantic clustering of these subgoals—annotated using LLMs for natural-language explanations—and executes abstraction procedures to propose general candidate lemmas for each cluster. Redundant, highly specific, or unused lemmas are pruned using structured graph-based similarity metrics, and only verified and frequently utilized lemmas are retained via a least-recently-used (LRU) criterion.

This approach ensures library compactness, promotes strong abstraction and transfer, and prevents an explosion in context size or lemma redundancy, which are primary bottlenecks in agentic or retrieval-enhanced systems. The method’s rigorous ablation analyses demonstrate that both cluster-based abstraction and iterative refinement cycles are necessary conditions for effective generalization; without them, reusability and downstream success collapse to the baseline agentic setting.

Empirical Results

DreamProver’s experimental evaluation is comprehensive, spanning (1) established domains with strong LLM coverage (inequalities, number theory, combinatorics) and (2) underrepresented domains (plane geometry—LeanGeo, and machine learning theory—FormalML).

  • Theorem Proving Success Rate: DreamProver achieves average gains of 61% in solved theorems over agentic baselines (e.g., Hilbert) and even more over open-source LLMs across classical domains.
  • Proof Efficiency and Quality: It yields 50% shorter proofs and reduces token usage per theorem by up to 48% compared to the best strong agentic system.
  • Transferability: Up to 58% of learned library lemmas are reused in subsequent evaluation on unseen theorems, with a corresponding coverage of up to 71% of all theorems successfully proved in test sets—a sharp contrast to the near-zero lemma reuse observed in prior works. Figure 2

    Figure 2: Comparison of output token budgets per proved theorem, demonstrating DreamProver’s substantial computational efficiency across representative benchmarks.

    Figure 3

    Figure 3: Proof length statistics, illustrating a marked decrease in proof lengths with DreamProver, indicating greater conciseness and abstraction.

On benchmarks where the domain is not represented in LLM pretraining data or canonical formal libraries (e.g., LeanGeo and FormalML), DreamProver still provides relative improvements of up to 161% in challenging settings. Notably, on plane geometry and machine learning theory, where even state-of-the-art proprietary LLMs are nearly nonfunctional on Olympiad or competition-level instances, the inclusion of a DreamProver-evolved lemma library increases solved instances from near-zero to up to 16 (geometry) or 95 (machine learning theory).

Theoretical and Practical Implications

DreamProver establishes strong empirical evidence that iterative abstraction and pruning, guided by experience and clustering, enable reusable intermediate results in tasks where earlier LLM “library learning” approaches have failed to deliver transfer. The wake-sleep model leverages the structural and semantic similarities among intermediate goals to evolve core abstractions, mirroring human mathematical practice, and amplifies downstream proof efficiency and success. The approach is agnostic to formal system backend and can layer over any sufficiently capable LLM or step-prover for both “hard” and “soft” domains.

For practical deployment, the method’s output lemma library is generally small enough to fit into LLM context—mitigating scaling concerns regarding context window size. However, in scenarios where the domain is ambiguous or wide-ranging (thus requiring multiple libraries), retrieval-augmented premise selection or embedding-based selection becomes critical for future versions.

Theoretically, DreamProver’s empirical ablation shows that lemma library utility is not a simple function of lemma abundance but critically hinges on abstraction quality, semantic clustering, and recurrence across independent problems. This positions semantic library learning as a central ingredient for progress on automated formal mathematics, especially at research-level difficulty and under domain shift.

Outlook and Future Directions

Future avenues of investigation include: (1) scaling the approach to settings with abundant and overlapping domains, where more sophisticated, possibly GNN-based, premise selection will be required to avoid context overload; (2) adapting DreamProver for continual online learning in data-limited or entirely novel research domains, gradually accumulating lemma knowledge; and (3) integrating tight feedback between theorem proving and premise selection, potentially leveraging multimodal representation alignment between symbolic, graphical, and natural language descriptors.

Given the dramatic improvements in lemma reuse and computational cost, DreamProver effectively redefines the operational possibilities for library-based automated theorem proving, demonstrating that meaningful library transfer and accumulation is achievable via structured wake-sleep cycles.

Conclusion

DreamProver provides an effective, agentic framework for evolving transferable lemma libraries in automated theorem proving. By integrating semantic clustering, iterative abstraction, and empirical pruning in a wake-sleep paradigm, the agent achieves substantial improvements in proof success rate, proof length, and computational efficiency over both LLM-based and traditional agentic baselines. The findings substantially contradict prior claims regarding the infeasibility of lemma library reuse in neural theorem proving and lay the groundwork for sustained library-driven advances in both practical and theoretical domains of AI-reasoning.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 4 likes about this paper.