Proving Theorems Recursively

Haiming Wang, Huajian Xin, Zhengying Liu, Wenda Li, Yinya Huang, Jianqiao Lu, Zhicheng Yang, Jing Tang, Jian Yin, Zhenguo Li, Xiaodan Liang

Introduction

Automated theorem proving (ATP) represents a foundational challenge in artificial intelligence, sitting at the intersection of symbolic logic and neural generation. While Large Language Models (LLMs) have demonstrated remarkable capabilities in generating mathematical proofs, they often struggle with the "tunnel vision" inherent in step-by-step generation. These models frequently become entangled in low-level calculations, losing the global logical structure and succumbing to a "search explosion"—a state where the model explores an exponentially growing number of irrelevant proof paths.

To address these limitations, researchers have introduced POETRY (PrOvE Theorems RecursivelY). This framework shifts the paradigm from linear generation to a hierarchical, "big picture" approach, mimicking the way human mathematicians conceptualize proofs: by sketching an outline first and refining the details later.

The Challenge of Linear Proof Generation

Traditional neural theorem provers typically operate myopically. They generate proofs one line at a time, guided by local heuristics like log-probability. While effective for short proofs, this method encounters a "complexity wall." As a theorem's difficulty increases, a single distracting or overly complex subgoal can lead the model into a logical dead-end that appears statistically plausible but is logically irrelevant.

Empirical evidence suggests that standard models often fail when a proof exceeds approximately 10 steps. The search space becomes too vast to navigate without a high-level strategy, making it nearly impossible for linear models to maintain the coherence required for deeper, more intricate mathematical problems.

POETRY: Recursive Proof Sketching

The core innovation of POETRY is the Recursive Proof Sketch, a method that leverages the formal structure of the Isabelle theorem prover to decompose complex problems.

The sorry Tactic

In the Isabelle environment, the sorry command acts as a placeholder, telling the system: "Assume this conjecture is true for now; I will prove it later." POETRY utilizes this tactic to create verifiable abstractions. Instead of writing a full proof immediately, the model generates a high-level "sketch" that outlines the primary logical leaps, using sorry to bypass grueling intermediate steps.

Recursive Best-First Search (BFS)

POETRY employs a level-by-level search strategy to fill in these gaps:

  1. Level 1 Sketching: The model searches for a high-level sketch that Isabelle can verify as structurally sound.
  2. Recursive Refinement: Once a Level 1 sketch is verified, the model "pauses" and recursively enters Level 2 to prove the specific conjectures previously skipped with sorry.
  3. Backpropagation of Failure: If a model realizes a skipped conjecture is actually unprovable (a "false sketch"), it signals the level above to abandon that path and seek an alternative high-level strategy.

This "divide and conquer" approach ensures the model remains focused on a single level of abstraction at a time, preventing the exponential search explosion that plagues linear models.

Experimental Evaluation

The researchers evaluated POETRY using two primary benchmarks:

  • miniF2F: A standard suite of 488 competition-level problems from sources like the International Mathematical Olympiad (IMO) and AIME.
  • PISA (Portal for Isabelle): The authors utilized an updated version of this dataset based on Isabelle 2022, comprising 3.02 million proof steps. They specifically categorized the data into "single-level" (simple) and "multi-level" (complex) subsets to isolate and test the model's recursive capabilities.

Results and Impact

POETRY demonstrated significant improvements over existing state-of-the-art (SOTA) methods:

  • Performance Gains: On the miniF2F test set, POETRY achieved a 42.2% pass rate, representing a 5.1% absolute improvement over previous leading methods like Thor+Magnushammer.
  • Breaking the Length Barrier: Perhaps the most striking result is the increase in proof depth. While baseline models often hit a wall at 10 steps, POETRY successfully generated proofs up to 26 steps long. By decomposing a long proof into several short sketches, the model avoids the exponential search explosion.
  • Efficiency in Complexity: On the "multi-level" subset of the PISA dataset—representing the hardest problems—POETRY outperformed the baseline by 2.5%, proving 99 theorems that traditional step-by-step approaches simply could not solve.

Conclusion and Future Directions

POETRY formalizes hierarchical thinking in automated theorem proving, proving that verifiable abstraction is a powerful tool for navigating complex logical spaces. By mimicking human intuition through recursive sketching, the framework significantly extends the reach of neural provers.

However, challenges remain. The "false sketch" trap—where a model generates a structurally sound but logically impossible high-level path—remains a source of computational waste. Furthermore, the current implementation is specific to the Isabelle/Isar language. Future work may involve porting these recursive techniques to other environments like Lean or Coq and integrating "hammers" (automated tools that solve simple subgoals instantly) to further boost performance.

Summary updated

BibTeX
@inproceedings{wang2024proving,
  author = {Haiming Wang and Huajian Xin and Zhengying Liu and Wenda Li and Yinya Huang and Jianqiao Lu and Zhicheng YANG and Jing Tang and Jian Yin and Zhenguo Li and Xiaodan Liang},
  title = {{Proving Theorems Recursively}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=yAa5l92TtQ},
}
Figure