{
  "id": "1391",
  "ident": "NS.01391",
  "slug": "erdos-23",
  "title": "Erdős Problem 23",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Every triangle-free graph on $25$ vertices can be made bipartite by removing at most $25$\nedges.\n\nThis is the $n = 5$ case of Erdős Problem 23.  It follows from the high-density range of\nBalogh-Clemen-Lidicky together with McKay's complete catalogue of the 23-vertex extremal\ngraphs for bipartization of triangle-free graphs.",
  "subjects": [
    "math.CO",
    "msc:05"
  ],
  "tags": [],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos23.erdos_23.variants.n5",
  "statement_lean": "theorem erdos_23.variants.n5 :\n    ∀ (G : SimpleGraph (Fin 25)), G.CliqueFree 3 → ∃ (H : SimpleGraph (Fin 25)),\n        H ≤ G ∧ H.IsBipartite ∧ (G.edgeFinset \\ H.edgeFinset).card ≤ 25",
  "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 23\n\n*References:*\n* [erdosproblems.com/23](https://www.erdosproblems.com/23)\n* [OEIS A389646](https://oeis.org/A389646)\n* [Balogh-Clemen-Lidicky, Max Cuts in Triangle-free Graphs](https://arxiv.org/abs/2103.14179)\n* [McKay, Extremal graphs for bipartization of triangle-free graphs](https://users.cecs.anu.edu.au/~bdm/data/graphs.html)\n-/\n\n@[expose] public section\n\nopen SimpleGraph BigOperators\n\nnamespace Erdos23\n\nopen scoped Classical in\n/--\nEvery triangle-free graph on $5$ vertices can be made bipartite by removing at most $1$ edge.\nThis is the $n = 1$ case of Erdős Problem 23.\n-/\n@[category test, AMS 5]\ntheorem erdos_23.variants.n1 :\n    ∀ (G : SimpleGraph (Fin 5)), G.CliqueFree 3 → ∃ (H : SimpleGraph (Fin 5)),\n        H ≤ G ∧ H.IsBipartite ∧ (G.edgeFinset \\ H.edgeFinset).card ≤ 1 := by\n  sorry\n\nopen scoped Classical in\n/--\nThere exists a triangle-free graph on $5$ vertices such that at least $1$ edge must be removed\nto make it bipartite. This shows the bound in `erdos_23_n1` is tight.\n-/\n@[category test, AMS 5]\ntheorem erdos_23.variants.n1_tight :\n    ∃ (G : SimpleGraph (Fin 5)), G.CliqueFree 3 ∧ ∀ (H : SimpleGraph (Fin 5)),\n        H ≤ G → H.IsBipartite → 1 ≤ (G.edgeFinset \\ H.edgeFinset).card := by\n  -- The `5`-cycle is triangle-free, and a bipartite subgraph missing no edge would be the\n  -- `5`-cycle itself, which has chromatic number `3`.\n  refine ⟨cycleGraph 5, by unfold CliqueFree; decide +kernel, fun H hHG hH => ?_⟩\n  by_contra hcon\n  have h0 := Finset.card_eq_zero.1 (Nat.lt_one_iff.1 (not_le.1 hcon))\n  have hsub := Finset.sdiff_eq_empty_iff_subset.1 h0\n  rw [Finset.subset_iff] at hsub\n  simp only [mem_edgeFinset] at hsub\n  have hGH : cycleGraph 5 ≤ H := edgeSet_subset_edgeSet.1 fun _ he => hsub he\n  obtain rfl : H = cycleGraph 5 := le_antisymm hHG hGH\n  have h2 := hH.chromaticNumber_le\n  rw [chromaticNumber_cycleGraph_of_odd 5 (by norm_num) (by decide)] at h2\n  exact absurd h2 (by decide)\n\nopen scoped Classical in\n/--\nEvery triangle-free graph on $25$ vertices can be made bipartite by removing at most $25$\nedges.\n\nThis is the $n = 5$ case of Erdős Problem 23.  It follows from the high-density range of\nBalogh-Clemen-Lidicky together with McKay's complete catalogue of the 23-vertex extremal\ngraphs for bipartization of triangle-free graphs.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_23.variants.n5 :\n    ∀ (G : SimpleGraph (Fin 25)), G.CliqueFree 3 → ∃ (H : SimpleGraph (Fin 25)),\n        H ≤ G ∧ H.IsBipartite ∧ (G.edgeFinset \\ H.edgeFinset).card ≤ 25 := by\n  sorry\n\nopen scoped Classical in\n/--\nThere exists a triangle-free graph on $25$ vertices such that at least $25$ edges must be\nremoved to make it bipartite.  The balanced blow-up of $C_5$ with five parts of size $5$\nwitnesses this.\n-/\n@[category research solved, AMS 5]\ntheorem erdos_23.variants.n5_tight :\n    ∃ (G : SimpleGraph (Fin 25)), G.CliqueFree 3 ∧ ∀ (H : SimpleGraph (Fin 25)),\n        H ≤ G → H.IsBipartite → 25 ≤ (G.edgeFinset \\ H.edgeFinset).card := by\n  sorry\n\n/--\nThe blow-up of the 5-cycle $C_5$: replace each vertex of $C_5$ with an independent set of $n$\nvertices, and connect two vertices iff their corresponding vertices in $C_5$ are adjacent.\nThe vertex set is $\\mathbb{Z}/5\\mathbb{Z} \\times \\{0, \\ldots, n-1\\}$, where $(i, a)$ and $(j, b)$\nare adjacent iff $j = i + 1$ or $i = j + 1$ in $\\mathbb{Z}/5\\mathbb{Z}$.\n-/\ndef blowupC5 (n : ℕ) : SimpleGraph (ZMod 5 × Fin n) :=\n  SimpleGraph.fromRel fun (i, _) (j, _) => i + 1 = j ∨ j + 1 = i\n\nopen scoped Classical in\n/--\nThe blow-up of $C_5$ shows that the bound $n^2$ in Erdős Problem 23 is tight:\nany bipartite subgraph must omit at least $n^2$ edges.\n-/\n@[category test, AMS 5]\ntheorem blowupC5_tight (n : ℕ) (_hn : 0 < n) (H : SimpleGraph (ZMod 5 × Fin n))\n    (hH : H ≤ blowupC5 n) (hBip : H.IsBipartite) :\n    n ^ 2 ≤ ((blowupC5 n).edgeFinset \\ H.edgeFinset).card := by\n  sorry\n\nopen scoped Classical in\n/--\nCan every triangle-free graph on $5n$ vertices be made bipartite by deleting at most $n^2$ edges?\n-/\n@[category research open, question, AMS 5]\ntheorem erdos_23 :\n    ∀ (n : ℕ) (V : Type) [Fintype V], Fintype.card V = 5 * n →\n      ∀ (G : SimpleGraph V), G.CliqueFree 3 →\n        ∃ (H : SimpleGraph V),\n          H ≤ G ∧ H.IsBipartite ∧ (G.edgeFinset \\ H.edgeFinset).card ≤ n^2 := by\n  sorry\n\n-- TODO: add the remaining variants/statements/comments\n\nend Erdos23\n",
  "statement_hash": "778402de8964ec2c48347d999accdc6a8dd62632979e5319c841a162c881f206",
  "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."
}