/-
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 FormalConjecturesUtilMinimal primes in radix bases
Fix an integer base $b \ge 2$. A prime $p$ is minimal in base $b$ if no proper subsequence (not
necessarily contiguous) of its canonical base-$b$ expansion represents a prime—equivalently, no
prime $q \neq p$ has its canonical base-$b$ digit list as a sublist of Nat.digits b p. By
Higman's lemma, the set of minimal primes in base $b$ is finite for every $b \ge 2$. Jeffrey
Shallit (2000) classified all $26$ base-$10$ minimal primes (OEIS A071062, up to $66600049$).
Curtis Bright, Raymond Devillers, and Shallit (2016) extended minimal-prime classifications to
larger bases; in base $17$, they already reduced the classification to $1279$ minimal probable
primes (not all certified prime) together with the single unresolved candidate family
$\mathrm{F}1{9}$ (base-$17$ digits $15, 1, 9, \dots, 9$).
References:
J. Shallit, Minimal primes, J. Recreational Math. 30 (1999–2000), 113–117.
C. Bright, R. Devillers, and J. Shallit, Minimal elements for the prime numbers, Exp. Math. 25 (2016), 321–331.
@[expose] public sectionnamespace MinimalPrime
Prime $p$ is minimal in base $b \ge 2$ when no prime $q \neq p$ has Nat.digits b q as a
sublist of Nat.digits b p.
def IsMinimalPrimeInBase (b p : ℕ) : Prop :=
2 ≤ b ∧ p.Prime ∧ ¬∃ q : ℕ, q.Prime ∧ q ≠ p ∧ (Nat.digits b q).Sublist (Nat.digits b p)Base $10$ includes $2$ as minimal and excludes $13$ (via proper sublist $3$), while bases $b \in {0, 1}$ are excluded.
refine_1.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hd:Nat.digits 10 2 = [2]h2:Nat.digits 10 q = [2]this:q = Nat.ofDigits 10 [2]⊢ False
exact hne this All goals completed! 🐙
· refine_2 ⊢ ¬IsMinimalPrimeInBase 10 13 rintro ⟨_, _, hno⟩ refine_2 left✝¹:2 ≤ 10left✝:Nat.Prime 13hno:¬∃ q, Nat.Prime q ∧ q ≠ 13 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 13)⊢ False
exact hno ⟨3, by left✝¹:2 ≤ 10left✝:Nat.Prime 13hno:¬∃ q, Nat.Prime q ∧ q ≠ 13 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 13)⊢ Nat.Prime 3 decide All goals completed! 🐙, by left✝¹:2 ≤ 10left✝:Nat.Prime 13hno:¬∃ q, Nat.Prime q ∧ q ≠ 13 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 13)⊢ 3 ≠ 13 decide All goals completed! 🐙, by left✝¹:2 ≤ 10left✝:Nat.Prime 13hno:¬∃ q, Nat.Prime q ∧ q ≠ 13 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 13)⊢ (Nat.digits 10 3).Sublist (Nat.digits 10 13) decide All goals completed! 🐙⟩
Single-digit primes $p \in {3, 5, 7}$ satisfy IsMinimalPrimeInBase 10 p, whereas $1$
satisfies ¬ IsMinimalPrimeInBase b 1 for every $b$.
@[category test, AMS 11 68]
theorem single_digit_primes_minimal_base_ten :
IsMinimalPrimeInBase 10 3 ∧
IsMinimalPrimeInBase 10 5 ∧
IsMinimalPrimeInBase 10 7 ∧
∀ b : ℕ, ¬ IsMinimalPrimeInBase b 1 := by ⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1
have hmin : ∀ p : ℕ, p.Prime → p < 10 → IsMinimalPrimeInBase 10 p := by
intro p hp hlt p:ℕhp:Nat.Prime phlt:p < 10⊢ IsMinimalPrimeInBase 10 p hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1
refine ⟨by p:ℕhp:Nat.Prime phlt:p < 10⊢ 2 ≤ 10 hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1 omega All goals completed! 🐙 hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1, hp, ?_⟩
rintro ⟨q, hq, hne, hsub⟩ p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phsub:(Nat.digits 10 q).Sublist (Nat.digits 10 p)⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1
have hd : Nat.digits 10 p = [p] := Nat.digits_of_lt 10 p hp.ne_zero hlt p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phsub:(Nat.digits 10 q).Sublist (Nat.digits 10 p)hd:Nat.digits 10 p = [p]⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1
rw [hd, p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phsub:(Nat.digits 10 q).Sublist [p]hd:Nat.digits 10 p = [p]⊢ False p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phsub:Nat.digits 10 q = [] ∨ Nat.digits 10 q = [p]hd:Nat.digits 10 p = [p]⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1 List.sublist_singleton p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phsub:Nat.digits 10 q = [] ∨ Nat.digits 10 q = [p]hd:Nat.digits 10 p = [p]⊢ False p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phsub:Nat.digits 10 q = [] ∨ Nat.digits 10 q = [p]hd:Nat.digits 10 p = [p]⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1] at hsub p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phsub:Nat.digits 10 q = [] ∨ Nat.digits 10 q = [p]hd:Nat.digits 10 p = [p]⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1
rcases hsub with h0 | hp_eq inl p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phd:Nat.digits 10 p = [p]h0:Nat.digits 10 q = []⊢ Falseinr p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phd:Nat.digits 10 p = [p]hp_eq:Nat.digits 10 q = [p]⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1
· inl p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phd:Nat.digits 10 p = [p]h0:Nat.digits 10 q = []⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1 exact hq.ne_zero (Nat.digits_eq_nil_iff_eq_zero.mp h0) All goals completed! 🐙 hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1
· inr p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phd:Nat.digits 10 p = [p]hp_eq:Nat.digits 10 q = [p]⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1 have := congrArg (Nat.ofDigits 10) hp_eq inr p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phd:Nat.digits 10 p = [p]hp_eq:Nat.digits 10 q = [p]this:Nat.ofDigits 10 (Nat.digits 10 q) = Nat.ofDigits 10 [p]⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1
rw [Nat.ofDigits_digits, inr p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phd:Nat.digits 10 p = [p]hp_eq:Nat.digits 10 q = [p]this:q = Nat.ofDigits 10 [p]⊢ False inr p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phd:Nat.digits 10 p = [p]hp_eq:Nat.digits 10 q = [p]this:q = p⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1 Nat.ofDigits_singleton inr p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phd:Nat.digits 10 p = [p]hp_eq:Nat.digits 10 q = [p]this:q = p⊢ Falseinr p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phd:Nat.digits 10 p = [p]hp_eq:Nat.digits 10 q = [p]this:q = p⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1] at thisinr p:ℕhp:Nat.Prime phlt:p < 10q:ℕhq:Nat.Prime qhne:q ≠ phd:Nat.digits 10 p = [p]hp_eq:Nat.digits 10 q = [p]this:q = p⊢ False hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1
exact hne this hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1 hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ IsMinimalPrimeInBase 10 3 ∧ IsMinimalPrimeInBase 10 5 ∧ IsMinimalPrimeInBase 10 7 ∧ ∀ (b : ℕ), ¬IsMinimalPrimeInBase b 1
exact ⟨hmin 3 (by hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ Nat.Prime 3 decide All goals completed! 🐙) (by hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ 3 < 10 omega All goals completed! 🐙), hmin 5 (by hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ Nat.Prime 5 decide All goals completed! 🐙) (by hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ 5 < 10 omega All goals completed! 🐙),
hmin 7 (by hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ Nat.Prime 7 decide All goals completed! 🐙) (by hmin:∀ (p : ℕ), Nat.Prime p → p < 10 → IsMinimalPrimeInBase 10 p⊢ 7 < 10 omega All goals completed! 🐙), fun _ h => Nat.not_prime_one h.2.1⟩In binary ($b = 2$), $2 = (10)_2$ is minimal, whereas in base $10$ neither $23$ nor $37$ is minimal.
@[category test, AMS 11 68]
theorem binary_two_minimal_and_base_ten_nonminimal :
IsMinimalPrimeInBase 2 2 ∧
¬ IsMinimalPrimeInBase 10 23 ∧
¬ IsMinimalPrimeInBase 10 37 := by ⊢ IsMinimalPrimeInBase 2 2 ∧ ¬IsMinimalPrimeInBase 10 23 ∧ ¬IsMinimalPrimeInBase 10 37
refine ⟨⟨by ⊢ 2 ≤ 2 omega All goals completed! 🐙, Nat.prime_two, ?_⟩, ?_, ?_⟩
· refine_1 ⊢ ¬∃ q, Nat.Prime q ∧ q ≠ 2 ∧ (Nat.digits 2 q).Sublist (Nat.digits 2 2) rintro ⟨q, hq, hne, hsub⟩ refine_1 q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist (Nat.digits 2 2)⊢ False
have hd : Nat.digits 2 2 = [0, 1] := by ⊢ IsMinimalPrimeInBase 2 2 ∧ ¬IsMinimalPrimeInBase 10 23 ∧ ¬IsMinimalPrimeInBase 10 37 refine_1 q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist (Nat.digits 2 2)hd:Nat.digits 2 2 = [0, 1]⊢ False decide refine_1 q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist (Nat.digits 2 2)hd:Nat.digits 2 2 = [0, 1]⊢ Falserefine_1 q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist (Nat.digits 2 2)hd:Nat.digits 2 2 = [0, 1]⊢ False
rw [hd refine_1 q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]⊢ False refine_1 q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]⊢ False] at hsubrefine_1 q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]⊢ False
have hval : q = Nat.ofDigits 2 (Nat.digits 2 q) := (Nat.ofDigits_digits 2 q).symm refine_1 q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)⊢ False
rcases List.sublist_cons_iff.mp hsub with hsub1 | ⟨l, hdig, hsub1⟩ refine_1.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)hsub1:(Nat.digits 2 q).Sublist [1]⊢ Falserefine_1.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)l:List ℕhdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]⊢ False
· refine_1.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)hsub1:(Nat.digits 2 q).Sublist [1]⊢ False rcases List.sublist_singleton.mp hsub1 with h0 | h1 refine_1.inl.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)hsub1:(Nat.digits 2 q).Sublist [1]h0:Nat.digits 2 q = []⊢ Falserefine_1.inl.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)hsub1:(Nat.digits 2 q).Sublist [1]h1:Nat.digits 2 q = [1]⊢ False
· refine_1.inl.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)hsub1:(Nat.digits 2 q).Sublist [1]h0:Nat.digits 2 q = []⊢ False rw [h0 refine_1.inl.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 []hsub1:(Nat.digits 2 q).Sublist [1]h0:Nat.digits 2 q = []⊢ False refine_1.inl.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 []hsub1:(Nat.digits 2 q).Sublist [1]h0:Nat.digits 2 q = []⊢ False] at hvalrefine_1.inl.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 []hsub1:(Nat.digits 2 q).Sublist [1]h0:Nat.digits 2 q = []⊢ False; rw [hval refine_1.inl.inl q:ℕhq:Nat.Prime (Nat.ofDigits 2 [])hne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 []hsub1:(Nat.digits 2 q).Sublist [1]h0:Nat.digits 2 q = []⊢ False refine_1.inl.inl q:ℕhq:Nat.Prime (Nat.ofDigits 2 [])hne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 []hsub1:(Nat.digits 2 q).Sublist [1]h0:Nat.digits 2 q = []⊢ False] at hqrefine_1.inl.inl q:ℕhq:Nat.Prime (Nat.ofDigits 2 [])hne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 []hsub1:(Nat.digits 2 q).Sublist [1]h0:Nat.digits 2 q = []⊢ False; revert hq refine_1.inl.inl q:ℕhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 []hsub1:(Nat.digits 2 q).Sublist [1]h0:Nat.digits 2 q = []⊢ Nat.Prime (Nat.ofDigits 2 []) → False; decide All goals completed! 🐙
· refine_1.inl.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)hsub1:(Nat.digits 2 q).Sublist [1]h1:Nat.digits 2 q = [1]⊢ False rw [h1 refine_1.inl.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 [1]hsub1:(Nat.digits 2 q).Sublist [1]h1:Nat.digits 2 q = [1]⊢ False refine_1.inl.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 [1]hsub1:(Nat.digits 2 q).Sublist [1]h1:Nat.digits 2 q = [1]⊢ False] at hvalrefine_1.inl.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 [1]hsub1:(Nat.digits 2 q).Sublist [1]h1:Nat.digits 2 q = [1]⊢ False; rw [hval refine_1.inl.inr q:ℕhq:Nat.Prime (Nat.ofDigits 2 [1])hne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 [1]hsub1:(Nat.digits 2 q).Sublist [1]h1:Nat.digits 2 q = [1]⊢ False refine_1.inl.inr q:ℕhq:Nat.Prime (Nat.ofDigits 2 [1])hne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 [1]hsub1:(Nat.digits 2 q).Sublist [1]h1:Nat.digits 2 q = [1]⊢ False] at hqrefine_1.inl.inr q:ℕhq:Nat.Prime (Nat.ofDigits 2 [1])hne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 [1]hsub1:(Nat.digits 2 q).Sublist [1]h1:Nat.digits 2 q = [1]⊢ False; revert hq refine_1.inl.inr q:ℕhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 [1]hsub1:(Nat.digits 2 q).Sublist [1]h1:Nat.digits 2 q = [1]⊢ Nat.Prime (Nat.ofDigits 2 [1]) → False; decide All goals completed! 🐙
· refine_1.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)l:List ℕhdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]⊢ False rcases List.sublist_singleton.mp hsub1 with h0 | h1 refine_1.inr.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)l:List ℕhdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h0:l = []⊢ Falserefine_1.inr.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)l:List ℕhdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h1:l = [1]⊢ False
· refine_1.inr.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)l:List ℕhdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h0:l = []⊢ False rw [hdig, refine_1.inr.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 (0 :: l)hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h0:l = []⊢ False refine_1.inr.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h0:l = []⊢ False h0 refine_1.inr.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h0:l = []⊢ Falserefine_1.inr.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h0:l = []⊢ False] at hvalrefine_1.inr.inl q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h0:l = []⊢ False; rw [hval refine_1.inr.inl q:ℕhq:Nat.Prime (Nat.ofDigits 2 [0])hne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h0:l = []⊢ False refine_1.inr.inl q:ℕhq:Nat.Prime (Nat.ofDigits 2 [0])hne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h0:l = []⊢ False] at hqrefine_1.inr.inl q:ℕhq:Nat.Prime (Nat.ofDigits 2 [0])hne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h0:l = []⊢ False; revert hq refine_1.inr.inl q:ℕhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h0:l = []⊢ Nat.Prime (Nat.ofDigits 2 [0]) → False; decide All goals completed! 🐙
· refine_1.inr.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]hval:q = Nat.ofDigits 2 (Nat.digits 2 q)l:List ℕhdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h1:l = [1]⊢ False rw [hdig, refine_1.inr.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 (0 :: l)hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h1:l = [1]⊢ False refine_1.inr.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0, 1]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h1:l = [1]⊢ False h1 refine_1.inr.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0, 1]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h1:l = [1]⊢ Falserefine_1.inr.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0, 1]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h1:l = [1]⊢ False] at hvalrefine_1.inr.inr q:ℕhq:Nat.Prime qhne:q ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0, 1]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h1:l = [1]⊢ False; rw [hval refine_1.inr.inr q:ℕhq:Nat.Prime qhne:Nat.ofDigits 2 [0, 1] ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0, 1]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h1:l = [1]⊢ False refine_1.inr.inr q:ℕhq:Nat.Prime qhne:Nat.ofDigits 2 [0, 1] ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0, 1]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h1:l = [1]⊢ False] at hnerefine_1.inr.inr q:ℕhq:Nat.Prime qhne:Nat.ofDigits 2 [0, 1] ≠ 2hsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0, 1]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h1:l = [1]⊢ False; revert hne refine_1.inr.inr q:ℕhq:Nat.Prime qhsub:(Nat.digits 2 q).Sublist [0, 1]hd:Nat.digits 2 2 = [0, 1]l:List ℕhval:q = Nat.ofDigits 2 [0, 1]hdig:Nat.digits 2 q = 0 :: lhsub1:l.Sublist [1]h1:l = [1]⊢ Nat.ofDigits 2 [0, 1] ≠ 2 → False; decide All goals completed! 🐙
· refine_2 ⊢ ¬IsMinimalPrimeInBase 10 23 rintro ⟨_, _, hno⟩ refine_2 left✝¹:2 ≤ 10left✝:Nat.Prime 23hno:¬∃ q, Nat.Prime q ∧ q ≠ 23 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 23)⊢ False
exact hno ⟨3, by left✝¹:2 ≤ 10left✝:Nat.Prime 23hno:¬∃ q, Nat.Prime q ∧ q ≠ 23 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 23)⊢ Nat.Prime 3 decide All goals completed! 🐙, by left✝¹:2 ≤ 10left✝:Nat.Prime 23hno:¬∃ q, Nat.Prime q ∧ q ≠ 23 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 23)⊢ 3 ≠ 23 decide All goals completed! 🐙, by left✝¹:2 ≤ 10left✝:Nat.Prime 23hno:¬∃ q, Nat.Prime q ∧ q ≠ 23 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 23)⊢ (Nat.digits 10 3).Sublist (Nat.digits 10 23) decide All goals completed! 🐙⟩
· refine_3 ⊢ ¬IsMinimalPrimeInBase 10 37 rintro ⟨_, _, hno⟩ refine_3 left✝¹:2 ≤ 10left✝:Nat.Prime 37hno:¬∃ q, Nat.Prime q ∧ q ≠ 37 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 37)⊢ False
exact hno ⟨7, by left✝¹:2 ≤ 10left✝:Nat.Prime 37hno:¬∃ q, Nat.Prime q ∧ q ≠ 37 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 37)⊢ Nat.Prime 7 decide All goals completed! 🐙, by left✝¹:2 ≤ 10left✝:Nat.Prime 37hno:¬∃ q, Nat.Prime q ∧ q ≠ 37 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 37)⊢ 7 ≠ 37 decide All goals completed! 🐙, by left✝¹:2 ≤ 10left✝:Nat.Prime 37hno:¬∃ q, Nat.Prime q ∧ q ≠ 37 ∧ (Nat.digits 10 q).Sublist (Nat.digits 10 37)⊢ (Nat.digits 10 7).Sublist (Nat.digits 10 37) decide All goals completed! 🐙⟩
Finiteness of minimal primes (empty for $b < 2$, and finite by Higman's lemma for $b \ge 2$):
for every $b \in \mathbb{N}$, the set of primes satisfying IsMinimalPrimeInBase b p is finite.
@[category textbook, AMS 11 68]
theorem minimal_primes_finite_in_every_base (b : ℕ) :
{p : ℕ | IsMinimalPrimeInBase b p}.Finite := by b:ℕ⊢ {p | IsMinimalPrimeInBase b p}.Finite
sorry All goals completed! 🐙
Base-$10$ classification (Shallit 2000): exactly $26$ primes satisfy
IsMinimalPrimeInBase 10 p.
@[category research solved, AMS 11 68]
theorem base_ten_minimal_primes_card :
{p : ℕ | IsMinimalPrimeInBase 10 p}.ncard = 26 := by ⊢ {p | IsMinimalPrimeInBase 10 p}.ncard = 26
sorry All goals completed! 🐙
Explicit base-$10$ minimal prime set (Shallit 2000, OEIS A071062): the primes satisfying
IsMinimalPrimeInBase 10 p are precisely the $26$ integers listed below.
@[category research solved, AMS 11 68]
theorem base_ten_minimal_primes_eq :
{p : ℕ | IsMinimalPrimeInBase 10 p} =
{2, 3, 5, 7, 11, 19, 41, 61, 89, 409, 449, 499, 881, 991, 6469, 6949, 9001, 9049, 9649,
9949, 60649, 666649, 946669, 60000049, 66000049, 66600049} := by ⊢ {p | IsMinimalPrimeInBase 10 p} =
{2, 3, 5, 7, 11, 19, 41, 61, 89, 409, 449, 499, 881, 991, 6469, 6949, 9001, 9049, 9649, 9949, 60649, 666649, 946669,
60000049, 66000049, 66600049}
sorry All goals completed! 🐙
Unresolved base-$17$ candidate family $\mathrm{F}1{9}$: does there exist $k \in \mathbb{N}$
such that the integer with base-$17$ digits $15, 1, \underbrace{9, \dots, 9}{k}$ (namely
$15 \cdot 17^{k + 1} + 17^k + \sum{i < k} 9 \cdot 17^i$) satisfies
IsMinimalPrimeInBase 17?
@[category research open, question, AMS 11 68]
theorem base_seventeen_f19_family_minimal_prime_question :
∃ k : ℕ, IsMinimalPrimeInBase 17
(15 * 17 ^ (k + 1) + 17 ^ k + ∑ i ∈ Finset.range k, 9 * 17 ^ i) := by ⊢ ∃ k, IsMinimalPrimeInBase 17 (15 * 17 ^ (k + 1) + 17 ^ k + ∑ i ∈ Finset.range k, 9 * 17 ^ i)
sorry All goals completed! 🐙end MinimalPrime