Deep Vision: A Formal Proof of Wolstenholmes Theorem in Lean 4
Abstract
We present a formal verification of Wolstenholme's theorem -- 2pp 2 p3 for prime p ≥ 5 -- in Lean~4 with Mathlib. The proof proceeds by expanding the shifted factorial product Πk=1p-1(p+k) 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 comprises nine lemmas across approximately 800 lines of Lean, with zero sorry declarations. To our knowledge, this is the first formal verification of Wolstenholme's theorem in Lean~4. The proof was discovered through a collaboration between a relational analogy engine for theorem proving and human-directed formalization.
Turn this paper into a lesson
ArcXiv compiles a structured reading guide from this paper's metadata: plain-English importance, contributions, prerequisite concepts, which sections to read first, flashcards, and a quiz. Grounded in the abstract, never invented.