l3lab/ntp-mathlib huggingface dataset:
theorem coeff_rename_eq_zero (f : σ → τ) (φ : MvPolynomial σ R) (d : τ →₀ ℕ)
    (h : ∀ u : σ →₀ ℕ, u.mapDomain f = d → φ.coeff u = 0) : (rename f φ).coeff d = 0 := by
  classical
  rw [rename_eq, ← not_mem_support_iff]
  intro H
  replace H := mapDomain_support H
  rw [Finset.mem_image] at H
  obtain ⟨u, hu, rfl⟩ := H
  specialize h u rfl
  simp? at h hu says simp only [Finsupp.mem_support_iff, ne_eq] at h hu
  

Proof state:
case intro.intro
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : σ → τ
φ : MvPolynomial σ R
u : σ →₀ ℕ
h : coeff u φ = 0
hu : ¬φ u = 0
⊢ False

Next tactic:
contradiction
theorem coeff_rename_ne_zero (f : σ → τ) (φ : MvPolynomial σ R) (d : τ →₀ ℕ)
    (h : (rename f φ).coeff d ≠ 0) : ∃ u : σ →₀ ℕ, u.mapDomain f = d ∧ φ.coeff u ≠ 0 := by
  

Proof state:
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : σ → τ
φ : MvPolynomial σ R
d : τ →₀ ℕ
h : coeff d ((rename f) φ) ≠ 0
⊢ ∃ u, Finsupp.mapDomain f u = d ∧ coeff u φ ≠ 0

Next tactic:
contrapose! h
theorem coeff_rename_ne_zero (f : σ → τ) (φ : MvPolynomial σ R) (d : τ →₀ ℕ)
    (h : (rename f φ).coeff d ≠ 0) : ∃ u : σ →₀ ℕ, u.mapDomain f = d ∧ φ.coeff u ≠ 0 := by
  contrapose! h
  

Proof state:
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : σ → τ
φ : MvPolynomial σ R
d : τ →₀ ℕ
h : ∀ (u : σ →₀ ℕ), Finsupp.mapDomain f u = d → coeff u φ = 0
⊢ coeff d ((rename f) φ) = 0

Next tactic:
apply coeff_rename_eq_zero _ _ _ h
@[simp]
theorem constantCoeff_rename {τ : Type*} (f : σ → τ) (φ : MvPolynomial σ R) :
    constantCoeff (rename f φ) = constantCoeff φ := by
  

Proof state:
σ : Type u_1
τ✝ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
τ : Type u_6
f : σ → τ
φ : MvPolynomial σ R
⊢ constantCoeff ((rename f) φ) = constantCoeff φ

Next tactic:
apply φ.induction_on
@[simp]
theorem constantCoeff_rename {τ : Type*} (f : σ → τ) (φ : MvPolynomial σ R) :
    constantCoeff (rename f φ) = constantCoeff φ := by
  apply φ.induction_on
  · 

Proof state:
case h_C
σ : Type u_1
τ✝ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
τ : Type u_6
f : σ → τ
φ : MvPolynomial σ R
⊢ ∀ (a : R), constantCoeff ((rename f) (C a)) = constantCoeff (C a)

Next tactic:
intro a
@[simp]
theorem constantCoeff_rename {τ : Type*} (f : σ → τ) (φ : MvPolynomial σ R) :
    constantCoeff (rename f φ) = constantCoeff φ := by
  apply φ.induction_on
  · intro a
    

Proof state:
case h_C
σ : Type u_1
τ✝ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
τ : Type u_6
f : σ → τ
φ : MvPolynomial σ R
a : R
⊢ constantCoeff ((rename f) (C a)) = constantCoeff (C a)

Next tactic:
simp only [constantCoeff_C, rename_C]
@[simp]
theorem constantCoeff_rename {τ : Type*} (f : σ → τ) (φ : MvPolynomial σ R) :
    constantCoeff (rename f φ) = constantCoeff φ := by
  apply φ.induction_on
  · intro a
    simp only [constantCoeff_C, rename_C]
  · 

