Infinitude of primes
219 characters · @majdi19 ·
Statement
import Mathlib.Data.Nat.Prime.Infinite
theorem LeanGolf.inf_primes (n : ℕ) : ∃ p, n ≤ p ∧ Nat.Prime pRecord proof
import Mathlib.Data.Nat.Prime.Infinite
theorem LeanGolf.inf_primes (n : ℕ) : ∃ p, n ≤ p ∧ Nat.Prime p := by
let m := n.factorial+1
have P : m.minFac.Prime := Nat.minFac_prime (by have := Nat.factorial_pos n; dsimp [m]; omega)
refine ⟨_,?_,P⟩
by_contra! H
exact P.not_dvd_one ((Nat.dvd_add_iff_right (Nat.dvd_factorial P.pos H.le)).mpr (Nat.minFac_dvd m))Record history
| Holder | Characters | Date |
|---|---|---|
| @majdi19 | 219 | |
| @lean-golf-seed | 294 |