{
  "id": "403",
  "ident": "NS.00403",
  "slug": "erdos-1025",
  "title": "Erdős Problem 1025",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $f$ be a function from all pairs of elements in $\\{1,\\ldots,n\\}$ to $\\{1,\\ldots,n\\}$ such\nthat $f(x,y)\\neq x$ and $\\neq y$ for all $x,y$. We call $X\\subseteq \\{1,\\ldots,n\\}$ independent\nif whenever $x,y\\in X$ we have $f(x,y)\\not\\in X$.\n\nLet $g(n)$ be such that, in every function $f$, there is an independent set of size at least\n$g(n)$. Estimate $g(n)$.\n\nA question of Erdős and Hajnal [ErHa58], who could prove $n^{1/3} \\ll g(n) \\ll (n\\log n)^{1/2}$.\nSpencer [Sp72] proved $g(n)\\gg n^{1/2}$. Conlon, Fox, and Sudakov [CFS16] proved\n$g(n)\\ll n^{1/2}$.",
  "subjects": [
    "math.CO",
    "msc:05"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos1025.erdos_1025",
  "statement_lean": "theorem erdos_1025 : (fun n : ℕ => (g n : ℝ)) =Θ[atTop] fun 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 1025\n\n*References:*\n- [erdosproblems.com/1025](https://www.erdosproblems.com/1025)\n- [Er71] Erdős, P., *Some unsolved problems in graph theory and combinatorial analysis*.\n  Combinatorial Mathematics and its Applications (Proc. Conf., Oxford, 1969) (1971), 97-109.\n- [ErHa58] Erdős, P. and Hajnal, A., *On the structure of set mappings*. Acta Math. Acad. Sci.\n  Hungar. (1958), 111-133.\n- [Sp72] Spencer, Joel, *Turán's theorem for $k$-graphs*. Discrete Math. (1972), 183--186.\n- [CFS16] Conlon, David and Fox, Jacob and Sudakov, Benny, *Short proofs of some extremal results\n  II*. J. Combin. Theory Ser. B (2016), 173--196.\n-/\n\n@[expose] public section\n\nopen Filter Asymptotics\n\nnamespace Erdos1025\n\n/-- `X` is independent for a set mapping `f` on pairs if `f s(x, y) ∉ X` whenever `x ≠ y` are in\n`X`. -/\ndef IsIndependent {n : ℕ} (f : Sym2 (Fin n) → Fin n) (X : Finset (Fin n)) : Prop :=\n  ∀ x ∈ X, ∀ y ∈ X, x ≠ y → f s(x, y) ∉ X\n\n/-- `g n` is the largest `k` such that every set mapping `f` on the pairs of an `n`-element set\nwith `f(x, y) ∉ {x, y}` admits an independent set of size at least `k`. -/\nnoncomputable def g (n : ℕ) : ℕ :=\n  sSup {k : ℕ | k ≤ n ∧ ∀ f : Sym2 (Fin n) → Fin n,\n    (∀ x y, x ≠ y → f s(x, y) ≠ x ∧ f s(x, y) ≠ y) →\n      ∃ X : Finset (Fin n), IsIndependent f X ∧ k ≤ X.card}\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $f$ be a function from all pairs of elements in $\\{1,\\ldots,n\\}$ to $\\{1,\\ldots,n\\}$ such\nthat $f(x,y)\\neq x$ and $\\neq y$ for all $x,y$. We call $X\\subseteq \\{1,\\ldots,n\\}$ independent\nif whenever $x,y\\in X$ we have $f(x,y)\\not\\in X$.\n\nLet $g(n)$ be such that, in every function $f$, there is an independent set of size at least\n$g(n)$. Estimate $g(n)$.\n\nA question of Erdős and Hajnal [ErHa58], who could prove $n^{1/3} \\ll g(n) \\ll (n\\log n)^{1/2}$.\nSpencer [Sp72] proved $g(n)\\gg n^{1/2}$. Conlon, Fox, and Sudakov [CFS16] proved\n$g(n)\\ll n^{1/2}$.\n-/\n@[category research solved, AMS 5, formal_proof using lean4 at\n  \"https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/ErdosProblems/Erdos1025.lean#L829\"]\ntheorem erdos_1025 : (fun n : ℕ => (g n : ℝ)) =Θ[atTop] fun n : ℕ => √n := by\n  sorry\n\nend Erdos1025\n",
  "statement_hash": "ed943cea5b074c5fd7a91f6318d4e3c3b46a57f87c47eb8225eade4b691681a2",
  "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."
}