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

tactic: constructor
state_before: V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
n : ℕ
⊢ Colorable G n ↔ ∃ C, ∀ (v : V), ↑C v < n

tactic: rintro hc
state_before: case mp
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
n : ℕ
⊢ Colorable G n → ∃ C, ∀ (v : V), ↑C v < n

tactic: have C : G.Coloring (Fin n) := hc.toColoring (by simp)
state_before: case mp
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
n : ℕ
hc : Colorable G n
⊢ ∃ C, ∀ (v : V), ↑C v < n

tactic: let f := Embedding.completeGraph (@Fin.valEmbedding n)
state_before: case mp
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
n : ℕ
hc : Colorable G n
C : Coloring G (Fin n)
⊢ ∃ C, ∀ (v : V), ↑C v < n

tactic: use f.toHom.comp C
state_before: case mp
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
n : ℕ
hc : Colorable G n
C : Coloring G (Fin n)
f : ⊤ ↪g ⊤ := Embedding.completeGraph Fin.valEmbedding
⊢ ∃ C, ∀ (v : V), ↑C v < n

tactic: intro v
state_before: case mp
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
n : ℕ
hc : Colorable G n
C : Coloring G (Fin n)
f : ⊤ ↪g ⊤ := Embedding.completeGraph Fin.valEmbedding
⊢ ∀ (v : V), ↑(Hom.comp (Embedding.toHom f) C) v < n

tactic: cases' C with color valid
state_before: case mp
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
n : ℕ
hc : Colorable G n
C : Coloring G (Fin n)
f : ⊤ ↪g ⊤ := Embedding.completeGraph Fin.valEmbedding
v : V
⊢ ↑(Hom.comp (Embedding.toHom f) C) v < n

tactic: exact Fin.is_lt (color v)
state_before: case mp.mk
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
n : ℕ
hc : Colorable G n
f : ⊤ ↪g ⊤ := Embedding.completeGraph Fin.valEmbedding
v : V
color : V → Fin n
valid : ∀ {a b : V}, Adj G a b → Adj ⊤ (color a) (color b)
⊢ ↑(Hom.comp (Embedding.toHom f) { toFun := color, map_rel' := valid }) v < n

tactic: simp
state_before: V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
n : ℕ
hc : Colorable G n
⊢ n ≤ Fintype.card (Fin n)

tactic: rintro ⟨C, Cf⟩
state_before: case mpr
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
n : ℕ
⊢ (∃ C, ∀ (v : V), ↑C v < n) → Colorable G n

tactic: refine' ⟨Coloring.mk _ _⟩
state_before: case mpr.intro
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
n : ℕ
C : Coloring G ℕ
Cf : ∀ (v : V), ↑C v < n
⊢ Colorable G n

tactic: exact fun v => ⟨C v, Cf v⟩
state_before: case mpr.intro.refine'_1
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
n : ℕ
C : Coloring G ℕ
Cf : ∀ (v : V), ↑C v < n
⊢ V → Fin n

tactic: rintro v w hvw
state_before: case mpr.intro.refine'_2
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
n : ℕ
C : Coloring G ℕ
Cf : ∀ (v : V), ↑C v < n
⊢ ∀ {v w : V}, Adj G v w → { val := ↑C v, isLt := (_ : ↑C v < n) } ≠ { val := ↑C w, isLt := (_ : ↑C w < n) }

tactic: simp only [Fin.mk_eq_mk, Ne.def]
state_before: case mpr.intro.refine'_2
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
n : ℕ
C : Coloring G ℕ
Cf : ∀ (v : V), ↑C v < n
v w : V
hvw : Adj G v w
⊢ { val := ↑C v, isLt := (_ : ↑C v < n) } ≠ { val := ↑C w, isLt := (_ : ↑C w < n) }

tactic: exact C.valid hvw
state_before: case mpr.intro.refine'_2
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
n : ℕ
C : Coloring G ℕ
Cf : ∀ (v : V), ↑C v < n
v w : V
hvw : Adj G v w
⊢ ¬↑C v = ↑C w