Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Erdős Problem 785

Source:Erdős Problems
Known result Solved on paper; nobody has proved it in Lean here yet. First verified proof: +10 points.
Statement:reviewed
Statement:

Let A,B⊆NA,B\subseteq \mathbb{N} be infinite sets of positive integers such that A+BA+B contains all large integers. Let A(x)=∣A∩[1,x]∣A(x)=\lvert A\cap [1,x]\rvert and similarly for B(x)B(x). Is it true that if A(x)B(x)∼xA(x)B(x)\sim x then A(x)B(x)−x→∞A(x)B(x)-x\to \infty as x→∞x\to \infty?

A conjecture of Erdős and Danzer. The answer is yes, proved by Sárközy and Szemerédi [SaSz94], who actually proved that it is impossible for A(x)B(x)−x=o(A(x)).A(x)B(x)-x=o(A(x)).

This was formalized in Lean by van Doorn using Aristotle.

Subjects:Number Theory (math.NT)
MSC classes:11
Tags:question, formal_proof
Cite as:NS.03180 [math.NT] · NS.03180v1 for this version
Declaration:Erdos785.erdos_785
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:1585e134676713ada82c98ca9178bdf30b1a1c7cd06c93c4875c52bde5165bca
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/ErdosProblems/785.lean

Formal statement

theorem erdos_785 :
    ∀ A B : Set ℕ, A.Infinite → B.Infinite → 0 ∉ A → 0 ∉ B → IsExactAdditiveComplement A B →
      Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) atTop atTop
Show the full Challenge.lean (205 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Erdős Problem 785

*References:*
- [erdosproblems.com/785](https://www.erdosproblems.com/785)
- [ChFa10] Fang, Jin-Hui and Chen, Yong-Gao, *On additive complements*. Proc. Amer. Math. Soc.
  (2010), 1923-1927.
- [ChFa11] Chen, Yong-Gao and Fang, Jin-Hui, *On additive complements. II*. Proc. Amer. Math. Soc.
  (2011), 881-883.
- [ChFa14] Fang, Jin-Hui and Chen, Yong-Gao, *On additive complements. III*. J. Number Theory
  (2014), 83-91.
- [ChFa15] Chen, Yong-Gao and Fang, Jin-Hui, *On a conjecture of Sárközy and Szemerédi*.
  Acta Arith. (2015), 47-58.
- [Da64] Danzer, L., *Über eine Frage von G. Hanani aus der additiven Zahlentheorie*.
  J. Reine Angew. Math. (1964), 392-394.
- [Er57] Erdős, Paul, *Some unsolved problems*. Michigan Math. J. (1957), 291-300.
- [Er61] Erdős, Paul, *Some unsolved problems*. Magyar Tud. Akad. Mat. Kutató Int. Közl. (1961),
  221-254.
- [Na59] Narkiewicz, Władysław, *Remarks on a conjecture of Hanani in additive number theory*.
  Colloq. Math. (1959/60), 161-165.
- [Ru17] Ruzsa, Imre Z., *Exact additive complements*. Q. J. Math. (2017), 227-235.
- [SaSz94] Sárközy, A. and Szemerédi, E., *On a problem in additive number theory*.
  Acta Math. Hungar. (1994), 237-245.
-/

@[expose] public section

open Filter Pointwise
open scoped Topology

namespace Erdos785

/-- The counting function $A(x)=\lvert A\cap [1,x]\rvert$. -/
noncomputable def counting (A : Set ℕ) (x : ℕ) : ℕ :=
  (A ∩ Set.Icc 1 x).ncard

/-- The largest element of $A$ in $[1,x]$, that is $a^*(x)=\max A\cap [1,x]$
(equal to $0$ when there is no such element). -/
noncomputable def aStar (A : Set ℕ) (x : ℕ) : ℕ :=
  sSup (A ∩ Set.Icc 1 x)

/-- Two sets $A, B\subseteq \mathbb{N}$ are *exact additive complements* if $A+B$ contains all
large integers and $A(x)B(x)\sim x$. -/
def IsExactAdditiveComplement (A B : Set ℕ) : Prop :=
  IsAdditiveComplement A B ∧
    Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) / (x : ℝ)) atTop (𝓝 1)

