/- 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 Pointwise namespace 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$?

@[category research open, AMS 11] theorem declaration uses 'sorry'erdos_40 : Erdos40ForSet answer(sorry) := Erdos40ForSet sorry 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).

@[category textbook, AMS 11] theorem erdos_40.variants.implies_erdos_28 (h_erdos_40 : Erdos40ForSet .univ) : type_of% Erdos28.erdos_28 := h_erdos_40:Erdos40ForSet univ (A : Set ), (A + A).Finite limsup (fun n => (sumRep A n)) atTop = 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = (A : Set ), (A + A).Finite limsup (fun n => (sumRep A n)) atTop = intro A 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finitelimsup (fun n => (sumRep A n)) atTop = 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).FiniteTendsto ?g atTop atToph_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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finite(fun N => N / ?g N) =O[atTop] fun N => (A Icc 1 N).ncardh_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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finite 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finite 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).FiniteTendsto ?g atTop atToph_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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finite(fun N => N / ?g N) =O[atTop] fun N => (A Icc 1 N).ncard 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finite 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).FiniteTendsto ?g atTop atTop 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).FiniteTendsto (fun N => (fun x => x ^ (1 / 2)) N) atTop atTop 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finite(fun N => N / ?g N) =O[atTop] fun N => (A Icc 1 N).ncard 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i n(fun N => N / N) =O[atTop] fun N => (A Icc 1 N).ncard 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i n∀ᶠ (x : ) in atTop, x / x 1 * (A Icc 1 x).ncard 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i n a, b a, b / b 1 * (A Icc 1 b).ncard 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i n b n + 1, b / b 1 * (A Icc 1 b).ncard intro m 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1m / m 1 * (A Icc 1 m).ncard have : 0 < m := h_erdos_40:Erdos40ForSet univ (A : Set ), (A + A).Finite limsup (fun n => (sumRep A n)) atTop = 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm a1 (A Icc 1 m).ncard 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm a1 (A Icc 1 m).ncard 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm aNonempty (A Icc 1 m) Finite (A Icc 1 m) 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm aNonempty (A Icc 1 m)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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm aFinite (A Icc 1 m) 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm aNonempty (A Icc 1 m) 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)False have : m (A + A) := h_erdos_40:Erdos40ForSet univ (A : Set ), (A + A).Finite limsup (fun n => (sumRep A n)) atTop = 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)h:m A + AFalse 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)a:ha:a Ab:hb:b Ah:(fun x1 x2 => x1 + x2) a b = mFalse 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)a:ha:a Ab:hb:b Ah:(fun x1 x2 => x1 + x2) a b = mNonempty (A Icc 1 m) 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)a:ha:a Ab:hb:b Ah:(fun x1 x2 => x1 + x2) a b = mha':1 aNonempty (A Icc 1 m)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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)a:ha:a Ab:hb:b Ah:(fun x1 x2 => x1 + x2) a b = mha':¬1 aNonempty (A Icc 1 m) 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)a:ha:a Ab:hb:b Ah:(fun x1 x2 => x1 + x2) a b = mha':1 aNonempty (A Icc 1 m) refine a, ha, ha', 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)a:ha:a Ab:hb:b Ah:(fun x1 x2 => x1 + x2) a b = mha':1 aa m 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)a:ha:a Ab:hb:b Ah:(fun x1 x2 => x1 + x2) a b = mha':¬1 aNonempty (A Icc 1 m) exact b, hb, 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)a:ha:a Ab:hb:b Ah:(fun x1 x2 => x1 + x2) a b = mha':¬1 a1 b 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)a:ha:a Ab:hb:b Ah:a + b = mha':¬1 a1 b; 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)a:ha:a Ab:hb:b Ah:(fun x1 x2 => x1 + x2) a b = mha':¬1 ab m 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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this✝¹:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm ah_empty:¬Nonempty (A Icc 1 m)this✝:m (A + A) := fun h => match h with | Exists.intro a ha, Exists.intro b hb, h => absurd (if ha' : 1 a then Nonempty.intro a, ha, ha', Eq.ndrec (motive := fun m => m n + 1 0 < m ¬Nonempty (A Icc 1 m) a m) (fun hm this h_empty => le_add_of_nonneg_right (of_eq_true (Eq.trans (one_le._simp_2 b) (eq_true True.intro)))) h hm this✝¹ h_empty else Nonempty.intro b, hb, Decidable.byContradiction fun a_1 => implies_erdos_28._proof_7 n m this✝¹ a b h ha' a_1, Eq.ndrec (motive := fun m => m n + 1 0 < m ¬Nonempty (A Icc 1 m) b m) (fun hm this h_empty => le_add_of_nonneg_left (of_eq_true (Eq.trans (one_le._simp_2 a) (eq_true True.intro)))) h hm this✝¹ h_empty) h_emptythis:m n := hn m this✝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 => (∑ x Finset.antidiagonal N, A.indicator (fun x => 1) x.1 * A.indicator (fun x => 1) x.2)) atTop = A:Set hA:(A + A).Finiten:hn: i (A + A), i nm:hm:m n + 1this:0 < m := Decidable.byContradiction fun a => implies_erdos_28._proof_4 n m hm aFinite (A Icc 1 m) All goals completed! 🐙 end Erdos40