Theorem: SimpleGraph.CompleteBipartiteGraph.chromaticNumber
File: Mathlib/Combinatorics/SimpleGraph/Coloring.lean

tactic: apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
state_before: V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
⊢ SimpleGraph.chromaticNumber (completeBipartiteGraph V W) = 2

tactic: intro C b
state_before: V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
⊢ ∀ (C' : Coloring (completeBipartiteGraph V W) Bool), Function.Surjective ↑C'

tactic: have v := Classical.arbitrary V
state_before: V✝ : Type u
G : SimpleGraph V✝
α : Type v
C✝ : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
C : Coloring (completeBipartiteGraph V W) Bool
b : Bool
⊢ ∃ a, ↑C a = b

tactic: have w := Classical.arbitrary W
state_before: V✝ : Type u
G : SimpleGraph V✝
α : Type v
C✝ : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
C : Coloring (completeBipartiteGraph V W) Bool
b : Bool
v : V
⊢ ∃ a, ↑C a = b

tactic: have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
state_before: V✝ : Type u
G : SimpleGraph V✝
α : Type v
C✝ : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
C : Coloring (completeBipartiteGraph V W) Bool
b : Bool
v : V
w : W
⊢ ∃ a, ↑C a = b

tactic: have hn := C.valid h
state_before: V✝ : Type u
G : SimpleGraph V✝
α : Type v
C✝ : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
C : Coloring (completeBipartiteGraph V W) Bool
b : Bool
v : V
w : W
h : Adj (completeBipartiteGraph V W) (Sum.inl v) (Sum.inr w)
⊢ ∃ a, ↑C a = b

tactic: by_cases he : C (Sum.inl v) = b
state_before: V✝ : Type u
G : SimpleGraph V✝
α : Type v
C✝ : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
C : Coloring (completeBipartiteGraph V W) Bool
b : Bool
v : V
w : W
h : Adj (completeBipartiteGraph V W) (Sum.inl v) (Sum.inr w)
hn : ↑C (Sum.inl v) ≠ ↑C (Sum.inr w)
⊢ ∃ a, ↑C a = b

tactic: simp
state_before: V✝ : Type u
G : SimpleGraph V✝
α : Type v
C✝ : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
C : Coloring (completeBipartiteGraph V W) Bool
b : Bool
v : V
w : W
⊢ Adj (completeBipartiteGraph V W) (Sum.inl v) (Sum.inr w)

tactic: exact ⟨_, he⟩
state_before: case pos
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C✝ : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
C : Coloring (completeBipartiteGraph V W) Bool
b : Bool
v : V
w : W
h : Adj (completeBipartiteGraph V W) (Sum.inl v) (Sum.inr w)
hn : ↑C (Sum.inl v) ≠ ↑C (Sum.inr w)
he : ↑C (Sum.inl v) = b
⊢ ∃ a, ↑C a = b

tactic: by_cases he' : C (Sum.inr w) = b
state_before: case neg
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C✝ : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
C : Coloring (completeBipartiteGraph V W) Bool
b : Bool
v : V
w : W
h : Adj (completeBipartiteGraph V W) (Sum.inl v) (Sum.inr w)
hn : ↑C (Sum.inl v) ≠ ↑C (Sum.inr w)
he : ¬↑C (Sum.inl v) = b
⊢ ∃ a, ↑C a = b

tactic: exact ⟨_, he'⟩
state_before: case pos
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C✝ : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
C : Coloring (completeBipartiteGraph V W) Bool
b : Bool
v : V
w : W
h : Adj (completeBipartiteGraph V W) (Sum.inl v) (Sum.inr w)
hn : ↑C (Sum.inl v) ≠ ↑C (Sum.inr w)
he : ¬↑C (Sum.inl v) = b
he' : ↑C (Sum.inr w) = b
⊢ ∃ a, ↑C a = b

tactic: exfalso
state_before: case neg
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C✝ : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
C : Coloring (completeBipartiteGraph V W) Bool
b : Bool
v : V
w : W
h : Adj (completeBipartiteGraph V W) (Sum.inl v) (Sum.inr w)
hn : ↑C (Sum.inl v) ≠ ↑C (Sum.inr w)
he : ¬↑C (Sum.inl v) = b
he' : ¬↑C (Sum.inr w) = b
⊢ ∃ a, ↑C a = b

tactic: cases b <;>
  simp only [Bool.eq_true_eq_not_eq_false, Bool.eq_false_eq_not_eq_true] at he he' <;>
    rw [he, he'] at hn <;>
  contradiction
state_before: case neg.h
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C✝ : Coloring G α
V : Type u_1
W : Type u_2
inst✝¹ : Nonempty V
inst✝ : Nonempty W
C : Coloring (completeBipartiteGraph V W) Bool
b : Bool
v : V
w : W
h : Adj (completeBipartiteGraph V W) (Sum.inl v) (Sum.inr w)
hn : ↑C (Sum.inl v) ≠ ↑C (Sum.inr w)
he : ¬↑C (Sum.inl v) = b
he' : ¬↑C (Sum.inr w) = b
⊢ False