{
  "id": "3437",
  "ident": "NS.03437",
  "slug": "erdos-865",
  "title": "Erdős Problem 865",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "There exists a constant $C>0$ such that, for all large $N$, if $A\\subseteq \\{1,\\ldots,N\\}$ has\nsize at least $\\frac{5}{8}N+C$ then there are distinct $a,b,c\\in A$ such that $a+b,a+c,b+c\\in A$.\n\nA problem of Erdős and Sós (also earlier considered by Choi, Erdős, and Szemerédi [CES75], but Erdős\nhad forgotten this).\n\nThis problem was solved in the affirmative by Cipollini and GPT Pro [Ci26].\n\nThis is true. The linked proof gives it in the contrapositive and with the constant cleared:\nevery triple-free $A\\subseteq\\{1,\\ldots,N\\}$ satisfies $8\\lvert A\\rvert\\leq 5N+C$ for a fixed\n$C$, for every $N$ rather than only for large $N$. It also shows the threshold is sharp, by\nexhibiting triple-free sets of size $(5N+16)/8$ for every $N$ divisible by $8$.",
  "subjects": [
    "math.CO",
    "math.NT",
    "msc:05",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos865.erdos_865",
  "statement_lean": "theorem erdos_865 :\n    ∃ C > 0, ∀ᶠ (N : ℕ) in atTop,\n      ∀ A ⊆ Icc 1 N, A.card ≥ (5 / 8 : ℝ) * N + C →\n      ∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧\n      a + b ∈ A ∧ a + c ∈ A ∧ b + c ∈ A",
  "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 865\n\n*References:*\n- [erdosproblems.com/865](https://www.erdosproblems.com/865)\n- [CES75] Choi, S. L. G. and Erdős, P. and Szemerédi, E., Some additive and multiplicative problems\n  in number theory. Acta Arith. (1975), 37--50.\n- [Ci26] R. Cipollini, [A sharp $5/8$ bound for an Erdős–Sós pairwise-sums problem](https://arxiv.org/html/2606.29361)\n  (2026).\n-/\n\n@[expose] public section\n\nopen Finset Filter\nopen scoped Asymptotics\n\nnamespace Erdos865\n\nset_option linter.style.formal_proof_palomar false in\n/--\nThere exists a constant $C>0$ such that, for all large $N$, if $A\\subseteq \\{1,\\ldots,N\\}$ has\nsize at least $\\frac{5}{8}N+C$ then there are distinct $a,b,c\\in A$ such that $a+b,a+c,b+c\\in A$.\n\nA problem of Erdős and Sós (also earlier considered by Choi, Erdős, and Szemerédi [CES75], but Erdős\nhad forgotten this).\n\nThis problem was solved in the affirmative by Cipollini and GPT Pro [Ci26].\n\nThis is true. The linked proof gives it in the contrapositive and with the constant cleared:\nevery triple-free $A\\subseteq\\{1,\\ldots,N\\}$ satisfies $8\\lvert A\\rvert\\leq 5N+C$ for a fixed\n$C$, for every $N$ rather than only for large $N$. It also shows the threshold is sharp, by\nexhibiting triple-free sets of size $(5N+16)/8$ for every $N$ divisible by $8$.\n-/\n@[category research solved, AMS 5 11,\n  formal_proof using lean4 at \"https://github.com/Jayyhk/erdos-lean/blob/f8a51976fd2e66a52b4928c109fb9ae877a1a507/problems/865/Erdos865.lean\",\n  formal_proof using lean4 at \"https://github.com/mrricky22/erdos-865-lean/blob/f861539107a7adeaa97462ce7c7171127696b63a/RequestProject/Main.lean#L45\"]\ntheorem erdos_865 :\n    ∃ C > 0, ∀ᶠ (N : ℕ) in atTop,\n      ∀ A ⊆ Icc 1 N, A.card ≥ (5 / 8 : ℝ) * N + C →\n      ∃ a ∈ A, ∃ b ∈ A, ∃ c ∈ A, a ≠ b ∧ a ≠ c ∧ b ≠ c ∧\n      a + b ∈ A ∧ a + c ∈ A ∧ b + c ∈ A := by\n  sorry\n\n/--\nIt is a classical folklore fact that if $A\\subseteq \\{1,\\ldots,2N\\}$ has size $\\geq N+2$ then\nthere are distinct $a,b\\in A$ such that $a+b\\in A$, which establishes the $k=2$ case.\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_865.variants.k2 (N : ℕ) :\n    ∀ A ⊆ Icc 1 (2 * N), A.card ≥ N + 2 →\n    ∃ a ∈ A, ∃ b ∈ A, a ≠ b ∧ a + b ∈ A := by\n  intro A hA hcard\n  have hne : A.Nonempty := by\n    rw [← Finset.card_pos]; omega\n  set m := A.max' hne with hm\n  have hmA : m ∈ A := Finset.max'_mem A hne\n  have hmle : m ≤ 2 * N := by\n    have := hA hmA\n    rw [Finset.mem_Icc] at this\n    omega\n  have hcard' : (Icc 1 N).card < (A.erase m).card := by\n    rw [Finset.card_erase_of_mem hmA, Nat.card_Icc]\n    omega\n  have hmaps : ∀ x ∈ A.erase m, min x (m - x) ∈ Icc 1 N := by\n    intro x hx\n    obtain ⟨hxm, hxA⟩ := Finset.mem_erase.mp hx\n    have hxle : x ≤ m := Finset.le_max' A x hxA\n    have hx1 := (Finset.mem_Icc.mp (hA hxA)).1\n    rw [Finset.mem_Icc]\n    omega\n  obtain ⟨x, hx, y, hy, hxy, hxyeq⟩ :=\n    Finset.exists_ne_map_eq_of_card_lt_of_maps_to hcard' hmaps\n  obtain ⟨hxm, hxA⟩ := Finset.mem_erase.mp hx\n  obtain ⟨hym, hyA⟩ := Finset.mem_erase.mp hy\n  have hxle : x ≤ m := Finset.le_max' A x hxA\n  have hyle : y ≤ m := Finset.le_max' A y hyA\n  refine ⟨x, hxA, y, hyA, hxy, ?_⟩\n  have : x + y = m := by omega\n  rw [this]\n  exact hmA\n\nnoncomputable def f (N k : ℕ) : ℕ :=\n  sInf {m | ∀ A ⊆ Icc 1 N, A.card ≥ m →\n    ∃ S ⊆ A, S.card = k ∧ ∀ x ∈ S, ∀ y ∈ S, x ≠ y → x + y ∈ A}\n\n/--\nErdős and Sós conjectured that\n$f_k(N)\\sim \\frac{1}{2}\\left(1+\\sum_{1\\leq r\\leq k-2}\\frac{1}{4^r}\\right) N$,\nwhere $f_k(N)$ is the minimal size of a subset of $\\{1, \\dots, N\\}$ guaranteeing $k$ elements\nhave all pairwise sums in the set.\n-/\n@[category research open, AMS 5 11]\ntheorem erdos_865.variants.sos :\n    ∀ᵉ (k : ℕ) (hk : 2 ≤ k),\n    (fun N ↦ (f N k : ℝ)) ~[atTop] (fun N ↦ (1 / 2 : ℝ) * (1 + ∑ r ∈ Icc 1 (k - 2),\n      (1 / 4 : ℝ) ^ r) * N) := by\n  sorry\n\n/--\nChoi, Erdős, and Szemerédi [CES75] have proved that, for all $k\\geq 3$, there exists $\\epsilon_k>0$\nsuch that (for large enough $N$) $f_k(N)\\leq \\left(\\frac{2}{3}-\\epsilon_k\\right)N$.\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_865.variants.upper_bound (k : ℕ) (hk : 3 ≤ k) :\n    ∃ ε > 0, ∀ᶠ N in atTop, (f N k : ℝ) ≤ (2 / 3 - ε) * N := by\n  sorry\n\nend Erdos865\n",
  "statement_hash": "9ed8c231a7711faa53afe33378b5fa6ed458e8f8f0af703a89b0764533b63ba4",
  "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."
}