{
  "id": "2961",
  "ident": "NS.02961",
  "slug": "erdos-709",
  "title": "Erdős Problem 709",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Let $f(n)$ be minimal such that, for any $A=\\{a_1,\\ldots,a_n\\}\\subseteq [2,\\infty)\\cap\\mathbb{N}$\nof size $n$, in any interval $I$ of $f(n)\\max(A)$ consecutive integers there exist distinct\n$x_1,\\ldots,x_n\\in I$ such that $a_i\\mid x_i$.\n\nObtain good bounds for $f(n)$, or even an asymptotic formula.\n\nWe read \"good bounds\" as determining the order of magnitude of $f(n)$.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos709.erdos_709",
  "statement_lean": "theorem erdos_709 : f =Θ[atTop] erdos_709.answer",
  "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 709\n\n*References:*\n- [erdosproblems.com/709](https://www.erdosproblems.com/709)\n- [ErSu59] P. Erdős and J. Surányi, Bemerkungen zu einer Aufgabe eines mathematischen\n  Wettbewerbs, Mat. Lapok 10 (1959), 39–48.\n- [Er92c] P. Erdős, Some of my forgotten problems in number theory, Hardy–Ramanujan J. 15\n  (1992), 34–50.\n- [vD26] W. van Doorn, On the length of an interval that contains distinct multiples of the\n  first $n$ positive integers, Integers (2026), #A7.\n-/\n\n@[expose] public section\n\nopen Filter Asymptotics\n\nnamespace Erdos709\n\n/-- The block of `length` consecutive positive integers immediately after `start`. -/\ndef window (start length : ℕ) : Finset ℕ := Finset.Icc (start + 1) (start + length)\n\n/-- A block contains distinct multiples of all elements of `A`. -/\ndef HasDistinctMultiples (A : Finset ℕ) (start length : ℕ) : Prop :=\n  ∃ choice : ℕ → ℕ,\n    Set.InjOn choice (A : Set ℕ) ∧\n    ∀ a ∈ A, choice a ∈ window start length ∧ a ∣ choice a\n\n/-- The multiplier `k` works for all `n`-element inputs and all starting points.\n`M` is required to be the largest element of `A`. -/\ndef Works (n k : ℕ) : Prop :=\n  ∀ (A : Finset ℕ) (M : ℕ),\n    A.card = n → M ∈ A → (∀ a ∈ A, a ≤ M) → (∀ a ∈ A, 2 ≤ a) →\n    ∀ start : ℕ, HasDistinctMultiples A start (k * M)\n\n/-- `k` is the least multiplier that works for inputs of size `n`. -/\ndef IsOptimal (n k : ℕ) : Prop := Works n k ∧ ∀ j < k, ¬ Works n j\n\n/-- A matching in a shorter block remains a matching in any longer block. -/\n@[category API, AMS 5 11]\ntheorem matching_mono_length\n    (A : Finset ℕ) (start small large : ℕ) (hsmall : small ≤ large)\n    (h : HasDistinctMultiples A start small) : HasDistinctMultiples A start large := by\n  obtain ⟨choice, hinj, hchoice⟩ := h\n  refine ⟨choice, hinj, ?_⟩\n  intro a ha\n  obtain ⟨hmem, hdvd⟩ := hchoice a ha\n  refine ⟨?_, hdvd⟩\n  simp only [window, Finset.mem_Icc] at hmem ⊢\n  constructor\n  · exact hmem.1\n  · omega\n\n/-- If multiplier `k` works, every larger multiplier also works. -/\n@[category API, AMS 5 11]\ntheorem works_mono (n k l : ℕ) (hkl : k ≤ l) (h : Works n k) : Works n l := by\n  intro A M hcard hmax hbound htwo start\n  exact matching_mono_length A start (k * M) (l * M) (Nat.mul_le_mul_right M hkl)\n    (h A M hcard hmax hbound htwo start)\n\n/-- Every interval of `M` consecutive positive integers contains a multiple of `a` when\n`0 < a ≤ M`. -/\n@[category API, AMS 5 11]\ntheorem exists_multiple_in_window\n    (a M start : ℕ) (ha : 0 < a) (haM : a ≤ M) :\n    ∃ b ∈ window start M, a ∣ b := by\n  let r := start % a\n  let b := start + (a - r)\n  have hr : r < a := Nat.mod_lt start ha\n  have heq : start % a + a * (start / a) = start := by\n    simpa [Nat.mul_comm] using Nat.mod_add_div start a\n  have hbdiv : b = a * (start / a + 1) := by\n    have haux : b = a * (start / a) + a := by\n      dsimp [b, r]\n      omega\n    calc\n      b = a * (start / a) + a := haux\n      _ = a * (start / a + 1) := by ring\n  refine ⟨b, ?_, ?_⟩\n  · simp only [window, Finset.mem_Icc]\n    constructor\n    · dsimp [b]\n      omega\n    · dsimp [b]\n      omega\n  · exact ⟨start / a + 1, hbdiv⟩\n\n/-- Erdős Problem 709 holds for a singleton input: the multiplier `1` suffices. -/\n@[category textbook, AMS 5 11]\ntheorem erdos_709.variants.singleton : Works 1 1 := by\n  intro A M hcard hM hbound htwo start\n  have hA : A = {M} := by\n    obtain ⟨z, hz⟩ := Finset.card_eq_one.mp hcard\n    have hMz : M = z := Finset.mem_singleton.mp (hz ▸ hM)\n    simpa [hMz] using hz\n  obtain ⟨b, hb, hd⟩ :=\n    exists_multiple_in_window M M start (by have := htwo M hM; omega) le_rfl\n  refine ⟨fun _ => b, ?_, ?_⟩\n  · intro u hu v hv _\n    rw [hA] at hu hv\n    simp only [Finset.coe_singleton, Set.mem_singleton_iff] at hu hv\n    exact hu.trans hv.symm\n  · intro a ha\n    rw [hA] at ha\n    have hEq : a = M := Finset.mem_singleton.mp ha\n    subst a\n    simpa using And.intro hb hd\n\n/-- For singleton inputs, every multiplier at least `1` works. -/\n@[category API, AMS 5 11]\ntheorem works_one_of_one_le (k : ℕ) (hk : 1 ≤ k) : Works 1 k :=\n  works_mono 1 1 k hk erdos_709.variants.singleton\n\n/-- `IsAdmissible n c` says that for every set $A \\subseteq [2,\\infty)$ of $n$ natural numbers,\nevery block of at least $c \\max(A)$ consecutive positive integers contains distinct multiples of\nthe elements of $A$. Restricting to positive integers loses nothing: translating a block by a\nmultiple of $\\operatorname{lcm}(A)$ does not change which of its elements each $a \\in A$ divides.\n`Works` above is the same condition with an integer multiplier. -/\ndef IsAdmissible (n : ℕ) (c : ℝ) : Prop :=\n  ∀ A : Finset ℕ, A.card = n → (∀ a ∈ A, 2 ≤ a) →\n    ∀ start length : ℕ, c * ((A.sup id : ℕ) : ℝ) ≤ (length : ℝ) →\n      HasDistinctMultiples A start length\n\n/-- $f(n)$ is the infimum of the admissible $c$. Since $c\\max(A)$ need not be an integer, \"an\ninterval of $c\\max(A)$ consecutive integers\" is read as \"at least $c\\max(A)$ consecutive\nintegers\" (a longer interval contains a shorter one). For $n \\geq 1$ the set of admissible $c$\ncontains $n$ and is bounded below by $0$, so `sInf` is the true infimum. The value $f(0)=0$ is\na junk value and plays no role. -/\nnoncomputable def f (n : ℕ) : ℝ := sInf {c : ℝ | IsAdmissible n c}\n\n/-- The integers $5, 6, 7$ contain no distinct multiples of $2$ and $3$, since $6$ is the only\nmultiple of each. So three consecutive integers are not enough for $A=\\{2,3\\}$. -/\n@[category test, AMS 11]\ntheorem not_hasDistinctMultiples_two_three : ¬ HasDistinctMultiples {2, 3} 4 3 := by\n  rintro ⟨x, hinj, h⟩\n  obtain ⟨h2w, h2d⟩ := h 2 (by simp)\n  obtain ⟨h3w, h3d⟩ := h 3 (by simp)\n  simp only [window, Finset.mem_Icc] at h2w h3w\n  have h23 : x 2 = x 3 := by omega\n  have := hinj (by simp) (by simp) h23\n  omega\n\ndef erdos_709.answer : ℕ → ℝ := sorry\n\n/--\nLet $f(n)$ be minimal such that, for any $A=\\{a_1,\\ldots,a_n\\}\\subseteq [2,\\infty)\\cap\\mathbb{N}$\nof size $n$, in any interval $I$ of $f(n)\\max(A)$ consecutive integers there exist distinct\n$x_1,\\ldots,x_n\\in I$ such that $a_i\\mid x_i$.\n\nObtain good bounds for $f(n)$, or even an asymptotic formula.\n\nWe read \"good bounds\" as determining the order of magnitude of $f(n)$.\n-/\n@[category research open, question value, AMS 11]\ntheorem erdos_709 : f =Θ[atTop] erdos_709.answer := by\n  sorry\n\n/--\nA problem of Erdős and Surányi [ErSu59], who proved\n$$(\\log n)^c \\ll f(n) \\ll n^{1/2}$$\nfor some constant $c>0$.\n\nThis is the lower bound.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_709.variants.ersu_lower :\n    ∃ c > (0 : ℝ), (fun n : ℕ ↦ Real.log n ^ c) =O[atTop] f := by\n  sorry\n\n/--\nA problem of Erdős and Surányi [ErSu59], who proved\n$$(\\log n)^c \\ll f(n) \\ll n^{1/2}$$\nfor some constant $c>0$.\n\nThis is the upper bound.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_709.variants.ersu_upper :\n    f =O[atTop] fun n : ℕ ↦ (n : ℝ) ^ (1 / 2 : ℝ) := by\n  sorry\n\n/--\nThe lower bound here can be improved, using van Doorn's lower bound for [711] from [vD26], to\n$$\\frac{\\log n}{\\log\\log n}\\ll f(n).$$\n-/\n@[category research solved, AMS 11]\ntheorem erdos_709.variants.van_doorn_lower :\n    (fun n : ℕ ↦ Real.log n / Real.log (Real.log n)) =O[atTop] f := by\n  sorry\n\nend Erdos709\n",
  "statement_hash": "b7ed0b949f08f0e32ae12cb27ddd4fc2b9a6440e1e8b7b1cc04b9328c4f9849c",
  "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."
}