{
  "id": "2004",
  "ident": "NS.02004",
  "slug": "erdos-40",
  "title": "Erdős Problem 40",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "For what functions $g(N) → \\infty$ is it true that\n$$\\lvert A\\cap \\{1,\\ldots,N\\}\\rvert \\gg \\frac{N^{1/2}}{g(N)}$$\nimplies $\\limsup 1_A\\ast 1_A(n)=\\infty$?",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": "https://www.erdosproblems.com/40",
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos40.erdos_40",
  "statement_lean": "theorem erdos_40 :\n    {g : ℕ → ℝ | Tendsto g atTop atTop ∧ Erdos40For g} = erdos_40.answer",
  "challenge_source": "/-\nCopyright 2025 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\npublic import FormalConjectures.ErdosProblems.«28»\n\n/-!\n# Erdős Problem 40\n\n*Reference:* [erdosproblems.com/40](https://www.erdosproblems.com/40)\n-/\n\n@[expose] public section\n\nopen AdditiveCombinatorics Filter Real Set\nopen scoped Pointwise\n\nnamespace Erdos40\n\n/--\nThe predicate for a function $g\\colon\\mathbb{N} → \\mathbb{R})$ that\n$$\\lvert A\\cap \\{1,\\ldots,N\\}\\rvert \\gg \\frac{N^{1/2}}{g(N)}$$\nimplies $\\limsup 1_A\\ast 1_A(n)=\\infty$.\n-/\ndef Erdos40For (g : ℕ → ℝ) : Prop :=\n  ∀ A : Set ℕ,\n    (fun N : ℕ ↦ √N / g N) =O[atTop] (fun N ↦ ((A ∩ .Icc 1 N).ncard : ℝ)) →\n    limsup (fun N ↦ (sumRep A N : ℕ∞)) atTop = ⊤\n\ndef erdos_40.answer : Set (ℕ → ℝ) := sorry\n\n/--\nFor what functions $g(N) → \\infty$ is it true that\n$$\\lvert A\\cap \\{1,\\ldots,N\\}\\rvert \\gg \\frac{N^{1/2}}{g(N)}$$\nimplies $\\limsup 1_A\\ast 1_A(n)=\\infty$?\n-/\n@[category research open, question value, AMS 11]\ntheorem erdos_40 :\n    {g : ℕ → ℝ | Tendsto g atTop atTop ∧ Erdos40For g} = erdos_40.answer := by\n  sorry\n\n/--\nIs there any function $g(N) → \\infty$ such that\n$$\\lvert A\\cap \\{1,\\ldots,N\\}\\rvert \\gg \\frac{N^{1/2}}{g(N)}$$\nimplies $\\limsup 1_A\\ast 1_A(n)=\\infty$?\n\nThis is a weaker form of Erdős Problem 40, which asks for all such $g$. Establishing\nthe implication for even one $g(N) → \\infty$ already answers Erdős Problem 28\npositively, because a basis of order $2$ satisfies\n$\\lvert A\\cap \\{1,\\ldots,N\\}\\rvert \\gg N^{1/2}$.\n-/\n@[category research open, question, AMS 11]\ntheorem erdos_40.variants.weaker :\n    ∃ g : ℕ → ℝ, Tendsto g atTop atTop ∧ Erdos40For g := by\n  sorry\n\n/--\nEstablishing the property in Erdős Problem 40 for any one function $g(N) → \\infty$\nimplies the Erdős-Turán conjecture, see Erdős Problem 28.\n-/\n@[category textbook, AMS 11]\ntheorem erdos_40.variants.implies_erdos_28 (g : ℕ → ℝ) (hg : Tendsto g atTop atTop)\n    (h_erdos_40 : Erdos40For g) : type_of% Erdos28.erdos_28 := by\n  classical\n  intro A hA\n  apply h_erdos_40 A\n  obtain ⟨n, hn⟩ := hA.exists_le\n  apply Asymptotics.IsBigO.of_bound 4\n  filter_upwards [eventually_ge_atTop (2 * n + 2), hg.eventually_ge_atTop 1] with N hN hgN\n  let k := (A ∩ Icc 1 N).ncard\n  let B := insert 0 (A ∩ Icc 1 N)\n  have hB : B.Finite := ((finite_Icc 1 N).inter_of_right A).insert 0\n  have hmem : ∀ a ∈ A, a ≤ N → a ∈ B := by\n    intro a ha haN\n    by_cases ha0 : a = 0\n    · exact Or.inl ha0\n    · exact Or.inr ⟨ha, by omega, haN⟩\n  have hsub : Icc (n + 1) N ⊆ B + B := by\n    intro m ⟨hmlo, hmhi⟩\n    have hmA : m ∈ A + A := by\n      by_contra hmA\n      have := hn m hmA\n      omega\n    obtain ⟨a, ha, b, hb, hab⟩ := hmA\n    simp only at hab\n    exact ⟨a, hmem a ha (by omega), b, hmem b hb (by omega), hab⟩\n  have hcard : N - n ≤ (k + 1) ^ 2 := calc\n    N - n = (Icc (n + 1) N).ncard := by simp\n    _ ≤ (B + B).ncard := ncard_le_ncard hsub (hB.add hB)\n    _ ≤ B.ncard ^ 2 := by\n      simpa only [Nat.card_coe_set_eq, pow_two] using (Set.natCard_add_le (s := B) (t := B))\n    _ ≤ (k + 1) ^ 2 := by\n      gcongr\n      exact ncard_insert_le 0 (A ∩ Icc 1 N)\n  have hcard' : N ≤ n + (k + 1) ^ 2 := by omega\n  have hk : 1 ≤ k := by nlinarith\n  have hcardR : (N : ℝ) ≤ n + ((k : ℝ) + 1) ^ 2 := by exact_mod_cast hcard'\n  have hNR : 2 * (n : ℝ) + 2 ≤ (N : ℝ) := by exact_mod_cast hN\n  have hkR : 1 ≤ (k : ℝ) := by exact_mod_cast hk\n  have hsqrt : √(N : ℝ) ≤ 4 * (k : ℝ) := by\n    apply sqrt_le_iff.2\n    constructor\n    · positivity\n    · nlinarith [sq_nonneg ((k : ℝ) - 1)]\n  rw [Real.norm_of_nonneg (div_nonneg (sqrt_nonneg _) (le_trans zero_le_one hgN)),\n    Real.norm_natCast]\n  exact (div_le_self (sqrt_nonneg _) hgN).trans hsqrt\n\nend Erdos40\n",
  "statement_hash": "5629e447989ea59e95f42c31d3b95785be4ec2c4407c9a31eacaeef610251ce8",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}