TL;DR
AI systems can now generate formal mathematical proofs faster than humans can read them, and while proof assistants like Lean guarantee these proofs are correct, they can't tell us if a thousand generated proofs represent a thousand fresh insights or one recycled idea in a trench coat. Turning David Hilbert’s century-old philosophical question ("When are two proofs the same?") into a practical engineering metric, this paper defines and tests nearly twenty ways to measure the distance between mathematical arguments. Along the way, it reveals why looking at what a proof cites tracks human intuition best—and why a famous topological proof about prime numbers is secretly Euclid’s ancient arithmetic proof in disguise.
What Problem Does This Paper Address?
Imagine a swarm of 10,000 AI agents exploring a math problem in parallel, or two rival research labs claiming priority over closely related machine-assisted proofs within weeks of each other. Proof-checking kernels (the trusted cores of software like Lean) only output a binary yes or no on logical validity. In fact, Lean’s kernel enforces "proof irrelevance," treating every valid proof of a theorem as literally identical.
Historically, logicians studied the "identity of proofs" as a binary equivalence relation—asking whether two proofs reduce to the exact same canonical form. What we lack is a graded distance metric: a way to map "proof space" and quantify whether two proofs are trivial rewrites, variations on a theme, or conceptually worlds apart. Without this, we cannot detect AI memorization, steer multi-agent provers away from redundant work, or translate opaque machine proofs by matching them to their nearest human-understandable cousins.
Methods
Instead of hunting for one magic formula, the author systematically evaluates 19 dissimilarity measures (12 of them newly introduced or adapted) grouped into six families:
- Syntactic: Comparing proof trees via edit distances, both raw and after stripping away "bureaucracy" like helper lemmas into a simplified normal form.
- Structural: Tracking vocabulary, type classes, and "flow-linking" (how parts of the conclusion wire up to specific lemmas).
- Dependency & Resource: Comparing the transitive web of library lemmas a proof relies upon (e.g., Jaccard distance or Graph Edit Distance on dependency graphs) and its mathematical subject-area footprint.
- Semantic: Running constructive proofs like computer programs ("realizers") against test inputs to see what concrete mathematical witnesses they compute.
- Information-theoretic: Using data compression (zlib) to see how much knowing Proof A shrinks the file size of Proof B.
- Higher-categorical: Measuring the shortest chain of reduction steps connecting two proofs, or building a discrete "identification ladder" from identical syntax down to proving the same theorem.
Each measure is graded against 10 desirable properties—such as triangle inequality, insensitivity to variable renaming, and robustness when a single lemma is split into finer steps—which double as safety checks against Goodhart’s law if an AI optimizes the metric for novelty.
Datasets
The paper introduces two newly constructed, machine-checked evaluation test beds (no training data is used):
- Custom Curry–Howard Kernel: 5 formal proofs of the infinitude of primes built over a shared toy lemma library—Euclid’s classic proof ($E$), a lemma-extracted rewrite ($E'$), a finer-grained expansion ($E^+$), Goldbach’s Fermat-number proof ($G$), and Furstenberg’s topological proof ($F$).
- Lean 4 / Mathlib Replication: 19 tactic-written proofs (plus renamed variants) across 3 classic theorems—infinitude of primes, irrationality of $\sqrt{2}$, and Gauss’s sum $2\sum_{i\le n} i = n(n+1)$—automatically extracted from a pinned version of the massive community library Mathlib.
Key Insights and Ideas
- Furstenberg is Euclid in topological clothing: Intuitively, Furstenberg’s proof (using open and closed sets on integers) feels maximally distant from Euclid’s arithmetic proof. Yet semantic measures invert this completely, scoring them as 100% identical! When executed against a finite list of primes $S$, Furstenberg’s topological machinery computes the exact same missing prime as Euclid: the least prime factor of $1 + \prod S$.
- Classical proof-theory identity breaks in the wild: Logicians long proposed that "the same proof" means "the same normal form." In Lean 4, zero pairs of intuitively identical proofs reduced to the same normal form, because different Lean tactics (
inductionvs.Nat.rec, or automated arithmetic certificates) elaborate into wildly different underlying term trees. - The "Proof by Citation" blind spot: A two-line proof that cites a powerhouse library theorem looks completely alien to a proof that spells out that exact same argument from scratch. Worse, checking Mathlib’s dependency web uncovered relative circularity: proving primes are infinite via the divergence of $\sum 1/p$ silently depended (9 steps deep in Mathlib) on Euclid's proof of infinite primes!
- Profiles beat single numbers: Because two proofs can be conceptually distant yet computationally identical, dissimilarity is best reported as a multi-level profile (where they meet on an identification ladder, their dependency distance, subject-area shift, and an independence flag) rather than a single scalar.
Key Results
- Dependency measures win across the board:
Dependency-JaccardandDependency-GEDscored highest on desirable properties in both the custom kernel (9.5/10) and Lean/Mathlib (9/10). They gave "same" proof pairs a 1.000 similarity while cleanly orderingsame > similar > dissimilaracross all three Lean theorems (averaging 1.00 / 0.66 / 0.45 for Jaccard). - Raw syntax is blind: In the kernel, raw tree-edit similarity scored Euclid vs. its trivial lemma rewrite $(E, E')$ at 0.512—virtually indistinguishable from Furstenberg’s topological proof at 0.514.
- Normal-form syntax ranks well, even without exact matches: In Lean,
NF-TEDachieved full intuitive ordering on 3/3 theorems with a wide similarity spread (0.806 for same, 0.401 for similar, 0.135 for dissimilar). - Lean’s built-in axioms carry zero signal: Every single one of the 19 Lean proofs—even simple induction on Gauss's sum—pulled in
Classical.choicevia standard Mathlib tactics, rendering surface-level axiom checks useless for telling constructive proofs apart from non-constructive ones.
Limitations and Future Work
- Author-stipulated ground truth: Labels like "similar" and "dissimilar" reflect the author’s judgment on a small sample (19 Lean proofs). The author includes a ready-to-run survey instrument to gather empirical ratings from a panel of human mathematicians next.
- The granularity hurdle: Splitting one lemma into three smaller steps still fools most metrics. Achieving true "granularity invariance" requires unfolding and normalizing definitions through a massive library without computational blowup.
- Cross-theorem analogies: Applying current measures across different theorems mostly captures shared proof style (e.g., heavy rewriting vs. citing analysis) rather than shared mathematical tricks. Future work proposes anti-unification—extracting the largest shared template between two abstracted proof terms—to spot "old tricks proving new theorems" at scale.
Summary updated