/- Copyright 2025 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 import FormalConjectures.ErdosProblems.«28»

Erdős Problem 40

Reference: erdosproblems.com/40

open AdditiveCombinatorics Filter Real Setopen scoped Pointwisenamespace Erdos40

The predicate for a function $g\colon\mathbb{N} → \mathbb{R})$ that $$\lvert A\cap {1,\ldots,N}\rvert \gg \frac{N^{1/2}}{g(N)}$$ implies $\limsup 1_A\ast 1_A(n)=\infty$.

def Erdos40For (g : ℕ → ℝ) : Prop := ∀ A : Set ℕ, (fun N : ℕ ↦ √N / g N) =O[atTop] (fun N ↦ ((A ∩ .Icc 1 N).ncard : ℝ)) → limsup (fun N ↦ (sumRep A N : ℕ∞)) atTop = ⊤

Given a set of functions $\mathbb{N} → \mathbb{R})$, we assert that for all $g$ in that set, if $g(N) → \infty$ then $$\lvert A\cap {1,\ldots,N}\rvert \gg \frac{N^{1/2}}{g(N)}$$ implies $\limsup 1_A\ast 1_A(n)=\infty$.

def Erdos40ForSet (G : Set (ℕ → ℝ)) : Prop := ∀ g ∈ G, Tendsto g atTop atTop → Erdos40For g

For what functions $g(N) → \infty$ is it true that $$\lvert A\cap {1,\ldots,N}\rvert \gg \frac{N^{1/2}}{g(N)}$$ implies $\limsup 1_A\ast 1_A(n)=\infty$?

Asked here in decision form: is there any such $g$ at all? Establishing the implication for even one $g(N) → \infty$ already answers Erdős Problem 28 positively, because a basis of order $2$ satisfies $\lvert A\cap {1,\ldots,N}\rvert \gg N^{1/2}$.

@[category research open, AMS 11] theorem erdos_40 : answer(sorry) ↔ ∃ g : ℕ → ℝ, Tendsto g atTop atTop ∧ Erdos40For g := ⊢ True ↔ ∃ g, Tendsto g atTop atTop ∧ Erdos40For g All goals completed! 🐙

If we don't pose additional conditions on the functions, then this is a stronger form of the Erdős-Turán conjecture, see Erdõs Problem 28, (since establishing this for any function $g(N) → \infty$ would imply a positive solution to Erdős Problem 28).

h_erdos_40:∀ (g : ℕ → ℝ), Tendsto g atTop atTop → ∀ (A : Set ℕ), ((fun N ↦ √↑N / g N) =O[atTop] fun N ↦ ↑(A ∩ Icc 1 N).ncard) → limsup (fun N ↦ ↑(∑ p ∈ Finset.HasAntidiagonal.antidiagonal N, A.indicator (fun x ↦ 1) p.1 * A.indicator (fun x ↦ 1) p.2)) atTop = ⊤A:Set ℕhA:(A + A)ᶜ.Finiten:ℕhn:∀ i ∈ (A + A)ᶜ, i ≤ nm:ℕhm:n + 1 ≤ mthis✝:0 < mh_empty:¬Nonempty ↑(A ∩ Icc 1 m)this:m ∈ (A + A)ᶜ⊢ False h_erdos_40:∀ (g : ℕ → ℝ), Tendsto g atTop atTop → ∀ (A : Set ℕ), ((fun N ↦ √↑N / g N) =O[atTop] fun N ↦ ↑(A ∩ Icc 1 N).ncard) → limsup (fun N ↦ ↑(∑ p ∈ Finset.HasAntidiagonal.antidiagonal N, A.indicator (fun x ↦ 1) p.1 * A.indicator (fun x ↦ 1) p.2)) atTop = ⊤A:Set ℕhA:(A + A)ᶜ.Finiten:ℕhn:∀ i ∈ (A + A)ᶜ, i ≤ nm:ℕhm:n + 1 ≤ mthis✝¹:0 < mh_empty:¬Nonempty ↑(A ∩ Icc 1 m)this✝:m ∈ (A + A)ᶜthis:m ≤ n⊢ False All goals completed! 🐙 h_erdos_40:∀ (g : ℕ → ℝ), Tendsto g atTop atTop → ∀ (A : Set ℕ), ((fun N ↦ √↑N / g N) =O[atTop] fun N ↦ ↑(A ∩ Icc 1 N).ncard) → limsup (fun N ↦ ↑(∑ p ∈ Finset.HasAntidiagonal.antidiagonal N, A.indicator (fun x ↦ 1) p.1 * A.indicator (fun x ↦ 1) p.2)) atTop = ⊤A:Set ℕhA:(A + A)ᶜ.Finiten:ℕhn:∀ i ∈ (A + A)ᶜ, i ≤ nm:ℕhm:n + 1 ≤ mthis:0 < m⊢ Finite ↑(A ∩ Icc 1 m) All goals completed! 🐙end Erdos40