Proof state:
case h_add
σ : Type u_1
τ✝ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
τ : Type u_6
f : σ → τ
φ : MvPolynomial σ R
⊢ ∀ (p q : MvPolynomial σ R),
    constantCoeff ((rename f) p) = constantCoeff p →
      constantCoeff ((rename f) q) = constantCoeff q → constantCoeff ((rename f) (p + q)) = constantCoeff (p + q)

Next tactic:
intro p q hp hq
@[simp]
theorem constantCoeff_rename {τ : Type*} (f : σ → τ) (φ : MvPolynomial σ R) :
    constantCoeff (rename f φ) = constantCoeff φ := by
  apply φ.induction_on
  · intro a
    simp only [constantCoeff_C, rename_C]
  · intro p q hp hq
    

Proof state:
case h_add
σ : Type u_1
τ✝ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
τ : Type u_6
f : σ → τ
φ p q : MvPolynomial σ R
hp : constantCoeff ((rename f) p) = constantCoeff p
hq : constantCoeff ((rename f) q) = constantCoeff q
⊢ constantCoeff ((rename f) (p + q)) = constantCoeff (p + q)

Next tactic:
simp only [hp, hq, RingHom.map_add, AlgHom.map_add]
@[simp]
theorem constantCoeff_rename {τ : Type*} (f : σ → τ) (φ : MvPolynomial σ R) :
    constantCoeff (rename f φ) = constantCoeff φ := by
  apply φ.induction_on
  · intro a
    simp only [constantCoeff_C, rename_C]
  · intro p q hp hq
    simp only [hp, hq, RingHom.map_add, AlgHom.map_add]
  · 

Proof state:
case h_X
σ : Type u_1
τ✝ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
τ : Type u_6
f : σ → τ
φ : MvPolynomial σ R
⊢ ∀ (p : MvPolynomial σ R) (n : σ),
    constantCoeff ((rename f) p) = constantCoeff p → constantCoeff ((rename f) (p * X n)) = constantCoeff (p * X n)

Next tactic:
intro p n hp
@[simp]
theorem constantCoeff_rename {τ : Type*} (f : σ → τ) (φ : MvPolynomial σ R) :
    constantCoeff (rename f φ) = constantCoeff φ := by
  apply φ.induction_on
  · intro a
    simp only [constantCoeff_C, rename_C]
  · intro p q hp hq
    simp only [hp, hq, RingHom.map_add, AlgHom.map_add]
  · intro p n hp
    

Proof state:
case h_X
σ : Type u_1
τ✝ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
τ : Type u_6
f : σ → τ
φ p : MvPolynomial σ R
n : σ
hp : constantCoeff ((rename f) p) = constantCoeff p
⊢ constantCoeff ((rename f) (p * X n)) = constantCoeff (p * X n)

Next tactic:
simp only [hp, rename_X, constantCoeff_X, RingHom.map_mul, AlgHom.map_mul]
theorem support_rename_of_injective {p : MvPolynomial σ R} {f : σ → τ} [DecidableEq τ]
    (h : Function.Injective f) :
    (rename f p).support = Finset.image (Finsupp.mapDomain f) p.support := by
  

Proof state:
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
p : MvPolynomial σ R
f : σ → τ
inst✝ : DecidableEq τ
h : Injective f
⊢ support ((rename f) p) = Finset.image (Finsupp.mapDomain f) (support p)

Next tactic:
rw [rename_eq]
theorem support_rename_of_injective {p : MvPolynomial σ R} {f : σ → τ} [DecidableEq τ]
    (h : Function.Injective f) :
    (rename f p).support = Finset.image (Finsupp.mapDomain f) p.support := by
  rw [rename_eq]
  

Proof state:
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝² : CommSemiring R
inst✝¹ : CommSemiring S
p : MvPolynomial σ R
f : σ → τ
inst✝ : DecidableEq τ
h : Injective f
⊢ support (Finsupp.mapDomain (Finsupp.mapDomain f) p) = Finset.image (Finsupp.mapDomain f) (support p)

Next tactic:
exact Finsupp.mapDomain_support_of_injective (mapDomain_injective h) _
/-- Bicoloring of a path graph -/
def pathGraph.bicoloring (n : ℕ) :
    Coloring (pathGraph n) Bool :=
  Coloring.mk (fun u ↦ u.val % 2 = 0) <| by
    

