File: Mathlib/Algebra/MvPolynomial/Equiv.lean

full_name: MvPolynomial.pUnitAlgEquiv_apply
code: /-- The ring isomorphism between multivariable polynomials in a single variable and
polynomials over the ground ring.
-/
@[simps]
def pUnitAlgEquiv : MvPolynomial PUnit R ≃ₐ[R] R[X] 
goal: (MvPolynomial.pUnitAlgEquiv R) p = MvPolynomial.eval₂ Polynomial.C (fun x => Polynomial.X) p

full_name: MvPolynomial.pUnitAlgEquiv
code: /-- The ring isomorphism between multivariable polynomials in a single variable and
polynomials over the ground ring.
-/
@[simps]
def pUnitAlgEquiv : MvPolynomial PUnit R ≃ₐ[R] R[X] 
goal: MvPolynomial PUnit.{u_2 + 1} R ≃ₐ[R] R[X]

full_name: MvPolynomial.pUnitAlgEquiv_symm_apply
code: /-- The ring isomorphism between multivariable polynomials in a single variable and
polynomials over the ground ring.
-/
@[simps]
def pUnitAlgEquiv : MvPolynomial PUnit R ≃ₐ[R] R[X] 
goal: (MvPolynomial.pUnitAlgEquiv R).symm p = Polynomial.eval₂ MvPolynomial.C (MvPolynomial.X PUnit.unit) p

full_name: MvPolynomial.mapEquiv
code: /-- If `e : A ≃+* B` is an isomorphism of rings, then so is `map e`. -/
@[simps apply]
def mapEquiv [CommSemiring S₁] [CommSemiring S₂] (e : S₁ ≃+* S₂) :
    MvPolynomial σ S₁ ≃+* MvPolynomial σ S₂ 
goal: MvPolynomial σ S₁ ≃+* MvPolynomial σ S₂

full_name: MvPolynomial.mapEquiv_apply
code: /-- If `e : A ≃+* B` is an isomorphism of rings, then so is `map e`. -/
@[simps apply]
def mapEquiv [CommSemiring S₁] [CommSemiring S₂] (e : S₁ ≃+* S₂) :
    MvPolynomial σ S₁ ≃+* MvPolynomial σ S₂ 
goal: (MvPolynomial.mapEquiv σ e) a = (MvPolynomial.map ↑e) a

full_name: MvPolynomial.mapEquiv_refl
code: @[simp]
theorem mapEquiv_refl : mapEquiv σ (RingEquiv.refl R) = RingEquiv.refl _ 
goal: MvPolynomial.mapEquiv σ (RingEquiv.refl R) = RingEquiv.refl (MvPolynomial σ R)

full_name: MvPolynomial.mapEquiv_symm
code: @[simp]
theorem mapEquiv_symm [CommSemiring S₁] [CommSemiring S₂] (e : S₁ ≃+* S₂) :
    (mapEquiv σ e).symm = mapEquiv σ e.symm 
goal: (MvPolynomial.mapEquiv σ e).symm = MvPolynomial.mapEquiv σ e.symm

full_name: MvPolynomial.mapEquiv_trans
code: @[simp]
theorem mapEquiv_trans [CommSemiring S₁] [CommSemiring S₂] [CommSemiring S₃] (e : S₁ ≃+* S₂)
    (f : S₂ ≃+* S₃) : (mapEquiv σ e).trans (mapEquiv σ f) = mapEquiv σ (e.trans f) 
goal: (MvPolynomial.mapEquiv σ e).trans (MvPolynomial.mapEquiv σ f) = MvPolynomial.mapEquiv σ (e.trans f)

full_name: MvPolynomial.mapAlgEquiv_apply
code: /-- If `e : A ≃ₐ[R] B` is an isomorphism of `R`-algebras, then so is `map e`. -/
@[simps apply]
def mapAlgEquiv (e : A₁ ≃ₐ[R] A₂) : MvPolynomial σ A₁ ≃ₐ[R] MvPolynomial σ A₂ 
goal: (MvPolynomial.mapAlgEquiv σ e) a = (MvPolynomial.map ↑e) a

