/- Copyright 2026 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. -/ module public import FormalConjectures.Wikipedia.Euclid public import FormalConjecturesUtil

Infinitude of primorial primes

For $n \in \mathbb{N}$, let $p_n#$ (Nat.kthPrimorial n) denote the primorial multiplying the initial $n$ primes (with $p_0# = 1$), so EuclidNumbers.Euclid n equals $p_n# + 1$ and $p_n# - 1$ is a Kummer number (OEIS A057588). Primes equal to $p_n# + 1$ (prime Euclid numbers, OEIS A018239) or $p_n# - 1$ (prime Kummer numbers, OEIS A057705) are called primorial primes (OEIS A228486, studied computationally by Dubner 1987). Although $p_n# + 1$ always has a prime factor exceeding $p_n$, the integers $p_n# \pm 1$ are often composite (beginning with $p_4# - 1 = 209 = 11 \times 19$ and $p_6# + 1 = 30031 = 59 \times 509$). Whether infinitely many primorial primes exist, whether infinitely many Kummer numbers are prime, and whether infinitely many integers $p_n# \pm 1$ (or of either sign individually) are composite all remain open.

References:

@[expose] public sectionnamespace PrimorialPrime

EuclidNumbers.Euclid n agrees with Nat.kthPrimorial n + 1.

@[simp, category API, AMS 11] theorem euclid_eq_kthPrimorial_add_one (n : ℕ) : EuclidNumbers.Euclid n = Nat.kthPrimorial n + 1 := Nat.add_comm 1 _