Proof state:
n : ℕ
⊢ ∀ {v w : Fin n}, Adj (pathGraph n) v w → (fun u => decide (↑u % 2 = 0)) v ≠ (fun u => decide (↑u % 2 = 0)) w

Next tactic:
intro u v
/-- Bicoloring of a path graph -/
def pathGraph.bicoloring (n : ℕ) :
    Coloring (pathGraph n) Bool :=
  Coloring.mk (fun u ↦ u.val % 2 = 0) <| by
    intro u v
    

Proof state:
n : ℕ
u v : Fin n
⊢ Adj (pathGraph n) u v → (fun u => decide (↑u % 2 = 0)) u ≠ (fun u => decide (↑u % 2 = 0)) v

Next tactic:
rw [pathGraph_adj]
/-- Bicoloring of a path graph -/
def pathGraph.bicoloring (n : ℕ) :
    Coloring (pathGraph n) Bool :=
  Coloring.mk (fun u ↦ u.val % 2 = 0) <| by
    intro u v
    rw [pathGraph_adj]
    

Proof state:
n : ℕ
u v : Fin n
⊢ ↑u + 1 = ↑v ∨ ↑v + 1 = ↑u → (fun u => decide (↑u % 2 = 0)) u ≠ (fun u => decide (↑u % 2 = 0)) v

Next tactic:
rintro (h | h)
/-- Bicoloring of a path graph -/
def pathGraph.bicoloring (n : ℕ) :
    Coloring (pathGraph n) Bool :=
  Coloring.mk (fun u ↦ u.val % 2 = 0) <| by
    intro u v
    rw [pathGraph_adj]
    rintro (h | h) <;> 

Proof state:
case inl
n : ℕ
u v : Fin n
h : ↑u + 1 = ↑v
⊢ (fun u => decide (↑u % 2 = 0)) u ≠ (fun u => decide (↑u % 2 = 0)) v

Next tactic:
simp [← h, not_iff, Nat.succ_mod_two_eq_zero_iff]
/-- Bicoloring of a path graph -/
def pathGraph.bicoloring (n : ℕ) :
    Coloring (pathGraph n) Bool :=
  Coloring.mk (fun u ↦ u.val % 2 = 0) <| by
    intro u v
    rw [pathGraph_adj]
    rintro (h | h) <;> 

Proof state:
case inr
n : ℕ
u v : Fin n
h : ↑v + 1 = ↑u
⊢ (fun u => decide (↑u % 2 = 0)) u ≠ (fun u => decide (↑u % 2 = 0)) v

Next tactic:
simp [← h, not_iff, Nat.succ_mod_two_eq_zero_iff]
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where
  toFun v := ⟨v, trans v.2 h⟩
  inj' := by
    

Proof state:
n : ℕ
h : 2 ≤ n
⊢ Function.Injective fun v => { val := ↑v, isLt := (_ : ↑v < n) }

Next tactic:
rintro v w
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where
  toFun v := ⟨v, trans v.2 h⟩
  inj' := by
    rintro v w
    

Proof state:
n : ℕ
h : 2 ≤ n
v w : Fin 2
⊢ (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w → v = w

Next tactic:
rw [Fin.mk.injEq]
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where
  toFun v := ⟨v, trans v.2 h⟩
  inj' := by
    rintro v w
    rw [Fin.mk.injEq]
    

Proof state:
n : ℕ
h : 2 ≤ n
v w : Fin 2
⊢ ↑v = ↑w → v = w

Next tactic:
exact Fin.ext
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where
  toFun v := ⟨v, trans v.2 h⟩
  inj' := by
    rintro v w
    rw [Fin.mk.injEq]
    exact Fin.ext
  map_rel_iff' := by
    

Proof state:
n : ℕ
h : 2 ≤ n
⊢ ∀ {a b : Fin 2},
    Adj (pathGraph n)
        ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
            inj' :=
              (_ :
                ∀ ⦃v w : Fin 2⦄,
                  (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                    v = w) }
          a)
        ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
            inj' :=
              (_ :
                ∀ ⦃v w : Fin 2⦄,
                  (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                    v = w) }
          b) ↔
      Adj (pathGraph 2) a b

