Introduction
Interactive Theorem Proving (ITP) systems, such as HOL4 or Coq, are essential for creating highly trustworthy, machine-checked mathematical proofs and verifying critical software. However, they demand intense human expertise. Users must manually guide the system by providing "tactics" (high-level proof strategies like induction or simplification) and specific arguments to break a main theorem down into simpler subgoals.
Recent machine learning approaches have attempted to automate this process by training models to imitate human proofs. Unfortunately, human proofs are scarce, not always optimal, and restrict an AI agent's ability to discover novel mathematical insights. Furthermore, existing ML systems typically rely on fixed, computationally expensive search strategies (like Breadth-First Search or Beam Search) to explore the proof tree.
To address these limitations, researchers introduce TacticZero, a novel Deep Reinforcement Learning (DRL) framework for ITP that learns to prove mathematical theorems entirely from scratch. By formulating the proof process as a Markov Decision Process (MDP) where the agent manages its own search tree, TacticZero learns both tactic selection and dynamic proof search strategies, outperforming existing automated theorem provers without relying on human proof examples.
Formulating ITP as a Markov Decision Process
The core innovation of TacticZero is its formulation of ITP as an MDP with a flexible state representation that naturally supports backtracking.
- State Representation (Fringes): Instead of just looking at the current goal, the state is represented as a sequence of "fringes." A fringe is a set of subgoals that, if all proven, will prove the original theorem.
- Action Space: At each step, the agent chooses a 4-tuple: (1) which fringe to work on, (2) which goal within that fringe to attack, (3) which tactic to apply, and (4) the arguments for that tactic. Choosing a newly generated fringe means continuing down a path; choosing an older fringe effectively executes a "backtrack."
By framing backtracking simply as "choosing an older fringe," TacticZero elegantly maps a complex tree-search problem into a standard RL action space.
Neural Architecture and Training
The agent uses multiple neural network modules to navigate this action space:
- A feed-forward Goal Network scores how easy a goal is to prove, helping select the best fringe.
- A feed-forward Tactic Network selects the best tactic for the chosen goal.
- An LSTM-based Argument Network recurrently selects a sequence of arguments (like previous theorems or variables) required by the chosen tactic.
The system is trained end-to-end using Policy Gradients (REINFORCE). To handle the sparse reward of finding a valid proof, the authors use reward shaping (small rewards for making progress) and a custom replay buffer that forces the agent to re-walk its recent successful proofs if it starts forgetting them. The training data consists of 1,342 theorems from the HOL4 Core Library, providing only the statements of the theorems for the agent to practice on, not the human proofs.
Key Results and Insights
By allowing the RL agent to learn its own search strategy (via fringe selection), it avoids the pitfalls of fixed algorithms. It takes fewer steps than Breadth-First Search (BFS) and finds shorter, more elegant proofs than Depth-First Search (DFS). Because the agent isn't constrained by human imitation, it can even discover proofs that are significantly shorter and less redundant than those written by human experts.
- Overall Performance: TacticZero successfully proved 132 out of 268 (49.4%) unseen test theorems given a 10-second timeout per theorem.
- Beating the "Hammers": TacticZero outperformed state-of-the-art automated theorem provers (hammers) available in HOL4. When using all available facts, E, Vampire, and Z3 solved only 68, 47, and 41 theorems, respectively. Even when combining all three hammers with advanced premise selection, they only solved 112 theorems compared to TacticZero's 132.
- Ablation on Search Strategy: When the learned tactic/argument policies were paired with fixed search strategies, performance dropped. For example, BFS solved at most 116 theorems, and DFS solved at most 96, proving that TacticZero's learned dynamic search is a key driver of its success.
Limitations and Future Work
Currently, the agent's action space is constrained: it can only select arguments from a pre-existing pool of candidate theorems and variables. It cannot freely generate entirely new, complex HOL4 terms (e.g., synthesizing a novel mathematical expression to use as an induction hypothesis).
Future work aims to expand the action space to allow for the free generation of complex terms. The authors also plan to scale the framework to train on massive, individual HOL4 verification projects, such as the CakeML verified compiler library.
Summary updated