A prime Euclid number, i.e., a prime equal to EuclidNumbers.Euclid n ($p_n# + 1$) for some $n \in \mathbb{N}$ (including $E_0 = p_0# + 1 = 2$).

def IsEuclidPrimorialPrime (q : ℕ) : Prop := q.Prime ∧ ∃ n : ℕ, q = EuclidNumbers.Euclid n

A prime Kummer number, i.e., a prime equal to $p_n# - 1$ for some $n \in \mathbb{N}$.

def IsKummerPrimorialPrime (q : ℕ) : Prop := q.Prime ∧ ∃ n : ℕ, q + 1 = Nat.kthPrimorial n

A prime equal to $p_n# \pm 1$ for some $n \in \mathbb{N}$.

def IsPrimorialPrime (q : ℕ) : Prop := IsEuclidPrimorialPrime q ∨ IsKummerPrimorialPrime q

Verifies $2 = p_0# + 1$, $3 = p_1# + 1$, and $31 = p_3# + 1$ as prime Euclid numbers, and $5 = p_2# - 1$ and $29 = p_3# - 1$ as prime Kummer numbers.

@[category test, AMS 11] theorem primorialPrime_small_witnesses : IsEuclidPrimorialPrime 2 ∧ IsEuclidPrimorialPrime 3 ∧ IsEuclidPrimorialPrime 31 ∧ IsKummerPrimorialPrime 5 ∧ IsPrimorialPrime 29 := ⊢ IsEuclidPrimorialPrime 2 ∧ IsEuclidPrimorialPrime 3 ∧ IsEuclidPrimorialPrime 31 ∧ IsKummerPrimorialPrime 5 ∧ IsPrimorialPrime 29 refine ⟨⟨⊢ Nat.Prime 2 All goals completed! 🐙, 0, ⊢ 2 = EuclidNumbers.Euclid 0 All goals completed! 🐙⟩, ⟨⊢ Nat.Prime 3 All goals completed! 🐙, 1, ⊢ 3 = EuclidNumbers.Euclid 1 All goals completed! 🐙⟩, ⟨⊢ Nat.Prime 31 All goals completed! 🐙, 3, ⊢ 31 = EuclidNumbers.Euclid 3 All goals completed! 🐙⟩, ⟨⊢ Nat.Prime 5 All goals completed! 🐙, 2, ⊢ 5 + 1 = Nat.kthPrimorial 2 All goals completed! 🐙⟩, Or.inr ⟨⊢ Nat.Prime 29 All goals completed! 🐙, 3, ⊢ 29 + 1 = Nat.kthPrimorial 3 All goals completed! 🐙⟩⟩

Checks that $p_4# - 1 = 209 = 11 \times 19$ and $E_6 = p_6# + 1 = 30031 = 59 \times 509$ are composite, hence not primorial primes.

h4:Nat.kthPrimorial 4 = 210h6:Nat.kthPrimorial 6 = 30030⊢ ¬IsPrimorialPrime (210 - 1) ∧ ¬Nat.Prime (30030 + 1) refine ⟨?_, h4:Nat.kthPrimorial 4 = 210h6:Nat.kthPrimorial 6 = 30030⊢ ¬Nat.Prime (30030 + 1) All goals completed! 🐙⟩ h4:Nat.kthPrimorial 4 = 210h6:Nat.kthPrimorial 6 = 30030hp:Nat.Prime (210 - 1)right✝:∃ n, 210 - 1 = EuclidNumbers.Euclid n⊢ Falseh4:Nat.kthPrimorial 4 = 210h6:Nat.kthPrimorial 6 = 30030hp:Nat.Prime (210 - 1)right✝:∃ n, 210 - 1 + 1 = n.kthPrimorial⊢ False h4:Nat.kthPrimorial 4 = 210h6:Nat.kthPrimorial 6 = 30030hp:Nat.Prime (210 - 1)right✝:∃ n, 210 - 1 = EuclidNumbers.Euclid n⊢ Falseh4:Nat.kthPrimorial 4 = 210h6:Nat.kthPrimorial 6 = 30030hp:Nat.Prime (210 - 1)right✝:∃ n, 210 - 1 + 1 = n.kthPrimorial⊢ False All goals completed! 🐙

Every primorial prime is prime, and infinitude of either prime Euclid numbers (EuclidNumbers.infinite_prime_euclid_numbers) or prime Kummer numbers implies infinitude of IsPrimorialPrime.

hmono:StrictMono EuclidNumbers.Euclid⊢ (∀ (q : ℕ), IsPrimorialPrime q → Nat.Prime q) ∧ ({n | Nat.Prime (EuclidNumbers.Euclid n)}.Infinite → {q | IsPrimorialPrime q}.Infinite) ∧ ({q | IsKummerPrimorialPrime q}.Infinite → {q | IsPrimorialPrime q}.Infinite) hmono:StrictMono EuclidNumbers.Euclid⊢ ∀ (q : ℕ), IsPrimorialPrime q → Nat.Prime qhmono:StrictMono EuclidNumbers.Euclidh:{n | Nat.Prime (EuclidNumbers.Euclid n)}.Infinite⊢ EuclidNumbers.Euclid '' {n | Nat.Prime (EuclidNumbers.Euclid n)} ⊆ {q | IsPrimorialPrime q} hmono:StrictMono EuclidNumbers.Euclid⊢ ∀ (q : ℕ), IsPrimorialPrime q → Nat.Prime q hmono:StrictMono EuclidNumbers.Euclidq:ℕhq:Nat.Prime qright✝:∃ n, q = EuclidNumbers.Euclid n⊢ Nat.Prime qhmono:StrictMono EuclidNumbers.Euclidq:ℕhq:Nat.Prime qright✝:∃ n, q + 1 = n.kthPrimorial⊢ Nat.Prime q hmono:StrictMono EuclidNumbers.Euclidq:ℕhq:Nat.Prime qright✝:∃ n, q = EuclidNumbers.Euclid n⊢ Nat.Prime qhmono:StrictMono EuclidNumbers.Euclidq:ℕhq:Nat.Prime qright✝:∃ n, q + 1 = n.kthPrimorial⊢ Nat.Prime q All goals completed! 🐙 hmono:StrictMono EuclidNumbers.Euclidh:{n | Nat.Prime (EuclidNumbers.Euclid n)}.Infinite⊢ EuclidNumbers.Euclid '' {n | Nat.Prime (EuclidNumbers.Euclid n)} ⊆ {q | IsPrimorialPrime q} hmono:StrictMono EuclidNumbers.Euclidh:{n | Nat.Prime (EuclidNumbers.Euclid n)}.Infiniten:ℕhn:n ∈ {n | Nat.Prime (EuclidNumbers.Euclid n)}⊢ EuclidNumbers.Euclid n ∈ {q | IsPrimorialPrime q} All goals completed! 🐙

Verifies $7 = p_2# + 1$ and $211 = p_4# + 1$ as prime Euclid numbers, and $2309 = p_5# - 1$ as a prime Kummer number.

@[category test, AMS 11] theorem primorialPrime_7_211_2309 : IsEuclidPrimorialPrime 7 ∧ IsEuclidPrimorialPrime 211 ∧ IsKummerPrimorialPrime 2309 := ⊢ IsEuclidPrimorialPrime 7 ∧ IsEuclidPrimorialPrime 211 ∧ IsKummerPrimorialPrime 2309 refine ⟨⟨⊢ Nat.Prime 7 All goals completed! 🐙, 2, ⊢ 7 = EuclidNumbers.Euclid 2 All goals completed! 🐙⟩, ⟨⊢ Nat.Prime 211 All goals completed! 🐙, 4, ⊢ 211 = EuclidNumbers.Euclid 4 All goals completed! 🐙⟩, ⟨⊢ Nat.Prime 2309 All goals completed! 🐙, 5, ⊢ 2309 + 1 = Nat.kthPrimorial 5 All goals completed! 🐙⟩⟩

Do infinitely many primorial primes $p_n# \pm 1$ exist? (The positive-sign case $p_n# + 1$ appears as EuclidNumbers.infinite_prime_euclid_numbers.)

@[category research open, question, AMS 11] theorem infinitely_many_primorial_primes : {q : ℕ | IsPrimorialPrime q}.Infinite := ⊢ {q | IsPrimorialPrime q}.Infinite All goals completed! 🐙

Do infinitely many prime Kummer numbers $p_n# - 1$ exist?

@[category research open, question, AMS 11] theorem infinitely_many_primorial_primes.variants.kummer : {q : ℕ | IsKummerPrimorialPrime q}.Infinite := ⊢ {q | IsKummerPrimorialPrime q}.Infinite All goals completed! 🐙

Are infinitely many integers of the form $p_n# \pm 1$ composite? This statement takes the union over both signs ($m = p_n# + 1$ or $m = p_n# - 1$).

@[category research open, question, AMS 11] theorem infinitely_many_primorial_primes.variants.composite : {m : ℕ | m.Composite ∧ ∃ n : ℕ, m = EuclidNumbers.Euclid n ∨ m + 1 = Nat.kthPrimorial n}.Infinite := ⊢ {m | m.Composite ∧ ∃ n, m = EuclidNumbers.Euclid n ∨ m + 1 = n.kthPrimorial}.Infinite All goals completed! 🐙

Are infinitely many Euclid numbers $p_n# + 1$ composite?

@[category research open, question, AMS 11] theorem infinitely_many_primorial_primes.variants.composite_euclid : {n : ℕ | (EuclidNumbers.Euclid n).Composite}.Infinite := ⊢ {n | (EuclidNumbers.Euclid n).Composite}.Infinite All goals completed! 🐙

Are infinitely many Kummer numbers $p_n# - 1$ composite?

@[category research open, question, AMS 11] theorem infinitely_many_primorial_primes.variants.composite_kummer : {m : ℕ | m.Composite ∧ ∃ n : ℕ, m + 1 = Nat.kthPrimorial n}.Infinite := ⊢ {m | m.Composite ∧ ∃ n, m + 1 = n.kthPrimorial}.Infinite All goals completed! 🐙end PrimorialPrime