{
  "id": "1683",
  "ident": "NS.01683",
  "slug": "erdos-318",
  "title": "Erdős Problem 318",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "`ℕ` has property `P₁`. This is proved in [ErSt75].",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos318.erdos_318.variants.univ",
  "statement_lean": "theorem erdos_318.variants.univ : P₁ univ",
  "challenge_source": "/-\nCopyright 2026 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 318\n\n*References:*\n  - [erdosproblems.com/318](https://www.erdosproblems.com/318)\n  - [ErSt75] Erdős, P. and Straus, E. G., Solution to Problem 387. Nieuw Arch. Wisk. (1975), 183.\n  - [Sa75] Sattler, R., Solution to Problem 387. Nieuw Arch. Wisk. (1975), 184-189.\n  - [Sa82b] Sattler, R., On Erdős property P₁ for the arithmetical sequence. Nederl. Akad. Wetensch.\n    Indag. Math. (1982), 347--352.\n  - [ErGr80] Erdős, P. and Graham, R., Old and new problems and results in combinatorial number\n    theory. Monographies de L'Enseignement Mathematique (1980).\n  - [La26] D. Larsen, [Erdős problem 318](https://github.com/Larsen-Daniel/Erdos-318/blob/main/318.pdf) (2026)\n-/\n\n@[expose] public section\n\nopen Set Real\n\nnamespace Erdos318\n\n/-- A set `A : Set ℕ` is said to have property `P₁` if for any nonconstant sequence\n`f : A → {-1, 1}`, one can always select a finite, nonempty subset `S ⊆ A \\ {0}` such that\n`∑ n ∈ S, fₙ / n = 0`. This is defined in [Sa82b]. -/\ndef P₁ (A : Set ℕ) : Prop := ∀ (f : ℕ → ℝ),\n  f ∘ (Subtype.val : (A \\ {0} : Set ℕ) → ℕ) ≠ (fun _ => 1) →\n  f ∘ (Subtype.val : (A \\ {0} : Set ℕ) → ℕ) ≠ (fun _ => - 1) →\n  Set.range f ⊆ {1, -1} →\n  ∃ S : Finset ℕ, S.Nonempty ∧ ↑S ⊆ A \\ {0} ∧ ∑ n ∈ S, f n / n = 0\n\nset_option linter.style.formal_proof_palomar false in\n/-- `ℕ` has property `P₁`. This is proved in [ErSt75]. -/\n@[category research solved, AMS 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos318.lean#L761\"]\ntheorem erdos_318.variants.univ : P₁ univ := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- Sattler proved in [Sa75] that the set of odd numbers has property `P₁`. -/\n@[category research solved, AMS 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos318.lean#L782\"]\ntheorem erdos_318.variants.odd : P₁ {n | Odd n} := by\n  sorry\n\n/-- The set of squares does not have property `P₁`. -/\n@[category test, AMS 11]\ntheorem erdos_318.variants.squares : ¬ P₁ ({n | IsSquare n}) := by\n  simp only [P₁, not_forall, not_exists, not_and]\n  -- Consider the function `f` that sends `1` to `1` and sends all other numbers to `-1`.\n  refine ⟨fun n => if n = 1 then 1 else - 1, fun h => ?_, fun h => ?_,\n    fun x ⟨y, hy⟩ => ?_, fun S h hs => ?_⟩\n  · have : (- 1 : ℝ) = 1 := by simpa using congr_fun h ⟨4, ⟨⟨2, by grind⟩, by grind⟩⟩\n    grind\n  · have : 1 = (- 1 : ℝ) := by simpa using congr_fun h ⟨1, ⟨IsSquare.one, by grind⟩⟩\n    grind\n  · by_cases x = 1 <;> grind\n  -- Consider two cases: `1 ∈ S` or `1 ∉ S`. In the first case, the finite sum over `S` is bounded\n  -- below by `1 - (π ^ 2 / 6 - 1)`, which is positive. In the second case, the finite sum over `S`\n  -- is negative.\n  by_cases h1 : 1 ∈ S\n  · rw [Finset.sum_eq_add_sum_sdiff_singleton 1 _ (by simp [h1]), Finset.sum_congr rfl\n      (g := fun n : ℕ => (- 1 : ℝ) / n)]\n    · simp only [↓reduceIte, Nat.cast_one, div_self one_ne_zero, ← ne_eq, div_eq_mul_one_div\n        (- 1 : ℝ), ← Finset.mul_sum, neg_one_mul (∑ x ∈ S \\ {1}, 1 / (x : ℝ)), ← sub_eq_add_neg]\n      apply ne_of_gt\n      calc\n      _ < 1 - (π ^ 2 / 6 - 1) := by\n        have : π ^ 2 < 3.15 ^ 2 := by gcongr; exact Real.pi_lt_d2\n        linarith\n      _ = 1 - (∑' n : ℕ, 1 / (n : ℝ) ^ 2 - 1) := by congr; exact hasSum_zeta_two.tsum_eq.symm\n      _ ≤ 1 - ∑ n ∈ S \\ {1}, 1 / (n : ℝ) := by\n        gcongr\n        have : 1 = 1 / ((1 : ℕ) : ℝ) := by norm_cast; grind\n        nth_rewrite 3 [this]\n        rw [le_sub_iff_add_le, ← Finset.sum_eq_sum_sdiff_singleton_add h1]\n        let S' := S.preimage (· ^ 2) (Function.Injective.injOn\n          (Nat.pow_left_injective (by decide)))\n        have hS' : S'.map ⟨(· ^ 2), Nat.pow_left_injective (by decide)⟩ = S := by\n          apply Finset.coe_injective\n          have h : (S : Set ℕ) ⊆ Set.range (· ^ 2) :=\n            hs.trans (by simp [isSquare_iff_exists_sq, Set.subset_def])\n          simpa [S', Set.image_preimage_eq_iff] using h\n        rw [← hS', Finset.sum_map, Function.Embedding.coeFn_mk]\n        simpa [Nat.cast_pow] using Summable.sum_le_tsum S' (fun _ _ => by positivity) (by simp)\n    · intro _ _; grind\n  · suffices ∑ n ∈ S, (fun n ↦ if n = 1 then 1 else - 1) n / (n : ℝ) < 0 from by linarith\n    refine Finset.sum_neg (fun p hp => ?_) h\n    have : p ≠ 1 := by grind\n    simp_all [neg_div, zero_lt_iff, (not_iff_not.2 mem_singleton_iff).1 (hs hp).2]\n\n/-- For any infinite set `A` containing exactly one positive even number, `A` does not have\nproperty `P₁`. Sattler [Sa82] credits this observation to Erdős, who presumably found this after\n[ErGr80]. The element `0` is not counted, since `P₁` ignores it, and the infinitude hypothesis\nexcludes degenerate sets such as `{2}`, on which `P₁` holds vacuously. -/\n@[category research solved, AMS 11]\ntheorem erdos_318.variants.contain_single_even {A : Set ℕ} (hA : A.Infinite)\n    (hA' : {n | n ∈ A \\ {0} ∧ Even n}.ncard = 1) : ¬ P₁ A := by\n  sorry\n\n/-- There exists a set `A` with positive density that does not have property `P₁`.\n#TODO: prove this lemma by assuming `erdos_318.contain_single_even`.\n\nThe density sits in an existential, so `HasPosDensity` is the *stronger* reading here and\nweakening it to positive lower density would claim less, which is the opposite of the usual\nsituation for Erdős' \"positive density\". It also costs nothing: by\n`erdos_318.variants.contain_single_even` a witness only needs exactly one even element, and the\nodd numbers together with one even number have density `1 / 2` on the nose. -/\n@[category research solved, AMS 11]\ntheorem erdos_318.parts.i : ∃ A : Set ℕ, HasPosDensity A ∧ ¬ P₁ A := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- Every infinite arithmetic progression has property `P₁`. This is proved in [Sa82b]. -/\n@[category research solved, AMS 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos318.lean#L599\"]\ntheorem erdos_318.variants.infinite_AP {A : Set ℕ} (hA : A.IsAPOfLength ⊤) : P₁ A := by\n  sorry\n\n/--\nDoes the set of squares excluding 1 have property `P₁`?\n\nLarsen [La26] proved that this set does have property `P₁`.\n-/\n@[category research solved, question, AMS 11]\ntheorem erdos_318.parts.ii : P₁ ({n | IsSquare n} \\ {1}) := by\n  sorry\n\nend Erdos318\n",
  "statement_hash": "bf6f1588a06791c0725cf2bc25eb2d39108a2e26bf59c78c6dc6c122eea9b9a1",
  "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."
}