l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem rename_rename (f : σ → τ) (g : τ → α) (p : MvPolynomial σ R) :
    rename g (rename f p) = rename (g ∘ f) p :=
  show rename g (eval₂ C (X ∘ f) p) = _ by
    simp only [rename, aeval_eq_eval₂Hom]
    -- porting note: the Lean 3 proof of this was very fragile and included a nonterminal `simp`.
    -- Hopefully this is less prone to breaking
    rw [eval₂_comp_left (eval₂Hom (algebraMap R (MvPolynomial α R)) (X ∘ g)) C (X ∘ f) p]
    simp only [(· ∘ ·), eval₂Hom_X']
    

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 : σ → τ
g : τ → α
p : MvPolynomial σ R
⊢ eval₂ (RingHom.comp (eval₂Hom (algebraMap R (MvPolynomial α R)) fun x => X (g x)) C) (fun x => X (g (f x))) p =
    (eval₂Hom (algebraMap R (MvPolynomial α R)) fun x => X (g (f x))) p

Next tactic:
refine' eval₂Hom_congr _ rfl rfl
@[simp]
theorem rename_rename (f : σ → τ) (g : τ → α) (p : MvPolynomial σ R) :
    rename g (rename f p) = rename (g ∘ f) p :=
  show rename g (eval₂ C (X ∘ f) p) = _ by
    simp only [rename, aeval_eq_eval₂Hom]
    -- porting note: the Lean 3 proof of this was very fragile and included a nonterminal `simp`.
    -- Hopefully this is less prone to breaking
    rw [eval₂_comp_left (eval₂Hom (algebraMap R (MvPolynomial α R)) (X ∘ g)) C (X ∘ f) p]
    simp only [(· ∘ ·), eval₂Hom_X']
    refine' eval₂Hom_congr _ rfl rfl
    

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 : σ → τ
g : τ → α
p : MvPolynomial σ R
⊢ RingHom.comp (eval₂Hom (algebraMap R (MvPolynomial α R)) fun x => X (g x)) C = algebraMap R (MvPolynomial α R)

Next tactic:
ext1
@[simp]
theorem rename_rename (f : σ → τ) (g : τ → α) (p : MvPolynomial σ R) :
    rename g (rename f p) = rename (g ∘ f) p :=
  show rename g (eval₂ C (X ∘ f) p) = _ by
    simp only [rename, aeval_eq_eval₂Hom]
    -- porting note: the Lean 3 proof of this was very fragile and included a nonterminal `simp`.
    -- Hopefully this is less prone to breaking
    rw [eval₂_comp_left (eval₂Hom (algebraMap R (MvPolynomial α R)) (X ∘ g)) C (X ∘ f) p]
    simp only [(· ∘ ·), eval₂Hom_X']
    refine' eval₂Hom_congr _ rfl rfl
    ext1; 

Proof state:
case a
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : σ → τ
g : τ → α
p : MvPolynomial σ R
x✝ : R
⊢ (RingHom.comp (eval₂Hom (algebraMap R (MvPolynomial α R)) fun x => X (g x)) C) x✝ =
    (algebraMap R (MvPolynomial α R)) x✝

Next tactic:
simp only [comp_apply, RingHom.coe_comp, eval₂Hom_C]
theorem rename_monomial (f : σ → τ) (d : σ →₀ ℕ) (r : R) :
    rename f (monomial d r) = monomial (d.mapDomain f) r := 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 : σ → τ
d : σ →₀ ℕ
r : R
⊢ (rename f) ((monomial d) r) = (monomial (Finsupp.mapDomain f d)) r

Next tactic:
rw [rename, aeval_monomial, monomial_eq (s := Finsupp.mapDomain f d),
    Finsupp.prod_mapDomain_index]
theorem rename_monomial (f : σ → τ) (d : σ →₀ ℕ) (r : R) :
    rename f (monomial d r) = monomial (d.mapDomain f) r := by
  rw [rename, aeval_monomial, monomial_eq (s := Finsupp.mapDomain f d),
    Finsupp.prod_mapDomain_index]
  · 

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 : σ → τ
d : σ →₀ ℕ
r : R
⊢ ((algebraMap R (MvPolynomial τ R)) r * Finsupp.prod d fun i k => (X ∘ f) i ^ k) =
    C r * Finsupp.prod d fun a m => X (f a) ^ m

Next tactic:
rfl
theorem rename_monomial (f : σ → τ) (d : σ →₀ ℕ) (r : R) :
    rename f (monomial d r) = monomial (d.mapDomain f) r := by
  rw [rename, aeval_monomial, monomial_eq (s := Finsupp.mapDomain f d),
    Finsupp.prod_mapDomain_index]
  · rfl
  · 

Proof state:
case h_zero
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : σ → τ
d : σ →₀ ℕ
r : R
⊢ ∀ (b : τ), X b ^ 0 = 1

Next tactic:
exact fun n => pow_zero _
theorem rename_monomial (f : σ → τ) (d : σ →₀ ℕ) (r : R) :
    rename f (monomial d r) = monomial (d.mapDomain f) r := by
  rw [rename, aeval_monomial, monomial_eq (s := Finsupp.mapDomain f d),
    Finsupp.prod_mapDomain_index]
  · rfl
  · exact fun n => pow_zero _
  · 

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
f : σ → τ
d : σ →₀ ℕ
r : R
⊢ ∀ (b : τ) (m₁ m₂ : ℕ), X b ^ (m₁ + m₂) = X b ^ m₁ * X b ^ m₂

Next tactic:
exact fun n i₁ i₂ => pow_add _ _ _
theorem rename_eq (f : σ → τ) (p : MvPolynomial σ R) :
    rename f p = Finsupp.mapDomain (Finsupp.mapDomain f) p := 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 : σ → τ
p : MvPolynomial σ R
⊢ (rename f) p = Finsupp.mapDomain (Finsupp.mapDomain f) p

Next tactic:
simp only [rename, aeval_def, eval₂, Finsupp.mapDomain, algebraMap_eq, comp_apply,
    X_pow_eq_monomial, ← monomial_finsupp_sum_index]
theorem rename_eq (f : σ → τ) (p : MvPolynomial σ R) :
    rename f p = Finsupp.mapDomain (Finsupp.mapDomain f) p := by
  simp only [rename, aeval_def, eval₂, Finsupp.mapDomain, algebraMap_eq, comp_apply,
    X_pow_eq_monomial, ← monomial_finsupp_sum_index]
  

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 : σ → τ
p : MvPolynomial σ R
⊢ (sum p fun s a => (monomial (sum s fun a b => fun₀ | f a => b)) a) =
    sum p fun a => Finsupp.single (sum a fun a => Finsupp.single (f a))

Next tactic:
rfl
theorem rename_injective (f : σ → τ) (hf : Function.Injective f) :
    Function.Injective (rename f : MvPolynomial σ R → MvPolynomial τ R) := 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 : σ → τ
hf : Injective f
⊢ Injective ⇑(rename f)

Next tactic:
have :
    (rename f : MvPolynomial σ R → MvPolynomial τ R) = Finsupp.mapDomain (Finsupp.mapDomain f) :=
    funext (rename_eq f)
theorem rename_injective (f : σ → τ) (hf : Function.Injective f) :
    Function.Injective (rename f : MvPolynomial σ R → MvPolynomial τ R) := by
  have :
    (rename f : MvPolynomial σ R → MvPolynomial τ R) = Finsupp.mapDomain (Finsupp.mapDomain f) :=
    funext (rename_eq f)
  

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 : σ → τ
hf : Injective f
this : ⇑(rename f) = Finsupp.mapDomain (Finsupp.mapDomain f)
⊢ Injective ⇑(rename f)

Next tactic:
rw [this]
theorem rename_injective (f : σ → τ) (hf : Function.Injective f) :
    Function.Injective (rename f : MvPolynomial σ R → MvPolynomial τ R) := by
  have :
    (rename f : MvPolynomial σ R → MvPolynomial τ R) = Finsupp.mapDomain (Finsupp.mapDomain f) :=
    funext (rename_eq f)
  rw [this]
  

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 : σ → τ
hf : Injective f
this : ⇑(rename f) = Finsupp.mapDomain (Finsupp.mapDomain f)
⊢ Injective (Finsupp.mapDomain (Finsupp.mapDomain f))

Next tactic:
exact Finsupp.mapDomain_injective (Finsupp.mapDomain_injective hf)
theorem killCompl_comp_rename : (killCompl hf).comp (rename f) = AlgHom.id R _ :=
  algHom_ext fun i => 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 : σ → τ
hf : Injective f
i : σ
⊢ (AlgHom.comp (killCompl hf) (rename f)) (X i) = (AlgHom.id R (MvPolynomial σ R)) (X i)

Next tactic:
dsimp
theorem killCompl_comp_rename : (killCompl hf).comp (rename f) = AlgHom.id R _ :=
  algHom_ext fun i => by
    dsimp
    

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 : σ → τ
hf : Injective f
i : σ
⊢ (killCompl hf) ((rename f) (X i)) = X i

Next tactic:
rw [rename, killCompl, aeval_X, comp_apply, aeval_X, dif_pos, Equiv.ofInjective_symm_apply]
/-- `MvPolynomial.rename e` is an equivalence when `e` is. -/
@[simps apply]
def renameEquiv (f : σ ≃ τ) : MvPolynomial σ R ≃ₐ[R] MvPolynomial τ R :=
  { rename f with
    toFun := rename f
    invFun := rename f.symm
    left_inv := fun p => 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 : σ ≃ τ
src✝ : MvPolynomial σ R →ₐ[R] MvPolynomial τ R := rename ⇑f
p : MvPolynomial σ R
⊢ (rename ⇑f.symm) ((rename ⇑f) p) = p

Next tactic:
rw [rename_rename, f.symm_comp_self, rename_id]
/-- `MvPolynomial.rename e` is an equivalence when `e` is. -/
@[simps apply]
def renameEquiv (f : σ ≃ τ) : MvPolynomial σ R ≃ₐ[R] MvPolynomial τ R :=
  { rename f with
    toFun := rename f
    invFun := rename f.symm
    left_inv := fun p => by rw [rename_rename, f.symm_comp_self, rename_id]
    right_inv := fun p => 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 : σ ≃ τ
src✝ : MvPolynomial σ R →ₐ[R] MvPolynomial τ R := rename ⇑f
p : MvPolynomial τ R
⊢ (rename ⇑f) ((rename ⇑f.symm) p) = p

Next tactic:
rw [rename_rename, f.self_comp_symm, rename_id]
theorem eval₂_rename : (rename k p).eval₂ f g = p.eval₂ f (g ∘ k) := 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 : R →+* S
k : σ → τ
g : τ → S
p : MvPolynomial σ R
⊢ eval₂ f g ((rename k) p) = eval₂ f (g ∘ k) p

Next tactic:
apply MvPolynomial.induction_on p
theorem eval₂_rename : (rename k p).eval₂ f g = p.eval₂ f (g ∘ k) := by
  apply MvPolynomial.induction_on p <;>
    · 

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
f : R →+* S
k : σ → τ
g : τ → S
p : MvPolynomial σ R
⊢ ∀ (a : R), eval₂ f g ((rename k) (C a)) = eval₂ f (g ∘ k) (C a)

Next tactic:
intros
theorem eval₂_rename : (rename k p).eval₂ f g = p.eval₂ f (g ∘ k) := by
  apply MvPolynomial.induction_on p <;>
    · intros
      

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
f : R →+* S
k : σ → τ
g : τ → S
p : MvPolynomial σ R
a✝ : R
⊢ eval₂ f g ((rename k) (C a✝)) = eval₂ f (g ∘ k) (C a✝)

Next tactic:
simp [*]
theorem eval₂_rename : (rename k p).eval₂ f g = p.eval₂ f (g ∘ k) := by
  apply MvPolynomial.induction_on p <;>
    · 

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
f : R →+* S
k : σ → τ
g : τ → S
p : MvPolynomial σ R
⊢ ∀ (p q : MvPolynomial σ R),
    eval₂ f g ((rename k) p) = eval₂ f (g ∘ k) p →
      eval₂ f g ((rename k) q) = eval₂ f (g ∘ k) q → eval₂ f g ((rename k) (p + q)) = eval₂ f (g ∘ k) (p + q)

Next tactic:
intros
theorem eval₂_rename : (rename k p).eval₂ f g = p.eval₂ f (g ∘ k) := by
  apply MvPolynomial.induction_on p <;>
    · intros
      

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
f : R →+* S
k : σ → τ
g : τ → S
p p✝ q✝ : MvPolynomial σ R
a✝¹ : eval₂ f g ((rename k) p✝) = eval₂ f (g ∘ k) p✝
a✝ : eval₂ f g ((rename k) q✝) = eval₂ f (g ∘ k) q✝
⊢ eval₂ f g ((rename k) (p✝ + q✝)) = eval₂ f (g ∘ k) (p✝ + q✝)

Next tactic:
simp [*]
theorem eval₂_rename : (rename k p).eval₂ f g = p.eval₂ f (g ∘ k) := by
  apply MvPolynomial.induction_on p <;>
    · 

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
f : R →+* S
k : σ → τ
g : τ → S
p : MvPolynomial σ R
⊢ ∀ (p : MvPolynomial σ R) (n : σ),
    eval₂ f g ((rename k) p) = eval₂ f (g ∘ k) p → eval₂ f g ((rename k) (p * X n)) = eval₂ f (g ∘ k) (p * X n)

Next tactic:
intros
theorem eval₂_rename : (rename k p).eval₂ f g = p.eval₂ f (g ∘ k) := by
  apply MvPolynomial.induction_on p <;>
    · intros
      

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
f : R →+* S
k : σ → τ
g : τ → S
p p✝ : MvPolynomial σ R
n✝ : σ
a✝ : eval₂ f g ((rename k) p✝) = eval₂ f (g ∘ k) p✝
⊢ eval₂ f g ((rename k) (p✝ * X n✝)) = eval₂ f (g ∘ k) (p✝ * X n✝)

Next tactic:
simp [*]
theorem rename_eval₂ (g : τ → MvPolynomial σ R) :
    rename k (p.eval₂ C (g ∘ k)) = (rename k p).eval₂ C (rename k ∘ g) := 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 : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
g : τ → MvPolynomial σ R
⊢ (rename k) (eval₂ C (g ∘ k) p) = eval₂ C (⇑(rename k) ∘ g) ((rename k) p)

Next tactic:
apply MvPolynomial.induction_on p
theorem rename_eval₂ (g : τ → MvPolynomial σ R) :
    rename k (p.eval₂ C (g ∘ k)) = (rename k p).eval₂ C (rename k ∘ g) := by
  apply MvPolynomial.induction_on p <;>
    · 

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
g : τ → MvPolynomial σ R
⊢ ∀ (a : R), (rename k) (eval₂ C (g ∘ k) (C a)) = eval₂ C (⇑(rename k) ∘ g) ((rename k) (C a))

Next tactic:
intros
theorem rename_eval₂ (g : τ → MvPolynomial σ R) :
    rename k (p.eval₂ C (g ∘ k)) = (rename k p).eval₂ C (rename k ∘ g) := by
  apply MvPolynomial.induction_on p <;>
    · intros
      

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
g : τ → MvPolynomial σ R
a✝ : R
⊢ (rename k) (eval₂ C (g ∘ k) (C a✝)) = eval₂ C (⇑(rename k) ∘ g) ((rename k) (C a✝))

Next tactic:
simp [*]
theorem rename_eval₂ (g : τ → MvPolynomial σ R) :
    rename k (p.eval₂ C (g ∘ k)) = (rename k p).eval₂ C (rename k ∘ g) := by
  apply MvPolynomial.induction_on p <;>
    · 

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
g : τ → MvPolynomial σ R
⊢ ∀ (p q : MvPolynomial σ R),
    (rename k) (eval₂ C (g ∘ k) p) = eval₂ C (⇑(rename k) ∘ g) ((rename k) p) →
      (rename k) (eval₂ C (g ∘ k) q) = eval₂ C (⇑(rename k) ∘ g) ((rename k) q) →
        (rename k) (eval₂ C (g ∘ k) (p + q)) = eval₂ C (⇑(rename k) ∘ g) ((rename k) (p + q))

Next tactic:
intros
theorem rename_eval₂ (g : τ → MvPolynomial σ R) :
    rename k (p.eval₂ C (g ∘ k)) = (rename k p).eval₂ C (rename k ∘ g) := by
  apply MvPolynomial.induction_on p <;>
    · intros
      

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
g : τ → MvPolynomial σ R
p✝ q✝ : MvPolynomial σ R
a✝¹ : (rename k) (eval₂ C (g ∘ k) p✝) = eval₂ C (⇑(rename k) ∘ g) ((rename k) p✝)
a✝ : (rename k) (eval₂ C (g ∘ k) q✝) = eval₂ C (⇑(rename k) ∘ g) ((rename k) q✝)
⊢ (rename k) (eval₂ C (g ∘ k) (p✝ + q✝)) = eval₂ C (⇑(rename k) ∘ g) ((rename k) (p✝ + q✝))

Next tactic:
simp [*]
theorem rename_eval₂ (g : τ → MvPolynomial σ R) :
    rename k (p.eval₂ C (g ∘ k)) = (rename k p).eval₂ C (rename k ∘ g) := by
  apply MvPolynomial.induction_on p <;>
    · 

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
g : τ → MvPolynomial σ R
⊢ ∀ (p : MvPolynomial σ R) (n : σ),
    (rename k) (eval₂ C (g ∘ k) p) = eval₂ C (⇑(rename k) ∘ g) ((rename k) p) →
      (rename k) (eval₂ C (g ∘ k) (p * X n)) = eval₂ C (⇑(rename k) ∘ g) ((rename k) (p * X n))

Next tactic:
intros
theorem rename_eval₂ (g : τ → MvPolynomial σ R) :
    rename k (p.eval₂ C (g ∘ k)) = (rename k p).eval₂ C (rename k ∘ g) := by
  apply MvPolynomial.induction_on p <;>
    · intros
      

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
g : τ → MvPolynomial σ R
p✝ : MvPolynomial σ R
n✝ : σ
a✝ : (rename k) (eval₂ C (g ∘ k) p✝) = eval₂ C (⇑(rename k) ∘ g) ((rename k) p✝)
⊢ (rename k) (eval₂ C (g ∘ k) (p✝ * X n✝)) = eval₂ C (⇑(rename k) ∘ g) ((rename k) (p✝ * X n✝))

Next tactic:
simp [*]
theorem rename_prod_mk_eval₂ (j : τ) (g : σ → MvPolynomial σ R) :
    rename (Prod.mk j) (p.eval₂ C g) = p.eval₂ C fun x => rename (Prod.mk j) (g x) := 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 : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
j : τ
g : σ → MvPolynomial σ R
⊢ (rename (Prod.mk j)) (eval₂ C g p) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) p

Next tactic:
apply MvPolynomial.induction_on p
theorem rename_prod_mk_eval₂ (j : τ) (g : σ → MvPolynomial σ R) :
    rename (Prod.mk j) (p.eval₂ C g) = p.eval₂ C fun x => rename (Prod.mk j) (g x) := by
  apply MvPolynomial.induction_on p <;>
    · 

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
j : τ
g : σ → MvPolynomial σ R
⊢ ∀ (a : R), (rename (Prod.mk j)) (eval₂ C g (C a)) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) (C a)

Next tactic:
intros
theorem rename_prod_mk_eval₂ (j : τ) (g : σ → MvPolynomial σ R) :
    rename (Prod.mk j) (p.eval₂ C g) = p.eval₂ C fun x => rename (Prod.mk j) (g x) := by
  apply MvPolynomial.induction_on p <;>
    · intros
      

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
j : τ
g : σ → MvPolynomial σ R
a✝ : R
⊢ (rename (Prod.mk j)) (eval₂ C g (C a✝)) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) (C a✝)

Next tactic:
simp [*]
theorem rename_prod_mk_eval₂ (j : τ) (g : σ → MvPolynomial σ R) :
    rename (Prod.mk j) (p.eval₂ C g) = p.eval₂ C fun x => rename (Prod.mk j) (g x) := by
  apply MvPolynomial.induction_on p <;>
    · 

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
j : τ
g : σ → MvPolynomial σ R
⊢ ∀ (p q : MvPolynomial σ R),
    (rename (Prod.mk j)) (eval₂ C g p) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) p →
      (rename (Prod.mk j)) (eval₂ C g q) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) q →
        (rename (Prod.mk j)) (eval₂ C g (p + q)) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) (p + q)

