Mersenne prime exponent counting function
DefinitionMersenneLPW_mersenneExponentCountFor a natural number , the Mersenne prime exponent counting function is
It counts exponents, not the Mersenne primes themselves, and the bound is strict (). This is the counting function appearing in the Lenstra–Pomerance–Wagstaff conjecture, which predicts as , where 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 by changes by at most one and does not affect the conjectured asymptotic.
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
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.