How Far Apart Are Two Proofs? Measuring Proof Dissimilarity in a Proof Kernel and in Lean/Mathlib
Nikolaos Nikolaou
cs.LO
Nov 24, 2026 · v1
cs.AI cs.LG
TL;DR
Writes 19 Lean 4/Mathlib proofs of three theorems and automatically extracts 18 dissimilarity measures from their elaborated terms and dependencies.
Abstract
We now live in the age of machine-generated mathematics: AI systems produce research-level proofs faster than the human mathematical community can read them. Verification is only part of the challenge. We also need to know whether a "new proof" is indeed new, whether a thousand generated proofs contain one idea or many, and where each sits relative to human mathematics. All of these require measuring distances between proofs. Following Hilbert's 24th problem and the identity-of-proofs problem, we ask how far apart two proofs of one theorem are, and what shape the proof space they inhabit has. We define 19 dissimilarity measures in 6 families (syntactic, structural, dependency & resource, semantic, information-theoretic, higher-categorical) and 10 desirable properties, which we argue are the conditions for safely optimising a measure. In a Curry-Howard kernel, 5 machine-checked proofs that the primes are infinite show that raw syntax cannot tell a rewrite from a new argument, that dependency-based and structural measures reproduce the intuitive ordering (Euclid rewritten < Goldbach < Furstenberg), and that semantic measures invert it: Furstenberg's topological proof produces exactly Euclid's witness. A replication in Lean 4/Mathlib (3 theorems, 19 proofs, 18 measures) confirms that dependency-closure measures track intuition best, and shows that equality of normal forms never holds between differently written versions of the same argument, that proofs by citation look unlike the arguments they cite, and that proof irrelevance cannot distinguish any two proofs. We argue for reporting dissimilarity as a multi-level profile, extend the measures to proofs of different theorems, and discuss uses, from detecting duplicated AI proofs and orchestrating prover agents to interpreting AI proofs via their nearest human-understandable counterparts. Code, Lean sources and data are released.
Problem
Machine-generated proofs are multiplying, so it matters whether a new proof is genuinely new and how alternative proofs of one theorem relate to each other. This requires quantitative measures of distance between proofs.
Approach
Defines 19 dissimilarity measures in six families (syntactic, structural, dependency & resource, semantic, information-theoretic, higher-categorical) and 10 desirable properties. They are first evaluated on five machine-checked proofs of the infinitude of primes in a Curry-Howard kernel (Euclid variants, Goldbach, Furstenberg). The study is then replicated in Lean 4 against pinned Mathlib with 19 tactic-mode proofs of three theorems (infinitude of primes, irrationality of sqrt 2, Gauss's sum), extracting 18 measures from elaborated terms.
Results
Dependency-closure and structural measures reproduce the intuitive ordering. Semantic measures invert it: Furstenberg's proof yields Euclid's witness. In Lean, normal-form equality never holds between rewrites of the same argument, citation-based proofs look unlike the arguments they cite, and proof irrelevance distinguishes nothing. Dependency-Jaccard gets the full ordering on all theorems and satisfies 9/10 properties.
| Metric | (E,E') same | (E,G) similar | (E,F) dissimilar | order |
|---|
| Raw TED | 0.512 | 0.500 | 0.514 | ✗ |
| Dependency-Jaccard | 1.000 | 0.429 | 0.333 | ✓ |
| MSC-EMD | 1.000 | 0.652 | 0.407 | ✓ |
| Herbrand-witness | 1.000 | 0.160 | 1.000 | ✗ |
Kernel study: similarity s=1-d for intuitive pairs (selected measures)