{
  "id": "1463",
  "ident": "NS.01463",
  "slug": "erdos-254",
  "title": "Erdős Problem 254",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $A\\subseteq \\mathbb{N}$ be such that $\\lvert A\\cap [1,2x]\\rvert -\\lvert A\\cap [1,x]\\rvert \\to\n\\infty\\textrm{ as }x\\to \\infty$ and $\\sum_{n\\in A} \\{ \\theta n\\}=\\infty$ for every $\\theta\\in\n(0,1)$, where $\\{x\\}$ is the distance of $x$ from the nearest integer. Then every sufficiently large\ninteger is the sum of distinct elements of $A$.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos254.erdos_254",
  "statement_lean": "theorem erdos_254 :\n    ∀ (A : Set ℕ),\n      (Tendsto (fun x : ℕ ↦ (A ∩ Icc 1 (2 * x)).ncard - (A ∩ Icc 1 x).ncard) atTop atTop) ∧\n      (∀ θ : ℝ, 0 < θ → θ < 1 → ¬ Summable (fun n : A ↦ distToNearestInt (θ * (n : ℝ)))) →\n        ∀ᶠ m in atTop, IsSumOfDistinct A m",
  "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 254\n\n*References:*\n- [erdosproblems.com/254](https://www.erdosproblems.com/254)\n- [Ca60] Cassels, J. W. S., On the representation of integers as the sums of distinct summands taken\n  from a fixed set. Acta Sci. Math. (Szeged) (1960), 111-124.\n-/\n\n@[expose] public section\n\nopen Filter Set\n\nnamespace Erdos254\n\n/--\nAn integer `n` can be written as a sum of distinct elements of `A`.\n-/\ndef IsSumOfDistinct (A : Set ℕ) (n : ℕ) : Prop :=\n  ∃ S : Finset ℕ, (S : Set ℕ) ⊆ A ∧ S.sum (fun x ↦ x) = n\n\n/-- The hypothesis `¬ Summable (fun n : A ↦ distToNearestInt (θ * n))` used below says exactly\nthat the partial sums of `‖θ n‖` over `n ∈ A` diverge, which is the form the linked proof uses.\n`distToNearestInt` is nonnegative, so this is an instance of\n`not_summable_subtype_iff_tendsto_sum_indicator`. -/\n@[category API, AMS 11]\ntheorem not_summable_iff_tendsto_partial_sums (A : Set ℕ) (θ : ℝ) :\n    ¬ Summable (fun n : A ↦ distToNearestInt (θ * (n : ℝ))) ↔\n      Tendsto (fun N : ℕ =>\n          ∑ n ∈ Finset.range N, A.indicator (fun n => distToNearestInt (θ * (n : ℝ))) n)\n        atTop atTop :=\n  not_summable_subtype_iff_tendsto_sum_indicator\n    (f := fun m : ℕ => distToNearestInt (θ * (m : ℝ))) fun _ => distToNearestInt_nonneg _\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $A\\subseteq \\mathbb{N}$ be such that $\\lvert A\\cap [1,2x]\\rvert -\\lvert A\\cap [1,x]\\rvert \\to\n\\infty\\textrm{ as }x\\to \\infty$ and $\\sum_{n\\in A} \\{ \\theta n\\}=\\infty$ for every $\\theta\\in\n(0,1)$, where $\\{x\\}$ is the distance of $x$ from the nearest integer. Then every sufficiently large\ninteger is the sum of distinct elements of $A$.\n-/\n@[category research solved, AMS 11, formal_proof using lean4 at \"https://github.com/williamjblair/lean-proofs/blob/4f915a323443bfb1709a6805a013812016dca88a/starfleet/erdos-254/Research/Basic.lean\"]\ntheorem erdos_254 :\n    ∀ (A : Set ℕ),\n      (Tendsto (fun x : ℕ ↦ (A ∩ Icc 1 (2 * x)).ncard - (A ∩ Icc 1 x).ncard) atTop atTop) ∧\n      (∀ θ : ℝ, 0 < θ → θ < 1 → ¬ Summable (fun n : A ↦ distToNearestInt (θ * (n : ℝ)))) →\n        ∀ᶠ m in atTop, IsSumOfDistinct A m := by\n  sorry\n\n/--\nCassels [Ca60] proved this under the alternative hypotheses $\\lim \\frac{\\lvert A\\cap [1,2x]\\rvert\n-\\lvert A\\cap [1,x]\\rvert}{\\log\\log x}=\\infty$ and $\\sum_{n\\in A} \\{ \\theta n\\}^2=\\infty$ for every\n$\\theta\\in (0,1)$.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_254.variants.cassels :\n    ∀ (A : Set ℕ),\n      (Tendsto (fun x : ℕ ↦ (((A ∩ Icc 1 (2 * x)).ncard : ℝ) -\n        ((A ∩ Icc 1 x).ncard : ℝ)) / Real.log (Real.log x)) atTop atTop) ∧\n      (∀ θ : ℝ, 0 < θ → θ < 1 → ¬ Summable (fun n : A ↦ (distToNearestInt (θ * (n : ℝ)))^2)) →\n        ∀ᶠ m in atTop, IsSumOfDistinct A m := by\n  sorry\n\nend Erdos254\n",
  "statement_hash": "a3899e51dd0e9755812f451c08e06fdb64001839c2bc0c9ff8ebdb03d6f36650",
  "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."
}