Theorem: SimpleGraph.partitionable_iff_colorable
File: Mathlib/Combinatorics/SimpleGraph/Partition.lean

tactic: constructor
state_before: V : Type u
G : SimpleGraph V
n : ℕ
⊢ G.Partitionable n ↔ G.Colorable n
state_after: case mp
V : Type u
G : SimpleGraph V
n : ℕ
⊢ G.Partitionable n → G.Colorable n

case mpr
V : Type u
G : SimpleGraph V
n : ℕ
⊢ G.Colorable n → G.Partitionable n

tactic: rintro ⟨P, hf, hc⟩
state_before: case mp
V : Type u
G : SimpleGraph V
n : ℕ
⊢ G.Partitionable n → G.Colorable n
state_after: case mp.intro.intro
V : Type u
G : SimpleGraph V
n : ℕ
P : G.Partition
hf : P.parts.Finite
hc : hf.toFinset.card ≤ n
⊢ G.Colorable n

tactic: have : Fintype P.parts := hf.fintype
state_before: case mp.intro.intro
V : Type u
G : SimpleGraph V
n : ℕ
P : G.Partition
hf : P.parts.Finite
hc : hf.toFinset.card ≤ n
⊢ G.Colorable n
state_after: case mp.intro.intro
V : Type u
G : SimpleGraph V
n : ℕ
P : G.Partition
hf : P.parts.Finite
hc : hf.toFinset.card ≤ n
this : Fintype ↑P.parts
⊢ G.Colorable n

tactic: rw [Set.Finite.card_toFinset hf] at hc
state_before: case mp.intro.intro
V : Type u
G : SimpleGraph V
n : ℕ
P : G.Partition
hf : P.parts.Finite
hc : hf.toFinset.card ≤ n
this : Fintype ↑P.parts
⊢ G.Colorable n
state_after: case mp.intro.intro
V : Type u
G : SimpleGraph V
n : ℕ
P : G.Partition
hf : P.parts.Finite
this : Fintype ↑P.parts
hc : Fintype.card ↑P.parts ≤ n
⊢ G.Colorable n

tactic: apply P.colorable.mono hc
state_before: case mp.intro.intro
V : Type u
G : SimpleGraph V
n : ℕ
P : G.Partition
hf : P.parts.Finite
this : Fintype ↑P.parts
hc : Fintype.card ↑P.parts ≤ n
⊢ G.Colorable n
state_after: no goals

tactic: rintro ⟨C⟩
state_before: case mpr
V : Type u
G : SimpleGraph V
n : ℕ
⊢ G.Colorable n → G.Partitionable n
state_after: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
⊢ G.Partitionable n

tactic: refine ⟨C.toPartition, C.colorClasses_finite, le_trans ?_ (Fintype.card_fin n).le⟩
state_before: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
⊢ G.Partitionable n
state_after: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
⊢ ⋯.toFinset.card ≤ Fintype.card (Fin n)

tactic: generalize_proofs h
state_before: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
⊢ ⋯.toFinset.card ≤ Fintype.card (Fin n)
state_after: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
h : C.toPartition.parts.Finite
⊢ h.toFinset.card ≤ Fintype.card (Fin n)

tactic: change Set.Finite (Coloring.colorClasses C) at h
state_before: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
h : C.toPartition.parts.Finite
⊢ h.toFinset.card ≤ Fintype.card (Fin n)
state_after: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
h : C.colorClasses.Finite
⊢ h.toFinset.card ≤ Fintype.card (Fin n)

tactic: have : Fintype C.colorClasses := C.colorClasses_finite.fintype
state_before: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
h : C.colorClasses.Finite
⊢ h.toFinset.card ≤ Fintype.card (Fin n)
state_after: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
h : C.colorClasses.Finite
this : Fintype ↑C.colorClasses
⊢ h.toFinset.card ≤ Fintype.card (Fin n)

tactic: rw [h.card_toFinset]
state_before: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
h : C.colorClasses.Finite
this : Fintype ↑C.colorClasses
⊢ h.toFinset.card ≤ Fintype.card (Fin n)
state_after: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
h : C.colorClasses.Finite
this : Fintype ↑C.colorClasses
⊢ Fintype.card ↑C.colorClasses ≤ Fintype.card (Fin n)

tactic: exact C.card_colorClasses_le
state_before: case mpr.intro
V : Type u
G : SimpleGraph V
n : ℕ
C : G.Coloring (Fin n)
h : C.colorClasses.Finite
this : Fintype ↑C.colorClasses
⊢ Fintype.card ↑C.colorClasses ≤ Fintype.card (Fin n)
state_after: no goals