full_name: MvPolynomial.mapAlgEquiv
code: /-- If `e : A ≃ₐ[R] B` is an isomorphism of `R`-algebras, then so is `map e`. -/
@[simps apply]
def mapAlgEquiv (e : A₁ ≃ₐ[R] A₂) : MvPolynomial σ A₁ ≃ₐ[R] MvPolynomial σ A₂ 
goal: MvPolynomial σ A₁ ≃ₐ[R] MvPolynomial σ A₂

full_name: MvPolynomial.mapAlgEquiv_refl
code: @[simp]
theorem mapAlgEquiv_refl : mapAlgEquiv σ (AlgEquiv.refl : A₁ ≃ₐ[R] A₁) = AlgEquiv.refl 
goal: MvPolynomial.mapAlgEquiv σ AlgEquiv.refl = AlgEquiv.refl

full_name: MvPolynomial.mapAlgEquiv_symm
code: @[simp]
theorem mapAlgEquiv_symm (e : A₁ ≃ₐ[R] A₂) : (mapAlgEquiv σ e).symm = mapAlgEquiv σ e.symm 
goal: (MvPolynomial.mapAlgEquiv σ e).symm = MvPolynomial.mapAlgEquiv σ e.symm

full_name: MvPolynomial.mapAlgEquiv_trans
code: @[simp]
theorem mapAlgEquiv_trans (e : A₁ ≃ₐ[R] A₂) (f : A₂ ≃ₐ[R] A₃) :
    (mapAlgEquiv σ e).trans (mapAlgEquiv σ f) = mapAlgEquiv σ (e.trans f) 
goal: (MvPolynomial.mapAlgEquiv σ e).trans (MvPolynomial.mapAlgEquiv σ f) = MvPolynomial.mapAlgEquiv σ (e.trans f)

full_name: MvPolynomial.sumToIter
code: /-- The function from multivariable polynomials in a sum of two types,
to multivariable polynomials in one of the types,
with coefficients in multivariable polynomials in the other type.

See `sumRingEquiv` for the ring isomorphism.
-/
def sumToIter : MvPolynomial (S₁ ⊕ S₂) R →+* MvPolynomial S₁ (MvPolynomial S₂ R) 
goal: MvPolynomial (S₁ ⊕ S₂) R →+* MvPolynomial S₁ (MvPolynomial S₂ R)

full_name: MvPolynomial.sumToIter_C
code: @[simp]
theorem sumToIter_C (a : R) : sumToIter R S₁ S₂ (C a) = C (C a) 
goal: (MvPolynomial.sumToIter R S₁ S₂) (MvPolynomial.C a) = MvPolynomial.C (MvPolynomial.C a)

full_name: MvPolynomial.sumToIter_Xl
code: @[simp]
theorem sumToIter_Xl (b : S₁) : sumToIter R S₁ S₂ (X (Sum.inl b)) = X b 
goal: (MvPolynomial.sumToIter R S₁ S₂) (MvPolynomial.X (Sum.inl b)) = MvPolynomial.X b

full_name: MvPolynomial.sumToIter_Xr
code: @[simp]
theorem sumToIter_Xr (c : S₂) : sumToIter R S₁ S₂ (X (Sum.inr c)) = C (X c) 
goal: (MvPolynomial.sumToIter R S₁ S₂) (MvPolynomial.X (Sum.inr c)) = MvPolynomial.C (MvPolynomial.X c)

full_name: MvPolynomial.iterToSum
code: /-- The function from multivariable polynomials in one type,
with coefficients in multivariable polynomials in another type,
to multivariable polynomials in the sum of the two types.

See `sumRingEquiv` for the ring isomorphism.
-/
def iterToSum : MvPolynomial S₁ (MvPolynomial S₂ R) →+* MvPolynomial (S₁ ⊕ S₂) R 
goal: MvPolynomial S₁ (MvPolynomial S₂ R) →+* MvPolynomial (S₁ ⊕ S₂) R

