LeanSearch v2: Global Premise Retrieval for Lean 4 Theorem Proving
Guoxiong Gao, Zeming Sun, Jiedong Jiang, Yutong Wang, jd xu, Peihao Wu, Bryan Dai, Bin Dong
NeurIPS page · OpenReview · Open on the map
Category: LLM Agents, Evals & Benchmarks › Mathematical Reasoning Benchmarks · Type: new method · Keywords: global premise retrieval, theorem proving, Lean 4, information retrieval, automated reasoning
Areas: LLM Reasoning › Agentic Reasoning › Verifiable Reasoning Agents; Evaluation & Benchmarks › Language Model and Agent Benchmarks › Formal Mathematics Benchmarks
Summary
LeanSearch v2 introduces a two-mode retrieval system for global premise retrieval in Lean 4 theorem proving, achieving state-of-the-art single-query retrieval and improving downstream proof success.
Explained to a 5-year-old
In math, you sometimes need many little facts to prove something big. Existing tools only find one fact at a time, which isn't enough. The new system looks for many facts together to help finish the proof. It works on a big collection of math facts called Mathlib. By finding the right facts, it helps computers prove more theorems correctly.
Explained to a 5-year-old, longer
When you want to prove a math statement, you need to use many small facts from a big library. Usually, computers can only find one fact at a time, which makes it hard to finish the proof. The new system is designed to find many facts together, like a team of helpers. It works on a huge collection of math facts called Mathlib, which is organized in a special way. The system has two modes: one for quickly finding the best single fact, and another for building a group of facts. In the second mode, it repeatedly guesses a proof sketch, looks for related facts, and checks if they fit. This process repeats until it has gathered enough facts to make a complete proof. By collecting many relevant facts at once, the system can give the prover everything it needs. This approach improves the chances that the computer can finish the proof without getting stuck. The system was tested on a set of 69 challenging math problems. It succeeded in finding the right group of facts for almost half of those problems. Because the facts are better, the computer can prove more theorems correctly.
For a technical reader
The paper addresses the challenge of retrieving multiple relevant lemmas from a large formal mathematics library when proving a theorem. Existing retrieval tools either search for a single matching lemma or select lemmas step-by-step, which is insufficient for the full proof context. The proposed system introduces a two-stage retrieval pipeline: a standard embedding-based search for individual lemmas and a reasoning stage that iteratively refines a proof sketch by retrieving and evaluating candidate lemmas. Evaluations on a benchmark of 69 research-level theorems show that the reasoning stage recovers nearly half of the required premise groups within the top ten candidates and improves downstream proof success rates from 4% to 20%. The open-source release includes the system, data, and benchmarks for further research.
Problem
Theorem proving often requires finding a set of relevant lemmas from a large library, but existing retrieval tools only find individual lemmas or select them step-by-step, missing the full premise set needed for a complete proof.
Method
The approach uses a standard mode that embeds a hierarchy-informalized Mathlib corpus and re-ranks candidates, and a reasoning mode that iteratively sketches, retrieves, and reflects to gather global premise sets.
Results
The approach achieves nDCG@10 of 0.62 on single-query retrieval, recovers 46.1% of ground-truth premise groups within 10 candidates on the benchmark, and reaches 20% proof success in downstream evaluation.
Contributions
The paper introduces a two-mode retrieval system that performs both standard and reasoning retrieval for global premise retrieval, and demonstrates that improved retrieval translates to higher proof success rates.
Practical relevance
Open-sourcing the system and data enables broader research and deployment of automated theorem provers that rely on high-quality premise retrieval.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction