/- Copyright 2026 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ import FormalConjecturesUtil

Erdős Problem 158

References:

    erdosproblems.com/158

    [ESS94] Erdős, P. and Sárközy, A. and Sós, T., On Sum Sets of Sidon Sets, I. Journal of Number Theory (1994), 329-347.

open Filter Realnamespace Erdos158

A set A ⊆ ℕ is said to be a B₂[g] set if for all n, the equation a + a' = n, a ≤ a', a, a' ∈ A has at most g solutions. This is defined in [ESS94].

def B2 (g : ) (A : Set ) : Prop := n, {x : × | x.1 + x.2 = n x.1 x.2 x.1 A x.2 A}.encard g

A set is B₂[1] iff it is Sidon.

A:Set hA:B2 1 Aa₁:ha₁:a₁ Aa₂:ha₂:a₂ Ab₁:hb₁:b₁ Ab₂:hb₂:b₂ Ah:a₁ + b₁ = a₂ + b₂h₁:a₁ b₁h₂:a₂ b₂this:(a₁, b₁) = (a₂, b₂)a₁ = a₂ b₁ = b₂ a₁ = b₂ b₁ = a₂ All goals completed! 🐙 mpr hA n := A:Set hA:IsSidon An:{x | x.1 + x.2 = n x.1 x.2 x.1 A x.2 A}.encard 1 A:Set hA:IsSidon An:x: × y: × x✝¹:x {x | x.1 + x.2 = n x.1 x.2 x.1 A x.2 A}x✝:y {x | x.1 + x.2 = n x.1 x.2 x.1 A x.2 A}h:x.1 + x.2 = np:x.1 x.2q:x.1 A x.2 Ar:y.1 + y.2 = ns:y.1 y.2t:y.1 A y.2 Ax = y A:Set hA:IsSidon An:x: × y: × x✝¹:x {x | x.1 + x.2 = n x.1 x.2 x.1 A x.2 A}x✝:y {x | x.1 + x.2 = n x.1 x.2 x.1 A x.2 A}h:x.1 + x.2 = np:x.1 x.2q:x.1 A x.2 Ar:y.1 + y.2 = ns:y.1 y.2t:y.1 A y.2 Athis:x.1 = y.1 x.2 = y.2 x.1 = y.2 x.2 = y.1x = y All goals completed! 🐙

Let A be an infinite B₂[2] set. Must liminf |A ∩ {1, ..., N}| * N ^ (- 1 / 2) = 0?

@[category research open, AMS 5] theorem erdos_158 : answer(sorry) A : Set , A.Infinite B2 2 A liminf (fun N : => (A .Iio N).ncard * (N : ) ^ (- 1 / 2 : )) atTop = 0 := True (A : Set ), A.Infinite B2 2 A liminf (fun N (A Set.Iio N).ncard * N ^ (-1 / 2)) atTop = 0 All goals completed! 🐙

Let A be an infinite Sidon set. Then liminf |A ∩ {1, ..., N}| * N ^ (- 1 / 2) * (log N) ^ (1 / 2) < ∞. This is proved in [ESS94].

@[category research solved, AMS 5] theorem erdos_158.variants.isSidon' {A : Set } (hAinf : A.Infinite) (hAsid : IsSidon A) : liminf (fun N ENNReal.ofReal ((A .Iio N).ncard * N ^ (- 1 / 2 : ) * log N ^ (1 / 2 : ))) atTop < := A:Set hAinf:A.InfinitehAsid:IsSidon Aliminf (fun N ENNReal.ofReal ((A Set.Iio N).ncard * N ^ (-1 / 2) * log N ^ (1 / 2))) atTop < All goals completed! 🐙

As a corollary of erdos_158.isSidon', we can prove that liminf |A ∩ {1, ..., N}| * N ^ (- 1 / 2) = 0 for any infinite Sidon set A.

