l3lab/ntp-mathlib huggingface dataset:
theorem chromaticNumber_le_one_of_subsingleton (G : SimpleGraph V) [Subsingleton V] :
    G.chromaticNumber ≤ 1 := by
  

Proof state:
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : Subsingleton V
⊢ chromaticNumber G ≤ 1

Next tactic:
rw [chromaticNumber]
theorem chromaticNumber_le_one_of_subsingleton (G : SimpleGraph V) [Subsingleton V] :
    G.chromaticNumber ≤ 1 := by
  rw [chromaticNumber]
  

Proof state:
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : Subsingleton V
⊢ sInf {n | Colorable G n} ≤ 1

Next tactic:
apply csInf_le chromaticNumber_bddBelow
theorem chromaticNumber_le_one_of_subsingleton (G : SimpleGraph V) [Subsingleton V] :
    G.chromaticNumber ≤ 1 := by
  rw [chromaticNumber]
  apply csInf_le chromaticNumber_bddBelow
  

Proof state:
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : Subsingleton V
⊢ 1 ∈ {n | Colorable G n}

Next tactic:
constructor
theorem chromaticNumber_le_one_of_subsingleton (G : SimpleGraph V) [Subsingleton V] :
    G.chromaticNumber ≤ 1 := by
  rw [chromaticNumber]
  apply csInf_le chromaticNumber_bddBelow
  constructor
  

Proof state:
case val
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : Subsingleton V
⊢ Coloring G (Fin 1)

Next tactic:
refine' Coloring.mk (fun _ => 0) _
theorem chromaticNumber_le_one_of_subsingleton (G : SimpleGraph V) [Subsingleton V] :
    G.chromaticNumber ≤ 1 := by
  rw [chromaticNumber]
  apply csInf_le chromaticNumber_bddBelow
  constructor
  refine' Coloring.mk (fun _ => 0) _
  

Proof state:
case val
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : Subsingleton V
⊢ ∀ {v w : V}, Adj G v w → (fun x => 0) v ≠ (fun x => 0) w

Next tactic:
intro v w
theorem chromaticNumber_le_one_of_subsingleton (G : SimpleGraph V) [Subsingleton V] :
    G.chromaticNumber ≤ 1 := by
  rw [chromaticNumber]
  apply csInf_le chromaticNumber_bddBelow
  constructor
  refine' Coloring.mk (fun _ => 0) _
  intro v w
  

Proof state:
case val
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : Subsingleton V
v w : V
⊢ Adj G v w → (fun x => 0) v ≠ (fun x => 0) w

Next tactic:
rw [Subsingleton.elim v w]
theorem chromaticNumber_le_one_of_subsingleton (G : SimpleGraph V) [Subsingleton V] :
    G.chromaticNumber ≤ 1 := by
  rw [chromaticNumber]
  apply csInf_le chromaticNumber_bddBelow
  constructor
  refine' Coloring.mk (fun _ => 0) _
  intro v w
  rw [Subsingleton.elim v w]
  

Proof state:
case val
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : Subsingleton V
v w : V
⊢ Adj G w w → (fun x => 0) w ≠ (fun x => 0) w

Next tactic:
simp
theorem chromaticNumber_eq_zero_of_isempty (G : SimpleGraph V) [IsEmpty V] :
    G.chromaticNumber = 0 := by
  

Proof state:
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : IsEmpty V
⊢ chromaticNumber G = 0

Next tactic:
rw [← nonpos_iff_eq_zero]
theorem chromaticNumber_eq_zero_of_isempty (G : SimpleGraph V) [IsEmpty V] :
    G.chromaticNumber = 0 := by
  rw [← nonpos_iff_eq_zero]
  

Proof state:
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : IsEmpty V
⊢ chromaticNumber G ≤ 0

Next tactic:
apply csInf_le chromaticNumber_bddBelow
theorem chromaticNumber_eq_zero_of_isempty (G : SimpleGraph V) [IsEmpty V] :
    G.chromaticNumber = 0 := by
  rw [← nonpos_iff_eq_zero]
  apply csInf_le chromaticNumber_bddBelow
  

Proof state:
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : IsEmpty V
⊢ 0 ∈ {n | Colorable G n}

Next tactic:
apply colorable_of_isEmpty
theorem isEmpty_of_chromaticNumber_eq_zero (G : SimpleGraph V) [Finite V]
    (h : G.chromaticNumber = 0) : IsEmpty V := by
  

Proof state:
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : Finite V
h : chromaticNumber G = 0
⊢ IsEmpty V

