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 30 · variants.elementary_difference_count

Source:Erdős Problems
Textbook result A standard result, good for practice. First verified proof: +3 points.
Statement:reviewed
Elsewhere:the main problem, on aiXiv: partial progress — Not resolved on aiXiv. Latest progress: conditional in aiXiv:2611.00535 (2026-11-04). · erdosproblems.com: open (a claim recorded elsewhere, not verified on nosorry)
5 results recorded on aiXiv
  1. Lean formalization Lean 4/Mathlib formalization of upper bounds for the maximum size h(N)h(N) of a Sidon set in {0,…,N}\{0,\ldots,N\}: Lindström's h(N)≤N+N1/4+1h(N)\leq\sqrt N+N^{1/4}+1 and the Balogh–Füredi–Roy bound h(N)≤N+0.998N1/4+O(1)h(N)\leq\sqrt N+0.998N^{1/4}+O(1). The code has no sorry, but the deep combinatorial steps, including the order-of-differences counting and the BFR core bound, are declared as axioms. — aiXiv:2609.03118, 2026-03-30 · claimed by its authors; no independent check recorded on aiXiv
  2. bound A Sidon set with k≥2k\ge2 elements has diameter at least k2(11+0.945/k−0.945k)−1≥k2−1.89k3/2k^2\bigl(\frac{1}{1+0.945/\sqrt k}-\frac{0.945}{\sqrt k}\bigr)-1\ge k^2-1.89k^{3/2}, so a Sidon set in [1,N][1,N] has at most N1/2+0.945N1/4+0.447N^{1/2}+0.945N^{1/4}+0.447 elements. For k≥483k\ge483 the diameter is at least k2−1.88607k3/2k^2-1.88607k^{3/2}. — aiXiv:2610.02850, 2026-10-26 · claimed by its authors; no independent check recorded on aiXiv
  3. conditional If the factorial moments of window counts of random dilates of Singer perfect difference sets converge to the Poisson moments for every fixed order and window constant, then h(N)−N1/2h(N)-N^{1/2} is unbounded, where h(N)h(N) is the maximal size of a Sidon set in {1,…,N}\{1,\dots,N\}. The author notes this reduction is regarded as folklore. — aiXiv:2611.00535, 2026-11-04 · claimed by its authors; no independent check recorded on aiXiv
  4. theorem For a Singer set SS (∣S∣=q+1|S|=q+1, m=q2+q+1m=q^2+q+1) and ratio ρ\rho, the number N(ρ)N(\rho) of triples with c−a=ρ(b−a)c-a=\rho(b-a) equals the point count over Fq\mathbb F_q of a twisted form of a qq-independent curve, giving N(ρ)/E−1=O(q−1/2)N(\rho)/E-1=O(q^{-1/2}) for 17 certified orbits. Moreover 3k∣N(ρ)3k\mid N(\rho) for q=pkq=p^k, and for q=r3q=r^3 the S3S_3-orbit of r+1/rr+1/r gives N(ρ)=r(q+1−e)N(\rho)=r(q+1-e), e∈{0,1}e\in\{0,1\}. — aiXiv:2611.00535, 2026-11-04 · claimed by its authors; no independent check recorded on aiXiv
  5. theorem For prime q≥5q\ge5, ∑μ∣S∩(λS+μ)∣3=P(λ)−(q−2)2\sum_\mu|S\cap(\lambda S+\mu)|^3=P(\lambda)-(q-2)^2, with P(2)=P(−1)=(q−2)2P(2)=P(-1)=(q-2)^2, P(3)=(q−2)(2q−1)P(3)=(q-2)(2q-1) for q≡2(mod3)q\equiv2\pmod 3, and P(−2)=(q−2)(2q−1)+bqP(-2)=(q-2)(2q-1)+b_q. Here bqb_q is the qq-th coefficient of the CM form η(2τ)3η(6τ)3\eta(2\tau)^3\eta(6\tau)^3 (bq=4x2−2qb_q=4x^2-2q for q=x2+3y2q=x^2+3y^2). — aiXiv:2611.00535, 2026-11-04 · claimed by its authors; no independent check recorded on aiXiv

From aixiv.online, an open archive of AI-assisted research, synced daily. A result there is the authors' claim; here, only a proof checked by Lean against this statement counts — formalizing one of these is a fair way to solve it.

Statement:

The counting argument of Erdős and Turán [ErTu41]: a Sidon set A⊆{0,…,N}A \subseteq \{0, \dots, N\} has ∣A∣(∣A∣−1)≤2N|A|(|A| - 1) \le 2N, because the ∣A∣(∣A∣−1)/2|A|(|A|-1)/2 positive differences of AA are distinct and lie in {1,…,N}\{1, \dots, N\}.

