Skip to content

Commit a4bb4e5

Browse files
committed
feat(SimpleGraph): only the complete graph has chromatic number equal to its cardinality (#30053)
Prove that only the (finite) complete graph has chromatic number equal to its cardinality, thereby finishing an iff fully characterizing graphs with chromatic number equal to their cardinality. - [ ] depends on: #30136 - [ ] depends on: #30137
1 parent 46cbccc commit a4bb4e5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Mathlib/Combinatorics/SimpleGraph/Coloring.lean

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,27 @@ theorem chromaticNumber_top_eq_top_of_infinite (V : Type*) [Infinite V] :
426426
obtain ⟨n, ⟨hn⟩⟩ := hc
427427
exact not_injective_infinite_finite _ hn.injective_of_top_hom
428428

429+
theorem eq_top_of_chromaticNumber_eq_card [DecidableEq V] [Fintype V]
430+
(h : G.chromaticNumber = Fintype.card V) : G = ⊤ := by
431+
by_contra! hh
432+
have : G.chromaticNumber ≤ Fintype.card V - 1 := by
433+
obtain ⟨a, b, hne, _⟩ := ne_top_iff_exists_not_adj.mp hh
434+
apply chromaticNumber_le_iff_colorable.mpr
435+
suffices G.Coloring (Finset.univ.erase b) by simpa using Coloring.colorable this
436+
apply Coloring.mk (fun x ↦ if h' : x ≠ b then ⟨x, by simp [h']⟩ else ⟨a, by simp [hne]⟩)
437+
grind [Adj.ne', adj_symm]
438+
rw [h, ← ENat.coe_one, ← ENat.coe_sub, ENat.coe_le_coe] at this
439+
have := Fintype.one_lt_card_iff_nontrivial.mpr <| SimpleGraph.nontrivial_iff.mp ⟨_, _, hh⟩
440+
grind
441+
442+
theorem chromaticNumber_eq_card_iff [DecidableEq V] [Fintype V] :
443+
G.chromaticNumber = Fintype.card V ↔ G = ⊤ :=
444+
⟨eq_top_of_chromaticNumber_eq_card, fun h ↦ h ▸ chromaticNumber_top⟩
445+
446+
theorem chromaticNumber_le_card [Fintype V] : G.chromaticNumber ≤ Fintype.card V := by
447+
rw [← chromaticNumber_top]
448+
exact chromaticNumber_mono_of_hom G.selfColoring
449+
429450
/-- The bicoloring of a complete bipartite graph using whether a vertex
430451
is on the left or on the right. -/
431452
def CompleteBipartiteGraph.bicoloring (V W : Type*) : (completeBipartiteGraph V W).Coloring Bool :=

0 commit comments

Comments
 (0)