{
  "id": "1019",
  "ident": "NS.01019",
  "slug": "erdos-1211",
  "title": "Erdős Problem 1211",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $\\mathbb{N}=A\\cup B$ where $A$ and $B$ are disjoint. Let $S(A)$ be those integers which are the\nsum of finitely many distinct elements of $A$, and similarly for $S(B)$.\n\nIf\n$$\n\\overline{\\delta}(X)=\\limsup_{x\\to \\infty}\\frac{1}{\\log x}\n  \\sum_{\\substack{n\\in X\\\\ n<x}}\\frac{1}{n}\n$$\nis the upper logarithmic density of $X$ then how large must\n$$\\max(\\overline{\\delta}(S(A)),\\overline{\\delta}(S(B)))$$\nbe?\n\nA question of Erdős [Er80]. Conlon, Fox, and Pham [CFP22, Theorem 1] proved that the least\npossible value of $\\max(\\overline{\\delta}(S(A)),\\overline{\\delta}(S(B)))$ is\n$\\frac{2+\\sqrt{3}}{4}\\approx 0.93301$, and that it is attained.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos1211.erdos_1211",
  "statement_lean": "theorem erdos_1211 :\n    (∀ A B : Set ℕ, IsNatPartition A B → erdos_1211.answer ≤ partitionValue A B) ∧\n      ∃ A B : Set ℕ, IsNatPartition A B ∧ partitionValue A B = erdos_1211.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 1211\n\n*References:*\n- [erdosproblems.com/1211](https://www.erdosproblems.com/1211)\n- [CFP22] Conlon, David and Fox, Jacob and Pham, Huy Tuan, *The upper logarithmic density of\n  monochromatic subset sums*. Mathematika 68 (2022), 1292--1301.\n  [arXiv:2105.15195](https://arxiv.org/abs/2105.15195)\n- [Er80] Erdős, Paul, *A survey of problems in combinatorial number theory*. Ann. Discrete Math.\n  (1980), 89-115. [PDF](https://www.renyi.hu/~p_erdos/1980-03.pdf)\n-/\n\n@[expose] public section\n\nopen Filter\n\nnamespace Erdos1211\n\n/-- `IsNatPartition A B` says that `A` and `B` are disjoint and `A ∪ B` is all of `ℕ`.\nHere `ℕ` contains $0$. This is harmless: $0$ adds nothing to a sum of distinct elements and does\nnot count in the density below, so partitions of `ℕ` and of the positive integers give the same\nvalues. -/\ndef IsNatPartition (A B : Set ℕ) : Prop :=\n  Disjoint A B ∧ A ∪ B = Set.univ\n\n/-- The upper logarithmic density\n$$\\overline{\\delta}(X)=\\limsup_{x\\to\\infty}\\frac{1}{\\log x}\\sum_{n\\in X,\\ n<x}\\frac{1}{n}$$\nof a set `X` of natural numbers, with a real cutoff `x`. The sum runs over the positive integers\n`n < x` in `X`, written as `1 ≤ n < ⌈x⌉₊` (see `mem_Ico_ceil_iff`). The quotient is eventually at\nmost $1 + 1/\\log x$, so the `limsup` is not a junk value. -/\nnoncomputable def upperLogDensity (X : Set ℕ) : ℝ :=\n  open scoped Classical in\n  limsup (fun x : ℝ ↦\n    (∑ n ∈ (Finset.Ico 1 ⌈x⌉₊).filter (· ∈ X), (n : ℝ)⁻¹) / Real.log x) atTop\n\n/-- The larger of the upper logarithmic densities of the subset-sum sets of the two classes,\n$\\max(\\overline{\\delta}(S(A)),\\overline{\\delta}(S(B)))$. Here `subsetSums A` is the set of sums of\nfinitely many distinct elements of `A`; it contains the empty sum $0$, which does not affect the\ndensity. -/\nnoncomputable def partitionValue (A B : Set ℕ) : ℝ :=\n  max (upperLogDensity (subsetSums A)) (upperLogDensity (subsetSums B))\n\n/-- A natural number `n` lies in `Finset.Ico 1 ⌈x⌉₊` exactly when it is positive and below the\nreal cutoff `x`. -/\n@[category API, AMS 11]\ntheorem mem_Ico_ceil_iff (n : ℕ) (x : ℝ) :\n    n ∈ Finset.Ico 1 ⌈x⌉₊ ↔ 1 ≤ n ∧ (n : ℝ) < x := by\n  rw [Finset.mem_Ico, Nat.lt_ceil]\n\n/-- Every set `A` is part of a partition, with the complement as the other class. -/\n@[category API, AMS 11]\ntheorem isNatPartition_compl (A : Set ℕ) : IsNatPartition A Aᶜ :=\n  ⟨disjoint_compl_right, Set.union_compl_self A⟩\n\n/-- The answer, $\\frac{2+\\sqrt{3}}{4}$. -/\nnoncomputable def erdos_1211.answer : ℝ := (2 + √3) / 4\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $\\mathbb{N}=A\\cup B$ where $A$ and $B$ are disjoint. Let $S(A)$ be those integers which are the\nsum of finitely many distinct elements of $A$, and similarly for $S(B)$.\n\nIf\n$$\n\\overline{\\delta}(X)=\\limsup_{x\\to \\infty}\\frac{1}{\\log x}\n  \\sum_{\\substack{n\\in X\\\\ n<x}}\\frac{1}{n}\n$$\nis the upper logarithmic density of $X$ then how large must\n$$\\max(\\overline{\\delta}(S(A)),\\overline{\\delta}(S(B)))$$\nbe?\n\nA question of Erdős [Er80]. Conlon, Fox, and Pham [CFP22, Theorem 1] proved that the least\npossible value of $\\max(\\overline{\\delta}(S(A)),\\overline{\\delta}(S(B)))$ is\n$\\frac{2+\\sqrt{3}}{4}\\approx 0.93301$, and that it is attained.\n-/\n@[category research solved, question value, AMS 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos1211.lean#L401\"]\ntheorem erdos_1211 :\n    (∀ A B : Set ℕ, IsNatPartition A B → erdos_1211.answer ≤ partitionValue A B) ∧\n      ∃ A B : Set ℕ, IsNatPartition A B ∧ partitionValue A B = erdos_1211.answer := by\n  sorry\n\nend Erdos1211\n",
  "statement_hash": "d73bad35f3e1cfc21310f2c09ff00338593b22651ac816ae439aeeef4ceb4164",
  "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."
}