← All papers
First page of Can the Library Speak? Self-Advertised Method Selection for Formal Proving

Can the Library Speak? Self-Advertised Method Selection for Formal Proving

Xiaopeng Yuan, Suijin Wang, Yanli Wang, Haibo Jin, Peng Kuang, Jerry Wang, Lijun Yu, Haohan Wang

cs.AI Oct 7, 2026 · v2
Builds a library of 82 method contracts with Mathlib anchors and Lean-checked scaffolds, then supplies the selected contract to a Lean prover loop.
LLM-based formal provers can retrieve relevant lemmas and prior proofs, but relevance alone does not say whether a mathematical method can be used on the current theorem. A method has prerequisites, a target, an intended action, and obligations that its use leaves to prove. Methods that look equally related to a theorem may therefore differ substantially in whether they offer a plausible next step. We formulate this as an applicability-aware method-selection problem and introduce self-advertisement: before candidates are ranked, a model generates a problem-specific proposal for each one, stating what part of the goal it targets, what action it would take, and what conditions that action requires. We organize 82 reusable methods from Putnam 2000-2014 as Method Contracts, which pair applicability descriptions with Mathlib anchors, a checked example or scaffold, and expected proof obligations. A single batched call elicits proposals across the library; vague or unsupported proposals are demoted, yielding a ranked shortlist accompanied by inspectable claims about each candidate's use. We analyze when similarity-based representations cannot distinguish methods with different applicability, how errors in applicability estimates affect shortlist quality, and what a checked scaffold guarantees under its stated assumptions. Against lexical, embedding, and embedding-plus-LLM reranking baselines, self-advertisement achieves 95.0% hit@5 on Putnam 2015-2025, compared with 84.2% for the strongest reranker. On IMO ProofBench, it achieves 91.7% compared with 88.3%. These results indicate improved coverage of annotated methods in the retrieved shortlists, particularly on Putnam.

LLM-based Lean provers can retrieve lemmas and prior proofs that look relevant, but relevance does not show whether a mathematical method actually applies to the current goal. A method has prerequisites, a target, an intended action and residual obligations, so methods that look equally related can differ in whether they give a usable next step.

82 reusable methods drawn from Putnam 2000–2014 are organized as Method Contracts, each pairing an applicability description with Mathlib anchors, a Lean-checked example or scaffold, and expected proof obligations. In self-advertisement, a single batched LLM call asks each contract to propose a goal-specific target, action and required conditions. A commitment gate demotes proposals that are vague or unsupported, and tiered ranking produces a shortlist. An optional runoff re-ranks the top candidates, and the top-ranked contract is passed to a verifier-guided Lean proof loop.

Figure 1: Self-advertised method selection. Given a theorem, a single model call asks every contract in the library how it would be used. A gate demotes proposals that are vague (Pigeonhole) or unsupported (AM-GM, since a_{i}\geq 0 is not given), and the top-ranked contract (Cauchy–Schwarz) goes to the prover. Inset: similarity retrieval would pick AM-GM instead.

Self-advertisement reaches 95.0% hit@5 on Putnam 2015–2025, versus 84.2% for the strongest embedding-plus-LLM reranker. On IMO ProofBench it reaches 91.7% versus 88.3%. Adding the self-advertised contract to AxProverBase raises problems proved from 5.8% to 12.5% on Putnam and from 10.0% to 15.0% on IMO ProofBench.

MethodPutnam AllIMO ProofBench All
pass@200.81.7
APOLLO2.56.7
AxProverBase5.810.0
+ Self-adv. contract12.515.0
Problems proved (%) in a fixed-budget proof loop