{
  "id": "3076",
  "ident": "NS.03076",
  "slug": "erdos-748",
  "title": "Erdős Problem 748",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $f(n)$ count the number of sum-free $A\\subseteq \\{1,\\ldots,n\\}$, i.e. $A$ contains no\nsolutions to $a=b+c$ with $a,b,c\\in A$. Is it true that\n$$f(n)=2^{(1+o(1))\\frac{n}{2}}?$$\n\nThe Cameron–Erdős conjecture. This is true, and in fact $f(n) \\ll 2^{n/2}$, which was proved\nindependently by Green [Gr04] and Sapozhenko [Sa03].\n\nThe statement $f(n)=2^{(1+o(1))n/2}$ is formalised as $\\log_2 f(n)/n\\to 1/2$.",
  "subjects": [
    "math.CO",
    "math.NT",
    "msc:05",
    "msc:11"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos748.erdos_748",
  "statement_lean": "theorem erdos_748 :\n    Tendsto (fun n : ℕ ↦ logb 2 (f n) / n) atTop (nhds (1 / 2))",
  "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 748\n\n*References:*\n- [erdosproblems.com/748](https://www.erdosproblems.com/748)\n- [CaEr90] Cameron, P. J. and Erdős, P., _On the number of sets of integers with various\n  properties_. (1990), 61-79.\n- [Er94b] Erdős, Paul, _Some problems in number theory, combinatorics and combinatorial\n  geometry_. Math. Pannon. (1994), 261-269.\n- [Er98] Erdős, Paul, _Some of my new and almost new problems and results in combinatorial number\n  theory_. Number theory (Eger, 1996) (1998), 169-180.\n- [Gr04] Green, Ben, _The Cameron-Erdős conjecture_. Bull. London Math. Soc. (2004), 769-778.\n- [Sa03] Sapozhenko, A. A., _The Cameron-Erdős conjecture_. Dokl. Akad. Nauk (2003), 749-752.\n-/\n\n@[expose] public section\n\nopen Filter Real\n\nnamespace Erdos748\n\nopen scoped Classical in\n/-- `f n` counts the number of sum-free $A\\subseteq \\{1,\\ldots,n\\}$, i.e. $A$ contains no\nsolutions to $a=b+c$ with $a,b,c\\in A$. -/\nnoncomputable def f (n : ℕ) : ℕ :=\n  ((Finset.Icc 1 n).powerset.filter fun A : Finset ℕ ↦ IsSumFree (A : Set ℕ)).card\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $f(n)$ count the number of sum-free $A\\subseteq \\{1,\\ldots,n\\}$, i.e. $A$ contains no\nsolutions to $a=b+c$ with $a,b,c\\in A$. Is it true that\n$$f(n)=2^{(1+o(1))\\frac{n}{2}}?$$\n\nThe Cameron–Erdős conjecture. This is true, and in fact $f(n) \\ll 2^{n/2}$, which was proved\nindependently by Green [Gr04] and Sapozhenko [Sa03].\n\nThe statement $f(n)=2^{(1+o(1))n/2}$ is formalised as $\\log_2 f(n)/n\\to 1/2$.\n-/\n@[category research solved, question, AMS 5 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos748.lean#L1228\"]\ntheorem erdos_748 :\n    Tendsto (fun n : ℕ ↦ logb 2 (f n) / n) atTop (nhds (1 / 2)) := by\n  sorry\n\n/-- It is trivial to see that $f(n) \\geq 2^{\\frac{n}{2}}$, considering all subsets of\n$(n/2,n]$. The source writes $[n/2,n]$, but for even $n$ that interval is not sum-free,\nsince $n/2 + n/2 = n$. -/\n@[category textbook, AMS 5 11]\ntheorem erdos_748.variants.lower_bound (n : ℕ) :\n    (2 : ℝ) ^ ((n : ℝ) / 2) ≤ (f n : ℝ) := by\n  sorry\n\n/-- Green [Gr04] and Sapozhenko [Sa03] proved that $f(n) \\ll 2^{n/2}$. -/\n@[category research solved, AMS 5 11]\ntheorem erdos_748.variants.green_sapozhenko :\n    ∃ C : ℝ, ∀ n : ℕ, (f n : ℝ) ≤ C * 2 ^ ((n : ℝ) / 2) := by\n  sorry\n\n/-- In fact, both Green [Gr04] and Sapozhenko [Sa03] prove the stronger asymptotic\n$f(n) \\sim c_n 2^{n/2}$, where $c_n$ takes on one of two values depending on the parity of\n$n$. -/\n@[category research solved, AMS 5 11]\ntheorem erdos_748.variants.asymptotic :\n    ∃ c₀ c₁ : ℝ, 0 < c₀ ∧ 0 < c₁ ∧\n      Tendsto (fun m : ℕ ↦ (f (2 * m) : ℝ) / 2 ^ m) atTop (nhds c₀) ∧\n      Tendsto (fun m : ℕ ↦ (f (2 * m + 1) : ℝ) / 2 ^ ((2 * m + 1 : ℝ) / 2)) atTop\n        (nhds c₁) := by\n  sorry\n\nend Erdos748\n",
  "statement_hash": "500ad6a8b68be1c7d0b2d8a75a5c2f4111b97d2fdde481dc07bb0575790f7c17",
  "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."
}