A:Set hAinf:A.InfinitehAsid:IsSidon Ah:liminf (fun N (A Set.Iio N).ncard * N ^ (-1 / 2)) atTop 0c:hc_pos:c > 0hc:∀ᶠ (N : ) in atTop, c (A Set.Iio N).ncard * N ^ (-1 / 2)Tendsto (fun N (A Set.Iio N).ncard * N ^ (-1 / 2) * log N ^ (1 / 2)) atTop atTop A:Set hAinf:A.InfinitehAsid:IsSidon Ah:liminf (fun N (A Set.Iio N).ncard * N ^ (-1 / 2)) atTop 0c:hc_pos:c > 0hc:∀ᶠ (N : ) in atTop, c (A Set.Iio N).ncard * N ^ (-1 / 2)(fun N c * log N ^ (1 / 2)) ≤ᶠ[atTop] fun N (A Set.Iio N).ncard * N ^ (-1 / 2) * log N ^ (1 / 2)A:Set hAinf:A.InfinitehAsid:IsSidon Ah:liminf (fun N (A Set.Iio N).ncard * N ^ (-1 / 2)) atTop 0c:hc_pos:c > 0hc:∀ᶠ (N : ) in atTop, c (A Set.Iio N).ncard * N ^ (-1 / 2)Tendsto (fun N c * log N ^ (1 / 2)) atTop atTop A:Set hAinf:A.InfinitehAsid:IsSidon Ah:liminf (fun N (A Set.Iio N).ncard * N ^ (-1 / 2)) atTop 0c:hc_pos:c > 0hc:∀ᶠ (N : ) in atTop, c (A Set.Iio N).ncard * N ^ (-1 / 2)(fun N c * log N ^ (1 / 2)) ≤ᶠ[atTop] fun N (A Set.Iio N).ncard * N ^ (-1 / 2) * log N ^ (1 / 2) filter_upwards [hc] with n A:Set hAinf:A.InfinitehAsid:IsSidon Ah:liminf (fun N (A Set.Iio N).ncard * N ^ (-1 / 2)) atTop 0c:hc_pos:c > 0hc:∀ᶠ (N : ) in atTop, c (A Set.Iio N).ncard * N ^ (-1 / 2)n:hn:c (A Set.Iio n).ncard * n ^ (-1 / 2)c * log n ^ (1 / 2) (A Set.Iio n).ncard * n ^ (-1 / 2) * log n ^ (1 / 2) grw [A:Set hAinf:A.InfinitehAsid:IsSidon Ah:liminf (fun N (A Set.Iio N).ncard * N ^ (-1 / 2)) atTop 0c:hc_pos:c > 0hc:∀ᶠ (N : ) in atTop, c (A Set.Iio N).ncard * N ^ (-1 / 2)n:hn:c (A Set.Iio n).ncard * n ^ (-1 / 2)(A Set.Iio n).ncard * n ^ (-1 / 2) * log n ^ (1 / 2) (A Set.Iio n).ncard * n ^ (-1 / 2) * log n ^ (1 / 2)All goals completed! 🐙 A:Set hAinf:A.InfinitehAsid:IsSidon Ah:liminf (fun N (A Set.Iio N).ncard * N ^ (-1 / 2)) atTop 0c:hc_pos:c > 0hc:∀ᶠ (N : ) in atTop, c (A Set.Iio N).ncard * N ^ (-1 / 2)Tendsto (fun N c * log N ^ (1 / 2)) atTop atTop A:Set hAinf:A.InfinitehAsid:IsSidon Ah:liminf (fun N (A Set.Iio N).ncard * N ^ (-1 / 2)) atTop 0c:hc_pos:c > 0hc:∀ᶠ (N : ) in atTop, c (A Set.Iio N).ncard * N ^ (-1 / 2)Tendsto (fun N log N ^ (1 / 2)) atTop atTop simpa [Function.comp_def] using (tendsto_rpow_atTop (A:Set hAinf:A.InfinitehAsid:IsSidon Ah:liminf (fun N (A Set.Iio N).ncard * N ^ (-1 / 2)) atTop 0c:hc_pos:c > 0hc:∀ᶠ (N : ) in atTop, c (A Set.Iio N).ncard * N ^ (-1 / 2)0 < 1 / 2 All goals completed! 🐙 : 0 < 1 / (2 : ))).comp (Real.tendsto_log_atTop.comp tendsto_natCast_atTop_atTop)end Erdos158