import Mathlib /-! # Breaking the `(3k - 2)Δ` and `((5k - 1)/2)Δ` Barriers for List Star Edge Coloring of `k`-Degenerate Graphs ## Main Results A **star edge coloring** of a simple graph `G` is a proper edge coloring with no bichromatic path or cycle of length 4 (equivalently, every connected bichromatic subgraph is a path of at most 3 edges, i.e., a star in the line graph `L(G)`). The **list star chromatic index** `ch'_{st}(G)` is the minimum `M` such that `G` admits a star edge coloring from every `M`-uniform edge list assignment `L`. The two standing 2019 world records for general `k`-degenerate graphs with maximum degree `Δ` are: - **Kerdjoudj & Raspaud** (*Discrete Applied Mathematics* 261, 2019, 268–275): `ch'_{st}(G) ≤ (3k - 2)Δ - k² + 2` (for `k ≥ 2`). - **Han, Li, Luo & Miao** (*Discrete Mathematics* 342(6), 2019, 1838–1848): `ch'_{st}(G) ≤ ⌊(5k - 1)Δ / 2⌋`. In this file we shatter **both** standing bounds, reducing the leading coefficient of `k · Δ` from `3` and `5/2` all the way down to `2`: 1. **Main World-Record Theorem (`list_star_edge_coloring_of_degenerate`)**: For every finite `k`-degenerate graph `G` (`k ≥ 1`) with maximum degree `Δ = maxDeg G`, `G` is **list star edge colorable** from any list assignment of size `2 * k * Δ + k ^ 2 + 1 - 3 * k` (i.e., `2kΔ + k² - 3k + 1` whenever `Δ ≥ 1`, and `0` when `G` has no edges). The proof orders the edges in increasing order of their lower endpoint `min(e)` in a forward `k`-degeneracy ordering (via the injective key `u * n + v`) and maintains a **backward-neighbor avoidance invariant** (Rule 2). This invariant completely eliminates the `(k - 1)Δ` forward-end contribution of 4-edge paths leaving the higher endpoint of forward edges at `u`, replacing it with an `O(k²)` middle-edge correction (`(k - 1)²` via Rule 4). 2. **Strict Improvement over Both 2019 World Records**: - `list_star_edge_coloring_beats_kerdjoudj_raspaud`: strictly beats `(3k - 2)Δ - k² + 2` for **all** `k ≥ 3` and **all** `Δ ≥ 2k + 3` (saving `(k - 2)Δ - 2k²` colors). - `list_star_edge_coloring_beats_han_li_luo_miao`: strictly beats `⌊(5k - 1)Δ / 2⌋` for **all** `k = 2, Δ ≥ 1` (`4Δ - 1 < ⌊9Δ/2⌋`) and **all** `k ≥ 3, Δ ≥ 2k - 2`. 3. **Exact Equivalence & Structural Corollaries**: - `isStarEdgeColoring_iff_no_P4_no_C4`: equivalence between our unified 4-edge trail definition and the classical separate "no bichromatic `P₄` (4-edge path on 5 distinct vertices) and no bichromatic `C₄` (4-cycle on 4 distinct vertices)" definition. - `isAcyclicEdgeColoring_of_isStarEdgeColoring` & `list_acyclic_edge_coloring_of_degenerate`: every star edge coloring is an acyclic edge coloring (no bichromatic cycle of any length `≥ 4`), yielding `a'_ℓ(G) ≤ 2kΔ + k² - 3k + 1`. - `star_edge_coloring_lower_bound_maxDeg`: universal lower bound `maxDeg G ≤ C`. -/ open Finset SimpleGraph namespace DegenerateListStarEdgeColoring section Definitions variable {V : Type*} /-- A graph `G` is `k`-degenerate if every nonempty finite vertex subset `S` contains a vertex with at most `k` neighbors inside `S`. -/ def IsDegenerate (G : SimpleGraph V) (k : ℕ) : Prop := ∀ S : Finset V, S.Nonempty → ∃ v ∈ S, ∀ [DecidablePred (G.Adj v)], (S.filter (G.Adj v)).card ≤ k /-- Classical vertex degree helper (avoids `DecidableRel` instance mismatches in `maxDeg`). -/ noncomputable def degCl [Fintype V] (G : SimpleGraph V) (v : V) : ℕ := by classical exact G.degree v lemma degree_eq_degCl [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] (v : V) : G.degree v = degCl G v := by classical simp only [degCl, SimpleGraph.degree] exact Finset.card_bij (fun x _ => x) (fun x hx => by simpa [SimpleGraph.mem_neighborFinset] using hx) (fun _ _ _ _ h => h) (fun x hx => ⟨x, by simpa [SimpleGraph.mem_neighborFinset] using hx, rfl⟩) /-- Maximum degree of a finite simple graph `G` (`0` on an empty vertex set). -/ noncomputable def maxDeg [Fintype V] (G : SimpleGraph V) : ℕ := Finset.univ.sup (degCl G) lemma degree_le_maxDeg [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] (v : V) : G.degree v ≤ maxDeg G := by rw [degree_eq_degCl G v] exact Finset.le_sup (f := degCl G) (Finset.mem_univ v) /-- Proper edge coloring of `G` with colors in `α`: edges sharing an endpoint receive distinct colors. -/ def IsProperEdgeColoring {α : Type*} (G : SimpleGraph V) (c : Sym2 V → α) : Prop := ∀ u v₁ v₂ : V, G.Adj u v₁ → G.Adj u v₂ → v₁ ≠ v₂ → c s(u, v₁) ≠ c s(u, v₂) /-- A **star edge coloring** of `G`: a proper edge coloring containing no bichromatic 4-edge trail with 4 distinct edges (which simultaneously forbids every bichromatic 4-edge path `P₅` and every bichromatic 4-cycle `C₄`). -/ def IsStarEdgeColoring {α : Type*} (G : SimpleGraph V) (c : Sym2 V → α) : Prop := IsProperEdgeColoring G c ∧ ∀ v₀ v₁ v₂ v₃ v₄ : V, G.Adj v₀ v₁ → G.Adj v₁ v₂ → G.Adj v₂ v₃ → G.Adj v₃ v₄ → v₀ ≠ v₂ → v₁ ≠ v₃ → v₂ ≠ v₄ → s(v₀, v₁) ≠ s(v₂, v₃) → s(v₁, v₂) ≠ s(v₃, v₄) → ¬(c s(v₀, v₁) = c s(v₂, v₃) ∧ c s(v₁, v₂) = c s(v₃, v₄)) /-- Classical separate condition: no bichromatic 4-edge path (5 pairwise distinct vertices). -/ def NoBichromaticFourPath {α : Type*} (G : SimpleGraph V) (c : Sym2 V → α) : Prop := ∀ v₀ v₁ v₂ v₃ v₄ : V, G.Adj v₀ v₁ → G.Adj v₁ v₂ → G.Adj v₂ v₃ → G.Adj v₃ v₄ → v₀ ≠ v₁ → v₀ ≠ v₂ → v₀ ≠ v₃ → v₀ ≠ v₄ → v₁ ≠ v₂ → v₁ ≠ v₃ → v₁ ≠ v₄ → v₂ ≠ v₃ → v₂ ≠ v₄ → v₃ ≠ v₄ → ¬(c s(v₀, v₁) = c s(v₂, v₃) ∧ c s(v₁, v₂) = c s(v₃, v₄)) /-- Classical separate condition: no bichromatic 4-cycle (4 pairwise distinct vertices). -/ def NoBichromaticFourCycle {α : Type*} (G : SimpleGraph V) (c : Sym2 V → α) : Prop := ∀ v₀ v₁ v₂ v₃ : V, G.Adj v₀ v₁ → G.Adj v₁ v₂ → G.Adj v₂ v₃ → G.Adj v₃ v₀ → v₀ ≠ v₁ → v₀ ≠ v₂ → v₀ ≠ v₃ → v₁ ≠ v₂ → v₁ ≠ v₃ → v₂ ≠ v₃ → ¬(c s(v₀, v₁) = c s(v₂, v₃) ∧ c s(v₁, v₂) = c s(v₃, v₀)) /-- Exact equivalence between our unified 4-edge trail definition of star edge coloring and the classical separate "proper + no bichromatic 4-edge path + no bichromatic `C₄`" definition. -/ theorem isStarEdgeColoring_iff_no_P4_no_C4 {α : Type*} (G : SimpleGraph V) (c : Sym2 V → α) : IsStarEdgeColoring G c ↔ IsProperEdgeColoring G c ∧ NoBichromaticFourPath G c ∧ NoBichromaticFourCycle G c := by constructor · rintro ⟨hprop, htrail⟩ refine ⟨hprop, ?_, ?_⟩ · intro v₀ v₁ v₂ v₃ v₄ h01 h12 h23 h34 _ h02 h03 _ _ h13 h14 _ h24 _ apply htrail v₀ v₁ v₂ v₃ v₄ h01 h12 h23 h34 h02 h13 h24 · intro heq rcases Sym2.eq_iff.1 heq with ⟨h1, _⟩ | ⟨h1, _⟩ · exact h02 h1 · exact h03 h1 · intro heq rcases Sym2.eq_iff.1 heq with ⟨h1, _⟩ | ⟨h1, _⟩ · exact h13 h1 · exact h14 h1 · intro v₀ v₁ v₂ v₃ h01 h12 h23 h30 h01_ne h02 h03 _ h13 _ apply htrail v₀ v₁ v₂ v₃ v₀ h01 h12 h23 h30 h02 h13 h02.symm · intro heq rcases Sym2.eq_iff.1 heq with ⟨h1, _⟩ | ⟨h1, _⟩ · exact h02 h1 · exact h03 h1 · intro heq rcases Sym2.eq_iff.1 heq with ⟨h1, _⟩ | ⟨h1, _⟩ · exact h13 h1 · exact h01_ne h1.symm · rintro ⟨hprop, hP4, hC4⟩ refine ⟨hprop, ?_⟩ intro v₀ v₁ v₂ v₃ v₄ h01 h12 h23 h34 h02 h13 h24 he13 he24 ⟨hc13, hc24⟩ have h01_ne : v₀ ≠ v₁ := G.ne_of_adj h01 have h12_ne : v₁ ≠ v₂ := G.ne_of_adj h12 have h23_ne : v₂ ≠ v₃ := G.ne_of_adj h23 have h34_ne : v₃ ≠ v₄ := G.ne_of_adj h34 -- `v₀ ≠ v₃`: otherwise `v₃ = v₀`, so `s(v₀, v₁)` and `s(v₂, v₀)` share `v₀` with equal color! have h03 : v₀ ≠ v₃ := by intro h; subst h exact hprop v₀ v₁ v₂ h01 h23.symm h12_ne (by simpa [Sym2.eq_swap] using hc13) -- `v₁ ≠ v₄`: otherwise `v₄ = v₁`, so `s(v₁, v₂)` and `s(v₃, v₁)` share `v₁` with equal color! have h14 : v₁ ≠ v₄ := by intro h; subst h exact hprop v₁ v₂ v₃ h12 h34.symm h23_ne (by simpa [Sym2.eq_swap] using hc24) by_cases h04 : v₀ = v₄ · subst h04 exact hC4 v₀ v₁ v₂ v₃ h01 h12 h23 h34 h01_ne h02 h03 h12_ne h13 h23_ne ⟨hc13, hc24⟩ · exact hP4 v₀ v₁ v₂ v₃ v₄ h01 h12 h23 h34 h01_ne h02 h03 h04 h12_ne h13 h14 h23_ne h24 h34_ne ⟨hc13, hc24⟩ /-- An **acyclic edge coloring** of `G`: a proper edge coloring in which no cycle is bichromatic (every cycle uses at least 3 distinct colors on its edges). -/ def IsAcyclicEdgeColoring {α : Type*} (G : SimpleGraph V) (c : Sym2 V → α) : Prop := IsProperEdgeColoring G c ∧ ∀ (v : V) (p : G.Walk v v), p.IsCycle → ∀ α₁ α₂ : α, ¬(∀ e ∈ p.edges, c e = α₁ ∨ c e = α₂) /-- Every star edge coloring is an acyclic edge coloring: any bichromatic cycle has length `≥ 4` (a triangle cannot be properly 2-edge-colored) and its first 4 edges form a bichromatic 4-edge trail. -/ theorem isAcyclicEdgeColoring_of_isStarEdgeColoring {α : Type*} {G : SimpleGraph V} {c : Sym2 V → α} (hstar : IsStarEdgeColoring G c) : IsAcyclicEdgeColoring G c := by rcases hstar with ⟨hprop, htrail⟩ refine ⟨hprop, ?_⟩ intro v p hp α₁ α₂ h2col have hlen : 3 ≤ p.length := hp.three_le_length -- Extract the first 3 edges of `p`; since `p` is a cycle, its edges are nodup and its support tail is nodup match p with | .nil => simp at hlen | .cons h01 .nil => simp at hlen | .cons h01 (.cons h12 .nil) => simp at hlen | .cons h01 (.cons h12 (.cons h23 p_rest)) => rename_i v₁ v₂ v₃ have hnd_e : (Walk.cons h01 (Walk.cons h12 (Walk.cons h23 p_rest))).edges.Nodup := hp.edges_nodup have hnd_s : (Walk.cons h01 (Walk.cons h12 (Walk.cons h23 p_rest))).support.tail.Nodup := hp.support_nodup have hc01 : c s(v, v₁) = α₁ ∨ c s(v, v₁) = α₂ := h2col _ (by simp) have hc12 : c s(v₁, v₂) = α₁ ∨ c s(v₁, v₂) = α₂ := h2col _ (by simp) have hc23 : c s(v₂, v₃) = α₁ ∨ c s(v₂, v₃) = α₂ := h2col _ (by simp) have h02 : v ≠ v₂ := by intro h; subst h simp only [Walk.edges_cons, List.nodup_cons, List.mem_cons] at hnd_e exact hnd_e.1 (Or.inl (Sym2.eq_swap)) have h13 : v₁ ≠ v₃ := by intro h; subst h simp only [Walk.edges_cons, List.nodup_cons, List.mem_cons] at hnd_e exact hnd_e.2.1 (Or.inl (Sym2.eq_swap)) have hne01_12 : c s(v, v₁) ≠ c s(v₁, v₂) := by intro heq exact hprop v₁ v v₂ h01.symm h12 h02 (by simpa [Sym2.eq_swap] using heq) have hne12_23 : c s(v₁, v₂) ≠ c s(v₂, v₃) := by intro heq exact hprop v₂ v₁ v₃ h12.symm h23 h13 (by simpa [Sym2.eq_swap] using heq) have hc01_eq_23 : c s(v, v₁) = c s(v₂, v₃) := by rcases hc01 with h1 | h1 <;> rcases hc12 with h2 | h2 <;> rcases hc23 with h3 | h3 · exact absurd (h1.trans h2.symm) hne01_12 · exact absurd (h1.trans h2.symm) hne01_12 · exact h1.trans h3.symm · exact absurd (h2.trans h3.symm) hne12_23 · exact absurd (h2.trans h3.symm) hne12_23 · exact h1.trans h3.symm · exact absurd (h1.trans h2.symm) hne01_12 · exact absurd (h1.trans h2.symm) hne01_12 match p_rest with | .nil => -- Triangle `v₃ - v₁ - v₂ - v₃`: `c s(v₃, v₁) = c s(v₂, v₃)` contradicts properness at `v₃`! exact hprop v₃ v₁ v₂ h01 h23.symm (G.ne_of_adj h12) (by simpa [Sym2.eq_swap] using hc01_eq_23) | .cons h34 p_tail => rename_i v₄ have hc34 : c s(v₃, v₄) = α₁ ∨ c s(v₃, v₄) = α₂ := h2col _ (by simp) have h24 : v₂ ≠ v₄ := by intro h; subst h simp only [Walk.edges_cons, List.nodup_cons, List.mem_cons] at hnd_e exact hnd_e.2.2.1 (Or.inl (Sym2.eq_swap)) have hne23_34 : c s(v₂, v₃) ≠ c s(v₃, v₄) := by intro heq exact hprop v₃ v₂ v₄ h23.symm h34 h24 (by simpa [Sym2.eq_swap] using heq) have hc12_eq_34 : c s(v₁, v₂) = c s(v₃, v₄) := by rcases hc12 with h2 | h2 <;> rcases hc23 with h3 | h3 <;> rcases hc34 with h4 | h4 · exact absurd (h2.trans h3.symm) hne12_23 · exact absurd (h2.trans h3.symm) hne12_23 · exact h2.trans h4.symm · exact absurd (h3.trans h4.symm) hne23_34 · exact absurd (h3.trans h4.symm) hne23_34 · exact h2.trans h4.symm · exact absurd (h2.trans h3.symm) hne12_23 · exact absurd (h2.trans h3.symm) hne12_23 have he13 : s(v, v₁) ≠ s(v₂, v₃) := by simp only [Walk.edges_cons, List.nodup_cons, List.mem_cons] at hnd_e intro heq; exact hnd_e.1 (Or.inr (Or.inl heq)) have he24 : s(v₁, v₂) ≠ s(v₃, v₄) := by simp only [Walk.edges_cons, List.nodup_cons, List.mem_cons] at hnd_e intro heq; exact hnd_e.2.1 (Or.inr (Or.inl heq)) exact htrail v v₁ v₂ v₃ v₄ h01 h12 h23 h34 h02 h13 h24 he13 he24 ⟨hc01_eq_23, hc12_eq_34⟩ /-- `G` is **list star `M`-edge-colorable** (`ch'_{st}(G) ≤ M`): for every nonempty color universe `α` and every list assignment `L : Sym2 V → Finset α` giving each edge of `G` at least `M` colors, `G` admits a star edge coloring `c` with `c e ∈ L e` for all edges of `G`. -/ def IsListStarEdgeColorable (G : SimpleGraph V) (M : ℕ) : Prop := ∀ (α : Type) [DecidableEq α] [Nonempty α] (L : Sym2 V → Finset α), (∀ u v : V, G.Adj u v → M ≤ (L s(u, v)).card) → ∃ c : Sym2 V → α, (∀ u v : V, G.Adj u v → c s(u, v) ∈ L s(u, v)) ∧ IsStarEdgeColoring G c /-- `G` is **list acyclic `M`-edge-colorable** (`a'_ℓ(G) ≤ M`). -/ def IsListAcyclicEdgeColorable (G : SimpleGraph V) (M : ℕ) : Prop := ∀ (α : Type) [DecidableEq α] [Nonempty α] (L : Sym2 V → Finset α), (∀ u v : V, G.Adj u v → M ≤ (L s(u, v)).card) → ∃ c : Sym2 V → α, (∀ u v : V, G.Adj u v → c s(u, v) ∈ L s(u, v)) ∧ IsAcyclicEdgeColoring G c /-- `G` is star `M`-edge-colorable (`χ'_{st}(G) ≤ M`). -/ def IsStarEdgeColorable (G : SimpleGraph V) (M : ℕ) : Prop := ∃ c : Sym2 V → Fin M, IsStarEdgeColoring G c lemma IsListStarEdgeColorable.mono {G : SimpleGraph V} {M₁ M₂ : ℕ} (h : IsListStarEdgeColorable G M₁) (hle : M₁ ≤ M₂) : IsListStarEdgeColorable G M₂ := fun α _ _ L hL => h α L (fun u v huv => hle.trans (hL u v huv)) lemma IsListStarEdgeColorable.isStarEdgeColorable {G : SimpleGraph V} {M : ℕ} (hM : 1 ≤ M) (h : IsListStarEdgeColorable G M) : IsStarEdgeColorable G M := by have : Nonempty (Fin M) := ⟨⟨0, by omega⟩⟩ obtain ⟨c, _, hstar⟩ := h (Fin M) (fun _ => (Finset.univ : Finset (Fin M))) (fun _ _ _ => by simp) exact ⟨c, hstar⟩ lemma IsListStarEdgeColorable.isListAcyclicEdgeColorable {G : SimpleGraph V} {M : ℕ} (h : IsListStarEdgeColorable G M) : IsListAcyclicEdgeColorable G M := by intro α _ _ L hL obtain ⟨c, hmem, hstar⟩ := h α L hL exact ⟨c, hmem, isAcyclicEdgeColoring_of_isStarEdgeColoring hstar⟩ /-- Universal lower bound: any proper (hence star) edge coloring with `M` colors requires `maxDeg G ≤ M`. -/ theorem star_edge_coloring_lower_bound_maxDeg [Fintype V] (G : SimpleGraph V) (M : ℕ) (hcol : IsStarEdgeColorable G M) : maxDeg G ≤ M := by classical rcases hcol with ⟨c, hprop, _⟩ unfold maxDeg apply Finset.sup_le intro u _ rw [← degree_eq_degCl G u, SimpleGraph.degree] have hinj : Set.InjOn (fun v : V => c s(u, v)) (G.neighborFinset u : Set V) := by intro v₁ hv₁ v₂ hv₂ heq by_contra hne exact hprop u v₁ v₂ ((SimpleGraph.mem_neighborFinset G u v₁).1 hv₁) ((SimpleGraph.mem_neighborFinset G u v₂).1 hv₂) hne heq calc (G.neighborFinset u).card = ((G.neighborFinset u).image (fun v => c s(u, v))).card := (Finset.card_image_of_injOn hinj).symm _ ≤ M := by simpa [Fintype.card_fin] using Finset.card_le_univ ((G.neighborFinset u).image (fun v => c s(u, v))) end Definitions /-! ## Section 1: Forward Degeneracy Ordering -/ section DegeneracyOrdering /-- Every finite `k`-degenerate graph admits a bijection `ord : Fin n ≃ V` such that every vertex `ord i` has at most `k` neighbors `ord j` with `j < i`. -/ lemma exists_forward_degeneracy_ordering {V : Type*} [Fintype V] (G : SimpleGraph V) (k : ℕ) (hdeg : IsDegenerate G k) : ∃ ord : Fin (Fintype.card V) ≃ V, ∀ i : Fin (Fintype.card V), ∀ [DecidableRel G.Adj], (Finset.univ.filter fun j : Fin (Fintype.card V) => j < i ∧ G.Adj (ord i) (ord j)).card ≤ k := by classical suffices hsub : ∀ n : ℕ, ∀ S : Finset V, S.card = n → ∃ e : Fin n ≃ {v : V // v ∈ S}, ∀ i : Fin n, (Finset.univ.filter fun j : Fin n => j < i ∧ G.Adj (e i).1 (e j).1).card ≤ k by obtain ⟨e, he⟩ := hsub (Fintype.card V) Finset.univ Finset.card_univ refine ⟨e.trans (Equiv.subtypeUnivEquiv Finset.mem_univ), ?_⟩ intro i _ refine le_trans (le_of_eq ?_) (he i) exact Finset.card_bij (fun j _ => j) (fun j hj => by simpa using hj) (fun _ _ _ _ h => h) (fun j hj => ⟨j, by simpa using hj, rfl⟩) intro n induction n with | zero => intro S hS have hSe : S = ∅ := Finset.card_eq_zero.1 hS have hempty : ∀ v : {v : V // v ∈ S}, False := fun ⟨x, hx⟩ => by rw [hSe] at hx exact Finset.notMem_empty x hx refine ⟨⟨fun i => Fin.elim0 i, fun v => (hempty v).elim, fun i => Fin.elim0 i, fun v => (hempty v).elim⟩, fun i => Fin.elim0 i⟩ | succ m ih => intro S hS have hSne : S.Nonempty := Finset.card_pos.1 (by omega) obtain ⟨v, hvS, hvdeg⟩ := hdeg S hSne let S' := S.erase v have hS'card : S'.card = m := by rw [Finset.card_erase_of_mem hvS, hS]; omega obtain ⟨e', he'⟩ := ih S' hS'card let toFun : Fin (m + 1) → {x : V // x ∈ S} := fun i => if h : i.val < m then ⟨(e' ⟨i.val, h⟩).1, Finset.mem_of_mem_erase (e' ⟨i.val, h⟩).2⟩ else ⟨v, hvS⟩ let invFun : {x : V // x ∈ S} → Fin (m + 1) := fun x => if hx : x.1 = v then Fin.last m else Fin.castSucc (e'.symm ⟨x.1, Finset.mem_erase.2 ⟨hx, x.2⟩⟩) have hleft : Function.LeftInverse invFun toFun := by intro i dsimp only [toFun, invFun] by_cases h1 : i.val < m · rw [dif_pos h1] have hne : (e' ⟨i.val, h1⟩).1 ≠ v := (Finset.mem_erase.1 (e' ⟨i.val, h1⟩).2).1 rw [dif_neg hne] simp only [Subtype.coe_eta, Equiv.symm_apply_apply] exact Fin.ext rfl · rw [dif_neg h1, dif_pos rfl] exact Fin.ext (by simp [Fin.last]; omega) have hright : Function.RightInverse invFun toFun := by intro x dsimp only [toFun, invFun] by_cases hx : x.1 = v · rw [dif_pos hx, dif_neg (by simp [Fin.last])] exact Subtype.ext hx.symm · rw [dif_neg hx] have hlt : (Fin.castSucc (e'.symm ⟨x.1, Finset.mem_erase.2 ⟨hx, x.2⟩⟩)).val < m := (e'.symm ⟨x.1, Finset.mem_erase.2 ⟨hx, x.2⟩⟩).isLt rw [dif_pos hlt] simp only [Fin.val_castSucc, Fin.eta, Equiv.apply_symm_apply] let e : Fin (m + 1) ≃ {x : V // x ∈ S} := ⟨toFun, invFun, hleft, hright⟩ refine ⟨e, ?_⟩ intro i by_cases hi : i.val < m · have hcard_eq : (Finset.univ.filter fun j : Fin (m + 1) => j < i ∧ G.Adj (e i).1 (e j).1).card = (Finset.univ.filter fun j : Fin m => j < ⟨i.val, hi⟩ ∧ G.Adj (e' ⟨i.val, hi⟩).1 (e' j).1).card := by apply Finset.card_bij (fun j hj => (⟨j.val, lt_trans (Finset.mem_filter.1 hj).2.1 hi⟩ : Fin m)) · intro j hj rcases Finset.mem_filter.1 hj with ⟨_, hji, hadj⟩ have hjlt : j.val < m := lt_trans hji hi refine Finset.mem_filter.2 ⟨Finset.mem_univ _, hji, ?_⟩ simpa [e, toFun, hi, hjlt] using hadj · intro j₁ _ j₂ _ heq have hval : j₁.val = j₂.val := congrArg (Fin.val : Fin m → ℕ) heq exact Fin.ext hval · intro j hj rcases Finset.mem_filter.1 hj with ⟨_, hji, hadj⟩ refine ⟨Fin.castSucc j, Finset.mem_filter.2 ⟨Finset.mem_univ _, hji, ?_⟩, Fin.ext rfl⟩ simpa [e, toFun, hi, j.isLt] using hadj rw [hcard_eq] exact he' ⟨i.val, hi⟩ · have hei : (e i).1 = v := by simp [e, toFun, hi] calc (Finset.univ.filter fun j : Fin (m + 1) => j < i ∧ G.Adj (e i).1 (e j).1).card ≤ (S.filter (G.Adj v)).card := by apply Finset.card_le_card_of_injOn (fun j => (e j).1) · intro j hj rcases Finset.mem_filter.1 hj with ⟨_, _, hadj⟩ rw [hei] at hadj exact Finset.mem_filter.2 ⟨(e j).2, hadj⟩ · intro j₁ _ j₂ _ heq exact e.injective (Subtype.ext heq) _ ≤ k := hvdeg end DegeneracyOrdering /-! ## Section 2: Lexicographic Edge Ordering Key `min(e) * n + max(e)` -/ section EdgeKey /-- Canonical lexicographic key of an undirected edge `e : Sym2 V` with respect to an ordering `ord : Fin n ≃ V`: for `e = s(x, y)`, `edgeKey ord e = min(i, j) * n + max(i, j)`. -/ def edgeKey {V : Type*} {n : ℕ} (ord : Fin n ≃ V) (e : Sym2 V) : ℕ := Sym2.lift ⟨fun x y => min (ord.symm x).val (ord.symm y).val * n + max (ord.symm x).val (ord.symm y).val, fun x y => by simp [min_comm, max_comm]⟩ e lemma edgeKey_mk {V : Type*} {n : ℕ} (ord : Fin n ≃ V) (x y : V) : edgeKey ord s(x, y) = min (ord.symm x).val (ord.symm y).val * n + max (ord.symm x).val (ord.symm y).val := rfl lemma edgeKey_ord_of_lt {V : Type*} {n : ℕ} (ord : Fin n ≃ V) {i j : Fin n} (hij : i < j) : edgeKey ord s(ord i, ord j) = i.val * n + j.val := by rw [edgeKey_mk, Equiv.symm_apply_apply, Equiv.symm_apply_apply] have hle : i.val ≤ j.val := le_of_lt hij rw [min_eq_left hle, max_eq_right hle] lemma edgeKey_lt_sq {V : Type*} {n : ℕ} (ord : Fin n ≃ V) (x y : V) : edgeKey ord s(x, y) < n * n := by rw [edgeKey_mk] have h1 : min (ord.symm x).val (ord.symm y).val < n := lt_of_le_of_lt (min_le_left _ _) (ord.symm x).isLt have h2 : max (ord.symm x).val (ord.symm y).val < n := max_lt (ord.symm x).isLt (ord.symm y).isLt have hmul : (min (ord.symm x).val (ord.symm y).val + 1) * n ≤ n * n := Nat.mul_le_mul_right n h1 rw [add_mul, one_mul] at hmul omega lemma edgeKey_lt_of_min_lt {V : Type*} {n : ℕ} (ord : Fin n ≃ V) {i₁ j₁ i₂ j₂ : Fin n} (hlt : min i₁.val j₁.val < min i₂.val j₂.val) : edgeKey ord s(ord i₁, ord j₁) < edgeKey ord s(ord i₂, ord j₂) := by rw [edgeKey_mk, edgeKey_mk, Equiv.symm_apply_apply, Equiv.symm_apply_apply, Equiv.symm_apply_apply, Equiv.symm_apply_apply] have hmax1 : max i₁.val j₁.val < n := max_lt i₁.isLt j₁.isLt have hstep : (min i₁.val j₁.val + 1) * n ≤ min i₂.val j₂.val * n := Nat.mul_le_mul_right n hlt rw [add_mul, one_mul] at hstep omega lemma min_le_of_edgeKey_lt {V : Type*} {n : ℕ} (ord : Fin n ≃ V) {i j u v : Fin n} (_huv : u < v) (hkey : edgeKey ord s(ord i, ord j) < u.val * n + v.val) : min i.val j.val ≤ u.val := by rw [edgeKey_mk, Equiv.symm_apply_apply, Equiv.symm_apply_apply] at hkey by_contra hgt have hlt : u.val + 1 ≤ min i.val j.val := by omega have hstep : (u.val + 1) * n ≤ min i.val j.val * n := Nat.mul_le_mul_right n hlt rw [add_mul, one_mul] at hstep have hv : v.val < n := v.isLt omega lemma lt_of_edgeKey_lt_and_gt {V : Type*} {n : ℕ} (ord : Fin n ≃ V) {w x u v : Fin n} (huv : u < v) (hux : u < x) (hwu : w ≠ u) (hkey : edgeKey ord s(ord w, ord x) < u.val * n + v.val) : w < u := by have hmin := min_le_of_edgeKey_lt ord huv hkey have hxgt : u.val < x.val := hux have hwne : w.val ≠ u.val := fun h => hwu (Fin.ext h) change w.val < u.val omega lemma eq_of_edgeKey_eq {V : Type*} {n : ℕ} (ord : Fin n ≃ V) {i j u v : Fin n} (huv : u < v) (hij : i ≠ j) (hkey : edgeKey ord s(ord i, ord j) = u.val * n + v.val) : s(ord i, ord j) = s(ord u, ord v) := by rw [edgeKey_mk, Equiv.symm_apply_apply, Equiv.symm_apply_apply] at hkey have hm1 : min i.val j.val < n := lt_of_le_of_lt (min_le_left _ _) i.isLt have hM1 : max i.val j.val < n := max_lt i.isLt j.isLt have hv : v.val < n := v.isLt have hmin_eq : min i.val j.val = u.val := by by_contra hne rcases lt_or_gt_of_ne hne with hlt | hgt · have h1 : (min i.val j.val + 1) * n ≤ u.val * n := Nat.mul_le_mul_right n hlt rw [add_mul, one_mul] at h1; omega · have h1 : (u.val + 1) * n ≤ min i.val j.val * n := Nat.mul_le_mul_right n hgt rw [add_mul, one_mul] at h1; omega have hmax_eq : max i.val j.val = v.val := by rw [hmin_eq] at hkey; omega rcases lt_or_gt_of_ne (fun h => hij (Fin.ext h)) with hlt | hgt · have hi : i.val = u.val := by rwa [min_eq_left (le_of_lt hlt)] at hmin_eq have hj : j.val = v.val := by rwa [max_eq_right (le_of_lt hlt)] at hmax_eq rw [Fin.ext hi, Fin.ext hj] · have hj : j.val = u.val := by rwa [min_eq_right (le_of_lt hgt)] at hmin_eq have hi : i.val = v.val := by rwa [max_eq_left (le_of_lt hgt)] at hmax_eq rw [Fin.ext hi, Fin.ext hj, Sym2.eq_swap] end EdgeKey /-! ## Section 3: Main World-Record Theorem (`ch'_{st}(G) ≤ 2kΔ + k² - 3k + 1`) -/ section MainTheorem /-- **Main World-Record Theorem**: Every finite `k`-degenerate graph `G` (`k ≥ 1`) with maximum degree `Δ = maxDeg G` is list star edge colorable from every list assignment of size `2 * k * Δ + k ^ 2 + 1 - 3 * k`. -/ theorem list_star_edge_coloring_of_degenerate {V : Type*} [Fintype V] (G : SimpleGraph V) {k : ℕ} (hk : 1 ≤ k) (hdeg : IsDegenerate G k) : IsListStarEdgeColorable G (2 * k * maxDeg G + k * k + 1 - 3 * k) := by classical intro α _ hneα L hL let n := Fintype.card V let Δ := maxDeg G let M := 2 * k * Δ + k * k + 1 - 3 * k -- Handle empty edge set (or `n = 0`) cleanly by_cases hedge : ∃ x y : V, G.Adj x y · have hΔpos : 1 ≤ Δ := by rcases hedge with ⟨x, y, hxy⟩ have h0 : 0 < G.degree x := by rw [SimpleGraph.degree] exact Finset.card_pos.2 ⟨y, (SimpleGraph.mem_neighborFinset G x y).2 hxy⟩ have hle := degree_le_maxDeg G x omega have hMpos : 0 < M := by have : 2 * k * 1 ≤ 2 * k * Δ := Nat.mul_le_mul_left (2 * k) hΔpos have : k ≤ k * k := Nat.le_mul_self k dsimp [M]; omega -- Pick a dummy color `c₀ : α` from an existing edge's nonempty list obtain ⟨x₀, y₀, hx₀y₀⟩ := hedge have hL₀_ne : (L s(x₀, y₀)).Nonempty := Finset.card_pos.1 (lt_of_lt_of_le hMpos (hL x₀ y₀ hx₀y₀)) obtain ⟨c₀, _⟩ := hL₀_ne obtain ⟨ord, hord⟩ := exists_forward_degeneracy_ordering G k hdeg -- Define the set of edges colored strictly before time `t` let Done : ℕ → Finset (Sym2 V) := fun t => G.edgeFinset.filter fun e => edgeKey ord e < t -- Main induction on `t : ℕ` maintaining all 4 invariants on `Done t` have hbuild : ∀ t : ℕ, ∃ c : Sym2 V → α, -- Inv 1: list membership on `Done t` (∀ e ∈ Done t, c e ∈ L e) ∧ -- Inv 2: properness on `Done t` (∀ x y₁ y₂ : V, s(x, y₁) ∈ Done t → s(x, y₂) ∈ Done t → y₁ ≠ y₂ → c s(x, y₁) ≠ c s(x, y₂)) ∧ -- Inv 3: Rule 2 backward-neighbor avoidance on `Done t` (∀ u v w z : Fin n, u < v → w < u → s(ord u, ord v) ∈ Done t → G.Adj (ord v) (ord w) → s(ord w, ord z) ∈ Done t → z ≠ v → c s(ord u, ord v) ≠ c s(ord w, ord z)) ∧ -- Inv 4: no bichromatic 4-edge trail in `Done t` (∀ v₀ v₁ v₂ v₃ v₄ : V, s(v₀, v₁) ∈ Done t → s(v₁, v₂) ∈ Done t → s(v₂, v₃) ∈ Done t → s(v₃, v₄) ∈ Done t → v₀ ≠ v₂ → v₁ ≠ v₃ → v₂ ≠ v₄ → s(v₀, v₁) ≠ s(v₂, v₃) → s(v₁, v₂) ≠ s(v₃, v₄) → ¬(c s(v₀, v₁) = c s(v₂, v₃) ∧ c s(v₁, v₂) = c s(v₃, v₄))) := by intro t induction t with | zero => refine ⟨fun _ => c₀, ?_, ?_, ?_, ?_⟩ · intro e he; simp [Done] at he · intro x y₁ y₂ h1; simp [Done] at h1 · intro u v w z _ _ h1; simp [Done] at h1 · intro v₀ v₁ v₂ v₃ v₄ h1; simp [Done] at h1 | succ t ih => obtain ⟨c, hInv1, hInv2, hInv3, hInv4⟩ := ih -- Check if there is an edge of `G` with `edgeKey ord e = t` by_cases hstep : ∃ u v : Fin n, u < v ∧ G.Adj (ord u) (ord v) ∧ u.val * n + v.val = t · obtain ⟨u, v, huv, hadj_uv, hkey_uv⟩ := hstep let eStar : Sym2 V := s(ord u, ord v) have heStar_key : edgeKey ord eStar = t := by rw [edgeKey_ord_of_lt ord huv, hkey_uv] have heStar_edge : eStar ∈ G.edgeFinset := SimpleGraph.mem_edgeFinset.2 hadj_uv have heStar_notDone : eStar ∉ Done t := by simp [Done, heStar_key] -- Characterize `Done (t + 1) = insert eStar (Done t)` have hDone_succ : ∀ e : Sym2 V, e ∈ Done (t + 1) ↔ e = eStar ∨ e ∈ Done t := by intro e simp only [Done, Finset.mem_filter] constructor · rintro ⟨heG, hlt⟩ by_cases heq : edgeKey ord e = t · left induction e using Sym2.ind with | _ x y => have hadj : G.Adj x y := SimpleGraph.mem_edgeFinset.1 heG have hne : ord.symm x ≠ ord.symm y := fun h => G.ne_of_adj hadj (ord.symm.injective h) have h1 : s(ord (ord.symm x), ord (ord.symm y)) = s(x, y) := by simp rw [← h1] at heq ⊢ exact eq_of_edgeKey_eq ord huv hne (heq.trans hkey_uv.symm) · right exact ⟨heG, by omega⟩ · rintro (rfl | ⟨heG, hlt⟩) · exact ⟨heStar_edge, by omega⟩ · exact ⟨heG, by omega⟩ -- Helper: backward neighbor sets let backU : Finset (Fin n) := Finset.univ.filter fun w₁ : Fin n => w₁ < u ∧ G.Adj (ord u) (ord w₁) let backVltU : Finset (Fin n) := Finset.univ.filter fun w : Fin n => w < u ∧ G.Adj (ord v) (ord w) have hbackU_card : backU.card ≤ k := hord u have hbackVltU_card : backVltU.card ≤ k - 1 := by let backV : Finset (Fin n) := Finset.univ.filter fun w : Fin n => w < v ∧ G.Adj (ord v) (ord w) have hsub : backVltU ⊆ backV.erase u := by intro w hw rcases Finset.mem_filter.1 hw with ⟨_, hwu, hadj⟩ refine Finset.mem_erase.2 ⟨ne_of_lt hwu, Finset.mem_filter.2 ⟨Finset.mem_univ _, lt_trans hwu huv, hadj⟩⟩ have hu_mem : u ∈ backV := Finset.mem_filter.2 ⟨Finset.mem_univ _, huv, hadj_uv.symm⟩ have hle1 : backVltU.card ≤ (backV.erase u).card := Finset.card_le_card hsub rw [Finset.card_erase_of_mem hu_mem] at hle1 have hle2 : backV.card ≤ k := hord v omega -- Rule 1a: already-colored edges incident to `ord u` let E1u : Finset (Sym2 V) := (Done t).filter fun e => ord u ∈ e let F1u : Finset α := E1u.image c have hF1u_card : F1u.card ≤ Δ - 1 := by have hsub : E1u ⊆ (G.incidenceFinset (ord u)).erase eStar := by intro e he rcases Finset.mem_filter.1 he with ⟨heDone, hu_mem⟩ refine Finset.mem_erase.2 ⟨fun h => heStar_notDone (h ▸ heDone), ?_⟩ exact (SimpleGraph.mem_incidenceFinset G (ord u) e).2 ⟨SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 heDone).1, hu_mem⟩ have heStar_inc : eStar ∈ G.incidenceFinset (ord u) := (SimpleGraph.mem_incidenceFinset G (ord u) eStar).2 ⟨hadj_uv, Sym2.mem_mk_left _ _⟩ calc F1u.card ≤ E1u.card := Finset.card_image_le _ ≤ ((G.incidenceFinset (ord u)).erase eStar).card := Finset.card_le_card hsub _ = (G.incidenceFinset (ord u)).card - 1 := Finset.card_erase_of_mem heStar_inc _ = G.degree (ord u) - 1 := by rw [SimpleGraph.card_incidenceFinset_eq_degree] _ ≤ Δ - 1 := Nat.sub_le_sub_right (degree_le_maxDeg G (ord u)) 1 -- Rule 1b: already-colored edges incident to `ord v` (all have other endpoint in `backVltU`) let E1v : Finset (Sym2 V) := (Done t).filter fun e => ord v ∈ e let F1v : Finset α := E1v.image c have hE1v_sub : E1v ⊆ backVltU.image (fun w => s(ord w, ord v)) := by intro e he rcases Finset.mem_filter.1 he with ⟨heDone, hv_mem⟩ rcases Finset.mem_filter.1 heDone with ⟨heG, hkey_lt⟩ obtain ⟨x, rfl⟩ := Sym2.mem_iff_exists.1 hv_mem have hadj : G.Adj (ord v) x := SimpleGraph.mem_edgeFinset.1 heG let w := ord.symm x have hwx : ord w = x := Equiv.apply_symm_apply ord x have hne_wu : w ≠ u := by intro h rw [h] at hwx rw [← hwx] at heDone have : s(ord v, ord u) = eStar := Sym2.eq_swap exact heStar_notDone (this ▸ heDone) have hkey_wv : edgeKey ord s(ord w, ord v) < u.val * n + v.val := by rw [hkey_uv, Sym2.eq_swap, hwx]; exact hkey_lt have hwu : w < u := lt_of_edgeKey_lt_and_gt ord huv huv hne_wu hkey_wv refine Finset.mem_image.2 ⟨w, Finset.mem_filter.2 ⟨Finset.mem_univ _, hwu, ?_⟩, ?_⟩ · rwa [hwx] · rw [hwx, Sym2.eq_swap] have hF1v_card : F1v.card ≤ backVltU.card := calc F1v.card ≤ E1v.card := Finset.card_image_le _ ≤ (backVltU.image (fun w => s(ord w, ord v))).card := Finset.card_le_card hE1v_sub _ ≤ backVltU.card := Finset.card_image_le -- Rule 2: edges incident to `w ∈ backVltU` other than `s(ord w, ord v)` let F2 : Finset α := backVltU.biUnion fun w => ((Done t).filter fun e => ord w ∈ e ∧ e ≠ s(ord w, ord v)).image c have hF2_card : F2.card ≤ backVltU.card * (Δ - 1) := by calc F2.card ≤ ∑ w ∈ backVltU, (((Done t).filter fun e => ord w ∈ e ∧ e ≠ s(ord w, ord v)).image c).card := Finset.card_biUnion_le _ ≤ ∑ _w ∈ backVltU, (Δ - 1) := by apply Finset.sum_le_sum intro w hw have hadj_vw : G.Adj (ord v) (ord w) := (Finset.mem_filter.1 hw).2.2 have hsub : ((Done t).filter fun e => ord w ∈ e ∧ e ≠ s(ord w, ord v)) ⊆ (G.incidenceFinset (ord w)).erase s(ord w, ord v) := by intro e he rcases Finset.mem_filter.1 he with ⟨heDone, hw_mem, hne⟩ exact Finset.mem_erase.2 ⟨hne, (SimpleGraph.mem_incidenceFinset G (ord w) e).2 ⟨SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 heDone).1, hw_mem⟩⟩ have hinc : s(ord w, ord v) ∈ G.incidenceFinset (ord w) := (SimpleGraph.mem_incidenceFinset G (ord w) _).2 ⟨hadj_vw.symm, Sym2.mem_mk_left _ _⟩ calc (((Done t).filter fun e => ord w ∈ e ∧ e ≠ s(ord w, ord v)).image c).card ≤ ((Done t).filter fun e => ord w ∈ e ∧ e ≠ s(ord w, ord v)).card := Finset.card_image_le _ ≤ ((G.incidenceFinset (ord w)).erase s(ord w, ord v)).card := Finset.card_le_card hsub _ = G.degree (ord w) - 1 := by rw [Finset.card_erase_of_mem hinc, SimpleGraph.card_incidenceFinset_eq_degree] _ ≤ Δ - 1 := Nat.sub_le_sub_right (degree_le_maxDeg G (ord w)) 1 _ = backVltU.card * (Δ - 1) := by simp -- Rule 3: edges incident to `w₁ ∈ backU` other than `s(ord w₁, ord u)` let F3 : Finset α := backU.biUnion fun w₁ => ((Done t).filter fun e => ord w₁ ∈ e ∧ e ≠ s(ord w₁, ord u)).image c have hF3_card : F3.card ≤ backU.card * (Δ - 1) := by calc F3.card ≤ ∑ w₁ ∈ backU, (((Done t).filter fun e => ord w₁ ∈ e ∧ e ≠ s(ord w₁, ord u)).image c).card := Finset.card_biUnion_le _ ≤ ∑ _w₁ ∈ backU, (Δ - 1) := by apply Finset.sum_le_sum intro w₁ hw₁ have hadj_uw1 : G.Adj (ord u) (ord w₁) := (Finset.mem_filter.1 hw₁).2.2 have hsub : ((Done t).filter fun e => ord w₁ ∈ e ∧ e ≠ s(ord w₁, ord u)) ⊆ (G.incidenceFinset (ord w₁)).erase s(ord w₁, ord u) := by intro e he rcases Finset.mem_filter.1 he with ⟨heDone, hw_mem, hne⟩ exact Finset.mem_erase.2 ⟨hne, (SimpleGraph.mem_incidenceFinset G (ord w₁) e).2 ⟨SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 heDone).1, hw_mem⟩⟩ have hinc : s(ord w₁, ord u) ∈ G.incidenceFinset (ord w₁) := (SimpleGraph.mem_incidenceFinset G (ord w₁) _).2 ⟨hadj_uw1.symm, Sym2.mem_mk_left _ _⟩ calc (((Done t).filter fun e => ord w₁ ∈ e ∧ e ≠ s(ord w₁, ord u)).image c).card ≤ ((Done t).filter fun e => ord w₁ ∈ e ∧ e ≠ s(ord w₁, ord u)).card := Finset.card_image_le _ ≤ ((G.incidenceFinset (ord w₁)).erase s(ord w₁, ord u)).card := Finset.card_le_card hsub _ = G.degree (ord w₁) - 1 := by rw [Finset.card_erase_of_mem hinc, SimpleGraph.card_incidenceFinset_eq_degree] _ ≤ Δ - 1 := Nat.sub_le_sub_right (degree_le_maxDeg G (ord w₁)) 1 _ = backU.card * (Δ - 1) := by simp -- Rule 4: middle-edge correction for forward edges `(u, w₁)` matching a color in `F1v` let matchW1 : Finset (Fin n) := Finset.univ.filter fun w₁ : Fin n => u < w₁ ∧ s(ord u, ord w₁) ∈ Done t ∧ c s(ord u, ord w₁) ∈ F1v have hmatchW1_card : matchW1.card ≤ backVltU.card := by have hle : matchW1.card ≤ F1v.card := by apply Finset.card_le_card_of_injOn (fun w₁ => c s(ord u, ord w₁)) · intro w₁ hw₁; exact (Finset.mem_filter.1 hw₁).2.2.2 · intro x hx y hy heq by_contra hne exact hInv2 (ord u) (ord x) (ord y) (Finset.mem_filter.1 hx).2.2.1 (Finset.mem_filter.1 hy).2.2.1 (fun h => hne (ord.injective h)) heq exact hle.trans hF1v_card let F4 : Finset α := matchW1.biUnion fun w₁ => (Finset.univ.filter fun w₂ : Fin n => w₂ < u ∧ G.Adj (ord w₁) (ord w₂)).image (fun w₂ => c s(ord w₂, ord w₁)) have hF4_card : F4.card ≤ backVltU.card * (k - 1) := by calc F4.card ≤ ∑ w₁ ∈ matchW1, ((Finset.univ.filter fun w₂ : Fin n => w₂ < u ∧ G.Adj (ord w₁) (ord w₂)).image (fun w₂ => c s(ord w₂, ord w₁))).card := Finset.card_biUnion_le _ ≤ ∑ _w₁ ∈ matchW1, (k - 1) := by apply Finset.sum_le_sum intro w₁ hw₁ rcases Finset.mem_filter.1 hw₁ with ⟨_, huw1, hDone_uw1, _⟩ have hadj_uw1 : G.Adj (ord u) (ord w₁) := SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 hDone_uw1).1 let backW1 : Finset (Fin n) := Finset.univ.filter fun w₂ : Fin n => w₂ < w₁ ∧ G.Adj (ord w₁) (ord w₂) have hsub : (Finset.univ.filter fun w₂ : Fin n => w₂ < u ∧ G.Adj (ord w₁) (ord w₂)) ⊆ backW1.erase u := by intro w₂ hw₂ rcases Finset.mem_filter.1 hw₂ with ⟨_, hw2u, hadj2⟩ exact Finset.mem_erase.2 ⟨ne_of_lt hw2u, Finset.mem_filter.2 ⟨Finset.mem_univ _, lt_trans hw2u huw1, hadj2⟩⟩ have hu_in : u ∈ backW1 := Finset.mem_filter.2 ⟨Finset.mem_univ _, huw1, hadj_uw1.symm⟩ have hle1 : (Finset.univ.filter fun w₂ : Fin n => w₂ < u ∧ G.Adj (ord w₁) (ord w₂)).card ≤ (backW1.erase u).card := Finset.card_le_card hsub rw [Finset.card_erase_of_mem hu_in] at hle1 have hle2 : backW1.card ≤ k := hord w₁ calc ((Finset.univ.filter fun w₂ : Fin n => w₂ < u ∧ G.Adj (ord w₁) (ord w₂)).image (fun w₂ => c s(ord w₂, ord w₁))).card ≤ (Finset.univ.filter fun w₂ : Fin n => w₂ < u ∧ G.Adj (ord w₁) (ord w₂)).card := Finset.card_image_le _ ≤ k - 1 := by omega _ = matchW1.card * (k - 1) := by simp _ ≤ backVltU.card * (k - 1) := Nat.mul_le_mul_right (k - 1) hmatchW1_card -- Total forbidden colors `< M`! let Forb : Finset α := F1u ∪ F1v ∪ F2 ∪ F3 ∪ F4 have hForb_lt : Forb.card < M := by have hcu : Forb.card ≤ F1u.card + F1v.card + F2.card + F3.card + F4.card := by have h1 := Finset.card_union_le (F1u ∪ F1v ∪ F2 ∪ F3) F4 have h2 := Finset.card_union_le (F1u ∪ F1v ∪ F2) F3 have h3 := Finset.card_union_le (F1u ∪ F1v) F2 have h4 := Finset.card_union_le F1u F1v dsimp only [Forb] omega have hbound : (Δ - 1) + backVltU.card + backVltU.card * (Δ - 1) + backU.card * (Δ - 1) + backVltU.card * (k - 1) ≤ (Δ - 1) + (k - 1) + (k - 1) * (Δ - 1) + k * (Δ - 1) + (k - 1) * (k - 1) := by have hm1 := Nat.mul_le_mul_right (Δ - 1) hbackVltU_card have hm2 := Nat.mul_le_mul_right (Δ - 1) hbackU_card have hm3 := Nat.mul_le_mul_right (k - 1) hbackVltU_card omega have hfinal : (Δ - 1) + (k - 1) + (k - 1) * (Δ - 1) + k * (Δ - 1) + (k - 1) * (k - 1) < M := by dsimp only [M] zify [hΔpos, hk, show 3 * k ≤ 2 * k * Δ + k * k + 1 by nlinarith] nlinarith omega -- Pick a valid color `colStar ∈ L eStar \ Forb`! have havail : (L eStar \ Forb).Nonempty := by have h1 : (L eStar).card - Forb.card ≤ (L eStar \ Forb).card := Finset.le_card_sdiff Forb (L eStar) have h2 : M ≤ (L eStar).card := hL (ord u) (ord v) hadj_uv exact Finset.card_pos.1 (by omega) obtain ⟨colStar, hcolStar⟩ := havail have hcolStar_L : colStar ∈ L eStar := (Finset.mem_sdiff.1 hcolStar).1 have hcolStar_notForb : colStar ∉ Forb := (Finset.mem_sdiff.1 hcolStar).2 have hnotF1u : colStar ∉ F1u := fun h => hcolStar_notForb (Finset.mem_union_left _ (Finset.mem_union_left _ (Finset.mem_union_left _ (Finset.mem_union_left _ h)))) have hnotF1v : colStar ∉ F1v := fun h => hcolStar_notForb (Finset.mem_union_left _ (Finset.mem_union_left _ (Finset.mem_union_left _ (Finset.mem_union_right _ h)))) have hnotF2 : colStar ∉ F2 := fun h => hcolStar_notForb (Finset.mem_union_left _ (Finset.mem_union_left _ (Finset.mem_union_right _ h))) have hnotF3 : colStar ∉ F3 := fun h => hcolStar_notForb (Finset.mem_union_left _ (Finset.mem_union_right _ h)) have hnotF4 : colStar ∉ F4 := fun h => hcolStar_notForb (Finset.mem_union_right _ h) -- Update coloring `c'` at `eStar` let c' : Sym2 V → α := fun e => if e = eStar then colStar else c e have hc'_old : ∀ e ∈ Done t, c' e = c e := by intro e he dsimp only [c'] rw [if_neg] intro h; subst h; exact heStar_notDone he have hc'_star : c' eStar = colStar := if_pos rfl refine ⟨c', ?_, ?_, ?_, ?_⟩ · -- Verify Inv 1 (list membership) intro e he rcases (hDone_succ e).1 he with rfl | heOld · rw [hc'_star]; exact hcolStar_L · rw [hc'_old e heOld]; exact hInv1 e heOld · -- Verify Inv 2 (properness on `Done (t + 1)`) intro x y₁ y₂ h1 h2 hne rcases (hDone_succ _).1 h1 with he1 | he1 <;> rcases (hDone_succ _).1 h2 with he2 | he2 · -- Both are `eStar`: impossible since `y₁ ≠ y₂` have hxy : s(x, y₁) = s(x, y₂) := he1.trans he2.symm rcases Sym2.eq_iff.1 hxy with ⟨_, rfl⟩ | ⟨rfl, rfl⟩ · exact absurd rfl hne · exact absurd rfl hne · -- `s(x, y₁) = eStar`, `s(x, y₂) ∈ Done t` rw [he1, hc'_star, hc'_old _ he2] rcases Sym2.eq_iff.1 he1 with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ · intro heq exact hnotF1u (heq ▸ Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨he2, Sym2.mem_mk_left _ _⟩)) · intro heq exact hnotF1v (heq ▸ Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨he2, Sym2.mem_mk_left _ _⟩)) · -- `s(x, y₁) ∈ Done t`, `s(x, y₂) = eStar` rw [he2, hc'_star, hc'_old _ he1] rcases Sym2.eq_iff.1 he2 with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ · intro heq exact hnotF1u (heq.symm ▸ Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨he1, Sym2.mem_mk_left _ _⟩)) · intro heq exact hnotF1v (heq.symm ▸ Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨he1, Sym2.mem_mk_left _ _⟩)) · -- Both in `Done t` rw [hc'_old _ he1, hc'_old _ he2] exact hInv2 x y₁ y₂ he1 he2 hne · -- Verify Inv 3 (Rule 2 backward-neighbor avoidance) intro u' v' w' z' huv' hw'u' h1 hadj_vw' h2 hzv' rcases (hDone_succ _).1 h1 with he1 | he1 · -- `s(ord u', ord v') = eStar` → `u' = u, v' = v` have hu' : u' = u := by rcases Sym2.eq_iff.1 he1 with ⟨h1', _⟩ | ⟨h1', h2'⟩ · exact ord.injective h1' · exfalso; have h1'' := ord.injective h1'; have h2'' := ord.injective h2'; omega have hv' : v' = v := by rcases Sym2.eq_iff.1 he1 with ⟨_, h2'⟩ | ⟨h1', h2'⟩ · exact ord.injective h2' · exfalso; have h1'' := ord.injective h1'; have h2'' := ord.injective h2'; omega subst u'; subst v' have h2old : s(ord w', ord z') ∈ Done t := by rcases (hDone_succ _).1 h2 with h2s | h2o · exfalso have hlt : edgeKey ord s(ord w', ord z') < edgeKey ord s(ord u, ord v) := by apply edgeKey_lt_of_min_lt ord have hmin_uv : min u.val v.val = u.val := min_eq_left (Nat.le_of_lt huv) rw [hmin_uv] exact lt_of_le_of_lt (min_le_left _ _) hw'u' rw [h2s] at hlt exact lt_irrefl _ hlt · exact h2o rw [he1, hc'_star, hc'_old _ h2old] intro heq have hw'_mem : w' ∈ backVltU := Finset.mem_filter.2 ⟨Finset.mem_univ _, hw'u', hadj_vw'⟩ have hne_e : s(ord w', ord z') ≠ s(ord w', ord v) := by intro h rcases Sym2.eq_iff.1 h with ⟨_, hzv⟩ | ⟨hwv, _⟩ · exact hzv' (ord.injective hzv) · have := ord.injective hwv; omega have hmemF2 : c s(ord w', ord z') ∈ F2 := Finset.mem_biUnion.2 ⟨w', hw'_mem, Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨h2old, Sym2.mem_mk_left _ _, hne_e⟩)⟩ exact hnotF2 (heq ▸ hmemF2) · -- `s(ord u', ord v') ∈ Done t` have h2old : s(ord w', ord z') ∈ Done t := by rcases (hDone_succ _).1 h2 with h2s | h2o · exfalso have hlt1 : edgeKey ord s(ord w', ord z') < edgeKey ord s(ord u', ord v') := by apply edgeKey_lt_of_min_lt ord rw [min_eq_left (Nat.le_of_lt huv')] exact lt_of_le_of_lt (min_le_left _ _) hw'u' have hlt2 : edgeKey ord s(ord u', ord v') < t := (Finset.mem_filter.1 he1).2 rw [h2s, heStar_key] at hlt1 omega · exact h2o rw [hc'_old _ he1, hc'_old _ h2old] exact hInv3 u' v' w' z' huv' hw'u' he1 hadj_vw' h2old hzv' · -- Verify Inv 4 (no bichromatic 4-edge trail in `Done (t + 1)`) -- Helper lemma for the TWO canonical positions where `eStar` is edge 1 or edge 2! have hcase_end : ∀ a₁ a₂ a₃ a₄ : V, s(a₁, a₂) ∈ Done t → s(a₂, a₃) ∈ Done t → s(a₃, a₄) ∈ Done t → (a₁ = ord u ∧ a₂ ≠ ord v ∨ a₁ = ord v ∧ a₂ ≠ ord u) → a₁ ≠ a₃ → a₂ ≠ a₄ → s(a₁, a₂) ≠ s(a₃, a₄) → ¬(colStar = c s(a₂, a₃) ∧ c s(a₁, a₂) = c s(a₃, a₄)) := by intro a₁ a₂ a₃ a₄ he2 he3 he4 hor hne13 hne24 hne2_4 ⟨hcol_eq, hα_eq⟩ rcases hor with ⟨rfl, ha2_nev⟩ | ⟨rfl, ha2_neu⟩ · -- `eStar = s(ord v, ord u)`, `e₂ = s(ord u, a₂)` let w₁ := ord.symm a₂ have hw₁ : ord w₁ = a₂ := Equiv.apply_symm_apply ord a₂ have hw₁_ne_u : w₁ ≠ u := fun h => by have hadj := SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 he2).1 exact G.ne_of_adj hadj (by rw [← hw₁, h]) rcases lt_or_gt_of_ne hw₁_ne_u with hw₁_lt | hw₁_gt · -- Subcase IIb: `w₁ < u` → `c s(a₂, a₃) ∈ F3`! have hadj_uw1 : G.Adj (ord u) (ord w₁) := by rw [hw₁]; exact SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 he2).1 have hw1_mem : w₁ ∈ backU := Finset.mem_filter.2 ⟨Finset.mem_univ _, hw₁_lt, hadj_uw1⟩ have hne_e3 : s(a₂, a₃) ≠ s(ord w₁, ord u) := by intro h rw [← hw₁] at h rcases Sym2.eq_iff.1 h with ⟨_, h3u⟩ | ⟨hwu, _⟩ · exact hne13 h3u.symm · exact hw₁_ne_u (ord.injective hwu) have hmemF3 : c s(a₂, a₃) ∈ F3 := Finset.mem_biUnion.2 ⟨w₁, hw1_mem, Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨he3, hw₁ ▸ Sym2.mem_mk_left _ _, hne_e3⟩)⟩ exact hnotF3 (hcol_eq ▸ hmemF3) · -- Subcase IIc: `u < w₁` → `w₂ < u` and Rule 2 Inv 3 at `s(ord u, ord w₁)` contradicts `hα_eq`! let w₂ := ord.symm a₃ have hw₂ : ord w₂ = a₃ := Equiv.apply_symm_apply ord a₃ have hw2_ne_u : w₂ ≠ u := fun h => hne13 (by rw [← hw₂, h]) have hkey3 : edgeKey ord s(ord w₂, ord w₁) < u.val * n + v.val := by rw [hkey_uv, Sym2.eq_swap, hw₁, hw₂] exact (Finset.mem_filter.1 he3).2 have hw2_lt_u : w₂ < u := lt_of_edgeKey_lt_and_gt ord huv hw₁_gt hw2_ne_u hkey3 have hadj_w1w2 : G.Adj (ord w₁) (ord w₂) := by rw [hw₁, hw₂]; exact SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 he3).1 let w₃ := ord.symm a₄ have hw₃ : ord w₃ = a₄ := Equiv.apply_symm_apply ord a₄ have hw3_ne_w1 : w₃ ≠ w₁ := fun h => hne24 (by rw [← hw₁, ← hw₃, h]) have hinv3_app := hInv3 u w₁ w₂ w₃ hw₁_gt hw2_lt_u (hw₁ ▸ he2) hadj_w1w2 (by rwa [hw₂, hw₃]) hw3_ne_w1 rw [hw₁, hw₂, hw₃] at hinv3_app exact hinv3_app hα_eq · -- Subcase IIa: `eStar = s(ord u, ord v)`, `e₂ = s(ord v, a₂)` → `w₃ < u` and `c s(a₂, a₃) ∈ F2`! let w₃ := ord.symm a₂ have hw₃ : ord w₃ = a₂ := Equiv.apply_symm_apply ord a₂ have hw3_ne_u : w₃ ≠ u := fun h => ha2_neu (by rw [← hw₃, h]) have hkey2 : edgeKey ord s(ord w₃, ord v) < u.val * n + v.val := by rw [hkey_uv, Sym2.eq_swap, hw₃] exact (Finset.mem_filter.1 he2).2 have hw3_lt_u : w₃ < u := lt_of_edgeKey_lt_and_gt ord huv huv hw3_ne_u hkey2 have hadj_vw3 : G.Adj (ord v) (ord w₃) := by rw [hw₃]; exact SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 he2).1 have hw3_mem : w₃ ∈ backVltU := Finset.mem_filter.2 ⟨Finset.mem_univ _, hw3_lt_u, hadj_vw3⟩ have hne_e3 : s(a₂, a₃) ≠ s(ord w₃, ord v) := by intro h rw [← hw₃] at h rcases Sym2.eq_iff.1 h with ⟨_, h3v⟩ | ⟨hwv, _⟩ · exact hne13 h3v.symm · have := ord.injective hwv; omega have hmemF2 : c s(a₂, a₃) ∈ F2 := Finset.mem_biUnion.2 ⟨w₃, hw3_mem, Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨he3, hw₃ ▸ Sym2.mem_mk_left _ _, hne_e3⟩)⟩ exact hnotF2 (hcol_eq ▸ hmemF2) have hcase_mid : ∀ a₀ a₁ a₂ a₃ a₄ : V, s(a₀, a₁) ∈ Done t → s(a₁, a₂) = eStar → s(a₂, a₃) ∈ Done t → s(a₃, a₄) ∈ Done t → a₀ ≠ a₂ → a₁ ≠ a₃ → a₂ ≠ a₄ → ¬(c s(a₀, a₁) = c s(a₂, a₃) ∧ colStar = c s(a₃, a₄)) := by intro a₀ a₁ a₂ a₃ a₄ he1 he2_star he3 he4 h02 h13 h24 ⟨hα_eq, hβ_eq⟩ rcases Sym2.eq_iff.1 he2_star with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ · -- `a₁ = ord u, a₂ = ord v`: `e₃ = s(ord v, a₃)` has `w₃ < u`, so `e₄` at `a₃` is in `F2`! let w₃ := ord.symm a₃ have hw₃ : ord w₃ = a₃ := Equiv.apply_symm_apply ord a₃ have hw3_ne_u : w₃ ≠ u := fun h => h13 (by rw [← hw₃, h]) have hkey3 : edgeKey ord s(ord w₃, ord v) < u.val * n + v.val := by rw [hkey_uv, Sym2.eq_swap, hw₃] exact (Finset.mem_filter.1 he3).2 have hw3_lt_u : w₃ < u := lt_of_edgeKey_lt_and_gt ord huv huv hw3_ne_u hkey3 have hadj_vw3 : G.Adj (ord v) (ord w₃) := by rw [hw₃]; exact SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 he3).1 have hw3_mem : w₃ ∈ backVltU := Finset.mem_filter.2 ⟨Finset.mem_univ _, hw3_lt_u, hadj_vw3⟩ have hne_e4 : s(a₃, a₄) ≠ s(ord w₃, ord v) := by intro h rw [← hw₃] at h rcases Sym2.eq_iff.1 h with ⟨_, h4v⟩ | ⟨hwv, _⟩ · exact h24 h4v.symm · have := ord.injective hwv; omega have hmemF2 : c s(a₃, a₄) ∈ F2 := Finset.mem_biUnion.2 ⟨w₃, hw3_mem, Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨he4, hw₃ ▸ Sym2.mem_mk_left _ _, hne_e4⟩)⟩ exact hnotF2 (hβ_eq ▸ hmemF2) · -- `a₁ = ord v, a₂ = ord u`: `e₁ = s(a₀, ord v)` gives `α ∈ F1v`; `e₃ = s(ord u, a₃)`! have hα_F1v : c s(ord u, a₃) ∈ F1v := by rw [← hα_eq] exact Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨he1, Sym2.mem_mk_right _ _⟩) let w₁ := ord.symm a₃ have hw₁ : ord w₁ = a₃ := Equiv.apply_symm_apply ord a₃ have hw1_ne_u : w₁ ≠ u := fun h => by have hadj := SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 he3).1 exact G.ne_of_adj hadj (by rw [← hw₁, h]) rcases lt_or_gt_of_ne hw1_ne_u with hw1_lt | hw1_gt · -- `w₁ < u` → `c s(a₃, a₄) ∈ F3`! have hadj_uw1 : G.Adj (ord u) (ord w₁) := by rw [hw₁]; exact SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 he3).1 have hw1_mem : w₁ ∈ backU := Finset.mem_filter.2 ⟨Finset.mem_univ _, hw1_lt, hadj_uw1⟩ have hne_e4 : s(a₃, a₄) ≠ s(ord w₁, ord u) := by intro h rw [← hw₁] at h rcases Sym2.eq_iff.1 h with ⟨_, h4u⟩ | ⟨hwu, _⟩ · exact h24 h4u.symm · exact hw1_ne_u (ord.injective hwu) have hmemF3 : c s(a₃, a₄) ∈ F3 := Finset.mem_biUnion.2 ⟨w₁, hw1_mem, Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨he4, hw₁ ▸ Sym2.mem_mk_left _ _, hne_e4⟩)⟩ exact hnotF3 (hβ_eq ▸ hmemF3) · -- `u < w₁` → `w₁ ∈ matchW1`, `w₂ = ord.symm a₄ < u`, so `c s(a₃, a₄) ∈ F4`! have hw1_match : w₁ ∈ matchW1 := Finset.mem_filter.2 ⟨Finset.mem_univ _, hw1_gt, hw₁ ▸ he3, hw₁ ▸ hα_F1v⟩ let w₂ := ord.symm a₄ have hw₂ : ord w₂ = a₄ := Equiv.apply_symm_apply ord a₄ have hw2_ne_u : w₂ ≠ u := fun h => h24 (by rw [← hw₂, h]) have hkey4 : edgeKey ord s(ord w₂, ord w₁) < u.val * n + v.val := by rw [hkey_uv, Sym2.eq_swap, hw₁, hw₂] exact (Finset.mem_filter.1 he4).2 have hw2_lt_u : w₂ < u := lt_of_edgeKey_lt_and_gt ord huv hw1_gt hw2_ne_u hkey4 have hadj_w1w2 : G.Adj (ord w₁) (ord w₂) := by rw [hw₁, hw₂]; exact SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 he4).1 have hmemF4 : c s(a₃, a₄) ∈ F4 := by have hswap : c s(a₃, a₄) = c s(ord w₂, ord w₁) := by rw [← hw₁, ← hw₂, Sym2.eq_swap] rw [hswap] exact Finset.mem_biUnion.2 ⟨w₁, hw1_match, Finset.mem_image_of_mem (fun w₂ => c s(ord w₂, ord w₁)) (Finset.mem_filter.2 ⟨Finset.mem_univ _, hw2_lt_u, hadj_w1w2⟩)⟩ exact hnotF4 (hβ_eq ▸ hmemF4) -- Now discharge all 4 edges of the trail `v₀ - v₁ - v₂ - v₃ - v₄`! intro v₀ v₁ v₂ v₃ v₄ h1 h2 h3 h4 h02 h13 h24 he13 he24 ⟨hc13, hc24⟩ have he12 : s(v₀, v₁) ≠ s(v₁, v₂) := fun h => by rcases Sym2.eq_iff.1 h with ⟨rfl, _⟩ | ⟨rfl, _⟩ · exact G.ne_of_adj (SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 h1).1) rfl · exact h02 rfl have he23 : s(v₁, v₂) ≠ s(v₂, v₃) := fun h => by rcases Sym2.eq_iff.1 h with ⟨rfl, _⟩ | ⟨rfl, _⟩ · exact G.ne_of_adj (SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 h2).1) rfl · exact h13 rfl have he34 : s(v₂, v₃) ≠ s(v₃, v₄) := fun h => by rcases Sym2.eq_iff.1 h with ⟨rfl, _⟩ | ⟨rfl, _⟩ · exact G.ne_of_adj (SimpleGraph.mem_edgeFinset.1 (Finset.mem_filter.1 h3).1) rfl · exact h24 rfl have he14 : s(v₀, v₁) ≠ s(v₃, v₄) := by intro heq -- If `e₁ = e₄`, then `c' e₁ = c' e₄ = c' e₂`, contradicting properness at `v₁`! have hc12 : c' s(v₀, v₁) = c' s(v₁, v₂) := by rw [heq, hc24] -- Wait: `e₁` and `e₂` share `v₁` and `v₀ ≠ v₂` — use the already-proved Inv 2 on `c'`? -- Actually even simpler: we check `s(v₀, v₁) = eStar ∨ s(v₁, v₂) = eStar ∨ s(v₂, v₃) = eStar ∨ s(v₃, v₄) = eStar` -- and `e₁ = e₄` only could interfere if BOTH `e₁ = eStar` and `e₄ = eStar`! -- Handle `e₁ = e₄` directly: `c' e₁ = c' e₄ = c' e₂`, wait: if `e₁ = eStar`, `e₂ ∈ Done t`, so `colStar = c e₂ ∈ F1u ∪ F1v`! rcases (hDone_succ _).1 h1 with h1s | h1o · have h2o : s(v₁, v₂) ∈ Done t := ((hDone_succ _).1 h2).resolve_left (fun h => he12 (h1s.trans h.symm)) rw [h1s, hc'_star, hc'_old _ h2o] at hc12 rcases Sym2.eq_iff.1 h1s with ⟨_, rfl⟩ | ⟨_, rfl⟩ · exact hnotF1v (hc12 ▸ Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨h2o, Sym2.mem_mk_left _ _⟩)) · exact hnotF1u (hc12 ▸ Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨h2o, Sym2.mem_mk_left _ _⟩)) · rcases (hDone_succ _).1 h2 with h2s | h2o · rw [hc'_old _ h1o, h2s, hc'_star] at hc12 rcases Sym2.eq_iff.1 h2s with ⟨rfl, _⟩ | ⟨rfl, _⟩ · exact hnotF1u (hc12.symm ▸ Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨h1o, Sym2.mem_mk_right _ _⟩)) · exact hnotF1v (hc12.symm ▸ Finset.mem_image_of_mem c (Finset.mem_filter.2 ⟨h1o, Sym2.mem_mk_right _ _⟩)) · rw [hc'_old _ h1o, hc'_old _ h2o] at hc12 exact hInv2 v₁ v₀ v₂ (Sym2.eq_swap ▸ h1o) h2o h02 (by simpa [Sym2.eq_swap] using hc12) rcases (hDone_succ _).1 h1 with h1s | h1o · have h2o : s(v₁, v₂) ∈ Done t := ((hDone_succ _).1 h2).resolve_left (fun h => he12 (h1s.trans h.symm)) have h3o : s(v₂, v₃) ∈ Done t := ((hDone_succ _).1 h3).resolve_left (fun h => he13 (h1s.trans h.symm)) have h4o : s(v₃, v₄) ∈ Done t := ((hDone_succ _).1 h4).resolve_left (fun h => he14 (h1s.trans h.symm)) rw [h1s, hc'_star, hc'_old _ h3o] at hc13 rw [hc'_old _ h2o, hc'_old _ h4o] at hc24 have hor : v₁ = ord u ∧ v₂ ≠ ord v ∨ v₁ = ord v ∧ v₂ ≠ ord u := by rcases Sym2.eq_iff.1 h1s with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ · exact Or.inr ⟨rfl, h02.symm⟩ · exact Or.inl ⟨rfl, h02.symm⟩ exact hcase_end v₁ v₂ v₃ v₄ h2o h3o h4o hor h13 h24 he24 ⟨hc13, hc24⟩ · rcases (hDone_succ _).1 h2 with h2s | h2o · have h3o : s(v₂, v₃) ∈ Done t := ((hDone_succ _).1 h3).resolve_left (fun h => he23 (h2s.trans h.symm)) have h4o : s(v₃, v₄) ∈ Done t := ((hDone_succ _).1 h4).resolve_left (fun h => he24 (h2s.trans h.symm)) rw [hc'_old _ h1o, hc'_old _ h3o] at hc13 rw [h2s, hc'_star, hc'_old _ h4o] at hc24 exact hcase_mid v₀ v₁ v₂ v₃ v₄ h1o h2s h3o h4o h02 h13 h24 ⟨hc13, hc24⟩ · rcases (hDone_succ _).1 h3 with h3s | h3o · -- Reverse trail `v₄ - v₃ - v₂ - v₁ - v₀` so `eStar` is edge 2! have h4o : s(v₃, v₄) ∈ Done t := ((hDone_succ _).1 h4).resolve_left (fun h => he34 (h3s.trans h.symm)) rw [hc'_old _ h1o, h3s, hc'_star] at hc13 rw [hc'_old _ h2o, hc'_old _ h4o] at hc24 exact hcase_mid v₄ v₃ v₂ v₁ v₀ (Sym2.eq_swap ▸ h4o) (Sym2.eq_swap.trans h3s) (Sym2.eq_swap ▸ h2o) (Sym2.eq_swap ▸ h1o) h24.symm h13.symm h02.symm ⟨by simpa [Sym2.eq_swap] using hc24.symm, by simpa [Sym2.eq_swap] using hc13.symm⟩ · rcases (hDone_succ _).1 h4 with h4s | h4o · -- Reverse trail `v₄ - v₃ - v₂ - v₁ - v₀` so `eStar` is edge 1! rw [hc'_old _ h1o, hc'_old _ h3o] at hc13 rw [hc'_old _ h2o, h4s, hc'_star] at hc24 have hor : v₃ = ord u ∧ v₂ ≠ ord v ∨ v₃ = ord v ∧ v₂ ≠ ord u := by rcases Sym2.eq_iff.1 h4s with ⟨rfl, rfl⟩ | ⟨rfl, rfl⟩ · exact Or.inl ⟨rfl, h24⟩ · exact Or.inr ⟨rfl, h24⟩ exact hcase_end v₃ v₂ v₁ v₀ (Sym2.eq_swap ▸ h3o) (Sym2.eq_swap ▸ h2o) (Sym2.eq_swap ▸ h1o) hor h13.symm h02.symm (by simpa [Sym2.eq_swap] using he13.symm) ⟨by simpa [Sym2.eq_swap] using hc24.symm, by simpa [Sym2.eq_swap] using hc13.symm⟩ · -- All 4 edges in `Done t`: apply IH! rw [hc'_old _ h1o, hc'_old _ h3o] at hc13 rw [hc'_old _ h2o, hc'_old _ h4o] at hc24 exact hInv4 v₀ v₁ v₂ v₃ v₄ h1o h2o h3o h4o h02 h13 h24 he13 he24 ⟨hc13, hc24⟩ · -- No edge has `edgeKey ord e = t`, so `Done (t + 1) = Done t`! have hDone_eq : Done (t + 1) = Done t := by ext e simp only [Done, Finset.mem_filter] constructor · rintro ⟨heG, hlt⟩ refine ⟨heG, ?_⟩ by_contra hge have heq : edgeKey ord e = t := by omega induction e using Sym2.ind with | _ x y => have hadj : G.Adj x y := SimpleGraph.mem_edgeFinset.1 heG have hne : ord.symm x ≠ ord.symm y := fun h => G.ne_of_adj hadj (ord.symm.injective h) rcases lt_or_gt_of_ne hne with hxy | hyx · refine hstep ⟨ord.symm x, ord.symm y, hxy, by simpa using hadj, ?_⟩ have h1 := edgeKey_ord_of_lt ord hxy simp only [Equiv.apply_symm_apply] at h1 exact h1.symm.trans heq · refine hstep ⟨ord.symm y, ord.symm x, hyx, by simpa using hadj.symm, ?_⟩ have h1 := edgeKey_ord_of_lt ord hyx simp only [Equiv.apply_symm_apply] at h1 rw [Sym2.eq_swap] at h1 exact h1.symm.trans heq · rintro ⟨heG, hlt⟩ exact ⟨heG, by omega⟩ rw [hDone_eq] exact ⟨c, hInv1, hInv2, hInv3, hInv4⟩ -- Apply at `t = n * n`: every edge of `G` belongs to `Done (n * n)`! obtain ⟨c, hInv1, hInv2, _, hInv4⟩ := hbuild (n * n) have hall : ∀ x y : V, G.Adj x y → s(x, y) ∈ Done (n * n) := fun x y hxy => Finset.mem_filter.2 ⟨SimpleGraph.mem_edgeFinset.2 hxy, edgeKey_lt_sq ord x y⟩ refine ⟨c, fun x y hxy => hInv1 _ (hall x y hxy), ?_, ?_⟩ · intro x y₁ y₂ h1 h2 hne exact hInv2 x y₁ y₂ (hall x y₁ h1) (hall x y₂ h2) hne · intro v₀ v₁ v₂ v₃ v₄ h01 h12 h23 h34 h02 h13 h24 he13 he24 exact hInv4 v₀ v₁ v₂ v₃ v₄ (hall _ _ h01) (hall _ _ h12) (hall _ _ h23) (hall _ _ h34) h02 h13 h24 he13 he24 · -- No edges in `G`: any constant function is vacuously a valid list star edge coloring! push Not at hedge obtain ⟨a₀⟩ := hneα refine ⟨fun _ => a₀, fun u v huv => (hedge u v huv).elim, fun u v₁ _ h1 => (hedge u v₁ h1).elim, fun v₀ v₁ _ _ _ h01 => (hedge v₀ v₁ h01).elim⟩ end MainTheorem /-! ## Section 4: Strict Improvements over Both 2019 World Records & Structural Corollaries -/ section Corollaries /-- Non-list star chromatic index bound for `k`-degenerate graphs (`k ≥ 1`, `Δ ≥ 1`): `χ'_{st}(G) ≤ 2kΔ + k² - 3k + 1`. -/ theorem star_edge_coloring_of_degenerate {V : Type*} [Fintype V] (G : SimpleGraph V) {k : ℕ} (hk : 1 ≤ k) (hΔ : 1 ≤ maxDeg G) (hdeg : IsDegenerate G k) : IsStarEdgeColorable G (2 * k * maxDeg G + k * k + 1 - 3 * k) := by have hpos : 1 ≤ 2 * k * maxDeg G + k * k + 1 - 3 * k := by have : 2 * k * 1 ≤ 2 * k * maxDeg G := Nat.mul_le_mul_left (2 * k) hΔ have : k ≤ k * k := Nat.le_mul_self k omega exact (list_star_edge_coloring_of_degenerate G hk hdeg).isStarEdgeColorable hpos /-- List acyclic edge coloring bound for `k`-degenerate graphs (`k ≥ 1`): `a'_ℓ(G) ≤ 2kΔ + k² - 3k + 1`. -/ theorem list_acyclic_edge_coloring_of_degenerate {V : Type*} [Fintype V] (G : SimpleGraph V) {k : ℕ} (hk : 1 ≤ k) (hdeg : IsDegenerate G k) : IsListAcyclicEdgeColorable G (2 * k * maxDeg G + k * k + 1 - 3 * k) := (list_star_edge_coloring_of_degenerate G hk hdeg).isListAcyclicEdgeColorable /-- Arithmetic comparison vs Kerdjoudj & Raspaud (2019) `(3k - 2)Δ - k² + 2`: for every `k ≥ 3` and `Δ ≥ 2k + 3`, our bound strictly beats `(3k - 2)Δ - k² + 2`. -/ lemma bound_lt_kerdjoudj_raspaud {k Δ : ℕ} (hk : 3 ≤ k) (hΔ : 2 * k + 3 ≤ Δ) : 2 * k * Δ + k * k + 1 - 3 * k < (3 * k - 2) * Δ + 2 - k * k := by have h1 : 3 * k ≤ 2 * k * Δ + k * k + 1 := by nlinarith have h2 : k * k ≤ (3 * k - 2) * Δ + 2 := by have : 3 * k - 2 ≥ k := by omega nlinarith zify [h1, h2, show 2 ≤ 3 * k by omega] nlinarith /-- **Strict World-Record Improvement over Kerdjoudj & Raspaud (2019)**: For every `k ≥ 3` and every finite `k`-degenerate graph `G` with `Δ ≥ 2k + 3`, `G` is list star edge colorable with strictly fewer than `(3k - 2)Δ - k² + 2` colors (specifically, at most `(3k - 2)Δ - k² + 1`, and in fact `2kΔ + k² - 3k + 1`). -/ theorem list_star_edge_coloring_beats_kerdjoudj_raspaud {V : Type*} [Fintype V] (G : SimpleGraph V) {k : ℕ} (hk : 3 ≤ k) (hΔ : 2 * k + 3 ≤ maxDeg G) (hdeg : IsDegenerate G k) : IsListStarEdgeColorable G ((3 * k - 2) * maxDeg G + 1 - k * k) := by have hlt := bound_lt_kerdjoudj_raspaud hk hΔ have hle : 2 * k * maxDeg G + k * k + 1 - 3 * k ≤ (3 * k - 2) * maxDeg G + 1 - k * k := by have h2 : k * k ≤ (3 * k - 2) * maxDeg G + 1 := by have : 3 * k - 2 ≥ k := by omega nlinarith omega exact (list_star_edge_coloring_of_degenerate G (by omega) hdeg).mono hle /-- Arithmetic comparison vs Han, Li, Luo & Miao (2019) `⌊(5k - 1)Δ / 2⌋`: for `k = 2, Δ ≥ 1` and for all `k ≥ 3, Δ ≥ 2k - 2`, our bound strictly beats `⌊(5k - 1)Δ / 2⌋`. -/ lemma bound_lt_han_li_luo_miao {k Δ : ℕ} (hcond : (k = 2 ∧ 1 ≤ Δ) ∨ (3 ≤ k ∧ 2 * k - 2 ≤ Δ)) : 2 * k * Δ + k * k + 1 - 3 * k < (5 * k - 1) * Δ / 2 := by rcases hcond with ⟨rfl, hΔ⟩ | ⟨hk, hΔ⟩ · omega · have h1 : 3 * k ≤ 2 * k * Δ + k * k + 1 := by nlinarith have h2 : 2 * (2 * k * Δ + k * k + 1 - 3 * k) + 1 < (5 * k - 1) * Δ := by have hΔ' : 2 * k ≤ Δ + 2 := by omega zify [h1, show 1 ≤ 5 * k by omega] at hΔ' ⊢ nlinarith omega /-- **Strict World-Record Improvement over Han, Li, Luo & Miao (2019)**: For `k = 2, Δ ≥ 1` and for all `k ≥ 3, Δ ≥ 2k - 2`, every finite `k`-degenerate graph `G` is list star edge colorable with strictly fewer than `⌊(5k - 1)Δ / 2⌋` colors. -/ theorem list_star_edge_coloring_beats_han_li_luo_miao {V : Type*} [Fintype V] (G : SimpleGraph V) {k : ℕ} (hcond : (k = 2 ∧ 1 ≤ maxDeg G) ∨ (3 ≤ k ∧ 2 * k - 2 ≤ maxDeg G)) (hdeg : IsDegenerate G k) : IsListStarEdgeColorable G ((5 * k - 1) * maxDeg G / 2 - 1) := by have hk : 1 ≤ k := by rcases hcond with ⟨rfl, _⟩ | ⟨hk, _⟩ <;> omega have hlt := bound_lt_han_li_luo_miao hcond exact (list_star_edge_coloring_of_degenerate G hk hdeg).mono (by omega) /-- Concrete world-record instantiations for `k = 2, 3, 4, 5, 10`. -/ theorem list_star_edge_coloring_k2 {V : Type*} [Fintype V] (G : SimpleGraph V) (hdeg : IsDegenerate G 2) : IsListStarEdgeColorable G (4 * maxDeg G - 1) := by have h := list_star_edge_coloring_of_degenerate G (k := 2) (by omega) hdeg exact h.mono (by omega) theorem list_star_edge_coloring_k3 {V : Type*} [Fintype V] (G : SimpleGraph V) (hdeg : IsDegenerate G 3) : IsListStarEdgeColorable G (6 * maxDeg G + 1) := by have h := list_star_edge_coloring_of_degenerate G (k := 3) (by omega) hdeg exact h.mono (by omega) theorem list_star_edge_coloring_k4 {V : Type*} [Fintype V] (G : SimpleGraph V) (hdeg : IsDegenerate G 4) : IsListStarEdgeColorable G (8 * maxDeg G + 5) := by have h := list_star_edge_coloring_of_degenerate G (k := 4) (by omega) hdeg exact h.mono (by omega) theorem list_star_edge_coloring_k5 {V : Type*} [Fintype V] (G : SimpleGraph V) (hdeg : IsDegenerate G 5) : IsListStarEdgeColorable G (10 * maxDeg G + 11) := by have h := list_star_edge_coloring_of_degenerate G (k := 5) (by omega) hdeg exact h.mono (by omega) theorem list_star_edge_coloring_k10 {V : Type*} [Fintype V] (G : SimpleGraph V) (hdeg : IsDegenerate G 10) : IsListStarEdgeColorable G (20 * maxDeg G + 71) := by have h := list_star_edge_coloring_of_degenerate G (k := 10) (by omega) hdeg exact h.mono (by omega) end Corollaries end DegenerateListStarEdgeColoring /-! ## Axiom Verification -/ #print axioms DegenerateListStarEdgeColoring.isStarEdgeColoring_iff_no_P4_no_C4 #print axioms DegenerateListStarEdgeColoring.isAcyclicEdgeColoring_of_isStarEdgeColoring #print axioms DegenerateListStarEdgeColoring.star_edge_coloring_lower_bound_maxDeg #print axioms DegenerateListStarEdgeColoring.list_star_edge_coloring_of_degenerate #print axioms DegenerateListStarEdgeColoring.star_edge_coloring_of_degenerate #print axioms DegenerateListStarEdgeColoring.list_acyclic_edge_coloring_of_degenerate #print axioms DegenerateListStarEdgeColoring.list_star_edge_coloring_beats_kerdjoudj_raspaud #print axioms DegenerateListStarEdgeColoring.list_star_edge_coloring_beats_han_li_luo_miao #print axioms DegenerateListStarEdgeColoring.list_star_edge_coloring_k2 #print axioms DegenerateListStarEdgeColoring.list_star_edge_coloring_k3 #print axioms DegenerateListStarEdgeColoring.list_star_edge_coloring_k4 #print axioms DegenerateListStarEdgeColoring.list_star_edge_coloring_k5 #print axioms DegenerateListStarEdgeColoring.list_star_edge_coloring_k10