Hashing Theorems Modulo Rewrites and Binder Permutation Enables Equivalence Search over 200k Mathlib Theorems
Samuel Le{\ss}mann, Simon Henniger, Gabriel Poesia, Nada Amin
Key points
From the paper's conclusion- We implement our method for Lean.
Abstract
Like all code, Lean libraries accumulate technical debt and structural deficiencies over the course of their development. A particular concern is duplicate theorems: different parts of a big library can unwittingly contain and prove the same theorem, duplicating maintenance efforts. Tools can help detect redundancy and clean up. For instance, Mathlib's duplicate-declarations linter compares theorem types syntactically after sorting top-level binders and erasing binder information and universe levels. If detecting an equivalence requires unfolding, reorientation, or logical transformations, it escapes this comparison. In this work, we present a method to detect theorems which are equivalent with regard to argument order and currying/uncurrying of dependent types. We implement our method for Lean. By applying it to Mathlib, a library of more than 200k theorems, we demonstrate that it is computationally cheap and scalable. We discuss how our work may enhance efforts to tackle the maintenance burden of Lean libraries.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Lean Graph Search for Formal Theorem ProvingarXiv · 2026
- SemantEq: Faithful Bidirectional Equivalence of Formal StatementsarXiv · 2026
- MechAlign: Evaluating Semantic Alignment at the Project Level in Mathematical FormalizationarXiv · 2026
- Lean Finder V2: Semantic Search for Mathlib That Disambiguates User QueriesarXiv · 2026
- How Far Apart Are Two Proofs? Measuring Proof Dissimilarity in a Proof Kernel and in Lean/MathlibarXiv · 2026
- A Transfer Tactic for LeanarXiv · 2026