Next tactic:
intro v w
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where
  toFun v := ⟨v, trans v.2 h⟩
  inj' := by
    rintro v w
    rw [Fin.mk.injEq]
    exact Fin.ext
  map_rel_iff' := by
    intro v w
    

Proof state:
n : ℕ
h : 2 ≤ n
v w : Fin 2
⊢ Adj (pathGraph n)
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        v)
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        w) ↔
    Adj (pathGraph 2) v w

Next tactic:
fin_cases v
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where
  toFun v := ⟨v, trans v.2 h⟩
  inj' := by
    rintro v w
    rw [Fin.mk.injEq]
    exact Fin.ext
  map_rel_iff' := by
    intro v w
    fin_cases v <;> 

Proof state:
case head
n : ℕ
h : 2 ≤ n
w : Fin 2
⊢ Adj (pathGraph n)
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        { val := 0, isLt := (_ : 0 < 2) })
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        w) ↔
    Adj (pathGraph 2) { val := 0, isLt := (_ : 0 < 2) } w

Next tactic:
fin_cases w
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where
  toFun v := ⟨v, trans v.2 h⟩
  inj' := by
    rintro v w
    rw [Fin.mk.injEq]
    exact Fin.ext
  map_rel_iff' := by
    intro v w
    fin_cases v <;> 

Proof state:
case tail.head
n : ℕ
h : 2 ≤ n
w : Fin 2
⊢ Adj (pathGraph n)
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        { val := 1, isLt := (_ : (fun a => a < 2) 1) })
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        w) ↔
    Adj (pathGraph 2) { val := 1, isLt := (_ : (fun a => a < 2) 1) } w

Next tactic:
fin_cases w
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where
  toFun v := ⟨v, trans v.2 h⟩
  inj' := by
    rintro v w
    rw [Fin.mk.injEq]
    exact Fin.ext
  map_rel_iff' := by
    intro v w
    fin_cases v <;> fin_cases w <;> 

Proof state:
case head.head
n : ℕ
h : 2 ≤ n
⊢ Adj (pathGraph n)
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        { val := 0, isLt := (_ : 0 < 2) })
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        { val := 0, isLt := (_ : 0 < 2) }) ↔
    Adj (pathGraph 2) { val := 0, isLt := (_ : 0 < 2) } { val := 0, isLt := (_ : 0 < 2) }

Next tactic:
simp [pathGraph, ← Fin.coe_covby_iff]
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where
  toFun v := ⟨v, trans v.2 h⟩
  inj' := by
    rintro v w
    rw [Fin.mk.injEq]
    exact Fin.ext
  map_rel_iff' := by
    intro v w
    fin_cases v <;> fin_cases w <;> 

Proof state:
case head.tail.head
n : ℕ
h : 2 ≤ n
⊢ Adj (pathGraph n)
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        { val := 0, isLt := (_ : 0 < 2) })
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        { val := 1, isLt := (_ : (fun a => a < 2) 1) }) ↔
    Adj (pathGraph 2) { val := 0, isLt := (_ : 0 < 2) } { val := 1, isLt := (_ : (fun a => a < 2) 1) }

Next tactic:
simp [pathGraph, ← Fin.coe_covby_iff]
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where
  toFun v := ⟨v, trans v.2 h⟩
  inj' := by
    rintro v w
    rw [Fin.mk.injEq]
    exact Fin.ext
  map_rel_iff' := by
    intro v w
    fin_cases v <;> fin_cases w <;> 

Proof state:
case tail.head.head
n : ℕ
h : 2 ≤ n
⊢ Adj (pathGraph n)
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        { val := 1, isLt := (_ : (fun a => a < 2) 1) })
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        { val := 0, isLt := (_ : 0 < 2) }) ↔
    Adj (pathGraph 2) { val := 1, isLt := (_ : (fun a => a < 2) 1) } { val := 0, isLt := (_ : 0 < 2) }