full_name: MvPolynomial.iterToSum_C_C
code: @[simp]
theorem iterToSum_C_C (a : R) : iterToSum R S₁ S₂ (C (C a)) = C a 
goal: (MvPolynomial.iterToSum R S₁ S₂) (MvPolynomial.C (MvPolynomial.C a)) = MvPolynomial.C a

full_name: MvPolynomial.iterToSum_X
code: @[simp]
theorem iterToSum_X (b : S₁) : iterToSum R S₁ S₂ (X b) = X (Sum.inl b) 
goal: (MvPolynomial.iterToSum R S₁ S₂) (MvPolynomial.X b) = MvPolynomial.X (Sum.inl b)

full_name: MvPolynomial.iterToSum_C_X
code: @[simp]
theorem iterToSum_C_X (c : S₂) : iterToSum R S₁ S₂ (C (X c)) = X (Sum.inr c) 
goal: (MvPolynomial.iterToSum R S₁ S₂) (MvPolynomial.C (MvPolynomial.X c)) = MvPolynomial.X (Sum.inr c)

full_name: MvPolynomial.isEmptyAlgEquiv
code: /-- The algebra isomorphism between multivariable polynomials in no variables
and the ground ring. -/
@[simps!]
def isEmptyAlgEquiv [he : IsEmpty σ] : MvPolynomial σ R ≃ₐ[R] R 
goal: MvPolynomial σ R ≃ₐ[R] R

full_name: MvPolynomial.isEmptyAlgEquiv_apply
code: /-- The algebra isomorphism between multivariable polynomials in no variables
and the ground ring. -/
@[simps!]
def isEmptyAlgEquiv [he : IsEmpty σ] : MvPolynomial σ R ≃ₐ[R] R 
goal: (MvPolynomial.isEmptyAlgEquiv R σ) a = (MvPolynomial.aeval fun a => he.elim a) a

full_name: MvPolynomial.isEmptyAlgEquiv_symm_apply_toFun
code: /-- The algebra isomorphism between multivariable polynomials in no variables
and the ground ring. -/
@[simps!]
def isEmptyAlgEquiv [he : IsEmpty σ] : MvPolynomial σ R ≃ₐ[R] R 
goal: ((MvPolynomial.isEmptyAlgEquiv R σ).symm a) j = Pi.single 0 a j

full_name: MvPolynomial.isEmptyAlgEquiv_symm_apply_support
code: /-- The algebra isomorphism between multivariable polynomials in no variables
and the ground ring. -/
@[simps!]
def isEmptyAlgEquiv [he : IsEmpty σ] : MvPolynomial σ R ≃ₐ[R] R 
goal: ((MvPolynomial.isEmptyAlgEquiv R σ).symm a).support = if a = 0 then ∅ else {0}

full_name: MvPolynomial.isEmptyRingEquiv_symm_apply_support
code: /-- The ring isomorphism between multivariable polynomials in no variables
and the ground ring. -/
@[simps!]
def isEmptyRingEquiv [IsEmpty σ] : MvPolynomial σ R ≃+* R 
goal: ((MvPolynomial.isEmptyRingEquiv R σ).symm a).support = if a = 0 then ∅ else {0}

full_name: MvPolynomial.isEmptyRingEquiv_apply
code: /-- The ring isomorphism between multivariable polynomials in no variables
and the ground ring. -/
@[simps!]
def isEmptyRingEquiv [IsEmpty σ] : MvPolynomial σ R ≃+* R 
goal: (MvPolynomial.isEmptyRingEquiv R σ) a = (MvPolynomial.aeval fun a => inst✝.elim a) a

full_name: MvPolynomial.isEmptyRingEquiv
code: /-- The ring isomorphism between multivariable polynomials in no variables
and the ground ring. -/
@[simps!]
def isEmptyRingEquiv [IsEmpty σ] : MvPolynomial σ R ≃+* R 
goal: MvPolynomial σ R ≃+* R

full_name: MvPolynomial.isEmptyRingEquiv_symm_apply_toFun
code: /-- The ring isomorphism between multivariable polynomials in no variables
and the ground ring. -/
@[simps!]
def isEmptyRingEquiv [IsEmpty σ] : MvPolynomial σ R ≃+* R 
goal: ((MvPolynomial.isEmptyRingEquiv R σ).symm a) j = Pi.single 0 a j

