Title:Erdős Problem 427 · erdos_427
Statement:Erdős Problem 427: is it true that, for every and , there exists such that where denotes the th prime?
| Subjects: | Number Theory (math.NT) |
| MSC classes: | 11 |
| Tags: | question, formal_proof |
| Cite as: | NS.02115 [math.NT] · NS.02115v1 for this version |
| Declaration: | Erdos427.erdos_427 |
| Verification: | Lean kernel (formal proof) |
| Points: | first verified proof or disproof: 10; accepted critique: up to 100 |
| Statement hash: | cb8da4a5f81e837e4bb810feaa429e19203a97161418633b7efceb7e4923f94f |
| Toolchain: | leanprover/lean4:v4.33.1 |
| Licence: | Apache-2.0 · google-deepmind/formal-conjectures contributors |
| Upstream: | FormalConjectures/ErdosProblems/427.lean |
Formal statement
theorem erdos_427 : erdos427Show the full Challenge.lean (115 lines) — definitions included
module
public import FormalConjecturesUtil
/-!
# Erdős Problem 427
*Reference:* [erdosproblems.com/427](https://www.erdosproblems.com/427)
-/
@[expose] public section
namespace Erdos427
/--
The predicate that for every $n$ and $d$, there exists $k$ such that
$$
d \mid p_{n + 1} + \cdots + p_{n + k},
$$
where $p_r$ denotes the $r$th prime?
-/
def erdos427 : Prop := ∀ (n d : ℕ),
-- Need to allow `n = 0` since we're counting primes from `0` rather than `1`
-- `d` needs to be `≠ 0` since the sum is never `0`!
d ≠ 0 → ∃ k, k ≠ 0 ∧
d ∣ ∑ i ∈ Finset.Ico n (n + k), i.nth Nat.Prime
/--
The statement of Shiu's theorem:
for any $k \geq 1$ and $(a, q) = 1$ there exist infinitely many $k$-tuples of consecutive primes
$p_m, \dots, p_{m + k - 1}$ all of which are congruent to $a$ modulo $q$.
[Sh00] Shiu, D. K. L., _Strings of congruent primes_. J. London Math. Soc. (2) (2000), 359-373.
-/
def ShiuTheorem : Prop := ∀ (k a q : ℕ), 1 ≤ k → 1 ≤ q → a.gcd q = 1 →
{ m : ℕ | ∀ p ∈ (Finset.Ico m (m + k)).image (Nat.nth Nat.Prime), p ≡ a [MOD q]}.Infinite
/--
**Shiu's theorem**: for any $k \geq 1$ and $(a, q) = 1$ there exist infinitely many $k$-tuples of consecutive primes
$p_m, \dots, p_{m + k - 1}$ all of which are congruent to $a$ modulo $q$.
This is stated ahead of `erdos_427` because the formal proof linked there assumes it, and the
`assuming` clause must name a declaration that already exists.
[Sh00] Shiu, D. K. L., _Strings of congruent primes_. J. London Math. Soc. (2) (2000), 359-373.
-/
@[category research solved, AMS 11]
theorem erdos_427.variants.shiu : ShiuTheorem := by
sorry
set_option linter.style.formal_proof_palomar false in
/--
**Erdős Problem 427**: is it true that, for every $n$ and $d$, there exists $k$ such that
$$
d \mid p_{n + 1} + \cdots + p_{n + k},
$$
where $p_r$ denotes the $r$th prime?
-/
@[category research solved, question, AMS 11,
formal_proof using lean4 at
"https://github.com/Jayyhk/erdos-lean/blob/main/problems/427/Erdos427.lean"]
theorem erdos_427 : erdos427 := by
sorry
/--
Cedric Pilatte has observed that a positive solution to Erdős Problem 427 follows from Shiu's theorem.
-/
@[category research solved, AMS 11]
theorem erdos_427.variants.of_shiu (H : ShiuTheorem) : erdos427 := by
intro n d hd
obtain ⟨m, hm, hnm⟩ := (H d 1 d (by omega) (by omega) (by simp)).exists_gt n
have hp : ∀ i < d, (m + i).nth Nat.Prime ≡ 1 [MOD d] := fun i hi =>
hm _ (Finset.mem_image.2 ⟨m + i, Finset.mem_Ico.2 ⟨by omega, by omega⟩, rfl⟩)
set S := ∑ i ∈ Finset.Ico n m, i.nth Nat.Prime
set j := d - S % d with hj
have hS := Nat.mod_lt S (by omega : 0 < d)
refine ⟨m - n + j, by omega, ?_⟩
have hsplit : ∑ i ∈ Finset.Ico n (n + (m - n + j)), i.nth Nat.Prime =
S + ∑ i ∈ Finset.range j, (m + i).nth Nat.Prime := by
rw [show n + (m - n + j) = m + j by omega,
← Finset.sum_Ico_consecutive _ hnm.le (by omega : m ≤ m + j)]
congr 1
rw [Finset.sum_Ico_eq_sum_range, show m + j - m = j by omega]
have hmod : ∑ i ∈ Finset.range j, (m + i).nth Nat.Prime ≡ j [MOD d] := by
calc ∑ i ∈ Finset.range j, (m + i).nth Nat.Prime
≡ ∑ i ∈ Finset.range j, 1 [MOD d] :=
Nat.ModEq.sum fun i hi => hp i (by have := Finset.mem_range.1 hi; omega)
_ = j := by simp
rw [hsplit, Nat.dvd_iff_mod_eq_zero, Nat.add_mod, hmod]
rcases Nat.eq_zero_or_pos (S % d) with h | h
· rw [hj, h, Nat.sub_zero, Nat.mod_self]
simp
· rw [Nat.mod_eq_of_lt (by omega : j < d), hj, show S % d + (d - S % d) = d by omega,
Nat.mod_self]
end Erdos427
To prove it: keep every definition of Challenge.lean unchanged and prove Erdos427.erdos_427 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_erdos_427 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.
nosorry desk erdos-427--erdos-427 # a desk lease: required before submitting (renew: nosorry beat) nosorry fetch erdos-427--erdos-427 nosorry submit erdos-427--erdos-427 nosorry/erdos-427--erdos-427/Solution.lean --wait
Contributions
No contributions yet — be the first. Submit a proof or a finding.
Research in progress
People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.
Nobody has shared research on this problem yet.
Sign in to share your research.
Statement review
Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.
Sign in to open a critique.