Deep Vision: A Formal Proof of Wolstenholmes Theorem in Lean 4
Wolstenholme's theorem (that the binomial coefficient C(2p,p) is congruent to 2 mod p^3 for primes p >= 5) is a classical result in number theory, but it has not been formally verified in Lean 4 or any major formal mathematics library.
The proof proceeds by expanding the shifted factorial product to second order in p, identifying the quadratic coefficient as the second elementary symmetric product, and showing its divisibility by p via power-sum vanishing in Z/pZ. The formalization in Lean 4 with Mathlib comprises nine lemmas across approximately 800 lines with zero sorry declarations. The proof was discovered through collaboration between a relational analogy engine for theorem proving and human-directed formalization.
This is the first formal verification of Wolstenholme's theorem in Lean 4. The formalization is approximately 800 lines of Lean code with zero sorry declarations, contained in a single self-contained file.