Next tactic:
simp [pathGraph, ← Fin.coe_covby_iff]
/-- Embedding of `pathGraph 2` into the first two elements of `pathGraph n` for `2 ≤ n` -/
def pathGraph_two_embedding (n : ℕ) (h : 2 ≤ n) : pathGraph 2 ↪g pathGraph n where
  toFun v := ⟨v, trans v.2 h⟩
  inj' := by
    rintro v w
    rw [Fin.mk.injEq]
    exact Fin.ext
  map_rel_iff' := by
    intro v w
    fin_cases v <;> fin_cases w <;> 

Proof state:
case tail.head.tail.head
n : ℕ
h : 2 ≤ n
⊢ Adj (pathGraph n)
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        { val := 1, isLt := (_ : (fun a => a < 2) 1) })
      ({ toFun := fun v => { val := ↑v, isLt := (_ : ↑v < n) },
          inj' :=
            (_ :
              ∀ ⦃v w : Fin 2⦄,
                (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) v = (fun v => { val := ↑v, isLt := (_ : ↑v < n) }) w →
                  v = w) }
        { val := 1, isLt := (_ : (fun a => a < 2) 1) }) ↔
    Adj (pathGraph 2) { val := 1, isLt := (_ : (fun a => a < 2) 1) } { val := 1, isLt := (_ : (fun a => a < 2) 1) }

Next tactic:
simp [pathGraph, ← Fin.coe_covby_iff]
theorem chromaticNumber_pathGraph (n : ℕ) (h : 2 ≤ n) :
    (pathGraph n).chromaticNumber = 2 := by
  

Proof state:
n : ℕ
h : 2 ≤ n
⊢ chromaticNumber (pathGraph n) = 2

Next tactic:
have hc := (pathGraph.bicoloring n).to_colorable
theorem chromaticNumber_pathGraph (n : ℕ) (h : 2 ≤ n) :
    (pathGraph n).chromaticNumber = 2 := by
  have hc := (pathGraph.bicoloring n).to_colorable
  

Proof state:
n : ℕ
h : 2 ≤ n
hc : Colorable (pathGraph n) (Fintype.card Bool)
⊢ chromaticNumber (pathGraph n) = 2

Next tactic:
apply le_antisymm
theorem chromaticNumber_pathGraph (n : ℕ) (h : 2 ≤ n) :
    (pathGraph n).chromaticNumber = 2 := by
  have hc := (pathGraph.bicoloring n).to_colorable
  apply le_antisymm
  · 

Proof state:
case a
n : ℕ
h : 2 ≤ n
hc : Colorable (pathGraph n) (Fintype.card Bool)
⊢ chromaticNumber (pathGraph n) ≤ 2

Next tactic:
exact chromaticNumber_le_of_colorable hc
theorem chromaticNumber_pathGraph (n : ℕ) (h : 2 ≤ n) :
    (pathGraph n).chromaticNumber = 2 := by
  have hc := (pathGraph.bicoloring n).to_colorable
  apply le_antisymm
  · exact chromaticNumber_le_of_colorable hc
  · 

Proof state:
case a
n : ℕ
h : 2 ≤ n
hc : Colorable (pathGraph n) (Fintype.card Bool)
⊢ 2 ≤ chromaticNumber (pathGraph n)

Next tactic:
simpa only [pathGraph_two_eq_top, chromaticNumber_top] using
      hc.chromaticNumber_mono_of_embedding (pathGraph_two_embedding n h)
/-- Every separable polynomial splits in the field extension `f : k →+* K` if `K` is
separably closed.

See also `IsSepClosed.splits_domain` for the case where `k` is separably closed.
-/
theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k →+* K}
    (p : k[X]) (h : p.Separable) : p.Splits f := by
  

Proof state:
k : Type u
inst✝² : Field k
K : Type v
inst✝¹ : Field K
inst✝ : IsSepClosed K
f : k →+* K
p : k[X]
h : Separable p
⊢ Splits f p

Next tactic:
convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h)
/-- Every separable polynomial splits in the field extension `f : k →+* K` if `K` is
separably closed.

See also `IsSepClosed.splits_domain` for the case where `k` is separably closed.
-/
theorem IsSepClosed.splits_codomain [IsSepClosed K] {f : k →+* K}
    (p : k[X]) (h : p.Separable) : p.Splits f := by
  convert IsSepClosed.splits_of_separable (p.map f) (Separable.map h); 