set_option linter.style.formal_proof_palomar false in
/--
Let $A,B\subseteq \mathbb{N}$ be infinite sets of positive integers such that $A+B$ contains all
large integers. Let $A(x)=\lvert A\cap [1,x]\rvert$ and similarly for $B(x)$. Is it true that if
$A(x)B(x)\sim x$ then
$$A(x)B(x)-x\to \infty$$
as $x\to \infty$?

A conjecture of Erdős and Danzer. The answer is yes, proved by Sárközy and Szemerédi [SaSz94],
who actually proved that it is impossible for
$$A(x)B(x)-x=o(A(x)).$$

This was formalized in Lean by van Doorn using Aristotle.
-/
@[category research solved, question, AMS 11, formal_proof using lean4 at
"https://github.com/Woett/Lean-files/blob/main/ErdosProblem785.lean"]
theorem erdos_785 :
    ∀ A B : Set ℕ, A.Infinite → B.Infinite → 0 ∉ A → 0 ∉ B → IsExactAdditiveComplement A B →
      Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) atTop atTop := by
  sorry

/--
Danzer [Da64] proved that exact additive complements exist (Hanani had earlier conjectured they
do not exist, as reported in [Er57] and [Er61]).
-/
@[category research solved, AMS 11]
theorem erdos_785.variants.danzer :
    ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ 0 ∉ A ∧ 0 ∉ B ∧ IsExactAdditiveComplement A B := by
  sorry

/--
Sárközy and Szemerédi [SaSz94, pp. 244–245] stated that the global estimate
$A(x)B(x) - x = o(\min(A(x), B(x)))$ is impossible. The stronger eventual bound stated here,
$$A(x)B(x) - x \ge c \min(A(x), B(x))$$
for some $c > 0$ and all sufficiently large $x$, follows as a later consequence of Chen and Fang
[ChFa15, Theorem 0.2] (for instance, taking $M = 2$).
-/
@[category research solved, AMS 11]
theorem erdos_785.variants.sarkozy_szemeredi (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite)
    (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B) :
    ∃ c > (0 : ℝ), ∀ᶠ x : ℕ in atTop,
      c * (min (counting A x) (counting B x) : ℝ) ≤
        (counting A x * counting B x : ℝ) - (x : ℝ) := by
  sorry

/--
Chen and Fang [ChFa15, Theorem 0.2] proved that for any $M > 1$,
$$A(x)B(x) - x \ge \min(A(x), B(x))^M$$
for all sufficiently large $x$. In particular $A(x)B(x)-x\ll A(x)^c$ cannot hold for any constant
$c>0$ when $A$ is the sparser of the two sets.
-/
@[category research solved, AMS 11]
theorem erdos_785.variants.chen_fang (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite)
    (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B) (M : ℝ) (hM : 1 < M) :
    ∀ᶠ x : ℕ in atTop,
      (min (counting A x) (counting B x) : ℝ) ^ M ≤
        (counting A x * counting B x : ℝ) - (x : ℝ) := by
  sorry

/--
Narkiewicz [Na59] proved that, under the given assumptions (and perhaps swapping $A$ and $B$)
we must have $A(2x)/A(x)\to 1$ and $B(2x)/B(x)\to 2$.
-/
@[category research solved, AMS 11]
theorem erdos_785.variants.narkiewicz (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite)
    (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B) :
    (Tendsto (fun x : ℕ => (counting A (2 * x) : ℝ) / (counting A x : ℝ)) atTop (𝓝 1) ∧
      Tendsto (fun x : ℕ => (counting B (2 * x) : ℝ) / (counting B x : ℝ)) atTop (𝓝 2)) ∨
    (Tendsto (fun x : ℕ => (counting B (2 * x) : ℝ) / (counting B x : ℝ)) atTop (𝓝 1) ∧
      Tendsto (fun x : ℕ => (counting A (2 * x) : ℝ) / (counting A x : ℝ))
        atTop (𝓝 2)) := by
  sorry

