arXiv:2610.41536cs.LOOct 2026

Manuscript Offprint

arXiv:2610.41536

DAPS: Dependency-Aware Premise Selection for LLM Theorem Proving

Zixuan Chen, Wenyuan Jiang, Junling Wang, Mrinmaya Sachan, Yinya Huang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Zixuan Chen

ETH Zurich

zxclara@outlook.com

Wenyuan Jiang

ETH Zurich

wenyjiang@student.ethz.ch

Junling Wang

ETH Zurich, ETH AI Center

junling.wang@ai.ethz.ch

Mrinmaya Sachan

ETH Zurich

mrinmaya.sachan@inf.ethz.ch

Yinya Huang†

ETH Zurich, ETH AI Center

yinya.huang@hotmail.com

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/.

1 Introduction

LLM-based Lean 4 theorem proving has progressed rapidly, with frontier provers such as DeepSeek-Prover-V2 [28], Kimina-Prover [32], and Goedel-Prover-V2 [18] reaching IMO-level performance. Yet a fundamental limitation persists: these provers operate within a self-contained paradigm, generating subgoals and reusing constants they have already memorized. Provers are difficult to leverage newly contributed lemmas in Mathlib4 [31] or theorems established by domain experts in collaborative formalization projects, because they lack a reliable way to identify the appropriate premises among the hundreds of thousands of available declarations. Closing this gap requires premise selec-

†Corresponding author.

40th Conference on Neural Information Processing Systems (NeurIPS 2026).

Figure

Figure 1: One dependency graph spanning Mathlib4 (left) and a representative Blueprint project (right). The two resources differ in density and composition. Mathlib4 averages 24 edges per node with strong directional asymmetry across node types, while Blueprint dependencies are much sparser, averaging 1.2, but carry research-level out-of-Mathlib4 declarations and informal LATEX signals.

tion that can reliably reach the rare and recently introduced lemmas, not just the popular foundational ones the prover has already memorized.

Existing neural selectors [40, 46, 23] frame premise selection as semantic retrieval, a framing with three intrinsic limitations that better encoding cannot fix. (P1) Frequency-skewed retrieval: rare and recently added premises with weak text signal are displaced in top-K by popular foundational lemmas the prover already controls. (P2) Group-level relevance: pairwise similarity ranks each lemma in isolation, missing whether the top-K cohere as a usable proof toolkit. (P3) Distribution shift: Mathlib-trained semantic features degrade on out-of-distribution queries such as competition problems, research blueprints, and informal language. The three share a single root cause. Mathematics is structured by dependencies rather than similarities, so what makes a lemma useful is its position in the dependency graph, for example, the classes it presupposes, the lemmas it composes with, and its distance to known premises. Restoring this structure to both the training data and the model architecture is the unifying lever we pursue.

As shown in Figure 1 with the flt-regular project as a running example¹, Lean 4 makes at least two rich dependency resources available. Mathlib4's compiled constant graph (left) is a typed, heterogeneous DAG with 275k+ nodes and 6.5M edges, where each edge points from a declaration to a constant it uses in its statement or proof. The graph is directionally asymmetric: statement nodes (e.g., theorem, lemma) have high out-degree and low in-degree, while foundational constructs (e.g., class, structure, instance, inductive) show the opposite pattern. Lean Blueprint projects² (right) are collaborative formalization repositories that contribute 3,805 manually curated nodes (71.7% formal, 28.3% informal) across 53 research projects. Many of these nodes are recent or not-yet-formalized results absent from Mathlib4, so the graph is sparse with an average degree of just 1.2. Against P1's frequency-skewed retrieval, Blueprints supply the rare, advanced premises absent from Mathlib4, while the heavy-tailed shape of Mathlib4 itself (top 10% of nodes capture 56% of in-edges) lets us measure the frequency skew directly. For P2's group-level relevance, the Mathlib graph encodes which sets of premises are jointly used per proof, providing direct supervision over premise groups rather than individual lemmas. For P3's distribution shift, the two resources span in-domain Mathlib (left of Figure 1) and out-of-distribution informal+formal queries (right), and we additionally collect out-of-distribution competition and synthetic proofs as a third source.

We accordingly derive four evaluation benchmarks of increasing distribution shift: Mathlib4-Random (1,000 in-distribution queries with per-declaration random holdout), Mathlib4-Heldout (1,000 in-distribution queries with file-level isolation), DAPS-Collection (1,000 queries mined from 152k open-source competitions and synthetic proofs), and DAPS-Blueprint (236 informal+formal queries from advanced research projects).

We then introduce DAPS, a dependency-aware premise selector that addresses the three problems. To counter the long-tail collapse of P1, DAPS has a structural neighborhood encoding that augments each candidate's text representation with features summarizing its position in the dependency graph

¹https://leanprover-community.github.io/flt-regular/blueprint/dep_graph_document.html ²https://github.com/PatrickMassot/leanblueprint

(i.e., the kinds of declarations it depends on, its connectivity, and its relation to the query). For the group-level relevance of P2, DAPS has a group-level training objective that pulls the multiple gold premises of a query towards the query embedding as a single group, away from negatives, so the model learns to rank jointly-useful premise sets near the top, not just individual nearest neighbors. To absorb the distribution shift of P3, DAPS has a Mathlib-then-Blueprint adaptation procedure that first trains on the abundant typed Mathlib graph, then continually adapts on Blueprint dependencies.

Experiments show that DAPS outperforms strong prior selectors across all four benchmarks with varying distributions. The lead persists at small retrieval budgets on DAPS-Blueprint. Substituting DAPS premises for those from existing Lean search engines improves both end-to-end formal theorem proving on miniF2F and informal theorem proving.

Our contributions are threefold:

• We diagnose three intrinsic limitations of existing premise selectors: long-tail collapse (P1), group-level relevance (P2), and distribution shift (P3).

• We bring underused Lean 4 dependency resources to bear on premise selection, specifically by systematically mining Lean Blueprint projects and comprehensive Mathlib4 dependencies. Derived from them, we release four evaluation benchmarks of increasing distribution shift: Mathlib4-Random, Mathlib4-Heldout, DAPS-Collection, and DAPS-Blueprint.

• We introduce DAPS, a dependency-aware premise selector that outperforms strong prior selectors, holds its lead at small retrieval budgets on DAPS-Blueprint, and improves downstream formal and informal theorem proving.

References (40)