Next tactic:
intros
theorem rename_prod_mk_eval₂ (j : τ) (g : σ → MvPolynomial σ R) :
    rename (Prod.mk j) (p.eval₂ C g) = p.eval₂ C fun x => rename (Prod.mk j) (g x) := by
  apply MvPolynomial.induction_on p <;>
    · intros
      

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
j : τ
g : σ → MvPolynomial σ R
p✝ q✝ : MvPolynomial σ R
a✝¹ : (rename (Prod.mk j)) (eval₂ C g p✝) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) p✝
a✝ : (rename (Prod.mk j)) (eval₂ C g q✝) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) q✝
⊢ (rename (Prod.mk j)) (eval₂ C g (p✝ + q✝)) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) (p✝ + q✝)

Next tactic:
simp [*]
theorem rename_prod_mk_eval₂ (j : τ) (g : σ → MvPolynomial σ R) :
    rename (Prod.mk j) (p.eval₂ C g) = p.eval₂ C fun x => rename (Prod.mk j) (g x) := by
  apply MvPolynomial.induction_on p <;>
    · 

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
j : τ
g : σ → MvPolynomial σ R
⊢ ∀ (p : MvPolynomial σ R) (n : σ),
    (rename (Prod.mk j)) (eval₂ C g p) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) p →
      (rename (Prod.mk j)) (eval₂ C g (p * X n)) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) (p * X n)

