{
  "id": "3180",
  "ident": "NS.03180",
  "slug": "erdos-785",
  "title": "Erdős Problem 785",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $A,B\\subseteq \\mathbb{N}$ be infinite sets of positive integers such that $A+B$ contains all\nlarge integers. Let $A(x)=\\lvert A\\cap [1,x]\\rvert$ and similarly for $B(x)$. Is it true that if\n$A(x)B(x)\\sim x$ then\n$$A(x)B(x)-x\\to \\infty$$\nas $x\\to \\infty$?\n\nA conjecture of Erdős and Danzer. The answer is yes, proved by Sárközy and Szemerédi [SaSz94],\nwho actually proved that it is impossible for\n$$A(x)B(x)-x=o(A(x)).$$\n\nThis was formalized in Lean by van Doorn using Aristotle.",
  "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": "Erdos785.erdos_785",
  "statement_lean": "theorem erdos_785 :\n    ∀ A B : Set ℕ, A.Infinite → B.Infinite → 0 ∉ A → 0 ∉ B → IsExactAdditiveComplement A B →\n      Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) atTop atTop",
  "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 785\n\n*References:*\n- [erdosproblems.com/785](https://www.erdosproblems.com/785)\n- [ChFa10] Fang, Jin-Hui and Chen, Yong-Gao, *On additive complements*. Proc. Amer. Math. Soc.\n  (2010), 1923-1927.\n- [ChFa11] Chen, Yong-Gao and Fang, Jin-Hui, *On additive complements. II*. Proc. Amer. Math. Soc.\n  (2011), 881-883.\n- [ChFa14] Fang, Jin-Hui and Chen, Yong-Gao, *On additive complements. III*. J. Number Theory\n  (2014), 83-91.\n- [ChFa15] Chen, Yong-Gao and Fang, Jin-Hui, *On a conjecture of Sárközy and Szemerédi*.\n  Acta Arith. (2015), 47-58.\n- [Da64] Danzer, L., *Über eine Frage von G. Hanani aus der additiven Zahlentheorie*.\n  J. Reine Angew. Math. (1964), 392-394.\n- [Er57] Erdős, Paul, *Some unsolved problems*. Michigan Math. J. (1957), 291-300.\n- [Er61] Erdős, Paul, *Some unsolved problems*. Magyar Tud. Akad. Mat. Kutató Int. Közl. (1961),\n  221-254.\n- [Na59] Narkiewicz, Władysław, *Remarks on a conjecture of Hanani in additive number theory*.\n  Colloq. Math. (1959/60), 161-165.\n- [Ru17] Ruzsa, Imre Z., *Exact additive complements*. Q. J. Math. (2017), 227-235.\n- [SaSz94] Sárközy, A. and Szemerédi, E., *On a problem in additive number theory*.\n  Acta Math. Hungar. (1994), 237-245.\n-/\n\n@[expose] public section\n\nopen Filter Pointwise\nopen scoped Topology\n\nnamespace Erdos785\n\n/-- The counting function $A(x)=\\lvert A\\cap [1,x]\\rvert$. -/\nnoncomputable def counting (A : Set ℕ) (x : ℕ) : ℕ :=\n  (A ∩ Set.Icc 1 x).ncard\n\n/-- The largest element of $A$ in $[1,x]$, that is $a^*(x)=\\max A\\cap [1,x]$\n(equal to $0$ when there is no such element). -/\nnoncomputable def aStar (A : Set ℕ) (x : ℕ) : ℕ :=\n  sSup (A ∩ Set.Icc 1 x)\n\n/-- Two sets $A, B\\subseteq \\mathbb{N}$ are *exact additive complements* if $A+B$ contains all\nlarge integers and $A(x)B(x)\\sim x$. -/\ndef IsExactAdditiveComplement (A B : Set ℕ) : Prop :=\n  IsAdditiveComplement A B ∧\n    Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) / (x : ℝ)) atTop (𝓝 1)\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $A,B\\subseteq \\mathbb{N}$ be infinite sets of positive integers such that $A+B$ contains all\nlarge integers. Let $A(x)=\\lvert A\\cap [1,x]\\rvert$ and similarly for $B(x)$. Is it true that if\n$A(x)B(x)\\sim x$ then\n$$A(x)B(x)-x\\to \\infty$$\nas $x\\to \\infty$?\n\nA conjecture of Erdős and Danzer. The answer is yes, proved by Sárközy and Szemerédi [SaSz94],\nwho actually proved that it is impossible for\n$$A(x)B(x)-x=o(A(x)).$$\n\nThis was formalized in Lean by van Doorn using Aristotle.\n-/\n@[category research solved, question, AMS 11, formal_proof using lean4 at\n\"https://github.com/Woett/Lean-files/blob/main/ErdosProblem785.lean\"]\ntheorem erdos_785 :\n    ∀ A B : Set ℕ, A.Infinite → B.Infinite → 0 ∉ A → 0 ∉ B → IsExactAdditiveComplement A B →\n      Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) atTop atTop := by\n  sorry\n\n/--\nDanzer [Da64] proved that exact additive complements exist (Hanani had earlier conjectured they\ndo not exist, as reported in [Er57] and [Er61]).\n-/\n@[category research solved, AMS 11]\ntheorem erdos_785.variants.danzer :\n    ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ 0 ∉ A ∧ 0 ∉ B ∧ IsExactAdditiveComplement A B := by\n  sorry\n\n/--\nSárközy and Szemerédi [SaSz94, pp. 244–245] stated that the global estimate\n$A(x)B(x) - x = o(\\min(A(x), B(x)))$ is impossible. The stronger eventual bound stated here,\n$$A(x)B(x) - x \\ge c \\min(A(x), B(x))$$\nfor some $c > 0$ and all sufficiently large $x$, follows as a later consequence of Chen and Fang\n[ChFa15, Theorem 0.2] (for instance, taking $M = 2$).\n-/\n@[category research solved, AMS 11]\ntheorem erdos_785.variants.sarkozy_szemeredi (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite)\n    (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B) :\n    ∃ c > (0 : ℝ), ∀ᶠ x : ℕ in atTop,\n      c * (min (counting A x) (counting B x) : ℝ) ≤\n        (counting A x * counting B x : ℝ) - (x : ℝ) := by\n  sorry\n\n/--\nChen and Fang [ChFa15, Theorem 0.2] proved that for any $M > 1$,\n$$A(x)B(x) - x \\ge \\min(A(x), B(x))^M$$\nfor all sufficiently large $x$. In particular $A(x)B(x)-x\\ll A(x)^c$ cannot hold for any constant\n$c>0$ when $A$ is the sparser of the two sets.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_785.variants.chen_fang (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite)\n    (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B) (M : ℝ) (hM : 1 < M) :\n    ∀ᶠ x : ℕ in atTop,\n      (min (counting A x) (counting B x) : ℝ) ^ M ≤\n        (counting A x * counting B x : ℝ) - (x : ℝ) := by\n  sorry\n\n/--\nNarkiewicz [Na59] proved that, under the given assumptions (and perhaps swapping $A$ and $B$)\nwe must have $A(2x)/A(x)\\to 1$ and $B(2x)/B(x)\\to 2$.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_785.variants.narkiewicz (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite)\n    (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B) :\n    (Tendsto (fun x : ℕ => (counting A (2 * x) : ℝ) / (counting A x : ℝ)) atTop (𝓝 1) ∧\n      Tendsto (fun x : ℕ => (counting B (2 * x) : ℝ) / (counting B x : ℝ)) atTop (𝓝 2)) ∨\n    (Tendsto (fun x : ℕ => (counting B (2 * x) : ℝ) / (counting B x : ℝ)) atTop (𝓝 1) ∧\n      Tendsto (fun x : ℕ => (counting A (2 * x) : ℝ) / (counting A x : ℝ))\n        atTop (𝓝 2)) := by\n  sorry\n\n/--\nRuzsa [Ru17] has constructed, for any function $w(x)\\to \\infty$, such a pair of sets with\n$$A(x)B(x)-x<w(x)$$\nfor infinitely many $x$.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_785.variants.ruzsa_upper_bound (w : ℕ → ℝ) (hw : Tendsto w atTop atTop) :\n    ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ 0 ∉ A ∧ 0 ∉ B ∧ IsExactAdditiveComplement A B ∧\n      ∃ᶠ x : ℕ in atTop, (counting A x * counting B x : ℝ) - (x : ℝ) < w x := by\n  sorry\n\n/--\nRuzsa [Ru17, Theorem 1.2] proves that, if $a^*(x)=\\max A \\cap [1,x]$, $A$ and $B$ satisfy the\nconditions in the problem, and $A$ is the sparser set with $A(2x)/A(x) \\to 1$ (which holds after\npossibly swapping the roles of $A$ and $B$ by Narkiewicz's theorem), then\n$$A(x)B(x)-x > (1-o(1))\\frac{a^*(x)}{A(x)}.$$\n-/\n@[category research solved, AMS 11]\ntheorem erdos_785.variants.ruzsa_lower_bound (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite)\n    (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B)\n    (hsmall : Tendsto (fun x : ℕ => (counting A (2 * x) : ℝ) / (counting A x : ℝ)) atTop (𝓝 1)) :\n    ∀ ε > (0 : ℝ), ∀ᶠ x : ℕ in atTop,\n      (1 - ε) * (aStar A x : ℝ) / (counting A x : ℝ)\n        < (counting A x * counting B x : ℝ) - (x : ℝ) := by\n  sorry\n\n/--\nChen and Fang [ChFa10] proved the stronger statement that $A(x)B(x)-x\\to \\infty$ if $A$ and $B$\nare infinite sets such that $A+B$ contains all large integers and\n$$\\limsup_{x\\to \\infty}\\frac{A(x)B(x)}{x}<\\frac{5}{4}.$$\nThey later [ChFa14] improved $5/4$ to $3-\\sqrt{3}\\approx 1.268$.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_785.variants.chen_fang_limsup (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite)\n    (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsAdditiveComplement A B)\n    (hlim : limsup (fun x : ℕ => ((counting A x * counting B x : ℝ) / (x : ℝ) : EReal)) atTop\n      < ((3 - Real.sqrt 3 : ℝ) : EReal)) :\n    Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) atTop atTop := by\n  sorry\n\n/--\nChen conjectures that this should be true with $3/2$.\n-/\n@[category research open, question, AMS 11]\ntheorem erdos_785.variants.chen_conjecture :\n    ∀ A B : Set ℕ, A.Infinite → B.Infinite → 0 ∉ A → 0 ∉ B → IsAdditiveComplement A B →\n      limsup (fun x : ℕ => ((counting A x * counting B x : ℝ) / (x : ℝ) : EReal)) atTop\n          < ((3 / 2 : ℝ) : EReal) →\n        Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) atTop atTop := by\n  sorry\n\n/--\nThis is sharp, as Chen and Fang [ChFa11] also proved that there exist such $A$ and $B$ with\n$$\\limsup_{x\\to \\infty}\\frac{A(x)B(x)}{x}=\\frac{3}{2}$$\nfor which $A(x)B(x)-x=1$ for infinitely many $x$.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_785.variants.chen_fang_sharp :\n    ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ 0 ∉ A ∧ 0 ∉ B ∧ IsAdditiveComplement A B ∧\n      limsup (fun x : ℕ => ((counting A x * counting B x : ℝ) / (x : ℝ) : EReal)) atTop\n          = ((3 / 2 : ℝ) : EReal) ∧\n      ∃ᶠ x : ℕ in atTop, (counting A x * counting B x : ℝ) - (x : ℝ) = 1 := by\n  sorry\n\nend Erdos785\n",
  "statement_hash": "1585e134676713ada82c98ca9178bdf30b1a1c7cd06c93c4875c52bde5165bca",
  "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."
}