{
  "id": "3457",
  "ident": "NS.03457",
  "slug": "erdos-872",
  "title": "Erdős Problem 872",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Erdős Problem 872, part (i) (weak form): there exists a constant $\\epsilon > 0$ such that the\ngame length is at least $\\epsilon \\cdot n$ for all sufficiently large $n$.",
  "subjects": [
    "math.CO",
    "math.NT",
    "math.OC",
    "msc:05",
    "msc:11",
    "msc:91"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos872.erdos_872.parts.i",
  "statement_lean": "theorem erdos_872.parts.i :\n    ∃ ε > (0 : ℝ), ∀ᶠ n in atTop, (L n : ℝ) ≥ ε * n",
  "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 872\n\nThis file states Erdős Problem 872 for the primitive-set saturation game on $\\{2, \\dots, n\\}$.\nThe game value `L n` is defined by a finite minimax recursion: Prolonger moves first and maximizes\nthe final size of the claimed primitive set, while Shortener minimizes it.\n\nThe problem statement does not fix the turn order. This file fixes Prolonger to move first,\nfollowing the convention used in the forum discussion of the problem. The choice is not cosmetic:\ncomputational data suggests the Shortener-first value tracks $\\pi(n)$ while the Prolonger-first\nvalue grows linearly, and the questions below concern the Prolonger-first quantity.\n\n*References:*\n- [erdosproblems.com/872](https://www.erdosproblems.com/872)\n- [erdosproblems.com/forum/thread/872](https://www.erdosproblems.com/forum/thread/872)\n-/\n\n@[expose] public section\n\nopen Filter\n\nnamespace Erdos872\n\nnoncomputable section\n\n/-- A primitive subset of $\\{2, \\dots, n\\}$ is a set in which no element divides another.\nThe quantified divisibility condition is one-sided because the variables range over all ordered\npairs of distinct elements. -/\ndef IsPrimitive (n : ℕ) (A : Finset ℕ) : Prop :=\n  A ⊆ Finset.Icc 2 n ∧ ∀ a ∈ A, ∀ b ∈ A, a ≠ b → ¬ a ∣ b\n\n/- The two-player primitive-set saturation game on `{2, ..., n}`.\n\nA position records the already claimed set and the unclaimed pool. A legal move chooses `x` from\nthe pool such that adding `x` keeps the claimed set primitive. The next position inserts `x` into\nthe claimed set and erases `x` from the pool. Elements that have become illegal are left in the\npool, but `legalMoves` filters them out at the next turn. Thus the game ends exactly when no\nunclaimed element can be legally added, and the pool cardinality strictly decreases after every\nplayed move.\n-/\n\n/-- A game position consists of the already claimed set and the still unclaimed pool. -/\nstructure GamePos (n : ℕ) where\n  claimed : Finset ℕ\n  pool : Finset ℕ\n\n/-- The legal moves from a position: unclaimed elements whose insertion preserves primitiveness. -/\ndef legalMoves {n : ℕ} (p : GamePos n) : Finset ℕ :=\n  open scoped Classical in\n  p.pool.filter fun x => IsPrimitive n (insert x p.claimed)\n\n/-- Membership in `legalMoves`: a legal move is a pool element whose insertion preserves\nprimitiveness. -/\n@[category API, AMS 5]\nlemma mem_legalMoves {n : ℕ} {p : GamePos n} {x : ℕ} :\n    x ∈ legalMoves p ↔ x ∈ p.pool ∧ IsPrimitive n (insert x p.claimed) := by\n  classical\n  simp [legalMoves]\n\n/-- Apply a move by claiming `x` and removing it from the unclaimed pool.\n\nThis function is intentionally total: if `x` is not legal, it still returns the formal position\nobtained by inserting and erasing `x`. The minimax recursion below only calls it for\n`x ∈ legalMoves p`. -/\ndef applyMove {n : ℕ} (p : GamePos n) (x : ℕ) : GamePos n where\n  claimed := insert x p.claimed\n  pool := p.pool.erase x\n\n/-- The empty starting position on $\\{2, \\dots, n\\}$. -/\ndef startPos (n : ℕ) : GamePos n where\n  claimed := ∅\n  pool := Finset.Icc 2 n\n\n/-- Auxiliary finite minimax recursion with an explicit fuel bound.\n\nAt a Prolonger turn (`turn = true`) the recursion takes the maximum over legal moves; at a\nShortener turn (`turn = false`) it takes the minimum. If there are no legal moves, or the fuel is\nexhausted, it returns the current final size `p.claimed.card`. Starting with fuel `p.pool.card` is\nsufficient because every played move erases the chosen pool element. -/\ndef gameValueAux {n : ℕ} : ℕ → Bool → GamePos n → ℕ\n  | 0, _turn, p => p.claimed.card\n  | fuel + 1, turn, p =>\n      let moves := legalMoves p\n      let f := fun x => gameValueAux fuel (!turn) (applyMove p x)\n      let vals := moves.image f\n      if h : moves.Nonempty then\n        let hvals : vals.Nonempty := h.image f\n        if turn then vals.max' hvals else vals.min' hvals\n      else\n        p.claimed.card\n\n/-- Each move claims exactly one pool element, so the minimax value never exceeds the number of\nalready claimed elements plus the number of still unclaimed elements. -/\n@[category API, AMS 5]\nlemma gameValueAux_le {n : ℕ} (fuel : ℕ) (turn : Bool) (p : GamePos n) :\n    gameValueAux fuel turn p ≤ p.claimed.card + p.pool.card := by\n  induction fuel generalizing turn p with\n  | zero =>\n    simp only [gameValueAux]\n    exact Nat.le_add_right _ _\n  | succ fuel ih =>\n    have key : ∀ x ∈ legalMoves p,\n        gameValueAux fuel (!turn) (applyMove p x) ≤ p.claimed.card + p.pool.card := by\n      intro x hx\n      have hxpool : x ∈ p.pool := (mem_legalMoves.mp hx).1\n      have h1 : (insert x p.claimed).card ≤ p.claimed.card + 1 := Finset.card_insert_le _ _\n      have h2 : (p.pool.erase x).card = p.pool.card - 1 := Finset.card_erase_of_mem hxpool\n      have h3 : 0 < p.pool.card := Finset.card_pos.mpr ⟨x, hxpool⟩\n      have h4 : gameValueAux fuel (!turn) (applyMove p x) ≤\n          (insert x p.claimed).card + (p.pool.erase x).card := ih (!turn) (applyMove p x)\n      omega\n    have key' : ∀ v ∈ (legalMoves p).image\n        (fun x => gameValueAux fuel (!turn) (applyMove p x)),\n        v ≤ p.claimed.card + p.pool.card := by\n      intro v hv\n      obtain ⟨x, hx, rfl⟩ := Finset.mem_image.mp hv\n      exact key x hx\n    simp only [gameValueAux]\n    split_ifs with h ht\n    · exact Finset.max'_le _ _ _ key'\n    · exact key' _ (Finset.min'_mem _ _)\n    · exact Nat.le_add_right _ _\n\n/-- The minimax value of the primitive-set saturation game from `p`, with Prolonger to move.\n\nThis is a genuine game-value definition rather than an uninterpreted placeholder. It unfolds the\nfinite game tree up to `p.pool.card` moves; at each node Prolonger maximizes and Shortener\nminimizes the eventual terminal cardinality. -/\ndef gameLength {n : ℕ} : GamePos n → ℕ := fun p =>\n  gameValueAux p.pool.card true p\n\n/-- The Erdős primitive-set game length on $\\{2, \\dots, n\\}$. -/\ndef L (n : ℕ) : ℕ := gameLength (startPos n)\n\n/- ## Erdős Problem 872\n\nThe problem asks for asymptotic lower bounds on `L(n)`. Two specific targets are stated. -/\n\n/-- Erdős Problem 872, part (i) (weak form): there exists a constant $\\epsilon > 0$ such that the\ngame length is at least $\\epsilon \\cdot n$ for all sufficiently large $n$. -/\n@[category research open, question, AMS 5 11 91]\ntheorem erdos_872.parts.i :\n    ∃ ε > (0 : ℝ), ∀ᶠ n in atTop, (L n : ℝ) ≥ ε * n := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/-- Erdős Problem 872, part (ii) (strong form): for every $\\epsilon > 0$, the game length is at\nleast $(1-\\epsilon) \\cdot n / 2$ for all sufficiently large $n$.\n\nThe forum thread (April-May 2026) records Shortener strategies giving\n$L(n) \\leq (23/48 + o(1)) \\cdot n$ (described in the thread as accepted as correct, with a Lean\nformalization in progress) and a claimed $L(n) \\leq 0.19 \\cdot n$, either of which would answer this\nquestion negatively under the Prolonger-first convention.\n\nThe $23/48$ upper bound for `C`-respecting plays (following old-bielefelder's strategy in the\nforum thread) was formalized in Lean 4 by Pommeret using Aristotle and Claude Opus 4.7, and\ncompleted to a proof for the full minimax game value `L n` by Ilia Pauzner using Gemini 4 Argon. -/\n@[category research solved, question, AMS 5 11 91, formal_proof using formal_conjectures at \"https://github.com/ilpauzner/formal-conjectures/blob/d9299da16287d2347e375d9eec253eec455bae75/FormalConjectures/ErdosProblems/872.lean#L1180\"]\ntheorem erdos_872.parts.ii :\n    ¬ ∀ ε > (0 : ℝ), ∀ᶠ n in atTop, (L n : ℝ) ≥ (1 - ε) * n / 2 := by\n  sorry\n\n/-- A trivial upper bound: a play can claim at most the $n - 1$ elements of $\\{2, \\dots, n\\}$, so\n$L(n) \\leq n - 1$. -/\n@[category textbook, AMS 5 11 91]\ntheorem erdos_872.trivial_upper_bound (n : ℕ) (hn : 2 ≤ n) :\n    L n ≤ n - 1 := by\n  calc L n ≤ (startPos n).claimed.card + (startPos n).pool.card :=\n        gameValueAux_le (startPos n).pool.card true (startPos n)\n    _ = n - 1 := by\n        simp only [startPos, Finset.card_empty, Nat.card_Icc]\n        omega\n\nset_option linter.style.formal_proof_palomar false in\n/-- Forum-related variant: how small can a maximal primitive subset of $\\{2, \\dots, n\\}$ be?\nThe set of primes in $\\{2, \\dots, n\\}$ is a maximal primitive subset of size $\\pi(n)$, and the forum\nthread asks whether this is the smallest possible for all $n \\geq 2$. Equivalently: must every\ncompleted play of the saturation game, by both players and regardless of strategy, claim at least\n$\\pi(n)$ elements? (Terminal positions of the game are exactly the maximal primitive subsets.)\n\nThe answer is yes. For each prime $q \\le n$, let $q^k$ be the largest power of $q$ that is at most\n$n$. Maximality gives an element of $A$ comparable with $q^k$ under divisibility, and no element is\ncomparable with two such prime powers, so $|A| \\ge \\pi(n)$. This argument was posted on the forum\nby old-bielefelder (May 2026); the statement also appears as Theorem 2.3(i) of\n[El23] S. Elsakhawy, *Independence and domination in divisor graph and mod-difference graphs*,\nJ. Egyptian Math. Soc. 31 (2023). -/\n@[category research solved, question, AMS 5 11 91, formal_proof using lean4 at\n  \"https://github.com/mnn31/erdos-lean/blob/5cb725981b3ad137103ef908eb6ecff9e7ed9bdf/ErdosLean/Erdos872.lean#L114\"]\ntheorem erdos_872.variants.prime_question :\n    ∀ n ≥ 2, ∀ A : Finset ℕ, Maximal (IsPrimitive n) A →\n      ((Finset.Icc 2 n).filter Nat.Prime).card ≤ A.card := by\n  sorry\n\nend\n\nend Erdos872\n",
  "statement_hash": "88354b43185e084c8f2944293e6a99f1b7e5c21c9ffaf2e102e3f51f5b3a4516",
  "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."
}