DAPS: Dependency-Aware Premise Selection for LLM Theorem Proving
Organizations: ETH Zurich · ETH Zurich, ETH AI Center
Abstract
LLM-based theorem proving in Lean 4 has advanced rapidly, but provers are difficult to leverage newly contributed lemmas, because retrieval skews toward popular foundational lemmas, leaving the right premises buried among hundreds of thousands of candidates. Existing neural selectors rank candidates by semantic similarity, with three intrinsic limitations: frequency-skewed retrieval, isolated pairwise ranking, and degradation on out-of-distribution queries such as competition problems and informal language. Given that mathematics is structured by dependencies rather than similarities, we restore this signal to both the training data and the model. We curate two underused dependency resources. We conduct the first systematic mining of 53 Lean Blueprint projects, a previously untapped corpus of 3,805 manually curated informal+formal nodes that capture rare, research-level premises absent from Mathlib4. We further pair it with the extraction of comprehensive, typed, multi-level Mathlib4 dependencies. We then introduce DAPS, a dependency-aware premise selector with a structural neighborhood encoder, a group-level contrastive objective, and a Mathlib-then-Blueprint adaptation procedure. DAPS reaches mean Recall@32 of 89.25 on Mathlib4-Heldout (+11.41 over the strong selector LeanHammer), and maintains this lead on two out-of-distribution benchmarks. Further experiments demonstrate that DAPS premises improve theorem proving on miniF2F and IMO-ProofBench. Project page: https://daps-eth.github.io/.
Figures & tables
| # Projects | 53 |
| # Nodes / # Edges | 3,805 / 4,651 |
| Formal vs. informal nodes | 2,728 (71.7%) / 1,077 (28.3%) |
| Project size: median / mean / range | 35 / 71.8 / 6–525 |
| Fully-formalized projects | 14 |
| Informal-majority projects | 14 |
| Source | #Train | #Val | Test slices (#queries) |
| Mathlib4 | 275,842 | 2,000 | Mathlib4-Heldout (1,000), Mathlib4-Random (1,000) |
| Blueprints | 1,880 | 235 | DAPS -Blueprint (236) |
| DAPS -Collection | – | – | DAPS -Collection (1,000) |
| Method | Mathlib4-R | Mathlib4-H | DAPS -Coll. | DAPS -BP |
| MePo ( Meng et al., 2006 ) | – | |||
| ReProver ( Yang et al., 2023 ) | ||||
| LeanHammer ( Zhu et al., 2025 ) | ||||
| Qwen3-Embedding-8B ( Zhang et al., 2025b ) | ||||
| DAPS |
| Model | LeanExplore | LeanSearch | Qwen3 | DAPS | % |
| Qwen3-235b ( Yang et al., 2025 ) | 18.45 | 17.01 | 19.08 | 21.25 | 11.37 |
| DeepSeek-V3.1 ( DeepSeek-AI, 2024 ) | 11.96 | 12.38 | 13.75 | 13.90 | 1.09 |
| kimi-k2-instruct ( Bai et al., 2025 ) | 8.66 | 8.26 | 8.27 | 9.08 | 4.85 |
| Gemini-3.6-Flash 5 5 5 https://deepmind.google/models/model-cards/gemini-3-6-flash/ | 46.13 | 44.04 | 45.51 | 48.69 | 5.55 |
| Goedel-Prover-V2-8B | DeepSeek-Prover-V2-7B | |||||
| pass@1 | pass@2 | pass@4 | pass@1 | pass@2 | pass@4 | |
| w/o premises | 36.48 | 43.62 | 49.90 | 34.07 | 42.23 | 48.23 |
| LeanExplore | 40.37 | 47.18 | 52.36 | 36.73 | 44.29 | 48.72 |
| LeanSearch | 39.19 | 46.05 | 51.43 | 34.32 | 42.21 | 47.32 |
| Qwen3-Embedding-8B | 39.86 | 46.41 | 51.84 | 35.09 | 42.86 | 47.68 |
| MePo | 37.92 | 44.74 | 50.60 | 35.60 | 43.06 | 47.75 |
Appendix figures & tables29 assets
Supplementary material from the paper’s appendix.
Appendix
| Workload | Hardware | #Devices | Runtime | Compute |
| Stage 1: text encoder warm-up | GH200 cluster | 16 | 12 h | 192 GPU-h |
| Stage 2: structural fusion training | GH200 cluster | 16 | 24 h | 384 GPU-h |
| Blueprint continual training | MacBook Pro (M4 Max) | 1 | 3 h | 3 machine-h |
| Total (cluster training) | 408 GPU-h | |||
| Total (local training) | 3 machine-h |
| Node Field | Definition |
| name | Fully qualified Lean name (e.g., AddConstMap.instFunLike ) or the synthetic file_ identifiers we create from the filesystem. |
| category | Underlying ConstantInfo tag ( theorem , def , instance , inductive , structure , class , constructor , recursor , etc.). |
| line / column | Start position from findDeclarationRanges? , measured in the source .lean file. |
| doc | Docstring preceding the declaration; null when absent. |
| signature | Canonical type with all binders and constants spelled out. |
| isProp | Flags declarations whose type lives in Prop . |
| Edge Field | Definition |
| source_name / target_name | The name entry of source/target node of the edge. |
| category | Semantic label chosen based on the source and the target’s subcategory . Conventions: CONTAINS for file declaration, IMPORTS for file file, DEPENDS_ON for anything targeting a theorem/lemma/axiom (including derived variants), and USES<CATEGORY> (e.g., USES_CLASS , USES_INSTANCE_DERIVED , USES_STRUCTURE ) for everything else. |
| explicit | Whether a dependency appears in the explicit argument positions of the source declaration. It is True when the referenced constant is used only through explicit parameters( i.e. binderInfo = .default ). It is False when the dependency arises solely via implicit arguments, including implicit {} binders or typeclass instance parameters [] . |
| direct | True if the dependency can be obtained from calling function getUsedConstantsAsSet in ConstantInfo ). False if it is obtained through further unfolding the direct dependencies of auxiliary lemmas. |
| could_skip | True if the target node in_blacklist . |
| Node Categories | #node | avg. | max #in-degree | total #in-degree |
| class | 2,126 | 348.20 | 62,237 | 740,276 |
| structure | 3,260 | 174.95 | 24,449 | 570,325 |
| class_derived | 11,472 | 148.51 | 49,867 | 1,703,655 |
| instance_derived | 1,912 | 79.71 | 16,527 | 152,413 |
| inductive | 290 | 60.77 | 2,474 | 17,622 |
| instance | 22,462 | 58.24 | 32,159 | 1,308,114 |
| Node Categories | #node | avg. | max #out-degree | total #out-degree |
| file | 6,726 | 43.70 | 684 | 293,910 |
| example_derived | 1 | 37.00 | 37 | 37 |
| lemma | 39,832 | 31.08 | 395 | 1,237,896 |
| theorem | 116,096 | 26.85 | 474 | 3,116,776 |
| lemma_derived | 3,918 | 25.36 | 259 | 99,369 |
| attribute_derived | 3 | 20.33 | 25 | 61 |
| Project | #Nodes | #Edges | #Formal | #Informal |
|---|---|---|---|---|
| AlexKontorovich/PrimeNumberTheoremAnd | 525 | 694 | 487 | 38 |
| RemyDegenne/brownian-motion | 458 | 732 | 298 | 160 |
| teorth/pfr | 218 | 403 | 214 | 4 |
| teorth/equational_theories | 214 | 185 | 145 | 69 |
| firsching/FormalBook | 189 | 93 | 55 | 134 |
| florisvandoorn/carleson | 179 | 213 | 175 | 4 |
| Mathlib4 encoder | 32 | 300 | 64 | 0 | 3 | all |
| Mathlib4 structural fusion | 32 | 300 | 64 | 30 | 30 | 1,500 |
| Blueprint continual training | all | 33 | 33 | 15 | 45 | 960 |
| Method | Precision@16 | Recall@16 | F1@16 | Precision@32 | Recall@32 | F1@32 |
| MePo | ||||||
| ReProver | ||||||
| LeanHammer | ||||||
| Qwen3-Embedding-8B | ||||||
| DAPS |
| Method | Precision@16 | Recall@16 | F1@16 | Precision@32 | Recall@32 | F1@32 |
| MePo | ||||||
| ReProver | ||||||
| LeanHammer | ||||||
| Qwen3-Embedding-8B | ||||||
| DAPS |
| Method | Precision@16 | Recall@16 | F1@16 | Precision@32 | Recall@32 | F1@32 |
| MePo | ||||||
| ReProver | ||||||
| LeanHammer | ||||||
| Qwen3-Embedding-8B | ||||||
| DAPS |
| Method | Precision@16 | Recall@16 | F1@16 | Precision@32 | Recall@32 | F1@32 |
| ReProver | ||||||
| LeanHammer | ||||||
| Qwen3-Embedding-8B | ||||||
| DAPS |
| Query formalization | Pass@4 |
| Gemini-3-Pro | 46.55 |
| Goedel-Formalizer-V2-32B | 47.50 |
| Manual formalization | 48.27 |
| Variant | Mathlib4-R | Mathlib4-H | DAPS -Coll. |
| (a) Full configuration | |||
| DAPS (warmed-up MGTE encoder, DySS, 2-hop bidirectional, all node categories) | 79.63 | 89.31 | 24.38 |
| (b) Encoder ablations | |||
| encoder warm-up | 74.30 | 81.08 | 15.63 |
| structural fusion (MGTE encoder only) | 56.29 | 43.85 | 5.53 |
| MGTE encoder warmed-up ReProver/ByT5 | 74.20 | 81.72 | 1.08 |
| Failure mode | Symptom | Rep. case |
| Type over-generalization | DAPS retrieves typeclass instances on a type that shares the relevant typeclass with the target, but is not the target itself. | App. 16 |
| Lexical sibling drift | When the query is a modifier-prefixed or -suffixed sibling of an in-corpus lemma, DAPS retrieves thematically related premises rather than the near-identical sibling. | App. 17 |
| Topical subgraph drift | DAPS resolves the correct project, but selects the wrong topical subgraph when several thematically adjacent clusters compete. | App. 18 |