/-
Copyright 2025 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
import FormalConjecturesUtilConjectures about Mersenne primes
References:
namespace Mersennenamespace NatA Wagstaff prime is a prime number of the form $(2^p+1)/3$.
def GivesWagstaffPrime (p : ℕ) : Prop :=
Odd p ∧ Nat.Prime ((2^p + 1) / 3)
Holds when there is exists a number k such that $p = 2^k \pm 1$ or $p = 4^k \pm 3$.
def IsSpecialForm (p : ℕ) : Prop :=
∃ k : ℕ, p = 2^k + 1 ∨ p = 2^k - 1 ∨ p = 4^k + 3 ∨ p = 4^k - 3end Natopen MersenneThe Catalan-Mersenne numbers, defined recursively by $c_0 = 2$ and $c_{n+1} = 2^{c_n} - 1$.
def catalanMersenne : ℕ → ℕ
| 0 => 2
| n + 1 => 2 ^ catalanMersenne n - 1
A natural number p satisfies the statement of the New Mersenne Conjecture if whenever
two of the following conditions hold,
then all three must hold:
$2^p-1$ is prime
$(2^p+1)/3$ is prime
Exists a number k such that $p = 2^k \pm 1$ or $p = 4^k \pm 3$
def NewMersenneConjectureStatement (p : ℕ) : Prop :=
((mersenne p).Prime ∧ p.GivesWagstaffPrime → p.IsSpecialForm) ∧
((mersenne p).Prime ∧ p.IsSpecialForm → p.GivesWagstaffPrime) ∧
(p.GivesWagstaffPrime ∧ p.IsSpecialForm → (mersenne p).Prime)
For any odd natural number p if two of the following conditions hold,
then all three must hold:
$2^p-1$ is prime
$(2^p+1)/3$ is prime
Exists a number k such that $p = 2^k \pm 1$ or $p = 4^k \pm 3$
@[category research open, AMS 11]
theorem new_mersenne_conjecture (p : ℕ) (hp : Odd p) :
NewMersenneConjectureStatement p := p:ℕhp:Odd p⊢ NewMersenneConjectureStatement p
All goals completed! 🐙It suffices to check this conjecture for primes
neg H:∀ (p : ℕ), Nat.Prime p → NewMersenneConjectureStatement pp:ℕhp_odd:Odd php_prime:¬Nat.Prime pleft✝:Odd phP:Nat.Prime ((2 ^ p + 1) / 3)hp1:¬p = 1q:ℕ := p.minFachq_ne2:q ≠ 2hq_odd:Odd qs:ℕhs:p = q * shs_odd:Odd sh3q:3 ∣ 2 ^ q + 1h3p:3 ∣ 2 ^ p + 1k:ℕhk:2 ^ p + 1 = (2 ^ q + 1) * kd:ℕ := (2 ^ q + 1) / 3hd:d = (2 ^ q + 1) / 3hd_dvd:d ∣ (2 ^ p + 1) / 3h8:8 ≤ 2 ^ qhd_lt:d < (2 ^ p + 1) / 3⊢ False
rcases hP.eq_one_or_self_of_dvd d hd_dvd with h | h neg.inl H:∀ (p : ℕ), Nat.Prime p → NewMersenneConjectureStatement pp:ℕhp_odd:Odd php_prime:¬Nat.Prime pleft✝:Odd phP:Nat.Prime ((2 ^ p + 1) / 3)hp1:¬p = 1q:ℕ := p.minFachq_ne2:q ≠ 2hq_odd:Odd qs:ℕhs:p = q * shs_odd:Odd sh3q:3 ∣ 2 ^ q + 1h3p:3 ∣ 2 ^ p + 1k:ℕhk:2 ^ p + 1 = (2 ^ q + 1) * kd:ℕ := (2 ^ q + 1) / 3hd:d = (2 ^ q + 1) / 3hd_dvd:d ∣ (2 ^ p + 1) / 3h8:8 ≤ 2 ^ qhd_lt:d < (2 ^ p + 1) / 3h:d = 1⊢ Falseneg.inr H:∀ (p : ℕ), Nat.Prime p → NewMersenneConjectureStatement pp:ℕhp_odd:Odd php_prime:¬Nat.Prime pleft✝:Odd phP:Nat.Prime ((2 ^ p + 1) / 3)hp1:¬p = 1q:ℕ := p.minFachq_ne2:q ≠ 2hq_odd:Odd qs:ℕhs:p = q * shs_odd:Odd sh3q:3 ∣ 2 ^ q + 1h3p:3 ∣ 2 ^ p + 1k:ℕhk:2 ^ p + 1 = (2 ^ q + 1) * kd:ℕ := (2 ^ q + 1) / 3hd:d = (2 ^ q + 1) / 3hd_dvd:d ∣ (2 ^ p + 1) / 3h8:8 ≤ 2 ^ qhd_lt:d < (2 ^ p + 1) / 3h:d = (2 ^ p + 1) / 3⊢ False <;> neg.inl H:∀ (p : ℕ), Nat.Prime p → NewMersenneConjectureStatement pp:ℕhp_odd:Odd php_prime:¬Nat.Prime pleft✝:Odd phP:Nat.Prime ((2 ^ p + 1) / 3)hp1:¬p = 1q:ℕ := p.minFachq_ne2:q ≠ 2hq_odd:Odd qs:ℕhs:p = q * shs_odd:Odd sh3q:3 ∣ 2 ^ q + 1h3p:3 ∣ 2 ^ p + 1k:ℕhk:2 ^ p + 1 = (2 ^ q + 1) * kd:ℕ := (2 ^ q + 1) / 3hd:d = (2 ^ q + 1) / 3hd_dvd:d ∣ (2 ^ p + 1) / 3h8:8 ≤ 2 ^ qhd_lt:d < (2 ^ p + 1) / 3h:d = 1⊢ Falseneg.inr H:∀ (p : ℕ), Nat.Prime p → NewMersenneConjectureStatement pp:ℕhp_odd:Odd php_prime:¬Nat.Prime pleft✝:Odd phP:Nat.Prime ((2 ^ p + 1) / 3)hp1:¬p = 1q:ℕ := p.minFachq_ne2:q ≠ 2hq_odd:Odd qs:ℕhs:p = q * shs_odd:Odd sh3q:3 ∣ 2 ^ q + 1h3p:3 ∣ 2 ^ p + 1k:ℕhk:2 ^ p + 1 = (2 ^ q + 1) * kd:ℕ := (2 ^ q + 1) / 3hd:d = (2 ^ q + 1) / 3hd_dvd:d ∣ (2 ^ p + 1) / 3h8:8 ≤ 2 ^ qhd_lt:d < (2 ^ p + 1) / 3h:d = (2 ^ p + 1) / 3⊢ False grind All goals completed! 🐙The New Mersenne Conjecture statement holds for odd primes.
@[category research open, AMS 11]
theorem new_mersenne_conjecture.variants.prime (p : ℕ) (hp : p.Prime) (h : Odd p) :
NewMersenneConjectureStatement p := by p:ℕhp:Nat.Prime ph:Odd p⊢ NewMersenneConjectureStatement p
sorry All goals completed! 🐙Are there infinitely many Mersenne primes?
@[category research open, AMS 11]
theorem infinitely_many_mersenne_primes :
answer(sorry) ↔ Set.Infinite { p : ℕ | (mersenne p).Prime } := by ⊢ True ↔ {p | Nat.Prime (mersenne p)}.Infinite
sorry All goals completed! 🐙The first five Catalan-Mersenne numbers $c_0, \ldots, c_4$ are known to be prime. Catalan conjectured that they are prime "up to a certain limit". Are all Catalan-Mersenne numbers $c_n$ with $n \geq 5$ prime?
@[category research open, AMS 11]
theorem catalans_mersenne_conjecture :
answer(sorry) ↔ ∀ n ≥ 5, Nat.Prime (catalanMersenne n) := by ⊢ True ↔ ∀ n ≥ 5, Nat.Prime (catalanMersenne n)
sorry All goals completed! 🐙end Mersenne