{
  "id": "3432",
  "ident": "NS.03432",
  "slug": "erdos-864",
  "title": "Erdős Problem 864",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Let $A\\subseteq \\{1,\\ldots,N\\}$ be a set such that there exists at most one $n$ with more than one\nsolution to $n=a+b$ (with $a\\leq b\\in A$). Estimate the maximal possible size of $|A|$. In\nparticular, is it true that\n$$|A| \\leq (1+o(1))\\frac{2}{\\sqrt{3}} N^{1/2}?$$\n\nA problem of Erdős and Freud [ErFr91] [Er92c]. For the analogous question with $n=a-b$ they prove\nthat $\\lvert A\\rvert\\sim N^{1/2}$. This is a weaker form of Erdős Problem 840.\n\nThe condition on $A$ is `HasAtMostOneRepeatedSum`. We state the question as follows: for every\n$\\varepsilon > 0$ and all large $N$, every such set $A$ satisfies\n$|A| \\leq (1+\\varepsilon)\\frac{2}{\\sqrt{3}} N^{1/2}$.",
  "subjects": [
    "math.CO",
    "math.NT",
    "msc:05",
    "msc:11"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos864.erdos_864",
  "statement_lean": "theorem erdos_864 :\n    ∀ ε : ℝ, 0 < ε → ∀ᶠ N : ℕ in atTop, ∀ A ⊆ Finset.Icc 1 N,\n      HasAtMostOneRepeatedSum A →\n        (#A : ℝ) ≤ (1 + ε) * (2 / Real.sqrt 3) * Real.sqrt (N : ℝ)",
  "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 864\n\n*References:*\n- [erdosproblems.com/864](https://www.erdosproblems.com/864)\n- [A389182](https://oeis.org/A389182)\n- [ErFr91] Erdős, P. and Freud, R., *On sums of a Sidon-sequence*. J. Number Theory 38 (1991),\n  196--205.\n- [Er92c] Erdős, P., *Some of my forgotten problems in number theory*. Hardy-Ramanujan J. 15\n  (1992), 34-50.\n-/\n\n@[expose] public section\n\nopen Filter\nopen scoped Finset\n\nnamespace Erdos864\n\n/-- The representations of $n$ as a sum $n = a + b$ with $a \\leq b$ and $a, b \\in A$, recorded as\nthe pairs $(a, b)$. The case $a = b$ is allowed. -/\ndef sumRepresentations (A : Finset ℕ) (n : ℕ) : Finset (ℕ × ℕ) :=\n  {p ∈ A ×ˢ A | p.1 ≤ p.2 ∧ p.1 + p.2 = n}\n\n/-- There is at most one $n$ with more than one representation $n = a + b$, where $a \\leq b$ and\n$a, b \\in A$. That is, any two integers with more than one representation are equal.\n\nEvery Sidon set satisfies this condition, since then no $n$ has more than one representation. -/\ndef HasAtMostOneRepeatedSum (A : Finset ℕ) : Prop :=\n  ∀ n m : ℕ, 1 < #(sumRepresentations A n) → 1 < #(sumRepresentations A m) → n = m\n\n/--\nLet $A\\subseteq \\{1,\\ldots,N\\}$ be a set such that there exists at most one $n$ with more than one\nsolution to $n=a+b$ (with $a\\leq b\\in A$). Estimate the maximal possible size of $|A|$. In\nparticular, is it true that\n$$|A| \\leq (1+o(1))\\frac{2}{\\sqrt{3}} N^{1/2}?$$\n\nA problem of Erdős and Freud [ErFr91] [Er92c]. For the analogous question with $n=a-b$ they prove\nthat $\\lvert A\\rvert\\sim N^{1/2}$. This is a weaker form of Erdős Problem 840.\n\nThe condition on $A$ is `HasAtMostOneRepeatedSum`. We state the question as follows: for every\n$\\varepsilon > 0$ and all large $N$, every such set $A$ satisfies\n$|A| \\leq (1+\\varepsilon)\\frac{2}{\\sqrt{3}} N^{1/2}$.\n-/\n@[category research open, question, AMS 5 11]\ntheorem erdos_864 :\n    ∀ ε : ℝ, 0 < ε → ∀ᶠ N : ℕ in atTop, ∀ A ⊆ Finset.Icc 1 N,\n      HasAtMostOneRepeatedSum A →\n        (#A : ℝ) ≤ (1 + ε) * (2 / Real.sqrt 3) * Real.sqrt (N : ℝ) := by\n  sorry\n\n/--\nErdős and Freud [ErFr91] [Er92c] prove that\n$$\\lvert A\\rvert \\geq (1+o(1))\\frac{2}{\\sqrt{3}}N^{1/2}.$$\nThis is shown by taking a genuine Sidon set $B\\subset [1,N/3]$ of size $\\sim N^{1/2}/\\sqrt{3}$\nand taking the union with $\\{N-b : b\\in B\\}$.\n\nThat is, for every $\\varepsilon > 0$ and all large $N$ there is a set $A\\subseteq \\{1,\\ldots,N\\}$\nwith the property of `Erdos864.erdos_864` and $|A| \\geq (1-\\varepsilon)\\frac{2}{\\sqrt{3}}N^{1/2}$.\nSo the constant $2/\\sqrt{3}$ there cannot be replaced by a smaller one.\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_864.variants.lower_bound :\n    ∀ ε : ℝ, 0 < ε → ∀ᶠ N : ℕ in atTop, ∃ A ⊆ Finset.Icc 1 N,\n      HasAtMostOneRepeatedSum A ∧\n        (1 - ε) * (2 / Real.sqrt 3) * Real.sqrt (N : ℝ) ≤ #A := by\n  sorry\n\n/-- A Sidon set has no integer with more than one representation, so it satisfies the condition\nof the problem. -/\n@[category test, AMS 5 11]\ntheorem hasAtMostOneRepeatedSum_of_isSidon {A : Finset ℕ} (hA : IsSidon (A : Set ℕ)) :\n    HasAtMostOneRepeatedSum A := by\n  intro n m hn _\n  exfalso\n  obtain ⟨p, hp, q, hq, hpq⟩ := Finset.one_lt_card.1 hn\n  simp only [sumRepresentations, Finset.mem_filter, Finset.mem_product] at hp hq\n  obtain ⟨⟨hp1, hp2⟩, hp3, hp4⟩ := hp\n  obtain ⟨⟨hq1, hq2⟩, hq3, hq4⟩ := hq\n  rcases hA p.1 (Finset.mem_coe.2 hp1) q.1 (Finset.mem_coe.2 hq1)\n      p.2 (Finset.mem_coe.2 hp2) q.2 (Finset.mem_coe.2 hq2) (by omega) with ⟨h1, h2⟩ | ⟨h1, h2⟩\n  · exact hpq (Prod.ext h1 h2)\n  · exact hpq (Prod.ext (by omega) (by omega))\n\n/-- The set $\\{1,2,3\\}$ is not a Sidon set, but it satisfies the condition: only\n$4 = 1 + 3 = 2 + 2$ has two representations. -/\n@[category test, AMS 5 11]\ntheorem hasAtMostOneRepeatedSum_one_two_three : HasAtMostOneRepeatedSum {1, 2, 3} := by\n  have key : ∀ n, 1 < #(sumRepresentations {1, 2, 3} n) → n = 4 := by\n    intro n hn\n    obtain ⟨⟨a, b⟩, hp, ⟨c, d⟩, hq, hpq⟩ := Finset.one_lt_card.1 hn\n    simp only [sumRepresentations, Finset.mem_filter, Finset.mem_product, Finset.mem_insert,\n      Finset.mem_singleton] at hp hq\n    have hne : a ≠ c ∨ b ≠ d := by\n      rw [Ne, Prod.mk.injEq, not_and_or] at hpq\n      exact hpq\n    omega\n  intro n m hn hm\n  rw [key n hn, key m hm]\n\n/-- The set $\\{1,2,3,4\\}$ does not satisfy the condition: both $4 = 1 + 3 = 2 + 2$ and\n$5 = 1 + 4 = 2 + 3$ have two representations. Without the case $a = b$, $4$ would have only one\nrepresentation and the set would satisfy the condition. -/\n@[category test, AMS 5 11]\ntheorem not_hasAtMostOneRepeatedSum_Icc_one_four :\n    ¬ HasAtMostOneRepeatedSum (Finset.Icc 1 4) := by\n  intro h\n  have h4 : 1 < #(sumRepresentations (Finset.Icc 1 4) 4) := by decide +kernel\n  have h5 : 1 < #(sumRepresentations (Finset.Icc 1 4) 5) := by decide +kernel\n  have := h 4 5 h4 h5\n  omega\n\nend Erdos864\n",
  "statement_hash": "daf645019ab16c5d48d2c699dac2583ad21755c010062ba4547c667149818c74",
  "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."
}