l3lab/ntp-mathlib huggingface dataset:
/-- Build a `k[G]`-linear map from a `k`-linear map and evidence that it is `G`-equivariant. -/
def equivariantOfLinearOfComm : V →ₗ[MonoidAlgebra k G] W where
  toFun := f
  map_add' v v' := by simp
  map_smul' c v := by
    -- Porting note: `dsimp` is required for beta reduction.
    dsimp only []
    -- Porting note: Was `apply`.
    refine Finsupp.induction c ?_ ?_
    · simp
    · 

Proof state:
case refine_2
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁹ : Monoid G
inst✝⁸ : CommSemiring k
V : Type u₃
W : Type u₄
inst✝⁷ : AddCommMonoid V
inst✝⁶ : Module k V
inst✝⁵ : Module (MonoidAlgebra k G) V
inst✝⁴ : IsScalarTower k (MonoidAlgebra k G) V
inst✝³ : AddCommMonoid W
inst✝² : Module k W
inst✝¹ : Module (MonoidAlgebra k G) W
inst✝ : IsScalarTower k (MonoidAlgebra k G) W
f : V →ₗ[k] W
h : ∀ (g : G) (v : V), f (single g 1 • v) = single g 1 • f v
c : MonoidAlgebra k G
v : V
⊢ ∀ (a : G) (b : k) (f_1 : G →₀ k),
    a ∉ f_1.support →
      b ≠ 0 →
        f (f_1 • v) = (RingHom.id (MonoidAlgebra k G)) f_1 • f v →
          f (((fun₀ | a => b) + f_1) • v) = (RingHom.id (MonoidAlgebra k G)) ((fun₀ | a => b) + f_1) • f v

Next tactic:
intro g r c' _nm _nz w
/-- Build a `k[G]`-linear map from a `k`-linear map and evidence that it is `G`-equivariant. -/
def equivariantOfLinearOfComm : V →ₗ[MonoidAlgebra k G] W where
  toFun := f
  map_add' v v' := by simp
  map_smul' c v := by
    -- Porting note: `dsimp` is required for beta reduction.
    dsimp only []
    -- Porting note: Was `apply`.
    refine Finsupp.induction c ?_ ?_
    · simp
    · intro g r c' _nm _nz w
      