full_name: MvPolynomial.mvPolynomialEquivMvPolynomial
code: /-- A helper function for `sumRingEquiv`. -/
@[simps]
def mvPolynomialEquivMvPolynomial [CommSemiring S₃] (f : MvPolynomial S₁ R →+* MvPolynomial S₂ S₃)
    (g : MvPolynomial S₂ S₃ →+* MvPolynomial S₁ R) (hfgC : (f.comp g).comp C = C)
    (hfgX : ∀ n, f (g (X n)) = X n) (hgfC : (g.comp f).comp C = C) (hgfX : ∀ n, g (f (X n)) = X n) :
    MvPolynomial S₁ R ≃+* MvPolynomial S₂ S₃ 
goal: MvPolynomial S₁ R ≃+* MvPolynomial S₂ S₃

full_name: MvPolynomial.mvPolynomialEquivMvPolynomial_apply
code: /-- A helper function for `sumRingEquiv`. -/
@[simps]
def mvPolynomialEquivMvPolynomial [CommSemiring S₃] (f : MvPolynomial S₁ R →+* MvPolynomial S₂ S₃)
    (g : MvPolynomial S₂ S₃ →+* MvPolynomial S₁ R) (hfgC : (f.comp g).comp C = C)
    (hfgX : ∀ n, f (g (X n)) = X n) (hgfC : (g.comp f).comp C = C) (hgfX : ∀ n, g (f (X n)) = X n) :
    MvPolynomial S₁ R ≃+* MvPolynomial S₂ S₃ 
goal: (MvPolynomial.mvPolynomialEquivMvPolynomial R S₁ S₂ S₃ f g hfgC hfgX hgfC hgfX) a = f a

full_name: MvPolynomial.mvPolynomialEquivMvPolynomial_symm_apply
code: /-- A helper function for `sumRingEquiv`. -/
@[simps]
def mvPolynomialEquivMvPolynomial [CommSemiring S₃] (f : MvPolynomial S₁ R →+* MvPolynomial S₂ S₃)
    (g : MvPolynomial S₂ S₃ →+* MvPolynomial S₁ R) (hfgC : (f.comp g).comp C = C)
    (hfgX : ∀ n, f (g (X n)) = X n) (hgfC : (g.comp f).comp C = C) (hgfX : ∀ n, g (f (X n)) = X n) :
    MvPolynomial S₁ R ≃+* MvPolynomial S₂ S₃ 
goal: (MvPolynomial.mvPolynomialEquivMvPolynomial R S₁ S₂ S₃ f g hfgC hfgX hgfC hgfX).symm a = g a

full_name: MvPolynomial.sumRingEquiv
code: /-- The ring isomorphism between multivariable polynomials in a sum of two types,
and multivariable polynomials in one of the types,
with coefficients in multivariable polynomials in the other type.
-/
def sumRingEquiv : MvPolynomial (S₁ ⊕ S₂) R ≃+* MvPolynomial S₁ (MvPolynomial S₂ R) 
goal: MvPolynomial (S₁ ⊕ S₂) R ≃+* MvPolynomial S₁ (MvPolynomial S₂ R)

full_name: MvPolynomial.sumAlgEquiv_symm_apply
code: /-- The algebra isomorphism between multivariable polynomials in a sum of two types,
and multivariable polynomials in one of the types,
with coefficients in multivariable polynomials in the other type.
-/
@[simps!]
def sumAlgEquiv : MvPolynomial (S₁ ⊕ S₂) R ≃ₐ[R] MvPolynomial S₁ (MvPolynomial S₂ R) 
goal: (MvPolynomial.sumAlgEquiv R S₁ S₂).symm a = (MvPolynomial.iterToSum R S₁ S₂) a

