{
  "id": "3524",
  "ident": "NS.03524",
  "slug": "erdos-888",
  "title": "Erdős Problem 888",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "What is the size of the largest $A\\subseteq \\{1,\\ldots,n\\}$ such that if\n$a\\leq b\\leq c\\leq d\\in A$ are such that $abcd$ is a square then $ad=bc$?\n\nThis was proved by GPT-5.5 Pro (prompted by Chojecki).",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos888.erdos_888",
  "statement_lean": "theorem erdos_888 :\n    (fun n : ℕ ↦ (Nat.findGreatest (p n) n : ℝ)) =Θ[atTop]\n      (fun n : ℕ ↦ (n : ℝ) * Real.log (Real.log n) / Real.log 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 888\n\n*References:*\n- [erdosproblems.com/888](https://www.erdosproblems.com/888)\n- [Er98] Erdős, Paul, Some of my new and almost new problems and results in combinatorial number\n  theory. Number theory (Eger, 1996) (1998), 169-180.\n-/\n\n@[expose] public section\n\nopen Filter\n\nnamespace Erdos888\n\n/--\nCondition on the sets $A$ appearing in Erdős 888. Namely, let $A$ be a subset\nof ${1,...,n}$ such that if $a ≤ b ≤ c ≤ d ∈ A$ and $abcd$ square then $ad=bc$.\n-/\ndef RequiredCondition (A : Finset ℕ) (n : ℕ) : Prop :=\n  A ⊆ Finset.Ioc 0 n ∧ ∀ᵉ (a ∈ A) (b ∈ A) (c ∈ A) (d ∈ A),\n  a ≤ b → b ≤ c → c ≤ d → IsSquare (a * b * c * d) → a * d = b * c\n\n/--\nProposition that for a specific $n$ an $A$ with the above defined condition and cardinality $k$\nexists.\n-/\ndef p (n : ℕ) (k : ℕ) : Prop := ∃ A : Finset ℕ, RequiredCondition A n ∧ A.card = k\n\nopen scoped Classical in\nset_option linter.style.formal_proof_palomar false in\n/--\nWhat is the size of the largest $A\\subseteq \\{1,\\ldots,n\\}$ such that if\n$a\\leq b\\leq c\\leq d\\in A$ are such that $abcd$ is a square then $ad=bc$?\n\nThis was proved by GPT-5.5 Pro (prompted by Chojecki).\n-/\n@[category research solved, AMS 11,\n  formal_proof using lean4 at \"https://github.com/plby/lean-proofs/blob/dfe2d78128b493c572cf525b1b8edf4897fb7664/src/latest/ErdosProblems/Erdos888.lean#L47\"]\ntheorem erdos_888 :\n    (fun n : ℕ ↦ (Nat.findGreatest (p n) n : ℝ)) =Θ[atTop]\n      (fun n : ℕ ↦ (n : ℝ) * Real.log (Real.log n) / Real.log n) := by\n  sorry\n\nopen scoped Classical in\n/--\nErdős claims that Sárközy proved that $\\lvert A\\rvert =o(n)$ (a proof of this\nbound is provided by Tao in the comments).\n-/\n@[category research solved, AMS 11]\ntheorem erdos_888.variants.sarkozy :\n    (fun n ↦ (Nat.findGreatest (p n) n : ℝ)) =o[atTop] (Nat.cast : ℕ → ℝ) := by\n  sorry\n\nopen scoped Classical in\n/--\nThe primes show that $\\lvert A\\rvert \\gg n/\\log n$ is possible.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_888.variants.primes :\n    (fun n : ℕ ↦ (Nat.findGreatest (p n) n : ℝ)) ≫ (fun n : ℕ ↦ (n : ℝ) / Real.log n) := by\n  sorry\n\nopen scoped Classical in\n/--\nCambie and Weisenberg have noted in the comments that the set of semiprimes\nalso works, showing $(1+o(1))\\frac{\\log\\log n}{\\log n}n \\leq \\lvert A\\rvert$ is achievable.\n-/\n@[category research solved, AMS 11]\ntheorem erdos_888.variants.semiprimes :\n    ∃ c : ℕ → ℝ, c =o[atTop] (1 : ℕ → ℝ) ∧ ∀ᶠ n : ℕ in atTop,\n      (1 + c n) * ((n : ℝ) * Real.log (Real.log n) / Real.log n) ≤ Nat.findGreatest (p n) n := by\n  sorry\n\nend Erdos888\n",
  "statement_hash": "16478741667edc80ec3b4e40b516b70512f3204a639cc6530d7f7d3c29c6d1b8",
  "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."
}