{
  "id": "1376",
  "ident": "NS.01376",
  "slug": "erdos-219",
  "title": "Erdős Problem 219",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Are there arbitrarily long arithmetic progressions of primes?\nSolution: yes.\nRef: Green, Ben and Tao, Terence, _The primes contain arbitrarily long arithmetic progressions_",
  "subjects": [
    "math.CO",
    "math.NT",
    "msc:05",
    "msc:11"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": "https://www.erdosproblems.com/219",
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos219.erdos_219",
  "statement_lean": "theorem erdos_219 : ∀ N : ℕ, ∃ l ∈ primeArithmeticProgressions, N ≤ ENat.card l",
  "challenge_source": "/-\nCopyright 2025 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Erdős Problem 219\n\n*Reference:* [erdosproblems.com/219](https://www.erdosproblems.com/219)\n-/\n\n@[expose] public section\n\nnamespace Erdos219\n\n/--\nThe set of arithmetic progressions of primes\n-/\ndef primeArithmeticProgressions : Set (Set ℕ) :=\n  {s | (∀ p ∈ s, p.Prime) ∧ ∃ l > 0, s.IsAPOfLength l}\n\n@[category test, AMS 5 11]\ntheorem primeArithmeticProgression_3_5_7 : {3, 5, 7} ∈ primeArithmeticProgressions := by\n  simp only [primeArithmeticProgressions, gt_iff_lt, Set.IsAPOfLength, Set.IsAPOfLengthWith,\n    smul_eq_mul, exists_prop, exists_and_left, existsAndEq, true_and, Set.mem_ofPred_eq,\n    Set.mem_insert_iff, Set.mem_singleton_iff, forall_eq_or_imp, forall_eq,\n    ENat.card_eq_coe_fintype_card, Fintype.card_ofFinset, Set.toFinset_insert,\n    Set.toFinset_singleton, Finset.mem_insert, Nat.reduceEqDiff, Finset.mem_singleton, or_self,\n    not_false_eq_true, Finset.card_insert_of_notMem, Finset.card_singleton, Nat.reduceAdd,\n    Nat.cast_ofNat, Nat.ofNat_pos, Nat.cast_lt_ofNat]\n  refine ⟨by norm_num, ⟨3, 2, Set.ext fun x => ?_⟩⟩\n  refine ⟨?_, fun ⟨w, ⟨hl, hr⟩⟩ => by interval_cases w <;> simp_all⟩\n  rintro (rfl | rfl | rfl)\n  · simp\n  · simpa using ⟨1, by simp⟩\n  · simpa using ⟨2, by simp⟩\n\n@[category test, AMS 5 11]\ntheorem not_primeArithmeticProgression_1_2 : ¬{1, 2} ∈ primeArithmeticProgressions := by\n  simp [primeArithmeticProgressions]\n\n@[category API, AMS 5 11]\ntheorem empty_not_primeArithmeticProgression : ∅ ∉ primeArithmeticProgressions := by\n  simpa [primeArithmeticProgressions] using fun _ hl ↦ Set.not_isAPOfLength_empty hl\n\n@[category API, AMS 5 11]\nlemma singleton_mem_primeArithmeticProgressions\n    {p : ℕ} (hp : p.Prime) : {p} ∈ primeArithmeticProgressions := by\n  simpa [primeArithmeticProgressions, hp] using ⟨1, one_pos, by simp⟩\n\n@[category API, AMS 5 11]\nlemma pair_mem_primeArithmeticProgressions\n    {p q : ℕ} (hp : p.Prime) (hq : q.Prime) (hpq : p < q) :\n    {p, q} ∈ primeArithmeticProgressions := by\n  let ⟨n, h⟩ := Nat.exists_eq_add_of_lt hpq\n  simpa [primeArithmeticProgressions, hp, hq] using ⟨2, by norm_num, Nat.isAPOfLength_pair hpq⟩\n\nset_option linter.style.formal_proof_palomar false in\n/--\nAre there arbitrarily long arithmetic progressions of primes?\nSolution: yes.\nRef: Green, Ben and Tao, Terence, _The primes contain arbitrarily long arithmetic progressions_\n-/\n\n@[category research solved, question, AMS 5 11,\n  formal_proof using lean4 at \"https://github.com/plby/lean-proofs/blob/1268917deaaaa0d674f651287027baa26cea9920/src/latest/ErdosProblems/Erdos219.lean\"]\ntheorem erdos_219 : ∀ N : ℕ, ∃ l ∈ primeArithmeticProgressions, N ≤ ENat.card l := by\n  sorry\n\nend Erdos219\n",
  "statement_hash": "bb20ce5b4e7f99784a660e7106128588aa8e52fb39c6a3da077d7305ec498357",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}