{
  "id": "3441",
  "ident": "NS.03441",
  "slug": "erdos-867",
  "title": "Erdős Problem 867",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Is it true that if $A=\\{a_1<\\cdots <a_t\\}\\subseteq \\{1,\\ldots,N\\}$ has no solutions to\n$$a_i+a_{i+1}+\\cdots+a_j\\in A$$\nthen\n$$\\lvert A\\rvert \\leq \\frac{N}{2}+O(1)?$$\n\nIn fact this problem is false. Freud [Fr93] constructed a sequence with density $\\geq 19/36$.\nThe current best bounds are due to Coppersmith and Phillips [CoPh96], who prove that the\nmaximal size of such an $A$ satisfies\n$$\\frac{13}{24}N -O(1)\\leq \\lvert A\\rvert \\leq \\left(\\frac{2}{3}-\\frac{1}{512}\\right)N+\\log N.$$",
  "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": "Erdos867.erdos_867",
  "statement_lean": "theorem erdos_867 :\n    ¬ ∃ C : ℝ, ∀ N : ℕ, ∀ A ⊆ Finset.Icc 1 N, ConsecutiveSumFree A →\n      (A.card : ℝ) ≤ (N : ℝ) / 2 + C",
  "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 867\n\n*References:*\n- [erdosproblems.com/867](https://www.erdosproblems.com/867)\n- [CoPh96] Coppersmith, Don and Phillips, Steven, *On a question of Erdős on subsequence sums*.\n  SIAM J. Discrete Math. (1996), 173-177.\n- [Fr93] Freud, R., *Adding numbers - on a problem of P. Erdős*. James Cook Mathematical\n  Notes (1993), 6199-6202.\n-/\n\n@[expose] public section\n\nopen Filter\n\nnamespace Erdos867\n\n/-- A finite set of naturals $A=\\{a_1<\\cdots<a_t\\}$ is *consecutive-sum-free* if it has no\nsolutions to $a_i+a_{i+1}+\\cdots+a_j\\in A$ with $i<j$; equivalently, whenever an interval\n$[m,n]$ contains at least two elements of $A$, the sum of the elements of $A$ lying in\n$[m,n]$ is not itself an element of $A$. -/\ndef ConsecutiveSumFree (A : Finset ℕ) : Prop :=\n  ∀ m n : ℕ, 2 ≤ (Finset.Icc m n ∩ A).card → (∑ a ∈ Finset.Icc m n ∩ A, a) ∉ A\n\nset_option linter.style.formal_proof_palomar false in\n/--\nIs it true that if $A=\\{a_1<\\cdots <a_t\\}\\subseteq \\{1,\\ldots,N\\}$ has no solutions to\n$$a_i+a_{i+1}+\\cdots+a_j\\in A$$\nthen\n$$\\lvert A\\rvert \\leq \\frac{N}{2}+O(1)?$$\n\nIn fact this problem is false. Freud [Fr93] constructed a sequence with density $\\geq 19/36$.\nThe current best bounds are due to Coppersmith and Phillips [CoPh96], who prove that the\nmaximal size of such an $A$ satisfies\n$$\\frac{13}{24}N -O(1)\\leq \\lvert A\\rvert \\leq \\left(\\frac{2}{3}-\\frac{1}{512}\\right)N+\\log N.$$\n-/\n@[category research solved, question, AMS 5 11, formal_proof using lean4 at \"https://github.com/plby/lean-proofs/blob/main/src/v4.29.1/ErdosProblems/Erdos867.lean\"]\ntheorem erdos_867 :\n    ¬ ∃ C : ℝ, ∀ N : ℕ, ∀ A ⊆ Finset.Icc 1 N, ConsecutiveSumFree A →\n      (A.card : ℝ) ≤ (N : ℝ) / 2 + C := by\n  sorry\n\n/--\nTaking $A=(N/2,N]\\cap \\mathbb{N}$ shows $\\lvert A\\rvert \\geq N/2-O(1)$ is possible.\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_867.variants.lower_bound :\n    ∃ C : ℝ, ∀ N : ℕ, ∃ A ⊆ Finset.Icc 1 N, ConsecutiveSumFree A ∧\n      ((N : ℝ) / 2 - C ≤ (A.card : ℝ)) := by\n  -- Take `A = (N/2, N]`: any two of its elements already sum to more than `N`.\n  refine ⟨0, fun N => ⟨Finset.Icc (N / 2 + 1) N, ?_, ?_, ?_⟩⟩\n  · intro x hx\n    simp only [Finset.mem_Icc] at hx ⊢\n    omega\n  · intro m n hcard hmem\n    set T := Finset.Icc m n ∩ Finset.Icc (N / 2 + 1) N with hT\n    have hlow : ∀ x ∈ T, N / 2 + 1 ≤ x := by\n      intro x hx\n      simp only [hT, Finset.mem_inter, Finset.mem_Icc] at hx\n      omega\n    have hsum : T.card * (N / 2 + 1) ≤ ∑ a ∈ T, a := by\n      simpa [mul_comm] using Finset.card_nsmul_le_sum T _ _ hlow\n    have h2 : 2 * (N / 2 + 1) ≤ ∑ a ∈ T, a :=\n      le_trans (Nat.mul_le_mul_right _ hcard) hsum\n    simp only [Finset.mem_Icc] at hmem\n    omega\n  · rw [Nat.card_Icc, sub_zero]\n    have h2 : N + 1 - (N / 2 + 1) = N - N / 2 := by omega\n    rw [h2]\n    have h3 : N ≤ 2 * (N - N / 2) := by omega\n    have h4 : (N : ℝ) ≤ ((2 * (N - N / 2) : ℕ) : ℝ) := by exact_mod_cast h3\n    push_cast at h4\n    linarith\n\nset_option linter.style.formal_proof_palomar false in\n/--\nAdenwalla has observed that\n$$\\lvert A\\rvert \\leq (\\tfrac{2}{3}+o(1))N.$$\n-/\n@[category research solved, AMS 5 11, formal_proof using lean4 at \"https://github.com/anatoliiohorodnyk/lean-fc-proofs/blob/5da9642575b26c2c816a49bcb56b33fed5456619/Proofs/T_Erdos867_erdos_867_variants_adenwalla.lean#L262\"]\ntheorem erdos_867.variants.adenwalla (ε : ℝ) (hε : 0 < ε) :\n    ∀ᶠ N : ℕ in atTop, ∀ A ⊆ Finset.Icc 1 N, ConsecutiveSumFree A →\n      (A.card : ℝ) ≤ (2 / 3 + ε) * (N : ℝ) := by\n  sorry\n\n/--\nFreud [Fr93] constructed a sequence with density $\\geq 19/36$.\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_867.variants.freud :\n    ∀ ε : ℝ, 0 < ε → ∀ᶠ N : ℕ in atTop, ∃ A ⊆ Finset.Icc 1 N, ConsecutiveSumFree A ∧\n      (((19 / 36 : ℝ) - ε) * (N : ℝ) ≤ (A.card : ℝ)) := by\n  sorry\n\n/--\nThe current best bounds are due to Coppersmith and Phillips [CoPh96], who prove that the\nmaximal size of such an $A$ satisfies\n$$\\frac{13}{24}N -O(1)\\leq \\lvert A\\rvert.$$\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_867.variants.coppersmith_phillips_lower_bound :\n    ∃ C : ℝ, ∀ N : ℕ, ∃ A ⊆ Finset.Icc 1 N, ConsecutiveSumFree A ∧\n      ((13 / 24 : ℝ) * (N : ℝ) - C ≤ (A.card : ℝ)) := by\n  sorry\n\n/--\nThe current best bounds are due to Coppersmith and Phillips [CoPh96], who prove that the\nmaximal size of such an $A$ satisfies\n$$\\lvert A\\rvert \\leq \\left(\\frac{2}{3}-\\frac{1}{512}\\right)N+\\log N.$$\n-/\n@[category research solved, AMS 5 11]\ntheorem erdos_867.variants.coppersmith_phillips_upper_bound :\n    ∀ᶠ N : ℕ in atTop, ∀ A ⊆ Finset.Icc 1 N, ConsecutiveSumFree A →\n      (A.card : ℝ) ≤ (2 / 3 - 1 / 512) * (N : ℝ) + Real.log (N : ℝ) := by\n  sorry\n\nend Erdos867\n",
  "statement_hash": "cd130052a4b570f3596cc11cf6c58cac9ca200365cacc6ac8f4e84cd7ac0fdc9",
  "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."
}