Next tactic:
intros
theorem rename_prod_mk_eval₂ (j : τ) (g : σ → MvPolynomial σ R) :
    rename (Prod.mk j) (p.eval₂ C g) = p.eval₂ C fun x => rename (Prod.mk j) (g x) := by
  apply MvPolynomial.induction_on p <;>
    · intros
      

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p : MvPolynomial σ R
j : τ
g : σ → MvPolynomial σ R
p✝ : MvPolynomial σ R
n✝ : σ
a✝ : (rename (Prod.mk j)) (eval₂ C g p✝) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) p✝
⊢ (rename (Prod.mk j)) (eval₂ C g (p✝ * X n✝)) = eval₂ C (fun x => (rename (Prod.mk j)) (g x)) (p✝ * X n✝)

Next tactic:
simp [*]
theorem eval₂_rename_prod_mk (g : σ × τ → S) (i : σ) (p : MvPolynomial τ R) :
    (rename (Prod.mk i) p).eval₂ f g = eval₂ f (fun j => g (i, j)) p := 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 : R →+* S
k : σ → τ
g✝ : τ → S
p✝ : MvPolynomial σ R
g : σ × τ → S
i : σ
p : MvPolynomial τ R
⊢ eval₂ f g ((rename (Prod.mk i)) p) = eval₂ f (fun j => g (i, j)) p

