{
  "id": "2548",
  "ident": "NS.02548",
  "slug": "erdos-595",
  "title": "Erdős Problem 595",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "**Erdős Problem 595 (\\$250)**: Is there an infinite graph $G$ which contains no $K_4$ and is\nnot the union of countably many triangle-free graphs?\n\nA problem of Erdős and Hajnal [Er87].",
  "subjects": [
    "math.CO",
    "msc:05"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos595.erdos_595",
  "statement_lean": "theorem erdos_595 :\n    ∃ (V : Type*) (_ : Infinite V) (G : SimpleGraph V),\n      G.CliqueFree 4 ∧ ¬IsCountableUnionOfTriangleFree G",
  "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 595\n\n*References:*\n- [erdosproblems.com/595](https://www.erdosproblems.com/595)\n- [Er87] Erdős, Paul, Problems and results on set systems and hypergraphs. Extremal problems\n  for finite sets (Visegrád, 1991), Bolyai Soc. Math. Stud. (1994), 217-227.\n- [Fo70] Folkman, Jon, Graphs with monochromatic complete subgraphs in every edge coloring.\n  SIAM J. Appl. Math. (1970), 19:340-345.\n- [NeRo75] Nešetřil, Jaroslav and Rödl, Vojtěch, Type theory of partition problems of graphs.\n  Recent advances in graph theory (Proc. Second Czechoslovak Sympos., Prague, 1974),\n  Academia, Prague (1975), 405-412.\n-/\n\n@[expose] public section\n\nopen SimpleGraph Set\n\nnamespace Erdos595\n\ndef IsCountableUnionOfTriangleFree {V : Type*} (G : SimpleGraph V) : Prop :=\n  ∃ H : ℕ → SimpleGraph V, (∀ i, (H i).CliqueFree 3) ∧ G = ⨆ i, H i\n\n/-\n## Main open problem\n-/\n\n/--\n**Erdős Problem 595 (\\$250)**: Is there an infinite graph $G$ which contains no $K_4$ and is\nnot the union of countably many triangle-free graphs?\n\nA problem of Erdős and Hajnal [Er87].\n-/\n@[category research open, question, AMS 5]\ntheorem erdos_595 :\n    ∃ (V : Type*) (_ : Infinite V) (G : SimpleGraph V),\n      G.CliqueFree 4 ∧ ¬IsCountableUnionOfTriangleFree G := by\n  sorry\n\n/-\n## Variants and partial results\n-/\n\n/--\n**Folkman–Nešetřil–Rödl (finite version) [Fo70, NeRo75]**: For every `n ≥ 1`, there exists a\ngraph `G` (on a finite vertex set) that contains no $K_4$ and whose edges cannot be covered by\n`n` triangle-free graphs.\n\nMore precisely: for every `n : ℕ` with `1 ≤ n`, there exist a finite type `V` and a graph\n`G : SimpleGraph V` with:\n1. `G.CliqueFree 4` (no $K_4$), and\n2. For every family `H : Fin n → SimpleGraph V` of triangle-free graphs, `G ≠ ⨆ i, H i`.\n\nThis is the finite analogue of Problem 595. The proofs of Folkman [Fo70] and Nešetřil–Rödl\n[NeRo75] give different explicit constructions.\n-/\n@[category research solved, question, AMS 5]\ntheorem erdos_595.variants.folkman_finite :\n    ∀ n : ℕ, 1 ≤ n →\n    ∃ (V : Type*) (_ : Fintype V) (G : SimpleGraph V),\n      G.CliqueFree 4 ∧\n      ∀ (H : Fin n → SimpleGraph V), (∀ i, (H i).CliqueFree 3) → G ≠ ⨆ i, H i := by\n  -- Folkman [Fo70] and Nešetřil–Rödl [NeRo75]: explicit construction exists.\n  sorry\n\n/--\n**Monotonicity**: If `G` is a countable union of triangle-free graphs and `H ≤ G` (i.e., `H` is\na subgraph of `G`), then `H` is also a countable union of triangle-free graphs.\n\n**Proof**: If `G = ⨆ i, G_i` with each `G_i` triangle-free, then `H = ⨆ i, H ⊓ G_i`.\nEach `H ⊓ G_i` is triangle-free because it is a subgraph of `G_i`.\n-/\n@[category textbook, AMS 5]\ntheorem erdos_595.variants.subgraph_of_countable_union\n    {V : Type*} {G H : SimpleGraph V}\n    (hH : H ≤ G) (hG : IsCountableUnionOfTriangleFree G) :\n    IsCountableUnionOfTriangleFree H := by\n  obtain ⟨f, hf_free, hf_eq⟩ := hG\n  refine ⟨fun i => H ⊓ f i, fun i => (hf_free i).anti inf_le_right, ?_⟩\n  ext a b\n  simp only [iSup_adj, inf_adj]\n  constructor\n  · intro hab\n    have habG : G.Adj a b := hH hab\n    rw [hf_eq, iSup_adj] at habG\n    obtain ⟨i, hi⟩ := habG\n    exact ⟨i, hab, hi⟩\n  · rintro ⟨i, hHab, _⟩\n    exact hHab\n\n/--\n**Triangle-free graphs are trivially countable unions of triangle-free graphs**: if `G` is\nalready triangle-free, then `G = ⨆ i : ℕ, G_i` where `G_0 = G` and `G_i = ⊥` for `i ≥ 1`.\n-/\n@[category textbook, AMS 5]\ntheorem erdos_595.variants.triangle_free_is_union\n    {V : Type*} (G : SimpleGraph V) (hG : G.CliqueFree 3) :\n    IsCountableUnionOfTriangleFree G := by\n  refine ⟨fun i => if i = 0 then G else ⊥, fun i => ?_, ?_⟩\n  · by_cases h : i = 0\n    · simp [h, hG]\n    · simp [h, cliqueFree_bot (by norm_num : 2 ≤ 3)]\n  · ext a b\n    simp only [iSup_adj]\n    constructor\n    · intro hab\n      exact ⟨0, by simp [hab]⟩\n    · rintro ⟨i, hi⟩\n      by_cases h : i = 0\n      · simp [h] at hi; exact hi\n      · simp [h] at hi\n\n/--\n**The complete graph `⊤` on `ℕ` is a countable union of triangle-free graphs**: we decompose\nit into the family of star graphs `{H_m}_{m : ℕ}`, where `H_m` is the graph with edges `{m, n}`\nfor all `n ≠ m`. Each star is triangle-free (any two non-center vertices share no edge within\nthe star), and their union covers all edges of `⊤`.\n\n**Proof sketch (star triangle-free):** If `{a, b, c}` were a triangle in `H_m`, then each of\nthe three edges `{a, b}`, `{a, c}`, `{b, c}` would pass through `m`. In particular, from\n`{a, b}` we get `a = m` or `b = m`; from `{b, c}` we get `b = m` or `c = m`. Case analysis\nshows that two vertices must equal `m`, contradicting the triangle having three distinct vertices.\n-/\n@[category textbook, AMS 5]\ntheorem erdos_595.variants.complete_nat_is_union :\n    IsCountableUnionOfTriangleFree (⊤ : SimpleGraph ℕ) := by\n  -- Star at m: edges are all {a, b} where a = m or b = m (and a ≠ b, by SimpleGraph.fromRel).\n  refine ⟨fun m => SimpleGraph.fromRel (fun (a b : ℕ) => a = m ∨ b = m),\n          fun m => ?_, ?_⟩\n  · -- Each star H_m is triangle-free.\n    rw [CliqueFree]\n    intro s hs\n    simp only [isNClique_iff] at hs\n    obtain ⟨hs_clique, hs_card⟩ := hs\n    rw [isClique_iff] at hs_clique\n    obtain ⟨a, b, c, hab, hac, hbc, hs_eq⟩ := Finset.card_eq_three.mp hs_card\n    -- Extract membership in s.\n    have ha : a ∈ s := hs_eq ▸ Finset.mem_insert_self a _\n    have hb : b ∈ s := hs_eq ▸ Finset.mem_insert.mpr\n                        (Or.inr (Finset.mem_insert_self b _))\n    have hc : c ∈ s := hs_eq ▸ Finset.mem_insert.mpr\n                        (Or.inr (Finset.mem_insert.mpr (Or.inr (Finset.mem_singleton_self c))))\n    -- Each pair is adjacent in H_m.\n    have hab_adj := hs_clique ha hb hab\n    have hac_adj := hs_clique ha hc hac\n    have hbc_adj := hs_clique hb hc hbc\n    -- fromRel_adj: (fromRel r).Adj x y ↔ x ≠ y ∧ (r x y ∨ r y x)\n    -- For r x y = (x = m ∨ y = m): r x y ∨ r y x simplifies to x = m ∨ y = m.\n    simp only [fromRel_adj] at hab_adj hac_adj hbc_adj\n    -- Extract \"a = m or b = m\", \"a = m or c = m\", \"b = m or c = m\".\n    have ham_or_bm : a = m ∨ b = m := hab_adj.2.elim id Or.symm\n    have ham_or_cm : a = m ∨ c = m := hac_adj.2.elim id Or.symm\n    have hbm_or_cm : b = m ∨ c = m := hbc_adj.2.elim id Or.symm\n    -- Case analysis: whichever vertex equals m forces another to equal m as well,\n    -- contradicting distinctness.\n    rcases ham_or_bm with rfl | rfl\n    · -- a = m\n      rcases hbm_or_cm with rfl | rfl\n      · exact absurd rfl hab   -- b = a = m\n      · exact absurd rfl hac   -- c = a = m\n    · -- b = m\n      rcases ham_or_cm with rfl | rfl\n      · exact hab.symm rfl  -- a = b = m, so a = m and b = m, contradiction\n      · exact hbc rfl       -- c = b = m, so b = c, contradiction\n  · -- The union ⨆ m, H_m equals ⊤.\n    ext a b\n    simp only [iSup_adj, fromRel_adj, top_adj]\n    -- Goal: a ≠ b ↔ ∃ m, a ≠ b ∧ ((a = m ∨ b = m) ∨ (b = m ∨ a = m))\n    exact ⟨fun hab => ⟨a, hab, Or.inl (Or.inl rfl)⟩,\n           fun ⟨_, hne, _⟩ => hne⟩\n\n/--\n**The complete graph `⊤` on `Fin 4` is not $K_4$-free**: `⊤` on `Fin 4` equals the complete\ngraph $K_4$, so it contains $K_4$ as a subgraph and is not $K_4$-free.\n\nThis sanity check confirms the $K_4$-free hypothesis of Problem 595 is non-trivial.\n-/\n@[category textbook, AMS 5]\ntheorem erdos_595.variants.K4_not_cliqueFree :\n    ¬ (⊤ : SimpleGraph (Fin 4)).CliqueFree 4 := by\n  rw [SimpleGraph.not_cliqueFree_iff_top_isContained]\n  exact IsContained.of_le fun ⦃v w⦄ a ↦ a\n\n/--\n**Reformulation via edge colourings**: A graph `G` is a countable union of triangle-free graphs\nif and only if there is a colouring of the edges of `G` by `ℕ` such that no monochromatic\ntriangle exists.\n\nMore precisely: `IsCountableUnionOfTriangleFree G` is equivalent to the existence of a map\n`c : G.edgeSet → ℕ` such that for each `n : ℕ`, the subgraph of edges coloured `n` is triangle-free.\n-/\n@[category test, AMS 5]\ntheorem erdos_595.variants.reformulation_edge_colouring {V : Type*} (G : SimpleGraph V) :\n    IsCountableUnionOfTriangleFree G ↔\n    ∃ c : G.edgeSet → ℕ,\n      ∀ n : ℕ,\n        (SimpleGraph.fromEdgeSet {e | ∃ h : e ∈ G.edgeSet, c ⟨e, h⟩ = n}).CliqueFree 3 := by\n  -- Note: `c : G.edgeSet → ℕ` is exactly `EdgeLabeling G ℕ`, and the `fromEdgeSet` expression\n  -- is exactly `EdgeLabeling.labelGraph c n`. We use `EdgeLabeling.iSup_labelGraph` for (←).\n  constructor\n  · -- (→): Given H : ℕ → SimpleGraph V with G = ⨆ H i and each H i triangle-free,\n    -- construct c : G.edgeSet → ℕ by choosing some i containing each edge classically.\n    rintro ⟨H, hH_free, hH_eq⟩\n    -- For each edge e = s(a,b) of G, use iSup_adj to find some H i containing it.\n    -- We use Sym2.ind to destructure e into s(a,b) form and then apply mem_edgeSet + iSup_adj.\n    have hcov : ∀ e : G.edgeSet, ∃ i, (e : Sym2 V) ∈ (H i).edgeSet :=\n      fun ⟨e, he⟩ => Sym2.ind (fun a b he => by\n        rw [hH_eq, mem_edgeSet, iSup_adj] at he\n        exact he.imp fun i hi => hi) e he\n    -- Define c by classical choice of the covering index.\n    refine ⟨fun e => (hcov e).choose, fun n => ?_⟩\n    -- Show the subgraph of edges coloured n is a subgraph of H n, hence triangle-free.\n    apply (hH_free n).anti\n    intro x y hxy\n    rw [fromEdgeSet_adj] at hxy\n    obtain ⟨⟨h_mem, h_eq⟩, _⟩ := hxy\n    -- h_eq : (hcov ⟨s(x,y), h_mem⟩).choose = n\n    -- choose_spec gives s(x,y) ∈ (H (choose)).edgeSet; after rewriting with h_eq, in H n.\n    have hspec := (hcov ⟨s(x, y), h_mem⟩).choose_spec\n    simp only [h_eq] at hspec\n    exact hspec\n  · -- (←): Given c : G.edgeSet → ℕ, define H n = fromEdgeSet {e | ∃ h, c ⟨e,h⟩ = n}.\n    -- This is EdgeLabeling.labelGraph c n, so ⨆ n, H n = G by iSup_labelGraph.\n    rintro ⟨c, hc⟩\n    refine ⟨fun n => SimpleGraph.fromEdgeSet {e | ∃ h : e ∈ G.edgeSet, c ⟨e, h⟩ = n},\n            hc, ?_⟩\n    -- G = ⨆ n, (labelGraph c n) follows from EdgeLabeling.iSup_labelGraph.\n    exact (EdgeLabeling.iSup_labelGraph (G := G) c).symm\n\nend Erdos595\n",
  "statement_hash": "13814bad4208c5dc2b05da99f36a5ec59c088198bf0e280657d05f61407f7f8a",
  "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."
}