Proof state:
case refine_2
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁹ : Monoid G
inst✝⁸ : CommSemiring k
V : Type u₃
W : Type u₄
inst✝⁷ : AddCommMonoid V
inst✝⁶ : Module k V
inst✝⁵ : Module (MonoidAlgebra k G) V
inst✝⁴ : IsScalarTower k (MonoidAlgebra k G) V
inst✝³ : AddCommMonoid W
inst✝² : Module k W
inst✝¹ : Module (MonoidAlgebra k G) W
inst✝ : IsScalarTower k (MonoidAlgebra k G) W
f : V →ₗ[k] W
h : ∀ (g : G) (v : V), f (single g 1 • v) = single g 1 • f v
c : MonoidAlgebra k G
v : V
g : G
r : k
c' : G →₀ k
_nm : g ∉ c'.support
_nz : r ≠ 0
w : f (c' • v) = (RingHom.id (MonoidAlgebra k G)) c' • f v
⊢ f (((fun₀ | g => r) + c') • v) = (RingHom.id (MonoidAlgebra k G)) ((fun₀ | g => r) + c') • f v

Next tactic:
dsimp at *
/-- Build a `k[G]`-linear map from a `k`-linear map and evidence that it is `G`-equivariant. -/
def equivariantOfLinearOfComm : V →ₗ[MonoidAlgebra k G] W where
  toFun := f
  map_add' v v' := by simp
  map_smul' c v := by
    -- Porting note: `dsimp` is required for beta reduction.
    dsimp only []
    -- Porting note: Was `apply`.
    refine Finsupp.induction c ?_ ?_
    · simp
    · intro g r c' _nm _nz w
      dsimp at *
      

Proof state:
case refine_2
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁹ : Monoid G
inst✝⁸ : CommSemiring k
V : Type u₃
W : Type u₄
inst✝⁷ : AddCommMonoid V
inst✝⁶ : Module k V
inst✝⁵ : Module (MonoidAlgebra k G) V
inst✝⁴ : IsScalarTower k (MonoidAlgebra k G) V
inst✝³ : AddCommMonoid W
inst✝² : Module k W
inst✝¹ : Module (MonoidAlgebra k G) W
inst✝ : IsScalarTower k (MonoidAlgebra k G) W
f : V →ₗ[k] W
h : ∀ (g : G) (v : V), f (single g 1 • v) = single g 1 • f v
c : MonoidAlgebra k G
v : V
g : G
r : k
c' : G →₀ k
_nm : g ∉ c'.support
_nz : ¬r = 0
w : f (c' • v) = c' • f v
⊢ f (((fun₀ | g => r) + c') • v) = ((fun₀ | g => r) + c') • f v

Next tactic:
simp only [add_smul, f.map_add, w, add_left_inj, single_eq_algebraMap_mul_of, ← smul_smul]
/-- Build a `k[G]`-linear map from a `k`-linear map and evidence that it is `G`-equivariant. -/
def equivariantOfLinearOfComm : V →ₗ[MonoidAlgebra k G] W where
  toFun := f
  map_add' v v' := by simp
  map_smul' c v := by
    -- Porting note: `dsimp` is required for beta reduction.
    dsimp only []
    -- Porting note: Was `apply`.
    refine Finsupp.induction c ?_ ?_
    · simp
    · intro g r c' _nm _nz w
      dsimp at *
      simp only [add_smul, f.map_add, w, add_left_inj, single_eq_algebraMap_mul_of, ← smul_smul]
      

Proof state:
case refine_2
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁹ : Monoid G
inst✝⁸ : CommSemiring k
V : Type u₃
W : Type u₄
inst✝⁷ : AddCommMonoid V
inst✝⁶ : Module k V
inst✝⁵ : Module (MonoidAlgebra k G) V
inst✝⁴ : IsScalarTower k (MonoidAlgebra k G) V
inst✝³ : AddCommMonoid W
inst✝² : Module k W
inst✝¹ : Module (MonoidAlgebra k G) W
inst✝ : IsScalarTower k (MonoidAlgebra k G) W
f : V →ₗ[k] W
h : ∀ (g : G) (v : V), f (single g 1 • v) = single g 1 • f v
c : MonoidAlgebra k G
v : V
g : G
r : k
c' : G →₀ k
_nm : g ∉ c'.support
_nz : ¬r = 0
w : f (c' • v) = c' • f v
⊢ f ((algebraMap k (MonoidAlgebra k G)) r • (of k G) g • v) + c' • f v =
    (algebraMap k (MonoidAlgebra k G)) r • (of k G) g • f v + c' • f v

Next tactic:
erw [algebraMap_smul (MonoidAlgebra k G) r, algebraMap_smul (MonoidAlgebra k G) r, f.map_smul,
        h g v, of_apply]
theorem prod_single [CommSemiring k] [CommMonoid G] {s : Finset ι} {a : ι → G} {b : ι → k} :
    (∏ i in s, single (a i) (b i)) = single (∏ i in s, a i) (∏ i in s, b i) :=
  Finset.cons_induction_on s rfl fun a s has ih => by
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
ι : Type ui
inst✝¹ : CommSemiring k
inst✝ : CommMonoid G
s✝ : Finset ι
a✝ : ι → G
b : ι → k
a : ι
s : Finset ι
has : a ∉ s
ih : ∏ i in s, single (a✝ i) (b i) = single (∏ i in s, a✝ i) (∏ i in s, b i)
⊢ ∏ i in Finset.cons a s has, single (a✝ i) (b i) =
    single (∏ i in Finset.cons a s has, a✝ i) (∏ i in Finset.cons a s has, b i)

Next tactic:
rw [prod_cons has, ih, single_mul_single, prod_cons has, prod_cons has]
theorem mul_apply_left (f g : MonoidAlgebra k G) (x : G) :
    (f * g) x = f.sum fun a b => b * g (a⁻¹ * x) :=
  calc
    (f * g) x = sum f fun a b => (single a b * g) x := by
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Group G
f g : MonoidAlgebra k G
x : G
⊢ (f * g) x = sum f fun a b => (single a b * g) x

Next tactic:
rw [← Finsupp.sum_apply, ← Finsupp.sum_mul g f, f.sum_single]
theorem mul_apply_left (f g : MonoidAlgebra k G) (x : G) :
    (f * g) x = f.sum fun a b => b * g (a⁻¹ * x) :=
  calc
    (f * g) x = sum f fun a b => (single a b * g) x := by
      rw [← Finsupp.sum_apply, ← Finsupp.sum_mul g f, f.sum_single]
    _ = _ := by 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Group G
f g : MonoidAlgebra k G
x : G
⊢ (sum f fun a b => (single a b * g) x) = sum f fun a b => b * g (a⁻¹ * x)

Next tactic:
simp only [single_mul_apply, Finsupp.sum]
theorem mul_apply_right (f g : MonoidAlgebra k G) (x : G) :
    (f * g) x = g.sum fun a b => f (x * a⁻¹) * b :=
  calc
    (f * g) x = sum g fun a b => (f * single a b) x := by
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Group G
f g : MonoidAlgebra k G
x : G
⊢ (f * g) x = sum g fun a b => (f * single a b) x

Next tactic:
rw [← Finsupp.sum_apply, ← Finsupp.mul_sum f g, g.sum_single]
theorem mul_apply_right (f g : MonoidAlgebra k G) (x : G) :
    (f * g) x = g.sum fun a b => f (x * a⁻¹) * b :=
  calc
    (f * g) x = sum g fun a b => (f * single a b) x := by
      rw [← Finsupp.sum_apply, ← Finsupp.mul_sum f g, g.sum_single]
    _ = _ := by 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Group G
f g : MonoidAlgebra k G
x : G
⊢ (sum g fun a b => (f * single a b) x) = sum g fun a b => f (x * a⁻¹) * b

Next tactic:
simp only [mul_single_apply, Finsupp.sum]
/-- The opposite of a `MonoidAlgebra R I` equivalent as a ring to
the `MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [Monoid G] :
    (MonoidAlgebra k G)ᵐᵒᵖ ≃+* MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ :=
  { opAddEquiv.symm.trans <|
      (Finsupp.mapRange.addEquiv (opAddEquiv : k ≃+ kᵐᵒᵖ)).trans <| Finsupp.domCongr opEquiv with
    map_mul' := by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
src✝ : (G →₀ k)ᵐᵒᵖ ≃+ (Gᵐᵒᵖ →₀ kᵐᵒᵖ) :=
  AddEquiv.trans (AddEquiv.symm opAddEquiv) (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))
⊢ ∀ (x y : (MonoidAlgebra k G)ᵐᵒᵖ),
    Equiv.toFun src✝.toEquiv (x * y) = Equiv.toFun src✝.toEquiv x * Equiv.toFun src✝.toEquiv y

Next tactic:
rw [Equiv.toFun_as_coe, AddEquiv.toEquiv_eq_coe]
/-- The opposite of a `MonoidAlgebra R I` equivalent as a ring to
the `MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [Monoid G] :
    (MonoidAlgebra k G)ᵐᵒᵖ ≃+* MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ :=
  { opAddEquiv.symm.trans <|
      (Finsupp.mapRange.addEquiv (opAddEquiv : k ≃+ kᵐᵒᵖ)).trans <| Finsupp.domCongr opEquiv with
    map_mul' := by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      rw [Equiv.toFun_as_coe, AddEquiv.toEquiv_eq_coe]; 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
src✝ : (G →₀ k)ᵐᵒᵖ ≃+ (Gᵐᵒᵖ →₀ kᵐᵒᵖ) :=
  AddEquiv.trans (AddEquiv.symm opAddEquiv) (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))
⊢ ∀ (x y : (MonoidAlgebra k G)ᵐᵒᵖ), ↑src✝ (x * y) = ↑src✝ x * ↑src✝ y

Next tactic:
erw [AddEquiv.coe_toEquiv]
/-- The opposite of a `MonoidAlgebra R I` equivalent as a ring to
the `MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [Monoid G] :
    (MonoidAlgebra k G)ᵐᵒᵖ ≃+* MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ :=
  { opAddEquiv.symm.trans <|
      (Finsupp.mapRange.addEquiv (opAddEquiv : k ≃+ kᵐᵒᵖ)).trans <| Finsupp.domCongr opEquiv with
    map_mul' := by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      rw [Equiv.toFun_as_coe, AddEquiv.toEquiv_eq_coe]; erw [AddEquiv.coe_toEquiv]
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
src✝ : (G →₀ k)ᵐᵒᵖ ≃+ (Gᵐᵒᵖ →₀ kᵐᵒᵖ) :=
  AddEquiv.trans (AddEquiv.symm opAddEquiv) (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))
⊢ ∀ (x y : (MonoidAlgebra k G)ᵐᵒᵖ), src✝ (x * y) = src✝ x * src✝ y

Next tactic:
rw [← AddEquiv.coe_toAddMonoidHom]
/-- The opposite of a `MonoidAlgebra R I` equivalent as a ring to
the `MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [Monoid G] :
    (MonoidAlgebra k G)ᵐᵒᵖ ≃+* MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ :=
  { opAddEquiv.symm.trans <|
      (Finsupp.mapRange.addEquiv (opAddEquiv : k ≃+ kᵐᵒᵖ)).trans <| Finsupp.domCongr opEquiv with
    map_mul' := by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      rw [Equiv.toFun_as_coe, AddEquiv.toEquiv_eq_coe]; erw [AddEquiv.coe_toEquiv]
      rw [← AddEquiv.coe_toAddMonoidHom]
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
src✝ : (G →₀ k)ᵐᵒᵖ ≃+ (Gᵐᵒᵖ →₀ kᵐᵒᵖ) :=
  AddEquiv.trans (AddEquiv.symm opAddEquiv) (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))
⊢ ∀ (x y : (MonoidAlgebra k G)ᵐᵒᵖ),
    (AddEquiv.toAddMonoidHom src✝) (x * y) = (AddEquiv.toAddMonoidHom src✝) x * (AddEquiv.toAddMonoidHom src✝) y

Next tactic:
refine Iff.mpr (AddMonoidHom.map_mul_iff (R := (MonoidAlgebra k G)ᵐᵒᵖ)
        (S := MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ) _) ?_
/-- The opposite of a `MonoidAlgebra R I` equivalent as a ring to
the `MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [Monoid G] :
    (MonoidAlgebra k G)ᵐᵒᵖ ≃+* MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ :=
  { opAddEquiv.symm.trans <|
      (Finsupp.mapRange.addEquiv (opAddEquiv : k ≃+ kᵐᵒᵖ)).trans <| Finsupp.domCongr opEquiv with
    map_mul' := by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      rw [Equiv.toFun_as_coe, AddEquiv.toEquiv_eq_coe]; erw [AddEquiv.coe_toEquiv]
      rw [← AddEquiv.coe_toAddMonoidHom]
      refine Iff.mpr (AddMonoidHom.map_mul_iff (R := (MonoidAlgebra k G)ᵐᵒᵖ)
        (S := MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ) _) ?_
      -- Porting note: Was `ext`.
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
src✝ : (G →₀ k)ᵐᵒᵖ ≃+ (Gᵐᵒᵖ →₀ kᵐᵒᵖ) :=
  AddEquiv.trans (AddEquiv.symm opAddEquiv) (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))
⊢ AddMonoidHom.compr₂ AddMonoidHom.mul (AddEquiv.toAddMonoidHom src✝) =
    AddMonoidHom.compl₂ (AddMonoidHom.comp AddMonoidHom.mul (AddEquiv.toAddMonoidHom src✝))
      (AddEquiv.toAddMonoidHom src✝)

Next tactic:
refine AddMonoidHom.mul_op_ext _ _ <| addHom_ext' fun i₁ => AddMonoidHom.ext fun r₁ =>
        AddMonoidHom.mul_op_ext _ _ <| addHom_ext' fun i₂ => AddMonoidHom.ext fun r₂ => ?_
/-- The opposite of a `MonoidAlgebra R I` equivalent as a ring to
the `MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [Monoid G] :
    (MonoidAlgebra k G)ᵐᵒᵖ ≃+* MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ :=
  { opAddEquiv.symm.trans <|
      (Finsupp.mapRange.addEquiv (opAddEquiv : k ≃+ kᵐᵒᵖ)).trans <| Finsupp.domCongr opEquiv with
    map_mul' := by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      rw [Equiv.toFun_as_coe, AddEquiv.toEquiv_eq_coe]; erw [AddEquiv.coe_toEquiv]
      rw [← AddEquiv.coe_toAddMonoidHom]
      refine Iff.mpr (AddMonoidHom.map_mul_iff (R := (MonoidAlgebra k G)ᵐᵒᵖ)
        (S := MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ) _) ?_
      -- Porting note: Was `ext`.
      refine AddMonoidHom.mul_op_ext _ _ <| addHom_ext' fun i₁ => AddMonoidHom.ext fun r₁ =>
        AddMonoidHom.mul_op_ext _ _ <| addHom_ext' fun i₂ => AddMonoidHom.ext fun r₂ => ?_
      -- Porting note: `reducible` cannot be `local` so proof gets long.
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
src✝ : (G →₀ k)ᵐᵒᵖ ≃+ (Gᵐᵒᵖ →₀ kᵐᵒᵖ) :=
  AddEquiv.trans (AddEquiv.symm opAddEquiv) (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))
i₁ : G
r₁ : k
i₂ : G
r₂ : k
⊢ (AddMonoidHom.comp
        (AddMonoidHom.comp
          ((AddMonoidHom.comp
              (AddMonoidHom.comp (AddMonoidHom.compr₂ AddMonoidHom.mul (AddEquiv.toAddMonoidHom src✝))
                (AddEquiv.toAddMonoidHom opAddEquiv))
              (singleAddHom i₁))
            r₁)
          (AddEquiv.toAddMonoidHom opAddEquiv))
        (singleAddHom i₂))
      r₂ =
    (AddMonoidHom.comp
        (AddMonoidHom.comp
          ((AddMonoidHom.comp
              (AddMonoidHom.comp
                (AddMonoidHom.compl₂ (AddMonoidHom.comp AddMonoidHom.mul (AddEquiv.toAddMonoidHom src✝))
                  (AddEquiv.toAddMonoidHom src✝))
                (AddEquiv.toAddMonoidHom opAddEquiv))
              (singleAddHom i₁))
            r₁)
          (AddEquiv.toAddMonoidHom opAddEquiv))
        (singleAddHom i₂))
      r₂

Next tactic:
simp only [AddMonoidHom.coe_comp, AddEquiv.coe_toAddMonoidHom, opAddEquiv_apply,
        Function.comp_apply, singleAddHom_apply, AddMonoidHom.compr₂_apply, AddMonoidHom.coe_mul,
        AddMonoidHom.coe_mulLeft, AddMonoidHom.compl₂_apply]
/-- The opposite of a `MonoidAlgebra R I` equivalent as a ring to
the `MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [Monoid G] :
    (MonoidAlgebra k G)ᵐᵒᵖ ≃+* MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ :=
  { opAddEquiv.symm.trans <|
      (Finsupp.mapRange.addEquiv (opAddEquiv : k ≃+ kᵐᵒᵖ)).trans <| Finsupp.domCongr opEquiv with
    map_mul' := by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      rw [Equiv.toFun_as_coe, AddEquiv.toEquiv_eq_coe]; erw [AddEquiv.coe_toEquiv]
      rw [← AddEquiv.coe_toAddMonoidHom]
      refine Iff.mpr (AddMonoidHom.map_mul_iff (R := (MonoidAlgebra k G)ᵐᵒᵖ)
        (S := MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ) _) ?_
      -- Porting note: Was `ext`.
      refine AddMonoidHom.mul_op_ext _ _ <| addHom_ext' fun i₁ => AddMonoidHom.ext fun r₁ =>
        AddMonoidHom.mul_op_ext _ _ <| addHom_ext' fun i₂ => AddMonoidHom.ext fun r₂ => ?_
      -- Porting note: `reducible` cannot be `local` so proof gets long.
      simp only [AddMonoidHom.coe_comp, AddEquiv.coe_toAddMonoidHom, opAddEquiv_apply,
        Function.comp_apply, singleAddHom_apply, AddMonoidHom.compr₂_apply, AddMonoidHom.coe_mul,
        AddMonoidHom.coe_mulLeft, AddMonoidHom.compl₂_apply]
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
src✝ : (G →₀ k)ᵐᵒᵖ ≃+ (Gᵐᵒᵖ →₀ kᵐᵒᵖ) :=
  AddEquiv.trans (AddEquiv.symm opAddEquiv) (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))
i₁ : G
r₁ : k
i₂ : G
r₂ : k
⊢ (AddEquiv.toAddMonoidHom
        (AddEquiv.trans (AddEquiv.symm opAddEquiv)
          (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))))
      ((opAddEquiv fun₀ | i₁ => r₁) * opAddEquiv fun₀ | i₂ => r₂) =
    (AddEquiv.toAddMonoidHom
          (AddEquiv.trans (AddEquiv.symm opAddEquiv)
            (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))))
        (opAddEquiv fun₀ | i₁ => r₁) *
      (AddEquiv.toAddMonoidHom
          (AddEquiv.trans (AddEquiv.symm opAddEquiv)
            (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))))
        (opAddEquiv fun₀ | i₂ => r₂)

Next tactic:
erw [AddEquiv.trans_apply, AddEquiv.trans_apply, AddEquiv.trans_apply, AddEquiv.trans_apply,
        AddEquiv.trans_apply, AddEquiv.trans_apply, MulOpposite.opAddEquiv_symm_apply]
/-- The opposite of a `MonoidAlgebra R I` equivalent as a ring to
the `MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [Monoid G] :
    (MonoidAlgebra k G)ᵐᵒᵖ ≃+* MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ :=
  { opAddEquiv.symm.trans <|
      (Finsupp.mapRange.addEquiv (opAddEquiv : k ≃+ kᵐᵒᵖ)).trans <| Finsupp.domCongr opEquiv with
    map_mul' := by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      rw [Equiv.toFun_as_coe, AddEquiv.toEquiv_eq_coe]; erw [AddEquiv.coe_toEquiv]
      rw [← AddEquiv.coe_toAddMonoidHom]
      refine Iff.mpr (AddMonoidHom.map_mul_iff (R := (MonoidAlgebra k G)ᵐᵒᵖ)
        (S := MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ) _) ?_
      -- Porting note: Was `ext`.
      refine AddMonoidHom.mul_op_ext _ _ <| addHom_ext' fun i₁ => AddMonoidHom.ext fun r₁ =>
        AddMonoidHom.mul_op_ext _ _ <| addHom_ext' fun i₂ => AddMonoidHom.ext fun r₂ => ?_
      -- Porting note: `reducible` cannot be `local` so proof gets long.
      simp only [AddMonoidHom.coe_comp, AddEquiv.coe_toAddMonoidHom, opAddEquiv_apply,
        Function.comp_apply, singleAddHom_apply, AddMonoidHom.compr₂_apply, AddMonoidHom.coe_mul,
        AddMonoidHom.coe_mulLeft, AddMonoidHom.compl₂_apply]
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [AddEquiv.trans_apply, AddEquiv.trans_apply, AddEquiv.trans_apply, AddEquiv.trans_apply,
        AddEquiv.trans_apply, AddEquiv.trans_apply, MulOpposite.opAddEquiv_symm_apply]
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
src✝ : (G →₀ k)ᵐᵒᵖ ≃+ (Gᵐᵒᵖ →₀ kᵐᵒᵖ) :=
  AddEquiv.trans (AddEquiv.symm opAddEquiv) (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))
i₁ : G
r₁ : k
i₂ : G
r₂ : k
⊢ (Finsupp.domCongr opEquiv)
      ((mapRange.addEquiv opAddEquiv) (unop ((opAddEquiv fun₀ | i₁ => r₁) * opAddEquiv fun₀ | i₂ => r₂))) =
    (Finsupp.domCongr opEquiv) ((mapRange.addEquiv opAddEquiv) (unop (opAddEquiv fun₀ | i₁ => r₁))) *
      (Finsupp.domCongr opEquiv) ((mapRange.addEquiv opAddEquiv) (unop (opAddEquiv fun₀ | i₂ => r₂)))

Next tactic:
rw [MulOpposite.unop_mul (α := MonoidAlgebra k G)]
/-- The opposite of a `MonoidAlgebra R I` equivalent as a ring to
the `MonoidAlgebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps! (config := { simpRhs := true }) apply symm_apply]
protected noncomputable def opRingEquiv [Monoid G] :
    (MonoidAlgebra k G)ᵐᵒᵖ ≃+* MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ :=
  { opAddEquiv.symm.trans <|
      (Finsupp.mapRange.addEquiv (opAddEquiv : k ≃+ kᵐᵒᵖ)).trans <| Finsupp.domCongr opEquiv with
    map_mul' := by
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      rw [Equiv.toFun_as_coe, AddEquiv.toEquiv_eq_coe]; erw [AddEquiv.coe_toEquiv]
      rw [← AddEquiv.coe_toAddMonoidHom]
      refine Iff.mpr (AddMonoidHom.map_mul_iff (R := (MonoidAlgebra k G)ᵐᵒᵖ)
        (S := MonoidAlgebra kᵐᵒᵖ Gᵐᵒᵖ) _) ?_
      -- Porting note: Was `ext`.
      refine AddMonoidHom.mul_op_ext _ _ <| addHom_ext' fun i₁ => AddMonoidHom.ext fun r₁ =>
        AddMonoidHom.mul_op_ext _ _ <| addHom_ext' fun i₂ => AddMonoidHom.ext fun r₂ => ?_
      -- Porting note: `reducible` cannot be `local` so proof gets long.
      simp only [AddMonoidHom.coe_comp, AddEquiv.coe_toAddMonoidHom, opAddEquiv_apply,
        Function.comp_apply, singleAddHom_apply, AddMonoidHom.compr₂_apply, AddMonoidHom.coe_mul,
        AddMonoidHom.coe_mulLeft, AddMonoidHom.compl₂_apply]
      -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
      erw [AddEquiv.trans_apply, AddEquiv.trans_apply, AddEquiv.trans_apply, AddEquiv.trans_apply,
        AddEquiv.trans_apply, AddEquiv.trans_apply, MulOpposite.opAddEquiv_symm_apply]
      rw [MulOpposite.unop_mul (α := MonoidAlgebra k G)]
      -- This was not needed before leanprover/lean4#2644
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝¹ : Semiring k
inst✝ : Monoid G
src✝ : (G →₀ k)ᵐᵒᵖ ≃+ (Gᵐᵒᵖ →₀ kᵐᵒᵖ) :=
  AddEquiv.trans (AddEquiv.symm opAddEquiv) (AddEquiv.trans (mapRange.addEquiv opAddEquiv) (Finsupp.domCongr opEquiv))
i₁ : G
r₁ : k
i₂ : G
r₂ : k
⊢ (Finsupp.domCongr opEquiv)
      ((mapRange.addEquiv opAddEquiv) (unop (opAddEquiv fun₀ | i₂ => r₂) * unop (opAddEquiv fun₀ | i₁ => r₁))) =
    (Finsupp.domCongr opEquiv) ((mapRange.addEquiv opAddEquiv) (unop (opAddEquiv fun₀ | i₁ => r₁))) *
      (Finsupp.domCongr opEquiv) ((mapRange.addEquiv opAddEquiv) (unop (opAddEquiv fun₀ | i₂ => r₂)))

Next tactic:
erw [unop_op, unop_op, single_mul_single]