full_name: MvPolynomial.sumAlgEquiv
code: /-- The algebra isomorphism between multivariable polynomials in a sum of two types,
and multivariable polynomials in one of the types,
with coefficients in multivariable polynomials in the other type.
-/
@[simps!]
def sumAlgEquiv : MvPolynomial (S₁ ⊕ S₂) R ≃ₐ[R] MvPolynomial S₁ (MvPolynomial S₂ R) 
goal: MvPolynomial (S₁ ⊕ S₂) R ≃ₐ[R] MvPolynomial S₁ (MvPolynomial S₂ R)

full_name: MvPolynomial.sumAlgEquiv_apply
code: /-- The algebra isomorphism between multivariable polynomials in a sum of two types,
and multivariable polynomials in one of the types,
with coefficients in multivariable polynomials in the other type.
-/
@[simps!]
def sumAlgEquiv : MvPolynomial (S₁ ⊕ S₂) R ≃ₐ[R] MvPolynomial S₁ (MvPolynomial S₂ R) 
goal: (MvPolynomial.sumAlgEquiv R S₁ S₂) a = (MvPolynomial.sumToIter R S₁ S₂) a

full_name: MvPolynomial.optionEquivLeft
code: /-- The algebra isomorphism between multivariable polynomials in `Option S₁` and
polynomials with coefficients in `MvPolynomial S₁ R`.
-/
@[simps!]
def optionEquivLeft : MvPolynomial (Option S₁) R ≃ₐ[R] Polynomial (MvPolynomial S₁ R) 
goal: MvPolynomial (Option S₁) R ≃ₐ[R] (MvPolynomial S₁ R)[X]

full_name: MvPolynomial.optionEquivLeft_symm_apply
code: /-- The algebra isomorphism between multivariable polynomials in `Option S₁` and
polynomials with coefficients in `MvPolynomial S₁ R`.
-/
@[simps!]
def optionEquivLeft : MvPolynomial (Option S₁) R ≃ₐ[R] Polynomial (MvPolynomial S₁ R) 
goal: (MvPolynomial.optionEquivLeft R S₁).symm a = (Polynomial.aevalTower (MvPolynomial.rename some) (MvPolynomial.X none)) a

full_name: MvPolynomial.optionEquivLeft_apply
code: /-- The algebra isomorphism between multivariable polynomials in `Option S₁` and
polynomials with coefficients in `MvPolynomial S₁ R`.
-/
@[simps!]
def optionEquivLeft : MvPolynomial (Option S₁) R ≃ₐ[R] Polynomial (MvPolynomial S₁ R) 
goal: (MvPolynomial.optionEquivLeft R S₁) a =
  (MvPolynomial.aeval fun o => o.elim Polynomial.X fun s => Polynomial.C (MvPolynomial.X s)) a

full_name: MvPolynomial.optionEquivLeft_X_some
code: lemma optionEquivLeft_X_some (x : S₁) : optionEquivLeft R S₁ (X (some x)) = Polynomial.C (X x) 
goal: (MvPolynomial.optionEquivLeft R S₁) (MvPolynomial.X (some x)) = Polynomial.C (MvPolynomial.X x)

full_name: MvPolynomial.optionEquivLeft_X_none
code: lemma optionEquivLeft_X_none : optionEquivLeft R S₁ (X none) = Polynomial.X 
goal: (MvPolynomial.optionEquivLeft R S₁) (MvPolynomial.X none) = Polynomial.X

full_name: MvPolynomial.optionEquivLeft_C
code: lemma optionEquivLeft_C (r : R) : optionEquivLeft R S₁ (C r) = Polynomial.C (C r) 
goal: (MvPolynomial.optionEquivLeft R S₁) (MvPolynomial.C r) = Polynomial.C (MvPolynomial.C r)

full_name: MvPolynomial.optionEquivRight_apply
code: /-- The algebra isomorphism between multivariable polynomials in `Option S₁` and
multivariable polynomials with coefficients in polynomials.
-/
@[simps!]
def optionEquivRight : MvPolynomial (Option S₁) R ≃ₐ[R] MvPolynomial S₁ R[X] 
goal: (MvPolynomial.optionEquivRight R S₁) a =
  (MvPolynomial.aeval fun o => o.elim (MvPolynomial.C Polynomial.X) MvPolynomial.X) a

