import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Combinatorics.SimpleGraph.Finite import Mathlib.Combinatorics.SimpleGraph.Clique import Mathlib.Combinatorics.SimpleGraph.Acyclic import Mathlib.Combinatorics.Hall.Basic import Mathlib.Data.Finset.Card import Mathlib.Data.Finset.Max import Mathlib.Dynamics.PeriodicPts.Defs import Mathlib.Tactic /-! # Sharp Weak König–Egerváry Threshold for Triangle-Free Graphs and Tuza's Conjecture for K₄-Free 8-Degenerate Graphs We prove and formalize: 1. **Master WKE Link-Reduction Theorem** for Tuza's Conjecture (`τ(G) ≤ 2 ν(G)`). 2. **Exact WKE Threshold for General Graphs (`n ≤ 4`)**, sharp at `n = 5` (`K₅` and `K₅ - 2K₂`). 3. **Subcubic / `Δ ≤ 2` WKE Theorem**: every finite graph of maximum degree `≤ 2` is WKE. 4. **Sharp Triangle-Free WKE Threshold (`n ≤ 8`)**: every finite triangle-free graph on at most 8 vertices is weak König–Egerváry, proved via a purely structural argument combining Hall's Marriage Theorem (`2α ≥ n`), degree-2 reduction (`n = 7, 8`), and a unique 3-regular Möbius-ladder (`M₈`) classification — and sharp at `n = 9` via the symmetric blow-up `C₅[2,2,2,2,1]` (dissociation number `ψ = 4`). 5. **Headline Tuza Conjecture Theorems**: - Every `K₄`-free `8`-degenerate graph (even localized to the triangle-support subgraph `G_△`) satisfies `τ(G) ≤ 2 ν(G)`. - Corollaries for `K₄`-free graphs with `mad(G) < 9`, `K₄`-free graphs of arboricity `≤ 4`, minimum-degree barrier `δ ≥ 9` for edge-minimal `K₄`-free counterexamples, general `4`-degenerate graphs, and `B₃`-free (edge-codegree `≤ 2`) graphs. - Explicit infinite separation family `G_m = K_{4,4} ∨ I_m` with `Δ = m + 4 → ∞`, edge-codegree `m → ∞`, and average degree `(16m + 32)/(m + 8) → 16 > 25/2`. -/ open Finset SimpleGraph namespace TuzaK4Free /-! ## Section 1: Core Definitions of Tuza's Conjecture -/ section CoreDefinitions variable {V : Type*} /-- A triangle in a simple graph `G` is a 3-element vertex subset inducing a `K₃`. -/ def IsTriangle (G : SimpleGraph V) (T : Finset V) : Prop := T.card = 3 ∧ ∀ u ∈ T, ∀ v ∈ T, u ≠ v → G.Adj u v /-- The finset of all unordered pairs of distinct vertices inside `T`. -/ def subsetEdges [DecidableEq V] (T : Finset V) : Finset (Sym2 V) := T.offDiag.image (fun p => s(p.1, p.2)) lemma mem_subsetEdges [DecidableEq V] {T : Finset V} {u v : V} : s(u, v) ∈ subsetEdges T ↔ u ∈ T ∧ v ∈ T ∧ u ≠ v := by simp only [subsetEdges, mem_image, mem_offDiag, Prod.exists, Sym2.eq, Sym2.rel_iff', Prod.mk.injEq] constructor · rintro ⟨a, b, ⟨ha, hb, hab⟩, (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)⟩ · exact ⟨ha, hb, hab⟩ · exact ⟨hb, ha, hab.symm⟩ · rintro ⟨hu, hv, huv⟩ exact ⟨u, v, ⟨hu, hv, huv⟩, Or.inl ⟨rfl, rfl⟩⟩ /-- A triangle packing in `G` is a finset of pairwise edge-disjoint triangles of `G`. -/ def IsTrianglePacking [DecidableEq V] (G : SimpleGraph V) (P : Finset (Finset V)) : Prop := (∀ T ∈ P, IsTriangle G T) ∧ (∀ T₁ ∈ P, ∀ T₂ ∈ P, T₁ ≠ T₂ → Disjoint (subsetEdges T₁) (subsetEdges T₂)) /-- A triangle transversal in `G` is a finset of edges of `G` hitting every triangle of `G`. -/ def IsTriangleTransversal [DecidableEq V] (G : SimpleGraph V) (C : Finset (Sym2 V)) : Prop := (∀ e ∈ C, e ∈ G.edgeSet) ∧ (∀ T : Finset V, IsTriangle G T → ∃ e ∈ C, e ∈ subsetEdges T) /-- The triangle packing number `ν(G)`: maximum size of a triangle packing. -/ noncomputable def nu [DecidableEq V] (G : SimpleGraph V) : ℕ := sSup {k : ℕ | ∃ P : Finset (Finset V), IsTrianglePacking G P ∧ P.card = k} /-- The triangle transversal number `τ(G)`: minimum size of a triangle transversal. -/ noncomputable def tau [DecidableEq V] (G : SimpleGraph V) : ℕ := sInf {k : ℕ | ∃ C : Finset (Sym2 V), IsTriangleTransversal G C ∧ C.card = k} lemma isTrianglePacking_empty [DecidableEq V] (G : SimpleGraph V) : IsTrianglePacking G ∅ := by simp [IsTrianglePacking] lemma isTriangleTransversal_edgeFinset [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] : IsTriangleTransversal G G.edgeFinset := by refine ⟨fun e he => by simpa [mem_edgeFinset] using he, fun T hT => ?_⟩ have h1 : 1 < T.card := by have := hT.1; omega obtain ⟨u, hu, v, hv, huv⟩ := Finset.one_lt_card.mp h1 refine ⟨s(u, v), ?_, mem_subsetEdges.mpr ⟨hu, hv, huv⟩⟩ rw [mem_edgeFinset] exact hT.2 u hu v hv huv lemma packing_bddAbove [Fintype V] [DecidableEq V] (G : SimpleGraph V) : BddAbove {k : ℕ | ∃ P : Finset (Finset V), IsTrianglePacking G P ∧ P.card = k} := by refine ⟨Fintype.card (Finset V), ?_⟩ rintro k ⟨P, _, rfl⟩ exact Finset.card_le_univ P lemma nu_ge_of_packing [Fintype V] [DecidableEq V] {G : SimpleGraph V} {P : Finset (Finset V)} (hP : IsTrianglePacking G P) : P.card ≤ nu G := le_csSup (packing_bddAbove G) ⟨P, hP, rfl⟩ lemma exists_max_packing [Fintype V] [DecidableEq V] (G : SimpleGraph V) : ∃ P : Finset (Finset V), IsTrianglePacking G P ∧ P.card = nu G := by have hne : ({k : ℕ | ∃ P : Finset (Finset V), IsTrianglePacking G P ∧ P.card = k}).Nonempty := ⟨0, ∅, isTrianglePacking_empty G, rfl⟩ exact Nat.sSup_mem hne (packing_bddAbove G) lemma tau_le_of_transversal [DecidableEq V] {G : SimpleGraph V} {C : Finset (Sym2 V)} (hC : IsTriangleTransversal G C) : tau G ≤ C.card := Nat.sInf_le ⟨C, hC, rfl⟩ lemma exists_min_transversal [Fintype V] [DecidableEq V] (G : SimpleGraph V) : ∃ C : Finset (Sym2 V), IsTriangleTransversal G C ∧ C.card = tau G := by classical have hne : ({k : ℕ | ∃ C : Finset (Sym2 V), IsTriangleTransversal G C ∧ C.card = k}).Nonempty := ⟨G.edgeFinset.card, G.edgeFinset, isTriangleTransversal_edgeFinset G, rfl⟩ exact Nat.sInf_mem hne lemma tau_eq_zero_of_triangleFree [DecidableEq V] {G : SimpleGraph V} (h : ∀ T : Finset V, ¬ IsTriangle G T) : tau G = 0 := by apply Nat.eq_zero_of_le_zero have hC : IsTriangleTransversal G ∅ := ⟨fun _ he => by simp at he, fun T hT => (h T hT).elim⟩ exact tau_le_of_transversal hC lemma isTriangle_mono {G H : SimpleGraph V} (hle : H ≤ G) {T : Finset V} (hT : IsTriangle H T) : IsTriangle G T := ⟨hT.1, fun u hu v hv huv => hle (hT.2 u hu v hv huv)⟩ /-- Core Reducible-Set Lemma: if `F` is a set of edges, `P₀` is a packing of triangles all contained in `F`, and `C₀` is a set of edges of `G` hitting every triangle of `G` that intersects `F`, then deleting `F` drops `ν` by at least `|P₀|` and increases `τ` by at most `|C₀|`. -/ theorem reducible_edgeSet_step [Fintype V] [DecidableEq V] {G : SimpleGraph V} (F C₀ : Finset (Sym2 V)) (P₀ : Finset (Finset V)) (hC₀_sub : ∀ e ∈ C₀, e ∈ G.edgeSet) (hP₀ : IsTrianglePacking G P₀) (hP₀_in_F : ∀ T ∈ P₀, subsetEdges T ⊆ F) (hC₀_hits : ∀ T : Finset V, IsTriangle G T → (∃ e ∈ subsetEdges T, e ∈ F) → ∃ e ∈ C₀, e ∈ subsetEdges T) : nu (G.deleteEdges (F : Set (Sym2 V))) + P₀.card ≤ nu G ∧ tau G ≤ tau (G.deleteEdges (F : Set (Sym2 V))) + C₀.card := by set G' := G.deleteEdges (F : Set (Sym2 V)) with hG'_def have hle : G' ≤ G := SimpleGraph.deleteEdges_le _ constructor · obtain ⟨P', hP', hP'_card⟩ := exists_max_packing G' have hdisj_edges : ∀ T' ∈ P', ∀ T₀ ∈ P₀, Disjoint (subsetEdges T') (subsetEdges T₀) := by intro T' hT' T₀ hT₀ rw [Finset.disjoint_left] intro e he' he₀ have heF : e ∈ F := hP₀_in_F T₀ hT₀ he₀ induction e using Sym2.ind with | _ u v => rw [mem_subsetEdges] at he' have hadj : G'.Adj u v := (hP'.1 T' hT').2 u he'.1 v he'.2.1 he'.2.2 rw [hG'_def, SimpleGraph.deleteEdges_adj] at hadj exact hadj.2 heF have hdisj_P : Disjoint P' P₀ := by rw [Finset.disjoint_left] intro T hT' hT₀ have hT := hP'.1 T hT' have h1 : 1 < T.card := by have := hT.1; omega obtain ⟨u, hu, v, hv, huv⟩ := Finset.one_lt_card.mp h1 have he : s(u, v) ∈ subsetEdges T := mem_subsetEdges.mpr ⟨hu, hv, huv⟩ exact Finset.disjoint_left.mp (hdisj_edges T hT' T hT₀) he he have hPack : IsTrianglePacking G (P' ∪ P₀) := by refine ⟨fun T hT => ?_, fun T₁ hT₁ T₂ hT₂ hne => ?_⟩ · rcases Finset.mem_union.mp hT with h | h · exact isTriangle_mono hle (hP'.1 T h) · exact hP₀.1 T h · rcases Finset.mem_union.mp hT₁ with h1 | h1 <;> rcases Finset.mem_union.mp hT₂ with h2 | h2 · exact hP'.2 T₁ h1 T₂ h2 hne · exact hdisj_edges T₁ h1 T₂ h2 · exact (hdisj_edges T₂ h2 T₁ h1).symm · exact hP₀.2 T₁ h1 T₂ h2 hne have hcard : (P' ∪ P₀).card = nu G' + P₀.card := by rw [Finset.card_union_of_disjoint hdisj_P, hP'_card] rw [← hcard] exact nu_ge_of_packing hPack · obtain ⟨C', hC', hC'_card⟩ := exists_min_transversal G' have hTrans : IsTriangleTransversal G (C' ∪ C₀) := by refine ⟨fun e he => ?_, fun T hT => ?_⟩ · rcases Finset.mem_union.mp he with h | h · exact SimpleGraph.edgeSet_mono hle (hC'.1 e h) · exact hC₀_sub e h · by_cases hhit : ∃ e ∈ subsetEdges T, e ∈ F · obtain ⟨e, heC, heT⟩ := hC₀_hits T hT hhit exact ⟨e, Finset.mem_union_right _ heC, heT⟩ · push Not at hhit have hT' : IsTriangle G' T := by refine ⟨hT.1, fun u hu v hv huv => ?_⟩ rw [hG'_def, SimpleGraph.deleteEdges_adj] exact ⟨hT.2 u hu v hv huv, hhit s(u, v) (mem_subsetEdges.mpr ⟨hu, hv, huv⟩)⟩ obtain ⟨e, heC', heT⟩ := hC'.2 T hT' exact ⟨e, Finset.mem_union_left _ heC', heT⟩ calc tau G ≤ (C' ∪ C₀).card := tau_le_of_transversal hTrans _ ≤ C'.card + C₀.card := Finset.card_union_le C' C₀ _ = tau G' + C₀.card := by rw [hC'_card] end CoreDefinitions /-! ## Section 2: Weak König–Egerváry (WKE) Graphs & Master Link-Reduction Engine -/ section WKEDefinitions /-- A matching in a simple graph `L` is a finset of pairwise vertex-disjoint edges of `L`. -/ def IsMatching {W : Type*} (L : SimpleGraph W) (M : Finset (Sym2 W)) : Prop := (∀ e ∈ M, e ∈ L.edgeSet) ∧ (∀ e₁ ∈ M, ∀ e₂ ∈ M, e₁ ≠ e₂ → ∀ x : W, x ∈ e₁ → x ∉ e₂) /-- A finite simple graph `L` is **weak König–Egerváry (WKE)** (Puleo 2015) if there exist a matching `M` of `L` and a vertex set `Q` with `|Q| ≤ |M|` such that every edge of `L - Q` belongs to `M`. -/ def IsWKE {W : Type*} (L : SimpleGraph W) : Prop := ∃ (M : Finset (Sym2 W)) (Q : Finset W), IsMatching L M ∧ Q.card ≤ M.card ∧ ∀ u v : W, L.Adj u v → u ∉ Q → v ∉ Q → s(u, v) ∈ M lemma isMatching_empty {W : Type*} (L : SimpleGraph W) : IsMatching L ∅ := by simp [IsMatching] lemma isMatching_singleton {W : Type*} {L : SimpleGraph W} {u v : W} (h : L.Adj u v) : IsMatching L {s(u, v)} := by refine ⟨fun e he => ?_, fun e₁ h1 e₂ h2 hne => ?_⟩ · simp only [mem_singleton] at he; subst he; exact h · simp only [mem_singleton] at h1 h2; exact (hne (h1.trans h2.symm)).elim /-- Endpoints of a matching are pairwise disjoint, so `2 * |M| ≤ |W|`. -/ lemma two_mul_card_le_of_isMatching {W : Type*} [Fintype W] [DecidableEq W] {L : SimpleGraph W} {M : Finset (Sym2 W)} (hM : IsMatching L M) : 2 * M.card ≤ Fintype.card W := by classical let pts : Sym2 W → Finset W := fun e => Finset.univ.filter (fun x => x ∈ e) have hpts_card : ∀ e ∈ M, (pts e).card = 2 := by intro e he have hadj := hM.1 e he induction e using Sym2.ind with | _ u v => have huv : u ≠ v := L.ne_of_adj hadj have hset : pts s(u, v) = {u, v} := by ext x simp [pts, Sym2.mem_iff] rw [hset, Finset.card_pair huv] have hpts_disj : (M : Set (Sym2 W)).PairwiseDisjoint pts := by intro e₁ h1 e₂ h2 hne rw [Function.onFun, Finset.disjoint_left] intro x hx1 hx2 simp only [pts, mem_filter, mem_univ, true_and] at hx1 hx2 exact hM.2 e₁ h1 e₂ h2 hne x hx1 hx2 have hsum : (M.biUnion pts).card = 2 * M.card := by rw [Finset.card_biUnion hpts_disj] calc ∑ e ∈ M, (pts e).card = ∑ _e ∈ M, 2 := Finset.sum_congr rfl hpts_card _ = 2 * M.card := by simp [mul_comm] rw [← hsum] exact Finset.card_le_univ _ /-- In a matching `M`, every vertex is incident to at most one edge in `M`. -/ lemma matching_unique_neighbor {W : Type*} {L : SimpleGraph W} {M : Finset (Sym2 W)} (hM : IsMatching L M) {u v w : W} (h1 : s(u, v) ∈ M) (h2 : s(u, w) ∈ M) : v = w := by by_contra hne have hene : s(u, v) ≠ s(u, w) := by intro heq rw [Sym2.eq_iff] at heq rcases heq with ⟨_, hvw⟩ | ⟨huw, hvu⟩ · exact hne hvw · exact hne (hvu.trans huw) exact hM.2 s(u, v) h1 s(u, w) h2 hene u (Sym2.mem_mk_left u v) (Sym2.mem_mk_left u w) /-- Equivalent dissociation formulation of WKE: `I = univ \ Q` satisfies `|I| + |M| ≥ |W|` and every edge inside `I` belongs to `M`. -/ lemma isWKE_of_dissociation_matching {W : Type*} [Fintype W] [DecidableEq W] {L : SimpleGraph W} (M : Finset (Sym2 W)) (I : Finset W) (hM : IsMatching L M) (hcard : Fintype.card W ≤ I.card + M.card) (hsub : ∀ u ∈ I, ∀ v ∈ I, L.Adj u v → s(u, v) ∈ M) : IsWKE L := by refine ⟨M, Finset.univ \ I, hM, ?_, ?_⟩ · rw [Finset.card_sdiff, Finset.inter_univ, Finset.card_univ] omega · intro u v huv hu hv simp only [mem_sdiff, mem_univ, true_and, not_not] at hu hv exact hsub u hu v hv huv /-- Every graph with an independent set `I` and matching `M` satisfying `|I| + |M| ≥ |W|` is WKE. -/ lemma isWKE_of_alpha_add_matching {W : Type*} [Fintype W] [DecidableEq W] {L : SimpleGraph W} (M : Finset (Sym2 W)) (I : Finset W) (hM : IsMatching L M) (hI : ∀ u ∈ I, ∀ v ∈ I, ¬ L.Adj u v) (hcard : Fintype.card W ≤ I.card + M.card) : IsWKE L := isWKE_of_dissociation_matching M I hM hcard (fun u hu v hv hadj => (hI u hu v hv hadj).elim) /-- An edgeless graph is trivially WKE. -/ lemma isWKE_of_no_edges {W : Type*} {L : SimpleGraph W} (h : ∀ u v : W, ¬ L.Adj u v) : IsWKE L := ⟨∅, ∅, isMatching_empty L, le_rfl, fun u v huv _ _ => (h u v huv).elim⟩ /-- WKE transfers across graph isomorphisms. -/ lemma isWKE_of_iso {W₁ W₂ : Type*} {L₁ : SimpleGraph W₁} {L₂ : SimpleGraph W₂} (e : L₁ ≃g L₂) (h : IsWKE L₁) : IsWKE L₂ := by classical obtain ⟨M, Q, hM, hcard, hcov⟩ := h let M' : Finset (Sym2 W₂) := M.image (Sym2.map e) let Q' : Finset W₂ := Q.image e have hinj_e : Function.Injective e := e.injective have hinj_sym : Function.Injective (Sym2.map e) := Sym2.map.injective hinj_e refine ⟨M', Q', ?_, ?_, ?_⟩ · refine ⟨?_, ?_⟩ · intro x hx obtain ⟨y, hy, rfl⟩ := Finset.mem_image.mp hx induction y using Sym2.ind with | _ u v => simpa [Sym2.map_mk] using e.map_rel_iff.mpr (hM.1 s(u, v) hy) · intro x₁ hx₁ x₂ hx₂ hne z hz₁ hz₂ obtain ⟨y₁, hy₁, rfl⟩ := Finset.mem_image.mp hx₁ obtain ⟨y₂, hy₂, rfl⟩ := Finset.mem_image.mp hx₂ have hyne : y₁ ≠ y₂ := fun h => hne (congrArg (Sym2.map e) h) obtain ⟨w₁, hw₁, rfl⟩ := Sym2.mem_map.mp hz₁ obtain ⟨w₂, hw₂, hw_eq⟩ := Sym2.mem_map.mp hz₂ have hweq : w₁ = w₂ := hinj_e hw_eq.symm subst hweq exact hM.2 y₁ hy₁ y₂ hy₂ hyne w₁ hw₁ hw₂ · rw [Finset.card_image_of_injective Q hinj_e, Finset.card_image_of_injective M hinj_sym] exact hcard · intro u v huv hu hv have hu' : e.symm u ∉ Q := fun h => hu (Finset.mem_image.mpr ⟨e.symm u, h, e.apply_symm_apply u⟩) have hv' : e.symm v ∉ Q := fun h => hv (Finset.mem_image.mpr ⟨e.symm v, h, e.apply_symm_apply v⟩) have hadj' : L₁.Adj (e.symm u) (e.symm v) := e.symm.map_rel_iff.mpr huv have hmem := hcov (e.symm u) (e.symm v) hadj' hu' hv' refine Finset.mem_image.mpr ⟨s(e.symm u, e.symm v), hmem, ?_⟩ simp /-- Removing an isolated vertex preserves WKE. -/ lemma isWKE_of_isolated {W : Type*} [DecidableEq W] {L : SimpleGraph W} (v : W) (hiso : ∀ w : W, ¬ L.Adj v w) (hsub : IsWKE (L.induce {x : W | x ≠ v})) : IsWKE L := by classical obtain ⟨M, Q, hM, hcard, hcov⟩ := hsub let emb : {x : W // x ≠ v} → W := Subtype.val have hinj : Function.Injective emb := Subtype.val_injective let M' : Finset (Sym2 W) := M.image (Sym2.map emb) let Q' : Finset W := Q.image emb refine ⟨M', Q', ?_, ?_, ?_⟩ · refine ⟨?_, ?_⟩ · intro x hx obtain ⟨y, hy, rfl⟩ := Finset.mem_image.mp hx induction y using Sym2.ind with | _ a b => simpa [Sym2.map_mk] using hM.1 s(a, b) hy · intro x₁ hx₁ x₂ hx₂ hne z hz₁ hz₂ obtain ⟨y₁, hy₁, rfl⟩ := Finset.mem_image.mp hx₁ obtain ⟨y₂, hy₂, rfl⟩ := Finset.mem_image.mp hx₂ have hyne : y₁ ≠ y₂ := fun h => hne (congrArg (Sym2.map emb) h) obtain ⟨w₁, hw₁, rfl⟩ := Sym2.mem_map.mp hz₁ obtain ⟨w₂, hw₂, hw_eq⟩ := Sym2.mem_map.mp hz₂ have hweq : w₁ = w₂ := hinj hw_eq.symm subst hweq exact hM.2 y₁ hy₁ y₂ hy₂ hyne w₁ hw₁ hw₂ · rw [Finset.card_image_of_injective Q hinj, Finset.card_image_of_injective M (Sym2.map.injective hinj)] exact hcard · intro x y hxy hx hy have hxv : x ≠ v := fun h => by subst h; exact hiso y hxy have hyv : y ≠ v := fun h => by subst h; exact hiso x hxy.symm have hx' : (⟨x, hxv⟩ : {z : W // z ≠ v}) ∉ Q := fun h => hx (Finset.mem_image.mpr ⟨⟨x, hxv⟩, h, rfl⟩) have hy' : (⟨y, hyv⟩ : {z : W // z ≠ v}) ∉ Q := fun h => hy (Finset.mem_image.mpr ⟨⟨y, hyv⟩, h, rfl⟩) have hmem := hcov ⟨x, hxv⟩ ⟨y, hyv⟩ hxy hx' hy' exact Finset.mem_image.mpr ⟨s(⟨x, hxv⟩, ⟨y, hyv⟩), hmem, by simp [emb]⟩ /-- Removing a degree-1 vertex `v` together with its unique neighbor `w` preserves WKE. -/ lemma isWKE_of_deg_one {W : Type*} [DecidableEq W] {L : SimpleGraph W} (v w : W) (hvw : L.Adj v w) (huniq : ∀ z : W, L.Adj v z → z = w) (hsub : IsWKE (L.induce {x : W | x ≠ v ∧ x ≠ w})) : IsWKE L := by classical obtain ⟨M, Q, hM, hcard, hcov⟩ := hsub let emb : {x : W // x ≠ v ∧ x ≠ w} → W := Subtype.val have hinj : Function.Injective emb := Subtype.val_injective let M₀ : Finset (Sym2 W) := M.image (Sym2.map emb) let Q₀ : Finset W := Q.image emb have hvw_not_M₀ : s(v, w) ∉ M₀ := by intro h obtain ⟨y, _, hy⟩ := Finset.mem_image.mp h induction y using Sym2.ind with | _ a b => rw [Sym2.map_mk, Sym2.eq_iff] at hy rcases hy with ⟨ha, _⟩ | ⟨_, hb⟩ · exact a.2.1 ha · exact b.2.1 hb have hw_not_Q₀ : w ∉ Q₀ := by intro h obtain ⟨a, _, ha⟩ := Finset.mem_image.mp h exact a.2.2 ha refine ⟨insert s(v, w) M₀, insert w Q₀, ?_, ?_, ?_⟩ · refine ⟨?_, ?_⟩ · intro e he rcases Finset.mem_insert.mp he with rfl | he' · exact hvw · obtain ⟨y, hy, rfl⟩ := Finset.mem_image.mp he' induction y using Sym2.ind with | _ a b => simpa [Sym2.map_mk] using hM.1 s(a, b) hy · intro e₁ h1 e₂ h2 hne z hz₁ hz₂ rcases Finset.mem_insert.mp h1 with rfl | h1' <;> rcases Finset.mem_insert.mp h2 with rfl | h2' · exact hne rfl · obtain ⟨y, _, rfl⟩ := Finset.mem_image.mp h2' obtain ⟨a, _, rfl⟩ := Sym2.mem_map.mp hz₂ rw [Sym2.mem_iff] at hz₁ rcases hz₁ with ha | ha · exact a.2.1 ha · exact a.2.2 ha · obtain ⟨y, _, rfl⟩ := Finset.mem_image.mp h1' obtain ⟨a, _, rfl⟩ := Sym2.mem_map.mp hz₁ rw [Sym2.mem_iff] at hz₂ rcases hz₂ with ha | ha · exact a.2.1 ha · exact a.2.2 ha · obtain ⟨y₁, hy₁, rfl⟩ := Finset.mem_image.mp h1' obtain ⟨y₂, hy₂, rfl⟩ := Finset.mem_image.mp h2' have hyne : y₁ ≠ y₂ := fun h => hne (congrArg (Sym2.map emb) h) obtain ⟨a₁, ha₁, rfl⟩ := Sym2.mem_map.mp hz₁ obtain ⟨a₂, ha₂, ha_eq⟩ := Sym2.mem_map.mp hz₂ have haeq : a₁ = a₂ := hinj ha_eq.symm subst haeq exact hM.2 y₁ hy₁ y₂ hy₂ hyne a₁ ha₁ ha₂ · rw [Finset.card_insert_of_notMem hw_not_Q₀, Finset.card_insert_of_notMem hvw_not_M₀, Finset.card_image_of_injective Q hinj, Finset.card_image_of_injective M (Sym2.map.injective hinj)] omega · intro x y hxy hx hy have hxw : x ≠ w := fun h => hx (h ▸ Finset.mem_insert_self w Q₀) have hyw : y ≠ w := fun h => hy (h ▸ Finset.mem_insert_self w Q₀) have hxv : x ≠ v := fun h => by subst h; exact hyw (huniq y hxy) have hyv : y ≠ v := fun h => by subst h; exact hxw (huniq x hxy.symm) have hx' : (⟨x, hxv, hxw⟩ : {z : W // z ≠ v ∧ z ≠ w}) ∉ Q := fun h => hx (Finset.mem_insert_of_mem (Finset.mem_image.mpr ⟨⟨x, hxv, hxw⟩, h, rfl⟩)) have hy' : (⟨y, hyv, hyw⟩ : {z : W // z ≠ v ∧ z ≠ w}) ∉ Q := fun h => hy (Finset.mem_insert_of_mem (Finset.mem_image.mpr ⟨⟨y, hyv, hyw⟩, h, rfl⟩)) have hmem := hcov ⟨x, hxv, hxw⟩ ⟨y, hyv, hyw⟩ hxy hx' hy' exact Finset.mem_insert_of_mem (Finset.mem_image.mpr ⟨s(⟨x, hxv, hxw⟩, ⟨y, hyv, hyw⟩), hmem, by simp [emb]⟩) /-- Disjoint union of a WKE component (no edges leaving `S`) and a WKE complement is WKE. -/ lemma isWKE_of_component {W : Type*} [DecidableEq W] {L : SimpleGraph W} (S : Set W) (hcomp : ∀ x y : W, L.Adj x y → (x ∈ S ↔ y ∈ S)) (hS : IsWKE (L.induce S)) (hSc : IsWKE (L.induce Sᶜ)) : IsWKE L := by classical obtain ⟨M₁, Q₁, hM₁, hc₁, hcov₁⟩ := hS obtain ⟨M₂, Q₂, hM₂, hc₂, hcov₂⟩ := hSc let e₁ : S → W := Subtype.val let e₂ : (Sᶜ : Set W) → W := Subtype.val let M₁' := M₁.image (Sym2.map e₁) let M₂' := M₂.image (Sym2.map e₂) let Q₁' := Q₁.image e₁ let Q₂' := Q₂.image e₂ have hdisj_Q : Disjoint Q₁' Q₂' := by rw [Finset.disjoint_left] intro x h1 h2 obtain ⟨a, _, rfl⟩ := Finset.mem_image.mp h1 obtain ⟨b, _, hb⟩ := Finset.mem_image.mp h2 change b.1 = a.1 at hb exact b.2 (hb ▸ a.2) have hdisj_M : Disjoint M₁' M₂' := by rw [Finset.disjoint_left] intro e h1 h2 obtain ⟨x₁, _, rfl⟩ := Finset.mem_image.mp h1 obtain ⟨x₂, _, hx₂⟩ := Finset.mem_image.mp h2 induction x₁ using Sym2.ind with | _ a₁ b₁ => induction x₂ using Sym2.ind with | _ a₂ b₂ => rw [Sym2.map_mk, Sym2.map_mk, Sym2.eq_iff] at hx₂ rcases hx₂ with ⟨h, _⟩ | ⟨h, _⟩ · change a₂.1 = a₁.1 at h; exact a₂.2 (h ▸ a₁.2) · change a₂.1 = b₁.1 at h; exact a₂.2 (h ▸ b₁.2) refine ⟨M₁' ∪ M₂', Q₁' ∪ Q₂', ?_, ?_, ?_⟩ · refine ⟨?_, ?_⟩ · intro e he rcases Finset.mem_union.mp he with h | h · obtain ⟨y, hy, rfl⟩ := Finset.mem_image.mp h induction y using Sym2.ind with | _ a b => simpa [Sym2.map_mk] using hM₁.1 s(a, b) hy · obtain ⟨y, hy, rfl⟩ := Finset.mem_image.mp h induction y using Sym2.ind with | _ a b => simpa [Sym2.map_mk] using hM₂.1 s(a, b) hy · intro x₁ h1 x₂ h2 hne z hz₁ hz₂ rcases Finset.mem_union.mp h1 with h1' | h1' <;> rcases Finset.mem_union.mp h2 with h2' | h2' · obtain ⟨y₁, hy₁, rfl⟩ := Finset.mem_image.mp h1' obtain ⟨y₂, hy₂, rfl⟩ := Finset.mem_image.mp h2' have hyne : y₁ ≠ y₂ := fun h => hne (congrArg (Sym2.map e₁) h) obtain ⟨a₁, ha₁, rfl⟩ := Sym2.mem_map.mp hz₁ obtain ⟨a₂, ha₂, ha_eq⟩ := Sym2.mem_map.mp hz₂ have haeq : a₁ = a₂ := Subtype.val_injective ha_eq.symm subst haeq exact hM₁.2 y₁ hy₁ y₂ hy₂ hyne a₁ ha₁ ha₂ · obtain ⟨y₁, _, rfl⟩ := Finset.mem_image.mp h1' obtain ⟨y₂, _, rfl⟩ := Finset.mem_image.mp h2' obtain ⟨a₁, _, rfl⟩ := Sym2.mem_map.mp hz₁ obtain ⟨a₂, _, ha_eq⟩ := Sym2.mem_map.mp hz₂ change a₂.1 = a₁.1 at ha_eq exact a₂.2 (ha_eq ▸ a₁.2) · obtain ⟨y₁, _, rfl⟩ := Finset.mem_image.mp h1' obtain ⟨y₂, _, rfl⟩ := Finset.mem_image.mp h2' obtain ⟨a₁, _, rfl⟩ := Sym2.mem_map.mp hz₁ obtain ⟨a₂, _, ha_eq⟩ := Sym2.mem_map.mp hz₂ change a₂.1 = a₁.1 at ha_eq exact a₁.2 (ha_eq.symm ▸ a₂.2) · obtain ⟨y₁, hy₁, rfl⟩ := Finset.mem_image.mp h1' obtain ⟨y₂, hy₂, rfl⟩ := Finset.mem_image.mp h2' have hyne : y₁ ≠ y₂ := fun h => hne (congrArg (Sym2.map e₂) h) obtain ⟨a₁, ha₁, rfl⟩ := Sym2.mem_map.mp hz₁ obtain ⟨a₂, ha₂, ha_eq⟩ := Sym2.mem_map.mp hz₂ have haeq : a₁ = a₂ := Subtype.val_injective ha_eq.symm subst haeq exact hM₂.2 y₁ hy₁ y₂ hy₂ hyne a₁ ha₁ ha₂ · rw [Finset.card_union_of_disjoint hdisj_Q, Finset.card_union_of_disjoint hdisj_M, Finset.card_image_of_injective Q₁ Subtype.val_injective, Finset.card_image_of_injective Q₂ Subtype.val_injective, Finset.card_image_of_injective M₁ (Sym2.map.injective Subtype.val_injective), Finset.card_image_of_injective M₂ (Sym2.map.injective Subtype.val_injective)] omega · intro u v huv hu hv by_cases huS : u ∈ S · have hvS : v ∈ S := (hcomp u v huv).mp huS have hu' : (⟨u, huS⟩ : S) ∉ Q₁ := fun h => hu (Finset.mem_union_left _ (Finset.mem_image.mpr ⟨⟨u, huS⟩, h, rfl⟩)) have hv' : (⟨v, hvS⟩ : S) ∉ Q₁ := fun h => hv (Finset.mem_union_left _ (Finset.mem_image.mpr ⟨⟨v, hvS⟩, h, rfl⟩)) have hmem := hcov₁ ⟨u, huS⟩ ⟨v, hvS⟩ huv hu' hv' exact Finset.mem_union_left _ (Finset.mem_image.mpr ⟨s(⟨u, huS⟩, ⟨v, hvS⟩), hmem, by simp [e₁]⟩) · have hvS : v ∉ S := fun h => huS ((hcomp u v huv).mpr h) have hu' : (⟨u, huS⟩ : (Sᶜ : Set W)) ∉ Q₂ := fun h => hu (Finset.mem_union_right _ (Finset.mem_image.mpr ⟨⟨u, huS⟩, h, rfl⟩)) have hv' : (⟨v, hvS⟩ : (Sᶜ : Set W)) ∉ Q₂ := fun h => hv (Finset.mem_union_right _ (Finset.mem_image.mpr ⟨⟨v, hvS⟩, h, rfl⟩)) have hmem := hcov₂ ⟨u, huS⟩ ⟨v, hvS⟩ huv hu' hv' exact Finset.mem_union_right _ (Finset.mem_image.mpr ⟨s(⟨u, huS⟩, ⟨v, hvS⟩), hmem, by simp [e₂]⟩) end WKEDefinitions section MasterLinkReduction variable {V : Type*} /-- The **triangle-active neighborhood** of `v` in `G`: neighbors `u` of `v` such that the edge `vu` belongs to at least one triangle of `G`. -/ def activeNeighbors (G : SimpleGraph V) (v : V) : Set V := {u : V | G.Adj v u ∧ ∃ w : V, G.Adj v w ∧ G.Adj u w} /-- The **active link graph** of `v` in `G`: the subgraph induced on `activeNeighbors G v`. -/ def activeLink (G : SimpleGraph V) (v : V) : SimpleGraph (activeNeighbors G v) := G.induce (activeNeighbors G v) /-- The **triangle-support subgraph** `G_△` of `G`: keeps exactly the edges lying in at least one triangle of `G`. -/ def triangleSupport (G : SimpleGraph V) : SimpleGraph V where Adj u v := G.Adj u v ∧ ∃ w : V, G.Adj u w ∧ G.Adj v w symm := ⟨fun _ _ ⟨h, w, hu, hv⟩ => ⟨h.symm, w, hv, hu⟩⟩ loopless := ⟨fun _ ⟨h, _⟩ => G.loopless.irrefl _ h⟩ lemma triangleSupport_le (G : SimpleGraph V) : triangleSupport G ≤ G := fun _ _ h => h.1 lemma activeNeighbors_eq_triangleSupport_neighborSet (G : SimpleGraph V) (v : V) : activeNeighbors G v = (triangleSupport G).neighborSet v := by ext u simp [activeNeighbors, triangleSupport, SimpleGraph.mem_neighborSet] /-- **Master WKE Link-Reduction Step:** Suppose `v` lies in at least one triangle of `G` and `activeLink G v` is WKE. Then deleting `F = star_v ∪ M_G` removes at least one edge of `G` while satisfying `ν(G') + k ≤ ν(G)` and `τ(G) ≤ τ(G') + 2 * k`. -/ theorem tuza_step_of_wke_activeLink [Fintype V] [DecidableEq V] (G : SimpleGraph V) (v : V) (hact : (activeNeighbors G v).Nonempty) (hwke : IsWKE (activeLink G v)) : ∃ (F : Finset (Sym2 V)) (k : ℕ), (∃ e ∈ F, e ∈ G.edgeSet) ∧ nu (G.deleteEdges (F : Set (Sym2 V))) + k ≤ nu G ∧ tau G ≤ tau (G.deleteEdges (F : Set (Sym2 V))) + 2 * k := by classical obtain ⟨M, Q, hM, hQcard, hcov⟩ := hwke let emb : activeNeighbors G v → V := Subtype.val have hinj : Function.Injective emb := Subtype.val_injective let M_G : Finset (Sym2 V) := M.image (Sym2.map emb) let A_fin : Finset V := Finset.univ.filter (fun u => u ∈ activeNeighbors G v) let star_v : Finset (Sym2 V) := A_fin.image (fun u => s(v, u)) let Q_star : Finset (Sym2 V) := Q.image (fun a => s(v, emb a)) let F : Finset (Sym2 V) := star_v ∪ M_G let C₀ : Finset (Sym2 V) := M_G ∪ Q_star let mkTri : Sym2 (activeNeighbors G v) → Finset V := Sym2.lift ⟨fun a b => {v, emb a, emb b}, fun a b => by ext x; simp only [mem_insert, mem_singleton]; tauto⟩ let P₀ : Finset (Finset V) := M.image mkTri have hv_not_act : ∀ a : activeNeighbors G v, emb a ≠ v := by intro a h have hvv : G.Adj v v := by have h' := a.2.1 rw [show a.1 = v from h] at h' exact h' exact G.loopless.irrefl v hvv have hM_G_edge : ∀ e ∈ M_G, e ∈ G.edgeSet := by intro e he obtain ⟨y, hy, heq⟩ := Finset.mem_image.mp he rw [← heq] revert hy refine Sym2.ind (fun a b hab => ?_) y have hadj : G.Adj (emb a) (emb b) := hM.1 s(a, b) hab simpa [Sym2.map_mk] using hadj have hQ_star_edge : ∀ e ∈ Q_star, e ∈ G.edgeSet := by intro e he obtain ⟨a, _, rfl⟩ := Finset.mem_image.mp he exact a.2.1 have hC₀_edge : ∀ e ∈ C₀, e ∈ G.edgeSet := by intro e he rcases Finset.mem_union.mp he with h | h · exact hM_G_edge e h · exact hQ_star_edge e h have hF_nonempty_edge : ∃ e ∈ F, e ∈ G.edgeSet := by obtain ⟨u, hu⟩ := hact refine ⟨s(v, u), Finset.mem_union_left _ ?_, hu.1⟩ exact Finset.mem_image.mpr ⟨u, Finset.mem_filter.mpr ⟨Finset.mem_univ u, hu⟩, rfl⟩ have hmkTri_tri : ∀ e ∈ M, IsTriangle G (mkTri e) := by intro e he have hadj := hM.1 e he induction e using Sym2.ind with | _ a b => have hab : emb a ≠ emb b := fun h => (activeLink G v).ne_of_adj hadj (hinj h) have hva : v ≠ emb a := (hv_not_act a).symm have hvb : v ≠ emb b := (hv_not_act b).symm change IsTriangle G {v, emb a, emb b} refine ⟨?_, ?_⟩ · rw [Finset.card_insert_of_notMem (by simp [hva, hvb]), Finset.card_pair hab] · intro x hx y hy hxy simp only [mem_insert, mem_singleton] at hx hy rcases hx with rfl | rfl | rfl <;> rcases hy with rfl | rfl | rfl · exact (hxy rfl).elim · exact a.2.1 · exact b.2.1 · exact a.2.1.symm · exact (hxy rfl).elim · exact hadj · exact b.2.1.symm · exact hadj.symm · exact (hxy rfl).elim have hmkTri_edges : ∀ e ∈ M, subsetEdges (mkTri e) ⊆ F := by intro e he induction e using Sym2.ind with | _ a b => intro f hf induction f using Sym2.ind with | _ x y => rw [mem_subsetEdges] at hf change x ∈ ({v, emb a, emb b} : Finset V) ∧ y ∈ ({v, emb a, emb b} : Finset V) ∧ x ≠ y at hf simp only [mem_insert, mem_singleton] at hf rcases hf.1 with rfl | rfl | rfl <;> rcases hf.2.1 with rfl | rfl | rfl · exact (hf.2.2 rfl).elim · exact Finset.mem_union_left _ (Finset.mem_image.mpr ⟨emb a, Finset.mem_filter.mpr ⟨Finset.mem_univ _, a.2⟩, rfl⟩) · exact Finset.mem_union_left _ (Finset.mem_image.mpr ⟨emb b, Finset.mem_filter.mpr ⟨Finset.mem_univ _, b.2⟩, rfl⟩) · rw [Sym2.eq_swap] exact Finset.mem_union_left _ (Finset.mem_image.mpr ⟨emb a, Finset.mem_filter.mpr ⟨Finset.mem_univ _, a.2⟩, rfl⟩) · exact (hf.2.2 rfl).elim · exact Finset.mem_union_right _ (Finset.mem_image.mpr ⟨s(a, b), he, by simp⟩) · rw [Sym2.eq_swap] exact Finset.mem_union_left _ (Finset.mem_image.mpr ⟨emb b, Finset.mem_filter.mpr ⟨Finset.mem_univ _, b.2⟩, rfl⟩) · rw [Sym2.eq_swap] exact Finset.mem_union_right _ (Finset.mem_image.mpr ⟨s(a, b), he, by simp⟩) · exact (hf.2.2 rfl).elim have hmkTri_disj : ∀ e₁ ∈ M, ∀ e₂ ∈ M, e₁ ≠ e₂ → Disjoint (subsetEdges (mkTri e₁)) (subsetEdges (mkTri e₂)) := by intro e₁ h1 e₂ h2 hne induction e₁ using Sym2.ind with | _ a₁ b₁ => induction e₂ using Sym2.ind with | _ a₂ b₂ => rw [Finset.disjoint_left] intro f hf1 hf2 induction f using Sym2.ind with | _ x y => rw [mem_subsetEdges] at hf1 hf2 change x ∈ ({v, emb a₁, emb b₁} : Finset V) ∧ y ∈ ({v, emb a₁, emb b₁} : Finset V) ∧ x ≠ y at hf1 change x ∈ ({v, emb a₂, emb b₂} : Finset V) ∧ y ∈ ({v, emb a₂, emb b₂} : Finset V) ∧ x ≠ y at hf2 have hshared : ∃ c₁ ∈ s(a₁, b₁), ∃ c₂ ∈ s(a₂, b₂), emb c₁ = emb c₂ := by simp only [mem_insert, mem_singleton] at hf1 hf2 rcases hf1.1 with rfl | rfl | rfl · rcases hf1.2.1 with rfl | rfl | rfl · exact (hf1.2.2 rfl).elim · rcases hf2.2.1 with h | h | h · exact (hv_not_act a₁ h).elim · exact ⟨a₁, Sym2.mem_mk_left _ _, a₂, Sym2.mem_mk_left _ _, h⟩ · exact ⟨a₁, Sym2.mem_mk_left _ _, b₂, Sym2.mem_mk_right _ _, h⟩ · rcases hf2.2.1 with h | h | h · exact (hv_not_act b₁ h).elim · exact ⟨b₁, Sym2.mem_mk_right _ _, a₂, Sym2.mem_mk_left _ _, h⟩ · exact ⟨b₁, Sym2.mem_mk_right _ _, b₂, Sym2.mem_mk_right _ _, h⟩ · rcases hf2.1 with h | h | h · exact (hv_not_act a₁ h).elim · exact ⟨a₁, Sym2.mem_mk_left _ _, a₂, Sym2.mem_mk_left _ _, h⟩ · exact ⟨a₁, Sym2.mem_mk_left _ _, b₂, Sym2.mem_mk_right _ _, h⟩ · rcases hf2.1 with h | h | h · exact (hv_not_act b₁ h).elim · exact ⟨b₁, Sym2.mem_mk_right _ _, a₂, Sym2.mem_mk_left _ _, h⟩ · exact ⟨b₁, Sym2.mem_mk_right _ _, b₂, Sym2.mem_mk_right _ _, h⟩ obtain ⟨c₁, hc₁, c₂, hc₂, heq⟩ := hshared have hceq : c₁ = c₂ := hinj heq subst hceq exact hM.2 s(a₁, b₁) h1 s(a₂, b₂) h2 hne c₁ hc₁ hc₂ have hmkTri_inj : Set.InjOn mkTri M := by intro e₁ h1 e₂ h2 heq by_contra hne have hdisj := hmkTri_disj e₁ h1 e₂ h2 hne rw [heq] at hdisj have hT := hmkTri_tri e₂ h2 have h1lt : 1 < (mkTri e₂).card := by have := hT.1; omega obtain ⟨u, hu, w, hw, huw⟩ := Finset.one_lt_card.mp h1lt have hmem : s(u, w) ∈ subsetEdges (mkTri e₂) := mem_subsetEdges.mpr ⟨hu, hw, huw⟩ exact Finset.disjoint_left.mp hdisj hmem hmem have hP₀_pack : IsTrianglePacking G P₀ := by refine ⟨fun T hT => ?_, fun T₁ h1 T₂ h2 hne => ?_⟩ · obtain ⟨e, he, rfl⟩ := Finset.mem_image.mp hT exact hmkTri_tri e he · obtain ⟨e₁, he₁, rfl⟩ := Finset.mem_image.mp h1 obtain ⟨e₂, he₂, rfl⟩ := Finset.mem_image.mp h2 exact hmkTri_disj e₁ he₁ e₂ he₂ (fun h => hne (congrArg mkTri h)) have hP₀_card : P₀.card = M.card := Finset.card_image_of_injOn hmkTri_inj have hC₀_hits : ∀ T : Finset V, IsTriangle G T → (∃ e ∈ subsetEdges T, e ∈ F) → ∃ e ∈ C₀, e ∈ subsetEdges T := by intro T hT ⟨e, heT, heF⟩ rcases Finset.mem_union.mp heF with hstar | hMG · obtain ⟨u, _, rfl⟩ := Finset.mem_image.mp hstar rw [mem_subsetEdges] at heT have hcard_rest : (T.erase v).card = 2 := by rw [Finset.card_erase_of_mem heT.1, hT.1] have hu_er : u ∈ T.erase v := Finset.mem_erase.mpr ⟨heT.2.2.symm, heT.2.1⟩ have hcard_rest2 : ((T.erase v).erase u).card = 1 := by rw [Finset.card_erase_of_mem hu_er, hcard_rest] obtain ⟨w, hw_eq⟩ := Finset.card_eq_one.mp hcard_rest2 have hw_mem : w ∈ (T.erase v).erase u := hw_eq.symm ▸ Finset.mem_singleton_self w have hwu : w ≠ u := (Finset.mem_erase.mp hw_mem).1 have hwv : w ≠ v := (Finset.mem_erase.mp (Finset.mem_erase.mp hw_mem).2).1 have hwT : w ∈ T := (Finset.mem_erase.mp (Finset.mem_erase.mp hw_mem).2).2 have hvu : G.Adj v u := hT.2 v heT.1 u heT.2.1 heT.2.2 have hvw : G.Adj v w := hT.2 v heT.1 w hwT hwv.symm have huw : G.Adj u w := hT.2 u heT.2.1 w hwT hwu.symm let a : activeNeighbors G v := ⟨u, hvu, w, hvw, huw⟩ let b : activeNeighbors G v := ⟨w, hvw, u, hvu, huw.symm⟩ by_cases haQ : a ∈ Q · refine ⟨s(v, u), Finset.mem_union_right _ (Finset.mem_image.mpr ⟨a, haQ, rfl⟩), ?_⟩ exact mem_subsetEdges.mpr ⟨heT.1, heT.2.1, heT.2.2⟩ · by_cases hbQ : b ∈ Q · refine ⟨s(v, w), Finset.mem_union_right _ (Finset.mem_image.mpr ⟨b, hbQ, rfl⟩), ?_⟩ exact mem_subsetEdges.mpr ⟨heT.1, hwT, hwv.symm⟩ · have habM : s(a, b) ∈ M := hcov a b huw haQ hbQ refine ⟨s(u, w), Finset.mem_union_left _ (Finset.mem_image.mpr ⟨s(a, b), habM, by simp [emb, a, b]⟩), ?_⟩ exact mem_subsetEdges.mpr ⟨heT.2.1, hwT, hwu.symm⟩ · exact ⟨e, Finset.mem_union_left _ hMG, heT⟩ have hC₀_card : C₀.card ≤ 2 * M.card := by calc C₀.card ≤ M_G.card + Q_star.card := Finset.card_union_le M_G Q_star _ ≤ M.card + Q.card := Nat.add_le_add Finset.card_image_le Finset.card_image_le _ ≤ M.card + M.card := Nat.add_le_add_left hQcard M.card _ = 2 * M.card := by omega have hstep := reducible_edgeSet_step F C₀ P₀ hC₀_edge hP₀_pack (fun T hT => by obtain ⟨e, he, rfl⟩ := Finset.mem_image.mp hT; exact hmkTri_edges e he) hC₀_hits refine ⟨F, M.card, hF_nonempty_edge, ?_, ?_⟩ · rw [← hP₀_card]; exact hstep.1 · exact le_trans hstep.2 (Nat.add_le_add_left hC₀_card _) /-- **Master Hereditary WKE Link-Reduction Theorem:** Let `P` be any subgraph-closed property of simple graphs on `V` such that every graph `G` satisfying `P` with at least one triangle contains a vertex `v` with nonempty active neighborhood whose active link `activeLink G v` is WKE. Then every graph `G` satisfying `P` satisfies Tuza's Conjecture `τ(G) ≤ 2 ν(G)`. -/ theorem tuza_of_hereditary_wke_link [Fintype V] [DecidableEq V] (P : SimpleGraph V → Prop) (hmono : ∀ {G H : SimpleGraph V}, H ≤ G → P G → P H) (hstep : ∀ G : SimpleGraph V, P G → (∃ T : Finset V, IsTriangle G T) → ∃ v : V, (activeNeighbors G v).Nonempty ∧ IsWKE (activeLink G v)) : ∀ G : SimpleGraph V, P G → tau G ≤ 2 * nu G := by classical suffices h : ∀ m : ℕ, ∀ G : SimpleGraph V, G.edgeFinset.card = m → P G → tau G ≤ 2 * nu G by intro G hPG exact h G.edgeFinset.card G rfl hPG intro m induction m using Nat.strong_induction_on with | h m ih => intro G hcard hPG by_cases htri : ∃ T : Finset V, IsTriangle G T · obtain ⟨v, hact, hwke⟩ := hstep G hPG htri obtain ⟨F, k, ⟨e, heF, heG⟩, hnu, htau⟩ := tuza_step_of_wke_activeLink G v hact hwke set G' := G.deleteEdges (F : Set (Sym2 V)) with hG'_def have hle : G' ≤ G := SimpleGraph.deleteEdges_le _ have hsub : G'.edgeFinset ⊂ G.edgeFinset := by rw [Finset.ssubset_iff_of_subset] · refine ⟨e, (SimpleGraph.mem_edgeFinset).mpr heG, ?_⟩ rw [SimpleGraph.mem_edgeFinset, hG'_def, SimpleGraph.edgeSet_deleteEdges] exact fun h => h.2 heF · intro x hx rw [SimpleGraph.mem_edgeFinset] at hx ⊢ exact SimpleGraph.edgeSet_mono hle hx have hlt : G'.edgeFinset.card < m := hcard ▸ Finset.card_lt_card hsub have hIH : tau G' ≤ 2 * nu G' := ih G'.edgeFinset.card hlt G' (by convert rfl) (hmono hle hPG) omega · rw [tau_eq_zero_of_triangleFree (fun T hT => htri ⟨T, hT⟩)] exact Nat.zero_le _ /-- Corollary: In any edge-minimal counterexample to Tuza's Conjecture, no vertex with a triangle-active incident edge can have a WKE active link. -/ theorem min_counterexample_no_wke_activeLink [Fintype V] [DecidableEq V] (G : SimpleGraph V) (hce : 2 * nu G < tau G) (hmin : ∀ H : SimpleGraph V, H < G → tau H ≤ 2 * nu H) (v : V) (hact : (activeNeighbors G v).Nonempty) : ¬ IsWKE (activeLink G v) := by classical intro hwke obtain ⟨F, k, ⟨e, heF, heG⟩, hnu, htau⟩ := tuza_step_of_wke_activeLink G v hact hwke set G' := G.deleteEdges (F : Set (Sym2 V)) with hG'_def have hlt : G' < G := by refine lt_of_le_of_ne (SimpleGraph.deleteEdges_le _) ?_ intro heq have hmem : e ∈ G'.edgeSet := heq ▸ heG rw [hG'_def, SimpleGraph.edgeSet_deleteEdges] at hmem exact hmem.2 heF have hG' : tau G' ≤ 2 * nu G' := hmin G' hlt omega end MasterLinkReduction /-! ## Section 3: WKE Theorems for `Δ ≤ 2` and General `|V| ≤ 4` -/ section WKEGeneralClasses /-- Helper: cardinality of induced subtype on `{x | x ≠ v}` is `n - 1`. -/ lemma card_ne_subtype {W : Type*} [Fintype W] [DecidableEq W] (v : W) : Fintype.card {x : W // x ≠ v} + 1 = Fintype.card W := by classical have h : Fintype.card {x : W // x ≠ v} = Fintype.card W - Fintype.card {x : W // x = v} := Fintype.card_subtype_compl (fun x : W => x = v) have h1 : Fintype.card {x : W // x = v} = 1 := Fintype.card_unique have hpos : 1 ≤ Fintype.card W := Fintype.card_pos_iff.mpr ⟨v⟩ rw [h1] at h omega /-- Helper: cardinality of induced subtype on `{x | x ≠ v ∧ x ≠ w}` (for `v ≠ w`) is `n - 2`. -/ lemma card_ne_two_subtype {W : Type*} [Fintype W] [DecidableEq W] {v w : W} (hvw : v ≠ w) : Fintype.card {x : W // x ≠ v ∧ x ≠ w} + 2 = Fintype.card W := by classical have hset : (Finset.univ.filter (fun x : W => x ≠ v ∧ x ≠ w)) = Finset.univ \ {v, w} := by ext x; simp rw [Fintype.card_subtype, hset, Finset.card_sdiff, Finset.inter_univ, Finset.card_univ, Finset.card_pair hvw] have h2 : 2 ≤ Fintype.card W := by have := Finset.card_le_univ ({v, w} : Finset W) rwa [Finset.card_pair hvw] at this omega /-- Every finite simple graph `L` with maximum degree `≤ 2` is WKE. -/ theorem isWKE_of_maxDeg_le_two : ∀ n : ℕ, ∀ {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj], Fintype.card W = n → (∀ v : W, L.degree v ≤ 2) → IsWKE L := by intro n induction n using Nat.strong_induction_on with | h n ih => intro W _ _ L _ hcard hdeg classical by_cases h0 : ∃ v : W, L.degree v = 0 · obtain ⟨v, hv⟩ := h0 have hiso : ∀ w : W, ¬ L.Adj v w := by intro w hvw have hmem : w ∈ L.neighborFinset v := (SimpleGraph.mem_neighborFinset L v w).mpr hvw have hpos : 0 < L.degree v := Finset.card_pos.mpr ⟨w, hmem⟩ omega refine isWKE_of_isolated v hiso ?_ have hcard' : Fintype.card {x : W // x ≠ v} < n := by have := card_ne_subtype v; omega refine ih _ hcard' (L.induce {x : W | x ≠ v}) rfl (fun x => ?_) have hsub : ((L.induce {x : W | x ≠ v}).neighborFinset x).image Subtype.val ⊆ L.neighborFinset x.1 := by intro y hy obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hy rw [SimpleGraph.mem_neighborFinset] at hz ⊢ exact hz calc (L.induce {x : W | x ≠ v}).degree x = ((L.induce {x : W | x ≠ v}).neighborFinset x).card := rfl _ = (((L.induce {x : W | x ≠ v}).neighborFinset x).image Subtype.val).card := (Finset.card_image_of_injective _ Subtype.val_injective).symm _ ≤ (L.neighborFinset x.1).card := Finset.card_le_card hsub _ ≤ 2 := hdeg x.1 · by_cases h1 : ∃ v : W, L.degree v = 1 · obtain ⟨v, hv⟩ := h1 obtain ⟨w, hw_eq⟩ := Finset.card_eq_one.mp hv have hvw : L.Adj v w := by rw [← SimpleGraph.mem_neighborFinset, hw_eq]; exact Finset.mem_singleton_self w have huniq : ∀ z : W, L.Adj v z → z = w := by intro z hzv have : z ∈ L.neighborFinset v := (SimpleGraph.mem_neighborFinset L v z).mpr hzv rw [hw_eq, Finset.mem_singleton] at this exact this refine isWKE_of_deg_one v w hvw huniq ?_ have hcard' : Fintype.card {x : W // x ≠ v ∧ x ≠ w} < n := by have := card_ne_two_subtype (L.ne_of_adj hvw); omega refine ih _ hcard' (L.induce {x : W | x ≠ v ∧ x ≠ w}) rfl (fun x => ?_) have hsub : ((L.induce {x : W | x ≠ v ∧ x ≠ w}).neighborFinset x).image Subtype.val ⊆ L.neighborFinset x.1 := by intro y hy obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hy rw [SimpleGraph.mem_neighborFinset] at hz ⊢ exact hz calc (L.induce {x : W | x ≠ v ∧ x ≠ w}).degree x = (((L.induce {x : W | x ≠ v ∧ x ≠ w}).neighborFinset x).image Subtype.val).card := (Finset.card_image_of_injective _ Subtype.val_injective).symm _ ≤ (L.neighborFinset x.1).card := Finset.card_le_card hsub _ ≤ 2 := hdeg x.1 · -- Every vertex has degree 2! by_cases hne : Nonempty W · obtain ⟨v₀⟩ := hne have hreg : ∀ v : W, L.degree v = 2 := by intro v have hle := hdeg v have hn0 : L.degree v ≠ 0 := fun h => h0 ⟨v, h⟩ have hn1 : L.degree v ≠ 1 := fun h => h1 ⟨v, h⟩ omega -- Unique other neighbor of y distinct from x (when L.Adj x y) have hother : ∀ x y : W, L.Adj x y → ∃! z : W, L.Adj y z ∧ z ≠ x := by intro x y hxy have hxmem : x ∈ L.neighborFinset y := (SimpleGraph.mem_neighborFinset L y x).mpr hxy.symm have hcard1 : ((L.neighborFinset y).erase x).card = 1 := by rw [Finset.card_erase_of_mem hxmem, SimpleGraph.card_neighborFinset_eq_degree, hreg y] obtain ⟨z, hz_eq⟩ := Finset.card_eq_one.mp hcard1 refine ⟨z, ?_, ?_⟩ · have hz : z ∈ (L.neighborFinset y).erase x := hz_eq.symm ▸ Finset.mem_singleton_self z exact ⟨(SimpleGraph.mem_neighborFinset L y z).mp (Finset.mem_erase.mp hz).2, (Finset.mem_erase.mp hz).1⟩ · intro z' ⟨hyz', hzx⟩ have hz' : z' ∈ (L.neighborFinset y).erase x := Finset.mem_erase.mpr ⟨hzx, (SimpleGraph.mem_neighborFinset L y z').mpr hyz'⟩ rw [hz_eq, Finset.mem_singleton] at hz' exact hz' -- Directed edge transition map T on Dart := {p : W × W // L.Adj p.1 p.2} let Dart := {p : W × W // L.Adj p.1 p.2} let step : Dart → Dart := fun d => ⟨(d.1.2, Classical.choose (hother d.1.1 d.1.2 d.2)), (Classical.choose_spec (hother d.1.1 d.1.2 d.2)).1.1⟩ have hstep_ne : ∀ d : Dart, (step d).1.2 ≠ d.1.1 := fun d => (Classical.choose_spec (hother d.1.1 d.1.2 d.2)).1.2 have hstep_inj : Function.Injective step := by intro d₁ d₂ heq have hfst : d₁.1.2 = d₂.1.2 := congrArg (fun d => d.1.1) heq have hsnd : (step d₁).1.2 = (step d₂).1.2 := congrArg (fun d => d.1.2) heq have hspec1 := hother d₁.1.1 d₁.1.2 d₁.2 have hz_adj : L.Adj d₁.1.2 (step d₁).1.2 := (step d₁).2 have hspec_rev := hother (step d₁).1.2 d₁.1.2 hz_adj.symm have h1_mem : L.Adj d₁.1.2 d₁.1.1 ∧ d₁.1.1 ≠ (step d₁).1.2 := ⟨d₁.2.symm, (hstep_ne d₁).symm⟩ have h2_mem : L.Adj d₁.1.2 d₂.1.1 ∧ d₂.1.1 ≠ (step d₁).1.2 := ⟨hfst ▸ d₂.2.symm, hsnd ▸ (hstep_ne d₂).symm⟩ have heq1 : d₁.1.1 = d₂.1.1 := (hspec_rev.unique h1_mem h2_mem) exact Subtype.ext (Prod.ext heq1 hfst) -- Pick initial dart p₀ starting at v₀ have hv₀_pos : 0 < (L.neighborFinset v₀).card := by rw [SimpleGraph.card_neighborFinset_eq_degree, hreg v₀]; omega obtain ⟨v₁, hv₁_mem⟩ := Finset.card_pos.mp hv₀_pos have hv₀₁ : L.Adj v₀ v₁ := (SimpleGraph.mem_neighborFinset L v₀ v₁).mp hv₁_mem let p₀ : Dart := ⟨(v₀, v₁), hv₀₁⟩ -- Finite injective map makes p₀ periodic! have hper : Function.IsPeriodicPt step (Function.minimalPeriod step p₀) p₀ := Function.isPeriodicPt_minimalPeriod step p₀ have hpos_k : 0 < Function.minimalPeriod step p₀ := by have hfin : ∃ i j : ℕ, i < j ∧ step^[i] p₀ = step^[j] p₀ := by obtain ⟨a, b, hab, heq⟩ := Finite.exists_ne_map_eq_of_infinite (fun i : ℕ => step^[i] p₀) rcases lt_or_gt_of_ne hab with hlt | hgt · exact ⟨a, b, hlt, heq⟩ · exact ⟨b, a, hgt, heq.symm⟩ obtain ⟨i, j, hij, heq⟩ := hfin have h0 : step^[j - i] p₀ = p₀ := by have hiter : step^[i] (step^[j - i] p₀) = step^[i] p₀ := by rw [← Function.iterate_add_apply, Nat.add_sub_cancel' (le_of_lt hij), heq] exact (Function.Injective.iterate hstep_inj i) hiter exact Function.minimalPeriod_pos_of_mem_periodicPts ⟨j - i, Nat.sub_pos_of_lt hij, h0⟩ set k := Function.minimalPeriod step p₀ with hk_def let cyc : ℕ → W := fun i => (step^[i] p₀).1.1 have hcyc_next : ∀ i : ℕ, (step^[i] p₀).1.2 = cyc (i + 1) := by intro i simp only [cyc, Function.iterate_succ_apply'] rfl have hcyc_adj : ∀ i : ℕ, L.Adj (cyc i) (cyc (i + 1)) := by intro i rw [← hcyc_next i] exact (step^[i] p₀).2 have hcyc_ne2 : ∀ i : ℕ, cyc (i + 2) ≠ cyc i := by intro i have := hstep_ne (step^[i] p₀) have h2 : (step (step^[i] p₀)).1.2 = cyc (i + 2) := by simpa [Function.iterate_succ_apply'] using hcyc_next (i + 1) rwa [h2] at this have hcyc_per : ∀ i : ℕ, cyc (i + k) = cyc i := by intro i simp only [cyc, Function.iterate_add_apply] have hp : step^[k] p₀ = p₀ := hper rw [hp] have hcyc_mod : ∀ i : ℕ, cyc (i % k) = cyc i := by intro i have hdiv : i = i % k + k * (i / k) := (Nat.mod_add_div i k).symm conv_rhs => rw [hdiv] induction (i / k) with | zero => simp | succ m ihm => rw [Nat.mul_succ, ← Nat.add_assoc, hcyc_per, ihm] -- Period k ≥ 3 have hk3 : 3 ≤ k := by by_contra hlt have hk12 : k = 1 ∨ k = 2 := by omega rcases hk12 with hk1 | hk2 · have h01 : cyc 0 = cyc 1 := by have := hcyc_per 0; rw [hk1] at this; exact this.symm exact L.loopless.irrefl (cyc 0) (h01 ▸ hcyc_adj 0) · have h02 : cyc 2 = cyc 0 := by have := hcyc_per 0; rw [hk2] at this; exact this exact hcyc_ne2 0 h02 -- Distinctness of cyc 0, ..., cyc (k - 1) via dart reversal involution let rev : Dart → Dart := fun d => ⟨(d.1.2, d.1.1), d.2.symm⟩ have hstep_rev : ∀ d : Dart, step (rev (step d)) = rev d := by intro d apply Subtype.ext apply Prod.ext · rfl · have hspec := hother (step d).1.2 d.1.2 (step d).2.symm have h1 : L.Adj d.1.2 (step (rev (step d))).1.2 ∧ (step (rev (step d))).1.2 ≠ (step d).1.2 := ⟨(step (rev (step d))).2, hstep_ne (rev (step d))⟩ have h2 : L.Adj d.1.2 d.1.1 ∧ d.1.1 ≠ (step d).1.2 := ⟨d.2.symm, (hstep_ne d).symm⟩ exact hspec.unique h1 h2 have hrev_iter : ∀ a b t : ℕ, t ≤ a → step^[b] p₀ = rev (step^[a] p₀) → step^[b + t] p₀ = rev (step^[a - t] p₀) := by intro a b t ht hbase induction t with | zero => simpa using hbase | succ t iht => have hprev := iht (by omega) have hsub : a - t = (a - (t + 1)) + 1 := by omega rw [Nat.add_succ, Function.iterate_succ_apply', hprev, hsub, Function.iterate_succ_apply', hstep_rev] have hcyc_inj : ∀ i j : ℕ, i < k → j < k → cyc i = cyc j → i = j := by intro i j hi hj heq by_contra hne wlog hlt : i < j generalizing i j · exact this j i hj hi heq.symm (Ne.symm hne) (by omega) have hne_next : cyc (j + 1) ≠ cyc (i + 1) := by intro hnext have hd_eq : step^[j] p₀ = step^[i] p₀ := by apply Subtype.ext; apply Prod.ext · exact heq.symm · rw [hcyc_next j, hcyc_next i]; exact hnext have hji : step^[j - i] p₀ = p₀ := by have hiter : step^[i] (step^[j - i] p₀) = step^[i] p₀ := by rw [← Function.iterate_add_apply, Nat.add_sub_cancel' (le_of_lt hlt), hd_eq] exact (Function.Injective.iterate hstep_inj i) hiter have hge : k ≤ j - i := Function.IsPeriodicPt.minimalPeriod_le (Nat.sub_pos_of_lt hlt) hji omega -- Let m = i + k - 1; then step^[m] p₀ = (cyc m, cyc i) and cyc m ≠ cyc (i + 1) let m := i + k - 1 have hm_succ : m + 1 = i + k := by omega have hm_snd : (step^[m] p₀).1.2 = cyc i := by rw [hcyc_next m, hm_succ, hcyc_per i] have hm_adj : L.Adj (cyc i) (cyc m) := by have := (step^[m] p₀).2 rw [hm_snd] at this exact this.symm have hm_ne : cyc m ≠ cyc (i + 1) := by have h2 := hcyc_ne2 m have hm2 : m + 2 = (i + 1) + k := by omega rw [hm2, hcyc_per (i + 1)] at h2 exact h2.symm -- Both cyc (j + 1) and cyc m are neighbors of cyc i distinct from cyc (i + 1) have hj_eq_m : cyc (j + 1) = cyc m := by have hspec := hother (cyc (i + 1)) (cyc i) (hcyc_adj i).symm exact hspec.unique ⟨heq ▸ hcyc_adj j, hne_next⟩ ⟨hm_adj, hm_ne⟩ have hbase : step^[j] p₀ = rev (step^[m] p₀) := by apply Subtype.ext; apply Prod.ext · change cyc j = (step^[m] p₀).1.2 rw [hm_snd, heq] · rw [hcyc_next j] exact hj_eq_m have hjm : j ≤ m := by omega let r := (m - j) / 2 have hr_le : r ≤ m := by omega have hmid := hrev_iter m j r hr_le hbase rcases Nat.even_or_odd (m - j) with ⟨t, ht⟩ | ⟨t, ht⟩ · have heq_idx : j + r = m - r := by omega rw [heq_idx] at hmid have hself : (step^[m - r] p₀).1.1 = (step^[m - r] p₀).1.2 := congrArg (fun d => d.1.1) hmid exact L.loopless.irrefl _ (hself ▸ (step^[m - r] p₀).2) · have heq_idx : m - r = (j + r) + 1 := by omega rw [heq_idx, Function.iterate_succ_apply'] at hmid have hback : (step (step^[j + r] p₀)).1.2 = (step^[j + r] p₀).1.1 := (congrArg (fun d => d.1.1) hmid).symm exact hstep_ne (step^[j + r] p₀) hback -- Cycle vertex set S = {cyc i | i < k} is a connected component let S : Set W := {x : W | ∃ i : ℕ, i < k ∧ cyc i = x} have hS_comp : ∀ x y : W, L.Adj x y → (x ∈ S ↔ y ∈ S) := by suffices hdir : ∀ x y : W, L.Adj x y → x ∈ S → y ∈ S from fun x y hxy => ⟨hdir x y hxy, hdir y x hxy.symm⟩ intro x y hxy ⟨i, hi, hix⟩ subst hix -- The two neighbors of cyc i are cyc (i + 1) and cyc ((i + k - 1) % k) let p_idx := (i + k - 1) % k have hp_lt : p_idx < k := Nat.mod_lt _ hpos_k have hp_adj : L.Adj (cyc i) (cyc p_idx) := by have h1 := hcyc_adj (i + k - 1) have hsucc : i + k - 1 + 1 = i + k := by omega rw [hsucc, hcyc_per i, ← hcyc_mod (i + k - 1)] at h1 exact h1.symm have hne_pair : cyc (i + 1) ≠ cyc p_idx := by intro heq_p have h2 := hcyc_ne2 (i + k - 1) have hm2 : i + k - 1 + 2 = (i + 1) + k := by omega rw [hm2, hcyc_per (i + 1), ← hcyc_mod (i + k - 1)] at h2 exact h2 heq_p by_cases hy1 : y = cyc (i + 1) · refine ⟨(i + 1) % k, Nat.mod_lt _ hpos_k, ?_⟩ rw [hcyc_mod, ← hy1] · have hspec := hother (cyc (i + 1)) (cyc i) (hcyc_adj i).symm have hyp : y = cyc p_idx := hspec.unique ⟨hxy, hy1⟩ ⟨hp_adj, hne_pair.symm⟩ exact ⟨p_idx, hp_lt, hyp.symm⟩ -- Prove L.induce S is WKE using the unified (even + odd) formula! have hS_wke : IsWKE (L.induce S) := by let r := k / 2 have hcyc_mem : ∀ i : ℕ, cyc i ∈ S := fun i => ⟨i % k, Nat.mod_lt _ hpos_k, hcyc_mod i⟩ let vS : ℕ → S := fun i => ⟨cyc i, hcyc_mem i⟩ have hvS_inj : ∀ i j : ℕ, i < k → j < k → vS i = vS j → i = j := fun i j hi hj h => hcyc_inj i j hi hj (congrArg Subtype.val h) let M₀ : Finset (Sym2 S) := (Finset.range r).image (fun j => s(vS (2 * j + 1), vS (2 * j + 2))) let Q₀ : Finset S := (Finset.range r).image (fun j => vS (2 * j)) have hQ₀_card : Q₀.card = r := by rw [Finset.card_image_of_injOn] · exact Finset.card_range r · intro a ha b hb hab rw [Finset.mem_coe, Finset.mem_range] at ha hb have h2 := hvS_inj (2 * a) (2 * b) (by omega) (by omega) hab omega have hM₀_disj_pts : ∀ a b : ℕ, a < r → b < r → a ≠ b → ∀ z : S, z ∈ s(vS (2 * a + 1), vS (2 * a + 2)) → z ∉ s(vS (2 * b + 1), vS (2 * b + 2)) := by intro a b ha hb hab z hz1 hz2 rw [Sym2.mem_iff] at hz1 hz2 -- Reduce all indices mod k; note 2*a+1 < k and (2*a+2) % k is either 2*a+2 or 0! have hmod_eq : ∀ u w : ℕ, vS u = vS w → u % k = w % k := by intro u w huw apply hcyc_inj (u % k) (w % k) (Nat.mod_lt _ hpos_k) (Nat.mod_lt _ hpos_k) rw [hcyc_mod u, hcyc_mod w] exact congrArg Subtype.val huw rcases hz1 with rfl | rfl <;> rcases hz2 with heq | heq · have := hmod_eq _ _ heq rw [Nat.mod_eq_of_lt (show 2 * a + 1 < k by omega), Nat.mod_eq_of_lt (show 2 * b + 1 < k by omega)] at this; omega · have := hmod_eq _ _ heq rw [Nat.mod_eq_of_lt (show 2 * a + 1 < k by omega)] at this by_cases hb2 : 2 * b + 2 < k · rw [Nat.mod_eq_of_lt hb2] at this; omega · have hbk : 2 * b + 2 = k := by omega rw [hbk, Nat.mod_self] at this; omega · have := hmod_eq _ _ heq rw [Nat.mod_eq_of_lt (show 2 * b + 1 < k by omega)] at this by_cases ha2 : 2 * a + 2 < k · rw [Nat.mod_eq_of_lt ha2] at this; omega · have hak : 2 * a + 2 = k := by omega rw [hak, Nat.mod_self] at this; omega · have := hmod_eq _ _ heq by_cases ha2 : 2 * a + 2 < k <;> by_cases hb2 : 2 * b + 2 < k · rw [Nat.mod_eq_of_lt ha2, Nat.mod_eq_of_lt hb2] at this; omega · have hbk : 2 * b + 2 = k := by omega rw [Nat.mod_eq_of_lt ha2, hbk, Nat.mod_self] at this; omega · have hak : 2 * a + 2 = k := by omega rw [hak, Nat.mod_self, Nat.mod_eq_of_lt hb2] at this; omega · omega have hM₀_card : M₀.card = r := by rw [Finset.card_image_of_injOn] · exact Finset.card_range r · intro a ha b hb hab rw [Finset.mem_coe, Finset.mem_range] at ha hb change s(vS (2 * a + 1), vS (2 * a + 2)) = s(vS (2 * b + 1), vS (2 * b + 2)) at hab by_contra hne exact hM₀_disj_pts a b ha hb hne (vS (2 * a + 1)) (Sym2.mem_mk_left _ _) (hab ▸ Sym2.mem_mk_left _ _) refine ⟨M₀, Q₀, ⟨?_, ?_⟩, by rw [hQ₀_card, hM₀_card], ?_⟩ · intro e he obtain ⟨j, _, rfl⟩ := Finset.mem_image.mp he exact hcyc_adj (2 * j + 1) · intro e₁ h1 e₂ h2 hne z hz₁ hz₂ obtain ⟨a, ha, rfl⟩ := Finset.mem_image.mp h1 obtain ⟨b, hb, rfl⟩ := Finset.mem_image.mp h2 rw [Finset.mem_range] at ha hb exact hM₀_disj_pts a b ha hb (fun h => hne (by subst h; rfl)) z hz₁ hz₂ · intro x y hxy hx hy obtain ⟨i, hi, hix⟩ := x.2 have hx_eq : x = vS i := Subtype.ext hix.symm -- y must be either vS (i + 1) or vS ((i + k - 1) % k) have hynbs : y = vS (i + 1) ∨ y = vS ((i + k - 1) % k) := by let p_idx := (i + k - 1) % k have hp_adj : L.Adj (cyc i) (cyc p_idx) := by have h1 := hcyc_adj (i + k - 1) have hsucc : i + k - 1 + 1 = i + k := by omega rw [hsucc, hcyc_per i, ← hcyc_mod (i + k - 1)] at h1 exact h1.symm have hne_pair : cyc (i + 1) ≠ cyc p_idx := by intro heq_p have h2 := hcyc_ne2 (i + k - 1) have hm2 : i + k - 1 + 2 = (i + 1) + k := by omega rw [hm2, hcyc_per (i + 1), ← hcyc_mod (i + k - 1)] at h2 exact h2 heq_p by_cases hy1 : y.1 = cyc (i + 1) · exact Or.inl (Subtype.ext hy1) · have hspec := hother (cyc (i + 1)) (cyc i) (hcyc_adj i).symm have hyp : y.1 = cyc p_idx := hspec.unique ⟨hix.symm ▸ hxy, hy1⟩ ⟨hp_adj, hne_pair.symm⟩ exact Or.inr (Subtype.ext hyp) -- Helper: for any index t < k with vS t ∉ Q₀ and vS (t + 1) ∉ Q₀, s(vS t, vS (t + 1)) ∈ M₀ have hstep_cov : ∀ t : ℕ, t < k → vS t ∉ Q₀ → vS (t + 1) ∉ Q₀ → s(vS t, vS (t + 1)) ∈ M₀ := by intro t ht htQ ht1Q rcases Nat.even_or_odd t with ⟨j, hj⟩ | ⟨j, hj⟩ · by_cases hjr : j < r · exfalso; apply htQ exact Finset.mem_image.mpr ⟨j, Finset.mem_range.mpr hjr, by have : 2 * j = t := by omega rw [this]⟩ · exfalso; apply ht1Q have ht_eq : t + 1 = k := by omega refine Finset.mem_image.mpr ⟨0, Finset.mem_range.mpr (by omega), ?_⟩ apply Subtype.ext change cyc 0 = cyc (t + 1) rw [ht_eq, ← Nat.zero_add k, hcyc_per 0] · have hjr : j < r := by omega refine Finset.mem_image.mpr ⟨j, Finset.mem_range.mpr hjr, ?_⟩ have h2j : 2 * j + 1 = t := by omega have h2j2 : 2 * j + 2 = t + 1 := by omega rw [h2j, h2j2] rcases hynbs with hy1 | hy2 · rw [hx_eq, hy1] exact hstep_cov i hi (hx_eq ▸ hx) (hy1 ▸ hy) · let p_idx := (i + k - 1) % k have hp_lt : p_idx < k := Nat.mod_lt _ hpos_k have hp_succ : vS (p_idx + 1) = vS i := by apply Subtype.ext change cyc (p_idx + 1) = cyc i rw [← hcyc_mod (p_idx + 1)] have hmod1 : (p_idx + 1) % k = i % k := by simp only [p_idx, Nat.mod_add_mod] have : i + k - 1 + 1 = i + k := by omega rw [this, Nat.add_mod_right] rw [hmod1, hcyc_mod i] rw [hx_eq, hy2, Sym2.eq_swap, ← hp_succ] exact hstep_cov p_idx hp_lt (hy2 ▸ hy) (hp_succ ▸ hx_eq ▸ hx) -- Apply component decomposition + IH on Sᶜ refine isWKE_of_component S hS_comp hS_wke ?_ have hcard_lt : Fintype.card (Sᶜ : Set W) < n := by have hmem0 : cyc 0 ∈ S := ⟨0, hpos_k, rfl⟩ have hle_sub : Fintype.card (Sᶜ : Set W) ≤ Fintype.card {x : W // x ≠ cyc 0} := by refine Fintype.card_le_of_injective (fun x => ⟨x.1, fun h => x.2 (h ▸ hmem0)⟩) (fun a b h => Subtype.ext (congrArg (fun z : {x : W // x ≠ cyc 0} => z.1) h)) have := card_ne_subtype (cyc 0) omega refine ih _ hcard_lt (L.induce Sᶜ) rfl (fun x => ?_) have hsub : ((L.induce Sᶜ).neighborFinset x).image Subtype.val ⊆ L.neighborFinset x.1 := by intro y hy obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hy rw [SimpleGraph.mem_neighborFinset] at hz ⊢ exact hz calc (L.induce Sᶜ).degree x = (((L.induce Sᶜ).neighborFinset x).image Subtype.val).card := (Finset.card_image_of_injective _ Subtype.val_injective).symm _ ≤ (L.neighborFinset x.1).card := Finset.card_le_card hsub _ ≤ 2 := hdeg x.1 · rw [not_nonempty_iff] at hne exact isWKE_of_no_edges (fun u => (IsEmpty.false u).elim) /-- Convenience wrapper for `isWKE_of_maxDeg_le_two`. -/ theorem isWKE_of_maxDeg_le_two' {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj] (hdeg : ∀ v : W, L.degree v ≤ 2) : IsWKE L := isWKE_of_maxDeg_le_two (Fintype.card W) L rfl hdeg /-- Helper: building a matching from a list of 2, 3, or 4 pairwise-disjoint edges. -/ lemma isMatching_pair {W : Type*} [DecidableEq W] {L : SimpleGraph W} {a b c d : W} (hab : L.Adj a b) (hcd : L.Adj c d) (hac : a ≠ c) (had : a ≠ d) (hbc : b ≠ c) (hbd : b ≠ d) : IsMatching L {s(a, b), s(c, d)} ∧ ({s(a, b), s(c, d)} : Finset (Sym2 W)).card = 2 := by have hne : s(a, b) ≠ s(c, d) := by intro h; rw [Sym2.eq_iff] at h; rcases h with ⟨h1, _⟩ | ⟨h1, _⟩ · exact hac h1 · exact had h1 refine ⟨⟨?_, ?_⟩, Finset.card_pair hne⟩ · intro e he simp only [mem_insert, mem_singleton] at he rcases he with rfl | rfl · exact hab · exact hcd · intro e₁ h1 e₂ h2 hene x hx1 hx2 simp only [mem_insert, mem_singleton] at h1 h2 rcases h1 with rfl | rfl <;> rcases h2 with rfl | rfl · exact hene rfl · rw [Sym2.mem_iff] at hx1 hx2 rcases hx1 with rfl | rfl <;> rcases hx2 with h | h · exact hac h · exact had h · exact hbc h · exact hbd h · rw [Sym2.mem_iff] at hx1 hx2 rcases hx1 with rfl | rfl <;> rcases hx2 with h | h · exact hac h.symm · exact hbc h.symm · exact had h.symm · exact hbd h.symm · exact hene rfl lemma isMatching_triple {W : Type*} [DecidableEq W] {L : SimpleGraph W} {a₁ b₁ a₂ b₂ a₃ b₃ : W} (h1 : L.Adj a₁ b₁) (h2 : L.Adj a₂ b₂) (h3 : L.Adj a₃ b₃) (hdisj12 : a₁ ≠ a₂ ∧ a₁ ≠ b₂ ∧ b₁ ≠ a₂ ∧ b₁ ≠ b₂) (hdisj13 : a₁ ≠ a₃ ∧ a₁ ≠ b₃ ∧ b₁ ≠ a₃ ∧ b₁ ≠ b₃) (hdisj23 : a₂ ≠ a₃ ∧ a₂ ≠ b₃ ∧ b₂ ≠ a₃ ∧ b₂ ≠ b₃) : IsMatching L {s(a₁, b₁), s(a₂, b₂), s(a₃, b₃)} ∧ ({s(a₁, b₁), s(a₂, b₂), s(a₃, b₃)} : Finset (Sym2 W)).card = 3 := by have h12 : s(a₁, b₁) ≠ s(a₂, b₂) := by intro h; rw [Sym2.eq_iff] at h; rcases h with ⟨h, _⟩ | ⟨h, _⟩ · exact hdisj12.1 h · exact hdisj12.2.1 h have h13 : s(a₁, b₁) ≠ s(a₃, b₃) := by intro h; rw [Sym2.eq_iff] at h; rcases h with ⟨h, _⟩ | ⟨h, _⟩ · exact hdisj13.1 h · exact hdisj13.2.1 h have h23 : s(a₂, b₂) ≠ s(a₃, b₃) := by intro h; rw [Sym2.eq_iff] at h; rcases h with ⟨h, _⟩ | ⟨h, _⟩ · exact hdisj23.1 h · exact hdisj23.2.1 h have hcard : ({s(a₁, b₁), s(a₂, b₂), s(a₃, b₃)} : Finset (Sym2 W)).card = 3 := by rw [Finset.card_insert_of_notMem (by simp [h12, h13]), Finset.card_pair h23] refine ⟨⟨?_, ?_⟩, hcard⟩ · intro e he simp only [mem_insert, mem_singleton] at he rcases he with rfl | rfl | rfl <;> assumption · intro e₁ he₁ e₂ he₂ hene x hx1 hx2 simp only [mem_insert, mem_singleton] at he₁ he₂ rcases he₁ with rfl | rfl | rfl <;> rcases he₂ with rfl | rfl | rfl · exact hene rfl · rw [Sym2.mem_iff] at hx1 hx2; rcases hx1 with rfl | rfl <;> rcases hx2 with h | h <;> tauto · rw [Sym2.mem_iff] at hx1 hx2; rcases hx1 with rfl | rfl <;> rcases hx2 with h | h <;> tauto · rw [Sym2.mem_iff] at hx1 hx2; rcases hx1 with rfl | rfl <;> rcases hx2 with h | h <;> first | exact hdisj12.1 h.symm | exact hdisj12.2.1 h.symm | exact hdisj12.2.2.1 h.symm | exact hdisj12.2.2.2 h.symm · exact hene rfl · rw [Sym2.mem_iff] at hx1 hx2; rcases hx1 with rfl | rfl <;> rcases hx2 with h | h <;> tauto · rw [Sym2.mem_iff] at hx1 hx2; rcases hx1 with rfl | rfl <;> rcases hx2 with h | h <;> first | exact hdisj13.1 h.symm | exact hdisj13.2.1 h.symm | exact hdisj13.2.2.1 h.symm | exact hdisj13.2.2.2 h.symm · rw [Sym2.mem_iff] at hx1 hx2; rcases hx1 with rfl | rfl <;> rcases hx2 with h | h <;> first | exact hdisj23.1 h.symm | exact hdisj23.2.1 h.symm | exact hdisj23.2.2.1 h.symm | exact hdisj23.2.2.2 h.symm · exact hene rfl lemma isMatching_quad {W : Type*} [DecidableEq W] {L : SimpleGraph W} {a₁ b₁ a₂ b₂ a₃ b₃ a₄ b₄ : W} (h1 : L.Adj a₁ b₁) (h2 : L.Adj a₂ b₂) (h3 : L.Adj a₃ b₃) (h4 : L.Adj a₄ b₄) (hdisj : ([a₁, b₁, a₂, b₂, a₃, b₃, a₄, b₄] : List W).Nodup) : IsMatching L {s(a₁, b₁), s(a₂, b₂), s(a₃, b₃), s(a₄, b₄)} ∧ ({s(a₁, b₁), s(a₂, b₂), s(a₃, b₃), s(a₄, b₄)} : Finset (Sym2 W)).card = 4 := by simp only [List.nodup_cons, List.mem_cons, List.not_mem_nil, or_false, not_or, List.nodup_nil, and_true] at hdisj obtain ⟨⟨h12, h13, h14, h15, h16, h17, h18⟩, ⟨h23, h24, h25, h26, h27, h28⟩, ⟨h34, h35, h36, h37, h38⟩, ⟨h45, h46, h47, h48⟩, ⟨h56, h57, h58⟩, ⟨h67, h68⟩, h78⟩ := hdisj have hne_pair : ∀ x₁ y₁ x₂ y₂ : W, x₁ ≠ x₂ → x₁ ≠ y₂ → s(x₁, y₁) ≠ s(x₂, y₂) := by intro x₁ y₁ x₂ y₂ hx1 hx2 h; rw [Sym2.eq_iff] at h; rcases h with ⟨h, _⟩ | ⟨h, _⟩ · exact hx1 h · exact hx2 h have hcard : ({s(a₁, b₁), s(a₂, b₂), s(a₃, b₃), s(a₄, b₄)} : Finset (Sym2 W)).card = 4 := by rw [Finset.card_insert_of_notMem (by simp [hne_pair a₁ b₁ a₂ b₂ h13 h14, hne_pair a₁ b₁ a₃ b₃ h15 h16, hne_pair a₁ b₁ a₄ b₄ h17 h18]), Finset.card_insert_of_notMem (by simp [hne_pair a₂ b₂ a₃ b₃ h35 h36, hne_pair a₂ b₂ a₄ b₄ h37 h38]), Finset.card_pair (hne_pair a₃ b₃ a₄ b₄ h57 h58)] refine ⟨⟨?_, ?_⟩, hcard⟩ · intro e he simp only [mem_insert, mem_singleton] at he rcases he with rfl | rfl | rfl | rfl <;> assumption · intro e₁ he₁ e₂ he₂ hene x hx1 hx2 simp only [mem_insert, mem_singleton] at he₁ he₂ rcases he₁ with rfl | rfl | rfl | rfl <;> rcases he₂ with rfl | rfl | rfl | rfl all_goals try exact hene rfl all_goals (rw [Sym2.mem_iff] at hx1 hx2; rcases hx1 with rfl | rfl <;> rcases hx2 with h | h <;> first | exact h13 h | exact h14 h | exact h15 h | exact h16 h | exact h17 h | exact h18 h | exact h23 h | exact h24 h | exact h25 h | exact h26 h | exact h27 h | exact h28 h | exact h35 h | exact h36 h | exact h37 h | exact h38 h | exact h45 h | exact h46 h | exact h47 h | exact h48 h | exact h57 h | exact h58 h | exact h67 h | exact h68 h | exact h13 h.symm | exact h14 h.symm | exact h15 h.symm | exact h16 h.symm | exact h17 h.symm | exact h18 h.symm | exact h23 h.symm | exact h24 h.symm | exact h25 h.symm | exact h26 h.symm | exact h27 h.symm | exact h28 h.symm | exact h35 h.symm | exact h36 h.symm | exact h37 h.symm | exact h38 h.symm | exact h45 h.symm | exact h46 h.symm | exact h47 h.symm | exact h48 h.symm | exact h57 h.symm | exact h58 h.symm | exact h67 h.symm | exact h68 h.symm) lemma nodup4_iff {α : Type*} {a b c d : α} : ([a, b, c, d] : List α).Nodup ↔ a ≠ b ∧ a ≠ c ∧ a ≠ d ∧ b ≠ c ∧ b ≠ d ∧ c ≠ d := by simp [List.nodup_cons, ne_eq, and_assoc] /-- **Exact General WKE Threshold (`n ≤ 4`):** Every finite simple graph `L` on at most 4 vertices is weak König–Egerváry. -/ theorem isWKE_of_card_le_four {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj] (hcard : Fintype.card W ≤ 4) : IsWKE L := by by_cases hdeg : ∀ v : W, L.degree v ≤ 2 · exact isWKE_of_maxDeg_le_two' L hdeg · push Not at hdeg obtain ⟨v, hv⟩ := hdeg have hv_lt : L.degree v < Fintype.card W := L.degree_lt_card_verts v have hcard4 : Fintype.card W = 4 := by omega have hv3 : (L.neighborFinset v).card = 3 := by rw [SimpleGraph.card_neighborFinset_eq_degree]; omega obtain ⟨a, b, c, hab, hac, hbc, hne_eq⟩ := Finset.card_eq_three.mp hv3 have hva : L.Adj v a := (SimpleGraph.mem_neighborFinset L v a).mp (hne_eq ▸ by simp) have hvb : L.Adj v b := (SimpleGraph.mem_neighborFinset L v b).mp (hne_eq ▸ by simp) have hvc : L.Adj v c := (SimpleGraph.mem_neighborFinset L v c).mp (hne_eq ▸ by simp) have hne_va : v ≠ a := L.ne_of_adj hva have hne_vb : v ≠ b := L.ne_of_adj hvb have hne_vc : v ≠ c := L.ne_of_adj hvc by_cases h_edge : L.Adj a b ∨ L.Adj a c ∨ L.Adj b c · -- A matching of size 2 gives WKE via I = {v, third vertex}! have hpm : ∀ x y z : W, L.Adj v z → L.Adj x y → v ≠ x → v ≠ y → z ≠ x → z ≠ y → v ≠ z → IsWKE L := by intro x y z hvz hxy hvx hvy hzx hzy hvz_ne obtain ⟨hM, hMc⟩ := isMatching_pair hvz hxy hvx hvy hzx hzy refine isWKE_of_dissociation_matching {s(v, z), s(x, y)} {v, z} hM ?_ ?_ · rw [Finset.card_pair hvz_ne, hMc, hcard4] · intro p hp q hq hpq simp only [mem_insert, mem_singleton] at hp hq rcases hp with rfl | rfl <;> rcases hq with rfl | rfl · exact (L.loopless.irrefl _ hpq).elim · exact Finset.mem_insert_self _ _ · rw [Sym2.eq_swap]; exact Finset.mem_insert_self _ _ · exact (L.loopless.irrefl _ hpq).elim rcases h_edge with h1 | h2 | h3 · exact hpm a b c hvc h1 hne_va hne_vb hac.symm hbc.symm hne_vc · exact hpm a c b hvb h2 hne_va hne_vc hab.symm hbc hne_vb · exact hpm b c a hva h3 hne_vb hne_vc hab hac hne_va · -- {a, b, c} is independent of size 3; M = {s(v, a)} has size 1! push Not at h_edge refine isWKE_of_alpha_add_matching {s(v, a)} {a, b, c} (isMatching_singleton hva) ?_ ?_ · intro x hx y hy hxy simp only [mem_insert, mem_singleton] at hx hy rcases hx with rfl | rfl | rfl <;> rcases hy with rfl | rfl | rfl · exact L.loopless.irrefl _ hxy · exact h_edge.1 hxy · exact h_edge.2.1 hxy · exact h_edge.1 hxy.symm · exact L.loopless.irrefl _ hxy · exact h_edge.2.2 hxy · exact h_edge.2.1 hxy.symm · exact h_edge.2.2 hxy.symm · exact L.loopless.irrefl _ hxy · rw [Finset.card_insert_of_notMem (by simp [hab, hac]), Finset.card_pair hbc, Finset.card_singleton, hcard4] end WKEGeneralClasses /-! ## Section 4: Sharp Triangle-Free WKE Threshold (`|V| ≤ 8`) -/ section TriangleFreeWKE /-- Predicate expressing that `L` is triangle-free (contains no 3-clique). -/ def IsTF {W : Type*} (L : SimpleGraph W) : Prop := ∀ a b c : W, L.Adj a b → L.Adj b c → ¬ L.Adj a c lemma isTF_of_cliqueFree_three {W : Type*} {L : SimpleGraph W} (h : L.CliqueFree 3) : IsTF L := by classical intro a b c hab hbc hac have hne_ab : a ≠ b := L.ne_of_adj hab have hne_bc : b ≠ c := L.ne_of_adj hbc have hne_ac : a ≠ c := L.ne_of_adj hac have hclq : L.IsNClique 3 {a, b, c} := by refine ⟨?_, ?_⟩ · intro x hx y hy hxy simp only [Finset.mem_coe, mem_insert, mem_singleton] at hx hy rcases hx with rfl | rfl | rfl <;> rcases hy with rfl | rfl | rfl · exact (hxy rfl).elim · exact hab · exact hac · exact hab.symm · exact (hxy rfl).elim · exact hbc · exact hac.symm · exact hbc.symm · exact (hxy rfl).elim · rw [Finset.card_insert_of_notMem (by simp [hne_ab, hne_ac]), Finset.card_pair hne_bc] exact h {a, b, c} hclq /-- An independent set in `L`. -/ def IsIndepSet {W : Type*} (L : SimpleGraph W) (I : Finset W) : Prop := ∀ u ∈ I, ∀ v ∈ I, ¬ L.Adj u v /-- In a triangle-free graph, every open neighborhood `L.neighborFinset v` is an independent set. -/ lemma neighborFinset_isIndepSet {W : Type*} [Fintype W] [DecidableEq W] {L : SimpleGraph W} [DecidableRel L.Adj] (htf : IsTF L) (v : W) : IsIndepSet L (L.neighborFinset v) := by intro x hx y hy hxy rw [SimpleGraph.mem_neighborFinset] at hx hy exact htf x v y hx.symm hy hxy /-- In a triangle-free graph, any 3-element subset contains a non-adjacent pair of distinct vertices. -/ lemma exists_nonadj_pair_of_card_ge_three {W : Type*} [DecidableEq W] {L : SimpleGraph W} (htf : IsTF L) {S : Finset W} (h3 : 3 ≤ S.card) : ∃ x ∈ S, ∃ y ∈ S, x ≠ y ∧ ¬ L.Adj x y := by obtain ⟨T, hTS, hT3⟩ := Finset.exists_subset_card_eq h3 obtain ⟨a, b, c, hab, hac, hbc, rfl⟩ := Finset.card_eq_three.mp hT3 have ha : a ∈ S := hTS (by simp) have hb : b ∈ S := hTS (by simp) have hc : c ∈ S := hTS (by simp) by_cases h1 : L.Adj a b · by_cases h2 : L.Adj b c · exact ⟨a, ha, c, hc, hac, htf a b c h1 h2⟩ · exact ⟨b, hb, c, hc, hbc, h2⟩ · exact ⟨a, ha, b, hb, hab, h1⟩ /-- **4-Vertex Triangle-Free Perfect Matching Lemma:** In a triangle-free graph, any 4-element vertex subset `W` containing no independent 3-subset admits a partition `{p₀, p₁, p₂, p₃}` with `L.Adj p₀ p₁` and `L.Adj p₂ p₃`. -/ lemma tf_card_four_alpha_le_two_pm {V : Type*} [DecidableEq V] {L : SimpleGraph V} (htf : IsTF L) {W : Finset V} (hW4 : W.card = 4) (hno3 : ∀ I : Finset V, I ⊆ W → IsIndepSet L I → I.card ≤ 2) : ∃ p₀ p₁ p₂ p₃ : V, W = {p₀, p₁, p₂, p₃} ∧ ([p₀, p₁, p₂, p₃] : List V).Nodup ∧ L.Adj p₀ p₁ ∧ L.Adj p₂ p₃ := by -- Extract 4 distinct elements a, b, c, d of W have hne : W.Nonempty := Finset.card_pos.mp (by omega) obtain ⟨a, haW⟩ := hne have h3 : (W.erase a).card = 3 := by rw [Finset.card_erase_of_mem haW, hW4] obtain ⟨b, c, d, hbc, hbd, hcd, hW_er⟩ := Finset.card_eq_three.mp h3 have hW_eq : W = {a, b, c, d} := by rw [← Finset.insert_erase haW, hW_er] have hab : a ≠ b := by intro h; subst h have : a ∈ W.erase a := hW_er ▸ by simp exact (Finset.mem_erase.mp this).1 rfl have hac : a ≠ c := by intro h; subst h have : a ∈ W.erase a := hW_er ▸ by simp exact (Finset.mem_erase.mp this).1 rfl have had : a ≠ d := by intro h; subst h have : a ∈ W.erase a := hW_er ▸ by simp exact (Finset.mem_erase.mp this).1 rfl -- Helper: from any edge x-y and remaining pair z, w of W, produce a perfect matching! have hfrom_edge : ∀ x y z w : V, W = {x, y, z, w} → ([x, y, z, w] : List V).Nodup → L.Adj x y → ∃ p₀ p₁ p₂ p₃ : V, W = {p₀, p₁, p₂, p₃} ∧ ([p₀, p₁, p₂, p₃] : List V).Nodup ∧ L.Adj p₀ p₁ ∧ L.Adj p₂ p₃ := by intro x y z w hWeq hnd hxy by_cases hzw : L.Adj z w · exact ⟨x, y, z, w, hWeq, hnd, hxy, hzw⟩ · rw [nodup4_iff] at hnd obtain ⟨hxy_ne, hxz_ne, hxw_ne, hyz_ne, hyw_ne, hzw_ne⟩ := hnd -- {x, z, w} cannot be independent, so x is adj to z or w have hx_zw : L.Adj x z ∨ L.Adj x w := by by_contra hno push Not at hno have hI : IsIndepSet L {x, z, w} := by intro p hp q hq hpq simp only [mem_insert, mem_singleton] at hp hq rcases hp with rfl | rfl | rfl <;> rcases hq with rfl | rfl | rfl · exact L.loopless.irrefl _ hpq · exact hno.1 hpq · exact hno.2 hpq · exact hno.1 hpq.symm · exact L.loopless.irrefl _ hpq · exact hzw hpq · exact hno.2 hpq.symm · exact hzw hpq.symm · exact L.loopless.irrefl _ hpq have hsub : ({x, z, w} : Finset V) ⊆ W := by rw [hWeq]; intro p hp; simp at hp ⊢; tauto have hc3 : ({x, z, w} : Finset V).card = 3 := by rw [Finset.card_insert_of_notMem (by simp [hxz_ne, hxw_ne]), Finset.card_pair hzw_ne] have := hno3 {x, z, w} hsub hI omega -- {y, z, w} cannot be independent, so y is adj to z or w have hy_zw : L.Adj y z ∨ L.Adj y w := by by_contra hno push Not at hno have hI : IsIndepSet L {y, z, w} := by intro p hp q hq hpq simp only [mem_insert, mem_singleton] at hp hq rcases hp with rfl | rfl | rfl <;> rcases hq with rfl | rfl | rfl · exact L.loopless.irrefl _ hpq · exact hno.1 hpq · exact hno.2 hpq · exact hno.1 hpq.symm · exact L.loopless.irrefl _ hpq · exact hzw hpq · exact hno.2 hpq.symm · exact hzw hpq.symm · exact L.loopless.irrefl _ hpq have hsub : ({y, z, w} : Finset V) ⊆ W := by rw [hWeq]; intro p hp; simp at hp ⊢; tauto have hc3 : ({y, z, w} : Finset V).card = 3 := by rw [Finset.card_insert_of_notMem (by simp [hyz_ne, hyw_ne]), Finset.card_pair hzw_ne] have := hno3 {y, z, w} hsub hI omega rcases hx_zw with hxz | hxw · have hyw : L.Adj y w := by rcases hy_zw with hyz | hyw · exact (htf x y z hxy hyz hxz).elim · exact hyw refine ⟨x, z, y, w, ?_, ?_, hxz, hyw⟩ · rw [hWeq]; ext p; simp; tauto · rw [nodup4_iff]; exact ⟨hxz_ne, hxy_ne, hxw_ne, hyz_ne.symm, hzw_ne, hyw_ne⟩ · have hyz : L.Adj y z := by rcases hy_zw with hyz | hyw · exact hyz · exact (htf x y w hxy hyw hxw).elim refine ⟨x, w, y, z, ?_, ?_, hxw, hyz⟩ · rw [hWeq]; ext p; simp; tauto · rw [nodup4_iff]; exact ⟨hxw_ne, hxy_ne, hxz_ne, hyw_ne.symm, hzw_ne.symm, hyz_ne⟩ -- At least one edge exists among {a, b, c} (else {a, b, c} is independent of size 3!) have hedge : L.Adj a b ∨ L.Adj a c ∨ L.Adj b c := by by_contra hno push Not at hno have hI : IsIndepSet L {a, b, c} := by intro p hp q hq hpq simp only [mem_insert, mem_singleton] at hp hq rcases hp with rfl | rfl | rfl <;> rcases hq with rfl | rfl | rfl · exact L.loopless.irrefl _ hpq · exact hno.1 hpq · exact hno.2.1 hpq · exact hno.1 hpq.symm · exact L.loopless.irrefl _ hpq · exact hno.2.2 hpq · exact hno.2.1 hpq.symm · exact hno.2.2 hpq.symm · exact L.loopless.irrefl _ hpq have hsub : ({a, b, c} : Finset V) ⊆ W := by rw [hW_eq]; intro p hp; simp at hp ⊢; tauto have hc3 : ({a, b, c} : Finset V).card = 3 := by rw [Finset.card_insert_of_notMem (by simp [hab, hac]), Finset.card_pair hbc] have := hno3 {a, b, c} hsub hI omega rcases hedge with h1 | h2 | h3 · exact hfrom_edge a b c d hW_eq (nodup4_iff.mpr ⟨hab, hac, had, hbc, hbd, hcd⟩) h1 · exact hfrom_edge a c b d (by rw [hW_eq]; ext p; simp; tauto) (nodup4_iff.mpr ⟨hac, hab, had, hbc.symm, hcd, hbd⟩) h2 · exact hfrom_edge b c a d (by rw [hW_eq]; ext p; simp; tauto) (nodup4_iff.mpr ⟨hbc, hab.symm, hbd, hac.symm, hcd, had⟩) h3 /-- **Hall's Marriage Theorem Lemma (`2α(L) ≥ n`, `n ≤ 8`, `δ ≥ 2`, triangle-free):** Every triangle-free graph on `n ≤ 8` vertices with `δ(L) ≥ 2` and an independent set of size `≥ ⌈n/2⌉` is König–Egerváry (hence WKE). -/ theorem triangleFree_ke_of_two_alpha_ge {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj] (htf : IsTF L) (hcard : Fintype.card W ≤ 8) (hmin : ∀ v : W, 2 ≤ L.degree v) (I₀ : Finset W) (hI₀ : IsIndepSet L I₀) (h2alpha : Fintype.card W ≤ 2 * I₀.card) : IsWKE L := by classical -- Choose a maximum-cardinality independent set I let indepSets : Finset (Finset W) := Finset.univ.filter (IsIndepSet L) have hI₀_mem : I₀ ∈ indepSets := Finset.mem_filter.mpr ⟨Finset.mem_univ _, hI₀⟩ obtain ⟨I, hI_mem, hI_max⟩ := Finset.exists_max_image indepSets Finset.card ⟨I₀, hI₀_mem⟩ have hI_ind : IsIndepSet L I := (Finset.mem_filter.mp hI_mem).2 have hI_ge_I₀ : I₀.card ≤ I.card := hI_max I₀ hI₀_mem have h2I : Fintype.card W ≤ 2 * I.card := by omega let R : Finset W := Finset.univ \ I have hR_card : R.card + I.card = Fintype.card W := by rw [Finset.card_sdiff, Finset.inter_univ, Finset.card_univ] have := Finset.card_le_univ I omega have hR_le_I : R.card ≤ I.card := by omega have hR_le_4 : R.card ≤ 4 := by omega -- Neighborhood map from R into I let t : {r : W // r ∈ R} → Finset W := fun r => I.filter (L.Adj r.1) -- Key helper: for any independent subset S of R, |S| ≤ |N_I(S)| have h_ind_hall : ∀ S : Finset {r : W // r ∈ R}, IsIndepSet L (S.image Subtype.val) → S.card ≤ (S.biUnion t).card := by intro S hS_ind let J : Finset W := (I \ S.biUnion t) ∪ (S.image Subtype.val) have hJ_ind : IsIndepSet L J := by intro x hx y hy hxy rcases Finset.mem_union.mp hx with hx1 | hx2 <;> rcases Finset.mem_union.mp hy with hy1 | hy2 · exact hI_ind x (Finset.mem_sdiff.mp hx1).1 y (Finset.mem_sdiff.mp hy1).1 hxy · obtain ⟨r, hrS, rfl⟩ := Finset.mem_image.mp hy2 have hmem : x ∈ S.biUnion t := Finset.mem_biUnion.mpr ⟨r, hrS, Finset.mem_filter.mpr ⟨(Finset.mem_sdiff.mp hx1).1, hxy.symm⟩⟩ exact (Finset.mem_sdiff.mp hx1).2 hmem · obtain ⟨r, hrS, rfl⟩ := Finset.mem_image.mp hx2 have hmem : y ∈ S.biUnion t := Finset.mem_biUnion.mpr ⟨r, hrS, Finset.mem_filter.mpr ⟨(Finset.mem_sdiff.mp hy1).1, hxy⟩⟩ exact (Finset.mem_sdiff.mp hy1).2 hmem · exact hS_ind x hx2 y hy2 hxy have hdisj : Disjoint (I \ S.biUnion t) (S.image Subtype.val) := by rw [Finset.disjoint_left] intro x hx1 hx2 obtain ⟨r, _, rfl⟩ := Finset.mem_image.mp hx2 exact (Finset.mem_sdiff.mp r.2).2 (Finset.mem_sdiff.mp hx1).1 have hsub_I : S.biUnion t ⊆ I := by intro x hx obtain ⟨r, _, hxt⟩ := Finset.mem_biUnion.mp hx exact (Finset.mem_filter.mp hxt).1 have hJ_card : J.card = I.card - (S.biUnion t).card + S.card := by rw [Finset.card_union_of_disjoint hdisj, Finset.card_sdiff, Finset.inter_eq_left.mpr hsub_I, Finset.card_image_of_injective S Subtype.val_injective] have hJ_le : J.card ≤ I.card := hI_max J (Finset.mem_filter.mpr ⟨Finset.mem_univ _, hJ_ind⟩) have hbi_le : (S.biUnion t).card ≤ I.card := Finset.card_le_card hsub_I omega -- Verify Hall's condition for ALL S : Finset {r // r ∈ R} have hHall : ∀ S : Finset {r : W // r ∈ R}, S.card ≤ (S.biUnion t).card := by intro S have hS_le_R : S.card ≤ R.card := by have := Finset.card_le_univ S simpa [Fintype.card_coe] using this by_cases h0 : S.card = 0 · omega · by_cases h1 : S.card = 1 · obtain ⟨r, rfl⟩ := Finset.card_eq_one.mp h1 apply h_ind_hall intro x hx y hy hxy simp only [Finset.image_singleton, mem_singleton] at hx hy subst hx; subst hy exact L.loopless.irrefl _ hxy · by_cases h2 : S.card = 2 · obtain ⟨r₁, r₂, hrne, rfl⟩ := Finset.card_eq_two.mp h2 by_cases hadj : L.Adj r₁.1 r₂.1 · have hdisj_t : Disjoint (t r₁) (t r₂) := by rw [Finset.disjoint_left] intro w hw1 hw2 exact htf r₁.1 r₂.1 w hadj (Finset.mem_filter.mp hw2).2 (Finset.mem_filter.mp hw1).2 have h1_r1 : 1 ≤ (t r₁).card := by have := h_ind_hall {r₁} (by intro x hx y hy hxy simp only [Finset.image_singleton, mem_singleton] at hx hy subst hx; subst hy; exact L.loopless.irrefl _ hxy) simpa using this have h1_r2 : 1 ≤ (t r₂).card := by have := h_ind_hall {r₂} (by intro x hx y hy hxy simp only [Finset.image_singleton, mem_singleton] at hx hy subst hx; subst hy; exact L.loopless.irrefl _ hxy) simpa using this rw [Finset.card_pair hrne, Finset.biUnion_insert, Finset.singleton_biUnion, Finset.card_union_of_disjoint hdisj_t] omega · apply h_ind_hall intro x hx y hy hxy simp only [Finset.image_insert, Finset.image_singleton, mem_insert, mem_singleton] at hx hy rcases hx with rfl | rfl <;> rcases hy with rfl | rfl · exact L.loopless.irrefl _ hxy · exact hadj hxy · exact hadj hxy.symm · exact L.loopless.irrefl _ hxy · by_cases hfull : S.card = R.card · -- Every vertex in I has a neighbor in R = S, so I ⊆ S.biUnion t! have hS_univ : S = Finset.univ := by apply Finset.eq_univ_of_card simpa [Fintype.card_coe] using hfull have hI_sub : I ⊆ S.biUnion t := by intro w hwI have hw_pos : 0 < (L.neighborFinset w).card := by rw [SimpleGraph.card_neighborFinset_eq_degree]; have := hmin w; omega obtain ⟨r, hr_nb⟩ := Finset.card_pos.mp hw_pos have hwr : L.Adj w r := (SimpleGraph.mem_neighborFinset L w r).mp hr_nb have hrR : r ∈ R := Finset.mem_sdiff.mpr ⟨Finset.mem_univ r, fun hrI => hI_ind w hwI r hrI hwr⟩ exact Finset.mem_biUnion.mpr ⟨⟨r, hrR⟩, hS_univ ▸ Finset.mem_univ _, Finset.mem_filter.mpr ⟨hwI, hwr.symm⟩⟩ calc S.card = R.card := hfull _ ≤ I.card := hR_le_I _ ≤ (S.biUnion t).card := Finset.card_le_card hI_sub · -- Remaining case: S.card = 3, R.card = 4, I.card = 4! have hS3 : S.card = 3 := by omega have hR4 : R.card = 4 := by omega have hI4 : I.card = 4 := by omega by_contra hlt push Not at hlt have hbi_le2 : (S.biUnion t).card ≤ 2 := by omega have hsub_I : S.biUnion t ⊆ I := by intro x hx; obtain ⟨r, _, hxt⟩ := Finset.mem_biUnion.mp hx exact (Finset.mem_filter.mp hxt).1 have hdiff_pos : 0 < (I \ S.biUnion t).card := by rw [Finset.card_sdiff, Finset.inter_eq_left.mpr hsub_I]; omega obtain ⟨w, hw_diff⟩ := Finset.card_pos.mp hdiff_pos have hwI : w ∈ I := (Finset.mem_sdiff.mp hw_diff).1 have hw_not_bi : w ∉ S.biUnion t := (Finset.mem_sdiff.mp hw_diff).2 -- Every neighbor of w lies in R \ S.image Subtype.val, which has size 1! have hnb_sub : L.neighborFinset w ⊆ R \ S.image Subtype.val := by intro u hu have hwu : L.Adj w u := (SimpleGraph.mem_neighborFinset L w u).mp hu have huR : u ∈ R := Finset.mem_sdiff.mpr ⟨Finset.mem_univ u, fun huI => hI_ind w hwI u huI hwu⟩ refine Finset.mem_sdiff.mpr ⟨huR, fun huS => ?_⟩ obtain ⟨r, hrS, rfl⟩ := Finset.mem_image.mp huS exact hw_not_bi (Finset.mem_biUnion.mpr ⟨r, hrS, Finset.mem_filter.mpr ⟨hwI, hwu.symm⟩⟩) have hSim_sub : S.image Subtype.val ⊆ R := by intro u hu; obtain ⟨r, _, rfl⟩ := Finset.mem_image.mp hu; exact r.2 have hdiff_R : (R \ S.image Subtype.val).card = 1 := by rw [Finset.card_sdiff, Finset.inter_eq_left.mpr hSim_sub, Finset.card_image_of_injective S Subtype.val_injective] omega have hdeg_le1 : L.degree w ≤ 1 := by rw [← SimpleGraph.card_neighborFinset_eq_degree, ← hdiff_R] exact Finset.card_le_card hnb_sub have := hmin w omega -- Apply Hall's Marriage Theorem! obtain ⟨f, hf_inj, hf_mem⟩ := (Finset.all_card_le_biUnion_card_iff_exists_injective t).mp hHall let M : Finset (Sym2 W) := Finset.univ.image (fun r : {r : W // r ∈ R} => s(r.1, f r)) have hf_I : ∀ r : {r : W // r ∈ R}, f r ∈ I := fun r => (Finset.mem_filter.mp (hf_mem r)).1 have hf_adj : ∀ r : {r : W // r ∈ R}, L.Adj r.1 (f r) := fun r => (Finset.mem_filter.mp (hf_mem r)).2 have hM_inj : Function.Injective (fun r : {r : W // r ∈ R} => s(r.1, f r)) := by intro r₁ r₂ heq rw [Sym2.eq_iff] at heq rcases heq with ⟨h1, _⟩ | ⟨h1, _⟩ · exact Subtype.ext h1 · exfalso; exact (Finset.mem_sdiff.mp r₁.2).2 (h1 ▸ hf_I r₂) have hM_pack : IsMatching L M := by refine ⟨?_, ?_⟩ · intro e he obtain ⟨r, _, rfl⟩ := Finset.mem_image.mp he exact hf_adj r · intro e₁ h1 e₂ h2 hne x hx1 hx2 obtain ⟨r₁, _, rfl⟩ := Finset.mem_image.mp h1 obtain ⟨r₂, _, rfl⟩ := Finset.mem_image.mp h2 have hrne : r₁ ≠ r₂ := fun h => hne (by subst h; rfl) rw [Sym2.mem_iff] at hx1 hx2 rcases hx1 with rfl | rfl <;> rcases hx2 with h | h · exact hrne (Subtype.ext h) · exact (Finset.mem_sdiff.mp r₁.2).2 (h ▸ hf_I r₂) · exact (Finset.mem_sdiff.mp r₂.2).2 (h.symm ▸ hf_I r₁) · exact hrne (hf_inj h) have hM_card : M.card = R.card := by rw [Finset.card_image_of_injective _ hM_inj, Finset.card_univ, Fintype.card_coe] exact isWKE_of_alpha_add_matching M I hM_pack hI_ind (by omega) /-- **Case `n = 7`, `α(L) = 3`:** Every triangle-free graph on 7 vertices with `δ ≥ 2` and no independent 4-set is WKE. -/ theorem triangleFree_wke_card_seven_alpha_three {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj] (htf : IsTF L) (hcard7 : Fintype.card W = 7) (hmin : ∀ v : W, 2 ≤ L.degree v) (hno4 : ∀ I : Finset W, IsIndepSet L I → I.card ≤ 3) : IsWKE L := by classical have hmax3 : ∀ v : W, L.degree v ≤ 3 := fun v => by rw [← SimpleGraph.card_neighborFinset_eq_degree] exact hno4 (L.neighborFinset v) (neighborFinset_isIndepSet htf v) -- By handshaking, there exists a vertex u of degree 2 (since 7 * 3 = 21 is odd!) have hex_deg2 : ∃ u : W, L.degree u = 2 := by by_contra hno push Not at hno have hall3 : ∀ v : W, L.degree v = 3 := fun v => by have := hmin v; have := hmax3 v; have := hno v; omega have hsum := SimpleGraph.sum_degrees_eq_twice_card_edges L have h21 : ∑ v : W, L.degree v = 21 := by calc ∑ v : W, L.degree v = ∑ _v : W, 3 := Finset.sum_congr rfl (fun v _ => hall3 v) _ = 3 * Fintype.card W := by simp [mul_comm] _ = 21 := by omega omega obtain ⟨u, hu2⟩ := hex_deg2 have hu_nb : (L.neighborFinset u).card = 2 := by rw [SimpleGraph.card_neighborFinset_eq_degree]; exact hu2 obtain ⟨a, b, hab_ne, hu_eq⟩ := Finset.card_eq_two.mp hu_nb have hua : L.Adj u a := (SimpleGraph.mem_neighborFinset L u a).mp (hu_eq ▸ by simp) have hub : L.Adj u b := (SimpleGraph.mem_neighborFinset L u b).mp (hu_eq ▸ by simp) have hne_ua : u ≠ a := L.ne_of_adj hua have hne_ub : u ≠ b := L.ne_of_adj hub have hnot_ab : ¬ L.Adj a b := htf a u b hua.symm hub -- Let W₀ = univ \ {u, a, b} (card = 4); u has no edges into W₀ let W₀ : Finset W := Finset.univ \ {u, a, b} have hW₀_card : W₀.card = 4 := by rw [Finset.card_sdiff, Finset.inter_univ, Finset.card_univ, Finset.card_insert_of_notMem (by simp [hne_ua, hne_ub]), Finset.card_pair hab_ne, hcard7] have hu_not_W₀ : ∀ x ∈ W₀, ¬ L.Adj u x := by intro x hx hux have hx_nb : x ∈ L.neighborFinset u := (SimpleGraph.mem_neighborFinset L u x).mpr hux rw [hu_eq] at hx_nb have hx_not := (Finset.mem_sdiff.mp hx).2 simp only [mem_insert, mem_singleton] at hx_nb hx_not tauto have hW₀_no3 : ∀ I : Finset W, I ⊆ W₀ → IsIndepSet L I → I.card ≤ 2 := by intro I hIW hI have hu_not_I : u ∉ I := fun huI => (Finset.mem_sdiff.mp (hIW huI)).2 (by simp) have hI' : IsIndepSet L (insert u I) := by intro x hx y hy hxy simp only [mem_insert] at hx hy rcases hx with rfl | hx <;> rcases hy with rfl | hy · exact L.loopless.irrefl _ hxy · exact hu_not_W₀ y (hIW hy) hxy · exact hu_not_W₀ x (hIW hx) hxy.symm · exact hI x hx y hy hxy have := hno4 (insert u I) hI' rw [Finset.card_insert_of_notMem hu_not_I] at this omega -- By tf_card_four_alpha_le_two_pm, W₀ = {p₀, p₁, p₂, p₃} with p₀-p₁ and p₂-p₃! obtain ⟨p₀, p₁, p₂, p₃, hW₀_eq, hW₀_nd, hp01, hp23⟩ := tf_card_four_alpha_le_two_pm htf hW₀_card hW₀_no3 rw [nodup4_iff] at hW₀_nd obtain ⟨h01, h02, h03, h12, h13, h23⟩ := hW₀_nd have hp_mem : p₀ ∈ W₀ ∧ p₁ ∈ W₀ ∧ p₂ ∈ W₀ ∧ p₃ ∈ W₀ := by rw [hW₀_eq]; simp have hp_ne_uab : ∀ p ∈ W₀, p ≠ u ∧ p ≠ a ∧ p ≠ b := by intro p hp have hnot := (Finset.mem_sdiff.mp hp).2 simp only [mem_insert, mem_singleton, not_or] at hnot exact ⟨hnot.1, hnot.2.1, hnot.2.2⟩ have h0_uab := hp_ne_uab p₀ hp_mem.1 have h1_uab := hp_ne_uab p₁ hp_mem.2.1 have h2_uab := hp_ne_uab p₂ hp_mem.2.2.1 have h3_uab := hp_ne_uab p₃ hp_mem.2.2.2 -- Helper: given a neighbor c ∈ {a, b} of u, a matching M of size 3 containing s(u, c), -- and two distinct vertices x, y ∈ W₀ non-adjacent to c such that either ¬ L.Adj x y or s(x, y) ∈ M, -- we immediately obtain IsWKE L! have hwin : ∀ (c : W) (huc : L.Adj u c) (M : Finset (Sym2 W)), IsMatching L M → M.card = 3 → s(u, c) ∈ M → ∀ x y : W, x ∈ W₀ → y ∈ W₀ → x ≠ y → ¬ L.Adj c x → ¬ L.Adj c y → (¬ L.Adj x y ∨ s(x, y) ∈ M) → IsWKE L := by intro c huc M hM hMc hucM x y hxW hyW hxy hcx hcy hxyM have hxu : x ≠ u := (hp_ne_uab x hxW).1 have hyu : y ≠ u := (hp_ne_uab y hyW).1 have hxc : x ≠ c := fun h => hu_not_W₀ x hxW (h ▸ huc) have hyc : y ≠ c := fun h => hu_not_W₀ y hyW (h ▸ huc) have huc_ne : u ≠ c := L.ne_of_adj huc let I : Finset W := {u, c, x, y} have hI_card : I.card = 4 := by rw [Finset.card_insert_of_notMem (by simp [huc_ne, hxu.symm, hyu.symm]), Finset.card_insert_of_notMem (by simp [hxc.symm, hyc.symm]), Finset.card_pair hxy] refine isWKE_of_dissociation_matching M I hM (by omega) ?_ intro p hp q hq hpq simp only [I, mem_insert, mem_singleton] at hp hq rcases hp with hp | hp | hp | hp <;> rcases hq with hq | hq | hq | hq all_goals rw [hp, hq] at hpq ⊢ · exact (L.loopless.irrefl _ hpq).elim · exact hucM · exact (hu_not_W₀ x hxW hpq).elim · exact (hu_not_W₀ y hyW hpq).elim · rw [Sym2.eq_swap]; exact hucM · exact (L.loopless.irrefl _ hpq).elim · exact (hcx hpq).elim · exact (hcy hpq).elim · exact (hu_not_W₀ x hxW hpq.symm).elim · exact (hcx hpq.symm).elim · exact (L.loopless.irrefl _ hpq).elim · rcases hxyM with hno | hm · exact (hno hpq).elim · exact hm · exact (hu_not_W₀ y hyW hpq.symm).elim · exact (hcy hpq.symm).elim · rcases hxyM with hno | hm · exact (hno hpq.symm).elim · rw [Sym2.eq_swap]; exact hm · exact (L.loopless.irrefl _ hpq).elim -- Baseline matchings M_a = {s(u,a), s(p₀,p₁), s(p₂,p₃)} and M_b = {s(u,b), s(p₀,p₁), s(p₂,p₃)} obtain ⟨hMa, hMa_c⟩ := isMatching_triple hua hp01 hp23 ⟨h0_uab.1.symm, h1_uab.1.symm, h0_uab.2.1.symm, h1_uab.2.1.symm⟩ ⟨h2_uab.1.symm, h3_uab.1.symm, h2_uab.2.1.symm, h3_uab.2.1.symm⟩ ⟨h02, h03, h12, h13⟩ have ha_01 : ¬ L.Adj a p₀ ∨ ¬ L.Adj a p₁ := by by_contra h; push Not at h; exact htf a p₀ p₁ h.1 hp01 h.2 have ha_23 : ¬ L.Adj a p₂ ∨ ¬ L.Adj a p₃ := by by_contra h; push Not at h; exact htf a p₂ p₃ h.1 hp23 h.2 by_cases ha01_both : ¬ L.Adj a p₀ ∧ ¬ L.Adj a p₁ · exact hwin a hua _ hMa hMa_c (by simp) p₀ p₁ hp_mem.1 hp_mem.2.1 h01 ha01_both.1 ha01_both.2 (Or.inr (by simp)) by_cases ha23_both : ¬ L.Adj a p₂ ∧ ¬ L.Adj a p₃ · exact hwin a hua _ hMa hMa_c (by simp) p₂ p₃ hp_mem.2.2.1 hp_mem.2.2.2 h23 ha23_both.1 ha23_both.2 (Or.inr (by simp)) have hcase_symm : ∀ x₀ x₁ y₀ y₁ : W, x₀ ∈ W₀ → x₁ ∈ W₀ → y₀ ∈ W₀ → y₁ ∈ W₀ → ([x₀, x₁, y₀, y₁] : List W).Nodup → L.Adj x₀ x₁ → L.Adj y₀ y₁ → L.Adj a x₀ → ¬ L.Adj a x₁ → L.Adj a y₀ → ¬ L.Adj a y₁ → IsWKE L := by intro x₀ x₁ y₀ y₁ hx0 hx1 hy0 hy1 hnd hx01 hy01 hax0 hax1 hay0 hay1 rw [nodup4_iff] at hnd obtain ⟨hx01_ne, hxy00, hxy01, hxy10, hxy11, hy01_ne⟩ := hnd have hx0_uab := hp_ne_uab x₀ hx0 have hx1_uab := hp_ne_uab x₁ hx1 have hy0_uab := hp_ne_uab y₀ hy0 have hy1_uab := hp_ne_uab y₁ hy1 obtain ⟨hMa', hMa'_c⟩ := isMatching_triple hua hx01 hy01 ⟨hx0_uab.1.symm, hx1_uab.1.symm, hx0_uab.2.1.symm, hx1_uab.2.1.symm⟩ ⟨hy0_uab.1.symm, hy1_uab.1.symm, hy0_uab.2.1.symm, hy1_uab.2.1.symm⟩ ⟨hxy00, hxy01, hxy10, hxy11⟩ obtain ⟨hMb', hMb'_c⟩ := isMatching_triple hub hx01 hy01 ⟨hx0_uab.1.symm, hx1_uab.1.symm, hx0_uab.2.2.symm, hx1_uab.2.2.symm⟩ ⟨hy0_uab.1.symm, hy1_uab.1.symm, hy0_uab.2.2.symm, hy1_uab.2.2.symm⟩ ⟨hxy00, hxy01, hxy10, hxy11⟩ by_cases hx1y1 : L.Adj x₁ y₁ · by_cases hx0y0 : L.Adj x₀ y₀ · obtain ⟨hMalt, hMalt_c⟩ := isMatching_triple hua hx1y1 hx0y0 ⟨hx1_uab.1.symm, hy1_uab.1.symm, hx1_uab.2.1.symm, hy1_uab.2.1.symm⟩ ⟨hx0_uab.1.symm, hy0_uab.1.symm, hx0_uab.2.1.symm, hy0_uab.2.1.symm⟩ ⟨hx01_ne.symm, hxy10, hxy01.symm, hy01_ne.symm⟩ exact hwin a hua _ hMalt hMalt_c (by simp) x₁ y₁ hx1 hy1 hxy11 hax1 hay1 (Or.inr (by simp)) · have hnot_x0y1 : ¬ L.Adj x₀ y₁ := htf x₀ x₁ y₁ hx01 hx1y1 have hnot_x1y0 : ¬ L.Adj x₁ y₀ := htf x₁ y₁ y₀ hx1y1 hy01.symm by_cases hbx0 : L.Adj b x₀ · have hnot_bx1 : ¬ L.Adj b x₁ := htf b x₀ x₁ hbx0 hx01 by_cases hby1 : L.Adj b y₁ · have hnot_by0 : ¬ L.Adj b y₀ := htf b y₁ y₀ hby1 hy01.symm exact hwin b hub _ hMb' hMb'_c (by simp) x₁ y₀ hx1 hy0 hxy10 hnot_bx1 hnot_by0 (Or.inl hnot_x1y0) · obtain ⟨hMspec, hMspec_c⟩ := isMatching_triple hub hay0 hx1y1 ⟨hne_ua, hy0_uab.1.symm, hab_ne.symm, hy0_uab.2.2.symm⟩ ⟨hx1_uab.1.symm, hy1_uab.1.symm, hx1_uab.2.2.symm, hy1_uab.2.2.symm⟩ ⟨hx1_uab.2.1.symm, hy1_uab.2.1.symm, hxy10.symm, hy01_ne⟩ exact hwin b hub _ hMspec hMspec_c (by simp) x₁ y₁ hx1 hy1 hxy11 hnot_bx1 hby1 (Or.inr (by simp)) · by_cases hby0 : L.Adj b y₀ · have hnot_by1 : ¬ L.Adj b y₁ := htf b y₀ y₁ hby0 hy01 by_cases hbx1 : L.Adj b x₁ · exact hwin b hub _ hMb' hMb'_c (by simp) x₀ y₁ hx0 hy1 hxy01 hbx0 hnot_by1 (Or.inl hnot_x0y1) · obtain ⟨hMspec, hMspec_c⟩ := isMatching_triple hub hax0 hx1y1 ⟨hne_ua, hx0_uab.1.symm, hab_ne.symm, hx0_uab.2.2.symm⟩ ⟨hx1_uab.1.symm, hy1_uab.1.symm, hx1_uab.2.2.symm, hy1_uab.2.2.symm⟩ ⟨hx1_uab.2.1.symm, hy1_uab.2.1.symm, hx01_ne, hxy01⟩ exact hwin b hub _ hMspec hMspec_c (by simp) x₁ y₁ hx1 hy1 hxy11 hbx1 hnot_by1 (Or.inr (by simp)) · exact hwin b hub _ hMb' hMb'_c (by simp) x₀ y₀ hx0 hy0 hxy00 hbx0 hby0 (Or.inl hx0y0) · exact hwin a hua _ hMa' hMa'_c (by simp) x₁ y₁ hx1 hy1 hxy11 hax1 hay1 (Or.inl hx1y1) rcases ha_01 with hna0 | hna1 <;> rcases ha_23 with hna2 | hna3 · have ha1 : L.Adj a p₁ := by by_contra h; exact ha01_both ⟨hna0, h⟩ have ha3 : L.Adj a p₃ := by by_contra h; exact ha23_both ⟨hna2, h⟩ exact hcase_symm p₁ p₀ p₃ p₂ hp_mem.2.1 hp_mem.1 hp_mem.2.2.2 hp_mem.2.2.1 (nodup4_iff.mpr ⟨h01.symm, h13, h12, h03, h02, h23.symm⟩) hp01.symm hp23.symm ha1 hna0 ha3 hna2 · have ha1 : L.Adj a p₁ := by by_contra h; exact ha01_both ⟨hna0, h⟩ have ha2 : L.Adj a p₂ := by by_contra h; exact ha23_both ⟨h, hna3⟩ exact hcase_symm p₁ p₀ p₂ p₃ hp_mem.2.1 hp_mem.1 hp_mem.2.2.1 hp_mem.2.2.2 (nodup4_iff.mpr ⟨h01.symm, h12, h13, h02, h03, h23⟩) hp01.symm hp23 ha1 hna0 ha2 hna3 · have ha0 : L.Adj a p₀ := by by_contra h; exact ha01_both ⟨h, hna1⟩ have ha3 : L.Adj a p₃ := by by_contra h; exact ha23_both ⟨hna2, h⟩ exact hcase_symm p₀ p₁ p₃ p₂ hp_mem.1 hp_mem.2.1 hp_mem.2.2.2 hp_mem.2.2.1 (nodup4_iff.mpr ⟨h01, h03, h02, h13, h12, h23.symm⟩) hp01 hp23.symm ha0 hna1 ha3 hna2 · have ha0 : L.Adj a p₀ := by by_contra h; exact ha01_both ⟨h, hna1⟩ have ha2 : L.Adj a p₂ := by by_contra h; exact ha23_both ⟨h, hna3⟩ exact hcase_symm p₀ p₁ p₂ p₃ hp_mem.1 hp_mem.2.1 hp_mem.2.2.1 hp_mem.2.2.2 (nodup4_iff.mpr ⟨h01, h02, h03, h12, h13, h23⟩) hp01 hp23 ha0 hna1 ha2 hna3 /-- Helper for 3-regular triangle-free 8-vertex case: once `W₀ = V \ ({v₀} ∪ N(v₀))` induces a `P₄ = q₀ - q₁ - q₂ - q₃`, the graph is uniquely `M₈` and admits an explicit WKE witness. -/ private lemma triangleFree_wke_m8_of_P4 {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj] (htf : IsTF L) (hcard8 : Fintype.card W = 8) (v₀ a b c q₀ q₁ q₂ q₃ : W) (hab : a ≠ b) (hac : a ≠ c) (hbc : b ≠ c) (hv₀_eq : L.neighborFinset v₀ = {a, b, c}) (W₀ : Finset W) (hW₀_def : W₀ = Finset.univ \ {v₀, a, b, c}) (hWeq : W₀ = {q₀, q₁, q₂, q₃}) (hq01_ne : q₀ ≠ q₁) (hq02_ne : q₀ ≠ q₂) (hq03_ne : q₀ ≠ q₃) (hq12_ne : q₁ ≠ q₂) (hq13_ne : q₁ ≠ q₃) (hq23_ne : q₂ ≠ q₃) (hq01 : L.Adj q₀ q₁) (hq12 : L.Adj q₁ q₂) (hq23 : L.Adj q₂ q₃) (hnq02 : ¬ L.Adj q₀ q₂) (hnq03 : ¬ L.Adj q₀ q₃) (hnq13 : ¬ L.Adj q₁ q₃) (hw_deg_split : ∀ w ∈ W₀, (({a, b, c} : Finset W).filter (L.Adj w)).card + (W₀.filter (L.Adj w)).card = 3) : IsWKE L := by classical let N₀ : Finset W := {a, b, c} have hq_mem : q₀ ∈ W₀ ∧ q₁ ∈ W₀ ∧ q₂ ∈ W₀ ∧ q₃ ∈ W₀ := by rw [hWeq]; simp have hv₀_not_W₀ : ∀ x ∈ W₀, ¬ L.Adj v₀ x := by intro x hx hvx have hx_nb : x ∈ L.neighborFinset v₀ := (SimpleGraph.mem_neighborFinset L v₀ x).mpr hvx rw [hv₀_eq] at hx_nb rw [hW₀_def] at hx have hnot := (Finset.mem_sdiff.mp hx).2 simp only [mem_insert, mem_singleton] at hx_nb hnot tauto have hp_ne_top : ∀ p ∈ W₀, p ≠ v₀ ∧ p ≠ a ∧ p ≠ b ∧ p ≠ c := by intro p hp rw [hW₀_def] at hp have hnot := (Finset.mem_sdiff.mp hp).2 simp only [mem_insert, mem_singleton, not_or] at hnot exact ⟨hnot.1, hnot.2.1, hnot.2.2.1, hnot.2.2.2⟩ have hq0 := hp_ne_top q₀ hq_mem.1 have hq1 := hp_ne_top q₁ hq_mem.2.1 have hq2 := hp_ne_top q₂ hq_mem.2.2.1 have hq3 := hp_ne_top q₃ hq_mem.2.2.2 have hdeg_p : ∀ r s t u : W, W₀ = {r, s, t, u} → r ≠ s → r ≠ t → r ≠ u → s ≠ t → s ≠ u → t ≠ u → (W₀.filter (L.Adj r)).card = (if L.Adj r s then 1 else 0) + (if L.Adj r t then 1 else 0) + (if L.Adj r u then 1 else 0) := by intro r s t u hEq hrs hrt hru hst hsu htu rw [hEq, Finset.card_filter, Finset.sum_insert (by simp [hrs, hrt, hru]), Finset.sum_insert (by simp [hst, hsu]), Finset.sum_insert (by simp [htu]), Finset.sum_singleton] simp [Nat.add_assoc] have hdw0 : (W₀.filter (L.Adj q₀)).card = 1 := by rw [hdeg_p q₀ q₁ q₂ q₃ hWeq hq01_ne hq02_ne hq03_ne hq12_ne hq13_ne hq23_ne] simp [hq01, hnq02, hnq03] have hdw1 : (W₀.filter (L.Adj q₁)).card = 2 := by rw [hdeg_p q₁ q₀ q₂ q₃ (by rw [hWeq]; ext x; simp; tauto) hq01_ne.symm hq12_ne hq13_ne hq02_ne hq03_ne hq23_ne] simp [hq01.symm, hq12, hnq13] have hdw2 : (W₀.filter (L.Adj q₂)).card = 2 := by have hnq20 : ¬ L.Adj q₂ q₀ := fun h => hnq02 h.symm rw [hdeg_p q₂ q₃ q₀ q₁ (by rw [hWeq]; ext x; simp; tauto) hq23_ne hq02_ne.symm hq12_ne.symm hq03_ne.symm hq13_ne.symm hq01_ne] simp [hq23, hnq20, hq12.symm] have hdw3 : (W₀.filter (L.Adj q₃)).card = 1 := by have hnq30 : ¬ L.Adj q₃ q₀ := fun h => hnq03 h.symm have hnq31 : ¬ L.Adj q₃ q₁ := fun h => hnq13 h.symm rw [hdeg_p q₃ q₂ q₀ q₁ (by rw [hWeq]; ext x; simp; tauto) hq23_ne.symm hq03_ne.symm hq13_ne.symm hq02_ne.symm hq12_ne.symm hq01_ne] simp [hq23.symm, hnq30, hnq31] have hn0 : (N₀.filter (L.Adj q₀)).card = 2 := by have := hw_deg_split q₀ hq_mem.1; dsimp only [N₀]; omega have hn1 : (N₀.filter (L.Adj q₁)).card = 1 := by have := hw_deg_split q₁ hq_mem.2.1; dsimp only [N₀]; omega have hn2 : (N₀.filter (L.Adj q₂)).card = 1 := by have := hw_deg_split q₂ hq_mem.2.2.1; dsimp only [N₀]; omega have hn3 : (N₀.filter (L.Adj q₃)).card = 2 := by have := hw_deg_split q₃ hq_mem.2.2.2; dsimp only [N₀]; omega obtain ⟨c₁, hc₁_eq⟩ := Finset.card_eq_one.mp hn1 obtain ⟨c₂, hc₂_eq⟩ := Finset.card_eq_one.mp hn2 have hc₁_mem : c₁ ∈ N₀.filter (L.Adj q₁) := hc₁_eq ▸ Finset.mem_singleton_self c₁ have hc₂_mem : c₂ ∈ N₀.filter (L.Adj q₂) := hc₂_eq ▸ Finset.mem_singleton_self c₂ have hc₁N : c₁ ∈ N₀ := (Finset.mem_filter.mp hc₁_mem).1 have hq1c1 : L.Adj q₁ c₁ := (Finset.mem_filter.mp hc₁_mem).2 have hc₂N : c₂ ∈ N₀ := (Finset.mem_filter.mp hc₂_mem).1 have hq2c2 : L.Adj q₂ c₂ := (Finset.mem_filter.mp hc₂_mem).2 have hc12_ne : c₁ ≠ c₂ := fun h => htf q₁ q₂ c₁ hq12 (h ▸ hq2c2) hq1c1 have hN₀_card : N₀.card = 3 := by rw [Finset.card_insert_of_notMem (by simp [hab, hac]), Finset.card_pair hbc] have hc3_card : ((N₀.erase c₁).erase c₂).card = 1 := by have hc2_er : c₂ ∈ N₀.erase c₁ := Finset.mem_erase.mpr ⟨hc12_ne.symm, hc₂N⟩ rw [Finset.card_erase_of_mem hc2_er, Finset.card_erase_of_mem hc₁N, hN₀_card] obtain ⟨c₃, hc₃_eq⟩ := Finset.card_eq_one.mp hc3_card have hc₃_mem : c₃ ∈ (N₀.erase c₁).erase c₂ := hc₃_eq ▸ Finset.mem_singleton_self c₃ have hc32_ne : c₃ ≠ c₂ := (Finset.mem_erase.mp hc₃_mem).1 have hc31_ne : c₃ ≠ c₁ := (Finset.mem_erase.mp (Finset.mem_erase.mp hc₃_mem).2).1 have hc₃N : c₃ ∈ N₀ := (Finset.mem_erase.mp (Finset.mem_erase.mp hc₃_mem).2).2 have hN₀_eq_c : N₀ = {c₁, c₂, c₃} := by apply Finset.eq_of_subset_of_card_le · intro x hx by_cases hx1 : x = c₁ · simp [hx1] · by_cases hx2 : x = c₂ · simp [hx2] · have : x ∈ (N₀.erase c₁).erase c₂ := Finset.mem_erase.mpr ⟨hx2, Finset.mem_erase.mpr ⟨hx1, hx⟩⟩ rw [hc₃_eq, Finset.mem_singleton] at this simp [this] · rw [Finset.card_insert_of_notMem (by simp [hc12_ne, hc31_ne.symm]), Finset.card_pair hc32_ne.symm, hN₀_card] have hnq0c1 : ¬ L.Adj q₀ c₁ := htf q₀ q₁ c₁ hq01 hq1c1 have hq0_sub : N₀.filter (L.Adj q₀) ⊆ {c₂, c₃} := by intro x hx have hxN := (Finset.mem_filter.mp hx).1 have hqx := (Finset.mem_filter.mp hx).2 rw [hN₀_eq_c] at hxN simp only [mem_insert, mem_singleton] at hxN ⊢ rcases hxN with rfl | rfl | rfl · exact (hnq0c1 hqx).elim · exact Or.inl rfl · exact Or.inr rfl have hq0_eq : N₀.filter (L.Adj q₀) = {c₂, c₃} := Finset.eq_of_subset_of_card_le hq0_sub (by rw [hn0, Finset.card_pair hc32_ne.symm]) have hq0c3 : L.Adj q₀ c₃ := (Finset.mem_filter.mp (show c₃ ∈ N₀.filter (L.Adj q₀) by rw [hq0_eq]; simp)).2 have hnq3c2 : ¬ L.Adj q₃ c₂ := htf q₃ q₂ c₂ hq23.symm hq2c2 have hq3_sub : N₀.filter (L.Adj q₃) ⊆ {c₁, c₃} := by intro x hx have hxN := (Finset.mem_filter.mp hx).1 have hqx := (Finset.mem_filter.mp hx).2 rw [hN₀_eq_c] at hxN simp only [mem_insert, mem_singleton] at hxN ⊢ rcases hxN with rfl | rfl | rfl · exact Or.inl rfl · exact (hnq3c2 hqx).elim · exact Or.inr rfl have hq3_eq : N₀.filter (L.Adj q₃) = {c₁, c₃} := Finset.eq_of_subset_of_card_le hq3_sub (by rw [hn3, Finset.card_pair hc31_ne.symm]) have hq3c1 : L.Adj q₃ c₁ := (Finset.mem_filter.mp (show c₁ ∈ N₀.filter (L.Adj q₃) by rw [hq3_eq]; simp)).2 have hnq1c2 : ¬ L.Adj q₁ c₂ := by intro h have : c₂ ∈ N₀.filter (L.Adj q₁) := Finset.mem_filter.mpr ⟨hc₂N, h⟩ rw [hc₁_eq, Finset.mem_singleton] at this exact hc12_ne this.symm have hv₀c2 : L.Adj v₀ c₂ := by rw [← SimpleGraph.mem_neighborFinset, hv₀_eq]; exact hc₂N have hc_ne_v0 : c₁ ≠ v₀ ∧ c₂ ≠ v₀ ∧ c₃ ≠ v₀ := by have hv_mem : ∀ x ∈ N₀, x ≠ v₀ := fun x hx => by have : L.Adj v₀ x := (SimpleGraph.mem_neighborFinset L v₀ x).mp (hv₀_eq ▸ hx) exact (L.ne_of_adj this).symm exact ⟨hv_mem c₁ hc₁N, hv_mem c₂ hc₂N, hv_mem c₃ hc₃N⟩ have hq_ne_c : ∀ q ∈ W₀, q ≠ c₁ ∧ q ≠ c₂ ∧ q ≠ c₃ := by intro q hq have htop := hp_ne_top q hq have hmem : ∀ x ∈ N₀, q ≠ x := fun x hx => by simp only [N₀, mem_insert, mem_singleton] at hx rcases hx with rfl | rfl | rfl · exact htop.2.1 · exact htop.2.2.1 · exact htop.2.2.2 exact ⟨hmem c₁ hc₁N, hmem c₂ hc₂N, hmem c₃ hc₃N⟩ have hq0c := hq_ne_c q₀ hq_mem.1 have hq1c := hq_ne_c q₁ hq_mem.2.1 have hq2c := hq_ne_c q₂ hq_mem.2.2.1 have hq3c := hq_ne_c q₃ hq_mem.2.2.2 have hnd8 : ([v₀, c₂, c₃, q₀, c₁, q₃, q₁, q₂] : List W).Nodup := by simp only [List.nodup_cons, List.mem_cons, List.not_mem_nil, or_false, not_or, List.nodup_nil, not_false_eq_true, and_true] refine ⟨⟨hc_ne_v0.2.1.symm, hc_ne_v0.2.2.symm, hq0.1.symm, hc_ne_v0.1.symm, hq3.1.symm, hq1.1.symm, hq2.1.symm⟩, ⟨hc32_ne.symm, hq0c.2.1.symm, hc12_ne.symm, hq3c.2.1.symm, hq1c.2.1.symm, hq2c.2.1.symm⟩, ⟨hq0c.2.2.symm, hc31_ne, hq3c.2.2.symm, hq1c.2.2.symm, hq2c.2.2.symm⟩, ⟨hq0c.1, hq03_ne, hq01_ne, hq02_ne⟩, ⟨hq3c.1.symm, hq1c.1.symm, hq2c.1.symm⟩, ⟨hq13_ne.symm, hq23_ne.symm⟩, hq12_ne⟩ obtain ⟨hM, hMc⟩ := isMatching_quad hv₀c2 hq0c3.symm hq3c1.symm hq12 hnd8 let I : Finset W := {v₀, c₂, q₁, q₃} have hI_card : I.card = 4 := by rw [Finset.card_insert_of_notMem (by simp [hc_ne_v0.2.1.symm, hq1.1.symm, hq3.1.symm]), Finset.card_insert_of_notMem (by simp [hq1c.2.1.symm, hq3c.2.1.symm]), Finset.card_pair hq13_ne] refine isWKE_of_dissociation_matching _ I hM (by omega) ?_ intro x hx y hy hxy simp only [I, mem_insert, mem_singleton] at hx hy rcases hx with hx | hx | hx | hx <;> rcases hy with hy | hy | hy | hy all_goals rw [hx, hy] at hxy ⊢ · exact (L.loopless.irrefl _ hxy).elim · exact Finset.mem_insert_self _ _ · exact (hv₀_not_W₀ q₁ hq_mem.2.1 hxy).elim · exact (hv₀_not_W₀ q₃ hq_mem.2.2.2 hxy).elim · rw [Sym2.eq_swap]; exact Finset.mem_insert_self _ _ · exact (L.loopless.irrefl _ hxy).elim · exact (hnq1c2 hxy.symm).elim · exact (hnq3c2 hxy.symm).elim · exact (hv₀_not_W₀ q₁ hq_mem.2.1 hxy.symm).elim · exact (hnq1c2 hxy).elim · exact (L.loopless.irrefl _ hxy).elim · exact (hnq13 hxy).elim · exact (hv₀_not_W₀ q₃ hq_mem.2.2.2 hxy.symm).elim · exact (hnq3c2 hxy).elim · exact (hnq13 hxy.symm).elim · exact (L.loopless.irrefl _ hxy).elim /-- Subcase A of `n = 8, α = 3`: there exists a vertex of degree 2. -/ private lemma triangleFree_wke_card_eight_deg_two {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj] (htf : IsTF L) (hcard8 : Fintype.card W = 8) (hmin : ∀ v : W, 2 ≤ L.degree v) (hno4 : ∀ I : Finset W, IsIndepSet L I → I.card ≤ 3) (u : W) (hu2 : L.degree u = 2) : IsWKE L := by classical have hmax3 : ∀ v : W, L.degree v ≤ 3 := fun v => by rw [← SimpleGraph.card_neighborFinset_eq_degree] exact hno4 (L.neighborFinset v) (neighborFinset_isIndepSet htf v) have hu_nb : (L.neighborFinset u).card = 2 := by rw [SimpleGraph.card_neighborFinset_eq_degree]; exact hu2 obtain ⟨a, b, hab_ne, hu_eq⟩ := Finset.card_eq_two.mp hu_nb have hua : L.Adj u a := (SimpleGraph.mem_neighborFinset L u a).mp (hu_eq ▸ by simp) have hub : L.Adj u b := (SimpleGraph.mem_neighborFinset L u b).mp (hu_eq ▸ by simp) have hne_ua : u ≠ a := L.ne_of_adj hua have hne_ub : u ≠ b := L.ne_of_adj hub have hnot_ab : ¬ L.Adj a b := htf a u b hua.symm hub let W₀ : Finset W := Finset.univ \ {u, a, b} have hW₀_card : W₀.card = 5 := by rw [Finset.card_sdiff, Finset.inter_univ, Finset.card_univ, Finset.card_insert_of_notMem (by simp [hne_ua, hne_ub]), Finset.card_pair hab_ne, hcard8] have hu_not_W₀ : ∀ x ∈ W₀, ¬ L.Adj u x := by intro x hx hux have hx_nb : x ∈ L.neighborFinset u := (SimpleGraph.mem_neighborFinset L u x).mpr hux rw [hu_eq] at hx_nb have hx_not := (Finset.mem_sdiff.mp hx).2 simp only [mem_insert, mem_singleton] at hx_nb hx_not tauto have hb_W₀ : ∃ w₀ ∈ W₀, L.Adj b w₀ := by have hpos : 0 < ((L.neighborFinset b).erase u).card := by rw [Finset.card_erase_of_mem ((SimpleGraph.mem_neighborFinset L b u).mpr hub.symm), SimpleGraph.card_neighborFinset_eq_degree] have := hmin b; omega obtain ⟨w₀, hw₀⟩ := Finset.card_pos.mp hpos have hne_wu : w₀ ≠ u := (Finset.mem_erase.mp hw₀).1 have hbw₀ : L.Adj b w₀ := (SimpleGraph.mem_neighborFinset L b w₀).mp (Finset.mem_erase.mp hw₀).2 have hne_wb : w₀ ≠ b := (L.ne_of_adj hbw₀).symm have hne_wa : w₀ ≠ a := fun h => hnot_ab (h ▸ hbw₀).symm refine ⟨w₀, Finset.mem_sdiff.mpr ⟨Finset.mem_univ _, by simp [hne_wu, hne_wa, hne_wb]⟩, hbw₀⟩ obtain ⟨w₀, hw₀W, hbw₀⟩ := hb_W₀ let W₁ : Finset W := W₀.erase w₀ have hW₁_card : W₁.card = 4 := by rw [Finset.card_erase_of_mem hw₀W, hW₀_card] have hW₁_no3 : ∀ I : Finset W, I ⊆ W₁ → IsIndepSet L I → I.card ≤ 2 := by intro I hIW hI have hIW₀ : I ⊆ W₀ := hIW.trans (Finset.erase_subset _ _) have hu_not_I : u ∉ I := fun huI => (Finset.mem_sdiff.mp (hIW₀ huI)).2 (by simp) have hI' : IsIndepSet L (insert u I) := by intro x hx y hy hxy simp only [mem_insert] at hx hy rcases hx with rfl | hx <;> rcases hy with rfl | hy · exact L.loopless.irrefl _ hxy · exact hu_not_W₀ y (hIW₀ hy) hxy · exact hu_not_W₀ x (hIW₀ hx) hxy.symm · exact hI x hx y hy hxy have := hno4 (insert u I) hI' rw [Finset.card_insert_of_notMem hu_not_I] at this omega obtain ⟨p₀, p₁, p₂, p₃, hW₁_eq, hW₁_nd, hp01, hp23⟩ := tf_card_four_alpha_le_two_pm htf hW₁_card hW₁_no3 rw [nodup4_iff] at hW₁_nd obtain ⟨h01, h02, h03, h12, h13, h23⟩ := hW₁_nd have hp_ne_uabw : ∀ p ∈ W₁, p ≠ u ∧ p ≠ a ∧ p ≠ b ∧ p ≠ w₀ := by intro p hp have hpw0 : p ≠ w₀ := (Finset.mem_erase.mp hp).1 have hnot := (Finset.mem_sdiff.mp (Finset.mem_erase.mp hp).2).2 simp only [mem_insert, mem_singleton, not_or] at hnot exact ⟨hnot.1, hnot.2.1, hnot.2.2, hpw0⟩ have hw0_uab : w₀ ≠ u ∧ w₀ ≠ a ∧ w₀ ≠ b := by have hnot := (Finset.mem_sdiff.mp hw₀W).2 simp only [mem_insert, mem_singleton, not_or] at hnot exact ⟨hnot.1, hnot.2.1, hnot.2.2⟩ have hp_m : p₀ ∈ W₁ ∧ p₁ ∈ W₁ ∧ p₂ ∈ W₁ ∧ p₃ ∈ W₁ := by rw [hW₁_eq]; simp have h0 := hp_ne_uabw p₀ hp_m.1 have h1 := hp_ne_uabw p₁ hp_m.2.1 have h2 := hp_ne_uabw p₂ hp_m.2.2.1 have h3 := hp_ne_uabw p₃ hp_m.2.2.2 have hnd8 : ([u, a, b, w₀, p₀, p₁, p₂, p₃] : List W).Nodup := by simp only [List.nodup_cons, List.mem_cons, List.not_mem_nil, or_false, not_or, List.nodup_nil, not_false_eq_true, and_true] refine ⟨⟨hne_ua, hne_ub, hw0_uab.1.symm, h0.1.symm, h1.1.symm, h2.1.symm, h3.1.symm⟩, ⟨hab_ne, hw0_uab.2.1.symm, h0.2.1.symm, h1.2.1.symm, h2.2.1.symm, h3.2.1.symm⟩, ⟨hw0_uab.2.2.symm, h0.2.2.1.symm, h1.2.2.1.symm, h2.2.2.1.symm, h3.2.2.1.symm⟩, ⟨h0.2.2.2.symm, h1.2.2.2.symm, h2.2.2.2.symm, h3.2.2.2.symm⟩, ⟨h01, h02, h03⟩, ⟨h12, h13⟩, h23⟩ obtain ⟨hM, hMc⟩ := isMatching_quad hua hbw₀ hp01 hp23 hnd8 let Wa : Finset W := W₀.filter (fun x => ¬ L.Adj a x) have hWa_ge3 : 3 ≤ Wa.card := by have ha_in_W₀ : (W₀.filter (L.Adj a)).card ≤ 2 := by have hsub : W₀.filter (L.Adj a) ⊆ (L.neighborFinset a).erase u := by intro x hx have hxW := (Finset.mem_filter.mp hx).1 have hax := (Finset.mem_filter.mp hx).2 have hxu : x ≠ u := fun h => (Finset.mem_sdiff.mp hxW).2 (h ▸ by simp) exact Finset.mem_erase.mpr ⟨hxu, (SimpleGraph.mem_neighborFinset L a x).mpr hax⟩ have hle := Finset.card_le_card hsub rw [Finset.card_erase_of_mem ((SimpleGraph.mem_neighborFinset L a u).mpr hua.symm), SimpleGraph.card_neighborFinset_eq_degree] at hle have := hmax3 a; omega have hdisj : Disjoint (W₀.filter (L.Adj a)) Wa := by rw [Finset.disjoint_left] intro x hx1 hx2 exact (Finset.mem_filter.mp hx2).2 (Finset.mem_filter.mp hx1).2 have hunion : W₀.filter (L.Adj a) ∪ Wa = W₀ := by ext x; simp only [Wa, mem_union, mem_filter]; tauto have hsplit : (W₀.filter (L.Adj a)).card + Wa.card = W₀.card := by rw [← Finset.card_union_of_disjoint hdisj, hunion] omega obtain ⟨x, hxWa, y, hyWa, hxy_ne, hxy_nadj⟩ := exists_nonadj_pair_of_card_ge_three htf hWa_ge3 have hxW : x ∈ W₀ := (Finset.mem_filter.mp hxWa).1 have hyW : y ∈ W₀ := (Finset.mem_filter.mp hyWa).1 have hax : ¬ L.Adj a x := (Finset.mem_filter.mp hxWa).2 have hay : ¬ L.Adj a y := (Finset.mem_filter.mp hyWa).2 have hx_ne : x ≠ u ∧ x ≠ a := by have hnot := (Finset.mem_sdiff.mp hxW).2; simp only [mem_insert, mem_singleton, not_or] at hnot exact ⟨hnot.1, hnot.2.1⟩ have hy_ne : y ≠ u ∧ y ≠ a := by have hnot := (Finset.mem_sdiff.mp hyW).2; simp only [mem_insert, mem_singleton, not_or] at hnot exact ⟨hnot.1, hnot.2.1⟩ let I : Finset W := {u, a, x, y} have hI_card : I.card = 4 := by rw [Finset.card_insert_of_notMem (by simp [hne_ua, hx_ne.1.symm, hy_ne.1.symm]), Finset.card_insert_of_notMem (by simp [hx_ne.2.symm, hy_ne.2.symm]), Finset.card_pair hxy_ne] refine isWKE_of_dissociation_matching _ I hM (by omega) ?_ intro p hp q hq hpq simp only [I, mem_insert, mem_singleton] at hp hq rcases hp with hp | hp | hp | hp <;> rcases hq with hq | hq | hq | hq all_goals rw [hp, hq] at hpq ⊢ · exact (L.loopless.irrefl _ hpq).elim · exact Finset.mem_insert_self _ _ · exact (hu_not_W₀ x hxW hpq).elim · exact (hu_not_W₀ y hyW hpq).elim · rw [Sym2.eq_swap]; exact Finset.mem_insert_self _ _ · exact (L.loopless.irrefl _ hpq).elim · exact (hax hpq).elim · exact (hay hpq).elim · exact (hu_not_W₀ x hxW hpq.symm).elim · exact (hax hpq.symm).elim · exact (L.loopless.irrefl _ hpq).elim · exact (hxy_nadj hpq).elim · exact (hu_not_W₀ y hyW hpq.symm).elim · exact (hay hpq.symm).elim · exact (hxy_nadj hpq.symm).elim · exact (L.loopless.irrefl _ hpq).elim /-- Helper for 3-regular 8-vertex case: computes the 4 cross-edge count inside `W₀`. -/ private lemma reg3_cross_edge_count {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj] (W₀ : Finset W) (p₀ p₁ p₂ p₃ : W) (hW₀_eq : W₀ = {p₀, p₁, p₂, p₃}) (h01 : p₀ ≠ p₁) (h02 : p₀ ≠ p₂) (h03 : p₀ ≠ p₃) (h12 : p₁ ≠ p₂) (h13 : p₁ ≠ p₃) (h23 : p₂ ≠ p₃) (hp01 : L.Adj p₀ p₁) (hp23 : L.Adj p₂ p₃) (hsum_W₀ : ∑ w ∈ W₀, (W₀.filter (L.Adj w)).card = 6) : (if L.Adj p₀ p₂ then 1 else 0) + (if L.Adj p₀ p₃ then 1 else 0) + (if L.Adj p₁ p₂ then 1 else 0) + (if L.Adj p₁ p₃ then 1 else 0) = 1 := by have hdeg_p : ∀ r s t u : W, W₀ = {r, s, t, u} → r ≠ s → r ≠ t → r ≠ u → s ≠ t → s ≠ u → t ≠ u → (W₀.filter (L.Adj r)).card = (if L.Adj r s then 1 else 0) + (if L.Adj r t then 1 else 0) + (if L.Adj r u then 1 else 0) := by intro r s t u hEq hrs hrt hru hst hsu htu rw [hEq, Finset.card_filter, Finset.sum_insert (by simp [hrs, hrt, hru]), Finset.sum_insert (by simp [hst, hsu]), Finset.sum_insert (by simp [htu]), Finset.sum_singleton] simp [Nat.add_assoc] have hsum_eval : (W₀.filter (L.Adj p₀)).card + (W₀.filter (L.Adj p₁)).card + (W₀.filter (L.Adj p₂)).card + (W₀.filter (L.Adj p₃)).card = 6 := by have h1 : ∑ w ∈ ({p₀, p₁, p₂, p₃} : Finset W), (W₀.filter (L.Adj w)).card = 6 := by simpa [← hW₀_eq] using hsum_W₀ rw [Finset.sum_insert (by simp [h01, h02, h03]), Finset.sum_insert (by simp [h12, h13]), Finset.sum_insert (by simp [h23]), Finset.sum_singleton] at h1 omega have hd0 := hdeg_p p₀ p₁ p₂ p₃ hW₀_eq h01 h02 h03 h12 h13 h23 have hd1 := hdeg_p p₁ p₀ p₂ p₃ (by rw [hW₀_eq]; ext x; simp; tauto) h01.symm h12 h13 h02 h03 h23 have hd2 := hdeg_p p₂ p₃ p₀ p₁ (by rw [hW₀_eq]; ext x; simp; tauto) h23 h02.symm h12.symm h03.symm h13.symm h01 have hd3 := hdeg_p p₃ p₂ p₀ p₁ (by rw [hW₀_eq]; ext x; simp; tauto) h23.symm h03.symm h13.symm h02.symm h12.symm h01 have hsym02 : L.Adj p₂ p₀ ↔ L.Adj p₀ p₂ := SimpleGraph.adj_comm L p₂ p₀ have hsym03 : L.Adj p₃ p₀ ↔ L.Adj p₀ p₃ := SimpleGraph.adj_comm L p₃ p₀ have hsym12 : L.Adj p₂ p₁ ↔ L.Adj p₁ p₂ := SimpleGraph.adj_comm L p₂ p₁ have hsym13 : L.Adj p₃ p₁ ↔ L.Adj p₁ p₃ := SimpleGraph.adj_comm L p₃ p₁ simp only [hsym02, hsym12] at hd2 simp only [hsym03, hsym13] at hd3 simp only [hp01, hp01.symm, hp23, hp23.symm, ite_true] at hd0 hd1 hd2 hd3 omega /-- Subcase B of `n = 8, α = 3`: `L` is 3-regular on 8 vertices (unique Möbius ladder `M₈`). -/ private lemma triangleFree_wke_card_eight_reg_three {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj] (htf : IsTF L) (hcard8 : Fintype.card W = 8) (hreg3 : ∀ v : W, L.degree v = 3) (hno4 : ∀ I : Finset W, IsIndepSet L I → I.card ≤ 3) : IsWKE L := by classical obtain ⟨v₀⟩ : Nonempty W := Fintype.card_pos_iff.mp (by omega) have hv₀_nb : (L.neighborFinset v₀).card = 3 := by rw [SimpleGraph.card_neighborFinset_eq_degree]; exact hreg3 v₀ obtain ⟨a, b, c, hab, hac, hbc, hv₀_eq⟩ := Finset.card_eq_three.mp hv₀_nb have hv₀a : L.Adj v₀ a := (SimpleGraph.mem_neighborFinset L v₀ a).mp (hv₀_eq ▸ by simp) have hv₀b : L.Adj v₀ b := (SimpleGraph.mem_neighborFinset L v₀ b).mp (hv₀_eq ▸ by simp) have hv₀c : L.Adj v₀ c := (SimpleGraph.mem_neighborFinset L v₀ c).mp (hv₀_eq ▸ by simp) have hne_v0a : v₀ ≠ a := L.ne_of_adj hv₀a have hne_v0b : v₀ ≠ b := L.ne_of_adj hv₀b have hne_v0c : v₀ ≠ c := L.ne_of_adj hv₀c have hnot_ab : ¬ L.Adj a b := htf a v₀ b hv₀a.symm hv₀b have hnot_ac : ¬ L.Adj a c := htf a v₀ c hv₀a.symm hv₀c have hnot_bc : ¬ L.Adj b c := htf b v₀ c hv₀b.symm hv₀c let N₀ : Finset W := {a, b, c} let W₀ : Finset W := Finset.univ \ {v₀, a, b, c} have hW₀_card : W₀.card = 4 := by rw [Finset.card_sdiff, Finset.inter_univ, Finset.card_univ, Finset.card_insert_of_notMem (by simp [hne_v0a, hne_v0b, hne_v0c]), Finset.card_insert_of_notMem (by simp [hab, hac]), Finset.card_pair hbc, hcard8] have hv₀_not_W₀ : ∀ x ∈ W₀, ¬ L.Adj v₀ x := by intro x hx hvx have hx_nb : x ∈ L.neighborFinset v₀ := (SimpleGraph.mem_neighborFinset L v₀ x).mpr hvx rw [hv₀_eq] at hx_nb have hnot := (Finset.mem_sdiff.mp hx).2 simp only [mem_insert, mem_singleton] at hx_nb hnot tauto have hW₀_no3 : ∀ I : Finset W, I ⊆ W₀ → IsIndepSet L I → I.card ≤ 2 := by intro I hIW hI have hv_not_I : v₀ ∉ I := fun hvI => (Finset.mem_sdiff.mp (hIW hvI)).2 (by simp) have hI' : IsIndepSet L (insert v₀ I) := by intro x hx y hy hxy simp only [mem_insert] at hx hy rcases hx with rfl | hx <;> rcases hy with rfl | hy · exact L.loopless.irrefl _ hxy · exact hv₀_not_W₀ y (hIW hy) hxy · exact hv₀_not_W₀ x (hIW hx) hxy.symm · exact hI x hx y hy hxy have := hno4 (insert v₀ I) hI' rw [Finset.card_insert_of_notMem hv_not_I] at this omega obtain ⟨p₀, p₁, p₂, p₃, hW₀_eq, hW₀_nd, hp01, hp23⟩ := tf_card_four_alpha_le_two_pm htf hW₀_card hW₀_no3 rw [nodup4_iff] at hW₀_nd obtain ⟨h01, h02, h03, h12, h13, h23⟩ := hW₀_nd have hN₀_degW : ∀ x ∈ N₀, (W₀.filter (L.Adj x)).card = 2 := by intro x hx have hxeq : W₀.filter (L.Adj x) = (L.neighborFinset x).erase v₀ := by ext y simp only [mem_filter, mem_erase, SimpleGraph.mem_neighborFinset, W₀, mem_sdiff, mem_univ, true_and, mem_insert, mem_singleton, not_or] constructor · rintro ⟨⟨hyv, _, _, _⟩, hxy⟩; exact ⟨hyv, hxy⟩ · rintro ⟨hyv, hxy⟩ refine ⟨⟨hyv, ?_, ?_, ?_⟩, hxy⟩ · intro hya; subst hya simp only [N₀, mem_insert, mem_singleton] at hx rcases hx with rfl | rfl | rfl · exact L.loopless.irrefl _ hxy · exact hnot_ab hxy.symm · exact hnot_ac hxy.symm · intro hyb; subst hyb simp only [N₀, mem_insert, mem_singleton] at hx rcases hx with rfl | rfl | rfl · exact hnot_ab hxy · exact L.loopless.irrefl _ hxy · exact hnot_bc hxy.symm · intro hyc; subst hyc simp only [N₀, mem_insert, mem_singleton] at hx rcases hx with rfl | rfl | rfl · exact hnot_ac hxy · exact hnot_bc hxy · exact L.loopless.irrefl _ hxy rw [hxeq, Finset.card_erase_of_mem, SimpleGraph.card_neighborFinset_eq_degree, hreg3 x] rw [SimpleGraph.mem_neighborFinset] simp only [N₀, mem_insert, mem_singleton] at hx rcases hx with rfl | rfl | rfl · exact hv₀a.symm · exact hv₀b.symm · exact hv₀c.symm have hsum_cross : ∑ w ∈ W₀, (N₀.filter (L.Adj w)).card = 6 := by have hdouble : ∑ w ∈ W₀, (N₀.filter (L.Adj w)).card = ∑ x ∈ N₀, (W₀.filter (L.Adj x)).card := by simp only [Finset.card_filter] rw [Finset.sum_comm] refine Finset.sum_congr rfl fun x _ => Finset.sum_congr rfl fun w _ => ?_ by_cases h : L.Adj w x · simp [h, h.symm] · have h' : ¬ L.Adj x w := fun h' => h h'.symm simp [h, h'] rw [hdouble] calc ∑ x ∈ N₀, (W₀.filter (L.Adj x)).card = ∑ _x ∈ N₀, 2 := Finset.sum_congr rfl hN₀_degW _ = 2 * N₀.card := by simp [mul_comm] _ = 6 := by have hN3 : N₀.card = 3 := by rw [Finset.card_insert_of_notMem (by simp [hab, hac]), Finset.card_pair hbc] omega have hw_deg_split : ∀ w ∈ W₀, (N₀.filter (L.Adj w)).card + (W₀.filter (L.Adj w)).card = 3 := by intro w hw have hdisj : Disjoint (N₀.filter (L.Adj w)) (W₀.filter (L.Adj w)) := by rw [Finset.disjoint_left] intro x hx1 hx2 have hxN := (Finset.mem_filter.mp hx1).1 have hxW := (Finset.mem_filter.mp hx2).1 have hnot := (Finset.mem_sdiff.mp hxW).2 simp only [N₀, mem_insert, mem_singleton] at hxN hnot tauto have hunion : N₀.filter (L.Adj w) ∪ W₀.filter (L.Adj w) = L.neighborFinset w := by ext x simp only [mem_union, mem_filter, SimpleGraph.mem_neighborFinset, N₀, W₀, mem_sdiff, mem_univ, true_and, mem_insert, mem_singleton, not_or] constructor · rintro (⟨_, h⟩ | ⟨_, h⟩) <;> exact h · intro hwx have hxv : x ≠ v₀ := fun h => hv₀_not_W₀ w hw (h ▸ hwx.symm) by_cases hxN : x = a ∨ x = b ∨ x = c · exact Or.inl ⟨hxN, hwx⟩ · push Not at hxN exact Or.inr ⟨⟨hxv, hxN.1, hxN.2.1, hxN.2.2⟩, hwx⟩ rw [← Finset.card_union_of_disjoint hdisj, hunion, SimpleGraph.card_neighborFinset_eq_degree, hreg3 w] have hsum_W₀ : ∑ w ∈ W₀, (W₀.filter (L.Adj w)).card = 6 := by have htot : ∑ w ∈ W₀, ((N₀.filter (L.Adj w)).card + (W₀.filter (L.Adj w)).card) = 12 := by calc ∑ w ∈ W₀, ((N₀.filter (L.Adj w)).card + (W₀.filter (L.Adj w)).card) = ∑ _w ∈ W₀, 3 := Finset.sum_congr rfl hw_deg_split _ = 3 * W₀.card := by simp [mul_comm] _ = 12 := by omega rw [Finset.sum_add_distrib, hsum_cross] at htot omega have hcnt := reg3_cross_edge_count L W₀ p₀ p₁ p₂ p₃ hW₀_eq h01 h02 h03 h12 h13 h23 hp01 hp23 hsum_W₀ have hsplit_N₀ : ∀ w ∈ W₀, (({a, b, c} : Finset W).filter (L.Adj w)).card + (W₀.filter (L.Adj w)).card = 3 := hw_deg_split by_cases e02 : L.Adj p₀ p₂ · have e03 : ¬ L.Adj p₀ p₃ := by intro h; simp [e02, h] at hcnt; try omega have e12 : ¬ L.Adj p₁ p₂ := by intro h; simp [e02, h] at hcnt; try omega have e13 : ¬ L.Adj p₁ p₃ := by intro h; simp [e02, h] at hcnt; try omega have hW1 : W₀ = {p₁, p₀, p₂, p₃} := by rw [hW₀_eq]; ext x; simp; tauto exact triangleFree_wke_m8_of_P4 L htf hcard8 v₀ a b c p₁ p₀ p₂ p₃ hab hac hbc hv₀_eq W₀ rfl hW1 h01.symm h12 h13 h02 h03 h23 hp01.symm e02 hp23 e12 e13 e03 hsplit_N₀ · by_cases e03 : L.Adj p₀ p₃ · have e12 : ¬ L.Adj p₁ p₂ := by intro h; simp [e03, h] at hcnt; try omega have e13 : ¬ L.Adj p₁ p₃ := by intro h; simp [e03, h] at hcnt; try omega have hW2 : W₀ = {p₁, p₀, p₃, p₂} := by rw [hW₀_eq]; ext x; simp; tauto exact triangleFree_wke_m8_of_P4 L htf hcard8 v₀ a b c p₁ p₀ p₃ p₂ hab hac hbc hv₀_eq W₀ rfl hW2 h01.symm h13 h12 h03 h02 h23.symm hp01.symm e03 hp23.symm e13 e12 e02 hsplit_N₀ · by_cases e12 : L.Adj p₁ p₂ · have e13 : ¬ L.Adj p₁ p₃ := by intro h; simp [e12, h] at hcnt; try omega exact triangleFree_wke_m8_of_P4 L htf hcard8 v₀ a b c p₀ p₁ p₂ p₃ hab hac hbc hv₀_eq W₀ rfl hW₀_eq h01 h02 h03 h12 h13 h23 hp01 e12 hp23 e02 e03 e13 hsplit_N₀ · have e13 : L.Adj p₁ p₃ := by by_contra h; simp [e02, e03, e12, h] at hcnt have hW3 : W₀ = {p₀, p₁, p₃, p₂} := by rw [hW₀_eq]; ext x; simp; tauto exact triangleFree_wke_m8_of_P4 L htf hcard8 v₀ a b c p₀ p₁ p₃ p₂ hab hac hbc hv₀_eq W₀ rfl hW3 h01 h03 h02 h13 h12 h23.symm hp01 e13 hp23.symm e03 e02 e12 hsplit_N₀ /-- **Case `n = 8`, `α(L) = 3`:** Every triangle-free graph on 8 vertices with `δ ≥ 2` and no independent 4-set is WKE. -/ theorem triangleFree_wke_card_eight_alpha_three {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj] (htf : IsTF L) (hcard8 : Fintype.card W = 8) (hmin : ∀ v : W, 2 ≤ L.degree v) (hno4 : ∀ I : Finset W, IsIndepSet L I → I.card ≤ 3) : IsWKE L := by by_cases hdeg2 : ∃ u : W, L.degree u = 2 · obtain ⟨u, hu2⟩ := hdeg2 exact triangleFree_wke_card_eight_deg_two L htf hcard8 hmin hno4 u hu2 · push Not at hdeg2 have hmax3 : ∀ v : W, L.degree v ≤ 3 := fun v => by rw [← SimpleGraph.card_neighborFinset_eq_degree] exact hno4 (L.neighborFinset v) (neighborFinset_isIndepSet htf v) have hreg3 : ∀ v : W, L.degree v = 3 := fun v => by have := hmin v; have := hmax3 v; have := hdeg2 v; omega exact triangleFree_wke_card_eight_reg_three L htf hcard8 hreg3 hno4 /-- **MAIN STRUCTURAL BREAKTHROUGH — Sharp Triangle-Free WKE Threshold (`|V| ≤ 8`):** Every finite triangle-free simple graph `L` on at most 8 vertices is weak König–Egerváry! -/ theorem triangleFree_isWKE_of_card_le_eight : ∀ n : ℕ, n ≤ 8 → ∀ {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj], Fintype.card W = n → IsTF L → IsWKE L := by intro n induction n using Nat.strong_induction_on with | h n ih => intro hn8 W _ _ L _ hcard htf classical by_cases h4 : n ≤ 4 · exact isWKE_of_card_le_four L (by omega) by_cases h0 : ∃ v : W, L.degree v = 0 · obtain ⟨v, hv⟩ := h0 have hiso : ∀ w : W, ¬ L.Adj v w := fun w hvw => by have hpos : 0 < L.degree v := Finset.card_pos.mpr ⟨w, (SimpleGraph.mem_neighborFinset L v w).mpr hvw⟩ omega refine isWKE_of_isolated v hiso ?_ have hcard' : Fintype.card {x : W // x ≠ v} < n := by have := card_ne_subtype v; omega exact ih _ hcard' (by omega) (L.induce {x : W | x ≠ v}) rfl (fun a b c h1 h2 => htf a.1 b.1 c.1 h1 h2) by_cases h1 : ∃ v : W, L.degree v = 1 · obtain ⟨v, hv⟩ := h1 obtain ⟨w, hw_eq⟩ := Finset.card_eq_one.mp hv have hvw : L.Adj v w := by rw [← SimpleGraph.mem_neighborFinset, hw_eq]; exact Finset.mem_singleton_self w have huniq : ∀ z : W, L.Adj v z → z = w := fun z hzv => by have : z ∈ L.neighborFinset v := (SimpleGraph.mem_neighborFinset L v z).mpr hzv rw [hw_eq, Finset.mem_singleton] at this; exact this refine isWKE_of_deg_one v w hvw huniq ?_ have hcard' : Fintype.card {x : W // x ≠ v ∧ x ≠ w} < n := by have := card_ne_two_subtype (L.ne_of_adj hvw); omega exact ih _ hcard' (by omega) (L.induce {x : W | x ≠ v ∧ x ≠ w}) rfl (fun a b c h1 h2 => htf a.1 b.1 c.1 h1 h2) by_cases hmax2 : ∀ v : W, L.degree v ≤ 2 · exact isWKE_of_maxDeg_le_two' L hmax2 -- Now: 5 ≤ n ≤ 8, δ(L) ≥ 2, and Δ(L) ≥ 3! have hmin : ∀ v : W, 2 ≤ L.degree v := fun v => by have hn0 : L.degree v ≠ 0 := fun h => h0 ⟨v, h⟩ have hn1 : L.degree v ≠ 1 := fun h => h1 ⟨v, h⟩ omega push Not at hmax2 obtain ⟨v_max, hv_max⟩ := hmax2 -- Check if there exists an independent set I₀ with n ≤ 2 * |I₀| by_cases h2a : ∃ I₀ : Finset W, IsIndepSet L I₀ ∧ Fintype.card W ≤ 2 * I₀.card · obtain ⟨I₀, hI₀, h2I⟩ := h2a exact triangleFree_ke_of_two_alpha_ge L htf (by omega) hmin I₀ hI₀ h2I · -- Otherwise, every independent set has 2 * |I| < n! -- Since N(v_max) is independent of size ≥ 3, we have 6 < n, so n ∈ {7, 8} and α(L) ≤ 3! push Not at h2a have h3_ind : IsIndepSet L (L.neighborFinset v_max) := neighborFinset_isIndepSet htf v_max have h3_card : 3 ≤ (L.neighborFinset v_max).card := by rw [SimpleGraph.card_neighborFinset_eq_degree]; omega have hlt_n := h2a (L.neighborFinset v_max) h3_ind have hno4 : ∀ I : Finset W, IsIndepSet L I → I.card ≤ 3 := fun I hI => by have := h2a I hI; omega have hn78 : Fintype.card W = 7 ∨ Fintype.card W = 8 := by omega rcases hn78 with h7 | h8 · exact triangleFree_wke_card_seven_alpha_three L htf h7 hmin hno4 · exact triangleFree_wke_card_eight_alpha_three L htf h8 hmin hno4 /-- Convenience wrapper for `triangleFree_isWKE_of_card_le_eight`. -/ theorem triangleFree_isWKE_of_card_le_eight' {W : Type*} [Fintype W] [DecidableEq W] (L : SimpleGraph W) [DecidableRel L.Adj] (hcard : Fintype.card W ≤ 8) (htf : L.CliqueFree 3) : IsWKE L := triangleFree_isWKE_of_card_le_eight (Fintype.card W) hcard L rfl (isTF_of_cliqueFree_three htf) end TriangleFreeWKE /-! ## Section 5: Exact Sharpness Obstructions (`K₅`, `K₅ - 2K₂`, and `C₅[2,2,2,2,1]`) -/ section SharpnessObstructions /-- **Sharpness of `n = 4` (General):** `K₅` is NOT weak König–Egerváry. -/ theorem not_isWKE_K5 : ¬ IsWKE (⊤ : SimpleGraph (Fin 5)) := by rintro ⟨M, Q, hM, hQcard, hcov⟩ have h2M : 2 * M.card ≤ 5 := by simpa using two_mul_card_le_of_isMatching hM let I : Finset (Fin 5) := Finset.univ \ Q have hI3 : 3 ≤ I.card := by rw [Finset.card_sdiff, Finset.inter_univ, Finset.card_univ, Fintype.card_fin] omega obtain ⟨T, hTI, hT3⟩ := Finset.exists_subset_card_eq hI3 obtain ⟨a, b, c, hab, hac, hbc, rfl⟩ := Finset.card_eq_three.mp hT3 have ha : a ∉ Q := (Finset.mem_sdiff.mp (hTI (by simp))).2 have hb : b ∉ Q := (Finset.mem_sdiff.mp (hTI (by simp))).2 have hc : c ∉ Q := (Finset.mem_sdiff.mp (hTI (by simp))).2 have hm1 : s(a, b) ∈ M := hcov a b hab ha hb have hm2 : s(a, c) ∈ M := hcov a c hac ha hc exact hbc (matching_unique_neighbor hM hm1 hm2) /-- The 4-wheel `W₄ = K₁ ∨ C₄ = K₅ - 2K₂` on `Fin 5`: vertex `0` is the apex, `1-2-3-4-1` is `C₄`. -/ def wheel4Graph : SimpleGraph (Fin 5) where Adj u v := u ≠ v ∧ ¬ ((u = 1 ∧ v = 3) ∨ (u = 3 ∧ v = 1) ∨ (u = 2 ∧ v = 4) ∨ (u = 4 ∧ v = 2)) symm := ⟨fun _ _ ⟨hne, h⟩ => ⟨hne.symm, by tauto⟩⟩ loopless := ⟨fun _ ⟨h, _⟩ => h rfl⟩ instance : DecidableRel wheel4Graph.Adj := fun u v => by dsimp [wheel4Graph]; infer_instance /-- `K₅ - 2K₂` is `K₄`-free. -/ theorem wheel4Graph_cliqueFree_four : wheel4Graph.CliqueFree 4 := by intro S ⟨hclq, hcard⟩ have h13 : ¬ (1 ∈ S ∧ 3 ∈ S) := fun ⟨h1, h3⟩ => (hclq h1 h3 (by decide)).2 (Or.inl ⟨rfl, rfl⟩) have h24 : ¬ (2 ∈ S ∧ 4 ∈ S) := fun ⟨h2, h4⟩ => (hclq h2 h4 (by decide)).2 (Or.inr (Or.inr (Or.inl ⟨rfl, rfl⟩))) -- S misses at least one of {1, 3} and at least one of {2, 4}, so |S| ≤ 3! have hsub : ∃ x y : Fin 5, x ≠ y ∧ x ∉ S ∧ y ∉ S := by by_cases h1 : (1 : Fin 5) ∈ S · have h3 : (3 : Fin 5) ∉ S := fun h => h13 ⟨h1, h⟩ by_cases h2 : (2 : Fin 5) ∈ S · exact ⟨3, 4, by decide, h3, fun h => h24 ⟨h2, h⟩⟩ · exact ⟨3, 2, by decide, h3, h2⟩ · by_cases h2 : (2 : Fin 5) ∈ S · exact ⟨1, 4, by decide, h1, fun h => h24 ⟨h2, h⟩⟩ · exact ⟨1, 2, by decide, h1, h2⟩ obtain ⟨x, y, hxy, hx, hy⟩ := hsub have hle : S ⊆ Finset.univ \ {x, y} := by intro z hz refine Finset.mem_sdiff.mpr ⟨Finset.mem_univ z, ?_⟩ simp only [mem_insert, mem_singleton, not_or] exact ⟨fun h => hx (h ▸ hz), fun h => hy (h ▸ hz)⟩ have hc := Finset.card_le_card hle rw [Finset.card_sdiff, Finset.inter_univ, Finset.card_univ, Fintype.card_fin, Finset.card_pair hxy] at hc omega /-- **Sharpness of `n = 4` even for `K₄`-free links:** `K₅ - 2K₂` is NOT WKE. -/ theorem not_isWKE_wheel4Graph : ¬ IsWKE wheel4Graph := by rintro ⟨M, Q, hM, hQcard, hcov⟩ have h2M : 2 * M.card ≤ 5 := by simpa using two_mul_card_le_of_isMatching hM let I : Finset (Fin 5) := Finset.univ \ Q have hI3 : 3 ≤ I.card := by rw [Finset.card_sdiff, Finset.inter_univ, Finset.card_univ, Fintype.card_fin] omega have hnoP3 : ∀ x ∈ I, ∀ y ∈ I, ∀ z ∈ I, wheel4Graph.Adj x y → wheel4Graph.Adj x z → y = z := by intro x hx y hy z hz hxy hxz exact matching_unique_neighbor hM (hcov x y hxy (Finset.mem_sdiff.mp hx).2 (Finset.mem_sdiff.mp hy).2) (hcov x z hxz (Finset.mem_sdiff.mp hx).2 (Finset.mem_sdiff.mp hz).2) by_cases h0 : (0 : Fin 5) ∈ I · have h2 : 2 ≤ (I.erase 0).card := by rw [Finset.card_erase_of_mem h0]; omega obtain ⟨y, hy, z, hz, hyz⟩ := Finset.one_lt_card.mp (by omega : 1 < (I.erase 0).card) have hyI : y ∈ I := (Finset.mem_erase.mp hy).2 have hzI : z ∈ I := (Finset.mem_erase.mp hz).2 have hy0 : (0 : Fin 5) ≠ y := (Finset.mem_erase.mp hy).1.symm have hz0 : (0 : Fin 5) ≠ z := (Finset.mem_erase.mp hz).1.symm have h0y : wheel4Graph.Adj 0 y := ⟨hy0, by intro h; rcases h with ⟨h, _⟩ | ⟨h, _⟩ | ⟨h, _⟩ | ⟨h, _⟩ <;> simp at h⟩ have h0z : wheel4Graph.Adj 0 z := ⟨hz0, by intro h; rcases h with ⟨h, _⟩ | ⟨h, _⟩ | ⟨h, _⟩ | ⟨h, _⟩ <;> simp at h⟩ exact hyz (hnoP3 0 h0 y hyI z hzI h0y h0z) · -- I ⊆ {1, 2, 3, 4} has size ≥ 3, so at most one vertex of {1, 2, 3, 4} is missing! have hsub : I ⊆ {1, 2, 3, 4} := by intro x hx fin_cases x · exact (h0 hx).elim all_goals simp by_cases h1 : (1 : Fin 5) ∈ I · by_cases h2 : (2 : Fin 5) ∈ I · by_cases h3 : (3 : Fin 5) ∈ I · exact (by decide : (1 : Fin 5) ≠ 3) (hnoP3 2 h2 1 h1 3 h3 (by decide) (by decide)) · have h4 : (4 : Fin 5) ∈ I := by by_contra h4 have hle : I ⊆ {1, 2} := by intro x hx; have := hsub hx; simp only [mem_insert, mem_singleton] at this ⊢ rcases this with rfl | rfl | rfl | rfl <;> tauto have := Finset.card_le_card hle; rw [Finset.card_pair (by decide)] at this; omega exact (by decide : (2 : Fin 5) ≠ 4) (hnoP3 1 h1 2 h2 4 h4 (by decide) (by decide)) · have h34 : (3 : Fin 5) ∈ I ∧ (4 : Fin 5) ∈ I := by constructor · by_contra h3 have hle : I ⊆ {1, 4} := by intro x hx; have := hsub hx; simp only [mem_insert, mem_singleton] at this ⊢ rcases this with rfl | rfl | rfl | rfl <;> tauto have := Finset.card_le_card hle; rw [Finset.card_pair (by decide)] at this; omega · by_contra h4 have hle : I ⊆ {1, 3} := by intro x hx; have := hsub hx; simp only [mem_insert, mem_singleton] at this ⊢ rcases this with rfl | rfl | rfl | rfl <;> tauto have := Finset.card_le_card hle; rw [Finset.card_pair (by decide)] at this; omega exact (by decide : (1 : Fin 5) ≠ 3) (hnoP3 4 h34.2 1 h1 3 h34.1 (by decide) (by decide)) · have h234 : (2 : Fin 5) ∈ I ∧ (3 : Fin 5) ∈ I ∧ (4 : Fin 5) ∈ I := by have hle : I ⊆ {2, 3, 4} := by intro x hx; have := hsub hx; simp only [mem_insert, mem_singleton] at this ⊢ rcases this with rfl | rfl | rfl | rfl <;> tauto have heq : I = {2, 3, 4} := Finset.eq_of_subset_of_card_le hle (by rw [Finset.card_insert_of_notMem (by decide), Finset.card_pair (by decide)]; omega) rw [heq]; simp exact (by decide : (2 : Fin 5) ≠ 4) (hnoP3 3 h234.2.1 2 h234.1 4 h234.2.2 (by decide) (by decide)) /-- Part projection `Fin 9 → Fin 5` for the unbalanced `C₅` blow-up `C₅[2,2,2,2,1]`. -/ def c5Part (x : Fin 9) : Fin 5 := ⟨x.val / 2, by omega⟩ /-- The symmetric 9-vertex, 16-edge triangle-free blow-up `C₅[2,2,2,2,1]`. -/ def c5Blowup9 : SimpleGraph (Fin 9) where Adj u v := c5Part u - c5Part v = 1 ∨ c5Part v - c5Part u = 1 symm := ⟨fun _ _ h => h.symm⟩ loopless := ⟨fun x h => by rcases h with h | h <;> simp at h⟩ /-- `C₅[2,2,2,2,1]` is triangle-free (inherits triangle-freeness from `C₅`). -/ theorem c5Blowup9_cliqueFree_three : c5Blowup9.CliqueFree 3 := by intro S ⟨hclq, hcard⟩ obtain ⟨a, b, c, hab, hac, hbc, rfl⟩ := Finset.card_eq_three.mp hcard have h1 : c5Blowup9.Adj a b := hclq (by simp) (by simp) hab have h2 : c5Blowup9.Adj b c := hclq (by simp) (by simp) hbc have h3 : c5Blowup9.Adj a c := hclq (by simp) (by simp) hac have hno_c5_tri : ∀ p q r : Fin 5, (p - q = 1 ∨ q - p = 1) → (q - r = 1 ∨ r - q = 1) → ¬ (p - r = 1 ∨ r - p = 1) := by decide exact hno_c5_tri (c5Part a) (c5Part b) (c5Part c) h1 h2 h3 /-- The dissociation number of `C₅[2,2,2,2,1]` is at most 4: no subset `I` of size `≥ 5` can have maximum induced degree `≤ 1`. -/ theorem c5Blowup9_dissociation_le_four (I : Finset (Fin 9)) (hdeg1 : ∀ u ∈ I, ∀ v ∈ I, ∀ w ∈ I, c5Blowup9.Adj u v → c5Blowup9.Adj u w → v = w) : I.card ≤ 4 := by classical let s : Fin 5 → ℕ := fun i => (I.filter (fun x => c5Part x = i)).card have hsum : I.card = s 0 + s 1 + s 2 + s 3 + s 4 := by have hpart : I.card = ∑ i : Fin 5, s i := by simp only [s] rw [← Finset.card_biUnion] · congr 1; ext x; simp · intro i _ j _ hij rw [Function.onFun, Finset.disjoint_left] intro x hx1 hx2 exact hij ((Finset.mem_filter.mp hx1).2.symm.trans (Finset.mem_filter.mp hx2).2) rw [hpart, Fin.sum_univ_five] -- Part upper bounds: s 0, s 1, s 2, s 3 ≤ 2 and s 4 ≤ 1 have hb0 : s 0 ≤ 2 := by have : I.filter (fun x => c5Part x = 0) ⊆ {0, 1} := by intro x hx; have hp := (Finset.mem_filter.mp hx).2 fin_cases x <;> simp [c5Part] at hp ⊢ exact le_trans (Finset.card_le_card this) (by decide) have hb1 : s 1 ≤ 2 := by have : I.filter (fun x => c5Part x = 1) ⊆ {2, 3} := by intro x hx; have hp := (Finset.mem_filter.mp hx).2 fin_cases x <;> simp [c5Part] at hp ⊢ exact le_trans (Finset.card_le_card this) (by decide) have hb2 : s 2 ≤ 2 := by have : I.filter (fun x => c5Part x = 2) ⊆ {4, 5} := by intro x hx; have hp := (Finset.mem_filter.mp hx).2 fin_cases x <;> simp [c5Part] at hp ⊢ exact le_trans (Finset.card_le_card this) (by decide) have hb3 : s 3 ≤ 2 := by have : I.filter (fun x => c5Part x = 3) ⊆ {6, 7} := by intro x hx; have hp := (Finset.mem_filter.mp hx).2 fin_cases x <;> simp [c5Part] at hp ⊢ exact le_trans (Finset.card_le_card this) (by decide) have hb4 : s 4 ≤ 1 := by have : I.filter (fun x => c5Part x = 4) ⊆ {8} := by intro x hx; have hp := (Finset.mem_filter.mp hx).2 fin_cases x <;> simp [c5Part] at hp ⊢ exact le_trans (Finset.card_le_card this) (by decide) -- Local dissociation constraints between adjacent parts on C₅: -- (a) No two adjacent parts can have one of size ≥ 2 and the other of size ≥ 1 have hadj_le1 : ∀ i j : Fin 5, (i - j = 1 ∨ j - i = 1) → 1 ≤ s i → s j ≤ 1 := by intro i j hij hsi by_contra hgt have hsj : 1 < s j := by omega obtain ⟨u, hu⟩ := Finset.card_pos.mp (by omega : 0 < s i) obtain ⟨v, hv, w, hw, hvw⟩ := Finset.one_lt_card.mp hsj have huI : u ∈ I := (Finset.mem_filter.mp hu).1 have hvI : v ∈ I := (Finset.mem_filter.mp hv).1 have hwI : w ∈ I := (Finset.mem_filter.mp hw).1 have hpu : c5Part u = i := (Finset.mem_filter.mp hu).2 have hpv : c5Part v = j := (Finset.mem_filter.mp hv).2 have hpw : c5Part w = j := (Finset.mem_filter.mp hw).2 have huv : c5Blowup9.Adj u v := by change c5Part u - c5Part v = 1 ∨ c5Part v - c5Part u = 1; rw [hpu, hpv]; exact hij have huw : c5Blowup9.Adj u w := by change c5Part u - c5Part w = 1 ∨ c5Part w - c5Part u = 1; rw [hpu, hpw]; exact hij exact hvw (hdeg1 u huI v hvI w hwI huv huw) -- (b) No three consecutive parts on C₅ can all be nonempty have hno3 : ∀ i j k : Fin 5, i ≠ k → (j - i = 1 ∨ i - j = 1) → (j - k = 1 ∨ k - j = 1) → ¬ (1 ≤ s i ∧ 1 ≤ s j ∧ 1 ≤ s k) := by intro i j k hik hij hjk ⟨hsi, hsj, hsk⟩ obtain ⟨u, hu⟩ := Finset.card_pos.mp (by omega : 0 < s j) obtain ⟨v, hv⟩ := Finset.card_pos.mp (by omega : 0 < s i) obtain ⟨w, hw⟩ := Finset.card_pos.mp (by omega : 0 < s k) have hpu : c5Part u = j := (Finset.mem_filter.mp hu).2 have hpv : c5Part v = i := (Finset.mem_filter.mp hv).2 have hpw : c5Part w = k := (Finset.mem_filter.mp hw).2 have huv : c5Blowup9.Adj u v := by change c5Part u - c5Part v = 1 ∨ c5Part v - c5Part u = 1; rw [hpu, hpv]; exact hij have huw : c5Blowup9.Adj u w := by change c5Part u - c5Part w = 1 ∨ c5Part w - c5Part u = 1; rw [hpu, hpw]; exact hjk have hvw : v = w := hdeg1 u (Finset.mem_filter.mp hu).1 v (Finset.mem_filter.mp hv).1 w (Finset.mem_filter.mp hw).1 huv huw exact hik (hpv.symm.trans (congrArg c5Part hvw |>.trans hpw)) -- Instantiate the 10 pairwise and 5 triple constraints on s 0..s 4 and close by omega! have c01 : 1 ≤ s 0 → s 1 ≤ 1 := hadj_le1 0 1 (by decide) have c10 : 1 ≤ s 1 → s 0 ≤ 1 := hadj_le1 1 0 (by decide) have c12 : 1 ≤ s 1 → s 2 ≤ 1 := hadj_le1 1 2 (by decide) have c21 : 1 ≤ s 2 → s 1 ≤ 1 := hadj_le1 2 1 (by decide) have c23 : 1 ≤ s 2 → s 3 ≤ 1 := hadj_le1 2 3 (by decide) have c32 : 1 ≤ s 3 → s 2 ≤ 1 := hadj_le1 3 2 (by decide) have c34 : 1 ≤ s 3 → s 4 ≤ 1 := hadj_le1 3 4 (by decide) have c43 : 1 ≤ s 4 → s 3 ≤ 1 := hadj_le1 4 3 (by decide) have c40 : 1 ≤ s 4 → s 0 ≤ 1 := hadj_le1 4 0 (by decide) have c04 : 1 ≤ s 0 → s 4 ≤ 1 := hadj_le1 0 4 (by decide) have t012 : ¬ (1 ≤ s 0 ∧ 1 ≤ s 1 ∧ 1 ≤ s 2) := hno3 0 1 2 (by decide) (by decide) (by decide) have t123 : ¬ (1 ≤ s 1 ∧ 1 ≤ s 2 ∧ 1 ≤ s 3) := hno3 1 2 3 (by decide) (by decide) (by decide) have t234 : ¬ (1 ≤ s 2 ∧ 1 ≤ s 3 ∧ 1 ≤ s 4) := hno3 2 3 4 (by decide) (by decide) (by decide) have t340 : ¬ (1 ≤ s 3 ∧ 1 ≤ s 4 ∧ 1 ≤ s 0) := hno3 3 4 0 (by decide) (by decide) (by decide) have t401 : ¬ (1 ≤ s 4 ∧ 1 ≤ s 0 ∧ 1 ≤ s 1) := hno3 4 0 1 (by decide) (by decide) (by decide) omega /-- **Exact Sharpness of `n = 8` for Triangle-Free WKE:** The 9-vertex triangle-free graph `C₅[2,2,2,2,1]` is NOT weak König–Egerváry! -/ theorem not_isWKE_c5Blowup9 : ¬ IsWKE c5Blowup9 := by rintro ⟨M, Q, hM, hQcard, hcov⟩ have h2M : 2 * M.card ≤ 9 := by simpa using two_mul_card_le_of_isMatching hM let I : Finset (Fin 9) := Finset.univ \ Q have hI5 : 5 ≤ I.card := by rw [Finset.card_sdiff, Finset.inter_univ, Finset.card_univ, Fintype.card_fin] omega have hdeg1 : ∀ u ∈ I, ∀ v ∈ I, ∀ w ∈ I, c5Blowup9.Adj u v → c5Blowup9.Adj u w → v = w := by intro u hu v hv w hw huv huw exact matching_unique_neighbor hM (hcov u v huv (Finset.mem_sdiff.mp hu).2 (Finset.mem_sdiff.mp hv).2) (hcov u w huw (Finset.mem_sdiff.mp hu).2 (Finset.mem_sdiff.mp hw).2) have hle4 := c5Blowup9_dissociation_le_four I hdeg1 omega end SharpnessObstructions /-! ## Section 6: Headline Tuza Conjecture Theorems, Corollaries, and Strict Separation Family -/ section HeadlineTuzaTheorems variable {V : Type*} /-- A finite simple graph `G` is **`d`-degenerate** if every nonempty vertex subset `S` contains a vertex with at most `d` neighbors inside `S`. -/ def IsDegenerate (d : ℕ) (G : SimpleGraph V) : Prop := ∀ S : Finset V, S.Nonempty → ∃ v ∈ S, ∃ (T : Finset V), T.card ≤ d ∧ ∀ u ∈ S, G.Adj v u → u ∈ T lemma isDegenerate_mono {d : ℕ} {G H : SimpleGraph V} (hle : H ≤ G) (hG : IsDegenerate d G) : IsDegenerate d H := by intro S hS obtain ⟨v, hvS, T, hTd, hT⟩ := hG S hS exact ⟨v, hvS, T, hTd, fun u huS hvu => hT u huS (hle hvu)⟩ lemma isDegenerate_le {d₁ d₂ : ℕ} {G : SimpleGraph V} (hd : d₁ ≤ d₂) (hG : IsDegenerate d₁ G) : IsDegenerate d₂ G := by intro S hS obtain ⟨v, hvS, T, hTd, hT⟩ := hG S hS exact ⟨v, hvS, T, le_trans hTd hd, hT⟩ /-- A finite simple graph `G` has **maximum average degree strictly less than `k`** (`mad(G) < k`) if every nonempty induced subgraph `G[S]` satisfies `∑_{v ∈ S} deg_{G[S]}(v) < k * |S|`. -/ def HasMadLt [DecidableEq V] (k : ℕ) (G : SimpleGraph V) [DecidableRel G.Adj] : Prop := ∀ S : Finset V, S.Nonempty → ∑ v ∈ S, (S.filter (G.Adj v)).card < k * S.card lemma isDegenerate_of_hasMadLt [DecidableEq V] {d : ℕ} {G : SimpleGraph V} [DecidableRel G.Adj] (hmad : HasMadLt (d + 1) G) : IsDegenerate d G := by intro S hS have hlt : ∑ v ∈ S, (S.filter (G.Adj v)).card < ∑ _v ∈ S, (d + 1) := by simpa [Finset.sum_const, smul_eq_mul, mul_comm] using hmad S hS obtain ⟨v, hvS, hvlt⟩ := Finset.exists_lt_of_sum_lt hlt exact ⟨v, hvS, S.filter (G.Adj v), by omega, fun u huS hvu => Finset.mem_filter.mpr ⟨huS, hvu⟩⟩ /-- A graph has **arboricity at most `a`** if its edges are covered by `a` acyclic subgraphs. -/ def HasArboricityLe (a : ℕ) (G : SimpleGraph V) : Prop := ∃ F : Fin a → SimpleGraph V, (∀ i : Fin a, (F i).IsAcyclic) ∧ ∀ u v : V, G.Adj u v → ∃ i, (F i).Adj u v /-- Every finite nonempty acyclic graph `T` on a vertex subset `S` has a vertex of degree `≤ 1` in `S`, and hence `∑_{v ∈ S} deg_S(v) < 2 * |S|`. -/ lemma acyclic_exists_deg_le_one [DecidableEq V] {T : SimpleGraph V} [DecidableRel T.Adj] (hacyc : T.IsAcyclic) : ∀ S : Finset V, S.Nonempty → ∃ v ∈ S, (S.filter (T.Adj v)).card ≤ 1 := by classical intro S hS have hbound : ∀ l : List V, l.Nodup → (∀ x ∈ l, x ∈ S) → l.length ≤ S.card := by intro l hnd hsub have := Finset.card_le_card (show l.toFinset ⊆ S from fun x hx => hsub x (List.mem_toFinset.mp hx)) rwa [List.toFinset_card_of_nodup hnd] at this let IsValidPath : List V → Prop := fun l => l ≠ [] ∧ l.Nodup ∧ (∀ x ∈ l, x ∈ S) ∧ l.IsChain T.Adj obtain ⟨v₀, hv₀S⟩ := hS have hex1 : ∃ l : List V, IsValidPath l ∧ l.length = 1 := ⟨[v₀], ⟨by simp, by simp, fun x hx => by simp only [List.mem_singleton] at hx; subst hx; exact hv₀S, List.isChain_singleton v₀⟩, rfl⟩ let lens : Finset ℕ := (Finset.range (S.card + 1)).filter (fun k => ∃ l, IsValidPath l ∧ l.length = k) have h1_mem : 1 ∈ lens := by refine Finset.mem_filter.mpr ⟨Finset.mem_range.mpr ?_, hex1⟩ have := Finset.card_pos.mpr ⟨v₀, hv₀S⟩; omega obtain ⟨kmax, hkmax_mem, hkmax_ge⟩ := Finset.exists_max_image lens id ⟨1, h1_mem⟩ obtain ⟨l, ⟨hl_ne, hl_nd, hl_sub, hl_ch⟩, hl_len⟩ := (Finset.mem_filter.mp hkmax_mem).2 cases l with | nil => exact (hl_ne rfl).elim | cons v rest => have hvS : v ∈ S := hl_sub v (by simp) refine ⟨v, hvS, ?_⟩ have hnb_in_rest : ∀ u ∈ S, T.Adj v u → u ∈ rest := by intro u huS hvu by_contra hu_not have hne_uv : u ≠ v := (T.ne_of_adj hvu).symm have hnd' : (u :: v :: rest).Nodup := by rw [List.nodup_cons]; exact ⟨by simp [hne_uv, hu_not], hl_nd⟩ have hsub' : ∀ x ∈ u :: v :: rest, x ∈ S := by intro x hx rcases List.mem_cons.mp hx with rfl | hx' · exact huS · exact hl_sub x hx' have hch' : (u :: v :: rest).IsChain T.Adj := List.isChain_cons_cons.mpr ⟨hvu.symm, hl_ch⟩ have hlen' : (u :: v :: rest).length = kmax + 1 := by simp [← hl_len] have hle_S : kmax + 1 ≤ S.card := hlen' ▸ hbound _ hnd' hsub' have hmem' : kmax + 1 ∈ lens := Finset.mem_filter.mpr ⟨Finset.mem_range.mpr (by omega), ⟨u :: v :: rest, ⟨by simp, hnd', hsub', hch'⟩, hlen'⟩⟩ have := hkmax_ge (kmax + 1) hmem' dsimp only [id] at this omega cases rest with | nil => have hemp : S.filter (T.Adj v) = ∅ := by ext u; simp only [mem_filter, notMem_empty, iff_false, not_and] intro huS hvu; exact List.not_mem_nil (hnb_in_rest u huS hvu) rw [hemp]; simp | cons w tail => have hvw : T.Adj v w := (List.isChain_cons_cons.mp hl_ch).1 have hwt_ch : (w :: tail).IsChain T.Adj := (List.isChain_cons_cons.mp hl_ch).2 have hv_not_wt : v ∉ w :: tail := (List.nodup_cons.mp hl_nd).1 have hwt_nd : (w :: tail).Nodup := (List.nodup_cons.mp hl_nd).2 have hsub_w : S.filter (T.Adj v) ⊆ {w} := by intro u hu have huS := (Finset.mem_filter.mp hu).1 have hvu := (Finset.mem_filter.mp hu).2 have hu_mem := hnb_in_rest u huS hvu simp only [List.mem_cons] at hu_mem rcases hu_mem with rfl | hu_tail · exact Finset.mem_singleton_self u · exfalso have hwalk_from_list : ∀ (a : V) (xs : List V), (a :: xs).Nodup → (a :: xs).IsChain T.Adj → ∀ b ∈ xs, ∃ p : T.Walk a b, p.IsPath ∧ 1 ≤ p.length ∧ ∀ z ∈ p.support, z ∈ a :: xs := by intro a xs induction xs generalizing a with | nil => intro _ _ b hb; exact (List.not_mem_nil hb).elim | cons x xs' ih => intro hnd hch b hb have hax : T.Adj a x := (List.isChain_cons_cons.mp hch).1 have hch' : (x :: xs').IsChain T.Adj := (List.isChain_cons_cons.mp hch).2 have hnd' : (x :: xs').Nodup := (List.nodup_cons.mp hnd).2 have ha_not : a ∉ x :: xs' := (List.nodup_cons.mp hnd).1 simp only [List.mem_cons] at hb rcases hb with rfl | hb' · refine ⟨SimpleGraph.Walk.cons hax .nil, ?_, by simp, ?_⟩ · rw [SimpleGraph.Walk.isPath_def]; simp [T.ne_of_adj hax] · intro z hz; simp at hz ⊢; tauto · obtain ⟨p', hp'_path, hp'_len, hp'_sup⟩ := ih x hnd' hch' b hb' have ha_not_p : a ∉ p'.support := fun h => ha_not (hp'_sup a h) refine ⟨SimpleGraph.Walk.cons hax p', ?_, by simp, ?_⟩ · rw [SimpleGraph.Walk.isPath_def, SimpleGraph.Walk.support_cons, List.nodup_cons] exact ⟨ha_not_p, hp'_path.support_nodup⟩ · intro z hz rw [SimpleGraph.Walk.support_cons, List.mem_cons] at hz rcases hz with rfl | hz' · exact List.mem_cons_self · exact List.mem_cons_of_mem a (hp'_sup z hz') obtain ⟨p, hp_path, hp_len, hp_sup⟩ := hwalk_from_list w tail hwt_nd hwt_ch u hu_tail have hv_not_p : v ∉ p.support := fun h => hv_not_wt (hp_sup v h) let q : T.Walk v u := SimpleGraph.Walk.cons hvw p have hq_path : q.IsPath := by rw [SimpleGraph.Walk.isPath_def, SimpleGraph.Walk.support_cons, List.nodup_cons] exact ⟨hv_not_p, hp_path.support_nodup⟩ have hq_not_edge : s(u, v) ∉ q.edges := by rw [SimpleGraph.Walk.edges_cons, List.mem_cons, not_or] constructor · intro h; rw [Sym2.eq_iff] at h rcases h with ⟨huv, _⟩ | ⟨huw, _⟩ · exact T.ne_of_adj hvu huv.symm · exact (List.nodup_cons.mp hwt_nd).1 (huw ▸ hu_tail) · intro hmem have hv_in : v ∈ p.support := SimpleGraph.Walk.fst_mem_support_of_mem_edges p (Sym2.eq_swap ▸ hmem) exact hv_not_p hv_in have hc : (SimpleGraph.Walk.cons hvu.symm q).IsCycle := ⟨⟨⟨by rw [SimpleGraph.Walk.edges_cons, List.nodup_cons] exact ⟨hq_not_edge, hq_path.edges_nodup⟩⟩, by intro h; cases h⟩, by simpa [SimpleGraph.Walk.support_cons] using hq_path.support_nodup⟩ exact hacyc (SimpleGraph.Walk.cons hvu.symm q) hc exact le_trans (Finset.card_le_card hsub_w) (by simp) /-- Every finite graph of arboricity `≤ a` is `(2 * a - 1)`-degenerate (in fact `HasMadLt (2 * a)`). -/ lemma isDegenerate_of_arboricity_le [DecidableEq V] {a : ℕ} (ha : 1 ≤ a) {G : SimpleGraph V} [DecidableRel G.Adj] (harb : HasArboricityLe a G) : IsDegenerate (2 * a - 1) G := by classical obtain ⟨F, hacyc, hcov⟩ := harb -- For any nonempty S, every acyclic F_i has ∑_{v ∈ S} deg_{F_i, S}(v) ≤ 2 * |S| - 2 < 2 * |S|! have hacyc_sum : ∀ (T : SimpleGraph V) [DecidableRel T.Adj], T.IsAcyclic → ∀ n : ℕ, ∀ S : Finset V, S.card = n → S.Nonempty → ∑ v ∈ S, (S.filter (T.Adj v)).card < 2 * n := by intro T _ hT n induction n with | zero => intro S hSc hSne; have := Finset.card_pos.mpr hSne; omega | succ m ihm => intro S hSc hSne by_cases hm : m = 0 · subst hm obtain ⟨v, rfl⟩ := Finset.card_eq_one.mp hSc have hemp : ({v} : Finset V).filter (T.Adj v) = ∅ := by ext x; simp only [mem_filter, mem_singleton, notMem_empty, iff_false, not_and] rintro rfl h; exact T.loopless.irrefl x h simp [hemp] · obtain ⟨v, hvS, hvdeg⟩ := acyclic_exists_deg_le_one hT S hSne let S' := S.erase v have hS'_card : S'.card = m := by rw [Finset.card_erase_of_mem hvS, hSc]; omega have hS'_ne : S'.Nonempty := Finset.card_pos.mp (by omega) have hIH := ihm S' hS'_card hS'_ne -- Split sum over S into v + S', and for each u ∈ S', filter over S = filter over S' + (if Adj u v) have hsum_split : ∑ u ∈ S, (S.filter (T.Adj u)).card = (S.filter (T.Adj v)).card + ∑ u ∈ S', (S.filter (T.Adj u)).card := by rw [← Finset.add_sum_erase S (fun u => (S.filter (T.Adj u)).card) hvS] have hu_split : ∀ u ∈ S', (S.filter (T.Adj u)).card = (S'.filter (T.Adj u)).card + (if T.Adj u v then 1 else 0) := by intro u _ have h1 : S.filter (T.Adj u) = (insert v S').filter (T.Adj u) := by rw [Finset.insert_erase hvS] rw [h1, Finset.filter_insert] by_cases huv : T.Adj u v · rw [if_pos huv, if_pos huv, Finset.card_insert_of_notMem] intro h; exact (Finset.mem_erase.mp (Finset.mem_filter.mp h).1).1 rfl · rw [if_neg huv, if_neg huv, Nat.add_zero] have hsum_uv : ∑ u ∈ S', (if T.Adj u v then 1 else 0) = (S.filter (T.Adj v)).card := by have h1 : (S.filter (T.Adj v)).card = (S'.filter (T.Adj v)).card := by congr 1; ext u; simp only [S', mem_filter, mem_erase] constructor · rintro ⟨huS, hvu⟩; exact ⟨⟨(T.ne_of_adj hvu).symm, huS⟩, hvu⟩ · rintro ⟨⟨_, huS⟩, hvu⟩; exact ⟨huS, hvu⟩ rw [h1, Finset.card_filter] refine Finset.sum_congr rfl fun u _ => ?_ by_cases h : T.Adj u v · simp [h, h.symm] · have h' : ¬ T.Adj v u := fun h' => h h'.symm simp [h, h'] rw [hsum_split, Finset.sum_congr rfl hu_split, Finset.sum_add_distrib, hsum_uv] omega -- Now sum over i : Fin a to get HasMadLt (2 * a) G! have hmad : HasMadLt (2 * a) G := by intro S hS have hle_sum : ∀ v ∈ S, (S.filter (G.Adj v)).card ≤ ∑ i : Fin a, (S.filter ((F i).Adj v)).card := by intro v _ have hsub : S.filter (G.Adj v) ⊆ Finset.univ.biUnion (fun i : Fin a => S.filter ((F i).Adj v)) := by intro u hu obtain ⟨i, hi⟩ := hcov v u (Finset.mem_filter.mp hu).2 exact Finset.mem_biUnion.mpr ⟨i, Finset.mem_univ i, Finset.mem_filter.mpr ⟨(Finset.mem_filter.mp hu).1, hi⟩⟩ exact le_trans (Finset.card_le_card hsub) Finset.card_biUnion_le have hlt_each : ∀ i : Fin a, ∑ v ∈ S, (S.filter ((F i).Adj v)).card < 2 * S.card := fun i => hacyc_sum (F i) (hacyc i) S.card S rfl hS have hsum_lt : ∑ i : Fin a, ∑ v ∈ S, (S.filter ((F i).Adj v)).card < ∑ _i : Fin a, (2 * S.card) := Finset.sum_lt_sum_of_nonempty (Finset.univ_nonempty_iff.mpr ⟨⟨0, ha⟩⟩) (fun i _ => hlt_each i) calc ∑ v ∈ S, (S.filter (G.Adj v)).card ≤ ∑ v ∈ S, ∑ i : Fin a, (S.filter ((F i).Adj v)).card := Finset.sum_le_sum hle_sum _ = ∑ i : Fin a, ∑ v ∈ S, (S.filter ((F i).Adj v)).card := Finset.sum_comm _ < ∑ _i : Fin a, (2 * S.card) := hsum_lt _ = 2 * a * S.card := by simp [Finset.sum_const, smul_eq_mul]; ring have heq_a : 2 * a = (2 * a - 1) + 1 := by omega rw [heq_a] at hmad exact isDegenerate_of_hasMadLt hmad /-- Helper: in a `K₄`-free graph `G`, the active link `activeLink G v` of every vertex `v` is triangle-free! -/ lemma activeLink_isTF_of_cliqueFree_four {G : SimpleGraph V} (hk4 : G.CliqueFree 4) (v : V) : IsTF (activeLink G v) := by classical intro a b c hab hbc hac have hva : G.Adj v a.1 := a.2.1 have hvb : G.Adj v b.1 := b.2.1 have hvc : G.Adj v c.1 := c.2.1 have hne_va : v ≠ a.1 := G.ne_of_adj hva have hne_vb : v ≠ b.1 := G.ne_of_adj hvb have hne_vc : v ≠ c.1 := G.ne_of_adj hvc have hne_ab : a.1 ≠ b.1 := G.ne_of_adj hab have hne_ac : a.1 ≠ c.1 := G.ne_of_adj hac have hne_bc : b.1 ≠ c.1 := G.ne_of_adj hbc have hclq : G.IsNClique 4 {v, a.1, b.1, c.1} := by refine ⟨?_, ?_⟩ · intro x hx y hy hxy simp only [Finset.mem_coe, mem_insert, mem_singleton] at hx hy rcases hx with rfl | rfl | rfl | rfl <;> rcases hy with rfl | rfl | rfl | rfl · exact (hxy rfl).elim · exact hva · exact hvb · exact hvc · exact hva.symm · exact (hxy rfl).elim · exact hab · exact hac · exact hvb.symm · exact hab.symm · exact (hxy rfl).elim · exact hbc · exact hvc.symm · exact hac.symm · exact hbc.symm · exact (hxy rfl).elim · rw [Finset.card_insert_of_notMem (by simp [hne_va, hne_vb, hne_vc]), Finset.card_insert_of_notMem (by simp [hne_ab, hne_ac]), Finset.card_pair hne_bc] exact hk4 {v, a.1, b.1, c.1} hclq /-- Helper: if `H ≤ G`, then `triangleSupport H ≤ triangleSupport G`. -/ lemma triangleSupport_mono {G H : SimpleGraph V} (hle : H ≤ G) : triangleSupport H ≤ triangleSupport G := fun _ _ ⟨h1, w, h2, h3⟩ => ⟨hle h1, w, hle h2, hle h3⟩ /-- **HEADLINE THEOREM 1 (Localized `K₄`-Free `8`-Degenerate Tuza Theorem):** Every finite `K₄`-free graph `G` whose triangle-support subgraph `G_△` is `8`-degenerate satisfies Tuza's Conjecture `τ(G) ≤ 2 ν(G)`! -/ theorem tuza_of_cliqueFree_four_triangleSupport_eight_degenerate [Fintype V] [DecidableEq V] (G : SimpleGraph V) (hk4 : G.CliqueFree 4) (hdeg : IsDegenerate 8 (triangleSupport G)) : tau G ≤ 2 * nu G := by classical refine tuza_of_hereditary_wke_link (fun H => H.CliqueFree 4 ∧ IsDegenerate 8 (triangleSupport H)) (fun hle ⟨h1, h2⟩ => ⟨fun S hS => h1 S ⟨fun u hu v hv huv => hle (hS.1 hu hv huv), hS.2⟩, isDegenerate_mono (triangleSupport_mono hle) h2⟩) (fun H ⟨hHk4, hHdeg⟩ ⟨T, hT⟩ => ?_) G ⟨hk4, hdeg⟩ -- Let S be the set of all triangle-active vertices of H (nonempty since T exists!) let S : Finset V := Finset.univ.filter (fun v => (activeNeighbors H v).Nonempty) have hS_ne : S.Nonempty := by have h1 : 1 < T.card := by have := hT.1; omega obtain ⟨u, hu, v, hv, huv⟩ := Finset.one_lt_card.mp h1 have h2 : ((T.erase u).erase v).card = 1 := by rw [Finset.card_erase_of_mem (Finset.mem_erase.mpr ⟨huv.symm, hv⟩), Finset.card_erase_of_mem hu, hT.1] obtain ⟨w, hw_eq⟩ := Finset.card_eq_one.mp h2 have hw_mem : w ∈ (T.erase u).erase v := hw_eq.symm ▸ Finset.mem_singleton_self w have hwv : w ≠ v := (Finset.mem_erase.mp hw_mem).1 have hwu : w ≠ u := (Finset.mem_erase.mp (Finset.mem_erase.mp hw_mem).2).1 have hwT : w ∈ T := (Finset.mem_erase.mp (Finset.mem_erase.mp hw_mem).2).2 refine ⟨u, Finset.mem_filter.mpr ⟨Finset.mem_univ u, ⟨v, hT.2 u hu v hv huv, w, hT.2 u hu w hwT hwu.symm, hT.2 v hv w hwT hwv.symm⟩⟩⟩ -- By 8-degeneracy of triangleSupport H, some v ∈ S has ≤ 8 triangle-active neighbors inside S! obtain ⟨v, hvS, B, hB8, hBcov⟩ := hHdeg S hS_ne have hv_act : (activeNeighbors H v).Nonempty := (Finset.mem_filter.mp hvS).2 -- Every u ∈ activeNeighbors H v ALSO lies in S (since u-v-w is a triangle!) and is adj to v in triangleSupport H! have hact_card : Fintype.card (activeNeighbors H v) ≤ 8 := by have hsub : Finset.univ.filter (fun u : V => u ∈ activeNeighbors H v) ⊆ B := by intro u hu have hu_act : u ∈ activeNeighbors H v := (Finset.mem_filter.mp hu).2 obtain ⟨hvu, w, hvw, huw⟩ := hu_act have huS : u ∈ S := Finset.mem_filter.mpr ⟨Finset.mem_univ u, ⟨v, hvu.symm, w, huw, hvw⟩⟩ exact hBcov u huS ⟨hvu, w, hvw, huw⟩ calc Fintype.card (activeNeighbors H v) = (Finset.univ.filter (fun u : V => u ∈ activeNeighbors H v)).card := Fintype.card_subtype _ _ ≤ B.card := Finset.card_le_card hsub _ ≤ 8 := hB8 exact ⟨v, hv_act, triangleFree_isWKE_of_card_le_eight _ hact_card (activeLink H v) rfl (activeLink_isTF_of_cliqueFree_four hHk4 v)⟩ /-- **HEADLINE THEOREM 2 (`K₄`-Free `8`-Degenerate Tuza Theorem):** Every finite `K₄`-free `8`-degenerate simple graph `G` satisfies Tuza's Conjecture `τ(G) ≤ 2 ν(G)`! -/ theorem tuza_of_cliqueFree_four_eight_degenerate [Fintype V] [DecidableEq V] (G : SimpleGraph V) (hk4 : G.CliqueFree 4) (hdeg : IsDegenerate 8 G) : tau G ≤ 2 * nu G := tuza_of_cliqueFree_four_triangleSupport_eight_degenerate G hk4 (isDegenerate_mono (triangleSupport_le G) hdeg) /-- **HEADLINE COROLLARY 3 (`K₄`-Free `mad(G) < 9` Tuza Theorem):** Every finite `K₄`-free simple graph with maximum average degree `< 9` satisfies `τ(G) ≤ 2 ν(G)`. (Advances Puleo's `mad < 7` threshold by `+2` on `K₄`-free graphs.) -/ theorem tuza_of_cliqueFree_four_mad_lt_nine [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (hk4 : G.CliqueFree 4) (hmad : HasMadLt 9 G) : tau G ≤ 2 * nu G := tuza_of_cliqueFree_four_eight_degenerate G hk4 (isDegenerate_of_hasMadLt hmad) /-- **HEADLINE COROLLARY 4 (`K₄`-Free Arboricity `≤ 4` Tuza Theorem):** Every finite `K₄`-free simple graph of arboricity `≤ 4` satisfies `τ(G) ≤ 2 ν(G)`. -/ theorem tuza_of_cliqueFree_four_arboricity_le_four [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (hk4 : G.CliqueFree 4) (harb : HasArboricityLe 4 G) : tau G ≤ 2 * nu G := tuza_of_cliqueFree_four_eight_degenerate G hk4 (isDegenerate_le (by omega : 2 * 4 - 1 ≤ 8) (isDegenerate_of_arboricity_le (by omega) harb)) /-- **HEADLINE COROLLARY 5 (Minimum-Degree Barrier `δ ≥ 9` for `K₄`-Free Counterexamples):** In any edge-minimal `K₄`-free counterexample to Tuza's Conjecture, every vertex incident to a triangle has at least 9 triangle-active neighbors (hence `G.degree v ≥ 9`). -/ theorem tuza_min_counterexample_cliqueFree_four_minDeg_ge_nine [Fintype V] [DecidableEq V] (G : SimpleGraph V) [DecidableRel G.Adj] (hk4 : G.CliqueFree 4) (hce : 2 * nu G < tau G) (hmin : ∀ H : SimpleGraph V, H < G → tau H ≤ 2 * nu H) (v : V) (hact : (activeNeighbors G v).Nonempty) : 9 ≤ G.degree v := by classical have hnot_wke : ¬ IsWKE (activeLink G v) := min_counterexample_no_wke_activeLink G hce hmin v hact have hgt8 : 9 ≤ Fintype.card (activeNeighbors G v) := by by_contra hlt exact hnot_wke (triangleFree_isWKE_of_card_le_eight _ (by omega) (activeLink G v) rfl (activeLink_isTF_of_cliqueFree_four hk4 v)) have hsub : Finset.univ.filter (fun u : V => u ∈ activeNeighbors G v) ⊆ G.neighborFinset v := by intro u hu exact (SimpleGraph.mem_neighborFinset G v u).mpr (Finset.mem_filter.mp hu).2.1 calc 9 ≤ Fintype.card (activeNeighbors G v) := hgt8 _ = (Finset.univ.filter (fun u : V => u ∈ activeNeighbors G v)).card := Fintype.card_subtype _ _ ≤ (G.neighborFinset v).card := Finset.card_le_card hsub _ = G.degree v := SimpleGraph.card_neighborFinset_eq_degree G v /-- **HEADLINE THEOREM 6 (General `4`-Degenerate Tuza Theorem):** Every finite `4`-degenerate simple graph `G` (unbounded `Δ`, unbounded treewidth, `mad` up to `8`, `χ` up to `5`) satisfies Tuza's Conjecture `τ(G) ≤ 2 ν(G)`. -/ theorem tuza_of_four_degenerate [Fintype V] [DecidableEq V] (G : SimpleGraph V) (hdeg : IsDegenerate 4 G) : tau G ≤ 2 * nu G := by classical refine tuza_of_hereditary_wke_link (IsDegenerate 4) (fun hle h => isDegenerate_mono hle h) (fun H hHdeg ⟨T, hT⟩ => ?_) G hdeg let S : Finset V := Finset.univ.filter (fun v => (activeNeighbors H v).Nonempty) have hS_ne : S.Nonempty := by have h1 : 1 < T.card := by have := hT.1; omega obtain ⟨u, hu, v, hv, huv⟩ := Finset.one_lt_card.mp h1 have h2 : ((T.erase u).erase v).card = 1 := by rw [Finset.card_erase_of_mem (Finset.mem_erase.mpr ⟨huv.symm, hv⟩), Finset.card_erase_of_mem hu, hT.1] obtain ⟨w, hw_eq⟩ := Finset.card_eq_one.mp h2 have hw_mem : w ∈ (T.erase u).erase v := hw_eq.symm ▸ Finset.mem_singleton_self w have hwv : w ≠ v := (Finset.mem_erase.mp hw_mem).1 have hwu : w ≠ u := (Finset.mem_erase.mp (Finset.mem_erase.mp hw_mem).2).1 have hwT : w ∈ T := (Finset.mem_erase.mp (Finset.mem_erase.mp hw_mem).2).2 refine ⟨u, Finset.mem_filter.mpr ⟨Finset.mem_univ u, ⟨v, hT.2 u hu v hv huv, w, hT.2 u hu w hwT hwu.symm, hT.2 v hv w hwT hwv.symm⟩⟩⟩ obtain ⟨v, hvS, B, hB4, hBcov⟩ := hHdeg S hS_ne have hv_act : (activeNeighbors H v).Nonempty := (Finset.mem_filter.mp hvS).2 have hact_card : Fintype.card (activeNeighbors H v) ≤ 4 := by have hsub : Finset.univ.filter (fun u : V => u ∈ activeNeighbors H v) ⊆ B := by intro u hu obtain ⟨hvu, w, hvw, huw⟩ := (Finset.mem_filter.mp hu).2 have huS : u ∈ S := Finset.mem_filter.mpr ⟨Finset.mem_univ u, ⟨v, hvu.symm, w, huw, hvw⟩⟩ exact hBcov u huS hvu calc Fintype.card (activeNeighbors H v) = (Finset.univ.filter (fun u : V => u ∈ activeNeighbors H v)).card := Fintype.card_subtype _ _ ≤ B.card := Finset.card_le_card hsub _ ≤ 4 := hB4 exact ⟨v, hv_act, isWKE_of_card_le_four (activeLink H v) hact_card⟩ /-- **HEADLINE THEOREM 7 (Bounded Edge-Codegree / `B₃`-Free Tuza Theorem):** Every finite graph in which every edge lies in at most 2 triangles satisfies `τ(G) ≤ 2 ν(G)`. -/ theorem tuza_of_edgeCodegree_le_two [Fintype V] [DecidableEq V] (G : SimpleGraph V) (hcodeg : ∀ u v : V, G.Adj u v → ∃ a b : V, ∀ w : V, G.Adj u w → G.Adj v w → w = a ∨ w = b) : tau G ≤ 2 * nu G := by classical refine tuza_of_hereditary_wke_link (fun H => ∀ u v : V, H.Adj u v → ∃ a b : V, ∀ w : V, H.Adj u w → H.Adj v w → w = a ∨ w = b) (fun hle h u v huv => by obtain ⟨a, b, hab⟩ := h u v (hle huv) exact ⟨a, b, fun w huw hvw => hab w (hle huw) (hle hvw)⟩) (fun H hH ⟨T, hT⟩ => ?_) G hcodeg have h1 : 1 < T.card := by have := hT.1; omega obtain ⟨v, hv, u, hu, hvu⟩ := Finset.one_lt_card.mp h1 have h2 : ((T.erase v).erase u).card = 1 := by rw [Finset.card_erase_of_mem (Finset.mem_erase.mpr ⟨hvu.symm, hu⟩), Finset.card_erase_of_mem hv, hT.1] obtain ⟨w, hw_eq⟩ := Finset.card_eq_one.mp h2 have hw_mem : w ∈ (T.erase v).erase u := hw_eq.symm ▸ Finset.mem_singleton_self w have hwu : w ≠ u := (Finset.mem_erase.mp hw_mem).1 have hwv : w ≠ v := (Finset.mem_erase.mp (Finset.mem_erase.mp hw_mem).2).1 have hwT : w ∈ T := (Finset.mem_erase.mp (Finset.mem_erase.mp hw_mem).2).2 have hv_act : (activeNeighbors H v).Nonempty := ⟨u, hT.2 v hv u hu hvu, w, hT.2 v hv w hwT hwv.symm, hT.2 u hu w hwT hwu.symm⟩ refine ⟨v, hv_act, isWKE_of_maxDeg_le_two' (activeLink H v) (fun x => ?_)⟩ obtain ⟨a, b, hab⟩ := hH v x.1 x.2.1 have hsub : ((activeLink H v).neighborFinset x).image Subtype.val ⊆ {a, b} := by intro y hy obtain ⟨z, hz, rfl⟩ := Finset.mem_image.mp hy have hxz : H.Adj x.1 z.1 := (SimpleGraph.mem_neighborFinset (activeLink H v) x z).mp hz rcases hab z.1 z.2.1 hxz with rfl | rfl <;> simp calc (activeLink H v).degree x = (((activeLink H v).neighborFinset x).image Subtype.val).card := (Finset.card_image_of_injective _ Subtype.val_injective).symm _ ≤ ({a, b} : Finset V).card := Finset.card_le_card hsub _ ≤ 2 := Finset.card_le_two /-! ### Explicit Infinite Separation Family `G_m = K_{4,4} ∨ I_m` -/ /-- The infinite family `sepGraph m = K_{4,4} ∨ I_m` on `Fin 8 ⊕ Fin m`: - `Sum.inl i` (`i < 4`) adjacent to `Sum.inl j` (`4 ≤ j`), forming `K_{4,4}`; - every `Sum.inr k` (`k : Fin m`) adjacent to all 8 vertices `Sum.inl i`. -/ def sepGraph (m : ℕ) : SimpleGraph (Fin 8 ⊕ Fin m) where Adj u v := match u, v with | Sum.inl i, Sum.inl j => (i.val < 4 ∧ 4 ≤ j.val) ∨ (4 ≤ i.val ∧ j.val < 4) | Sum.inl _, Sum.inr _ => True | Sum.inr _, Sum.inl _ => True | Sum.inr _, Sum.inr _ => False symm := ⟨fun u v h => by cases u <;> cases v <;> tauto⟩ loopless := ⟨fun u h => by cases u with | inl i => simp at h; omega | inr k => exact h⟩ instance (m : ℕ) : DecidableRel (sepGraph m).Adj := fun u v => by cases u <;> cases v <;> dsimp [sepGraph] <;> infer_instance /-- Every `sepGraph m` is `K₄`-free. -/ theorem sepGraph_cliqueFree_four (m : ℕ) : (sepGraph m).CliqueFree 4 := by intro S ⟨hclq, hcard⟩ let R := S.filter (fun x => x.isRight) have hR_le1 : R.card ≤ 1 := by by_contra hgt obtain ⟨x, hx, y, hy, hxy⟩ := Finset.one_lt_card.mp (by omega : 1 < R.card) have hxS := (Finset.mem_filter.mp hx).1 have hyS := (Finset.mem_filter.mp hy).1 have hxr := (Finset.mem_filter.mp hx).2 have hyr := (Finset.mem_filter.mp hy).2 have hadj := hclq hxS hyS hxy cases x <;> cases y <;> simp [sepGraph] at hxr hyr hadj let L := S.filter (fun x => x.isLeft) have hL_ge3 : 3 ≤ L.card := by have hdisj : Disjoint L R := by rw [Finset.disjoint_left]; intro x h1 h2 cases x <;> simp [L, R] at h1 h2 have hunion : L ∪ R = S := by ext x; cases x <;> simp [L, R] have := Finset.card_union_of_disjoint hdisj rw [hunion, hcard] at this omega obtain ⟨T, hTL, hT3⟩ := Finset.exists_subset_card_eq hL_ge3 obtain ⟨a, b, c, hab, hac, hbc, rfl⟩ := Finset.card_eq_three.mp hT3 have haL : a ∈ L := hTL (by simp) have hbL : b ∈ L := hTL (by simp) have hcL : c ∈ L := hTL (by simp) have h1 := hclq (Finset.mem_filter.mp haL).1 (Finset.mem_filter.mp hbL).1 hab have h2 := hclq (Finset.mem_filter.mp hbL).1 (Finset.mem_filter.mp hcL).1 hbc have h3 := hclq (Finset.mem_filter.mp haL).1 (Finset.mem_filter.mp hcL).1 hac cases a with | inr _ => simp [L] at haL | inl ia => cases b with | inr _ => simp [L] at hbL | inl ib => cases c with | inr _ => simp [L] at hcL | inl ic => simp only [sepGraph] at h1 h2 h3 omega /-- Every `sepGraph m` is `8`-degenerate. -/ theorem sepGraph_eight_degenerate (m : ℕ) : IsDegenerate 8 (sepGraph m) := by intro S hS by_cases hr : ∃ k : Fin m, Sum.inr k ∈ S · obtain ⟨k, hkS⟩ := hr refine ⟨Sum.inr k, hkS, Finset.univ.image Sum.inl, ?_, ?_⟩ · rw [Finset.card_image_of_injective _ Sum.inl_injective, Finset.card_univ, Fintype.card_fin] · intro u _ hadj cases u with | inl i => exact Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩ | inr _ => exact hadj.elim · push Not at hr obtain ⟨v, hvS⟩ := hS refine ⟨v, hvS, Finset.univ.image Sum.inl, ?_, ?_⟩ · rw [Finset.card_image_of_injective _ Sum.inl_injective, Finset.card_univ, Fintype.card_fin] · intro u huS _ cases u with | inl i => exact Finset.mem_image.mpr ⟨i, Finset.mem_univ i, rfl⟩ | inr k => exact (hr k huS).elim /-- **HEADLINE THEOREM 8 (Strict Separation Family):** For EVERY `m : ℕ`, `sepGraph m` satisfies Tuza's Conjecture `τ(sepGraph m) ≤ 2 ν(sepGraph m)`, while achieving unbounded maximum degree `Δ ≥ m + 4`, unbounded edge-codegree `≥ m`, and edge count `8m + 16` (so average degree `(16m + 32)/(m + 8) → 16 > 25/2`). -/ theorem sepGraph_tuza (m : ℕ) : tau (sepGraph m) ≤ 2 * nu (sepGraph m) := tuza_of_cliqueFree_four_eight_degenerate (sepGraph m) (sepGraph_cliqueFree_four m) (sepGraph_eight_degenerate m) theorem sepGraph_degree_left (m : ℕ) (i : Fin 8) : (sepGraph m).degree (Sum.inl i) = m + 4 := by rw [← SimpleGraph.card_neighborFinset_eq_degree] let leftN : Finset (Fin 8 ⊕ Fin m) := (Finset.univ.filter (fun j : Fin 8 => (i.val < 4 ∧ 4 ≤ j.val) ∨ (4 ≤ i.val ∧ j.val < 4))).image Sum.inl let rightN : Finset (Fin 8 ⊕ Fin m) := Finset.univ.image Sum.inr have heq : (sepGraph m).neighborFinset (Sum.inl i) = leftN ∪ rightN := by ext x rw [SimpleGraph.mem_neighborFinset] cases x with | inl j => simp [leftN, rightN, sepGraph] | inr k => simp [leftN, rightN, sepGraph] have hdisj : Disjoint leftN rightN := by rw [Finset.disjoint_left]; intro x h1 h2 obtain ⟨_, _, rfl⟩ := Finset.mem_image.mp h1 obtain ⟨_, _, h⟩ := Finset.mem_image.mp h2 exact Sum.inr_ne_inl h have hleft4 : leftN.card = 4 := by rw [Finset.card_image_of_injective _ Sum.inl_injective] fin_cases i <;> decide have hrightm : rightN.card = m := by rw [Finset.card_image_of_injective _ Sum.inr_injective, Finset.card_univ, Fintype.card_fin] rw [heq, Finset.card_union_of_disjoint hdisj, hleft4, hrightm] omega theorem sepGraph_codegree_edge04 (m : ℕ) : (Finset.univ.filter (fun w : Fin 8 ⊕ Fin m => (sepGraph m).Adj (Sum.inl 0) w ∧ (sepGraph m).Adj (Sum.inl 4) w)).card = m := by have heq : Finset.univ.filter (fun w : Fin 8 ⊕ Fin m => (sepGraph m).Adj (Sum.inl 0) w ∧ (sepGraph m).Adj (Sum.inl 4) w) = Finset.univ.image Sum.inr := by ext x rw [Finset.mem_filter] cases x with | inl j => simp only [mem_univ, true_and, mem_image, reduceCtorEq, and_false, exists_false, iff_false] dsimp [sepGraph] omega | inr k => simp only [mem_univ, true_and, mem_image, Sum.inr.injEq] exact ⟨fun _ => ⟨k, rfl⟩, fun _ => ⟨trivial, trivial⟩⟩ rw [heq, Finset.card_image_of_injective _ Sum.inr_injective, Finset.card_univ, Fintype.card_fin] theorem sepGraph_twice_card_edges (m : ℕ) : 2 * (sepGraph m).edgeFinset.card = 16 * m + 32 := by rw [← SimpleGraph.sum_degrees_eq_twice_card_edges, Fintype.sum_sum_type] have hdeg_r : ∀ k : Fin m, (sepGraph m).degree (Sum.inr k) = 8 := by intro k rw [← SimpleGraph.card_neighborFinset_eq_degree] have heq : (sepGraph m).neighborFinset (Sum.inr k) = Finset.univ.image Sum.inl := by ext x rw [SimpleGraph.mem_neighborFinset] cases x <;> simp [sepGraph] rw [heq, Finset.card_image_of_injective _ Sum.inl_injective, Finset.card_univ, Fintype.card_fin] simp only [sepGraph_degree_left, hdeg_r, Finset.sum_const, Finset.card_univ, Fintype.card_fin, smul_eq_mul] ring end HeadlineTuzaTheorems end TuzaK4Free -- Axiom verification for all headline theorems #print axioms TuzaK4Free.tuza_of_hereditary_wke_link #print axioms TuzaK4Free.isWKE_of_maxDeg_le_two' #print axioms TuzaK4Free.isWKE_of_card_le_four #print axioms TuzaK4Free.triangleFree_isWKE_of_card_le_eight' #print axioms TuzaK4Free.not_isWKE_K5 #print axioms TuzaK4Free.not_isWKE_wheel4Graph #print axioms TuzaK4Free.not_isWKE_c5Blowup9 #print axioms TuzaK4Free.tuza_of_cliqueFree_four_triangleSupport_eight_degenerate #print axioms TuzaK4Free.tuza_of_cliqueFree_four_eight_degenerate #print axioms TuzaK4Free.tuza_of_cliqueFree_four_mad_lt_nine #print axioms TuzaK4Free.tuza_of_cliqueFree_four_arboricity_le_four #print axioms TuzaK4Free.tuza_min_counterexample_cliqueFree_four_minDeg_ge_nine #print axioms TuzaK4Free.tuza_of_four_degenerate #print axioms TuzaK4Free.tuza_of_edgeCodegree_le_two #print axioms TuzaK4Free.sepGraph_tuza #print axioms TuzaK4Free.sepGraph_cliqueFree_four #print axioms TuzaK4Free.sepGraph_eight_degenerate #print axioms TuzaK4Free.sepGraph_degree_left #print axioms TuzaK4Free.sepGraph_codegree_edge04 #print axioms TuzaK4Free.sepGraph_twice_card_edges