l3lab/ntp-mathlib huggingface dataset:
theorem chromaticNumber_top_eq_zero_of_infinite (V : Type*) [Infinite V] :
    (⊤ : SimpleGraph V).chromaticNumber = 0 := by
  let n := (⊤ : SimpleGraph V).chromaticNumber
  by_contra hc
  

Proof state:
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
inst✝ : Infinite V
n : ℕ := chromaticNumber ⊤
hc : ¬chromaticNumber ⊤ = 0
⊢ False

Next tactic:
replace hc := pos_iff_ne_zero.mpr hc
theorem chromaticNumber_top_eq_zero_of_infinite (V : Type*) [Infinite V] :
    (⊤ : SimpleGraph V).chromaticNumber = 0 := by
  let n := (⊤ : SimpleGraph V).chromaticNumber
  by_contra hc
  replace hc := pos_iff_ne_zero.mpr hc
  

Proof state:
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
inst✝ : Infinite V
n : ℕ := chromaticNumber ⊤
hc : 0 < chromaticNumber ⊤
⊢ False

Next tactic:
apply Nat.not_succ_le_self n
theorem chromaticNumber_top_eq_zero_of_infinite (V : Type*) [Infinite V] :
    (⊤ : SimpleGraph V).chromaticNumber = 0 := by
  let n := (⊤ : SimpleGraph V).chromaticNumber
  by_contra hc
  replace hc := pos_iff_ne_zero.mpr hc
  apply Nat.not_succ_le_self n
  

Proof state:
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
inst✝ : Infinite V
n : ℕ := chromaticNumber ⊤
hc : 0 < chromaticNumber ⊤
⊢ Nat.succ n ≤ n

Next tactic:
convert_to (⊤ : SimpleGraph { m | m < n + 1 }).chromaticNumber ≤ _
theorem chromaticNumber_top_eq_zero_of_infinite (V : Type*) [Infinite V] :
    (⊤ : SimpleGraph V).chromaticNumber = 0 := by
  let n := (⊤ : SimpleGraph V).chromaticNumber
  by_contra hc
  replace hc := pos_iff_ne_zero.mpr hc
  apply Nat.not_succ_le_self n
  convert_to (⊤ : SimpleGraph { m | m < n + 1 }).chromaticNumber ≤ _
  · 

Proof state:
case h.e'_3
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
inst✝ : Infinite V
n : ℕ := chromaticNumber ⊤
hc : 0 < chromaticNumber ⊤
⊢ Nat.succ n = chromaticNumber ⊤

Next tactic:
rw [SimpleGraph.chromaticNumber_top, Fintype.card_ofFinset,
        Finset.card_range, Nat.succ_eq_add_one]
theorem chromaticNumber_top_eq_zero_of_infinite (V : Type*) [Infinite V] :
    (⊤ : SimpleGraph V).chromaticNumber = 0 := by
  let n := (⊤ : SimpleGraph V).chromaticNumber
  by_contra hc
  replace hc := pos_iff_ne_zero.mpr hc
  apply Nat.not_succ_le_self n
  convert_to (⊤ : SimpleGraph { m | m < n + 1 }).chromaticNumber ≤ _
  · rw [SimpleGraph.chromaticNumber_top, Fintype.card_ofFinset,
        Finset.card_range, Nat.succ_eq_add_one]
  

Proof state:
case convert_2
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
inst✝ : Infinite V
n : ℕ := chromaticNumber ⊤
hc : 0 < chromaticNumber ⊤
⊢ chromaticNumber ⊤ ≤ n

Next tactic:
refine' (colorable_of_chromaticNumber_pos hc).chromaticNumber_mono_of_embedding _
theorem chromaticNumber_top_eq_zero_of_infinite (V : Type*) [Infinite V] :
    (⊤ : SimpleGraph V).chromaticNumber = 0 := by
  let n := (⊤ : SimpleGraph V).chromaticNumber
  by_contra hc
  replace hc := pos_iff_ne_zero.mpr hc
  apply Nat.not_succ_le_self n
  convert_to (⊤ : SimpleGraph { m | m < n + 1 }).chromaticNumber ≤ _
  · rw [SimpleGraph.chromaticNumber_top, Fintype.card_ofFinset,
        Finset.card_range, Nat.succ_eq_add_one]
  refine' (colorable_of_chromaticNumber_pos hc).chromaticNumber_mono_of_embedding _
  