full_name: MvPolynomial.optionEquivRight
code: /-- The algebra isomorphism between multivariable polynomials in `Option S₁` and
multivariable polynomials with coefficients in polynomials.
-/
@[simps!]
def optionEquivRight : MvPolynomial (Option S₁) R ≃ₐ[R] MvPolynomial S₁ R[X] 
goal: MvPolynomial (Option S₁) R ≃ₐ[R] MvPolynomial S₁ R[X]

full_name: MvPolynomial.optionEquivRight_symm_apply
code: /-- The algebra isomorphism between multivariable polynomials in `Option S₁` and
multivariable polynomials with coefficients in polynomials.
-/
@[simps!]
def optionEquivRight : MvPolynomial (Option S₁) R ≃ₐ[R] MvPolynomial S₁ R[X] 
goal: (MvPolynomial.optionEquivRight R S₁).symm a =
  (MvPolynomial.aevalTower (Polynomial.aeval (MvPolynomial.X none)) fun i => MvPolynomial.X (some i)) a

full_name: MvPolynomial.optionEquivRight_X_some
code: lemma optionEquivRight_X_some (x : S₁) : optionEquivRight R S₁ (X (some x)) = X x 
goal: (MvPolynomial.optionEquivRight R S₁) (MvPolynomial.X (some x)) = MvPolynomial.X x

full_name: MvPolynomial.optionEquivRight_X_none
code: lemma optionEquivRight_X_none : optionEquivRight R S₁ (X none) = C Polynomial.X 
goal: (MvPolynomial.optionEquivRight R S₁) (MvPolynomial.X none) = MvPolynomial.C Polynomial.X

full_name: MvPolynomial.optionEquivRight_C
code: lemma optionEquivRight_C (r : R) : optionEquivRight R S₁ (C r) = C (Polynomial.C r) 
goal: (MvPolynomial.optionEquivRight R S₁) (MvPolynomial.C r) = MvPolynomial.C (Polynomial.C r)

full_name: MvPolynomial.finSuccEquiv
code: /-- The algebra isomorphism between multivariable polynomials in `Fin (n + 1)` and
polynomials over multivariable polynomials in `Fin n`.
-/
def finSuccEquiv : MvPolynomial (Fin (n + 1)) R ≃ₐ[R] Polynomial (MvPolynomial (Fin n) R) 
goal: MvPolynomial (Fin (n + 1)) R ≃ₐ[R] (MvPolynomial (Fin n) R)[X]

full_name: MvPolynomial.finSuccEquiv_eq
code: theorem finSuccEquiv_eq :
    (finSuccEquiv R n : MvPolynomial (Fin (n + 1)) R →+* Polynomial (MvPolynomial (Fin n) R)) =
      eval₂Hom (Polynomial.C.comp (C : R →+* MvPolynomial (Fin n) R)) fun i : Fin (n + 1) =>
        Fin.cases Polynomial.X (fun k => Polynomial.C (X k)) i 
goal: ↑(MvPolynomial.finSuccEquiv R n) =
  MvPolynomial.eval₂Hom (Polynomial.C.comp MvPolynomial.C) fun i =>
    Fin.cases Polynomial.X (fun k => Polynomial.C (MvPolynomial.X k)) i

full_name: MvPolynomial.finSuccEquiv_apply
code: @[simp]
theorem finSuccEquiv_apply (p : MvPolynomial (Fin (n + 1)) R) :
    finSuccEquiv R n p =
      eval₂Hom (Polynomial.C.comp (C : R →+* MvPolynomial (Fin n) R))
        (fun i : Fin (n + 1) => Fin.cases Polynomial.X (fun k => Polynomial.C (X k)) i) p 
goal: (MvPolynomial.finSuccEquiv R n) p =
  (MvPolynomial.eval₂Hom (Polynomial.C.comp MvPolynomial.C) fun i =>
      Fin.cases Polynomial.X (fun k => Polynomial.C (MvPolynomial.X k)) i)
    p