Subjects:Number Theory (math.NT)
MSC classes:11
Cite as:NS.01612 [math.NT] · NS.01612v1 for this version
Declaration:Erdos30.erdos_30.variants.elementary_difference_count
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 3, later ones: 1; accepted critique: up to 60
Statement hash:d42ca7b6a2ad35089c80647059f55832a9e9e185eaab7079ed0c7f170fff0c24
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/ErdosProblems/30.lean

Formal statement

theorem erdos_30.variants.elementary_difference_count (A : Finset ℕ) (N : ℕ)
    (hS : IsSidon (A : Set ℕ)) (hA : A ⊆ Finset.range (N + 1)) :
    A.card * (A.card - 1) ≤ 2 * N
Show the full Challenge.lean (231 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Erdős Problem 30

*References:*
- [erdosproblems.com/30](https://www.erdosproblems.com/30)
- [ErTu41] Erdős, P. and Turán, P., *On a problem of Sidon in additive number theory, and on
  some related problems*. J. London Math. Soc. 16 (1941), 212-215.
- [Li69] Lindström, B., *An inequality for $B_2$-sequences*. J. Combinatorial Theory 6 (1969),
  211-212.
- [Si38] Singer, J., *A theorem in finite projective geometry and some applications to number
  theory*. Trans. Amer. Math. Soc. 43 (1938), 377-385.
- [BFR23] Balogh, J., Füredi, Z. and Roy, S., *An upper bound on the size of Sidon sets*.
  Amer. Math. Monthly 130 (2023), 437-445.
- [OB22] O'Bryant, K., *On the size of finite Sidon sets*.
  [arXiv:2207.07800](https://arxiv.org/abs/2207.07800) (2022).
- [CHO25] Carter, D., Hunter, Z. and O'Bryant, K., *On the diameter of finite Sidon sets*.
  Acta Math. Hungar. 175 (2025), 108-126.

See also [Ben Green's Open Problem 31](https://people.maths.ox.ac.uk/greenbj/papers/open-problems.pdf)
(formalised in `FormalConjectures/GreensOpenProblems/31.lean`).
-/

@[expose] public section

namespace Erdos30

/--
Let $h(N)$ be the maximum size of a Sidon set in $\{1, \dots, N\}$.
-/
noncomputable abbrev h (N : ℕ) : ℕ := Finset.maxSidonSubsetCard (Finset.Icc 1 N)


open Filter
open scoped Asymptotics Pointwise

/--
Is it true that, for every $\varepsilon > 0$, $h(N) = \sqrt N + O_{\varepsilon}(N^\varepsilon)$
-/
@[category research open, question, AMS 11]
theorem erdos_30 :
    ∀ᵉ (ε > 0), (fun N => h N - (N : Real).sqrt) =O[atTop] fun N => (N : ℝ)^(ε : ℝ) := by
  sorry

/--
A stronger conjecture: is it true that $h(N) = \sqrt N + O(1)$?
Erdős thought this was perhaps too optimistic.
-/
@[category research open, question, AMS 11]
theorem erdos_30.variants.O_one :
    (fun N => h N - (N : ℝ).sqrt) =O[atTop] fun _ => (1 : ℝ) := by
  sorry

/--
Erdős and Turán [ErTu41] proved $h(N) \le \sqrt N + O(N^{1/4})$.

This is an upper bound only. A statement with `=O` would also assert the lower bound
$h(N) \ge \sqrt N - O(N^{1/4})$, which is not part of this result.
-/
@[category research solved, AMS 11]
theorem erdos_30.variants.erdos_turan :
    ∃ C : ℝ, ∀ᶠ N in atTop, (h N : ℝ) ≤ (N : ℝ).sqrt + C * (N : ℝ) ^ (4⁻¹ : ℝ) := by
  sorry

/--
The proofs of Erdős–Turán [ErTu41] and Lindström [Li69] in fact give, for all $N$,
$h(N) \le N^{1/2} + N^{1/4} + 1$.
-/
@[category research solved, AMS 11]
theorem erdos_30.variants.lindstrom (N : ℕ) :
    (h N : ℝ) ≤ (N : ℝ).sqrt + (N : ℝ) ^ (4⁻¹ : ℝ) + 1 := by
  sorry

/--
Balogh, Füredi and Roy [BFR23] proved $h(N) \le N^{1/2} + 0.998 N^{1/4}$ for all sufficiently
large $N$.
-/
@[category research solved, AMS 11]
theorem erdos_30.variants.balogh_furedi_roy :
    ∀ᶠ N in atTop, (h N : ℝ) ≤ (N : ℝ).sqrt + (0.998 : ℝ) * (N : ℝ) ^ (4⁻¹ : ℝ) := by
  sorry

/--
O'Bryant [OB22] proved $h(N) \le N^{1/2} + 0.99703 N^{1/4}$ for all sufficiently large $N$.
-/
@[category research solved, AMS 11]
theorem erdos_30.variants.obryant :
    ∀ᶠ N in atTop, (h N : ℝ) ≤ (N : ℝ).sqrt + (0.99703 : ℝ) * (N : ℝ) ^ (4⁻¹ : ℝ) := by
  sorry

/--
Carter, Hunter and O'Bryant [CHO25] proved $h(N) \le N^{1/2} + 0.98183 N^{1/4} + O(1)$.
This is the current record upper bound.
-/
@[category research solved, AMS 11]
theorem erdos_30.variants.carter_hunter_obryant :
    ∃ C : ℝ, ∀ᶠ N in atTop,
      (h N : ℝ) ≤ (N : ℝ).sqrt + (0.98183 : ℝ) * (N : ℝ) ^ (4⁻¹ : ℝ) + C := by
  sorry

/--
Singer's construction [Si38] shows $h(N) \ge (1 - o(1)) N^{1/2}$ for all $N$.
-/
@[category research solved, AMS 11]
theorem erdos_30.variants.singer :
    ∀ ε > (0 : ℝ), ∀ᶠ N : ℕ in atTop, (1 - ε) * (N : ℝ).sqrt ≤ h N := by
  sorry

/--
Combining Singer's lower bound [Si38] with the Erdős–Turán upper bound [ErTu41]:
$h(N) \sim N^{1/2}$.
-/
@[category research solved, AMS 11]
theorem erdos_30.variants.isEquivalent_sqrt :
    (fun N => (h N : ℝ)) ~[atTop] fun N => (N : ℝ).sqrt := by
  sorry

/--
The counting argument of Erdős and Turán [ErTu41]: a Sidon set $A \subseteq \{0, \dots, N\}$
has $|A|(|A| - 1) \le 2N$, because the $|A|(|A|-1)/2$ positive differences of $A$ are distinct
and lie in $\{1, \dots, N\}$.
-/
@[category textbook, AMS 11]
theorem erdos_30.variants.elementary_difference_count (A : Finset ℕ) (N : ℕ)
    (hS : IsSidon (A : Set ℕ)) (hA : A ⊆ Finset.range (N + 1)) :
    A.card * (A.card - 1) ≤ 2 * N := by
  have h_inj : Set.InjOn (fun p : ℕ × ℕ ↦ p.1 - p.2)
      (({p ∈ A ×ˢ A | p.2 < p.1} : Finset (ℕ × ℕ)) : Set (ℕ × ℕ)) := by
    intro ⟨a₁, b₁⟩ h₁ ⟨a₂, b₂⟩ h₂ heq
    simp only [Finset.mem_coe, Finset.mem_filter, Finset.mem_product] at h₁ h₂
    have := Finset.IsSidon.eq_of_tsub hS h₁.1.1 h₁.1.2 h₂.1.1 h₂.1.2 h₁.2 h₂.2 heq
    exact Prod.ext this.1 this.2
  have h_sub : {p ∈ A ×ˢ A | p.2 < p.1}.image (fun p : ℕ × ℕ ↦ p.1 - p.2) ⊆ Finset.Icc 1 N := by
    simp only [Finset.image_subset_iff, Finset.mem_filter, Finset.mem_product, Finset.mem_Icc,
      and_imp, Prod.forall]
    intro a b ha _ hlt
    have := Finset.mem_range.mp (hA ha)
    lia
  have := Finset.card_le_card h_sub
  rw [Finset.card_image_of_injOn h_inj, Nat.card_Icc] at this
  have := Finset.two_mul_card_product_filter_gt A
  lia

/-- For a Sidon set $A$, $|A + A| = |A|(|A|+1)/2$: the sums $a + b$ with $a \le b$ are pairwise
distinct [ErTu41]. -/
@[category textbook, AMS 11]
theorem erdos_30.variants.distinct_sums_card (A : Finset ℕ) (hS : IsSidon (A : Set ℕ)) :
    (A + A).card = A.card * (A.card + 1) / 2 := by
  rw [Set.isSidon_iff_le] at hS
  have hAA : A + A = {p ∈ A ×ˢ A | p.1 ≤ p.2}.image (fun p ↦ p.1 + p.2) := by
    ext x
    simp only [Finset.mem_add, Finset.mem_image, Finset.mem_filter, Finset.mem_product, Prod.exists]
    constructor
    · rintro ⟨a, ha, b, hb, rfl⟩
      rcases le_total a b with hab | hba
      · exact ⟨a, b, ⟨⟨ha, hb⟩, hab⟩, rfl⟩
      · exact ⟨b, a, ⟨⟨hb, ha⟩, hba⟩, add_comm b a⟩
    · rintro ⟨a, b, ⟨⟨ha, hb⟩, _⟩, rfl⟩
      exact ⟨a, ha, b, hb, rfl⟩
  have h_inj : Set.InjOn (fun p : ℕ × ℕ ↦ p.1 + p.2)
      (({p ∈ A ×ˢ A | p.1 ≤ p.2} : Finset (ℕ × ℕ)) : Set (ℕ × ℕ)) := by
    intro ⟨a₁, b₁⟩ h₁ ⟨a₂, b₂⟩ h₂ heq
    simp only [Finset.mem_coe, Finset.mem_filter, Finset.mem_product] at h₁ h₂
    have := hS a₁ h₁.1.1 b₁ h₁.1.2 a₂ h₂.1.1 b₂ h₂.1.2 h₁.2 h₂.2 heq
    exact Prod.ext this.1 this.2
  have h_split : {p ∈ A ×ˢ A | p.1 ≤ p.2} = {p ∈ A ×ˢ A | p.1 < p.2} ∪ A.diag := by
    rw [Finset.diag_eq_filter]
    simp [le_iff_lt_or_eq, Finset.filter_or]
  have h_disj : Disjoint {p ∈ A ×ˢ A | p.1 < p.2} A.diag := by
    rw [Finset.diag_eq_filter]
    exact Finset.disjoint_filter.2 fun _ _ h₁ h₂ ↦ absurd h₂ h₁.ne
  have h_tri := Finset.two_mul_card_product_filter_lt A
  have h_le : A.card ≤ A.card * A.card := Nat.le_mul_self _
  rw [Nat.mul_sub_one] at h_tri
  rw [hAA, Finset.card_image_of_injOn h_inj, h_split, Finset.card_union_of_disjoint h_disj,
    Finset.diag_card, mul_add_one]
  lia

/-- If $A \subseteq \{0, \dots, N\}$ then $A + A \subseteq \{0, \dots, 2N\}$. -/
@[category textbook, AMS 11]
theorem erdos_30.variants.distinct_sums_in_range (A : Finset ℕ) (N : ℕ)
    (hA : A ⊆ Finset.range (N + 1)) :
    A + A ⊆ Finset.range (2 * N + 1) := by
  grw [hA, Finset.range_add_range]
  simp [two_mul]

/--
The counting bound of Erdős and Turán [ErTu41] in its sum form: a Sidon set
$A \subseteq \{0, \dots, N\}$ has $|A|(|A| + 1)/2 \le 2N + 1$.
-/
@[category textbook, AMS 11]
theorem erdos_30.variants.erdos_turan_counting (A : Finset ℕ) (N : ℕ)
    (hS : IsSidon (A : Set ℕ)) (hA : A ⊆ Finset.range (N + 1)) :
    A.card * (A.card + 1) / 2 ≤ 2 * N + 1 := by
  rw [← erdos_30.variants.distinct_sums_card A hS]
  simpa using Finset.card_le_card (erdos_30.variants.distinct_sums_in_range A N hA)

/--
A weak form of Lindström's bound [Li69], following from
`erdos_30.variants.elementary_difference_count`: a Sidon set $A \subseteq \{0, \dots, N\}$
has $|A| \le \lfloor \sqrt{2N} \rfloor + 1$.
-/
@[category textbook, AMS 11]
theorem erdos_30.variants.lindstrom_weak (A : Finset ℕ) (N : ℕ)
    (hS : IsSidon (A : Set ℕ)) (hA : A ⊆ Finset.range (N + 1)) :
    A.card ≤ Nat.sqrt (2 * N) + 1 := by
  have h := erdos_30.variants.elementary_difference_count A N hS hA
  have : (A.card - 1) * (A.card - 1) ≤ 2 * N := (Nat.mul_le_mul_right _ (Nat.sub_le _ _)).trans h
  have := Nat.le_sqrt.mpr this
  lia

end Erdos30

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

nosorry fetch erdos-30--erdos-30-variants-elementary-difference-count
nosorry submit erdos-30--erdos-30-variants-elementary-difference-count nosorry/erdos-30--erdos-30-variants-elementary-difference-count/Solution.lean --wait

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.