Proof state:
case convert_2
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
inst✝ : Infinite V
n : ℕ := chromaticNumber ⊤
hc : 0 < chromaticNumber ⊤
⊢ ⊤ ↪g ⊤

Next tactic:
apply Embedding.completeGraph
theorem chromaticNumber_top_eq_zero_of_infinite (V : Type*) [Infinite V] :
    (⊤ : SimpleGraph V).chromaticNumber = 0 := by
  let n := (⊤ : SimpleGraph V).chromaticNumber
  by_contra hc
  replace hc := pos_iff_ne_zero.mpr hc
  apply Nat.not_succ_le_self n
  convert_to (⊤ : SimpleGraph { m | m < n + 1 }).chromaticNumber ≤ _
  · rw [SimpleGraph.chromaticNumber_top, Fintype.card_ofFinset,
        Finset.card_range, Nat.succ_eq_add_one]
  refine' (colorable_of_chromaticNumber_pos hc).chromaticNumber_mono_of_embedding _
  apply Embedding.completeGraph
  

Proof state:
case convert_2.f
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
inst✝ : Infinite V
n : ℕ := chromaticNumber ⊤
hc : 0 < chromaticNumber ⊤
⊢ ↑{m | m < n + 1} ↪ V

Next tactic:
exact (Function.Embedding.subtype _).trans (Infinite.natEmbedding V)
/-- The bicoloring of a complete bipartite graph using whether a vertex
is on the left or on the right. -/
def CompleteBipartiteGraph.bicoloring (V W : Type*) : (completeBipartiteGraph V W).Coloring Bool :=
  Coloring.mk (fun v => v.isRight)
    (by
      

Proof state:
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
W : Type u_2
⊢ ∀ {v w : V ⊕ W}, Adj (completeBipartiteGraph V W) v w → (fun v => Sum.isRight v) v ≠ (fun v => Sum.isRight v) w

Next tactic:
intro v w
/-- The bicoloring of a complete bipartite graph using whether a vertex
is on the left or on the right. -/
def CompleteBipartiteGraph.bicoloring (V W : Type*) : (completeBipartiteGraph V W).Coloring Bool :=
  Coloring.mk (fun v => v.isRight)
    (by
      intro v w
      

Proof state:
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
W : Type u_2
v w : V ⊕ W
⊢ Adj (completeBipartiteGraph V W) v w → (fun v => Sum.isRight v) v ≠ (fun v => Sum.isRight v) w

Next tactic:
cases v
/-- The bicoloring of a complete bipartite graph using whether a vertex
is on the left or on the right. -/
def CompleteBipartiteGraph.bicoloring (V W : Type*) : (completeBipartiteGraph V W).Coloring Bool :=
  Coloring.mk (fun v => v.isRight)
    (by
      intro v w
      cases v <;> 

Proof state:
case inl
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
W : Type u_2
w : V ⊕ W
val✝ : V
⊢ Adj (completeBipartiteGraph V W) (Sum.inl val✝) w →
    (fun v => Sum.isRight v) (Sum.inl val✝) ≠ (fun v => Sum.isRight v) w

Next tactic:
cases w
/-- The bicoloring of a complete bipartite graph using whether a vertex
is on the left or on the right. -/
def CompleteBipartiteGraph.bicoloring (V W : Type*) : (completeBipartiteGraph V W).Coloring Bool :=
  Coloring.mk (fun v => v.isRight)
    (by
      intro v w
      cases v <;> 

Proof state:
case inr
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
W : Type u_2
w : V ⊕ W
val✝ : W
⊢ Adj (completeBipartiteGraph V W) (Sum.inr val✝) w →
    (fun v => Sum.isRight v) (Sum.inr val✝) ≠ (fun v => Sum.isRight v) w

Next tactic:
cases w
/-- The bicoloring of a complete bipartite graph using whether a vertex
is on the left or on the right. -/
def CompleteBipartiteGraph.bicoloring (V W : Type*) : (completeBipartiteGraph V W).Coloring Bool :=
  Coloring.mk (fun v => v.isRight)
    (by
      intro v w
      cases v <;> cases w <;> 

Proof state:
case inl.inl
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
W : Type u_2
val✝¹ val✝ : V
⊢ Adj (completeBipartiteGraph V W) (Sum.inl val✝¹) (Sum.inl val✝) →
    (fun v => Sum.isRight v) (Sum.inl val✝¹) ≠ (fun v => Sum.isRight v) (Sum.inl val✝)

Next tactic:
simp
/-- The bicoloring of a complete bipartite graph using whether a vertex
is on the left or on the right. -/
def CompleteBipartiteGraph.bicoloring (V W : Type*) : (completeBipartiteGraph V W).Coloring Bool :=
  Coloring.mk (fun v => v.isRight)
    (by
      intro v w
      cases v <;> cases w <;> 

Proof state:
case inl.inr
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
W : Type u_2
val✝¹ : V
val✝ : W
⊢ Adj (completeBipartiteGraph V W) (Sum.inl val✝¹) (Sum.inr val✝) →
    (fun v => Sum.isRight v) (Sum.inl val✝¹) ≠ (fun v => Sum.isRight v) (Sum.inr val✝)

Next tactic:
simp
/-- The bicoloring of a complete bipartite graph using whether a vertex
is on the left or on the right. -/
def CompleteBipartiteGraph.bicoloring (V W : Type*) : (completeBipartiteGraph V W).Coloring Bool :=
  Coloring.mk (fun v => v.isRight)
    (by
      intro v w
      cases v <;> cases w <;> 

Proof state:
case inr.inl
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
W : Type u_2
val✝¹ : W
val✝ : V
⊢ Adj (completeBipartiteGraph V W) (Sum.inr val✝¹) (Sum.inl val✝) →
    (fun v => Sum.isRight v) (Sum.inr val✝¹) ≠ (fun v => Sum.isRight v) (Sum.inl val✝)

Next tactic:
simp
/-- The bicoloring of a complete bipartite graph using whether a vertex
is on the left or on the right. -/
def CompleteBipartiteGraph.bicoloring (V W : Type*) : (completeBipartiteGraph V W).Coloring Bool :=
  Coloring.mk (fun v => v.isRight)
    (by
      intro v w
      cases v <;> cases w <;> 

Proof state:
case inr.inr
V✝ : Type u
G : SimpleGraph V✝
α : Type v
C : Coloring G α
V : Type u_1
W : Type u_2
val✝¹ val✝ : W
⊢ Adj (completeBipartiteGraph V W) (Sum.inr val✝¹) (Sum.inr val✝) →
    (fun v => Sum.isRight v) (Sum.inr val✝¹) ≠ (fun v => Sum.isRight v) (Sum.inr val✝)

Next tactic:
simp
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  

Proof state:
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

Next tactic:
apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  

Proof state:
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'

Next tactic:
intro C b
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  

Proof state:
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

Next tactic:
have v := Classical.arbitrary V
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  

Proof state:
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

Next tactic:
have w := Classical.arbitrary W
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  

Proof state:
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

Next tactic:
have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by 

Proof state:
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)

Next tactic:
simp
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  

Proof state:
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

Next tactic:
have hn := C.valid h
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  have hn := C.valid h
  

Proof state:
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

Next tactic:
by_cases he : C (Sum.inl v) = b
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  have hn := C.valid h
  by_cases he : C (Sum.inl v) = b
  · 

Proof state:
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

Next tactic:
exact ⟨_, he⟩
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  have hn := C.valid h
  by_cases he : C (Sum.inl v) = b
  · exact ⟨_, he⟩
  · 

Proof state:
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

Next tactic:
by_cases he' : C (Sum.inr w) = b
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  have hn := C.valid h
  by_cases he : C (Sum.inl v) = b
  · exact ⟨_, he⟩
  · by_cases he' : C (Sum.inr w) = b
    · 

Proof state:
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

Next tactic:
exact ⟨_, he'⟩
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  have hn := C.valid h
  by_cases he : C (Sum.inl v) = b
  · exact ⟨_, he⟩
  · by_cases he' : C (Sum.inr w) = b
    · exact ⟨_, he'⟩
    · 

Proof state:
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

Next tactic:
exfalso
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  have hn := C.valid h
  by_cases he : C (Sum.inl v) = b
  · exact ⟨_, he⟩
  · by_cases he' : C (Sum.inr w) = b
    · exact ⟨_, he'⟩
    · exfalso
      

Proof state:
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

Next tactic:
cases b
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  have hn := C.valid h
  by_cases he : C (Sum.inl v) = b
  · exact ⟨_, he⟩
  · by_cases he' : C (Sum.inr w) = b
    · exact ⟨_, he'⟩
    · exfalso
      cases b <;>
        

Proof state:
case neg.h.false
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
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) = false
he' : ¬C (Sum.inr w) = false
⊢ False

Next tactic:
simp only [Bool.eq_true_eq_not_eq_false, Bool.eq_false_eq_not_eq_true] at he he'
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  have hn := C.valid h
  by_cases he : C (Sum.inl v) = b
  · exact ⟨_, he⟩
  · by_cases he' : C (Sum.inr w) = b
    · exact ⟨_, he'⟩
    · exfalso
      cases b <;>
        

Proof state:
case neg.h.true
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
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) = true
he' : ¬C (Sum.inr w) = true
⊢ False

Next tactic:
simp only [Bool.eq_true_eq_not_eq_false, Bool.eq_false_eq_not_eq_true] at he he'
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  have hn := C.valid h
  by_cases he : C (Sum.inl v) = b
  · exact ⟨_, he⟩
  · by_cases he' : C (Sum.inr w) = b
    · exact ⟨_, he'⟩
    · exfalso
      cases b <;>
        simp only [Bool.eq_true_eq_not_eq_false, Bool.eq_false_eq_not_eq_true] at he he' <;>
          

Proof state:
case neg.h.false
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
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) = true
he' : C (Sum.inr w) = true
⊢ False

Next tactic:
rw [he, he'] at hn
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  have hn := C.valid h
  by_cases he : C (Sum.inl v) = b
  · exact ⟨_, he⟩
  · by_cases he' : C (Sum.inr w) = b
    · exact ⟨_, he'⟩
    · exfalso
      cases b <;>
        simp only [Bool.eq_true_eq_not_eq_false, Bool.eq_false_eq_not_eq_true] at he he' <;>
          

Proof state:
case neg.h.true
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
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) = false
he' : C (Sum.inr w) = false
⊢ False

Next tactic:
rw [he, he'] at hn
theorem CompleteBipartiteGraph.chromaticNumber {V W : Type*} [Nonempty V] [Nonempty W] :
    (completeBipartiteGraph V W).chromaticNumber = 2 := by
  apply chromaticNumber_eq_card_of_forall_surj (CompleteBipartiteGraph.bicoloring V W)
  intro C b
  have v := Classical.arbitrary V
  have w := Classical.arbitrary W
  have h : (completeBipartiteGraph V W).Adj (Sum.inl v) (Sum.inr w) := by simp
  have hn := C.valid h
  by_cases he : C (Sum.inl v) = b
  · exact ⟨_, he⟩
  · by_cases he' : C (Sum.inr w) = b
    · exact ⟨_, he'⟩
    · exfalso
      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 <;>
        

Proof state:
case neg.h.false
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
v : V
w : W
h : Adj (completeBipartiteGraph V W) (Sum.inl v) (Sum.inr w)
hn : true ≠ true
he : C (Sum.inl v) = true
he' : C (Sum.inr w) = true
⊢ False

Next tactic:
contradiction