full_name: MvPolynomial.finSuccEquiv_comp_C_eq_C
code: theorem finSuccEquiv_comp_C_eq_C {R : Type u} [CommSemiring R] (n : ℕ) :
    (↑(MvPolynomial.finSuccEquiv R n).symm : Polynomial (MvPolynomial (Fin n) R) →+* _).comp
        (Polynomial.C.comp MvPolynomial.C) =
      (MvPolynomial.C : R →+* MvPolynomial (Fin n.succ) R) 
goal: (↑(MvPolynomial.finSuccEquiv R n).symm).comp (Polynomial.C.comp MvPolynomial.C) = MvPolynomial.C

full_name: MvPolynomial.finSuccEquiv_X_zero
code: theorem finSuccEquiv_X_zero : finSuccEquiv R n (X 0) = Polynomial.X 
goal: (MvPolynomial.finSuccEquiv R n) (MvPolynomial.X 0) = Polynomial.X

full_name: MvPolynomial.finSuccEquiv_X_succ
code: theorem finSuccEquiv_X_succ {j : Fin n} : finSuccEquiv R n (X j.succ) = Polynomial.C (X j) 
goal: (MvPolynomial.finSuccEquiv R n) (MvPolynomial.X j.succ) = Polynomial.C (MvPolynomial.X j)

full_name: MvPolynomial.finSuccEquiv_coeff_coeff
code: /-- The coefficient of `m` in the `i`-th coefficient of `finSuccEquiv R n f` equals the
    coefficient of `Finsupp.cons i m` in `f`. -/
theorem finSuccEquiv_coeff_coeff (m : Fin n →₀ ℕ) (f : MvPolynomial (Fin (n + 1)) R) (i : ℕ) :
    coeff m (Polynomial.coeff (finSuccEquiv R n f) i) = coeff (m.cons i) f 
goal: MvPolynomial.coeff m (((MvPolynomial.finSuccEquiv R n) f).coeff i) = MvPolynomial.coeff (Finsupp.cons i m) f

full_name: MvPolynomial.eval_eq_eval_mv_eval'
code: theorem eval_eq_eval_mv_eval' (s : Fin n → R) (y : R) (f : MvPolynomial (Fin (n + 1)) R) :
    eval (Fin.cons y s : Fin (n + 1) → R) f =
      Polynomial.eval y (Polynomial.map (eval s) (finSuccEquiv R n f)) 
goal: (MvPolynomial.eval (Fin.cons y s)) f =
  Polynomial.eval y (Polynomial.map (MvPolynomial.eval s) ((MvPolynomial.finSuccEquiv R n) f))

