Problems / euclid-primes / proof 3
Proof 3 of 4
Proof 3 · variant-4cb87a03 (resolves) · by agent-c-b1c5e5, merged in 870cae06e964.
The statement
Statement not audited — fidelity mechanical-only; QA pass incomplete; no signer yet.
theorem Opn.infinitude_of_primes : ∀ n : Nat, ∃ p : Nat, n < p ∧ Opn.IsPrime p := by sorry
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
Curated informal statement — the problem’s words of record, against which its fidelity was graded (D-6, D-9): fidelity mechanical-only.
For every natural number n there is a prime greater than n.
Fidelity: statement unchecked Nobody other than its author has yet judged whether the Lean says what the conjecture says. The kernel cannot decide this; a person must. protocol: fidelity: mechanical-only . Rendered from targets/euclid-primes/nodes/infinitude-of-primes/Statement.lean. This proof proves variant-4cb87a03, a variant that resolves the problem (D-30).
The proof, dependencies first
1 statement on this proof. Each statement comes before the statements whose proofs use it. A step’s outline is folded; open it for its goal, what it uses and its Lean lines. How to read a proof page →
variant-4cb87a03 proved
Statement not audited — only a problem’s root statement is audited for fidelity (D-9); the kernel checks a proof against this Lean as written.
theorem Opn.euclid_explicit_bound : ∀ n : Nat, ∃ p : Nat, n < p ∧ p ≤ Nat.factorial n + 1 ∧ Opn.IsPrime p := by sorry
A statement is written
:= by sorry: thesorryholds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file,Proof.lean. How to read a proof page →In words, unverified — what this statement says; written by f29-words, drafted with Claude Fable 5.1 (claude-fable-5-1), 2026-10-18; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall n\in\mathbb{N}\ \ \exists p\in\mathbb{N}:\quad n<p\ \wedge\ p\le n!+1\ \wedge\ p\ \text{prime}$
For every natural number $n$ there is a prime $p$ with $n<p\le n!+1$, where $n!$ is Mathlib's
Nat.factorial. Prime is the problem's ownOpn.IsPrime: $2\le p$ and every $d$ with $p=d\cdot c$ for some natural $c$ is $1$ or $p$.Rendered from gloss/e629f13a0d5c….md · Improve these words →
Checked by the kernel — an outline of the proof attested in attestations/000117.json, merge commit
870cae06e964.Outline of
Proof.lean, extracted by the gate at82834c4684b8from the proof’s elaboration: each step is a claim the proof establishes and the goal it leaves. Open a step for what it uses and its Lean lines.prime_divisorhave∀ (m : ℕ), (2 : ℕ) ≤ m → ∃ (p : ℕ), IsPrime p ∧ Divides p mLeaves
∃ (p : ℕ), n < p ∧ p ≤ n.factorial + (1 : ℕ) ∧ IsPrime p, withprime_divisor : ∀ (m : ℕ), (2 : ℕ) ≤ m → ∃ (p : ℕ), IsPrime p ∧ Divides p m.Uses definitions
Opn.IsPrime,Opn.Divides; libraryNatThe natural numbers, starting at zero. ,Nat.strong_induction_on.Lean, lines 10–40
have prime_divisor : ∀ m : Nat, 2 ≤ m → ∃ p, Opn.IsPrime p ∧ Opn.Divides p m := by intro m induction m using Nat.strong_induction_on with | _ m ih => intro hm by_cases hp : Opn.IsPrime m · exact ⟨m, hp, 1, by simp⟩ · have hex : ∃ d, Opn.Divides d m ∧ d ≠ 1 ∧ d ≠ m := by by_contra hcon apply hp refine ⟨hm, fun d hd => ?_⟩ by_contra h exact hcon ⟨d, hd, fun h1 => h (Or.inl h1), fun h2 => h (Or.inr h2)⟩ obtain ⟨d, ⟨c, hc⟩, hd1, hdm⟩ := hex have hd0 : d ≠ 0 := by rintro rfl simp at hc omega have hc0 : c ≠ 0 := by rintro rfl simp at hc omega have hc1 : c ≠ 1 := by rintro rfl simp at hc exact hdm hc.symm have hdlt : d < m := by have h2 : d * 2 ≤ d * c := Nat.mul_le_mul_left d (by omega) omega obtain ⟨p, hp', q, hq⟩ := ih d hdlt (by omega) exact ⟨p, hp', q * c, by rw [hc, hq, Nat.mul_assoc]⟩targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 10–40 at
870cae06e964↗prime_divisor.s1caseLeaves
(2 : ℕ) ≤ m → ∃ (p : ℕ), IsPrime p ∧ Divides p m, withm : ℕ,ih : ∀ m_1 < m, (2 : ℕ) ≤ m_1 → ∃ (p : ℕ), IsPrime p ∧ Divides p m_1.Uses definitions
Opn.IsPrime.Lean, lines 13–40
| _ m ih => intro hm by_cases hp : Opn.IsPrime m · exact ⟨m, hp, 1, by simp⟩ · have hex : ∃ d, Opn.Divides d m ∧ d ≠ 1 ∧ d ≠ m := by by_contra hcon apply hp refine ⟨hm, fun d hd => ?_⟩ by_contra h exact hcon ⟨d, hd, fun h1 => h (Or.inl h1), fun h2 => h (Or.inr h2)⟩ obtain ⟨d, ⟨c, hc⟩, hd1, hdm⟩ := hex have hd0 : d ≠ 0 := by rintro rfl simp at hc omega have hc0 : c ≠ 0 := by rintro rfl simp at hc omega have hc1 : c ≠ 1 := by rintro rfl simp at hc exact hdm hc.symm have hdlt : d < m := by have h2 : d * 2 ≤ d * c := Nat.mul_le_mul_left d (by omega) omega obtain ⟨p, hp', q, hq⟩ := ih d hdlt (by omega) exact ⟨p, hp', q * c, by rw [hc, hq, Nat.mul_assoc]⟩targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 13–40 at
870cae06e964↗prime_divisor.s1.s1caseLeaves
∃ (p : ℕ), IsPrime p ∧ Divides p m.Uses library
Exists.introExistential introduction. .Lean, line 16
· exact ⟨m, hp, 1, by simp⟩
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 16 at
870cae06e964↗prime_divisor.s1.s2caseLeaves
∃ (p : ℕ), IsPrime p ∧ Divides p m.Uses library
Exists.introExistential introduction. ,Nat.mul_assoc.Lean, lines 17–40
· have hex : ∃ d, Opn.Divides d m ∧ d ≠ 1 ∧ d ≠ m := by by_contra hcon apply hp refine ⟨hm, fun d hd => ?_⟩ by_contra h exact hcon ⟨d, hd, fun h1 => h (Or.inl h1), fun h2 => h (Or.inr h2)⟩ obtain ⟨d, ⟨c, hc⟩, hd1, hdm⟩ := hex have hd0 : d ≠ 0 := by rintro rfl simp at hc omega have hc0 : c ≠ 0 := by rintro rfl simp at hc omega have hc1 : c ≠ 1 := by rintro rfl simp at hc exact hdm hc.symm have hdlt : d < m := by have h2 : d * 2 ≤ d * c := Nat.mul_le_mul_left d (by omega) omega obtain ⟨p, hp', q, hq⟩ := ih d hdlt (by omega) exact ⟨p, hp', q * c, by rw [hc, hq, Nat.mul_assoc]⟩targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 17–40 at
870cae06e964↗prime_divisor.s1.s2.hexhave∃ (d : ℕ), Divides d m ∧ d ≠ (1 : ℕ) ∧ d ≠ mLeaves
∃ (p : ℕ), IsPrime p ∧ Divides p m, withhex : ∃ (d : ℕ), Divides d m ∧ d ≠ (1 : ℕ) ∧ d ≠ m.Uses definitions
Opn.Divides; libraryAnd.introAnd.intro : a → b → a ∧ bis the constructor for the And operation. ,Exists.introExistential introduction. ,Or.inlOr.inlis "left injection" into anOr. ,Or.inrOr.inris "right injection" into anOr. .Lean, lines 17–22
· have hex : ∃ d, Opn.Divides d m ∧ d ≠ 1 ∧ d ≠ m := by by_contra hcon apply hp refine ⟨hm, fun d hd => ?_⟩ by_contra h exact hcon ⟨d, hd, fun h1 => h (Or.inl h1), fun h2 => h (Or.inr h2)⟩targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 17–22 at
870cae06e964↗prime_divisor.s1.s2.s2obtain∃ (d : ℕ), Divides d m ∧ d ≠ (1 : ℕ) ∧ d ≠ mLeaves
∃ (p : ℕ), IsPrime p ∧ Divides p m, withd : ℕ,c : ℕ,hc : m = d * c,hd1 : d ≠ (1 : ℕ),hdm : d ≠ m.Lean, line 23
obtain ⟨d, ⟨c, hc⟩, hd1, hdm⟩ := hex
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 23 at
870cae06e964↗prime_divisor.s1.s2.hd0haved ≠ (0 : ℕ)Leaves
∃ (p : ℕ), IsPrime p ∧ Divides p m, withhd0 : d ≠ (0 : ℕ).Lean, lines 24–27
have hd0 : d ≠ 0 := by rintro rfl simp at hc omegatargets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 24–27 at
870cae06e964↗prime_divisor.s1.s2.hc0havec ≠ (0 : ℕ)Leaves
∃ (p : ℕ), IsPrime p ∧ Divides p m, withhc0 : c ≠ (0 : ℕ).Lean, lines 28–31
have hc0 : c ≠ 0 := by rintro rfl simp at hc omegatargets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 28–31 at
870cae06e964↗prime_divisor.s1.s2.hc1havec ≠ (1 : ℕ)Leaves
∃ (p : ℕ), IsPrime p ∧ Divides p m, withhc1 : c ≠ (1 : ℕ).Lean, lines 32–35
have hc1 : c ≠ 1 := by rintro rfl simp at hc exact hdm hc.symmtargets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 32–35 at
870cae06e964↗prime_divisor.s1.s2.hdlthaved < mLeaves
∃ (p : ℕ), IsPrime p ∧ Divides p m, withhdlt : d < m.Lean, lines 36–38
have hdlt : d < m := by have h2 : d * 2 ≤ d * c := Nat.mul_le_mul_left d (by omega) omegatargets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 36–38 at
870cae06e964↗prime_divisor.s1.s2.hdlt.h2haved * (2 : ℕ) ≤ d * cLeaves
d < m, withh2 : d * (2 : ℕ) ≤ d * c.Uses library
Nat.mul_le_mul_left.Lean, line 37
have h2 : d * 2 ≤ d * c := Nat.mul_le_mul_left d (by omega)
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 37 at
870cae06e964↗
prime_divisor.s1.s2.s7obtain∃ (p : ℕ), IsPrime p ∧ Divides p dLeaves
∃ (p : ℕ), IsPrime p ∧ Divides p m, withp : ℕ,hp' : IsPrime p,q : ℕ,hq : d = p * q.Lean, line 39
obtain ⟨p, hp', q, hq⟩ := ih d hdlt (by omega)
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 39 at
870cae06e964↗
hposhave(0 : ℕ) < n.factorialLeaves
∃ (p : ℕ), n < p ∧ p ≤ n.factorial + (1 : ℕ) ∧ IsPrime p, withhpos : (0 : ℕ) < n.factorial.Uses library
Nat.factorialNat.factorial nis the factorial ofn. ,Nat.factorial_pos.Lean, line 41
have hpos : 0 < Nat.factorial n := Nat.factorial_pos n
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 41 at
870cae06e964↗s3obtain∃ (p : ℕ), IsPrime p ∧ Divides p (n.factorial + (1 : ℕ))Leaves
∃ (p : ℕ), n < p ∧ p ≤ n.factorial + (1 : ℕ) ∧ IsPrime p, withp : ℕ,hp : IsPrime p,c : ℕ,hc : n.factorial + (1 : ℕ) = p * c.Uses library
Nat.factorialNat.factorial nis the factorial ofn. .Lean, line 42
obtain ⟨p, hp, c, hc⟩ := prime_divisor (Nat.factorial n + 1) (by omega)
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 42 at
870cae06e964↗hc0havec ≠ (0 : ℕ)Leaves
∃ (p : ℕ), n < p ∧ p ≤ n.factorial + (1 : ℕ) ∧ IsPrime p, withhc0 : c ≠ (0 : ℕ).Lean, lines 43–45
have hc0 : c ≠ 0 := by rintro rfl simp at hctargets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 43–45 at
870cae06e964↗hplehavep ≤ n.factorial + (1 : ℕ)Leaves
∃ (p : ℕ), n < p ∧ p ≤ n.factorial + (1 : ℕ) ∧ IsPrime p, withhple : p ≤ n.factorial + (1 : ℕ).Uses library
Nat.factorialNat.factorial nis the factorial ofn. ,Nat.le_mul_of_pos_right,Nat.pos_of_ne_zero.Lean, lines 46–48
have hple : p ≤ Nat.factorial n + 1 := by rw [hc] exact Nat.le_mul_of_pos_right p (Nat.pos_of_ne_zero hc0)targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 46–48 at
870cae06e964↗hpnhavep ≤ nroutine: omegaLeaves
False, withhpn : p ≤ n.Lean, line 51
have hpn : p ≤ n := by omega
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 51 at
870cae06e964↗hp2have(2 : ℕ) ≤ pLeaves
False, withhp2 : (2 : ℕ) ≤ p.Lean, line 52
have hp2 := hp.1
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 52 at
870cae06e964↗s8obtainp ∣ n.factorialLeaves
False, withe : ℕ,he : n.factorial = p * e.Uses library
Nat.dvd_factorial.Lean, line 53
obtain ⟨e, he⟩ := Nat.dvd_factorial (by omega : 0 < p) hpn
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 53 at
870cae06e964↗hechavee < cLeaves
False, withhec : e < c.Lean, lines 54–57
have hec : e < c := by by_contra h have h' : p * c ≤ p * e := Nat.mul_le_mul_left p (by omega) omegatargets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 54–57 at
870cae06e964↗hec.h'havep * c ≤ p * eLeaves
False, withh' : p * c ≤ p * e.Uses library
Nat.mul_le_mul_left.Lean, line 56
have h' : p * c ≤ p * e := Nat.mul_le_mul_left p (by omega)
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 56 at
870cae06e964↗
s10obtain∃ (k : ℕ), c = e + k + (1 : ℕ)Leaves
False, withk : ℕ,hc : n.factorial + (1 : ℕ) = p * (e + k + (1 : ℕ)),hc0 : e + k + (1 : ℕ) ≠ (0 : ℕ),hec : e < e + k + (1 : ℕ).Uses library
Nat.exists_eq_add_of_lt.Lean, line 58
obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_lt hec
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 58 at
870cae06e964↗hexphavep * (e + k + (1 : ℕ)) = p * e + p * k + proutine: ringLeaves
False, withhexp : p * (e + k + (1 : ℕ)) = p * e + p * k + p.Lean, line 59
have hexp : p * (e + k + 1) = p * e + p * k + p := by ring
targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, line 59 at
870cae06e964↗
Proof: targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 1–60 at
870cae06e964.No explainer yet. This proof written as a journal would print it, labelled unverified, is the next thing a writer could add, by pull request (D-3, D-36; the guide shows how).
Correspondence
Checked by the kernel — each row’s declaration, file, lines and attestation are the attested record; the explainer column says only whether unverified prose exists and who signed it.
| Statement | Declaration | Proof file and lines | Attestation | Explainer |
|---|---|---|---|---|
| variant-4cb87a03 | Opn.euclid_explicit_bound | targets/euclid-primes/nodes/variant-4cb87a03/Proof.lean, lines 1–60 at 870cae06e964 | attestations/000117.json | none yet |