NaturalProofs: Mathematical Theorem Proving in Natural Language
NaturalProofs benchmarks BERT-based proof-reference retrieval; Joint BERT reaches 42.45 R@10 and 50.22 Full@100 on ProofWiki.
Key Findings
Methodology
NaturalProofs reformulates informal theorem proving as reference retrieval and sequence generation. It compares TF-IDF, BERT Pairwise, BERT Joint, and an autoregressive generator. Pairwise independently scores theorem-reference pairs with a dot product and contrastive negative sampling. Joint computes a softmax over all candidates using a theorem vector and reference matrix. The generator models p(r_t|r_<t,x), recovering order, multiplicity, and an EOS token.
Key Results
- On ProofWiki, source-specific BERT Joint obtains mAP 36.75, R@10 42.45, R@100 75.90, and Full@100 50.22, versus TF-IDF scores of 6.19, 10.27, 23.09, and 9.43 respectively.
- On Stacks, BERT Joint reaches mAP 28.32, R@10 39.10, and Full@100 65.59. In zero-shot Real Analysis, however, TF-IDF reaches mAP 15.79, exceeding ProofWiki-trained BERT Joint at 11.24.
- Exact sequence generation remains weak: autoregressive EM is 3.87% on Stacks and 3.69% on ProofWiki. Models can retrieve related mathematics, but rarely recover the exact set, order, and multiplicity of proof references.
Significance
NaturalProofs makes human-style mathematics—natural language mixed with symbols—measurable for machine learning. It connects informal mathematical understanding with premise selection, information retrieval, and language modeling. Crucially, its multi-domain and textbook zero-shot settings separate memorized domain competence from genuine transfer. The benchmark therefore addresses a long-standing gap between formal theorem-proving environments and the vast body of mathematical knowledge written in textbooks, web pages, and research prose. It also offers a realistic interface for educational assistants, literature navigation, and future scientific reasoning systems.
Technical Contribution
The paper contributes a common schema, a reference graph, and a leaf-node split that prevents evaluation theorems from appearing as training references. It contrasts independently scored Pairwise retrieval with Joint retrieval, which optimizes a distribution over all candidates and can initialize its reference matrix with content-based encodings. It additionally introduces autoregressive reference generation. Evaluation goes beyond ranking quality through mAP, R@k, and Full@k, while generation measures exact match, edit distance, BLEU, set recovery, and multiset recovery. This makes completeness and ordering explicit rather than hidden.
Novelty
Compared with prior ProofWiki-only premise-selection datasets and formal corpora such as Mizar or Lean libraries, NaturalProofs unifies ProofWiki, the deep-coverage Stacks project, and two real textbooks. Its fundamental innovation is benchmark design: it turns the otherwise vague act of identifying what a proof uses into both a set-retrieval task and an ordered-generation task, with domain-transfer protocols. The neural architecture is largely established, but the resource and evaluation problem are substantially new and broadly reusable.
Limitations
- Models often retrieve mathematically topical but proof-irrelevant results. In the Category of Monoids example, Joint improves ranks but still confuses relevant category-theory statements with the exact references used by the proof.
- BERT does not beat TF-IDF in textbook zero-shot evaluation, showing sensitivity to notation, formatting, vocabulary, and domain shift; autoregressive exact-match performance is also very low.
- The corpus depends on explicit source links, so implicit reasoning, equivalent reformulations, and unmarked premises are incompletely represented.
Future Work
Future systems should combine symbolic structure, theorem graphs, mathematical entity alignment, and formal verification rather than relying mainly on text similarity. Promising directions include cross-domain pretraining, few-shot adaptation to textbooks, graph neural networks, joint retrieval-generation training, and verifier-guided decoding. Lean, Mizar, or related proof assistants could check whether a generated reference set actually closes the theorem, turning plausible retrieval into reliable proof support.
AI Executive Summary
Mathematical proof is more than symbolic calculation. Human mathematicians combine prose, notation, definitions, and earlier theorems, whereas much automated theorem proving operates inside formal systems such as Lean, Mizar, Metamath, or HOL Light. NaturalProofs addresses this gap with a corpus of natural mathematical language drawn from ProofWiki, the Stacks algebraic-geometry project, and two textbooks, Real Analysis and Number Theory. The release contains about 32,000 theorem pages, 14,000 definitions, and 2,000 other pages.
The benchmark asks a deceptively focused question: given a theorem, which results actually occur in its proof? Retrieval models include TF-IDF, BERT Pairwise, and BERT Joint; an autoregressive model must additionally generate the reference sequence. Joint retrieval models all candidates together rather than scoring each independently. On ProofWiki, source-specific Joint BERT raises mAP from 16.82 for Pairwise BERT to 36.75, reaches R@10 42.45, and places every required reference in the top 100 for 50.22% of test theorems. On Stacks it obtains mAP 28.32 and Full@100 65.59.
The results are encouraging but deliberately sobering. In zero-shot Real Analysis, TF-IDF scores mAP 15.79, above ProofWiki-trained BERT Joint at 11.24. Exact sequence generation is only 3.69% on ProofWiki and 3.87% on Stacks. Thus, finding mathematically related material is not the same as identifying the premises a proof truly needs. NaturalProofs provides an important bridge from informal mathematics to machine reasoning, but dependable theorem proving will require symbolic understanding, graph-aware transfer, and verification by formal proof assistants.
Deep Analysis
Background
Formal theorem-proving research has advanced through HOL Light, Coq, Lean, Mizar, Metamath, premise selection, and benchmarks such as HOList. Neural systems can help choose assumptions for automated provers, but formal languages do not capture how most mathematics is written. ProofWiki-based resources began addressing natural mathematical language, yet generally emphasized one source. NaturalProofs extends this direction with broad, deep, and low-resource domains plus explicit out-of-distribution evaluation.
Core Problem
For theorem x and candidate set R, the system must recover the proof-reference sequence y=(r1,…,r|y|). Retrieval reduces y to a set; generation must recover cardinality, order, and repeated references. The problem is difficult because R contains roughly 46,000 unique candidates, mathematical wording varies widely, proofs omit steps, and test theorems must not have appeared as training references. Relevance is therefore finer than topical similarity.
Innovation
The corpus unifies ProofWiki’s broad coverage, Stacks’ deep algebraic-geometry coverage, and low-resource textbook material. Every page is represented with title, mixed text/LaTeX contents, proofs, and links in a common schema. A reference graph supports leaf-node splitting and leakage control. The task suite covers both unordered retrieval and ordered generation, while Full@k measures whether a small ranked list contains every result needed for a proof.
Methodology
- �� Data: extract statements, proofs, mixed text/LaTeX, and explicit links, yielding about 25,000 theorem-proof examples and roughly 46,000 candidate references.
- �� Pairwise retrieval: BERT encodes theorem and reference independently; sθ(x,r) is a dot product, trained with positive references and sampled negatives.
- �� Joint retrieval: compute softmax(Rfθ(x)) over all candidates; R may contain representations learned by an independent reference encoder.
- �� Generation: model pθ(rt|r<t,x), decode with beam search, and terminate with EOS.
- �� Evaluation: train/test within ProofWiki or Stacks, then transfer without training examples to the Real Analysis and Number Theory textbooks.
Experiments
Baselines are Random, Frequency, and TF-IDF. Neural variants are BERT Pairwise and Joint, trained either per source (P/S) or jointly on ProofWiki plus Stacks (P+S). Retrieval uses mAP, micro-averaged R@10/R@100, and Full@10/Full@100. Generation uses exact match, edit distance, BLEU, set F1, and multiset F1. Oracle conditions—randomized full set, randomized multiset, and correct first half—diagnose whether errors arise from membership, multiplicity, or ordering.
Results
On ProofWiki, source-specific Joint BERT reaches mAP 36.75 versus Pairwise 16.82, R@10 42.45, and Full@100 50.22. On Stacks it reaches mAP 28.32, R@10 39.10, and Full@100 65.59. Joint training remains useful but is usually below source-specific training. In zero-shot evaluation, TF-IDF achieves Real Analysis mAP 15.79 versus 11.24 for ProofWiki-trained Joint BERT; this shows that strong in-domain neural ranking does not yet imply robust mathematical transfer.
Applications
A practical system could retrieve prerequisite theorems for students, help researchers navigate large proof libraries, or provide candidate premises to Lean, Mizar, or another prover. It can also support semi-automated textbook indexing and proof explanation. Deployment requires structured references, domain adaptation, and human or formal verification, because high topical relevance is not evidence that a result is logically necessary.
Limitations & Outlook
Explicit links are an imperfect proxy for proof reasoning and miss implicit premises. BERT representations remain weak at variable renaming, equivalent equations, symbolic manipulation, and long-range proof structure. Joint scoring over tens of thousands of candidates can be computationally expensive, while autoregressive generation suffers exposure bias and error accumulation. The low zero-shot and exact-generation scores motivate graph-aware, symbol-aware, retrieval-generation models coupled to formal proof checking.
Plain Language Accessible to non-experts
Imagine a librarian helping you write a difficult report. The library contains tens of thousands of cards: some explain basic ideas, some state powerful facts, and some are unrelated. You give the librarian one question, and the real challenge is not finding cards about the same topic. It is finding the exact cards that the final report actually uses, then placing them in the order in which the argument needs them.
TF-IDF is like searching the catalogue for matching words. BERT is like a librarian who reads the meaning of the question and the card. Pairwise BERT compares cards one at a time; Joint BERT spreads every card across a table and ranks them together. Another system tries to recite the cards in sequence.
On familiar ProofWiki material, Joint BERT put about 42% of the correct cards in its first ten suggestions and included every required card in its first hundred for about half the cases. But when shown unfamiliar textbooks, simple word search sometimes won. The librarian had learned one library’s writing habits, not mathematics in a fully general way. The lesson is clear: “related” is not the same as “needed.” A trustworthy mathematical assistant must understand relationships and check that the selected cards really support the conclusion.
ELI14 Explained like you're 14
Think of a math proof as a game quest. The quest gives you a goal, and your backpack contains thousands of item cards: definitions, earlier theorems, and useful facts. Winning does not mean grabbing every item with a similar name. You need the exact items that unlock the quest, in the right order. That is what NaturalProofs asks a computer to do.
The researchers collected real math writing from ProofWiki, Stacks, and two textbooks. One computer method searches for matching words. BERT reads the theorem and candidate facts more like a language-aware helper. Pairwise BERT checks one candidate at a time, while Joint BERT ranks all candidates together. A generation model tries to name the needed facts step by step—like giving a walkthrough instead of merely listing possible items.
The familiar-game results are pretty good: on ProofWiki, Joint BERT puts around 42% of the correct references in its first ten guesses, and its first hundred guesses contain the full required set about half the time. But when the game changes to a new textbook, performance drops, and ordinary keyword search can win. Why? Different mathematicians may describe the same idea in totally different ways.
So has the computer learned to prove mathematics? Not yet! It has learned to suggest useful clues. The next level is understanding symbols, logical connections, and hidden steps, then asking a proof checker whether the proposed clues really work. That would turn a clever recommendation system into a dependable math teammate!
Glossary
Natural mathematical language
The mixture of ordinary prose, mathematical notation, and LaTeX used in human mathematical writing. It is less rigid than a formal proof language and closer to textbooks and research exposition.
The representation used throughout NaturalProofs.
Reference retrieval
Selecting the theorems, definitions, or other pages that occur in a target theorem’s proof. The retrieval version evaluates an unordered reference set.
The paper’s principal benchmark task.
Pairwise parameterization
A model independently scores each theorem-reference pair and learns from positive and negative examples. It is compatible with BERT encoders but does not directly model competition among all candidates.
The baseline neural retrieval formulation.
Joint parameterization
A model assigns a softmax distribution over all candidate references in one calculation. This enables direct optimization of the candidate distribution and often improves top-ranked results.
The strongest in-domain retrieval formulation.
Full@k
The proportion of examples for which the top k predictions contain every ground-truth proof reference. It is stricter than ordinary recall.
Measures whether a ranked shortlist could support a complete proof.
Zero-shot generalization
Evaluation on a new source without training examples from that source. It tests transfer across vocabulary, formatting, mathematical topic, and writing style.
Applied to the Real Analysis and Number Theory textbooks.
Open Questions Unanswered questions from this research
- 1 How can a model recognize mathematically equivalent statements written with different symbols or wording? Current lexical and language encoders remain sensitive to style, so normalization and entity alignment are needed.
- 2 Does a retrieved reference set logically prove the theorem? NaturalProofs evaluates link recovery, not universal proof validity; integration with formal verifiers is still missing.
- 3 How can systems jointly model long proofs, reference graphs, and implicit premises over tens of thousands of candidates without prohibitive computation?
Applications
Immediate Applications
Mathematics study assistant
A student enters a theorem and receives ranked prerequisite definitions and theorems from ProofWiki or a textbook. The system can provide useful hints and reading paths, but teachers should verify results because topical relevance does not guarantee proof necessity.
Premise filtering for formal provers
Before invoking Lean, Mizar, or another prover, a NaturalProofs-style retriever can narrow a large library to plausible premises. The natural-language candidates must then be aligned with formal declarations and checked by the prover.
Long-term Vision
Cross-domain mathematical research assistant
With theorem graphs, symbolic reasoning, and formal verification, a system could transfer across papers and textbooks, expose proof dependencies, fill missing background, and propose checkable proof sketches. Implicit reasoning and reliability remain the main obstacles.
Abstract
Understanding and creating mathematics using natural mathematical language - the mixture of symbolic and natural language used by humans - is a challenging and important problem for driving progress in machine learning. As a step in this direction, we develop NaturalProofs, a multi-domain corpus of mathematical statements and their proofs, written in natural mathematical language. NaturalProofs unifies broad coverage, deep coverage, and low-resource mathematical sources, allowing for evaluating both in-distribution and zero-shot generalization. Using NaturalProofs, we benchmark strong neural methods on mathematical reference retrieval and generation tasks which test a system's ability to determine key results that appear in a proof. Large-scale sequence models show promise compared to classical information retrieval methods, yet their performance and out-of-domain generalization leave substantial room for improvement. NaturalProofs opens many avenues for research on challenging mathematical tasks.