Next tactic:
apply MvPolynomial.induction_on p
theorem eval₂_rename_prod_mk (g : σ × τ → S) (i : σ) (p : MvPolynomial τ R) :
    (rename (Prod.mk i) p).eval₂ f g = eval₂ f (fun j => g (i, j)) p := by
  apply MvPolynomial.induction_on p <;>
    · 

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p✝ : MvPolynomial σ R
g : σ × τ → S
i : σ
p : MvPolynomial τ R
⊢ ∀ (a : R), eval₂ f g ((rename (Prod.mk i)) (C a)) = eval₂ f (fun j => g (i, j)) (C a)

Next tactic:
intros
theorem eval₂_rename_prod_mk (g : σ × τ → S) (i : σ) (p : MvPolynomial τ R) :
    (rename (Prod.mk i) p).eval₂ f g = eval₂ f (fun j => g (i, j)) p := by
  apply MvPolynomial.induction_on p <;>
    · intros
      

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p✝ : MvPolynomial σ R
g : σ × τ → S
i : σ
p : MvPolynomial τ R
a✝ : R
⊢ eval₂ f g ((rename (Prod.mk i)) (C a✝)) = eval₂ f (fun j => g (i, j)) (C a✝)

Next tactic:
simp [*]
theorem eval₂_rename_prod_mk (g : σ × τ → S) (i : σ) (p : MvPolynomial τ R) :
    (rename (Prod.mk i) p).eval₂ f g = eval₂ f (fun j => g (i, j)) p := by
  apply MvPolynomial.induction_on p <;>
    · 

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p✝ : MvPolynomial σ R
g : σ × τ → S
i : σ
p : MvPolynomial τ R
⊢ ∀ (p q : MvPolynomial τ R),
    eval₂ f g ((rename (Prod.mk i)) p) = eval₂ f (fun j => g (i, j)) p →
      eval₂ f g ((rename (Prod.mk i)) q) = eval₂ f (fun j => g (i, j)) q →
        eval₂ f g ((rename (Prod.mk i)) (p + q)) = eval₂ f (fun j => g (i, j)) (p + q)

Next tactic:
intros
theorem eval₂_rename_prod_mk (g : σ × τ → S) (i : σ) (p : MvPolynomial τ R) :
    (rename (Prod.mk i) p).eval₂ f g = eval₂ f (fun j => g (i, j)) p := by
  apply MvPolynomial.induction_on p <;>
    · intros
      

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
f : R →+* S
k : σ → τ
g✝ : τ → S
p✝¹ : MvPolynomial σ R
g : σ × τ → S
i : σ
p p✝ q✝ : MvPolynomial τ R
a✝¹ : eval₂ f g ((rename (Prod.mk i)) p✝) = eval₂ f (fun j => g (i, j)) p✝
a✝ : eval₂ f g ((rename (Prod.mk i)) q✝) = eval₂ f (fun j => g (i, j)) q✝
⊢ eval₂ f g ((rename (Prod.mk i)) (p✝ + q✝)) = eval₂ f (fun j => g (i, j)) (p✝ + q✝)

Next tactic:
simp [*]