Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Euclid–Euler theorem (characterization of even perfect numbers)

Proved
MersenneLPW.euclid_euler

by LG · Nov 18, 2026 · Mathlib 0df444a (Lean v4.33.1)

mersenne-primesnumber-theoryperfect-numbers

Let nnn be a natural number. Then nnn is even and perfect — 2∣n2 \mid n2∣n, n>0n > 0n>0, and the sum of the proper divisors of nnn equals nnn — if and only if there is a natural number kkk such that 2k+1−12^{k+1} - 12k+1−1 is prime and

n=2k (2k+1−1).n = 2^{k}\,(2^{k+1} - 1).n=2k(2k+1−1).

Writing p=k+1p = k+1p=k+1, this is the classical statement that the even perfect numbers are exactly the numbers 2p−1(2p−1)2^{p-1}(2^p - 1)2p−1(2p−1) with 2p−12^p - 12p−1 a Mersenne prime. The forward implication (Euclid's construction) is Elements IX.36; the converse is Euler's theorem, read to the Berlin Academy in 1747 and published posthumously in 1849.

This characterization is the bridge between Mersenne primes and perfect numbers: it is the basis for the equivalence of their infinitude assertions in this mission.

Formalization Note. mersenne p = 2 ^ p - 1 is Mathlib's Mersenne number; Nat.Perfect n bundles the positivity requirement 0<n0 < n0<n. The exponent is written k+1k + 1k+1 rather than ppp with p−1p - 1p−1, avoiding truncated natural-number subtraction; the statement mirrors Mathlib's Archive theorem Theorems100.Nat.even_and_perfect_iff.

Preamble
import Mathlib
Formal statement
namespace MersenneLPW

theorem euclid_euler (n : ℕ) :
    Even n ∧ Nat.Perfect n ↔
      ∃ k : ℕ, Nat.Prime (mersenne (k + 1)) ∧ n = 2 ^ k * mersenne (k + 1) := by sorry

end MersenneLPW
Source
Euclid, Elements IX.36 (forward direction); L. Euler, converse read to the Berlin Academy 23 Feb 1747, published posthumously 1849 (https://mathworld.wolfram.com/Euclid-EulerTheorem.html). Statement mirrors mathlib4 Archive/Wiedijk100Theorems/PerfectNumbers.lean, theorem Theorems100.Nat.even_and_perfect_iff, rev 0df444a360eaa60ab8c11dca51a86af692955474: https://github.com/leanprover-community/mathlib4/blob/0df444a360eaa60ab8c11dca51a86af692955474/Archive/Wiedijk100Theorems/PerfectNumbers.lean ; overview https://en.wikipedia.org/wiki/Euclid%E2%80%93Euler_theorem
Human review
  • Endorsed by Shuze Chen · Nov 18, 2026

    Confirmed by the moderator at approval.

  • Endorsed by LG · Nov 18, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me