FormalConjectures/ErdosProblems/1209.lean
Explanation legend Lean4 Domain Explanation Language (L4DEL)
L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.
- L4DEL
- Lean4 Domain Explanation Language
Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.
Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1
13 declarations, 4 contain sorry, 0 declared as axioms
Erdős Problem 1209
References:
- erdosproblems.com/429
- erdosproblems.com/1102
- erdosproblems.com/1209
- [Er80] Erdős, Paul, A survey of problems in combinatorial number theory. Ann. Discrete Math. (1980), 89-115.
Imports (1)
- theorem
Erdos1209.exists_prime_gt_not_prime_addFor everyk ≥ 1and boundm, there is a primep > msuch thatk + pis composite: take a primeq > kand, by Dirichlet, a primep > max m qwithp ≡ -k (mod q)line 40 sourceSource documentation
For every
k ≥ 1and boundm, there is a primep > msuch thatk + pis composite: take a primeq > kand, by Dirichlet, a primep > max m qwithp ≡ -k (mod q).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Exists,And,LT.lt,Nat.Prime,Not,HAdd.hAddProof uses:
Nat.exists_infinite_primes,NeZero,NeZero.mk,Nat.Prime.ne_zero,IsUnit,ZMod,Neg.neg,IsUnit.neg,Eq.mpr,Nat.Coprime,id,Eq,congrArg,propext,ZMod.isUnit_iff_coprime,Iff.mp,Nat.coprime_comm,Iff.mpr,Dvd.dvd,Nat.Prime.coprime_iff_not_dvdand 43 more56 instances, coercions and auxiliary constants left out.
Tactic trace: 16 steps
Open to load the checked before-and-after goal states.
theorem exists_prime_gt_not_prime_add (k m : ℕ) (hk : 1 ≤ k) : ∃ p, m < p ∧ p.Prime ∧ ¬ (k + p).Prime := by … - def
Erdos1209.seqThe counterexample sequence:a 0is a prime at leastf 0, anda (k + 1)is a prime larger thana kandf (k + 1)with(k + 1) + a (k + 1)composite line 58 sourceSource documentation
The counterexample sequence:
a 0is a prime at leastf 0, anda (k + 1)is a prime larger thana kandf (k + 1)with(k + 1) + a (k + 1)composite.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat2 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
noncomputable def seq (f : ℕ → ℕ) : ℕ → ℕ | 0 => Classical.choose (Nat.exists_infinite_primes (f 0)) | k + 1 => Classical.choose (exists_prime_gt_not_prime_add (k + 1) (max (seq f k) (f (k + 1))) (by omega)) /-- The defining properties of `seq f 0`. -/ @[category API, AMS 11]Mentions: Erdos1209.exists_prime_gt_not_prime_add, AMS
- theorem
Erdos1209.seq_zero_specThe defining properties ofseq f 0line 65 sourceSource documentation
The defining properties of
seq f 0.standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,And,LE.le,OfNat.ofNat, Erdos1209.seq,Nat.PrimeProof uses:
Classical.choose_spec,Nat.exists_infinite_primes4 instances, coercions and auxiliary constants left out.
theorem seq_zero_spec (f : ℕ → ℕ) : f 0 ≤ seq f 0 ∧ (seq f 0).Prime := …
Mentions: Erdos1209.seq
- theorem
Erdos1209.seq_succ_specThe defining properties ofseq f (k + 1)line 70 sourceSource documentation
The defining properties of
seq f (k + 1).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,And,LT.lt,Max.max, Erdos1209.seq,HAdd.hAdd,OfNat.ofNat,Nat.Prime,NotProof uses:
Classical.choose_spec, Erdos1209.exists_prime_gt_not_prime_add,Decidable.byContradiction,LE.le13 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
theorem seq_succ_spec (f : ℕ → ℕ) (k : ℕ) : max (seq f k) (f (k + 1)) < seq f (k + 1) ∧ (seq f (k + 1)).Prime ∧ ¬ ((k + 1) + seq f (k + 1)).Prime := …Mentions: Erdos1209.seq
- theorem
Erdos1209.erdos_1209.parts.iLet $A=\{a_1a_{k-1}$ be a prime such that $a_k+k\equiv 0\pmod{q_k}$, where $q_k$ is some prime not dividing $k$ line 89 sourceSource documentation
Let $A=\{a_1<a_2<\cdots\}$ be a sequence of integers which tends to infinity sufficiently fast. If there is an $n$ such that all $n+a_k$ are primes then must there exist infinitely many such $n$?
Erdős [Er80] wrote 'unless I overlook a trivial way of getting a counterexample these questions are quite hopeless'. There is indeed a trivial counterexample (a variant of the construction in [erdosproblems.com/429]): define $a_1=2$ and for $k\geq 2$ let $a_k>a_{k-1}$ be a prime such that $a_k+k\equiv 0\pmod{q_k}$, where $q_k$ is some prime not dividing $k$. This sequence can be made to grow arbitrarily fast
See also [erdosproblems.com/429] and [erdosproblems.com/1102].
L4DEL explanation
Let $A=\{a_1a_{k-1}$ be a prime such that $a_k+k\equiv 0\pmod{q_k}$, where $q_k$ is some prime not dividing $k$. This sequence can be made to grow arbitrarily fast See also [erdosproblems.com/429] and [erdosproblems.com/1102].
Sources and attribution: Pinned Lean source (1646ca16afd6)
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Iff,False,Exists,Nat,StrictMono,LE.le,Nat.Prime,HAdd.hAdd,Set.Infinite,Set.ofPredProof uses:
Iff.intro,False.elim, Erdos1209.seq,strictMono_nat_of_lt_succ,lt_of_le_of_lt,Max.max,OfNat.ofNat,le_max_left,And.left,LT.lt,And,Not, Erdos1209.seq_succ_spec,Nat.casesAuxOn,Eq, Erdos1209.seq_zero_spec,Eq.symm,LT.lt.le,le_max_right,Eq.refland 15 more25 instances, coercions and auxiliary constants left out.
Tactic trace: 21 steps
Open to load the checked before-and-after goal states.
theorem erdos_1209.parts.i : answer(False) ↔ ∃ f : ℕ → ℕ, ∀ a : ℕ → ℕ, StrictMono a → (∀ k, f k ≤ a k) → (∃ n, ∀ k, (n + a k).Prime) → {n | ∀ k, (n + a k).Prime}.Infinite := by … - theorem
Erdos1209.exists_prime_gt_not_squarefree_addFor everyk ≥ 1and boundm, there is a primep > msuch thatk + pis not squarefree: take a primeq > kand, by Dirichlet, a primep > mwithp ≡ -k (mod q ^ 2)line 120 sourceSource documentation
For every
k ≥ 1and boundm, there is a primep > msuch thatk + pis not squarefree: take a primeq > kand, by Dirichlet, a primep > mwithp ≡ -k (mod q ^ 2).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,LE.le,OfNat.ofNat,Exists,And,LT.lt,Nat.Prime,Not,Squarefree,HAdd.hAddProof uses:
Nat.exists_infinite_primes,NeZero,HPow.hPow,NeZero.mk,pow_ne_zero,Nat.Prime.ne_zero,IsUnit,ZMod,Neg.neg,IsUnit.neg,Eq.mpr,Nat.Coprime,id,Eq,congrArg,propext,ZMod.isUnit_iff_coprime,Nat.Coprime.pow_right,Iff.mp,Nat.coprime_command 47 more72 instances, coercions and auxiliary constants left out.
Tactic trace: 17 steps
Open to load the checked before-and-after goal states.
theorem exists_prime_gt_not_squarefree_add (k m : ℕ) (hk : 1 ≤ k) : ∃ p, m < p ∧ p.Prime ∧ ¬ Squarefree (k + p) := by … - def
Erdos1209.seq'The counterexample sequence for the squarefree variant line 139 sourceSource documentation
The counterexample sequence for the squarefree variant.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat2 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
noncomputable def seq' (f : ℕ → ℕ) : ℕ → ℕ | 0 => Classical.choose (Nat.exists_infinite_primes (f 0)) | k + 1 => Classical.choose (exists_prime_gt_not_squarefree_add (k + 1) (max (seq' f k) (f (k + 1))) (by omega)) /-- The defining properties of `seq' f (k + 1)`. -/ @[category API, AMS 11]Mentions: Erdos1209.exists_prime_gt_not_squarefree_add, AMS
- theorem
Erdos1209.seq'_succ_specThe defining properties ofseq' f (k + 1)line 146 sourceSource documentation
The defining properties of
seq' f (k + 1).standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Nat,And,LT.lt,Max.max, Erdos1209.seq',HAdd.hAdd,OfNat.ofNat,Nat.Prime,Not,SquarefreeProof uses:
Classical.choose_spec, Erdos1209.exists_prime_gt_not_squarefree_add,Decidable.byContradiction,LE.le15 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
theorem seq'_succ_spec (f : ℕ → ℕ) (k : ℕ) : max (seq' f k) (f (k + 1)) < seq' f (k + 1) ∧ (seq' f (k + 1)).Prime ∧ ¬ Squarefree ((k + 1) + seq' f (k + 1)) := …Mentions: Erdos1209.seq'
- theorem
Erdos1209.erdos_1209.parts.iiWhat if we ask for $n+a_k$ to be squarefree instead of prime? line 158 sourceSource documentation
What if we ask for $n+a_k$ to be squarefree instead of prime?
A similar construction provides a counterexample to the squarefree question.
standard axioms: Classical.choice, Quot.sound, propext what this means
Statement uses:
Iff,False,Exists,Nat,StrictMono,LE.le,Squarefree,HAdd.hAdd,Set.Infinite,Set.ofPredProof uses:
Iff.intro,False.elim,And,OfNat.ofNat,Classical.choose,Nat.Prime,Nat.exists_infinite_primes,Classical.choose_spec, Erdos1209.seq',strictMono_nat_of_lt_succ,lt_of_le_of_lt,Max.max,le_max_left,And.left,LT.lt,Not, Erdos1209.seq'_succ_spec,Nat.casesAuxOn,Eq,Eq.symmand 20 more29 instances, coercions and auxiliary constants left out.
Tactic trace: 22 steps
Open to load the checked before-and-after goal states.
theorem erdos_1209.parts.ii : answer(False) ↔ ∃ f : ℕ → ℕ, ∀ a : ℕ → ℕ, StrictMono a → (∀ k, f k ≤ a k) → (∃ n, ∀ k, Squarefree (n + a k)) → {n | ∀ k, Squarefree (n + a k)}.Infinite := by … - theorem
Erdos1209.erdos_1209.parts.iii.aAre there $n$ such that $n+2^{2^k}$ is always a prime? sorry line 198 sourceSource documentation
Are there $n$ such that $n+2^{2^k}$ is always a prime?
ebarschkis and GPT have proved that there are no $n$ such that $n+2^{2^k}$ is always prime: let $n\geq 3$ be any odd integer. If $k$ is chosen sufficiently large, and $p=n+2^{2^{k}}$ is prime, then the multiplicative order of $2^{2^k}\pmod{p}$, say $m$ is odd, and hence if $l$ is chosen such that $2^l\equiv 1\pmod{m}$ then $p\mid n+2^{2^{k+rl}}$ for all $r\geq 1$.
This was formalized in Lean by Barschkis using ChatGPT.
depends on sorry what this means
Statement uses:
Iff,False,Exists,Nat,Nat.Prime,HAdd.hAdd,HPow.hPow,OfNat.ofNatProof uses:
sorryAx,Lean.Name,Bool.false,Lean.Name.num,Lean.Name.str,Lean.Name.anonymous14 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
theorem erdos_1209.parts.iii.a : answer(False) ↔ ∃ n : ℕ, ∀ k : ℕ, (n + 2 ^ (2 ^ k)).Prime := by … - theorem
Erdos1209.erdos_1209.parts.iii.bAre there $n$ such that $n+2^{2^k}$ is always squarefree? sorry line 206 sourceSource documentation
Are there $n$ such that $n+2^{2^k}$ is always squarefree?
depends on sorry what this means
Statement uses:
Iff,True,Exists,Nat,Squarefree,HAdd.hAdd,HPow.hPow,OfNat.ofNatProof uses:
sorryAx,Lean.Name,Bool.false,Lean.Name.num,Lean.Name.str,Lean.Name.anonymous14 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
theorem erdos_1209.parts.iii.b : answer(sorry) ↔ ∃ n : ℕ, ∀ k : ℕ, Squarefree (n + 2 ^ (2 ^ k)) := by … - theorem
Erdos1209.erdos_1209.parts.iii.cAre there $n$ such that $n+2^{2^k}$ is infinitely often a prime? sorry line 214 sourceSource documentation
Are there $n$ such that $n+2^{2^k}$ is infinitely often a prime?
depends on sorry what this means
Statement uses:
Iff,True,Exists,Nat,Set.Infinite,Set.ofPred,Nat.Prime,HAdd.hAdd,HPow.hPow,OfNat.ofNatProof uses:
sorryAx,Lean.Name,Bool.false,Lean.Name.num,Lean.Name.str,Lean.Name.anonymous14 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
theorem erdos_1209.parts.iii.c : answer(sorry) ↔ ∃ n : ℕ, {k | (n + 2 ^ (2 ^ k)).Prime}.Infinite := by … - theorem
Erdos1209.erdos_1209.parts.iii.dAre there $n$ such that $n+2^{2^k}$ is infinitely often squarefree? sorry line 222 sourceSource documentation
Are there $n$ such that $n+2^{2^k}$ is infinitely often squarefree?
depends on sorry what this means
Statement uses:
Iff,True,Exists,Nat,Set.Infinite,Set.ofPred,Squarefree,HAdd.hAdd,HPow.hPow,OfNat.ofNatProof uses:
sorryAx,Lean.Name,Bool.false,Lean.Name.num,Lean.Name.str,Lean.Name.anonymous14 instances, coercions and auxiliary constants left out.
Tactic trace: 1 steps
Open to load the checked before-and-after goal states.
theorem erdos_1209.parts.iii.d : answer(sorry) ↔ ∃ n : ℕ, {k | Squarefree (n + 2 ^ (2 ^ k))}.Infinite := by …