LeanSearch v2: Global Premise Retrieval for Lean 4 Theorem Proving

📅 2026-05-13
📈 Citations: 0
Influential: 0
📄 PDF

career value

170K/year
🤖 AI Summary
This work addresses the challenge in Lean 4 theorem proving that existing tools struggle to retrieve the complete set of prerequisite lemmas needed for a full proof in a single pass. The paper introduces LeanSearch v2, the first dual-mode system supporting global premise retrieval: its standard mode leverages a hierarchical informal Mathlib corpus with an embedding-reranking pipeline for efficient one-shot retrieval, while its reasoning mode employs an iterative sketch-retrieve-reflect loop that enhances recall quality without domain-specific fine-tuning. Evaluated on 69 research-level theorems, the reasoning mode retrieves 46.1% of the true premise sets within just 10 candidates, substantially outperforming baselines. When integrated into a prover, it achieves a 20% proof success rate—significantly higher than both no retrieval (4%) and the next-best system (16%).
📝 Abstract
Proving theorems in Lean 4 often requires identifying a scattered set of library lemmas whose joint use enables a concise proof -- a task we call global premise retrieval. Existing tools address adjacent problems: semantic search engines find individual declarations matching a query, while premise-selection systems predict useful lemmas one tactic step at a time. Neither recovers the full premise set an entire theorem requires. We present LeanSearch v2, a two-mode retrieval system for this task. Its standard mode applies a hierarchy-informalized Mathlib corpus with an embedding-reranker pipeline, achieving state-of-the-art single-query retrieval without domain-specific fine-tuning (nDCG@10 of 0.62 vs. 0.53 for the next-best system). Its reasoning mode builds on standard mode as its retrieval substrate, targeting global premise retrieval through iterative sketch-retrieve-reflect cycles. On a 69-query benchmark of research-level Mathlib theorems, reasoning mode recovers 46.1% of ground-truth premise groups within 10 retrieved candidates, outperforming strong reasoning retrieval systems (38.0%) and premise-selection baselines (9.3%) on the same benchmark. In a controlled downstream evaluation with a fixed prover loop, replacing alternative retrievers with LeanSearch v2 yields the highest proof success (20% vs. 16% for the next-best system and 4% without retrieval), confirming that retrieval quality propagates to proof generation. We have open-sourced all code, data, and benchmarks. Code and data: https://github.com/frenzymath/LeanSearch-v2 . The standard mode is publicly available with API access at https://leansearch.net/ .
Problem

Research questions and friction points this paper is trying to address.

global premise retrieval
theorem proving
Lean 4
premise selection
semantic search
Innovation

Methods, ideas, or system contributions that make the work stand out.

global premise retrieval
Lean 4
embedding-reranker pipeline
iterative sketch-retrieve-reflect
theorem proving
🔎 Similar Papers
2024-03-20Conference on Empirical Methods in Natural Language ProcessingCitations: 1
G
Guoxiong Gao
School of Mathematical Sciences, Peking University; IQuest Research
Z
Zeming Sun
School of Mathematical Sciences, Peking University; Research Institute for Mathematical Sciences, Kyoto University
J
Jiedong Jiang
Westlake Institute for Advanced Study, Westlake University
Y
Yutong Wang
School of Mathematical Sciences, Peking University; IQuest Research
J
Jingda Xu
IQuest Research
P
Peihao Wu
IQuest Research
B
Bryan Dai
IQuest Research
Bin Dong
Bin Dong
Beijing International Center for Mathematical Research, Peking University
Scientific ComputingComputational ImagingMachine Learning