Proof state:
case a
k : Type u
inst✝² : Field k
K : Type v
inst✝¹ : Field K
inst✝ : IsSepClosed K
f : k →+* K
p : k[X]
h : Separable p
⊢ Splits f p ↔ Splits (RingHom.id K) (map f p)

Next tactic:
simp [splits_map_iff]
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] :
    ∃ z, z ^ n = x := by
  

Proof state:
k : Type u
inst✝² : Field k
K : Type v
inst✝¹ : Field K
inst✝ : IsSepClosed k
x : k
n : ℕ
hn : NeZero ↑n
⊢ ∃ z, z ^ n = x

Next tactic:
have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by
    rw [h, Nat.cast_zero] at hn
    exact hn.out rfl
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] :
    ∃ z, z ^ n = x := by
  have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by
    

Proof state:
k : Type u
inst✝² : Field k
K : Type v
inst✝¹ : Field K
inst✝ : IsSepClosed k
x : k
n : ℕ
hn : NeZero ↑n
h : n = 0
⊢ False

Next tactic:
rw [h, Nat.cast_zero] at hn
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] :
    ∃ z, z ^ n = x := by
  have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by
    rw [h, Nat.cast_zero] at hn
    

Proof state:
k : Type u
inst✝² : Field k
K : Type v
inst✝¹ : Field K
inst✝ : IsSepClosed k
x : k
n : ℕ
hn : NeZero 0
h : n = 0
⊢ False

Next tactic:
exact hn.out rfl
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] :
    ∃ z, z ^ n = x := by
  have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by
    rw [h, Nat.cast_zero] at hn
    exact hn.out rfl
  

Proof state:
k : Type u
inst✝² : Field k
K : Type v
inst✝¹ : Field K
inst✝ : IsSepClosed k
x : k
n : ℕ
hn : NeZero ↑n
hn' : 0 < n
⊢ ∃ z, z ^ n = x

Next tactic:
have : degree (X ^ n - C x) ≠ 0 := by
    rw [degree_X_pow_sub_C hn' x]
    exact (WithBot.coe_lt_coe.2 hn').ne'
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] :
    ∃ z, z ^ n = x := by
  have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by
    rw [h, Nat.cast_zero] at hn
    exact hn.out rfl
  have : degree (X ^ n - C x) ≠ 0 := by
    

Proof state:
k : Type u
inst✝² : Field k
K : Type v
inst✝¹ : Field K
inst✝ : IsSepClosed k
x : k
n : ℕ
hn : NeZero ↑n
hn' : 0 < n
⊢ degree (X ^ n - C x) ≠ 0

Next tactic:
rw [degree_X_pow_sub_C hn' x]
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] :
    ∃ z, z ^ n = x := by
  have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by
    rw [h, Nat.cast_zero] at hn
    exact hn.out rfl
  have : degree (X ^ n - C x) ≠ 0 := by
    rw [degree_X_pow_sub_C hn' x]
    

Proof state:
k : Type u
inst✝² : Field k
K : Type v
inst✝¹ : Field K
inst✝ : IsSepClosed k
x : k
n : ℕ
hn : NeZero ↑n
hn' : 0 < n
⊢ ↑n ≠ 0

Next tactic:
exact (WithBot.coe_lt_coe.2 hn').ne'
theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] :
    ∃ z, z ^ n = x := by
  have hn' : 0 < n := Nat.pos_of_ne_zero <| fun h => by
    rw [h, Nat.cast_zero] at hn
    exact hn.out rfl
  have : degree (X ^ n - C x) ≠ 0 := by
    rw [degree_X_pow_sub_C hn' x]
    exact (WithBot.coe_lt_coe.2 hn').ne'
  

Proof state:
k : Type u
inst✝² : Field k
K : Type v
inst✝¹ : Field K
inst✝ : IsSepClosed k
x : k
n : ℕ
hn : NeZero ↑n
hn' : 0 < n
this : degree (X ^ n - C x) ≠ 0
⊢ ∃ z, z ^ n = x

Next tactic:
by_cases hx : x = 0