{
  "id": "949",
  "ident": "NS.00949",
  "slug": "erdos-1192",
  "title": "Erdős Problem 1192",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Does there exist, for all $r\\geq 2$, a basis $A$ of order $r$ (so that $f_r(n)>0$ for all\nlarge $n$) such that $$\\sum_{n\\leq x}f_r(n)^2 \\ll x$$ for all $x$?",
  "subjects": [
    "math.CO",
    "msc:05"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos1192.erdos_1192",
  "statement_lean": "theorem erdos_1192 :\n    ∀ r ≥ 2, ∃ A : Set ℕ,\n      (∀ᶠ n in atTop, f_r A r n > 0) ∧\n      (fun (x : ℕ) ↦ ∑ n ∈ range (x + 1), (f_r A r n : ℝ) ^ 2) =O[atTop]\n        (fun (x : ℕ) ↦ (x : ℝ))",
  "challenge_source": "/-\nCopyright 2026 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\n\n/-!\n# Erdős Problem 1192\n\n*References:*\n- [erdosproblems.com/1192](https://www.erdosproblems.com/1192)\n- [Ru90] Ruzsa, Imre Z., A just basis. Monatsh. Math. (1990), 145--151.\n- [Er80] Erdős, Paul, A survey of problems in combinatorial number theory.\n  Ann. Discrete Math. 6 (1980), 89--115.\n-/\n\n@[expose] public section\n\nopen Nat Filter Finset Set\nopen scoped Asymptotics BigOperators\n\nnamespace Erdos1192\n\n/--\nFor $A\\subset \\mathbb{N}$ let $f_r(n)$ count the number of solutions to $n=a_1+\\cdots+a_r$\nwith $a_i\\in A$.\n-/\nnoncomputable def f_r (A : Set ℕ) (r n : ℕ) : ℕ :=\n  { v : Fin r → ℕ | (∀ i, v i ∈ A) ∧ ∑ i, v i = n }.ncard\n\n/-- The empty sum ($r = 0$) gives exactly one representation of $0$: the empty tuple. -/\n@[category test, AMS 5 11]\ntheorem erdos_1192.f_r_zero_zero (A : Set ℕ) : f_r A 0 0 = 1 := by\n  dsimp [f_r]\n  have h : { v : Fin 0 → ℕ | (∀ i, v i ∈ A) ∧ ∑ i, v i = 0 } = { default } := by\n    ext v\n    simp [eq_iff_true_of_subsingleton]\n  rw [h, Set.ncard_singleton]\n\n/-- With an empty set, there are no valid $r$-tuples for $r \\geq 1$. -/\n@[category test, AMS 5 11]\ntheorem erdos_1192.f_r_empty (r n : ℕ) : f_r ∅ (r + 1) n = 0 := by\n  dsimp [f_r]\n  have h : { v : Fin (r + 1) → ℕ | (∀ i, v i ∈ (∅ : Set ℕ)) ∧ ∑ i, v i = n } = ∅ := by\n    ext v\n    simp\n  rw [h, Set.ncard_empty]\n\n/-- For $r = 1$, $f_1(\\{n\\}, n) = 1$: the only $1$-tuple from $\\{n\\}$ summing to $n$ is $(n)$. -/\n@[category test, AMS 5 11]\ntheorem erdos_1192.f_r_singleton_self (n : ℕ) : f_r {n} 1 n = 1 := by\n  dsimp [f_r]\n  have h : { v : Fin 1 → ℕ | (∀ i, v i ∈ ({n} : Set ℕ)) ∧ ∑ i, v i = n } = { fun _ ↦ n } := by\n    ext v\n    simp only [Set.mem_ofPred_eq, Set.mem_singleton_iff]\n    constructor\n    · rintro ⟨h1, _⟩\n      ext i\n      exact h1 i\n    · rintro rfl\n      refine ⟨fun _ ↦ rfl, ?_⟩\n      simp\n  rw [h, Set.ncard_singleton]\n\n/-- $f_1(\\{0\\}, 1) = 0$: can't represent $1$ with a single element from $\\{0\\}$. -/\n@[category test, AMS 5 11]\ntheorem erdos_1192.f_r_no_rep : f_r {0} 1 1 = 0 := by\n  dsimp [f_r]\n  have h : { v : Fin 1 → ℕ | (∀ i, v i ∈ ({0} : Set ℕ)) ∧ ∑ i, v i = 1 } = ∅ := by\n    ext v\n    simp only [Set.mem_ofPred_eq, Set.mem_singleton_iff, Set.mem_empty_iff_false, iff_false]\n    rintro ⟨h1, h2⟩\n    have h3 : v = fun _ ↦ 0 := by ext i; exact h1 i\n    rw [h3] at h2\n    revert h2\n    simp\n  rw [h, Set.ncard_empty]\n\n/--\nDoes there exist, for all $r\\geq 2$, a basis $A$ of order $r$ (so that $f_r(n)>0$ for all\nlarge $n$) such that $$\\sum_{n\\leq x}f_r(n)^2 \\ll x$$ for all $x$?\n-/\n@[category research open, question, AMS 5]\ntheorem erdos_1192 :\n    ∀ r ≥ 2, ∃ A : Set ℕ,\n      (∀ᶠ n in atTop, f_r A r n > 0) ∧\n      (fun (x : ℕ) ↦ ∑ n ∈ range (x + 1), (f_r A r n : ℝ) ^ 2) =O[atTop]\n        (fun (x : ℕ) ↦ (x : ℝ)) := by\n  sorry\n\nopen scoped Classical in\n/--\nErdős and Rényi proved by the probabilistic method that there exists a set $A$ such that\n$$\\sum_{n\\leq x}f_r(n)^2 \\ll x$$ and $$\\lvert A\\cap [1,x]\\rvert\\gg x^{1/r}$$ for all $x$.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_1192.variants.renyi :\n    ∀ r ≥ 2, ∃ A : Set ℕ,\n      ((fun (x : ℕ) ↦ ∑ n ∈ range (x + 1), (f_r A r n : ℝ) ^ 2) =O[atTop]\n        (fun (x : ℕ) ↦ (x : ℝ))) ∧\n      ((fun (x : ℕ) ↦ (x : ℝ) ^ (1 / (r : ℝ))) =O[atTop]\n        (fun (x : ℕ) ↦ (count (· ∈ A) x : ℝ))) := by\n  sorry\n\n/--\nRuzsa [Ru90] proved that the answer is yes for $r=2$.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_1192.variants.ruzsa :\n    ∃ A : Set ℕ,\n      (∀ᶠ n in atTop, f_r A 2 n > 0) ∧\n      (fun (x : ℕ) ↦ ∑ n ∈ range (x + 1), (f_r A 2 n : ℝ) ^ 2) =O[atTop]\n        (fun (x : ℕ) ↦ (x : ℝ)) := by\n  sorry\n\nend Erdos1192\n",
  "statement_hash": "aff90e72d063229718405ca9548a5fd3eff58852e041c4a38ce3847db631157d",
  "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."
}