Next tactic:
have h' := G.colorable_chromaticNumber_of_fintype
theorem isEmpty_of_chromaticNumber_eq_zero (G : SimpleGraph V) [Finite V]
    (h : G.chromaticNumber = 0) : IsEmpty V := by
  have h' := G.colorable_chromaticNumber_of_fintype
  

Proof state:
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : Finite V
h : chromaticNumber G = 0
h' : Colorable G (chromaticNumber G)
⊢ IsEmpty V

Next tactic:
rw [h] at h'
theorem isEmpty_of_chromaticNumber_eq_zero (G : SimpleGraph V) [Finite V]
    (h : G.chromaticNumber = 0) : IsEmpty V := by
  have h' := G.colorable_chromaticNumber_of_fintype
  rw [h] at h'
  

Proof state:
V : Type u
G✝ : SimpleGraph V
α : Type v
C : Coloring G✝ α
G : SimpleGraph V
inst✝ : Finite V
h : chromaticNumber G = 0
h' : Colorable G 0
⊢ IsEmpty V

Next tactic:
exact G.isEmpty_of_colorable_zero h'
theorem chromaticNumber_pos [Nonempty V] {n : ℕ} (hc : G.Colorable n) : 0 < G.chromaticNumber := by
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
inst✝ : Nonempty V
n : ℕ
hc : Colorable G n
⊢ 0 < chromaticNumber G

Next tactic:
apply le_csInf (colorable_set_nonempty_of_colorable hc)
theorem chromaticNumber_pos [Nonempty V] {n : ℕ} (hc : G.Colorable n) : 0 < G.chromaticNumber := by
  apply le_csInf (colorable_set_nonempty_of_colorable hc)
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
inst✝ : Nonempty V
n : ℕ
hc : Colorable G n
⊢ ∀ b ∈ {n | Colorable G n}, Nat.succ 0 ≤ b

Next tactic:
intro m hm
theorem chromaticNumber_pos [Nonempty V] {n : ℕ} (hc : G.Colorable n) : 0 < G.chromaticNumber := by
  apply le_csInf (colorable_set_nonempty_of_colorable hc)
  intro m hm
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
inst✝ : Nonempty V
n : ℕ
hc : Colorable G n
m : ℕ
hm : m ∈ {n | Colorable G n}
⊢ Nat.succ 0 ≤ m

Next tactic:
by_contra h'
theorem chromaticNumber_pos [Nonempty V] {n : ℕ} (hc : G.Colorable n) : 0 < G.chromaticNumber := by
  apply le_csInf (colorable_set_nonempty_of_colorable hc)
  intro m hm
  by_contra h'
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
inst✝ : Nonempty V
n : ℕ
hc : Colorable G n
m : ℕ
hm : m ∈ {n | Colorable G n}
h' : ¬Nat.succ 0 ≤ m
⊢ False

Next tactic:
simp only [not_le] at h'
theorem chromaticNumber_pos [Nonempty V] {n : ℕ} (hc : G.Colorable n) : 0 < G.chromaticNumber := by
  apply le_csInf (colorable_set_nonempty_of_colorable hc)
  intro m hm
  by_contra h'
  simp only [not_le] at h'
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
inst✝ : Nonempty V
n : ℕ
hc : Colorable G n
m : ℕ
hm : m ∈ {n | Colorable G n}
h' : m < Nat.succ 0
⊢ False

Next tactic:
obtain ⟨i, hi⟩ := hm.some (Classical.arbitrary V)
theorem chromaticNumber_pos [Nonempty V] {n : ℕ} (hc : G.Colorable n) : 0 < G.chromaticNumber := by
  apply le_csInf (colorable_set_nonempty_of_colorable hc)
  intro m hm
  by_contra h'
  simp only [not_le] at h'
  obtain ⟨i, hi⟩ := hm.some (Classical.arbitrary V)
  

Proof state:
case mk
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
inst✝ : Nonempty V
n : ℕ
hc : Colorable G n
m : ℕ
hm : m ∈ {n | Colorable G n}
h' : m < Nat.succ 0
i : ℕ
hi : i < m
⊢ False