/--
Ruzsa [Ru17] has constructed, for any function $w(x)\to \infty$, such a pair of sets with
$$A(x)B(x)-x<w(x)$$
for infinitely many $x$.
-/
@[category research solved, AMS 11]
theorem erdos_785.variants.ruzsa_upper_bound (w : ℕ → ℝ) (hw : Tendsto w atTop atTop) :
    ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ 0 ∉ A ∧ 0 ∉ B ∧ IsExactAdditiveComplement A B ∧
      ∃ᶠ x : ℕ in atTop, (counting A x * counting B x : ℝ) - (x : ℝ) < w x := by
  sorry

/--
Ruzsa [Ru17, Theorem 1.2] proves that, if $a^*(x)=\max A \cap [1,x]$, $A$ and $B$ satisfy the
conditions in the problem, and $A$ is the sparser set with $A(2x)/A(x) \to 1$ (which holds after
possibly swapping the roles of $A$ and $B$ by Narkiewicz's theorem), then
$$A(x)B(x)-x > (1-o(1))\frac{a^*(x)}{A(x)}.$$
-/
@[category research solved, AMS 11]
theorem erdos_785.variants.ruzsa_lower_bound (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite)
    (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsExactAdditiveComplement A B)
    (hsmall : Tendsto (fun x : ℕ => (counting A (2 * x) : ℝ) / (counting A x : ℝ)) atTop (𝓝 1)) :
    ∀ ε > (0 : ℝ), ∀ᶠ x : ℕ in atTop,
      (1 - ε) * (aStar A x : ℝ) / (counting A x : ℝ)
        < (counting A x * counting B x : ℝ) - (x : ℝ) := by
  sorry

/--
Chen and Fang [ChFa10] proved the stronger statement that $A(x)B(x)-x\to \infty$ if $A$ and $B$
are infinite sets such that $A+B$ contains all large integers and
$$\limsup_{x\to \infty}\frac{A(x)B(x)}{x}<\frac{5}{4}.$$
They later [ChFa14] improved $5/4$ to $3-\sqrt{3}\approx 1.268$.
-/
@[category research solved, AMS 11]
theorem erdos_785.variants.chen_fang_limsup (A B : Set ℕ) (hA : A.Infinite) (hB : B.Infinite)
    (hA₀ : 0 ∉ A) (hB₀ : 0 ∉ B) (h : IsAdditiveComplement A B)
    (hlim : limsup (fun x : ℕ => ((counting A x * counting B x : ℝ) / (x : ℝ) : EReal)) atTop
      < ((3 - Real.sqrt 3 : ℝ) : EReal)) :
    Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) atTop atTop := by
  sorry

/--
Chen conjectures that this should be true with $3/2$.
-/
@[category research open, question, AMS 11]
theorem erdos_785.variants.chen_conjecture :
    ∀ A B : Set ℕ, A.Infinite → B.Infinite → 0 ∉ A → 0 ∉ B → IsAdditiveComplement A B →
      limsup (fun x : ℕ => ((counting A x * counting B x : ℝ) / (x : ℝ) : EReal)) atTop
          < ((3 / 2 : ℝ) : EReal) →
        Tendsto (fun x : ℕ => (counting A x * counting B x : ℝ) - (x : ℝ)) atTop atTop := by
  sorry

/--
This is sharp, as Chen and Fang [ChFa11] also proved that there exist such $A$ and $B$ with
$$\limsup_{x\to \infty}\frac{A(x)B(x)}{x}=\frac{3}{2}$$
for which $A(x)B(x)-x=1$ for infinitely many $x$.
-/
@[category research solved, AMS 11]
theorem erdos_785.variants.chen_fang_sharp :
    ∃ A B : Set ℕ, A.Infinite ∧ B.Infinite ∧ 0 ∉ A ∧ 0 ∉ B ∧ IsAdditiveComplement A B ∧
      limsup (fun x : ℕ => ((counting A x * counting B x : ℝ) / (x : ℝ) : EReal)) atTop
          = ((3 / 2 : ℝ) : EReal) ∧
      ∃ᶠ x : ℕ in atTop, (counting A x * counting B x : ℝ) - (x : ℝ) = 1 := by
  sorry

end Erdos785

To prove it: keep every definition of Challenge.lean unchanged and prove Erdos785.erdos_785 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_erdos_785 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry fetch erdos-785
nosorry submit erdos-785 nosorry/erdos-785/Solution.lean --wait

Formal variants

Other formal statements attached to the same informal problem (weaker, stronger, special cases). Each is scored separately.

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.