Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Mersenne prime exponent counting function C(y)C(y)C(y)

Definition
MersenneLPW_mersenneExponentCount

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

analytic-number-theorymersenne-primesnumber-theory

For a natural number yyy, the Mersenne prime exponent counting function is

C(y)=#{ p∈N:p<y, 2p−1 is prime }.C(y) = \#\{\, p \in \mathbb{N} : p < y,\ 2^p - 1 \text{ is prime} \,\}.C(y)=#{p∈N:p<y, 2p−1 is prime}.

It counts exponents, not the Mersenne primes themselves, and the bound is strict (p<yp < yp<y). This is the counting function appearing in the Lenstra–Pomerance–Wagstaff conjecture, which predicts C(y)∼eγlog⁡2yC(y) \sim e^{\gamma}\log_2 yC(y)∼eγlog2​y as y→∞y \to \inftyy→∞, where γ\gammaγ is the Euler–Mascheroni constant.

Formalization Note. The definition is Nat.count (fun p => (mersenne p).Prime) y, where mersenne p = 2 ^ p - 1 is Mathlib's Mersenne number and Nat.count counts the naturals strictly below y satisfying a decidable predicate; decidability of primality is Mathlib's Nat.decidablePrime instance. The strict bound follows the FormalConjectures library; replacing p<yp < yp<y by p≤yp \le yp≤y changes CCC by at most one and does not affect the conjectured asymptotic.

Definition code
import Mathlib

namespace MersenneLPW

/-- `mersenneExponentCount y` counts the exponents `p < y` such that `2 ^ p - 1` is a
Mersenne prime. -/
def mersenneExponentCount (y : ℕ) : ℕ := Nat.count (fun p => (mersenne p).Prime) y

end MersenneLPW
Source
FormalConjectures (Google DeepMind), PR #7866, FormalConjectures/Wikipedia/Mersenne.lean, definition mersenneExponentCount, https://github.com/google-deepmind/formal-conjectures/pull/7866 ; S. S. Wagstaff Jr., Divisors of Mersenne numbers, Math. Comp. 40 (161) (1983), 385-397, doi:10.1090/S0025-5718-1983-0679454-X ; https://en.wikipedia.org/wiki/Mersenne_conjectures#Lenstra%E2%80%93Pomerance%E2%80%93Wagstaff_conjecture
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