TL;DR
DAPS (Dependency-Aware Premise Selection) shifts the paradigm of finding mathematical "building blocks" for AI provers from simple text similarity to structural graph analysis. By leveraging the dependency network of the Lean 4 library and a new corpus of research-level "Blueprints," DAPS significantly improves an LLM's ability to find rare, specialized lemmas, outperforming existing state-of-the-art selectors by over 11 points in recall.
What Problem Does This Paper Address?
To prove a complex mathematical theorem, an AI must perform premise selection: identifying which existing lemmas or definitions from a massive library (like Lean’s Mathlib4) are needed for the proof.
Current state-of-the-art tools treat this as a semantic search problem—essentially asking, "Which lemmas look like my goal?" However, the authors identify three "intrinsic limitations" to this approach:
- Frequency Bias: Popular, foundational lemmas (like basic arithmetic) drown out the rare, specialized ones actually needed for advanced research.
- Isolated Ranking: Current models rank lemmas one-by-one, ignoring whether a set of lemmas works together as a coherent toolkit.
- Distribution Shift: Models trained on standard libraries fail when faced with "out-of-distribution" queries, such as informal natural language or high-level competition math (IMO-level).
The core insight of this paper is that mathematics is structured by dependencies, not just similarities. A lemma is useful because of where it sits in the graph of mathematical knowledge, not just because its name sounds relevant.
Methods
The authors introduce DAPS, a selector that "restores the signal" of mathematical structure through three main innovations:
- Structural Neighborhood Encoding: Instead of just looking at a lemma's text, DAPS encodes its "neighborhood" in the dependency graph. It looks at the 2-hop subgraph (what the lemma uses and what uses it) to understand its functional role.
- Group-Level Contrastive Objective: Most models are trained to find the right premise. DAPS is trained to pull an entire group of "gold" premises toward the query simultaneously, teaching the model to recognize sets of lemmas that are jointly useful.
- Mathlib-to-Blueprint Adaptation: The model undergoes a two-stage training process. It first learns the dense structure of the 6.5-million-edge Mathlib4 graph, then fine-tunes on a smaller, "frontier" dataset of research projects to capture how experts formalize new math.
Datasets
The researchers curated a massive amount of underused Lean 4 data:
- Mathlib4 Graph: A typed, multi-level Directed Acyclic Graph (DAG) with 275k+ nodes and 6.5M edges, capturing every connection between declarations in the standard library.
- Lean Blueprints: The first systematic mining of 53 collaborative research projects (e.g., the Prime Number Theorem project). This yielded 3,805 nodes containing both formal Lean code and informal LaTeX descriptions.
- Evaluation Benchmarks: They released four benchmarks of increasing difficulty: Mathlib4-Random, Mathlib4-Heldout (file-level isolation), DAPS-Collection (Olympiad-style problems), and DAPS-Blueprint (frontier research).
Key Insights and Ideas
- The Asymmetry of Math: The authors found that mathematical declarations have a distinct "shape." Theorems have high "out-degree" (they use many things) but low "in-degree" (they aren't often used as premises). Foundational constructs like classes and structures are the opposite. DAPS explicitly uses these degree counts as features.
- Text is Not Enough: Rare lemmas often have very short or cryptic names/docstrings. By looking at the graph, DAPS can "see" that a rare lemma is connected to a well-known concept, allowing it to surface the rare lemma even when the text signal is weak.
- Formalizing the Informal: For natural language queries, DAPS uses a "formalize-then-retrieve" pipeline. It uses an LLM to turn a word problem into a Lean statement, then uses that statement to navigate the dependency graph.
Key Results
- Superior Retrieval: On the Mathlib4-Heldout benchmark, DAPS achieved a Recall@32 of 89.31, an 11.47-point lead over the previous leader, LeanHammer.
- Robustness to Shift: On competition-style problems (DAPS-Collection), all previous models dropped to single-digit recall. DAPS reached 24.38, a 7x improvement over the best baseline.
- Downstream Success: When DAPS-selected premises were fed into general-purpose LLMs (like Qwen3-235B or DeepSeek-V3), the models' ability to solve IMO-level proof problems improved significantly.
Limitations and Future Work
- Ground Truth Rigidity: The model is trained on the specific dependencies found in existing code. However, many theorems can be proven in multiple ways; DAPS doesn't currently get "credit" for finding valid alternative premises not used in the original source.
- Lean 4 Specificity: The current pipeline is tailored to Lean 4. Porting this to other proof assistants like Coq or Isabelle would require significant re-engineering of the extraction pipeline.
- Prover Integration: While DAPS is a powerful "retriever," the authors suggest that future work should involve tighter "prover-in-the-loop" integration, where the prover's feedback directly influences the selection process.
Summary updated