Theorem: SimpleGraph.chromaticNumber_eq_card_of_forall_surj
File: Mathlib/Combinatorics/SimpleGraph/Coloring.lean

tactic: apply le_antisymm
state_before: V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
h : ∀ (C' : Coloring G α), Function.Surjective ↑C'
⊢ chromaticNumber G = Fintype.card α

tactic: apply chromaticNumber_le_card C
state_before: case a
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
h : ∀ (C' : Coloring G α), Function.Surjective ↑C'
⊢ chromaticNumber G ≤ Fintype.card α

tactic: by_contra hc
state_before: case a
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
h : ∀ (C' : Coloring G α), Function.Surjective ↑C'
⊢ Fintype.card α ≤ chromaticNumber G

tactic: rw [not_le] at hc
state_before: case a
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
h : ∀ (C' : Coloring G α), Function.Surjective ↑C'
hc : ¬Fintype.card α ≤ chromaticNumber G
⊢ False

tactic: obtain ⟨n, cn, hc⟩ :=
  exists_lt_of_csInf_lt (colorable_set_nonempty_of_colorable C.to_colorable) hc
state_before: case a
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
h : ∀ (C' : Coloring G α), Function.Surjective ↑C'
hc : chromaticNumber G < Fintype.card α
⊢ False

tactic: rw [← Fintype.card_fin n] at hc
state_before: case a.intro.intro
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
h : ∀ (C' : Coloring G α), Function.Surjective ↑C'
hc✝ : chromaticNumber G < Fintype.card α
n : ℕ
cn : n ∈ {n | Colorable G n}
hc : n < Fintype.card α
⊢ False

tactic: have f := (Function.Embedding.nonempty_of_card_le (le_of_lt hc)).some
state_before: case a.intro.intro
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
h : ∀ (C' : Coloring G α), Function.Surjective ↑C'
hc✝ : chromaticNumber G < Fintype.card α
n : ℕ
cn : n ∈ {n | Colorable G n}
hc : Fintype.card (Fin n) < Fintype.card α
⊢ False

tactic: have C' := cn.some
state_before: case a.intro.intro
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
h : ∀ (C' : Coloring G α), Function.Surjective ↑C'
hc✝ : chromaticNumber G < Fintype.card α
n : ℕ
cn : n ∈ {n | Colorable G n}
hc : Fintype.card (Fin n) < Fintype.card α
f : Fin n ↪ α
⊢ False

tactic: specialize h (G.recolorOfEmbedding f C')
state_before: case a.intro.intro
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
h : ∀ (C' : Coloring G α), Function.Surjective ↑C'
hc✝ : chromaticNumber G < Fintype.card α
n : ℕ
cn : n ∈ {n | Colorable G n}
hc : Fintype.card (Fin n) < Fintype.card α
f : Fin n ↪ α
C' : Coloring G (Fin n)
⊢ False

tactic: have h1 : Function.Surjective f := Function.Surjective.of_comp h
state_before: case a.intro.intro
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
hc✝ : chromaticNumber G < Fintype.card α
n : ℕ
cn : n ∈ {n | Colorable G n}
hc : Fintype.card (Fin n) < Fintype.card α
f : Fin n ↪ α
C' : Coloring G (Fin n)
h : Function.Surjective ↑(↑(recolorOfEmbedding G f) C')
⊢ False

tactic: have h2 := Fintype.card_le_of_surjective _ h1
state_before: case a.intro.intro
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
hc✝ : chromaticNumber G < Fintype.card α
n : ℕ
cn : n ∈ {n | Colorable G n}
hc : Fintype.card (Fin n) < Fintype.card α
f : Fin n ↪ α
C' : Coloring G (Fin n)
h : Function.Surjective ↑(↑(recolorOfEmbedding G f) C')
h1 : Function.Surjective ↑f
⊢ False

tactic: exact Nat.lt_le_antisymm hc h2
state_before: case a.intro.intro
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype α
C : Coloring G α
hc✝ : chromaticNumber G < Fintype.card α
n : ℕ
cn : n ∈ {n | Colorable G n}
hc : Fintype.card (Fin n) < Fintype.card α
f : Fin n ↪ α
C' : Coloring G (Fin n)
h : Function.Surjective ↑(↑(recolorOfEmbedding G f) C')
h1 : Function.Surjective ↑f
h2 : Fintype.card α ≤ Fintype.card (Fin n)
⊢ False