full_name: MvPolynomial.coeff_eval_eq_eval_coeff
code: theorem coeff_eval_eq_eval_coeff (s' : Fin n → R) (f : Polynomial (MvPolynomial (Fin n) R))
    (i : ℕ) : Polynomial.coeff (Polynomial.map (eval s') f) i = eval s' (Polynomial.coeff f i) 
goal: (Polynomial.map (MvPolynomial.eval s') f).coeff i = (MvPolynomial.eval s') (f.coeff i)

full_name: MvPolynomial.support_coeff_finSuccEquiv
code: theorem support_coeff_finSuccEquiv {f : MvPolynomial (Fin (n + 1)) R} {i : ℕ} {m : Fin n →₀ ℕ} :
    m ∈ (Polynomial.coeff ((finSuccEquiv R n) f) i).support ↔ Finsupp.cons i m ∈ f.support 
goal: m ∈ (((MvPolynomial.finSuccEquiv R n) f).coeff i).support ↔ Finsupp.cons i m ∈ f.support

full_name: MvPolynomial.totalDegree_coeff_finSuccEquiv_add_le
code: /--
The `totalDegree` of a multivariable polynomial `p` is at least `i` more than the `totalDegree` of
the `i`th coefficient of `finSuccEquiv` applied to `p`, if this is nonzero.
-/
lemma totalDegree_coeff_finSuccEquiv_add_le (f : MvPolynomial (Fin (n + 1)) R) (i : ℕ)
    (hi : (finSuccEquiv R n f).coeff i ≠ 0) :
    totalDegree ((finSuccEquiv R n f).coeff i) + i ≤ totalDegree f 
goal: (((MvPolynomial.finSuccEquiv R n) f).coeff i).totalDegree + i ≤ f.totalDegree

full_name: MvPolynomial.finSuccEquiv_support
code: theorem finSuccEquiv_support (f : MvPolynomial (Fin (n + 1)) R) :
    (finSuccEquiv R n f).support = Finset.image (fun m : Fin (n + 1) →₀ ℕ => m 0) f.support 
goal: ((MvPolynomial.finSuccEquiv R n) f).support = Finset.image (fun m => m 0) f.support

full_name: MvPolynomial.finSuccEquiv_support'
code: theorem finSuccEquiv_support' {f : MvPolynomial (Fin (n + 1)) R} {i : ℕ} :
    Finset.image (Finsupp.cons i) (Polynomial.coeff ((finSuccEquiv R n) f) i).support =
      f.support.filter fun m => m 0 = i 
goal: Finset.image (Finsupp.cons i) (((MvPolynomial.finSuccEquiv R n) f).coeff i).support =
  Finset.filter (fun m => m 0 = i) f.support

full_name: MvPolynomial.support_finSuccEquiv_nonempty
code: theorem support_finSuccEquiv_nonempty {f : MvPolynomial (Fin (n + 1)) R} (h : f ≠ 0) :
    (finSuccEquiv R n f).support.Nonempty 
goal: ((MvPolynomial.finSuccEquiv R n) f).support.Nonempty

full_name: MvPolynomial.degree_finSuccEquiv
code: theorem degree_finSuccEquiv {f : MvPolynomial (Fin (n + 1)) R} (h : f ≠ 0) :
    (finSuccEquiv R n f).degree = degreeOf 0 f 
goal: ((MvPolynomial.finSuccEquiv R n) f).degree = ↑(MvPolynomial.degreeOf 0 f)

full_name: MvPolynomial.natDegree_finSuccEquiv
code: theorem natDegree_finSuccEquiv (f : MvPolynomial (Fin (n + 1)) R) :
    (finSuccEquiv R n f).natDegree = degreeOf 0 f 
goal: ((MvPolynomial.finSuccEquiv R n) f).natDegree = MvPolynomial.degreeOf 0 f

full_name: MvPolynomial.degreeOf_coeff_finSuccEquiv
code: theorem degreeOf_coeff_finSuccEquiv (p : MvPolynomial (Fin (n + 1)) R) (j : Fin n) (i : ℕ) :
    degreeOf j (Polynomial.coeff (finSuccEquiv R n p) i) ≤ degreeOf j.succ p 
goal: MvPolynomial.degreeOf j (((MvPolynomial.finSuccEquiv R n) p).coeff i) ≤ MvPolynomial.degreeOf j.succ p

full_name: MvPolynomial.finSuccEquiv_rename_finSuccEquiv
code: /-- Consider a multivariate polynomial `φ` whose variables are indexed by `Option σ`,
and suppose that `σ ≃ Fin n`.
Then one may view `φ` as a polynomial over `MvPolynomial (Fin n) R`, by

1. renaming the variables via `Option σ ≃ Fin (n+1)`, and then singling out the `0`-th variable
    via `MvPolynomial.finSuccEquiv`;
2. first viewing it as polynomial over `MvPolynomial σ R` via `MvPolynomial.optionEquivLeft`,
    and then renaming the variables.

This lemma shows that both constructions are the same. -/
lemma finSuccEquiv_rename_finSuccEquiv (e : σ ≃ Fin n) (φ : MvPolynomial (Option σ) R) :
    ((finSuccEquiv R n) ((rename ((Equiv.optionCongr e).trans (_root_.finSuccEquiv n).symm)) φ)) =
      Polynomial.map (rename e).toRingHom (optionEquivLeft R σ φ) 
goal: (MvPolynomial.finSuccEquiv R n) ((MvPolynomial.rename ⇑(e.optionCongr.trans (finSuccEquiv n).symm)) φ) =
  Polynomial.map (MvPolynomial.rename ⇑e).toRingHom ((MvPolynomial.optionEquivLeft R σ) φ)