{
  "id": "2396",
  "ident": "NS.02396",
  "slug": "erdos-534",
  "title": "Erdős Problem 534",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "What is the largest possible subset $A\\subseteq\\{1,\\ldots,N\\}$ which contains $N$ such that\n$\\mathrm{gcd}(a,b)>1$ for all $a\\neq b\\in A$?\n\nErdős conjectured that if $N=q_1^{k_1}\\cdots q_r^{k_r}$ (where $q_1<\\cdots <q_r$ are distinct\nprimes) then the maximum is achieved by, for some $1\\leq j\\leq r$, those integers in $[1,N]$\nwhich are a multiple of at least one of $\\{2q_1,\\ldots,2q_j,q_1\\cdots q_j\\}$.\n\nThis conjecture was proved by Ahlswede and Khachatrian [AhKh96].",
  "subjects": [
    "math.CO",
    "math.NT",
    "msc:05",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos534.erdos_534",
  "statement_lean": "theorem erdos_534 (N : ℕ) (hN : 2 ≤ N) :\n    ∃ q ∈ N.primeFactors, IsAdmissible N (ahlswedeKhachatrian N q) ∧\n      maxCard N = (ahlswedeKhachatrian N q).card",
  "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 534\n\n*References:*\n- [erdosproblems.com/534](https://www.erdosproblems.com/534)\n- [Er73] Erdős, P., _Problems and results on combinatorial number theory_. A survey of\n  combinatorial theory (Proc. Internat. Sympos., Colorado State Univ., Fort Collins, Colo., 1971)\n  (1973), 117-138.\n- [Er80] Erdős, Paul, _A survey of problems in combinatorial number theory_. Ann. Discrete Math.\n  (1980), 89-115.\n- [AhKh96] Ahlswede, Rudolf and Khachatrian, Levon H., _Sets of integers with pairwise common\n  divisor and a factor from a specified set of primes_. Acta Arith. (1996), 259--276.\n-/\n\n@[expose] public section\n\nnamespace Erdos534\n\n/-- A set `A ⊆ {1, …, N}` is *admissible* if it contains `N` and any two distinct elements\nof `A` have a common factor. -/\ndef IsAdmissible (N : ℕ) (A : Finset ℕ) : Prop :=\n  A ⊆ Finset.Icc 1 N ∧ N ∈ A ∧ (A : Set ℕ).Pairwise fun a b ↦ 1 < Nat.gcd a b\n\n/-- The largest size of an admissible subset of `{1, …, N}`. -/\nnoncomputable def maxCard (N : ℕ) : ℕ :=\n  sSup {n | ∃ A : Finset ℕ, IsAdmissible N A ∧ A.card = n}\n\n/-- The prime factors `q₁ < ⋯ < qⱼ` of `N` which are at most `q`. -/\ndef primePrefix (N q : ℕ) : Finset ℕ := N.primeFactors.filter (· ≤ q)\n\n/-- The Ahlswede–Khachatrian set associated to a prime factor `q` of `N`: those integers in\n`[1, N]` which are a multiple of at least one of `2 q₁, …, 2 qⱼ, q₁ ⋯ qⱼ`, where\n`q₁ < ⋯ < qⱼ = q` are the prime factors of `N` which are at most `q`. -/\ndef ahlswedeKhachatrian (N q : ℕ) : Finset ℕ :=\n  (Finset.Icc 1 N).filter fun m ↦\n    (∏ p ∈ primePrefix N q, p) ∣ m ∨ ∃ p ∈ primePrefix N q, 2 * p ∣ m\n\nset_option linter.style.formal_proof_palomar false in\n/--\nWhat is the largest possible subset $A\\subseteq\\{1,\\ldots,N\\}$ which contains $N$ such that\n$\\mathrm{gcd}(a,b)>1$ for all $a\\neq b\\in A$?\n\nErdős conjectured that if $N=q_1^{k_1}\\cdots q_r^{k_r}$ (where $q_1<\\cdots <q_r$ are distinct\nprimes) then the maximum is achieved by, for some $1\\leq j\\leq r$, those integers in $[1,N]$\nwhich are a multiple of at least one of $\\{2q_1,\\ldots,2q_j,q_1\\cdots q_j\\}$.\n\nThis conjecture was proved by Ahlswede and Khachatrian [AhKh96].\n-/\n@[category research solved, AMS 5 11, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos534.lean#L39\"]\ntheorem erdos_534 (N : ℕ) (hN : 2 ≤ N) :\n    ∃ q ∈ N.primeFactors, IsAdmissible N (ahlswedeKhachatrian N q) ∧\n      maxCard N = (ahlswedeKhachatrian N q).card := by\n  sorry\n\nend Erdos534\n",
  "statement_hash": "ba7dfd1aaec452ace64d069b3f5a5c5b341c8c8f2d79e112a8ae70ca892bf57d",
  "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."
}