{
  "id": "3199",
  "ident": "NS.03199",
  "slug": "erdos-787",
  "title": "Erdős Problem 787",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Let $g(n)$ be maximal such that given any set $A\\subset \\mathbb{R}$ with $\\lvert A\\rvert=n$ there\nexists some $B\\subseteq A$ of size $\\lvert B\\rvert\\geq g(n)$ such that $b_1+b_2\\not\\in A$ for all\n$b_1\\neq b_2\\in B$.\n\nEstimate $g(n)$.",
  "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": "Erdos787.erdos_787",
  "statement_lean": "theorem erdos_787 : (fun n ↦ (g ℝ n : ℝ)) =Θ[atTop] erdos_787.answer",
  "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 787\n\n*References:*\n- [erdosproblems.com/787](https://www.erdosproblems.com/787)\n- [Be25] Beker, A., *The Erdős-Moser sum-free set problem via improved bounds for\n  $k$-configurations*. [arXiv:2501.10203](https://arxiv.org/abs/2501.10203) (2025).\n- [Ch71] Choi, S. L. G., *On a combinatorial problem in number theory*.\n  Proc. London Math. Soc. (3) (1971), 629-642.\n- [Er65] Erdős, P., *Extremal problems in number theory*. Proc. Sympos. Pure Math., Vol. VIII\n  (1965), 181-189. [PDF](https://www.renyi.hu/~p_erdos/1965-02.pdf)\n- [Er73] Erdős, P., *Problems and results on combinatorial number theory*. A survey of\n  combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo.,\n  1971) (1973), 117-138. [PDF](https://www.renyi.hu/~p_erdos/1973-21.pdf)\n- [Ru05] Ruzsa, Imre Z., *Sum-avoiding subsets*. Ramanujan J. (2005), 77-82.\n- [Sa21] Sanders, Tom, *The Erdős-Moser sum-free set problem*. Canad. J. Math. (2021), 63-107.\n-/\n\n@[expose] public section\n\nopen Filter Asymptotics\n\nnamespace Erdos787\n\n/--\n`g G n` is the largest `m` such that every set `A` of `n` elements of `G` has a subset `B` with\n$\\lvert B\\rvert \\geq m$ and $b_1 + b_2 \\notin A$ for all distinct $b_1, b_2 \\in B$\n[Er65, p. 187]. The problem takes `G = ℝ`.\n\nThe condition on `B` is `Disjoint B.restrictedSumset A`. For `G = ℝ` or `G = ℤ`, the set of such\n`m` contains `0` and is bounded by `n`, so `sSup` is its maximum, not a junk value.\n-/\nnoncomputable def g (G : Type*) [Add G] [DecidableEq G] (n : ℕ) : ℕ :=\n  sSup {m : ℕ | ∀ A : Finset G, A.card = n →\n    ∃ B ⊆ A, m ≤ B.card ∧ Disjoint B.restrictedSumset A}\n\n/-- `Disjoint B.restrictedSumset A` says that $b_1 + b_2 \\notin A$ for all distinct\n$b_1, b_2 \\in B$. -/\n@[category API, AMS 5 11]\ntheorem disjoint_restrictedSumset_iff {G : Type*} [Add G] [DecidableEq G] (A B : Finset G) :\n    Disjoint B.restrictedSumset A ↔ ∀ b₁ ∈ B, ∀ b₂ ∈ B, b₁ ≠ b₂ → b₁ + b₂ ∉ A := by\n  unfold Finset.restrictedSumset\n  rw [Finset.disjoint_left]\n  constructor\n  · intro h b₁ hb₁ b₂ hb₂ hne hmem\n    have hmem' : b₁ + b₂ ∈ Finset.image (fun p : G × G => p.1 + p.2) B.offDiag :=\n      Finset.mem_image.2 ⟨(b₁, b₂), Finset.mem_offDiag.2 ⟨hb₁, hb₂, hne⟩, rfl⟩\n    exact h hmem' hmem\n  · intro h x hx hxA\n    obtain ⟨⟨b₁, b₂⟩, hp, rfl⟩ := Finset.mem_image.1 hx\n    obtain ⟨hb₁, hb₂, hne⟩ := Finset.mem_offDiag.1 hp\n    exact h b₁ hb₁ b₂ hb₂ hne hxA\n\n/-- If every set of `n` reals has a subset `B` of size at least `m` with\n`Disjoint B.restrictedSumset A`, then `m ≤ g ℝ n`. -/\n@[category API, AMS 5 11]\ntheorem le_g {n m : ℕ} (h : ∀ A : Finset ℝ, A.card = n →\n    ∃ B ⊆ A, m ≤ B.card ∧ Disjoint B.restrictedSumset A) : m ≤ g ℝ n := by\n  refine le_csSup (bddAbove_def.2 ⟨n, fun m' hm' => ?_⟩) h\n  have hm'' : ∀ A : Finset ℝ, A.card = n →\n      ∃ B ⊆ A, m' ≤ B.card ∧ Disjoint B.restrictedSumset A := hm'\n  obtain ⟨A, hA⟩ := Infinite.exists_subset_card_eq ℝ n\n  obtain ⟨B, hBA, hmB, -⟩ := hm'' A hA\n  exact hmB.trans ((Finset.card_le_card hBA).trans_eq hA)\n\ndef erdos_787.answer : ℕ → ℝ := sorry\n\n/--\nLet $g(n)$ be maximal such that given any set $A\\subset \\mathbb{R}$ with $\\lvert A\\rvert=n$ there\nexists some $B\\subseteq A$ of size $\\lvert B\\rvert\\geq g(n)$ such that $b_1+b_2\\not\\in A$ for all\n$b_1\\neq b_2\\in B$.\n\nEstimate $g(n)$.\n-/\n@[category research open, question value, AMS 5 11]\ntheorem erdos_787 : (fun n ↦ (g ℝ n : ℝ)) =Θ[atTop] erdos_787.answer := by\n  sorry\n\n/--\nThis function was considered by Erdős and Moser. Choi observed that, without loss of generality,\none can assume that $A\\subset \\mathbb{Z}$.\n\nHere this means that sets of integers give the same value $g(n)$ as sets of reals.\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_787.variants.integers (n : ℕ) : g ℤ n = g ℝ n := by\n  sorry\n\n/--\nKlarner proved $g(n) \\gg \\log n$ (indeed, a greedy construction suffices).\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_787.variants.klarner :\n    ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, c * Real.log n ≤ (g ℝ n : ℝ) := by\n  sorry\n\n/--\nChoi [Ch71] proved $g(n) \\ll n^{2/5+o(1)}$.\n\nHere this means that $g(n) \\leq n^{2/5+\\varepsilon}$ for every $\\varepsilon > 0$ and all large $n$,\nas in [Er73, p. 130].\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_787.variants.choi :\n    ∀ ε > (0 : ℝ), ∀ᶠ n : ℕ in atTop, (g ℝ n : ℝ) ≤ (n : ℝ) ^ (2 / 5 + ε) := by\n  sorry\n\n/--\nThe current best bounds known are\n$$(\\log n)^{1+c} \\ll g(n) \\ll \\exp(\\sqrt{\\log n})$$\nfor some constant $c>0$, the lower bound due to Sanders [Sa21] and the upper bound due to\nRuzsa [Ru05].\n\nThis is the lower bound.\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_787.variants.sanders :\n    ∃ c > (0 : ℝ), ∀ᶠ n : ℕ in atTop, Real.log n ^ (1 + c) ≤ (g ℝ n : ℝ) := by\n  sorry\n\n/--\nThe current best bounds known are\n$$(\\log n)^{1+c} \\ll g(n) \\ll \\exp(\\sqrt{\\log n})$$\nfor some constant $c>0$, the lower bound due to Sanders [Sa21] and the upper bound due to\nRuzsa [Ru05].\n\nThis is the upper bound. [Ru05] proves it in the form $\\exp(O(\\sqrt{\\log n}))$, which is the form\nstated here.\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_787.variants.ruzsa :\n    ∃ C > (0 : ℝ), ∀ᶠ n : ℕ in atTop, (g ℝ n : ℝ) ≤ Real.exp (C * Real.sqrt (Real.log n)) := by\n  sorry\n\n/--\nBeker [Be25] has proved\n$$(\\log n)^{1+\\tfrac{1}{68}+o(1)} \\ll g(n).$$\n\nHere this means that $g(n) \\geq (\\log n)^{1+c}$ for every $c < 1/68$ and all large $n$\n[Be25, Theorem 1.2].\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_787.variants.beker :\n    ∀ c : ℝ, 0 < c → c < 1 / 68 → ∀ᶠ n : ℕ in atTop, Real.log n ^ (1 + c) ≤ (g ℝ n : ℝ) := by\n  sorry\n\nend Erdos787\n",
  "statement_hash": "45f58299f0acdca9809be9edc82116b2749dd52ce98ab1bc6d4a9a30a91cc1e7",
  "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."
}