Next tactic:
have h₁: i < 0 := lt_of_lt_of_le hi (Nat.le_of_lt_succ h')
theorem chromaticNumber_pos [Nonempty V] {n : ℕ} (hc : G.Colorable n) : 0 < G.chromaticNumber := by
  apply le_csInf (colorable_set_nonempty_of_colorable hc)
  intro m hm
  by_contra h'
  simp only [not_le] at h'
  obtain ⟨i, hi⟩ := hm.some (Classical.arbitrary V)
  have h₁: i < 0 := lt_of_lt_of_le hi (Nat.le_of_lt_succ h')
  

Proof state:
case mk
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
inst✝ : Nonempty V
n : ℕ
hc : Colorable G n
m : ℕ
hm : m ∈ {n | Colorable G n}
h' : m < Nat.succ 0
i : ℕ
hi : i < m
h₁ : i < 0
⊢ False

Next tactic:
exact Nat.not_lt_zero _ h₁
theorem colorable_of_chromaticNumber_pos (h : 0 < G.chromaticNumber) :
    G.Colorable G.chromaticNumber := by
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
h : 0 < chromaticNumber G
⊢ Colorable G (chromaticNumber G)

Next tactic:
obtain ⟨h, hn⟩ := Nat.nonempty_of_pos_sInf h
theorem colorable_of_chromaticNumber_pos (h : 0 < G.chromaticNumber) :
    G.Colorable G.chromaticNumber := by
  obtain ⟨h, hn⟩ := Nat.nonempty_of_pos_sInf h
  

Proof state:
case intro
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
h✝ : 0 < chromaticNumber G
h : ℕ
hn : h ∈ {n | Colorable G n}
⊢ Colorable G (chromaticNumber G)

Next tactic:
exact colorable_chromaticNumber hn
theorem Colorable.chromaticNumber_le_of_forall_imp {V' : Type*} {G' : SimpleGraph V'} {m : ℕ}
    (hc : G'.Colorable m) (h : ∀ n, G'.Colorable n → G.Colorable n) :
    G.chromaticNumber ≤ G'.chromaticNumber := by
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
V' : Type u_1
G' : SimpleGraph V'
m : ℕ
hc : Colorable G' m
h : ∀ (n : ℕ), Colorable G' n → Colorable G n
⊢ chromaticNumber G ≤ chromaticNumber G'

Next tactic:
apply csInf_le chromaticNumber_bddBelow
theorem Colorable.chromaticNumber_le_of_forall_imp {V' : Type*} {G' : SimpleGraph V'} {m : ℕ}
    (hc : G'.Colorable m) (h : ∀ n, G'.Colorable n → G.Colorable n) :
    G.chromaticNumber ≤ G'.chromaticNumber := by
  apply csInf_le chromaticNumber_bddBelow
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
V' : Type u_1
G' : SimpleGraph V'
m : ℕ
hc : Colorable G' m
h : ∀ (n : ℕ), Colorable G' n → Colorable G n
⊢ chromaticNumber G' ∈ {n | Colorable G n}

Next tactic:
apply h
theorem Colorable.chromaticNumber_le_of_forall_imp {V' : Type*} {G' : SimpleGraph V'} {m : ℕ}
    (hc : G'.Colorable m) (h : ∀ n, G'.Colorable n → G.Colorable n) :
    G.chromaticNumber ≤ G'.chromaticNumber := by
  apply csInf_le chromaticNumber_bddBelow
  apply h
  

Proof state:
case a
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
V' : Type u_1
G' : SimpleGraph V'
m : ℕ
hc : Colorable G' m
h : ∀ (n : ℕ), Colorable G' n → Colorable G n
⊢ Colorable G' (chromaticNumber G')

Next tactic:
apply colorable_chromaticNumber hc
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  

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

Next tactic:
apply le_antisymm
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  apply le_antisymm
  · 

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

Next tactic:
apply chromaticNumber_le_card C
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  apply le_antisymm
  · apply chromaticNumber_le_card C
  · 

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

Next tactic:
by_contra hc
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  apply le_antisymm
  · apply chromaticNumber_le_card C
  · by_contra hc
    

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

Next tactic:
rw [not_le] at hc
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  apply le_antisymm
  · apply chromaticNumber_le_card C
  · by_contra hc
    rw [not_le] at hc
    

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

Next tactic:
obtain ⟨n, cn, hc⟩ :=
      exists_lt_of_csInf_lt (colorable_set_nonempty_of_colorable C.to_colorable) hc
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  apply le_antisymm
  · apply chromaticNumber_le_card C
  · by_contra hc
    rw [not_le] at hc
    obtain ⟨n, cn, hc⟩ :=
      exists_lt_of_csInf_lt (colorable_set_nonempty_of_colorable C.to_colorable) hc
    

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

Next tactic:
rw [← Fintype.card_fin n] at hc
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  apply le_antisymm
  · apply chromaticNumber_le_card C
  · by_contra hc
    rw [not_le] at hc
    obtain ⟨n, cn, hc⟩ :=
      exists_lt_of_csInf_lt (colorable_set_nonempty_of_colorable C.to_colorable) hc
    rw [← Fintype.card_fin n] at hc
    

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

Next tactic:
have f := (Function.Embedding.nonempty_of_card_le (le_of_lt hc)).some
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  apply le_antisymm
  · apply chromaticNumber_le_card C
  · by_contra hc
    rw [not_le] at hc
    obtain ⟨n, cn, hc⟩ :=
      exists_lt_of_csInf_lt (colorable_set_nonempty_of_colorable C.to_colorable) hc
    rw [← Fintype.card_fin n] at hc
    have f := (Function.Embedding.nonempty_of_card_le (le_of_lt hc)).some
    

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

Next tactic:
have C' := cn.some
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  apply le_antisymm
  · apply chromaticNumber_le_card C
  · by_contra hc
    rw [not_le] at hc
    obtain ⟨n, cn, hc⟩ :=
      exists_lt_of_csInf_lt (colorable_set_nonempty_of_colorable C.to_colorable) hc
    rw [← Fintype.card_fin n] at hc
    have f := (Function.Embedding.nonempty_of_card_le (le_of_lt hc)).some
    have C' := cn.some
    

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

Next tactic:
specialize h (G.recolorOfEmbedding f C')
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  apply le_antisymm
  · apply chromaticNumber_le_card C
  · by_contra hc
    rw [not_le] at hc
    obtain ⟨n, cn, hc⟩ :=
      exists_lt_of_csInf_lt (colorable_set_nonempty_of_colorable C.to_colorable) hc
    rw [← Fintype.card_fin n] at hc
    have f := (Function.Embedding.nonempty_of_card_le (le_of_lt hc)).some
    have C' := cn.some
    specialize h (G.recolorOfEmbedding f C')
    

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

Next tactic:
have h1 : Function.Surjective f := Function.Surjective.of_comp h
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  apply le_antisymm
  · apply chromaticNumber_le_card C
  · by_contra hc
    rw [not_le] at hc
    obtain ⟨n, cn, hc⟩ :=
      exists_lt_of_csInf_lt (colorable_set_nonempty_of_colorable C.to_colorable) hc
    rw [← Fintype.card_fin n] at hc
    have f := (Function.Embedding.nonempty_of_card_le (le_of_lt hc)).some
    have C' := cn.some
    specialize h (G.recolorOfEmbedding f C')
    have h1 : Function.Surjective f := Function.Surjective.of_comp h
    

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

Next tactic:
have h2 := Fintype.card_le_of_surjective _ h1
theorem chromaticNumber_eq_card_of_forall_surj [Fintype α] (C : G.Coloring α)
    (h : ∀ C' : G.Coloring α, Function.Surjective C') : G.chromaticNumber = Fintype.card α := by
  apply le_antisymm
  · apply chromaticNumber_le_card C
  · by_contra hc
    rw [not_le] at hc
    obtain ⟨n, cn, hc⟩ :=
      exists_lt_of_csInf_lt (colorable_set_nonempty_of_colorable C.to_colorable) hc
    rw [← Fintype.card_fin n] at hc
    have f := (Function.Embedding.nonempty_of_card_le (le_of_lt hc)).some
    have C' := cn.some
    specialize h (G.recolorOfEmbedding f C')
    have h1 : Function.Surjective f := Function.Surjective.of_comp h
    have h2 := Fintype.card_le_of_surjective _ h1
    

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

Next tactic:
exact Nat.lt_le_asymm hc h2
theorem chromaticNumber_bot [Nonempty V] : (⊥ : SimpleGraph V).chromaticNumber = 1 := by
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
inst✝ : Nonempty V
⊢ chromaticNumber ⊥ = 1

Next tactic:
let C : (⊥ : SimpleGraph V).Coloring (Fin 1) :=
      Coloring.mk (fun _ => 0) fun {v w} h => False.elim h
theorem chromaticNumber_bot [Nonempty V] : (⊥ : SimpleGraph V).chromaticNumber = 1 := by
  let C : (⊥ : SimpleGraph V).Coloring (Fin 1) :=
      Coloring.mk (fun _ => 0) fun {v w} h => False.elim h
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Nonempty V
C : Coloring ⊥ (Fin 1) := Coloring.mk (fun x => 0) (_ : ∀ {v w : V}, Adj ⊥ v w → (fun x => 0) v ≠ (fun x => 0) w)
⊢ chromaticNumber ⊥ = 1

Next tactic:
apply le_antisymm
theorem chromaticNumber_bot [Nonempty V] : (⊥ : SimpleGraph V).chromaticNumber = 1 := by
  let C : (⊥ : SimpleGraph V).Coloring (Fin 1) :=
      Coloring.mk (fun _ => 0) fun {v w} h => False.elim h
  apply le_antisymm
  · 

Proof state:
case a
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Nonempty V
C : Coloring ⊥ (Fin 1) := Coloring.mk (fun x => 0) (_ : ∀ {v w : V}, Adj ⊥ v w → (fun x => 0) v ≠ (fun x => 0) w)
⊢ chromaticNumber ⊥ ≤ 1

Next tactic:
exact chromaticNumber_le_card C
theorem chromaticNumber_bot [Nonempty V] : (⊥ : SimpleGraph V).chromaticNumber = 1 := by
  let C : (⊥ : SimpleGraph V).Coloring (Fin 1) :=
      Coloring.mk (fun _ => 0) fun {v w} h => False.elim h
  apply le_antisymm
  · exact chromaticNumber_le_card C
  · 

Proof state:
case a
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Nonempty V
C : Coloring ⊥ (Fin 1) := Coloring.mk (fun x => 0) (_ : ∀ {v w : V}, Adj ⊥ v w → (fun x => 0) v ≠ (fun x => 0) w)
⊢ 1 ≤ chromaticNumber ⊥

Next tactic:
exact chromaticNumber_pos C.to_colorable
@[simp]
theorem chromaticNumber_top [Fintype V] : (⊤ : SimpleGraph V).chromaticNumber = Fintype.card V := by
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
inst✝ : Fintype V
⊢ chromaticNumber ⊤ = Fintype.card V

Next tactic:
apply chromaticNumber_eq_card_of_forall_surj (selfColoring _)
@[simp]
theorem chromaticNumber_top [Fintype V] : (⊤ : SimpleGraph V).chromaticNumber = Fintype.card V := by
  apply chromaticNumber_eq_card_of_forall_surj (selfColoring _)
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C : Coloring G α
inst✝ : Fintype V
⊢ ∀ (C' : Coloring ⊤ V), Function.Surjective ⇑C'

Next tactic:
intro C
@[simp]
theorem chromaticNumber_top [Fintype V] : (⊤ : SimpleGraph V).chromaticNumber = Fintype.card V := by
  apply chromaticNumber_eq_card_of_forall_surj (selfColoring _)
  intro C
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype V
C : Coloring ⊤ V
⊢ Function.Surjective ⇑C

Next tactic:
rw [← Finite.injective_iff_surjective]
@[simp]
theorem chromaticNumber_top [Fintype V] : (⊤ : SimpleGraph V).chromaticNumber = Fintype.card V := by
  apply chromaticNumber_eq_card_of_forall_surj (selfColoring _)
  intro C
  rw [← Finite.injective_iff_surjective]
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype V
C : Coloring ⊤ V
⊢ Function.Injective ⇑C

Next tactic:
intro v w
@[simp]
theorem chromaticNumber_top [Fintype V] : (⊤ : SimpleGraph V).chromaticNumber = Fintype.card V := by
  apply chromaticNumber_eq_card_of_forall_surj (selfColoring _)
  intro C
  rw [← Finite.injective_iff_surjective]
  intro v w
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype V
C : Coloring ⊤ V
v w : V
⊢ C v = C w → v = w

Next tactic:
contrapose
@[simp]
theorem chromaticNumber_top [Fintype V] : (⊤ : SimpleGraph V).chromaticNumber = Fintype.card V := by
  apply chromaticNumber_eq_card_of_forall_surj (selfColoring _)
  intro C
  rw [← Finite.injective_iff_surjective]
  intro v w
  contrapose
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype V
C : Coloring ⊤ V
v w : V
⊢ ¬v = w → ¬C v = C w

Next tactic:
intro h
@[simp]
theorem chromaticNumber_top [Fintype V] : (⊤ : SimpleGraph V).chromaticNumber = Fintype.card V := by
  apply chromaticNumber_eq_card_of_forall_surj (selfColoring _)
  intro C
  rw [← Finite.injective_iff_surjective]
  intro v w
  contrapose
  intro h
  

Proof state:
V : Type u
G : SimpleGraph V
α : Type v
C✝ : Coloring G α
inst✝ : Fintype V
C : Coloring ⊤ V
v w : V
h : ¬v = w
⊢ ¬C v = C w

Next tactic:
exact C.valid h
theorem chromaticNumber_top_eq_zero_of_infinite (V : Type*) [Infinite V] :
    (⊤ : SimpleGraph V).chromaticNumber = 0 := by
  

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

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

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

Next tactic:
by_contra hc