Bipartite Edge Recovery in Formalized Mathematics
Bockman Cheung, Ryan Divan, Eli Perman, Justin M. Baker, Matthew Sottile, Andrea L. Bertozzi
cs.LG
Oct 22, 2026 · v2
cs.AI cs.CL
TL;DR
Recovers NL–Lean correspondence links from leanblueprint projects (Carleson, FLT, PFR, etc.) using Lean Finder embeddings, GBMs, and LLM deferral; applies to autoformalization.
Abstract
Several major recent breakthroughs in mathematics were enabled by machine-driven, large-scale autoformalization of mathematics, with the translation of whole papers and textbooks into machine-checked libraries. However, there remains an open problem of verifying that the two representations, a natural-language (NL) source and a formal-language (FL) library, are equivalent. We model the pairing as a bipartite knowledge graph (KG) whose cross-edges, labeled formalizes, link NL statement(s) to the corresponding FL declaration(s). We study the recovery and generation of these cross-edges as a link-prediction problem. Recovery predicts human-labeled cross-edges between existing NL-FL corpora; generation is autoformalization of NL that produces these cross-edges together with the formal declarations. These problems are particularly challenging as they may be sparse and many-to-many: a statement may be split into several declarations, a declaration may serve several statements, and many vertices may have no counterpart. We leverage community-developed projects with labeled \LaTeX{} (NL) and Lean (FL) cross-edges to train a model combining gradient-boosted edge scores, a global assignment that may leave a statement unmatched, and deferral of uncertain edges to an LLM. Across six projects, our pipeline improves edge precision and $F_1$ over an LLM-only baseline at less than half of its API cost, and it transfers to improved formalization of research mathematics.
Problem
Large formalization efforts need to verify that natural-language statements and their Lean declarations actually correspond. A formal proof checks correctness but not fidelity to the source claim. These correspondences are sparse and many-to-many.
Approach
NL LaTeX statements and Lean declarations from six leanblueprint projects are modeled as a bipartite knowledge graph, stored in Neo4j. Cross-edge recovery is treated as link prediction. Candidate pairs are embedded with Lean Finder, featurized, and scored with gradient-boosted trees. A global assignment is chosen by maximum-weight bipartite matching that can leave statements unmatched, and uncertain edges are deferred to an LLM judge. Evaluation uses leave-one-project-out cross-validation.
Results
Across six projects, the hybrid pipeline reaches pooled precision 0.837 and F1 0.816. The LLM-only judge reaches precision 0.721 and F1 0.787, at more than twice the API cost. The approach also transfers to a textbook setting and to autoformalization of research mathematics.
| Model | Prec. | Recall | F1 | Cost |
|---|
| Lean Finder cosine | 0.293 | 0.652 | 0.405 | - |
| LLM Judge (Opus 5.5) | 0.721 | 0.866 | 0.787 | $68.57 |
| Deterministic Pipeline | 0.695 | 0.774 | 0.733 | - |
| Hybrid Pipeline (Opus 5.5) | 0.837 | 0.796 | 0.816 | $28.23 |
Leave-one-project-out method comparison (pooled)