/-
Copyright (c) 2017 Johannes Hölzl. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Johannes Hölzl, Yury G. Kudryashov, Scott Morrison

! This file was ported from Lean 3 source module algebra.monoid_algebra.basic
! leanprover-community/mathlib commit 57e09a1296bfb4330ddf6624f1028ba186117d82
! Please do not edit these lines, except to modify the commit id
! if you have ported upstream changes.
-/
import Mathbin.Algebra.Algebra.Equiv
import Mathbin.Algebra.BigOperators.Finsupp
import Mathbin.Algebra.Hom.NonUnitalAlg
import Mathbin.Algebra.Module.BigOperators
import Mathbin.LinearAlgebra.Finsupp

/-!
# Monoid algebras

> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
> Any changes to this file require a corresponding PR to mathlib4.

When the domain of a `finsupp` has a multiplicative or additive structure, we can define
a convolution product. To mathematicians this structure is known as the "monoid algebra",
i.e. the finite formal linear combinations over a given semiring of elements of the monoid.
The "group ring" ℤ[G] or the "group algebra" k[G] are typical uses.

In fact the construction of the "monoid algebra" makes sense when `G` is not even a monoid, but
merely a magma, i.e., when `G` carries a multiplication which is not required to satisfy any
conditions at all. In this case the construction yields a not-necessarily-unital,
not-necessarily-associative algebra but it is still adjoint to the forgetful functor from such
algebras to magmas, and we prove this as `monoid_algebra.lift_magma`.

In this file we define `monoid_algebra k G := G →₀ k`, and `add_monoid_algebra k G`
in the same way, and then define the convolution product on these.

When the domain is additive, this is used to define polynomials:
```
polynomial α := add_monoid_algebra ℕ α
mv_polynomial σ α := add_monoid_algebra (σ →₀ ℕ) α
```

When the domain is multiplicative, e.g. a group, this will be used to define the group ring.

## Implementation note
Unfortunately because additive and multiplicative structures both appear in both cases,
it doesn't appear to be possible to make much use of `to_additive`, and we just settle for
saying everything twice.

Similarly, I attempted to just define
`add_monoid_algebra k G := monoid_algebra k (multiplicative G)`, but the definitional equality
`multiplicative G = G` leaks through everywhere, and seems impossible to use.
-/

noncomputable section

open BigOperators

open Finset Finsupp

universe u₁ u₂ u₃

variable (k : Type u₁) (G : Type u₂) {R : Type _}

/-! ### Multiplicative monoids -/

section

variable [Semiring k]

#print MonoidAlgebra /-
/-- The monoid algebra over a semiring `k` generated by the monoid `G`.
It is the type of finite formal `k`-linear combinations of terms of `G`,
endowed with the convolution product.
-/
def MonoidAlgebra : Type max u₁ u₂ :=
  G →₀ k deriving Inhabited, AddCommMonoid
#align monoid_algebra MonoidAlgebra
-/

instance : CoeFun (MonoidAlgebra k G) fun _ => G → k :=
  Finsupp.coeFun

end

namespace MonoidAlgebra

variable {k G}

section

variable [Semiring k] [NonUnitalNonAssocSemiring R]

/- warning: monoid_algebra.lift_nc -> MonoidAlgebra.liftNC is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : NonUnitalNonAssocSemiring.{u3} R], (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) -> (G -> R) -> (AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : NonUnitalNonAssocSemiring.{u3} R], (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) -> (G -> R) -> (AddMonoidHom.{max u2 u1, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u1, u2} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.lift_nc MonoidAlgebra.liftNCₓ'. -/
/-- A non-commutative version of `monoid_algebra.lift`: given a additive homomorphism `f : k →+ R`
and a homomorphism `g : G → R`, returns the additive homomorphism from
`monoid_algebra k G` such that `lift_nc f g (single a b) = f b * g a`. If `f` is a ring homomorphism
and the range of either `f` or `g` is in center of `R`, then the result is a ring homomorphism.  If
`R` is a `k`-algebra and `f = algebra_map k R`, then the result is an algebra homomorphism called
`monoid_algebra.lift`. -/
def liftNC (f : k →+ R) (g : G → R) : MonoidAlgebra k G →+ R :=
  liftAddHom fun x : G => (AddMonoidHom.mulRight (g x)).comp f
#align monoid_algebra.lift_nc MonoidAlgebra.liftNC

/- warning: monoid_algebra.lift_nc_single -> MonoidAlgebra.liftNC_single is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : NonUnitalNonAssocSemiring.{u3} R] (f : AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) (g : G -> R) (a : G) (b : k), Eq.{succ u3} R (coeFn.{max (succ u3) (succ (max u1 u2)), max (succ (max u1 u2)) (succ u3)} (AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) (fun (_x : AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) (MonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 _inst_2 f g) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a b)) (HMul.hMul.{u3, u3, u3} R R R (instHMul.{u3} R (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R _inst_2))) (coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) (fun (_x : AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) => k -> R) (AddMonoidHom.hasCoeToFun.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) f b) (g a))
but is expected to have type
  forall {k : Type.{u2}} {G : Type.{u3}} {R : Type.{u1}} [_inst_1 : Semiring.{u2} k] [_inst_2 : NonUnitalNonAssocSemiring.{u1} R] (f : AddMonoidHom.{u2, u1} k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (g : G -> R) (a : G) (b : k), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) (MonoidAlgebra.single.{u2, u3} k G _inst_1 a b)) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (AddMonoidHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (MonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : MonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddZeroClass.toAdd.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (AddMonoidHomClass.toAddHomClass.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2))) (AddMonoidHom.addMonoidHomClass.{max u2 u3, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))))) (MonoidAlgebra.liftNC.{u2, u3, u1} k G R _inst_1 _inst_2 f g) (MonoidAlgebra.single.{u2, u3} k G _inst_1 a b)) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : k) => R) b) R ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : k) => R) b) (instHMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : k) => R) b) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : k) => R) b) _inst_2)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (AddMonoidHom.{u2, u1} k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : k) => R) _x) (AddHomClass.toFunLike.{max u2 u1, u2, u1} (AddMonoidHom.{u2, u1} k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) k R (AddZeroClass.toAdd.{u2} k (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1)))))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (AddMonoidHomClass.toAddHomClass.{max u2 u1, u2, u1} (AddMonoidHom.{u2, u1} k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2))) (AddMonoidHom.addMonoidHomClass.{u2, u1} k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))))) f b) (g a))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.lift_nc_single MonoidAlgebra.liftNC_singleₓ'. -/
@[simp]
theorem liftNC_single (f : k →+ R) (g : G → R) (a : G) (b : k) :
    liftNC f g (single a b) = f b * g a :=
  liftAddHom_apply_single _ _ _
#align monoid_algebra.lift_nc_single MonoidAlgebra.liftNC_single

end

section Mul

variable [Semiring k] [Mul G]

/-- The product of `f g : monoid_algebra k G` is the finitely supported function
  whose value at `a` is the sum of `f x * g y` over all pairs `x, y`
  such that `x * y = a`. (Think of the group ring of a group.) -/
instance : Mul (MonoidAlgebra k G) :=
  ⟨fun f g => f.Sum fun a₁ b₁ => g.Sum fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂)⟩

/- warning: monoid_algebra.mul_def -> MonoidAlgebra.mul_def is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] {f : MonoidAlgebra.{u1, u2} k G _inst_1} {g : MonoidAlgebra.{u1, u2} k G _inst_1}, Eq.{succ (max u1 u2)} (MonoidAlgebra.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) f g) (Finsupp.sum.{u2, u1, max u1 u2} G k (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1) f (fun (a₁ : G) (b₁ : k) => Finsupp.sum.{u2, u1, max u1 u2} G k (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1) g (fun (a₂ : G) (b₂ : k) => Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) a₁ a₂) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) b₁ b₂))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] {f : MonoidAlgebra.{u1, u2} k G _inst_1} {g : MonoidAlgebra.{u1, u2} k G _inst_1}, Eq.{max (succ u1) (succ u2)} (MonoidAlgebra.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) f g) (Finsupp.sum.{u2, u1, max u2 u1} G k (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.addCommMonoid.{u1, u2} k G _inst_1) f (fun (a₁ : G) (b₁ : k) => Finsupp.sum.{u2, u1, max u2 u1} G k (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.addCommMonoid.{u1, u2} k G _inst_1) g (fun (a₂ : G) (b₂ : k) => MonoidAlgebra.single.{u1, u2} k G _inst_1 (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) a₁ a₂) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) b₁ b₂))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.mul_def MonoidAlgebra.mul_defₓ'. -/
theorem mul_def {f g : MonoidAlgebra k G} :
    f * g = f.Sum fun a₁ b₁ => g.Sum fun a₂ b₂ => single (a₁ * a₂) (b₁ * b₂) :=
  rfl
#align monoid_algebra.mul_def MonoidAlgebra.mul_def

instance : NonUnitalNonAssocSemiring (MonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    zero := 0
    mul := (· * ·)
    add := (· + ·)
    left_distrib := fun f g h => by
      haveI := Classical.decEq G <;>
        simp only [mul_def, sum_add_index, mul_add, MulZeroClass.mul_zero, single_zero, single_add,
          eq_self_iff_true, forall_true_iff, forall₃_true_iff, sum_add]
    right_distrib := fun f g h => by
      haveI := Classical.decEq G <;>
        simp only [mul_def, sum_add_index, add_mul, MulZeroClass.zero_mul, single_zero, single_add,
          eq_self_iff_true, forall_true_iff, forall₃_true_iff, sum_zero, sum_add]
    zero_mul := fun f => by simp only [mul_def, sum_zero_index]
    mul_zero := fun f => by simp only [mul_def, sum_zero_index, sum_zero] }

variable [Semiring R]

/- warning: monoid_algebra.lift_nc_mul -> MonoidAlgebra.liftNC_mul is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] [_inst_3 : Semiring.{u3} R] {g_hom : Type.{u4}} [_inst_4 : MulHomClass.{u4, u2, u3} g_hom G R _inst_2 (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))] (f : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (g : g_hom) (a : MonoidAlgebra.{u1, u2} k G _inst_1) (b : MonoidAlgebra.{u1, u2} k G _inst_1), (forall {x : G} {y : G}, (Membership.Mem.{u2, u2} G (Finset.{u2} G) (Finset.hasMem.{u2} G) y (Finsupp.support.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a)) -> (Commute.{u3} R (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => k -> R) (RingHom.hasCoeToFun.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) b x)) (coeFn.{succ u4, max (succ u2) (succ u3)} g_hom (fun (_x : g_hom) => G -> R) (FunLike.hasCoeToFun.{succ u4, succ u2, succ u3} g_hom G (fun (_x : G) => R) (MulHomClass.toFunLike.{u4, u2, u3} g_hom G R _inst_2 (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) _inst_4)) g y))) -> (Eq.{succ u3} R (coeFn.{max (succ u3) (succ (max u1 u2)), max (succ (max u1 u2)) (succ u3)} (AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (fun (_x : AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (MonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (coeFn.{succ u4, max (succ u2) (succ u3)} g_hom (fun (_x : g_hom) => G -> R) (FunLike.hasCoeToFun.{succ u4, succ u2, succ u3} g_hom G (fun (_x : G) => R) (MulHomClass.toFunLike.{u4, u2, u3} g_hom G R _inst_2 (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) _inst_4)) g)) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) a b)) (HMul.hMul.{u3, u3, u3} R R R (instHMul.{u3} R (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (coeFn.{max (succ u3) (succ (max u1 u2)), max (succ (max u1 u2)) (succ u3)} (AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (fun (_x : AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (MonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (coeFn.{succ u4, max (succ u2) (succ u3)} g_hom (fun (_x : g_hom) => G -> R) (FunLike.hasCoeToFun.{succ u4, succ u2, succ u3} g_hom G (fun (_x : G) => R) (MulHomClass.toFunLike.{u4, u2, u3} g_hom G R _inst_2 (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) _inst_4)) g)) a) (coeFn.{max (succ u3) (succ (max u1 u2)), max (succ (max u1 u2)) (succ u3)} (AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (fun (_x : AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (MonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (coeFn.{succ u4, max (succ u2) (succ u3)} g_hom (fun (_x : g_hom) => G -> R) (FunLike.hasCoeToFun.{succ u4, succ u2, succ u3} g_hom G (fun (_x : G) => R) (MulHomClass.toFunLike.{u4, u2, u3} g_hom G R _inst_2 (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) _inst_4)) g)) b)))
but is expected to have type
  forall {k : Type.{u3}} {G : Type.{u4}} {R : Type.{u1}} [_inst_1 : Semiring.{u3} k] [_inst_2 : Mul.{u4} G] [_inst_3 : Semiring.{u1} R] {g_hom : Type.{u2}} [_inst_4 : MulHomClass.{u2, u4, u1} g_hom G R _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))] (f : RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (g : g_hom) (a : MonoidAlgebra.{u3, u4} k G _inst_1) (b : MonoidAlgebra.{u3, u4} k G _inst_1), (forall {x : G} {y : G}, (Membership.mem.{u4, u4} G (Finset.{u4} G) (Finset.instMembershipFinset.{u4} G) y (Finsupp.support.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1)) a)) -> (Commute.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) (FunLike.coe.{max (succ u4) (succ u3), succ u4, succ u3} (Finsupp.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) G (fun (a : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) a) (Finsupp.funLike.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) b x)) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) (FunLike.coe.{max (succ u4) (succ u3), succ u4, succ u3} (Finsupp.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) G (fun (a : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) a) (Finsupp.funLike.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) b x)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) (FunLike.coe.{max (succ u4) (succ u3), succ u4, succ u3} (Finsupp.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) G (fun (a : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) a) (Finsupp.funLike.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) b x)) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) (FunLike.coe.{max (succ u4) (succ u3), succ u4, succ u3} (Finsupp.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) G (fun (a : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) a) (Finsupp.funLike.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) b x)) _inst_3))) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) _x) (MulHomClass.toFunLike.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (NonUnitalNonAssocSemiring.toMul.{u3} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) f (FunLike.coe.{max (succ u4) (succ u3), succ u4, succ u3} (Finsupp.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) b x)) (FunLike.coe.{succ u2, succ u4, succ u1} g_hom G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => R) _x) (MulHomClass.toFunLike.{u2, u4, u1} g_hom G R _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) _inst_4) g y))) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_1) => R) (HMul.hMul.{max u3 u4, max u3 u4, max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.{u3, u4} k G _inst_1) (instHMul.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.mul.{u3, u4} k G _inst_1 _inst_2)) a b)) (FunLike.coe.{max (max (succ u3) (succ u4)) (succ u1), max (succ u3) (succ u4), succ u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u3, u4} k G _inst_1) (fun (_x : MonoidAlgebra.{u3, u4} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddZeroClass.toAdd.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidHomClass.toAddHomClass.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidHom.addMonoidHomClass.{max u3 u4, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))))) (MonoidAlgebra.liftNC.{u3, u4, u1} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidHomClass.toAddMonoidHom.{u3, u1, max u3 u1} k R (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoid.toAddZeroClass.{u3} k (AddMonoidWithOne.toAddMonoid.{u3} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} k (NonAssocSemiring.toAddCommMonoidWithOne.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (FunLike.coe.{succ u2, succ u4, succ u1} g_hom G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => R) _x) (MulHomClass.toFunLike.{u2, u4, u1} g_hom G R _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) _inst_4) g)) (HMul.hMul.{max u3 u4, max u3 u4, max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.{u3, u4} k G _inst_1) (instHMul.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.mul.{u3, u4} k G _inst_1 _inst_2)) a b)) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_1) => R) a) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_1) => R) b) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_1) => R) a) (instHMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_1) => R) a) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_1) => R) a) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_1) => R) a) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_1) => R) a) _inst_3)))) (FunLike.coe.{max (max (succ u3) (succ u4)) (succ u1), max (succ u3) (succ u4), succ u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u3, u4} k G _inst_1) (fun (_x : MonoidAlgebra.{u3, u4} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddZeroClass.toAdd.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidHomClass.toAddHomClass.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidHom.addMonoidHomClass.{max u3 u4, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))))) (MonoidAlgebra.liftNC.{u3, u4, u1} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidHomClass.toAddMonoidHom.{u3, u1, max u3 u1} k R (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoid.toAddZeroClass.{u3} k (AddMonoidWithOne.toAddMonoid.{u3} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} k (NonAssocSemiring.toAddCommMonoidWithOne.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (FunLike.coe.{succ u2, succ u4, succ u1} g_hom G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => R) _x) (MulHomClass.toFunLike.{u2, u4, u1} g_hom G R _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) _inst_4) g)) a) (FunLike.coe.{max (max (succ u3) (succ u4)) (succ u1), max (succ u3) (succ u4), succ u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u3, u4} k G _inst_1) (fun (_x : MonoidAlgebra.{u3, u4} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddZeroClass.toAdd.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidHomClass.toAddHomClass.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidHom.addMonoidHomClass.{max u3 u4, u1} (MonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))))) (MonoidAlgebra.liftNC.{u3, u4, u1} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidHomClass.toAddMonoidHom.{u3, u1, max u3 u1} k R (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoid.toAddZeroClass.{u3} k (AddMonoidWithOne.toAddMonoid.{u3} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} k (NonAssocSemiring.toAddCommMonoidWithOne.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (FunLike.coe.{succ u2, succ u4, succ u1} g_hom G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => R) _x) (MulHomClass.toFunLike.{u2, u4, u1} g_hom G R _inst_2 (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) _inst_4) g)) b)))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.lift_nc_mul MonoidAlgebra.liftNC_mulₓ'. -/
theorem liftNC_mul {g_hom : Type _} [MulHomClass g_hom G R] (f : k →+* R) (g : g_hom)
    (a b : MonoidAlgebra k G) (h_comm : ∀ {x y}, y ∈ a.support → Commute (f (b x)) (g y)) :
    liftNC (f : k →+ R) g (a * b) = liftNC (f : k →+ R) g a * liftNC (f : k →+ R) g b :=
  by
  conv_rhs => rw [← sum_single a, ← sum_single b]
  simp_rw [mul_def, (lift_nc _ g).map_finsupp_sum, lift_nc_single, Finsupp.sum_mul, Finsupp.mul_sum]
  refine' Finset.sum_congr rfl fun y hy => Finset.sum_congr rfl fun x hx => _
  simp [mul_assoc, (h_comm hy).and_left_comm]
#align monoid_algebra.lift_nc_mul MonoidAlgebra.liftNC_mul

end Mul

section Semigroup

variable [Semiring k] [Semigroup G] [Semiring R]

instance : NonUnitalSemiring (MonoidAlgebra k G) :=
  { MonoidAlgebra.nonUnitalNonAssocSemiring with
    zero := 0
    mul := (· * ·)
    add := (· + ·)
    mul_assoc := fun f g h => by
      simp only [mul_def, sum_sum_index, sum_zero_index, sum_add_index, sum_single_index,
        single_zero, single_add, eq_self_iff_true, forall_true_iff, forall₃_true_iff, add_mul,
        mul_add, add_assoc, mul_assoc, MulZeroClass.zero_mul, MulZeroClass.mul_zero, sum_zero,
        sum_add] }

end Semigroup

section One

variable [NonAssocSemiring R] [Semiring k] [One G]

/-- The unit of the multiplication is `single 1 1`, i.e. the function
  that is `1` at `1` and zero elsewhere. -/
instance : One (MonoidAlgebra k G) :=
  ⟨single 1 1⟩

/- warning: monoid_algebra.one_def -> MonoidAlgebra.one_def is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_2 : Semiring.{u1} k] [_inst_3 : One.{u2} G], Eq.{succ (max u1 u2)} (MonoidAlgebra.{u1, u2} k G _inst_2) (OfNat.ofNat.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) 1 (OfNat.mk.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) 1 (One.one.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) (MonoidAlgebra.one.{u1, u2} k G _inst_2 _inst_3)))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_2)))) (OfNat.ofNat.{u2} G 1 (OfNat.mk.{u2} G 1 (One.one.{u2} G _inst_3))) (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_2))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_2 : Semiring.{u1} k] [_inst_3 : One.{u2} G], Eq.{max (succ u1) (succ u2)} (MonoidAlgebra.{u1, u2} k G _inst_2) (OfNat.ofNat.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) 1 (One.toOfNat1.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) (MonoidAlgebra.one.{u1, u2} k G _inst_2 _inst_3))) (MonoidAlgebra.single.{u1, u2} k G _inst_2 (OfNat.ofNat.{u2} G 1 (One.toOfNat1.{u2} G _inst_3)) (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k _inst_2))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.one_def MonoidAlgebra.one_defₓ'. -/
theorem one_def : (1 : MonoidAlgebra k G) = single 1 1 :=
  rfl
#align monoid_algebra.one_def MonoidAlgebra.one_def

/- warning: monoid_algebra.lift_nc_one -> MonoidAlgebra.liftNC_one is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : NonAssocSemiring.{u3} R] [_inst_2 : Semiring.{u1} k] [_inst_3 : One.{u2} G] {g_hom : Type.{u4}} [_inst_4 : OneHomClass.{u4, u2, u3} g_hom G R _inst_3 (AddMonoidWithOne.toOne.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_1)))] (f : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_2) _inst_1) (g : g_hom), Eq.{succ u3} R (coeFn.{max (succ u3) (succ (max u1 u2)), max (succ (max u1 u2)) (succ u3)} (AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_2) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_2))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R _inst_1))))) (fun (_x : AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_2) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_2))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R _inst_1))))) => (MonoidAlgebra.{u1, u2} k G _inst_2) -> R) (AddMonoidHom.hasCoeToFun.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_2) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_2))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R _inst_1))))) (MonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_2 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R _inst_1) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_2) _inst_1) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_2))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_1))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_2) _inst_1) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_2))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_1))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_2) _inst_1) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_2))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_1))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_2) _inst_1) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_2))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_1)))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_2) _inst_1) k R (Semiring.toNonAssocSemiring.{u1} k _inst_2) _inst_1 (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_2) _inst_1))))) f) (coeFn.{succ u4, max (succ u2) (succ u3)} g_hom (fun (_x : g_hom) => G -> R) (FunLike.hasCoeToFun.{succ u4, succ u2, succ u3} g_hom G (fun (_x : G) => R) (OneHomClass.toFunLike.{u4, u2, u3} g_hom G R _inst_3 (AddMonoidWithOne.toOne.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_1))) _inst_4)) g)) (OfNat.ofNat.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) 1 (OfNat.mk.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) 1 (One.one.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_2) (MonoidAlgebra.one.{u1, u2} k G _inst_2 _inst_3))))) (OfNat.ofNat.{u3} R 1 (OfNat.mk.{u3} R 1 (One.one.{u3} R (AddMonoidWithOne.toOne.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_1))))))
but is expected to have type
  forall {k : Type.{u3}} {G : Type.{u4}} {R : Type.{u1}} [_inst_1 : NonAssocSemiring.{u1} R] [_inst_2 : Semiring.{u3} k] [_inst_3 : One.{u4} G] {g_hom : Type.{u2}} [_inst_4 : OneHomClass.{u2, u4, u1} g_hom G R _inst_3 (NonAssocSemiring.toOne.{u1} R _inst_1)] (f : RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_2) _inst_1) (g : g_hom), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_2) => R) (OfNat.ofNat.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) 1 (One.toOfNat1.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (MonoidAlgebra.one.{u3, u4} k G _inst_2 _inst_3)))) (FunLike.coe.{max (max (succ u3) (succ u4)) (succ u1), max (succ u3) (succ u4), succ u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_2) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_2))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_1))))) (MonoidAlgebra.{u3, u4} k G _inst_2) (fun (_x : MonoidAlgebra.{u3, u4} k G _inst_2) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_2) => R) _x) (AddHomClass.toFunLike.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_2) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_2))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_1))))) (MonoidAlgebra.{u3, u4} k G _inst_2) R (AddZeroClass.toAdd.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_2)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_1))))) (AddMonoidHomClass.toAddHomClass.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (MonoidAlgebra.{u3, u4} k G _inst_2) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_2))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_1))))) (MonoidAlgebra.{u3, u4} k G _inst_2) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_2))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_1)))) (AddMonoidHom.addMonoidHomClass.{max u3 u4, u1} (MonoidAlgebra.{u3, u4} k G _inst_2) R (AddMonoid.toAddZeroClass.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (AddCommMonoid.toAddMonoid.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (MonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_2))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_1))))))) (MonoidAlgebra.liftNC.{u3, u4, u1} k G R _inst_2 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_1) (AddMonoidHomClass.toAddMonoidHom.{u3, u1, max u3 u1} k R (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_2) _inst_1) (AddMonoid.toAddZeroClass.{u3} k (AddMonoidWithOne.toAddMonoid.{u3} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} k (NonAssocSemiring.toAddCommMonoidWithOne.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_2))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_1)))) (RingHomClass.toAddMonoidHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_2) _inst_1) k R (Semiring.toNonAssocSemiring.{u3} k _inst_2) _inst_1 (RingHom.instRingHomClassRingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_2) _inst_1)) f) (FunLike.coe.{succ u2, succ u4, succ u1} g_hom G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.1262 : G) => R) _x) (OneHomClass.toFunLike.{u2, u4, u1} g_hom G R _inst_3 (NonAssocSemiring.toOne.{u1} R _inst_1) _inst_4) g)) (OfNat.ofNat.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) 1 (One.toOfNat1.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (MonoidAlgebra.one.{u3, u4} k G _inst_2 _inst_3)))) (OfNat.ofNat.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_2) => R) (OfNat.ofNat.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) 1 (One.toOfNat1.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (MonoidAlgebra.one.{u3, u4} k G _inst_2 _inst_3)))) 1 (One.toOfNat1.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_2) => R) (OfNat.ofNat.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) 1 (One.toOfNat1.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (MonoidAlgebra.one.{u3, u4} k G _inst_2 _inst_3)))) (NonAssocSemiring.toOne.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u3, u4} k G _inst_2) => R) (OfNat.ofNat.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) 1 (One.toOfNat1.{max u3 u4} (MonoidAlgebra.{u3, u4} k G _inst_2) (MonoidAlgebra.one.{u3, u4} k G _inst_2 _inst_3)))) _inst_1)))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.lift_nc_one MonoidAlgebra.liftNC_oneₓ'. -/
@[simp]
theorem liftNC_one {g_hom : Type _} [OneHomClass g_hom G R] (f : k →+* R) (g : g_hom) :
    liftNC (f : k →+ R) g 1 = 1 := by simp [one_def]
#align monoid_algebra.lift_nc_one MonoidAlgebra.liftNC_one

end One

section MulOneClass

variable [Semiring k] [MulOneClass G]

instance : NonAssocSemiring (MonoidAlgebra k G) :=
  { MonoidAlgebra.nonUnitalNonAssocSemiring with
    one := 1
    mul := (· * ·)
    zero := 0
    add := (· + ·)
    natCast := fun n => single 1 n
    natCast_zero := by simp [Nat.cast]
    natCast_succ := fun _ => by simp [Nat.cast] <;> rfl
    one_mul := fun f => by
      simp only [mul_def, one_def, sum_single_index, MulZeroClass.zero_mul, single_zero, sum_zero,
        zero_add, one_mul, sum_single]
    mul_one := fun f => by
      simp only [mul_def, one_def, sum_single_index, MulZeroClass.mul_zero, single_zero, sum_zero,
        add_zero, mul_one, sum_single] }

/- warning: monoid_algebra.nat_cast_def -> MonoidAlgebra.nat_cast_def is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (n : Nat), Eq.{succ (max u1 u2)} (MonoidAlgebra.{u1, u2} k G _inst_1) ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Nat (MonoidAlgebra.{u1, u2} k G _inst_1) (HasLiftT.mk.{1, succ (max u1 u2)} Nat (MonoidAlgebra.{u1, u2} k G _inst_1) (CoeTCₓ.coe.{1, succ (max u1 u2)} Nat (MonoidAlgebra.{u1, u2} k G _inst_1) (Nat.castCoe.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidWithOne.toNatCast.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoidWithOne.toAddMonoidWithOne.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toAddCommMonoidWithOne.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))))))) n) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (OfNat.ofNat.{u2} G 1 (OfNat.mk.{u2} G 1 (One.one.{u2} G (MulOneClass.toHasOne.{u2} G _inst_2)))) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat k (HasLiftT.mk.{1, succ u1} Nat k (CoeTCₓ.coe.{1, succ u1} Nat k (Nat.castCoe.{u1} k (AddMonoidWithOne.toNatCast.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))) n))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (n : Nat), Eq.{max (succ u1) (succ u2)} (MonoidAlgebra.{u1, u2} k G _inst_1) (Nat.cast.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toNatCast.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)) n) (MonoidAlgebra.single.{u1, u2} k G _inst_1 (OfNat.ofNat.{u2} G 1 (One.toOfNat1.{u2} G (MulOneClass.toOne.{u2} G _inst_2))) (Nat.cast.{u1} k (Semiring.toNatCast.{u1} k _inst_1) n))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.nat_cast_def MonoidAlgebra.nat_cast_defₓ'. -/
theorem nat_cast_def (n : ℕ) : (n : MonoidAlgebra k G) = single 1 n :=
  rfl
#align monoid_algebra.nat_cast_def MonoidAlgebra.nat_cast_def

end MulOneClass

/-! #### Semiring structure -/

section Semiring

variable [Semiring k] [Monoid G]

instance : Semiring (MonoidAlgebra k G) :=
  { MonoidAlgebra.nonUnitalSemiring,
    MonoidAlgebra.nonAssocSemiring with
    one := 1
    mul := (· * ·)
    zero := 0
    add := (· + ·) }

variable [Semiring R]

/- warning: monoid_algebra.lift_nc_ring_hom -> MonoidAlgebra.liftNCRingHom is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Monoid.{u2} G] [_inst_3 : Semiring.{u3} R] (f : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (g : MonoidHom.{u2, u3} G R (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))), (forall (x : k) (y : G), Commute.{u3} R (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => k -> R) (RingHom.hasCoeToFun.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f x) (coeFn.{max (succ u3) (succ u2), max (succ u2) (succ u3)} (MonoidHom.{u2, u3} G R (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (fun (_x : MonoidHom.{u2, u3} G R (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) => G -> R) (MonoidHom.hasCoeToFun.{u2, u3} G R (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) g y)) -> (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Monoid.{u2} G] [_inst_3 : Semiring.{u3} R] (f : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (g : MonoidHom.{u2, u3} G R (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))), (forall (x : k) (y : G), Commute.{u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) x) (NonUnitalNonAssocSemiring.toMul.{u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) x) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) x) (Semiring.toNonAssocSemiring.{u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) x) _inst_3))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.instRingHomClassRingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) f x) (FunLike.coe.{max (succ u2) (succ u3), succ u2, succ u3} (MonoidHom.{u2, u3} G R (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => R) _x) (MulHomClass.toFunLike.{max u2 u3, u2, u3} (MonoidHom.{u2, u3} G R (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) G R (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)) (MulOneClass.toMul.{u3} R (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (MonoidHomClass.toMulHomClass.{max u2 u3, u2, u3} (MonoidHom.{u2, u3} G R (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) G R (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) (MonoidHom.monoidHomClass.{u2, u3} G R (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) g y)) -> (RingHom.{max u2 u1, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.lift_nc_ring_hom MonoidAlgebra.liftNCRingHomₓ'. -/
/-- `lift_nc` as a `ring_hom`, for when `f x` and `g y` commute -/
def liftNCRingHom (f : k →+* R) (g : G →* R) (h_comm : ∀ x y, Commute (f x) (g y)) :
    MonoidAlgebra k G →+* R :=
  { liftNC (f : k →+ R) g with
    toFun := liftNC (f : k →+ R) g
    map_one' := liftNC_one _ _
    map_mul' := fun a b => liftNC_mul _ _ _ _ fun _ _ _ => h_comm _ _ }
#align monoid_algebra.lift_nc_ring_hom MonoidAlgebra.liftNCRingHom

end Semiring

instance [CommSemiring k] [CommSemigroup G] : NonUnitalCommSemiring (MonoidAlgebra k G) :=
  { MonoidAlgebra.nonUnitalSemiring with
    mul_comm := fun f g => by
      simp only [mul_def, Finsupp.sum, mul_comm]
      rw [Finset.sum_comm]
      simp only [mul_comm] }

instance [Semiring k] [Nontrivial k] [Nonempty G] : Nontrivial (MonoidAlgebra k G) :=
  Finsupp.nontrivial

/-! #### Derived instances -/

section DerivedInstances

instance [CommSemiring k] [CommMonoid G] : CommSemiring (MonoidAlgebra k G) :=
  { MonoidAlgebra.nonUnitalCommSemiring, MonoidAlgebra.semiring with }

instance [Semiring k] [Subsingleton k] : Unique (MonoidAlgebra k G) :=
  Finsupp.uniqueOfRight

instance [Ring k] : AddCommGroup (MonoidAlgebra k G) :=
  Finsupp.addCommGroup

instance [Ring k] [Mul G] : NonUnitalNonAssocRing (MonoidAlgebra k G) :=
  { MonoidAlgebra.addCommGroup, MonoidAlgebra.nonUnitalNonAssocSemiring with }

instance [Ring k] [Semigroup G] : NonUnitalRing (MonoidAlgebra k G) :=
  { MonoidAlgebra.addCommGroup, MonoidAlgebra.nonUnitalSemiring with }

instance [Ring k] [MulOneClass G] : NonAssocRing (MonoidAlgebra k G) :=
  { MonoidAlgebra.addCommGroup,
    MonoidAlgebra.nonAssocSemiring with
    intCast := fun z => single 1 (z : k)
    intCast_ofNat := fun n => by simpa
    intCast_negSucc := fun n => by simpa }

/- warning: monoid_algebra.int_cast_def -> MonoidAlgebra.int_cast_def is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Ring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (z : Int), Eq.{succ (max u1 u2)} (MonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) ((fun (a : Type) (b : Type.{max u1 u2}) [self : HasLiftT.{1, succ (max u1 u2)} a b] => self.0) Int (MonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (HasLiftT.mk.{1, succ (max u1 u2)} Int (MonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (CoeTCₓ.coe.{1, succ (max u1 u2)} Int (MonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (Int.castCoe.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (AddGroupWithOne.toHasIntCast.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (AddCommGroupWithOne.toAddGroupWithOne.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (NonAssocRing.toAddCommGroupWithOne.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocRing.{u1, u2} k G _inst_1 _inst_2))))))) z) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (Ring.toSemiring.{u1} k _inst_1))))) (OfNat.ofNat.{u2} G 1 (OfNat.mk.{u2} G 1 (One.one.{u2} G (MulOneClass.toHasOne.{u2} G _inst_2)))) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int k (HasLiftT.mk.{1, succ u1} Int k (CoeTCₓ.coe.{1, succ u1} Int k (Int.castCoe.{u1} k (AddGroupWithOne.toHasIntCast.{u1} k (AddCommGroupWithOne.toAddGroupWithOne.{u1} k (Ring.toAddCommGroupWithOne.{u1} k _inst_1)))))) z))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Ring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (z : Int), Eq.{max (succ u1) (succ u2)} (MonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (Int.cast.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (NonAssocRing.toIntCast.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocRing.{u1, u2} k G _inst_1 _inst_2)) z) (MonoidAlgebra.single.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1) (OfNat.ofNat.{u2} G 1 (One.toOfNat1.{u2} G (MulOneClass.toOne.{u2} G _inst_2))) (Int.cast.{u1} k (Ring.toIntCast.{u1} k _inst_1) z))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.int_cast_def MonoidAlgebra.int_cast_defₓ'. -/
theorem int_cast_def [Ring k] [MulOneClass G] (z : ℤ) : (z : MonoidAlgebra k G) = single 1 z :=
  rfl
#align monoid_algebra.int_cast_def MonoidAlgebra.int_cast_def

instance [Ring k] [Monoid G] : Ring (MonoidAlgebra k G) :=
  { MonoidAlgebra.nonAssocRing, MonoidAlgebra.semiring with }

instance [CommRing k] [CommSemigroup G] : NonUnitalCommRing (MonoidAlgebra k G) :=
  { MonoidAlgebra.nonUnitalCommSemiring, MonoidAlgebra.nonUnitalRing with }

instance [CommRing k] [CommMonoid G] : CommRing (MonoidAlgebra k G) :=
  { MonoidAlgebra.nonUnitalCommRing, MonoidAlgebra.ring with }

variable {S : Type _}

instance [Semiring k] [SMulZeroClass R k] : SMulZeroClass R (MonoidAlgebra k G) :=
  Finsupp.smulZeroClass

instance [Semiring k] [DistribSMul R k] : DistribSMul R (MonoidAlgebra k G) :=
  Finsupp.distribSMul _ _

instance [Monoid R] [Semiring k] [DistribMulAction R k] : DistribMulAction R (MonoidAlgebra k G) :=
  Finsupp.distribMulAction G k

instance [Semiring R] [Semiring k] [Module R k] : Module R (MonoidAlgebra k G) :=
  Finsupp.module G k

instance [Monoid R] [Semiring k] [DistribMulAction R k] [FaithfulSMul R k] [Nonempty G] :
    FaithfulSMul R (MonoidAlgebra k G) :=
  Finsupp.faithfulSMul

instance [Monoid R] [Monoid S] [Semiring k] [DistribMulAction R k] [DistribMulAction S k] [SMul R S]
    [IsScalarTower R S k] : IsScalarTower R S (MonoidAlgebra k G) :=
  Finsupp.isScalarTower G k

instance [Monoid R] [Monoid S] [Semiring k] [DistribMulAction R k] [DistribMulAction S k]
    [SMulCommClass R S k] : SMulCommClass R S (MonoidAlgebra k G) :=
  Finsupp.smulCommClass G k

instance [Monoid R] [Semiring k] [DistribMulAction R k] [DistribMulAction Rᵐᵒᵖ k]
    [IsCentralScalar R k] : IsCentralScalar R (MonoidAlgebra k G) :=
  Finsupp.isCentralScalar G k

#print MonoidAlgebra.comapDistribMulActionSelf /-
/-- This is not an instance as it conflicts with `monoid_algebra.distrib_mul_action` when `G = kˣ`.
-/
def comapDistribMulActionSelf [Group G] [Semiring k] : DistribMulAction G (MonoidAlgebra k G) :=
  Finsupp.comapDistribMulAction
#align monoid_algebra.comap_distrib_mul_action_self MonoidAlgebra.comapDistribMulActionSelf
-/

end DerivedInstances

section MiscTheorems

variable [Semiring k]

attribute [local reducible] MonoidAlgebra

/- warning: monoid_algebra.mul_apply -> MonoidAlgebra.mul_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DecidableEq.{succ u2} G] [_inst_3 : Mul.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (g : MonoidAlgebra.{u1, u2} k G _inst_1) (x : G), Eq.{succ u1} k (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_3)) f g) x) (Finsupp.sum.{u2, u1, u1} G k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) f (fun (a₁ : G) (b₁ : k) => Finsupp.sum.{u2, u1, u1} G k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) g (fun (a₂ : G) (b₂ : k) => ite.{succ u1} k (Eq.{succ u2} G (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_3) a₁ a₂) x) (_inst_2 (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_3) a₁ a₂) x) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) b₁ b₂) (OfNat.ofNat.{u1} k 0 (OfNat.mk.{u1} k 0 (Zero.zero.{u1} k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DecidableEq.{succ u2} G] [_inst_3 : Mul.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (g : MonoidAlgebra.{u1, u2} k G _inst_1) (x : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_3)) f g) x) (Finsupp.sum.{u2, u1, u1} G k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) f (fun (a₁ : G) (b₁ : k) => Finsupp.sum.{u2, u1, u1} G k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) g (fun (a₂ : G) (b₂ : k) => ite.{succ u1} k (Eq.{succ u2} G (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_3) a₁ a₂) x) (_inst_2 (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_3) a₁ a₂) x) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) b₁ b₂) (OfNat.ofNat.{u1} k 0 (Zero.toOfNat0.{u1} k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.mul_apply MonoidAlgebra.mul_applyₓ'. -/
theorem mul_apply [DecidableEq G] [Mul G] (f g : MonoidAlgebra k G) (x : G) :
    (f * g) x = f.Sum fun a₁ b₁ => g.Sum fun a₂ b₂ => if a₁ * a₂ = x then b₁ * b₂ else 0 :=
  by
  rw [mul_def]
  simp only [Finsupp.sum_apply, single_apply]
#align monoid_algebra.mul_apply MonoidAlgebra.mul_apply

/- warning: monoid_algebra.mul_apply_antidiagonal -> MonoidAlgebra.mul_apply_antidiagonal is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (g : MonoidAlgebra.{u1, u2} k G _inst_1) (x : G) (s : Finset.{u2} (Prod.{u2, u2} G G)), (forall {p : Prod.{u2, u2} G G}, Iff (Membership.Mem.{u2, u2} (Prod.{u2, u2} G G) (Finset.{u2} (Prod.{u2, u2} G G)) (Finset.hasMem.{u2} (Prod.{u2, u2} G G)) p s) (Eq.{succ u2} G (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) (Prod.fst.{u2, u2} G G p) (Prod.snd.{u2, u2} G G p)) x)) -> (Eq.{succ u1} k (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) f g) x) (Finset.sum.{u1, u2} k (Prod.{u2, u2} G G) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) s (fun (p : Prod.{u2, u2} G G) => HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f (Prod.fst.{u2, u2} G G p)) (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) g (Prod.snd.{u2, u2} G G p)))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (g : MonoidAlgebra.{u1, u2} k G _inst_1) (x : G) (s : Finset.{u2} (Prod.{u2, u2} G G)), (forall {p : Prod.{u2, u2} G G}, Iff (Membership.mem.{u2, u2} (Prod.{u2, u2} G G) (Finset.{u2} (Prod.{u2, u2} G G)) (Finset.instMembershipFinset.{u2} (Prod.{u2, u2} G G)) p s) (Eq.{succ u2} G (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) (Prod.fst.{u2, u2} G G p) (Prod.snd.{u2, u2} G G p)) x)) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) f g) x) (Finset.sum.{u1, u2} k (Prod.{u2, u2} G G) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) s (fun (p : Prod.{u2, u2} G G) => HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.snd.{u2, u2} G G p)) ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) (instHMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) _inst_1)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f (Prod.fst.{u2, u2} G G p)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) g (Prod.snd.{u2, u2} G G p)))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.mul_apply_antidiagonal MonoidAlgebra.mul_apply_antidiagonalₓ'. -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
/- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
theorem mul_apply_antidiagonal [Mul G] (f g : MonoidAlgebra k G) (x : G) (s : Finset (G × G))
    (hs : ∀ {p : G × G}, p ∈ s ↔ p.1 * p.2 = x) : (f * g) x = ∑ p in s, f p.1 * g p.2 := by
  classical exact
      let F : G × G → k := fun p => if p.1 * p.2 = x then f p.1 * g p.2 else 0
      calc
        (f * g) x = ∑ a₁ in f.support, ∑ a₂ in g.support, F (a₁, a₂) := mul_apply f g x
        _ = ∑ p in f.support ×ˢ g.support, F p := finset.sum_product.symm
        _ = ∑ p in (f.support ×ˢ g.support).filterₓ fun p : G × G => p.1 * p.2 = x, f p.1 * g p.2 :=
          (Finset.sum_filter _ _).symm
        _ = ∑ p in s.filter fun p : G × G => p.1 ∈ f.support ∧ p.2 ∈ g.support, f p.1 * g p.2 :=
          (sum_congr
            (by
              ext
              simp only [mem_filter, mem_product, hs, and_comm'])
            fun _ _ => rfl)
        _ = ∑ p in s, f p.1 * g p.2 :=
          sum_subset (filter_subset _ _) fun p hps hp =>
            by
            simp only [mem_filter, mem_support_iff, not_and, Classical.not_not] at hp⊢
            by_cases h1 : f p.1 = 0
            · rw [h1, MulZeroClass.zero_mul]
            · rw [hp hps h1, MulZeroClass.mul_zero]

#align monoid_algebra.mul_apply_antidiagonal MonoidAlgebra.mul_apply_antidiagonal

/- warning: monoid_algebra.single_mul_single -> MonoidAlgebra.single_mul_single is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] {a₁ : G} {a₂ : G} {b₁ : k} {b₂ : k}, Eq.{succ (max u2 u1)} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (instHMul.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a₁ b₁) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a₂ b₂)) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) a₁ a₂) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) b₁ b₂))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] {a₁ : G} {a₂ : G} {b₁ : k} {b₂ : k}, Eq.{max (succ u1) (succ u2)} (MonoidAlgebra.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) (MonoidAlgebra.single.{u1, u2} k G _inst_1 a₁ b₁) (MonoidAlgebra.single.{u1, u2} k G _inst_1 a₂ b₂)) (MonoidAlgebra.single.{u1, u2} k G _inst_1 (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) a₁ a₂) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) b₁ b₂))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.single_mul_single MonoidAlgebra.single_mul_singleₓ'. -/
@[simp]
theorem single_mul_single [Mul G] {a₁ a₂ : G} {b₁ b₂ : k} :
    (single a₁ b₁ : MonoidAlgebra k G) * single a₂ b₂ = single (a₁ * a₂) (b₁ * b₂) :=
  (sum_single_index (by simp only [MulZeroClass.zero_mul, single_zero, sum_zero])).trans
    (sum_single_index (by rw [MulZeroClass.mul_zero, single_zero]))
#align monoid_algebra.single_mul_single MonoidAlgebra.single_mul_single

/- warning: monoid_algebra.single_pow -> MonoidAlgebra.single_pow is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Monoid.{u2} G] {a : G} {b : k} (n : Nat), Eq.{succ (max u2 u1)} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (HPow.hPow.{max u2 u1, 0, max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) Nat (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (instHPow.{max u2 u1, 0} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) Nat (Monoid.Pow.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (MonoidWithZero.toMonoid.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (Semiring.toMonoidWithZero.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (MonoidAlgebra.semiring.{u1, u2} k G _inst_1 _inst_2))))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a b) n) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (HPow.hPow.{u2, 0, u2} G Nat G (instHPow.{u2, 0} G Nat (Monoid.Pow.{u2} G _inst_2)) a n) (HPow.hPow.{u1, 0, u1} k Nat k (instHPow.{u1, 0} k Nat (Monoid.Pow.{u1} k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))) b n))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Monoid.{u2} G] {a : G} {b : k} (n : Nat), Eq.{max (succ u1) (succ u2)} (MonoidAlgebra.{u1, u2} k G _inst_1) (HPow.hPow.{max u1 u2, 0, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) Nat (MonoidAlgebra.{u1, u2} k G _inst_1) (instHPow.{max u1 u2, 0} (MonoidAlgebra.{u1, u2} k G _inst_1) Nat (Monoid.Pow.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidWithZero.toMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.semiring.{u1, u2} k G _inst_1 _inst_2))))) (MonoidAlgebra.single.{u1, u2} k G _inst_1 a b) n) (MonoidAlgebra.single.{u1, u2} k G _inst_1 (HPow.hPow.{u2, 0, u2} G Nat G (instHPow.{u2, 0} G Nat (Monoid.Pow.{u2} G _inst_2)) a n) (HPow.hPow.{u1, 0, u1} k Nat k (instHPow.{u1, 0} k Nat (Monoid.Pow.{u1} k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))) b n))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.single_pow MonoidAlgebra.single_powₓ'. -/
@[simp]
theorem single_pow [Monoid G] {a : G} {b : k} :
    ∀ n : ℕ, (single a b : MonoidAlgebra k G) ^ n = single (a ^ n) (b ^ n)
  | 0 => by
    simp only [pow_zero]
    rfl
  | n + 1 => by simp only [pow_succ, single_pow n, single_mul_single]
#align monoid_algebra.single_pow MonoidAlgebra.single_pow

section

/- warning: monoid_algebra.map_domain_one -> MonoidAlgebra.mapDomain_one is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} {α₂ : Type.{u3}} [_inst_2 : Semiring.{u2} β] [_inst_3 : One.{u1} α] [_inst_4 : One.{u3} α₂] {F : Type.{u4}} [_inst_5 : OneHomClass.{u4, u1, u3} F α α₂ _inst_3 _inst_4] (f : F), Eq.{max (succ u3) (succ u2)} (Finsupp.{u3, u2} α₂ β (AddZeroClass.toHasZero.{u2} β (AddMonoid.toAddZeroClass.{u2} β (AddCommMonoid.toAddMonoid.{u2} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))))))) (Finsupp.mapDomain.{u1, u3, u2} α α₂ β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))) (coeFn.{succ u4, max (succ u1) (succ u3)} F (fun (_x : F) => α -> α₂) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} F α (fun (_x : α) => α₂) (OneHomClass.toFunLike.{u4, u1, u3} F α α₂ _inst_3 _inst_4 _inst_5)) f) (OfNat.ofNat.{max u2 u1} (MonoidAlgebra.{u2, u1} β α _inst_2) 1 (OfNat.mk.{max u2 u1} (MonoidAlgebra.{u2, u1} β α _inst_2) 1 (One.one.{max u2 u1} (MonoidAlgebra.{u2, u1} β α _inst_2) (MonoidAlgebra.one.{u2, u1} β α _inst_2 _inst_3))))) (OfNat.ofNat.{max u2 u3} (MonoidAlgebra.{u2, u3} β α₂ _inst_2) 1 (OfNat.mk.{max u2 u3} (MonoidAlgebra.{u2, u3} β α₂ _inst_2) 1 (One.one.{max u2 u3} (MonoidAlgebra.{u2, u3} β α₂ _inst_2) (MonoidAlgebra.one.{u2, u3} β α₂ _inst_2 _inst_4))))
but is expected to have type
  forall {α : Type.{u4}} {β : Type.{u3}} {α₂ : Type.{u2}} [_inst_2 : Semiring.{u3} β] [_inst_3 : One.{u4} α] [_inst_4 : One.{u2} α₂] {F : Type.{u1}} [_inst_5 : OneHomClass.{u1, u4, u2} F α α₂ _inst_3 _inst_4] (f : F), Eq.{max (succ u3) (succ u2)} (MonoidAlgebra.{u3, u2} β α₂ _inst_2) (MonoidAlgebra.mapDomain.{u3, u4, u2} β α _inst_2 α₂ (FunLike.coe.{succ u1, succ u4, succ u2} F α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.1262 : α) => α₂) _x) (OneHomClass.toFunLike.{u1, u4, u2} F α α₂ _inst_3 _inst_4 _inst_5) f) (OfNat.ofNat.{max u4 u3} (MonoidAlgebra.{u3, u4} β α _inst_2) 1 (One.toOfNat1.{max u4 u3} (MonoidAlgebra.{u3, u4} β α _inst_2) (MonoidAlgebra.one.{u3, u4} β α _inst_2 _inst_3)))) (OfNat.ofNat.{max u3 u2} (MonoidAlgebra.{u3, u2} β α₂ _inst_2) 1 (One.toOfNat1.{max u3 u2} (MonoidAlgebra.{u3, u2} β α₂ _inst_2) (MonoidAlgebra.one.{u3, u2} β α₂ _inst_2 _inst_4)))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.map_domain_one MonoidAlgebra.mapDomain_oneₓ'. -/
/-- Like `finsupp.map_domain_zero`, but for the `1` we define in this file -/
@[simp]
theorem mapDomain_one {α : Type _} {β : Type _} {α₂ : Type _} [Semiring β] [One α] [One α₂]
    {F : Type _} [OneHomClass F α α₂] (f : F) :
    (mapDomain f (1 : MonoidAlgebra β α) : MonoidAlgebra β α₂) = (1 : MonoidAlgebra β α₂) := by
  simp_rw [one_def, map_domain_single, map_one]
#align monoid_algebra.map_domain_one MonoidAlgebra.mapDomain_one

/- warning: monoid_algebra.map_domain_mul -> MonoidAlgebra.mapDomain_mul is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} {α₂ : Type.{u3}} [_inst_2 : Semiring.{u2} β] [_inst_3 : Mul.{u1} α] [_inst_4 : Mul.{u3} α₂] {F : Type.{u4}} [_inst_5 : MulHomClass.{u4, u1, u3} F α α₂ _inst_3 _inst_4] (f : F) (x : MonoidAlgebra.{u2, u1} β α _inst_2) (y : MonoidAlgebra.{u2, u1} β α _inst_2), Eq.{max (succ u3) (succ u2)} (Finsupp.{u3, u2} α₂ β (AddZeroClass.toHasZero.{u2} β (AddMonoid.toAddZeroClass.{u2} β (AddCommMonoid.toAddMonoid.{u2} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))))))) (Finsupp.mapDomain.{u1, u3, u2} α α₂ β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))) (coeFn.{succ u4, max (succ u1) (succ u3)} F (fun (_x : F) => α -> α₂) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} F α (fun (_x : α) => α₂) (MulHomClass.toFunLike.{u4, u1, u3} F α α₂ _inst_3 _inst_4 _inst_5)) f) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (MonoidAlgebra.{u2, u1} β α _inst_2) (MonoidAlgebra.{u2, u1} β α _inst_2) (MonoidAlgebra.{u2, u1} β α _inst_2) (instHMul.{max u2 u1} (MonoidAlgebra.{u2, u1} β α _inst_2) (MonoidAlgebra.mul.{u2, u1} β α _inst_2 _inst_3)) x y)) (HMul.hMul.{max u2 u3, max u2 u3, max u2 u3} (MonoidAlgebra.{u2, u3} β α₂ _inst_2) (MonoidAlgebra.{u2, u3} β α₂ _inst_2) (MonoidAlgebra.{u2, u3} β α₂ _inst_2) (instHMul.{max u2 u3} (MonoidAlgebra.{u2, u3} β α₂ _inst_2) (MonoidAlgebra.mul.{u2, u3} β α₂ _inst_2 _inst_4)) (Finsupp.mapDomain.{u1, u3, u2} α α₂ β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))) (coeFn.{succ u4, max (succ u1) (succ u3)} F (fun (_x : F) => α -> α₂) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} F α (fun (_x : α) => α₂) (MulHomClass.toFunLike.{u4, u1, u3} F α α₂ _inst_3 _inst_4 _inst_5)) f) x) (Finsupp.mapDomain.{u1, u3, u2} α α₂ β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))) (coeFn.{succ u4, max (succ u1) (succ u3)} F (fun (_x : F) => α -> α₂) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} F α (fun (_x : α) => α₂) (MulHomClass.toFunLike.{u4, u1, u3} F α α₂ _inst_3 _inst_4 _inst_5)) f) y))
but is expected to have type
  forall {α : Type.{u4}} {β : Type.{u3}} {α₂ : Type.{u2}} [_inst_2 : Semiring.{u3} β] [_inst_3 : Mul.{u4} α] [_inst_4 : Mul.{u2} α₂] {F : Type.{u1}} [_inst_5 : MulHomClass.{u1, u4, u2} F α α₂ _inst_3 _inst_4] (f : F) (x : MonoidAlgebra.{u3, u4} β α _inst_2) (y : MonoidAlgebra.{u3, u4} β α _inst_2), Eq.{max (succ u3) (succ u2)} (MonoidAlgebra.{u3, u2} β α₂ _inst_2) (MonoidAlgebra.mapDomain.{u3, u4, u2} β α _inst_2 α₂ (FunLike.coe.{succ u1, succ u4, succ u2} F α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : α) => α₂) _x) (MulHomClass.toFunLike.{u1, u4, u2} F α α₂ _inst_3 _inst_4 _inst_5) f) (HMul.hMul.{max u4 u3, max u4 u3, max u4 u3} (MonoidAlgebra.{u3, u4} β α _inst_2) (MonoidAlgebra.{u3, u4} β α _inst_2) (MonoidAlgebra.{u3, u4} β α _inst_2) (instHMul.{max u4 u3} (MonoidAlgebra.{u3, u4} β α _inst_2) (MonoidAlgebra.mul.{u3, u4} β α _inst_2 _inst_3)) x y)) (HMul.hMul.{max u3 u2, max u3 u2, max u3 u2} (MonoidAlgebra.{u3, u2} β α₂ _inst_2) (MonoidAlgebra.{u3, u2} β α₂ _inst_2) (MonoidAlgebra.{u3, u2} β α₂ _inst_2) (instHMul.{max u3 u2} (MonoidAlgebra.{u3, u2} β α₂ _inst_2) (MonoidAlgebra.mul.{u3, u2} β α₂ _inst_2 _inst_4)) (MonoidAlgebra.mapDomain.{u3, u4, u2} β α _inst_2 α₂ (FunLike.coe.{succ u1, succ u4, succ u2} F α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : α) => α₂) _x) (MulHomClass.toFunLike.{u1, u4, u2} F α α₂ _inst_3 _inst_4 _inst_5) f) x) (MonoidAlgebra.mapDomain.{u3, u4, u2} β α _inst_2 α₂ (FunLike.coe.{succ u1, succ u4, succ u2} F α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : α) => α₂) _x) (MulHomClass.toFunLike.{u1, u4, u2} F α α₂ _inst_3 _inst_4 _inst_5) f) y))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.map_domain_mul MonoidAlgebra.mapDomain_mulₓ'. -/
/-- Like `finsupp.map_domain_add`, but for the convolutive multiplication we define in this file -/
theorem mapDomain_mul {α : Type _} {β : Type _} {α₂ : Type _} [Semiring β] [Mul α] [Mul α₂]
    {F : Type _} [MulHomClass F α α₂] (f : F) (x y : MonoidAlgebra β α) :
    (mapDomain f (x * y : MonoidAlgebra β α) : MonoidAlgebra β α₂) =
      (mapDomain f x * mapDomain f y : MonoidAlgebra β α₂) :=
  by
  simp_rw [mul_def, map_domain_sum, map_domain_single, map_mul]
  rw [Finsupp.sum_mapDomain_index]
  · congr
    ext (a b)
    rw [Finsupp.sum_mapDomain_index]
    · simp
    · simp [mul_add]
  · simp
  · simp [add_mul]
#align monoid_algebra.map_domain_mul MonoidAlgebra.mapDomain_mul

variable (k G)

#print MonoidAlgebra.ofMagma /-
/-- The embedding of a magma into its magma algebra. -/
@[simps]
def ofMagma [Mul G] : G →ₙ* MonoidAlgebra k G
    where
  toFun a := single a 1
  map_mul' a b := by
    simp only [mul_def, mul_one, sum_single_index, single_eq_zero, MulZeroClass.mul_zero]
#align monoid_algebra.of_magma MonoidAlgebra.ofMagma
-/

#print MonoidAlgebra.of /-
/-- The embedding of a unital magma into its magma algebra. -/
@[simps]
def of [MulOneClass G] : G →* MonoidAlgebra k G :=
  { ofMagma k G with
    toFun := fun a => single a 1
    map_one' := rfl }
#align monoid_algebra.of MonoidAlgebra.of
-/

end

/- warning: monoid_algebra.smul_of -> MonoidAlgebra.smul_of is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (g : G) (r : k), Eq.{succ (max u1 u2)} (MonoidAlgebra.{u1, u2} k G _inst_1) (SMul.smul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toHasSmul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (MonoidAlgebra.smulZeroClass.{u1, u2, u1} k G k _inst_1 (SMulWithZero.toSmulZeroClass.{u1, u1} k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))) r (coeFn.{max (succ (max u1 u2)) (succ u2), max (succ u2) (succ (max u1 u2))} (MonoidHom.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (fun (_x : MonoidHom.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) => G -> (MonoidAlgebra.{u1, u2} k G _inst_1)) (MonoidHom.hasCoeToFun.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (MonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_2) g)) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) g r)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (g : G) (r : k), Eq.{max (succ u1) (succ u2)} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G _inst_1) g) (HSMul.hSMul.{u1, max u1 u2, max u1 u2} k ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G _inst_1) g) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G _inst_1) g) (instHSMul.{u1, max u1 u2} k ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G _inst_1) g) (SMulZeroClass.toSMul.{u1, max u1 u2} k ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G _inst_1) g) (MulZeroOneClass.toZero.{max u1 u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G _inst_1) g) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G _inst_1) g) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MonoidAlgebra.smulZeroClass.{u1, u2, u1} k G k _inst_1 (SMulWithZero.toSMulZeroClass.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))))) r (FunLike.coe.{max (succ u1) (succ u2), succ u2, max (succ u1) (succ u2)} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G _inst_1) _x) (MulHomClass.toFunLike.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) G (MonoidAlgebra.{u1, u2} k G _inst_1) (MulOneClass.toMul.{u2} G _inst_2) (MulOneClass.toMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (MonoidHomClass.toMulHomClass.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MonoidHom.monoidHomClass.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))))) (MonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_2) g)) (MonoidAlgebra.single.{u1, u2} k G _inst_1 g r)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.smul_of MonoidAlgebra.smul_ofₓ'. -/
theorem smul_of [MulOneClass G] (g : G) (r : k) : r • of k G g = single g r := by simp
#align monoid_algebra.smul_of MonoidAlgebra.smul_of

/- warning: monoid_algebra.of_injective -> MonoidAlgebra.of_injective is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] [_inst_3 : Nontrivial.{u1} k], Function.Injective.{succ u2, succ (max u1 u2)} G (MonoidAlgebra.{u1, u2} k G _inst_1) (coeFn.{max (succ (max u1 u2)) (succ u2), max (succ u2) (succ (max u1 u2))} (MonoidHom.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (fun (_x : MonoidHom.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) => G -> (MonoidAlgebra.{u1, u2} k G _inst_1)) (MonoidHom.hasCoeToFun.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (MonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_2))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] [_inst_3 : Nontrivial.{u1} k], Function.Injective.{succ u2, max (succ u1) (succ u2)} G (MonoidAlgebra.{u1, u2} k G _inst_1) (FunLike.coe.{max (succ u1) (succ u2), succ u2, max (succ u1) (succ u2)} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G _inst_1) _x) (MulHomClass.toFunLike.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) G (MonoidAlgebra.{u1, u2} k G _inst_1) (MulOneClass.toMul.{u2} G _inst_2) (MulOneClass.toMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (MonoidHomClass.toMulHomClass.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MonoidHom.monoidHomClass.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))))) (MonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_2))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.of_injective MonoidAlgebra.of_injectiveₓ'. -/
theorem of_injective [MulOneClass G] [Nontrivial k] : Function.Injective (of k G) := fun a b h => by
  simpa using (single_eq_single_iff _ _ _ _).mp h
#align monoid_algebra.of_injective MonoidAlgebra.of_injective

/- warning: monoid_algebra.single_hom -> MonoidAlgebra.singleHom is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G], MonoidHom.{max u1 u2, max u1 u2} (Prod.{u1, u2} k G) (MonoidAlgebra.{u1, u2} k G _inst_1) (Prod.mulOneClass.{u1, u2} k G (MulZeroOneClass.toMulOneClass.{u1} k (NonAssocSemiring.toMulZeroOneClass.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G], MonoidHom.{max u2 u1, max u2 u1} (Prod.{u1, u2} k G) (MonoidAlgebra.{u1, u2} k G _inst_1) (Prod.instMulOneClassProd.{u1, u2} k G (MulZeroOneClass.toMulOneClass.{u1} k (NonAssocSemiring.toMulZeroOneClass.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.single_hom MonoidAlgebra.singleHomₓ'. -/
/-- `finsupp.single` as a `monoid_hom` from the product type into the monoid algebra.

Note the order of the elements of the product are reversed compared to the arguments of
`finsupp.single`.
-/
@[simps]
def singleHom [MulOneClass G] : k × G →* MonoidAlgebra k G
    where
  toFun a := single a.2 a.1
  map_one' := rfl
  map_mul' a b := single_mul_single.symm
#align monoid_algebra.single_hom MonoidAlgebra.singleHom

/- warning: monoid_algebra.mul_single_apply_aux -> MonoidAlgebra.mul_single_apply_aux is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) {r : k} {x : G} {y : G} {z : G}, (forall (a : G), Iff (Eq.{succ u2} G (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) a x) z) (Eq.{succ u2} G a y)) -> (Eq.{succ u1} k (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) f (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x r)) z) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f y) r))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) {r : k} {x : G} {y : G} {z : G}, (forall (a : G), Iff (Eq.{succ u2} G (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) a x) z) (Eq.{succ u2} G a y)) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) z) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) f (MonoidAlgebra.single.{u1, u2} k G _inst_1 x r)) z) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (instHMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) _inst_1)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f y) r))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.mul_single_apply_aux MonoidAlgebra.mul_single_apply_auxₓ'. -/
theorem mul_single_apply_aux [Mul G] (f : MonoidAlgebra k G) {r : k} {x y z : G}
    (H : ∀ a, a * x = z ↔ a = y) : (f * single x r) z = f y * r := by
  classical exact
      have A :
        ∀ a₁ b₁,
          ((single x r).Sum fun a₂ b₂ => ite (a₁ * a₂ = z) (b₁ * b₂) 0) =
            ite (a₁ * x = z) (b₁ * r) 0 :=
        fun a₁ b₁ => sum_single_index <| by simp
      calc
        (f * single x r) z = Sum f fun a b => if a = y then b * r else 0 := by
          simp only [mul_apply, A, H]
        _ = if y ∈ f.support then f y * r else 0 := (f.support.sum_ite_eq' _ _)
        _ = f y * r := by split_ifs with h <;> simp at h <;> simp [h]

#align monoid_algebra.mul_single_apply_aux MonoidAlgebra.mul_single_apply_aux

/- warning: monoid_algebra.mul_single_one_apply -> MonoidAlgebra.mul_single_one_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G), Eq.{succ u1} k (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toHasMul.{u2} G _inst_2))) f (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (OfNat.ofNat.{u2} G 1 (OfNat.mk.{u2} G 1 (One.one.{u2} G (MulOneClass.toHasOne.{u2} G _inst_2)))) r)) x) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f x) r)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u2 u1, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toMul.{u2} G _inst_2))) f (MonoidAlgebra.single.{u1, u2} k G _inst_1 (OfNat.ofNat.{u2} G 1 (One.toOfNat1.{u2} G (MulOneClass.toOne.{u2} G _inst_2))) r)) x) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (instHMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) _inst_1)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f x) r)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.mul_single_one_apply MonoidAlgebra.mul_single_one_applyₓ'. -/
theorem mul_single_one_apply [MulOneClass G] (f : MonoidAlgebra k G) (r : k) (x : G) :
    (f * single 1 r) x = f x * r :=
  f.mul_single_apply_aux fun a => by rw [mul_one]
#align monoid_algebra.mul_single_one_apply MonoidAlgebra.mul_single_one_apply

/- warning: monoid_algebra.mul_single_apply_of_not_exists_mul -> MonoidAlgebra.mul_single_apply_of_not_exists_mul is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] (r : k) {g : G} {g' : G} (x : MonoidAlgebra.{u1, u2} k G _inst_1), (Not (Exists.{succ u2} G (fun (d : G) => Eq.{succ u2} G g' (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) d g)))) -> (Eq.{succ u1} k (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) x (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) g r)) g') (OfNat.ofNat.{u1} k 0 (OfNat.mk.{u1} k 0 (Zero.zero.{u1} k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] (r : k) {g : G} {g' : G} (x : MonoidAlgebra.{u1, u2} k G _inst_1), (Not (Exists.{succ u2} G (fun (d : G) => Eq.{succ u2} G g' (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) d g)))) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) x (MonoidAlgebra.single.{u1, u2} k G _inst_1 g r)) g') (OfNat.ofNat.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') 0 (Zero.toOfNat0.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (MonoidWithZero.toZero.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (Semiring.toMonoidWithZero.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') _inst_1)))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.mul_single_apply_of_not_exists_mul MonoidAlgebra.mul_single_apply_of_not_exists_mulₓ'. -/
theorem mul_single_apply_of_not_exists_mul [Mul G] (r : k) {g g' : G} (x : MonoidAlgebra k G)
    (h : ¬∃ d, g' = d * g) : (x * Finsupp.single g r : MonoidAlgebra k G) g' = 0 := by
  classical
    rw [mul_apply, Finsupp.sum_comm, Finsupp.sum_single_index]
    swap
    · simp_rw [Finsupp.sum, MulZeroClass.mul_zero, if_t_t, Finset.sum_const_zero]
    · apply Finset.sum_eq_zero
      simp_rw [ite_eq_right_iff]
      rintro g'' hg'' rfl
      exfalso
      exact h ⟨_, rfl⟩
#align monoid_algebra.mul_single_apply_of_not_exists_mul MonoidAlgebra.mul_single_apply_of_not_exists_mul

/- warning: monoid_algebra.single_mul_apply_aux -> MonoidAlgebra.single_mul_apply_aux is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) {r : k} {x : G} {y : G} {z : G}, (forall (a : G), Iff (Eq.{succ u2} G (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) x a) y) (Eq.{succ u2} G a z)) -> (Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (instHMul.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x r) f) y) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) r (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f z)))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) {r : k} {x : G} {y : G} {z : G}, (forall (a : G), Iff (Eq.{succ u2} G (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) x a) y) (Eq.{succ u2} G a z)) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) (MonoidAlgebra.single.{u1, u2} k G _inst_1 x r) f) y) (HMul.hMul.{u1, u1, u1} k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) z) k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) r (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f z)))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.single_mul_apply_aux MonoidAlgebra.single_mul_apply_auxₓ'. -/
theorem single_mul_apply_aux [Mul G] (f : MonoidAlgebra k G) {r : k} {x y z : G}
    (H : ∀ a, x * a = y ↔ a = z) : (single x r * f) y = r * f z := by
  classical exact
      have : (f.sum fun a b => ite (x * a = y) (0 * b) 0) = 0 := by simp
      calc
        (single x r * f) y = Sum f fun a b => ite (x * a = y) (r * b) 0 :=
          (mul_apply _ _ _).trans <| sum_single_index this
        _ = f.sum fun a b => ite (a = z) (r * b) 0 := by simp only [H]
        _ = if z ∈ f.support then r * f z else 0 := (f.support.sum_ite_eq' _ _)
        _ = _ := by split_ifs with h <;> simp at h <;> simp [h]

#align monoid_algebra.single_mul_apply_aux MonoidAlgebra.single_mul_apply_aux

/- warning: monoid_algebra.single_one_mul_apply -> MonoidAlgebra.single_one_mul_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G), Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (instHMul.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toHasMul.{u2} G _inst_2))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (OfNat.ofNat.{u2} G 1 (OfNat.mk.{u2} G 1 (One.one.{u2} G (MulOneClass.toHasOne.{u2} G _inst_2)))) r) f) x) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) r (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f x))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toMul.{u2} G _inst_2))) (MonoidAlgebra.single.{u1, u2} k G _inst_1 (OfNat.ofNat.{u2} G 1 (One.toOfNat1.{u2} G (MulOneClass.toOne.{u2} G _inst_2))) r) f) x) (HMul.hMul.{u1, u1, u1} k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) r (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f x))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.single_one_mul_apply MonoidAlgebra.single_one_mul_applyₓ'. -/
theorem single_one_mul_apply [MulOneClass G] (f : MonoidAlgebra k G) (r : k) (x : G) :
    (single 1 r * f) x = r * f x :=
  f.single_mul_apply_aux fun a => by rw [one_mul]
#align monoid_algebra.single_one_mul_apply MonoidAlgebra.single_one_mul_apply

/- warning: monoid_algebra.single_mul_apply_of_not_exists_mul -> MonoidAlgebra.single_mul_apply_of_not_exists_mul is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] (r : k) {g : G} {g' : G} (x : MonoidAlgebra.{u1, u2} k G _inst_1), (Not (Exists.{succ u2} G (fun (d : G) => Eq.{succ u2} G g' (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) g d)))) -> (Eq.{succ u1} k (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) g r) x) g') (OfNat.ofNat.{u1} k 0 (OfNat.mk.{u1} k 0 (Zero.zero.{u1} k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G] (r : k) {g : G} {g' : G} (x : MonoidAlgebra.{u1, u2} k G _inst_1), (Not (Exists.{succ u2} G (fun (d : G) => Eq.{succ u2} G g' (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G _inst_2) g d)))) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2)) (MonoidAlgebra.single.{u1, u2} k G _inst_1 g r) x) g') (OfNat.ofNat.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') 0 (Zero.toOfNat0.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (MonoidWithZero.toZero.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (Semiring.toMonoidWithZero.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') _inst_1)))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.single_mul_apply_of_not_exists_mul MonoidAlgebra.single_mul_apply_of_not_exists_mulₓ'. -/
theorem single_mul_apply_of_not_exists_mul [Mul G] (r : k) {g g' : G} (x : MonoidAlgebra k G)
    (h : ¬∃ d, g' = g * d) : (Finsupp.single g r * x : MonoidAlgebra k G) g' = 0 := by
  classical
    rw [mul_apply, Finsupp.sum_single_index]
    swap
    · simp_rw [Finsupp.sum, MulZeroClass.zero_mul, if_t_t, Finset.sum_const_zero]
    · apply Finset.sum_eq_zero
      simp_rw [ite_eq_right_iff]
      rintro g'' hg'' rfl
      exfalso
      exact h ⟨_, rfl⟩
#align monoid_algebra.single_mul_apply_of_not_exists_mul MonoidAlgebra.single_mul_apply_of_not_exists_mul

/- warning: monoid_algebra.lift_nc_smul -> MonoidAlgebra.liftNC_smul is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] {R : Type.{u3}} [_inst_3 : Semiring.{u3} R] (f : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (g : MonoidHom.{u2, u3} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (c : k) (φ : MonoidAlgebra.{u1, u2} k G _inst_1), Eq.{succ u3} R (coeFn.{max (succ u3) (succ (max u1 u2)), max (succ (max u1 u2)) (succ u3)} (AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (fun (_x : AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (MonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (coeFn.{max (succ u3) (succ u2), max (succ u2) (succ u3)} (MonoidHom.{u2, u3} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (fun (_x : MonoidHom.{u2, u3} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) => G -> R) (MonoidHom.hasCoeToFun.{u2, u3} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) g)) (SMul.smul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toHasSmul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (MonoidAlgebra.smulZeroClass.{u1, u2, u1} k G k _inst_1 (SMulWithZero.toSmulZeroClass.{u1, u1} k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))) c φ)) (HMul.hMul.{u3, u3, u3} R R R (instHMul.{u3} R (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => k -> R) (RingHom.hasCoeToFun.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f c) (coeFn.{max (succ u3) (succ (max u1 u2)), max (succ (max u1 u2)) (succ u3)} (AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (fun (_x : AddMonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (MonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (coeFn.{max (succ u3) (succ u2), max (succ u2) (succ u3)} (MonoidHom.{u2, u3} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (fun (_x : MonoidHom.{u2, u3} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) => G -> R) (MonoidHom.hasCoeToFun.{u2, u3} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) g)) φ))
but is expected to have type
  forall {k : Type.{u2}} {G : Type.{u3}} [_inst_1 : Semiring.{u2} k] [_inst_2 : MulOneClass.{u3} G] {R : Type.{u1}} [_inst_3 : Semiring.{u1} R] (f : RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (g : MonoidHom.{u3, u1} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (c : k) (φ : MonoidAlgebra.{u2, u3} k G _inst_1), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) (HSMul.hSMul.{u2, max u2 u3, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.{u2, u3} k G _inst_1) (instHSMul.{u2, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (SMulZeroClass.toSMul.{u2, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (MulZeroOneClass.toZero.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2))) (MonoidAlgebra.smulZeroClass.{u2, u3, u2} k G k _inst_1 (SMulWithZero.toSMulZeroClass.{u2, u2} k k (MonoidWithZero.toZero.{u2} k (Semiring.toMonoidWithZero.{u2} k _inst_1)) (MonoidWithZero.toZero.{u2} k (Semiring.toMonoidWithZero.{u2} k _inst_1)) (MulZeroClass.toSMulWithZero.{u2} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1)))))))) c φ)) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (AddMonoidHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : MonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddZeroClass.toAdd.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidHomClass.toAddHomClass.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidHom.addMonoidHomClass.{max u2 u3, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))))) (MonoidAlgebra.liftNC.{u2, u3, u1} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidHomClass.toAddMonoidHom.{u2, u1, max u2 u1} k R (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (MonoidHom.{u3, u1} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => R) _x) (MulHomClass.toFunLike.{max u3 u1, u3, u1} (MonoidHom.{u3, u1} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) G R (MulOneClass.toMul.{u3} G _inst_2) (MulOneClass.toMul.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (MonoidHomClass.toMulHomClass.{max u3 u1, u3, u1} (MonoidHom.{u3, u1} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (MonoidHom.monoidHomClass.{u3, u1} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) g)) (HSMul.hSMul.{u2, max u2 u3, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.{u2, u3} k G _inst_1) (instHSMul.{u2, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (SMulZeroClass.toSMul.{u2, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (MulZeroOneClass.toZero.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2))) (MonoidAlgebra.smulZeroClass.{u2, u3, u2} k G k _inst_1 (SMulWithZero.toSMulZeroClass.{u2, u2} k k (MonoidWithZero.toZero.{u2} k (Semiring.toMonoidWithZero.{u2} k _inst_1)) (MonoidWithZero.toZero.{u2} k (Semiring.toMonoidWithZero.{u2} k _inst_1)) (MulZeroClass.toSMulWithZero.{u2} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1)))))))) c φ)) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) φ) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) (instHMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) _inst_3)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (NonUnitalNonAssocSemiring.toMul.{u2} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) f c) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (AddMonoidHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : MonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddZeroClass.toAdd.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidHomClass.toAddHomClass.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidHom.addMonoidHomClass.{max u2 u3, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))))) (MonoidAlgebra.liftNC.{u2, u3, u1} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidHomClass.toAddMonoidHom.{u2, u1, max u2 u1} k R (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (MonoidHom.{u3, u1} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => R) _x) (MulHomClass.toFunLike.{max u3 u1, u3, u1} (MonoidHom.{u3, u1} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) G R (MulOneClass.toMul.{u3} G _inst_2) (MulOneClass.toMul.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (MonoidHomClass.toMulHomClass.{max u3 u1, u3, u1} (MonoidHom.{u3, u1} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (MonoidHom.monoidHomClass.{u3, u1} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) g)) φ))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.lift_nc_smul MonoidAlgebra.liftNC_smulₓ'. -/
theorem liftNC_smul [MulOneClass G] {R : Type _} [Semiring R] (f : k →+* R) (g : G →* R) (c : k)
    (φ : MonoidAlgebra k G) : liftNC (f : k →+ R) g (c • φ) = f c * liftNC (f : k →+ R) g φ :=
  by
  suffices :
    (lift_nc (↑f) g).comp (smulAddHom k (MonoidAlgebra k G) c) =
      (AddMonoidHom.mulLeft (f c)).comp (lift_nc (↑f) g)
  exact AddMonoidHom.congr_fun this φ
  ext (a b); simp [mul_assoc]
#align monoid_algebra.lift_nc_smul MonoidAlgebra.liftNC_smul

end MiscTheorems

/-! #### Non-unital, non-associative algebra structure -/

section NonUnitalNonAssocAlgebra

variable (k) [Semiring k] [DistribSMul R k] [Mul G]

/- warning: monoid_algebra.is_scalar_tower_self -> MonoidAlgebra.isScalarTower_self is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Mul.{u2} G] [_inst_4 : IsScalarTower.{u3, u1, u1} R k k (SMulZeroClass.toHasSmul.{u3, u1} R k (AddZeroClass.toHasZero.{u1} k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)) (Mul.toSMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (SMulZeroClass.toHasSmul.{u3, u1} R k (AddZeroClass.toHasZero.{u1} k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))], IsScalarTower.{u3, max u1 u2, max u1 u2} R (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toHasSmul.{u3, max u1 u2} R (MonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (MonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))) (Mul.toSMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_3)) (SMulZeroClass.toHasSmul.{u3, max u1 u2} R (MonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (MonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)))
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Mul.{u2} G] [_inst_4 : IsScalarTower.{u3, u1, u1} R k k (SMulZeroClass.toSMul.{u3, u1} R k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)) (SMulZeroClass.toSMul.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (SMulZeroClass.toSMul.{u3, u1} R k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))], IsScalarTower.{u3, max u2 u1, max u2 u1} R (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toSMul.{u3, max u1 u2} R (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))) (SMulZeroClass.toSMul.{max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (SMulWithZero.toSMulZeroClass.{max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toSMulWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))))) (SMulZeroClass.toSMul.{u3, max u1 u2} R (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.is_scalar_tower_self MonoidAlgebra.isScalarTower_selfₓ'. -/
instance isScalarTower_self [IsScalarTower R k k] :
    IsScalarTower R (MonoidAlgebra k G) (MonoidAlgebra k G) :=
  ⟨fun t a b => by
    ext m
    classical simp only [mul_apply, Finsupp.smul_sum, smul_ite, smul_mul_assoc, sum_smul_index',
        MulZeroClass.zero_mul, if_t_t, imp_true_iff, eq_self_iff_true, sum_zero, coe_smul,
        smul_eq_mul, Pi.smul_apply, smul_zero]⟩
#align monoid_algebra.is_scalar_tower_self MonoidAlgebra.isScalarTower_self

/- warning: monoid_algebra.smul_comm_class_self -> MonoidAlgebra.sMulCommClass_self is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Mul.{u2} G] [_inst_4 : SMulCommClass.{u3, u1, u1} R k k (SMulZeroClass.toHasSmul.{u3, u1} R k (AddZeroClass.toHasZero.{u1} k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)) (Mul.toSMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))], SMulCommClass.{u3, max u1 u2, max u1 u2} R (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toHasSmul.{u3, max u1 u2} R (MonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (MonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))) (Mul.toSMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_3))
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Mul.{u2} G] [_inst_4 : SMulCommClass.{u3, u1, u1} R k k (SMulZeroClass.toSMul.{u3, u1} R k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)) (SMulZeroClass.toSMul.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))], SMulCommClass.{u3, max u2 u1, max u2 u1} R (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toSMul.{u3, max u1 u2} R (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))) (SMulZeroClass.toSMul.{max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (SMulWithZero.toSMulZeroClass.{max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toSMulWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.smul_comm_class_self MonoidAlgebra.sMulCommClass_selfₓ'. -/
/-- Note that if `k` is a `comm_semiring` then we have `smul_comm_class k k k` and so we can take
`R = k` in the below. In other words, if the coefficients are commutative amongst themselves, they
also commute with the algebra multiplication. -/
instance sMulCommClass_self [SMulCommClass R k k] :
    SMulCommClass R (MonoidAlgebra k G) (MonoidAlgebra k G) :=
  ⟨fun t a b => by
    classical
      ext m
      simp only [mul_apply, Finsupp.sum, Finset.smul_sum, smul_ite, mul_smul_comm, sum_smul_index',
        imp_true_iff, eq_self_iff_true, coe_smul, ite_eq_right_iff, smul_eq_mul, Pi.smul_apply,
        MulZeroClass.mul_zero, smul_zero]⟩
#align monoid_algebra.smul_comm_class_self MonoidAlgebra.sMulCommClass_self

/- warning: monoid_algebra.smul_comm_class_symm_self -> MonoidAlgebra.sMulCommClass_symm_self is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Mul.{u2} G] [_inst_4 : SMulCommClass.{u1, u3, u1} k R k (Mul.toSMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (SMulZeroClass.toHasSmul.{u3, u1} R k (AddZeroClass.toHasZero.{u1} k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))], SMulCommClass.{max u1 u2, u3, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.{u1, u2} k G _inst_1) (Mul.toSMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_3)) (SMulZeroClass.toHasSmul.{u3, max u1 u2} R (MonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (MonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)))
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Mul.{u2} G] [_inst_4 : SMulCommClass.{u1, u3, u1} k R k (SMulZeroClass.toSMul.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (SMulZeroClass.toSMul.{u3, u1} R k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))], SMulCommClass.{max u2 u1, u3, max u2 u1} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toSMul.{max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (SMulWithZero.toSMulZeroClass.{max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toSMulWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))))) (SMulZeroClass.toSMul.{u3, max u1 u2} R (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.smul_comm_class_symm_self MonoidAlgebra.sMulCommClass_symm_selfₓ'. -/
instance sMulCommClass_symm_self [SMulCommClass k R k] :
    SMulCommClass (MonoidAlgebra k G) R (MonoidAlgebra k G) :=
  ⟨fun t a b => by
    haveI := SMulCommClass.symm k R k
    rw [← smul_comm]⟩
#align monoid_algebra.smul_comm_class_symm_self MonoidAlgebra.sMulCommClass_symm_self

variable {A : Type u₃} [NonUnitalNonAssocSemiring A]

/- warning: monoid_algebra.non_unital_alg_hom_ext -> MonoidAlgebra.nonUnitalAlgHom_ext is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Mul.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : DistribMulAction.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4))] {φ₁ : NonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5} {φ₂ : NonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5}, (forall (x : G), Eq.{succ u3} A (coeFn.{max (succ (max u1 u2)) (succ u3), max (succ (max u1 u2)) (succ u3)} (NonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) (fun (_x : NonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> A) (NonUnitalAlgHom.hasCoeToFun.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))) (coeFn.{max (succ (max u1 u2)) (succ u3), max (succ (max u1 u2)) (succ u3)} (NonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) (fun (_x : NonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> A) (NonUnitalAlgHom.hasCoeToFun.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₂ (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))))))) -> (Eq.{max (succ (max u1 u2)) (succ u3)} (NonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ φ₂)
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Mul.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : DistribMulAction.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4))] {φ₁ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5} {φ₂ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5}, (forall (x : G), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.NonUnitalAlg._hyg.1412 : MonoidAlgebra.{u1, u2} k G _inst_1) => A) (MonoidAlgebra.single.{u1, u2} k G _inst_1 x (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k _inst_1))))) (FunLike.coe.{max (max (succ u1) (succ u2)) (succ u3), max (succ u1) (succ u2), succ u3} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.NonUnitalAlg._hyg.1412 : MonoidAlgebra.{u1, u2} k G _inst_1) => A) _x) (NonUnitalAlgHom.instFunLikeNonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ (MonoidAlgebra.single.{u1, u2} k G _inst_1 x (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k _inst_1))))) (FunLike.coe.{max (max (succ u1) (succ u2)) (succ u3), max (succ u1) (succ u2), succ u3} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.NonUnitalAlg._hyg.1412 : MonoidAlgebra.{u1, u2} k G _inst_1) => A) _x) (NonUnitalAlgHom.instFunLikeNonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₂ (MonoidAlgebra.single.{u1, u2} k G _inst_1 x (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k _inst_1)))))) -> (Eq.{max (max (succ u1) (succ u2)) (succ u3)} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ φ₂)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.non_unital_alg_hom_ext MonoidAlgebra.nonUnitalAlgHom_extₓ'. -/
/-- A non_unital `k`-algebra homomorphism from `monoid_algebra k G` is uniquely defined by its
values on the functions `single a 1`. -/
theorem nonUnitalAlgHom_ext [DistribMulAction k A] {φ₁ φ₂ : MonoidAlgebra k G →ₙₐ[k] A}
    (h : ∀ x, φ₁ (single x 1) = φ₂ (single x 1)) : φ₁ = φ₂ :=
  NonUnitalAlgHom.to_distribMulActionHom_injective <|
    Finsupp.distribMulActionHom_ext' fun a => DistribMulActionHom.ext_ring (h a)
#align monoid_algebra.non_unital_alg_hom_ext MonoidAlgebra.nonUnitalAlgHom_ext

/- warning: monoid_algebra.non_unital_alg_hom_ext' -> MonoidAlgebra.nonUnitalAlgHom_ext' is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Mul.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : DistribMulAction.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4))] {φ₁ : NonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5} {φ₂ : NonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5}, (Eq.{max (succ u3) (succ u2)} (MulHom.{u2, u3} G A _inst_3 (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4))) (MulHom.comp.{u2, max u1 u2, u3} G (MonoidAlgebra.{u1, u2} k G _inst_1) A _inst_3 (Distrib.toHasMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4)) (NonUnitalAlgHom.toMulHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5 φ₁) (MonoidAlgebra.ofMagma.{u1, u2} k G _inst_1 _inst_3)) (MulHom.comp.{u2, max u1 u2, u3} G (MonoidAlgebra.{u1, u2} k G _inst_1) A _inst_3 (Distrib.toHasMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4)) (NonUnitalAlgHom.toMulHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5 φ₂) (MonoidAlgebra.ofMagma.{u1, u2} k G _inst_1 _inst_3))) -> (Eq.{max (succ (max u1 u2)) (succ u3)} (NonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ φ₂)
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Mul.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : DistribMulAction.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4))] {φ₁ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5} {φ₂ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5}, (Eq.{max (succ u2) (succ u3)} (MulHom.{u2, u3} G A _inst_3 (NonUnitalNonAssocSemiring.toMul.{u3} A _inst_4)) (MulHom.comp.{u2, max u1 u2, u3} G (MonoidAlgebra.{u1, u2} k G _inst_1) A _inst_3 (NonUnitalNonAssocSemiring.toMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)) (NonUnitalNonAssocSemiring.toMul.{u3} A _inst_4) (NonUnitalAlgHom.toMulHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5 φ₁) (MonoidAlgebra.ofMagma.{u1, u2} k G _inst_1 _inst_3)) (MulHom.comp.{u2, max u1 u2, u3} G (MonoidAlgebra.{u1, u2} k G _inst_1) A _inst_3 (NonUnitalNonAssocSemiring.toMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)) (NonUnitalNonAssocSemiring.toMul.{u3} A _inst_4) (NonUnitalAlgHom.toMulHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5 φ₂) (MonoidAlgebra.ofMagma.{u1, u2} k G _inst_1 _inst_3))) -> (Eq.{max (max (succ u1) (succ u2)) (succ u3)} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ φ₂)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.non_unital_alg_hom_ext' MonoidAlgebra.nonUnitalAlgHom_ext'ₓ'. -/
/-- See note [partially-applied ext lemmas]. -/
@[ext]
theorem nonUnitalAlgHom_ext' [DistribMulAction k A] {φ₁ φ₂ : MonoidAlgebra k G →ₙₐ[k] A}
    (h : φ₁.toMulHom.comp (ofMagma k G) = φ₂.toMulHom.comp (ofMagma k G)) : φ₁ = φ₂ :=
  nonUnitalAlgHom_ext k <| MulHom.congr_fun h
#align monoid_algebra.non_unital_alg_hom_ext' MonoidAlgebra.nonUnitalAlgHom_ext'

/- warning: monoid_algebra.lift_magma -> MonoidAlgebra.liftMagma is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Mul.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : Module.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)] [_inst_6 : IsScalarTower.{u1, u3, u3} k A A (SMulZeroClass.toHasSmul.{u1, u3} k A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (SMulWithZero.toSmulZeroClass.{u1, u3} k A (MulZeroClass.toHasZero.{u1} k (MulZeroOneClass.toMulZeroClass.{u1} k (MonoidWithZero.toMulZeroOneClass.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5)))) (Mul.toSMul.{u3} A (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4))) (SMulZeroClass.toHasSmul.{u1, u3} k A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (SMulWithZero.toSmulZeroClass.{u1, u3} k A (MulZeroClass.toHasZero.{u1} k (MulZeroOneClass.toMulZeroClass.{u1} k (MonoidWithZero.toMulZeroOneClass.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5))))] [_inst_7 : SMulCommClass.{u1, u3, u3} k A A (SMulZeroClass.toHasSmul.{u1, u3} k A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (SMulWithZero.toSmulZeroClass.{u1, u3} k A (MulZeroClass.toHasZero.{u1} k (MulZeroOneClass.toMulZeroClass.{u1} k (MonoidWithZero.toMulZeroOneClass.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5)))) (Mul.toSMul.{u3} A (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4)))], Equiv.{max (succ u3) (succ u2), max (succ (max u1 u2)) (succ u3)} (MulHom.{u2, u3} G A _inst_3 (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4))) (NonUnitalAlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 (Module.toDistribMulAction.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5))
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Mul.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : Module.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)] [_inst_6 : IsScalarTower.{u1, u3, u3} k A A (SMulZeroClass.toSMul.{u1, u3} k A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (SMulWithZero.toSMulZeroClass.{u1, u3} k A (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5)))) (SMulZeroClass.toSMul.{u3, u3} A A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (SMulWithZero.toSMulZeroClass.{u3, u3} A A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulZeroClass.toSMulWithZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)))) (SMulZeroClass.toSMul.{u1, u3} k A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (SMulWithZero.toSMulZeroClass.{u1, u3} k A (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5))))] [_inst_7 : SMulCommClass.{u1, u3, u3} k A A (SMulZeroClass.toSMul.{u1, u3} k A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (SMulWithZero.toSMulZeroClass.{u1, u3} k A (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5)))) (SMulZeroClass.toSMul.{u3, u3} A A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (SMulWithZero.toSMulZeroClass.{u3, u3} A A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulZeroClass.toSMulWithZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4))))], Equiv.{max (succ u3) (succ u2), max (succ u3) (succ (max u2 u1))} (MulHom.{u2, u3} G A _inst_3 (NonUnitalNonAssocSemiring.toMul.{u3} A _inst_4)) (NonUnitalAlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (MonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 (Module.toDistribMulAction.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.lift_magma MonoidAlgebra.liftMagmaₓ'. -/
/-- The functor `G ↦ monoid_algebra k G`, from the category of magmas to the category of non-unital,
non-associative algebras over `k` is adjoint to the forgetful functor in the other direction. -/
@[simps]
def liftMagma [Module k A] [IsScalarTower k A A] [SMulCommClass k A A] :
    (G →ₙ* A) ≃ (MonoidAlgebra k G →ₙₐ[k] A)
    where
  toFun f :=
    {
      liftAddHom fun x =>
        (smulAddHom k A).flip
          (f x) with
      toFun := fun a => a.Sum fun m t => t • f m
      map_smul' := fun t' a => by
        rw [Finsupp.smul_sum, sum_smul_index']
        · simp_rw [smul_assoc]
        · intro m
          exact zero_smul k (f m)
      map_mul' := fun a₁ a₂ => by
        let g : G → k → A := fun m t => t • f m
        have h₁ : ∀ m, g m 0 = 0 := by
          intros
          exact zero_smul k (f m)
        have h₂ : ∀ (m) (t₁ t₂ : k), g m (t₁ + t₂) = g m t₁ + g m t₂ :=
          by
          intros
          rw [← add_smul]
        simp_rw [Finsupp.mul_sum, Finsupp.sum_mul, smul_mul_smul, ← f.map_mul, mul_def,
          sum_comm a₂ a₁, sum_sum_index h₁ h₂, sum_single_index (h₁ _)] }
  invFun F := F.toMulHom.comp (ofMagma k G)
  left_inv f := by
    ext m
    simp only [NonUnitalAlgHom.coe_mk, of_magma_apply, NonUnitalAlgHom.toMulHom_eq_coe,
      sum_single_index, Function.comp_apply, one_smul, zero_smul, MulHom.coe_comp,
      NonUnitalAlgHom.coe_to_mulHom]
  right_inv F := by
    ext m
    simp only [NonUnitalAlgHom.coe_mk, of_magma_apply, NonUnitalAlgHom.toMulHom_eq_coe,
      sum_single_index, Function.comp_apply, one_smul, zero_smul, MulHom.coe_comp,
      NonUnitalAlgHom.coe_to_mulHom]
#align monoid_algebra.lift_magma MonoidAlgebra.liftMagma

end NonUnitalNonAssocAlgebra

/-! #### Algebra structure -/

section Algebra

attribute [local reducible] MonoidAlgebra

/- warning: monoid_algebra.single_one_comm -> MonoidAlgebra.single_one_comm is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (r : k) (f : MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)), Eq.{succ (max u2 u1)} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (instHMul.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (MonoidAlgebra.mul.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (MulOneClass.toHasMul.{u2} G _inst_2))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) (OfNat.ofNat.{u2} G 1 (OfNat.mk.{u2} G 1 (One.one.{u2} G (MulOneClass.toHasOne.{u2} G _inst_2)))) r) f) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (instHMul.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (MonoidAlgebra.mul.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (MulOneClass.toHasMul.{u2} G _inst_2))) f (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) (OfNat.ofNat.{u2} G 1 (OfNat.mk.{u2} G 1 (One.one.{u2} G (MulOneClass.toHasOne.{u2} G _inst_2)))) r))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] (r : k) (f : MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)), Eq.{max (succ u1) (succ u2)} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.mul.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (MulOneClass.toMul.{u2} G _inst_2))) (MonoidAlgebra.single.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (OfNat.ofNat.{u2} G 1 (One.toOfNat1.{u2} G (MulOneClass.toOne.{u2} G _inst_2))) r) f) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.mul.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (MulOneClass.toMul.{u2} G _inst_2))) f (MonoidAlgebra.single.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (OfNat.ofNat.{u2} G 1 (One.toOfNat1.{u2} G (MulOneClass.toOne.{u2} G _inst_2))) r))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.single_one_comm MonoidAlgebra.single_one_commₓ'. -/
theorem single_one_comm [CommSemiring k] [MulOneClass G] (r : k) (f : MonoidAlgebra k G) :
    single 1 r * f = f * single 1 r := by
  ext
  rw [single_one_mul_apply, mul_single_one_apply, mul_comm]
#align monoid_algebra.single_one_comm MonoidAlgebra.single_one_comm

#print MonoidAlgebra.singleOneRingHom /-
/-- `finsupp.single 1` as a `ring_hom` -/
@[simps]
def singleOneRingHom [Semiring k] [MulOneClass G] : k →+* MonoidAlgebra k G :=
  { Finsupp.singleAddHom 1 with
    map_one' := rfl
    map_mul' := fun x y => by rw [single_add_hom, single_mul_single, one_mul] }
#align monoid_algebra.single_one_ring_hom MonoidAlgebra.singleOneRingHom
-/

#print MonoidAlgebra.mapDomainRingHom /-
/-- If `f : G → H` is a multiplicative homomorphism between two monoids, then
`finsupp.map_domain f` is a ring homomorphism between their monoid algebras. -/
@[simps]
def mapDomainRingHom (k : Type _) {H F : Type _} [Semiring k] [Monoid G] [Monoid H]
    [MonoidHomClass F G H] (f : F) : MonoidAlgebra k G →+* MonoidAlgebra k H :=
  {
    (Finsupp.mapDomain.addMonoidHom f :
      MonoidAlgebra k G →+
        MonoidAlgebra k H) with
    map_one' := mapDomain_one f
    map_mul' := fun x y => mapDomain_mul f x y }
#align monoid_algebra.map_domain_ring_hom MonoidAlgebra.mapDomainRingHom
-/

/- warning: monoid_algebra.ring_hom_ext -> MonoidAlgebra.ringHom_ext is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] [_inst_3 : Semiring.{u3} R] {f : RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)} {g : RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)}, (forall (b : k), Eq.{succ u3} R (coeFn.{max (succ (max u1 u2)) (succ u3), max (succ (max u1 u2)) (succ u3)} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> R) (RingHom.hasCoeToFun.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (OfNat.ofNat.{u2} G 1 (OfNat.mk.{u2} G 1 (One.one.{u2} G (MulOneClass.toHasOne.{u2} G _inst_2)))) b)) (coeFn.{max (succ (max u1 u2)) (succ u3), max (succ (max u1 u2)) (succ u3)} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> R) (RingHom.hasCoeToFun.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) g (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (OfNat.ofNat.{u2} G 1 (OfNat.mk.{u2} G 1 (One.one.{u2} G (MulOneClass.toHasOne.{u2} G _inst_2)))) b))) -> (forall (a : G), Eq.{succ u3} R (coeFn.{max (succ (max u1 u2)) (succ u3), max (succ (max u1 u2)) (succ u3)} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> R) (RingHom.hasCoeToFun.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))) (coeFn.{max (succ (max u1 u2)) (succ u3), max (succ (max u1 u2)) (succ u3)} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => (MonoidAlgebra.{u1, u2} k G _inst_1) -> R) (RingHom.hasCoeToFun.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) g (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))))))) -> (Eq.{max (succ (max u1 u2)) (succ u3)} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f g)
but is expected to have type
  forall {k : Type.{u2}} {G : Type.{u3}} {R : Type.{u1}} [_inst_1 : Semiring.{u2} k] [_inst_2 : MulOneClass.{u3} G] [_inst_3 : Semiring.{u1} R] {f : RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)} {g : RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)}, (forall (b : k), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) (MonoidAlgebra.single.{u2, u3} k G _inst_1 (OfNat.ofNat.{u3} G 1 (One.toOfNat1.{u3} G (MulOneClass.toOne.{u3} G _inst_2))) b)) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : MonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (MulHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (NonUnitalNonAssocSemiring.toMul.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) f (MonoidAlgebra.single.{u2, u3} k G _inst_1 (OfNat.ofNat.{u3} G 1 (One.toOfNat1.{u3} G (MulOneClass.toOne.{u3} G _inst_2))) b)) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : MonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (MulHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (NonUnitalNonAssocSemiring.toMul.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) g (MonoidAlgebra.single.{u2, u3} k G _inst_1 (OfNat.ofNat.{u3} G 1 (One.toOfNat1.{u3} G (MulOneClass.toOne.{u3} G _inst_2))) b))) -> (forall (a : G), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) (MonoidAlgebra.single.{u2, u3} k G _inst_1 a (OfNat.ofNat.{u2} k 1 (One.toOfNat1.{u2} k (Semiring.toOne.{u2} k _inst_1))))) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : MonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (MulHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (NonUnitalNonAssocSemiring.toMul.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) f (MonoidAlgebra.single.{u2, u3} k G _inst_1 a (OfNat.ofNat.{u2} k 1 (One.toOfNat1.{u2} k (Semiring.toOne.{u2} k _inst_1))))) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : MonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : MonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (MulHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (NonUnitalNonAssocSemiring.toMul.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) g (MonoidAlgebra.single.{u2, u3} k G _inst_1 a (OfNat.ofNat.{u2} k 1 (One.toOfNat1.{u2} k (Semiring.toOne.{u2} k _inst_1)))))) -> (Eq.{max (max (succ u2) (succ u3)) (succ u1)} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) f g)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.ring_hom_ext MonoidAlgebra.ringHom_extₓ'. -/
/-- If two ring homomorphisms from `monoid_algebra k G` are equal on all `single a 1`
and `single 1 b`, then they are equal. -/
theorem ringHom_ext {R} [Semiring k] [MulOneClass G] [Semiring R] {f g : MonoidAlgebra k G →+* R}
    (h₁ : ∀ b, f (single 1 b) = g (single 1 b)) (h_of : ∀ a, f (single a 1) = g (single a 1)) :
    f = g :=
  RingHom.coe_addMonoidHom_injective <|
    addHom_ext fun a b => by
      rw [← one_mul a, ← mul_one b, ← single_mul_single, f.coe_add_monoid_hom, g.coe_add_monoid_hom,
        f.map_mul, g.map_mul, h₁, h_of]
#align monoid_algebra.ring_hom_ext MonoidAlgebra.ringHom_ext

/- warning: monoid_algebra.ring_hom_ext' -> MonoidAlgebra.ringHom_ext' is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : MulOneClass.{u2} G] [_inst_3 : Semiring.{u3} R] {f : RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)} {g : RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)}, (Eq.{max (succ u1) (succ u3)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (RingHom.comp.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3) f (MonoidAlgebra.singleOneRingHom.{u1, u2} k G _inst_1 _inst_2)) (RingHom.comp.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G _inst_1) R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3) g (MonoidAlgebra.singleOneRingHom.{u1, u2} k G _inst_1 _inst_2))) -> (Eq.{max (succ u3) (succ u2)} (MonoidHom.{u2, u3} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (MonoidHom.comp.{u2, max u1 u2, u3} G (MonoidAlgebra.{u1, u2} k G _inst_1) R _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) ((fun (a : Sort.{max (succ (max u1 u2)) (succ u3)}) (b : Sort.{max (succ u3) (succ (max u1 u2))}) [self : HasLiftT.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} a b] => self.0) (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (HasLiftT.mk.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (CoeTCₓ.coe.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (MonoidHom.hasCoeT.{max u1 u2, u3, max (max u1 u2) u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u1 u2) u3, max u1 u2, u3} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (MonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_2)) (MonoidHom.comp.{u2, max u1 u2, u3} G (MonoidAlgebra.{u1, u2} k G _inst_1) R _inst_2 (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) ((fun (a : Sort.{max (succ (max u1 u2)) (succ u3)}) (b : Sort.{max (succ u3) (succ (max u1 u2))}) [self : HasLiftT.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} a b] => self.0) (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (HasLiftT.mk.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (CoeTCₓ.coe.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (MonoidHom.hasCoeT.{max u1 u2, u3, max (max u1 u2) u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u1 u2) u3, max u1 u2, u3} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) g) (MonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_2))) -> (Eq.{max (succ (max u1 u2)) (succ u3)} (RingHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f g)
but is expected to have type
  forall {k : Type.{u2}} {G : Type.{u3}} {R : Type.{u1}} [_inst_1 : Semiring.{u2} k] [_inst_2 : MulOneClass.{u3} G] [_inst_3 : Semiring.{u1} R] {f : RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)} {g : RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)}, (Eq.{max (succ u2) (succ u1)} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHom.comp.{u2, max u2 u3, u1} k (MonoidAlgebra.{u2, u3} k G _inst_1) R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3) f (MonoidAlgebra.singleOneRingHom.{u2, u3} k G _inst_1 _inst_2)) (RingHom.comp.{u2, max u2 u3, u1} k (MonoidAlgebra.{u2, u3} k G _inst_1) R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3) g (MonoidAlgebra.singleOneRingHom.{u2, u3} k G _inst_1 _inst_2))) -> (Eq.{max (succ u3) (succ u1)} (MonoidHom.{u3, u1} G R _inst_2 (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (MonoidHom.comp.{u3, max u2 u3, u1} G (MonoidAlgebra.{u2, u3} k G _inst_1) R _inst_2 (MulZeroOneClass.toMulOneClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (MonoidHomClass.toMonoidHom.{max u2 u3, u1, max (max u2 u3) u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MulZeroOneClass.toMulOneClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (MonoidAlgebra.of.{u2, u3} k G _inst_1 _inst_2)) (MonoidHom.comp.{u3, max u2 u3, u1} G (MonoidAlgebra.{u2, u3} k G _inst_1) R _inst_2 (MulZeroOneClass.toMulOneClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (MonoidHomClass.toMonoidHom.{max u2 u3, u1, max (max u2 u3) u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MulZeroOneClass.toMulOneClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2))) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) g) (MonoidAlgebra.of.{u2, u3} k G _inst_1 _inst_2))) -> (Eq.{max (max (succ u2) (succ u3)) (succ u1)} (RingHom.{max u3 u2, u1} (MonoidAlgebra.{u2, u3} k G _inst_1) R (MonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 _inst_2) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) f g)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.ring_hom_ext' MonoidAlgebra.ringHom_ext'ₓ'. -/
/-- If two ring homomorphisms from `monoid_algebra k G` are equal on all `single a 1`
and `single 1 b`, then they are equal.

See note [partially-applied ext lemmas]. -/
@[ext]
theorem ringHom_ext' {R} [Semiring k] [MulOneClass G] [Semiring R] {f g : MonoidAlgebra k G →+* R}
    (h₁ : f.comp singleOneRingHom = g.comp singleOneRingHom)
    (h_of :
      (f : MonoidAlgebra k G →* R).comp (of k G) = (g : MonoidAlgebra k G →* R).comp (of k G)) :
    f = g :=
  ringHom_ext (RingHom.congr_fun h₁) (MonoidHom.congr_fun h_of)
#align monoid_algebra.ring_hom_ext' MonoidAlgebra.ringHom_ext'

/-- The instance `algebra k (monoid_algebra A G)` whenever we have `algebra k A`.

In particular this provides the instance `algebra k (monoid_algebra k G)`.
-/
instance {A : Type _} [CommSemiring k] [Semiring A] [Algebra k A] [Monoid G] :
    Algebra k (MonoidAlgebra A G) :=
  {
    singleOneRingHom.comp
      (algebraMap k
        A) with
    smul_def' := fun r a => by
      ext
      simp [single_one_mul_apply, Algebra.smul_def, Pi.smul_apply]
    commutes' := fun r f => by
      ext
      simp [single_one_mul_apply, mul_single_one_apply, Algebra.commutes] }

#print MonoidAlgebra.singleOneAlgHom /-
/-- `finsupp.single 1` as a `alg_hom` -/
@[simps]
def singleOneAlgHom {A : Type _} [CommSemiring k] [Semiring A] [Algebra k A] [Monoid G] :
    A →ₐ[k] MonoidAlgebra A G :=
  { singleOneRingHom with
    commutes' := fun r => by
      ext
      simp
      rfl }
#align monoid_algebra.single_one_alg_hom MonoidAlgebra.singleOneAlgHom
-/

/- warning: monoid_algebra.coe_algebra_map -> MonoidAlgebra.coe_algebraMap is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {A : Type.{u3}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Semiring.{u3} A] [_inst_3 : Algebra.{u1, u3} k A _inst_1 _inst_2] [_inst_4 : Monoid.{u2} G], Eq.{max (succ u1) (succ (max u3 u2))} (k -> (MonoidAlgebra.{u3, u2} A G _inst_2)) (coeFn.{max (succ u1) (succ (max u3 u2)), max (succ u1) (succ (max u3 u2))} (RingHom.{u1, max u3 u2} k (MonoidAlgebra.{u3, u2} A G _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (MonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4))) (fun (_x : RingHom.{u1, max u3 u2} k (MonoidAlgebra.{u3, u2} A G _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (MonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4))) => k -> (MonoidAlgebra.{u3, u2} A G _inst_2)) (RingHom.hasCoeToFun.{u1, max u3 u2} k (MonoidAlgebra.{u3, u2} A G _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (MonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4))) (algebraMap.{u1, max u3 u2} k (MonoidAlgebra.{u3, u2} A G _inst_2) _inst_1 (MonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4) (MonoidAlgebra.algebra.{u1, u2, u3} k G A _inst_1 _inst_2 _inst_3 _inst_4))) (Function.comp.{succ u1, succ u3, max (succ u2) (succ u3)} k A (Finsupp.{u2, u3} G A (MulZeroClass.toHasZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_2))))) (Finsupp.single.{u2, u3} G A (MulZeroClass.toHasZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_2)))) (OfNat.ofNat.{u2} G 1 (OfNat.mk.{u2} G 1 (One.one.{u2} G (MulOneClass.toHasOne.{u2} G (Monoid.toMulOneClass.{u2} G _inst_4)))))) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} k A (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_2)) (fun (_x : RingHom.{u1, u3} k A (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_2)) => k -> A) (RingHom.hasCoeToFun.{u1, u3} k A (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_2)) (algebraMap.{u1, u3} k A _inst_1 _inst_2 _inst_3)))
but is expected to have type
  forall {k : Type.{u2}} {G : Type.{u3}} {A : Type.{u1}} [_inst_1 : CommSemiring.{u2} k] [_inst_2 : Semiring.{u1} A] [_inst_3 : Algebra.{u2, u1} k A _inst_1 _inst_2] [_inst_4 : Monoid.{u3} G], Eq.{max (max (succ u2) (succ u3)) (succ u1)} (forall (ᾰ : k), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u1, u3} A G _inst_2) ᾰ) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), succ u2, max (succ u3) (succ u1)} (RingHom.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4))) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u1, u3} A G _inst_2) _x) (MulHomClass.toFunLike.{max (max u2 u3) u1, u2, max u3 u1} (RingHom.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4))) k (MonoidAlgebra.{u1, u3} A G _inst_2) (NonUnitalNonAssocSemiring.toMul.{u2} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4)))) (NonUnitalRingHomClass.toMulHomClass.{max (max u2 u3) u1, u2, max u3 u1} (RingHom.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4))) k (MonoidAlgebra.{u1, u3} A G _inst_2) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4))) (RingHomClass.toNonUnitalRingHomClass.{max (max u2 u3) u1, u2, max u3 u1} (RingHom.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4))) k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4)) (RingHom.instRingHomClassRingHom.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4)))))) (algebraMap.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) _inst_1 (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4) (MonoidAlgebra.algebra.{u2, u3, u1} k G A _inst_1 _inst_2 _inst_3 _inst_4))) (Function.comp.{succ u2, succ u1, max (succ u3) (succ u1)} k A (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.single.{u1, u3} A G _inst_2 (OfNat.ofNat.{u3} G 1 (One.toOfNat1.{u3} G (Monoid.toOne.{u3} G _inst_4)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2)) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => A) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2)) k A (NonUnitalNonAssocSemiring.toMul.{u2} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u1} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (Semiring.toNonAssocSemiring.{u1} A _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2)) k A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (Semiring.toNonAssocSemiring.{u1} A _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2)) k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2) (RingHom.instRingHomClassRingHom.{u2, u1} k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2))))) (algebraMap.{u2, u1} k A _inst_1 _inst_2 _inst_3)))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.coe_algebra_map MonoidAlgebra.coe_algebraMapₓ'. -/
@[simp]
theorem coe_algebraMap {A : Type _} [CommSemiring k] [Semiring A] [Algebra k A] [Monoid G] :
    ⇑(algebraMap k (MonoidAlgebra A G)) = single 1 ∘ algebraMap k A :=
  rfl
#align monoid_algebra.coe_algebra_map MonoidAlgebra.coe_algebraMap

/- warning: monoid_algebra.single_eq_algebra_map_mul_of -> MonoidAlgebra.single_eq_algebraMap_mul_of is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Monoid.{u2} G] (a : G) (b : k), Eq.{max (succ u2) (succ u1)} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) a b) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (instHMul.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (MonoidAlgebra.mul.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)))) (coeFn.{max (succ u1) (succ (max u1 u2)), max (succ u1) (succ (max u1 u2))} (RingHom.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) (fun (_x : RingHom.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) => k -> (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1))) (RingHom.hasCoeToFun.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) (algebraMap.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2)) b) (coeFn.{max (succ (max u1 u2)) (succ u2), max (succ u2) (succ (max u1 u2))} (MonoidHom.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) (fun (_x : MonoidHom.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) => G -> (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1))) (MonoidHom.hasCoeToFun.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) (MonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)) a))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Monoid.{u2} G] (a : G) (b : k), Eq.{max (succ u1) (succ u2)} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.single.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) a b) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) b) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) a) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) b) (instHMul.{max u1 u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) b) (MonoidAlgebra.mul.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)))) (FunLike.coe.{max (succ u1) (succ u2), succ u1, max (succ u1) (succ u2)} (RingHom.{u1, max u2 u1} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _x) (MulHomClass.toFunLike.{max u1 u2, u1, max u1 u2} (RingHom.{u1, max u2 u1} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u2, u1, max u1 u2} (RingHom.{u1, max u2 u1} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max u1 u2, u1, max u1 u2} (RingHom.{u1, max u2 u1} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)) (RingHom.instRingHomClassRingHom.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))))) (algebraMap.{u1, max u2 u1} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2)) b) (FunLike.coe.{max (succ u1) (succ u2), succ u2, max (succ u1) (succ u2)} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _x) (MulHomClass.toFunLike.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)) (MulOneClass.toMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) (MonoidHomClass.toMulHomClass.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MonoidHom.monoidHomClass.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))))) (MonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)) a))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.single_eq_algebra_map_mul_of MonoidAlgebra.single_eq_algebraMap_mul_ofₓ'. -/
theorem single_eq_algebraMap_mul_of [CommSemiring k] [Monoid G] (a : G) (b : k) :
    single a b = algebraMap k (MonoidAlgebra k G) b * of k G a := by simp
#align monoid_algebra.single_eq_algebra_map_mul_of MonoidAlgebra.single_eq_algebraMap_mul_of

/- warning: monoid_algebra.single_algebra_map_eq_algebra_map_mul_of -> MonoidAlgebra.single_algebraMap_eq_algebraMap_mul_of is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {A : Type.{u3}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Semiring.{u3} A] [_inst_3 : Algebra.{u1, u3} k A _inst_1 _inst_2] [_inst_4 : Monoid.{u2} G] (a : G) (b : k), Eq.{max (succ u2) (succ u3)} (Finsupp.{u2, u3} G A (MulZeroClass.toHasZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_2))))) (Finsupp.single.{u2, u3} G A (MulZeroClass.toHasZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_2)))) a (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} k A (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_2)) (fun (_x : RingHom.{u1, u3} k A (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_2)) => k -> A) (RingHom.hasCoeToFun.{u1, u3} k A (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{u3} A _inst_2)) (algebraMap.{u1, u3} k A _inst_1 _inst_2 _inst_3) b)) (HMul.hMul.{max u2 u3, max u2 u3, max u2 u3} (Finsupp.{u2, u3} G A (MulZeroClass.toHasZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_2))))) (Finsupp.{u2, u3} G A (MulZeroClass.toHasZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_2))))) (Finsupp.{u2, u3} G A (MulZeroClass.toHasZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_2))))) (instHMul.{max u2 u3} (Finsupp.{u2, u3} G A (MulZeroClass.toHasZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_2))))) (MonoidAlgebra.mul.{u3, u2} A G _inst_2 (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_4)))) (coeFn.{max (succ u1) (succ (max u3 u2)), max (succ u1) (succ (max u3 u2))} (RingHom.{u1, max u3 u2} k (MonoidAlgebra.{u3, u2} A G _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (MonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4))) (fun (_x : RingHom.{u1, max u3 u2} k (MonoidAlgebra.{u3, u2} A G _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (MonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4))) => k -> (MonoidAlgebra.{u3, u2} A G _inst_2)) (RingHom.hasCoeToFun.{u1, max u3 u2} k (MonoidAlgebra.{u3, u2} A G _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (MonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4))) (algebraMap.{u1, max u3 u2} k (MonoidAlgebra.{u3, u2} A G _inst_2) _inst_1 (MonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4) (MonoidAlgebra.algebra.{u1, u2, u3} k G A _inst_1 _inst_2 _inst_3 _inst_4)) b) (coeFn.{max (succ (max u3 u2)) (succ u2), max (succ u2) (succ (max u3 u2))} (MonoidHom.{u2, max u3 u2} G (MonoidAlgebra.{u3, u2} A G _inst_2) (Monoid.toMulOneClass.{u2} G _inst_4) (MulZeroOneClass.toMulOneClass.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (NonAssocSemiring.toMulZeroOneClass.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (MonoidAlgebra.nonAssocSemiring.{u3, u2} A G _inst_2 (Monoid.toMulOneClass.{u2} G _inst_4))))) (fun (_x : MonoidHom.{u2, max u3 u2} G (MonoidAlgebra.{u3, u2} A G _inst_2) (Monoid.toMulOneClass.{u2} G _inst_4) (MulZeroOneClass.toMulOneClass.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (NonAssocSemiring.toMulZeroOneClass.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (MonoidAlgebra.nonAssocSemiring.{u3, u2} A G _inst_2 (Monoid.toMulOneClass.{u2} G _inst_4))))) => G -> (MonoidAlgebra.{u3, u2} A G _inst_2)) (MonoidHom.hasCoeToFun.{u2, max u3 u2} G (MonoidAlgebra.{u3, u2} A G _inst_2) (Monoid.toMulOneClass.{u2} G _inst_4) (MulZeroOneClass.toMulOneClass.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (NonAssocSemiring.toMulZeroOneClass.{max u3 u2} (MonoidAlgebra.{u3, u2} A G _inst_2) (MonoidAlgebra.nonAssocSemiring.{u3, u2} A G _inst_2 (Monoid.toMulOneClass.{u2} G _inst_4))))) (MonoidAlgebra.of.{u3, u2} A G _inst_2 (Monoid.toMulOneClass.{u2} G _inst_4)) a))
but is expected to have type
  forall {k : Type.{u2}} {G : Type.{u3}} {A : Type.{u1}} [_inst_1 : CommSemiring.{u2} k] [_inst_2 : Semiring.{u1} A] [_inst_3 : Algebra.{u2, u1} k A _inst_1 _inst_2] [_inst_4 : Monoid.{u3} G] (a : G) (b : k), Eq.{max (succ u3) (succ u1)} (MonoidAlgebra.{u1, u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => A) b) G _inst_2) (MonoidAlgebra.single.{u1, u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => A) b) G _inst_2 a (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2)) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => A) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2)) k A (NonUnitalNonAssocSemiring.toMul.{u2} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u1} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (Semiring.toNonAssocSemiring.{u1} A _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2)) k A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} A (Semiring.toNonAssocSemiring.{u1} A _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2)) k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2) (RingHom.instRingHomClassRingHom.{u2, u1} k A (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{u1} A _inst_2))))) (algebraMap.{u2, u1} k A _inst_1 _inst_2 _inst_3) b)) (HMul.hMul.{max u3 u1, max u3 u1, max u3 u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u1, u3} A G _inst_2) b) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u3} A G _inst_2) a) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u1, u3} A G _inst_2) b) (instHMul.{max u3 u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u1, u3} A G _inst_2) b) (MonoidAlgebra.mul.{u1, u3} A G _inst_2 (MulOneClass.toMul.{u3} G (Monoid.toMulOneClass.{u3} G _inst_4)))) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), succ u2, max (succ u3) (succ u1)} (RingHom.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4))) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u1, u3} A G _inst_2) _x) (MulHomClass.toFunLike.{max (max u2 u3) u1, u2, max u3 u1} (RingHom.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4))) k (MonoidAlgebra.{u1, u3} A G _inst_2) (NonUnitalNonAssocSemiring.toMul.{u2} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4)))) (NonUnitalRingHomClass.toMulHomClass.{max (max u2 u3) u1, u2, max u3 u1} (RingHom.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4))) k (MonoidAlgebra.{u1, u3} A G _inst_2) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4))) (RingHomClass.toNonUnitalRingHomClass.{max (max u2 u3) u1, u2, max u3 u1} (RingHom.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4))) k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4)) (RingHom.instRingHomClassRingHom.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4)))))) (algebraMap.{u2, max u3 u1} k (MonoidAlgebra.{u1, u3} A G _inst_2) _inst_1 (MonoidAlgebra.semiring.{u1, u3} A G _inst_2 _inst_4) (MonoidAlgebra.algebra.{u2, u3, u1} k G A _inst_1 _inst_2 _inst_3 _inst_4)) b) (FunLike.coe.{max (succ u3) (succ u1), succ u3, max (succ u3) (succ u1)} (MonoidHom.{u3, max u3 u1} G (MonoidAlgebra.{u1, u3} A G _inst_2) (Monoid.toMulOneClass.{u3} G _inst_4) (MulZeroOneClass.toMulOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (NonAssocSemiring.toMulZeroOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.nonAssocSemiring.{u1, u3} A G _inst_2 (Monoid.toMulOneClass.{u3} G _inst_4))))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u3} A G _inst_2) _x) (MulHomClass.toFunLike.{max u3 u1, u3, max u3 u1} (MonoidHom.{u3, max u3 u1} G (MonoidAlgebra.{u1, u3} A G _inst_2) (Monoid.toMulOneClass.{u3} G _inst_4) (MulZeroOneClass.toMulOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (NonAssocSemiring.toMulZeroOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.nonAssocSemiring.{u1, u3} A G _inst_2 (Monoid.toMulOneClass.{u3} G _inst_4))))) G (MonoidAlgebra.{u1, u3} A G _inst_2) (MulOneClass.toMul.{u3} G (Monoid.toMulOneClass.{u3} G _inst_4)) (MulOneClass.toMul.{max u3 u1} (MonoidAlgebra.{u1, u3} A G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (NonAssocSemiring.toMulZeroOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.nonAssocSemiring.{u1, u3} A G _inst_2 (Monoid.toMulOneClass.{u3} G _inst_4))))) (MonoidHomClass.toMulHomClass.{max u3 u1, u3, max u3 u1} (MonoidHom.{u3, max u3 u1} G (MonoidAlgebra.{u1, u3} A G _inst_2) (Monoid.toMulOneClass.{u3} G _inst_4) (MulZeroOneClass.toMulOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (NonAssocSemiring.toMulZeroOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.nonAssocSemiring.{u1, u3} A G _inst_2 (Monoid.toMulOneClass.{u3} G _inst_4))))) G (MonoidAlgebra.{u1, u3} A G _inst_2) (Monoid.toMulOneClass.{u3} G _inst_4) (MulZeroOneClass.toMulOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (NonAssocSemiring.toMulZeroOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.nonAssocSemiring.{u1, u3} A G _inst_2 (Monoid.toMulOneClass.{u3} G _inst_4)))) (MonoidHom.monoidHomClass.{u3, max u3 u1} G (MonoidAlgebra.{u1, u3} A G _inst_2) (Monoid.toMulOneClass.{u3} G _inst_4) (MulZeroOneClass.toMulOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (NonAssocSemiring.toMulZeroOneClass.{max u1 u3} (MonoidAlgebra.{u1, u3} A G _inst_2) (MonoidAlgebra.nonAssocSemiring.{u1, u3} A G _inst_2 (Monoid.toMulOneClass.{u3} G _inst_4))))))) (MonoidAlgebra.of.{u1, u3} A G _inst_2 (Monoid.toMulOneClass.{u3} G _inst_4)) a))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.single_algebra_map_eq_algebra_map_mul_of MonoidAlgebra.single_algebraMap_eq_algebraMap_mul_ofₓ'. -/
theorem single_algebraMap_eq_algebraMap_mul_of {A : Type _} [CommSemiring k] [Semiring A]
    [Algebra k A] [Monoid G] (a : G) (b : k) :
    single a (algebraMap k A b) = algebraMap k (MonoidAlgebra A G) b * of A G a := by simp
#align monoid_algebra.single_algebra_map_eq_algebra_map_mul_of MonoidAlgebra.single_algebraMap_eq_algebraMap_mul_of

/- warning: monoid_algebra.induction_on -> MonoidAlgebra.induction_on is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Monoid.{u2} G] {p : (MonoidAlgebra.{u1, u2} k G _inst_1) -> Prop} (f : MonoidAlgebra.{u1, u2} k G _inst_1), (forall (g : G), p (coeFn.{max (succ (max u1 u2)) (succ u2), max (succ u2) (succ (max u1 u2))} (MonoidHom.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2))))) (fun (_x : MonoidHom.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2))))) => G -> (MonoidAlgebra.{u1, u2} k G _inst_1)) (MonoidHom.hasCoeToFun.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2))))) (MonoidAlgebra.of.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2)) g)) -> (forall (f : MonoidAlgebra.{u1, u2} k G _inst_1) (g : MonoidAlgebra.{u1, u2} k G _inst_1), (p f) -> (p g) -> (p (HAdd.hAdd.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (Finsupp.add.{u2, u1} G k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))) f g))) -> (forall (r : k) (f : MonoidAlgebra.{u1, u2} k G _inst_1), (p f) -> (p (SMul.smul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toHasSmul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (MonoidAlgebra.smulZeroClass.{u1, u2, u1} k G k _inst_1 (SMulWithZero.toSmulZeroClass.{u1, u1} k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))) r f))) -> (p f)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Monoid.{u2} G] {p : (MonoidAlgebra.{u1, u2} k G _inst_1) -> Prop} (f : MonoidAlgebra.{u1, u2} k G _inst_1), (forall (g : G), p (FunLike.coe.{max (succ u1) (succ u2), succ u2, max (succ u1) (succ u2)} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2))))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G _inst_1) _x) (MulHomClass.toFunLike.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2))))) G (MonoidAlgebra.{u1, u2} k G _inst_1) (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)) (MulOneClass.toMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2))))) (MonoidHomClass.toMulHomClass.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2))))) G (MonoidAlgebra.{u1, u2} k G _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2)))) (MonoidHom.monoidHomClass.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2))))))) (MonoidAlgebra.of.{u1, u2} k G _inst_1 (Monoid.toMulOneClass.{u2} G _inst_2)) g)) -> (forall (f : MonoidAlgebra.{u1, u2} k G _inst_1) (g : MonoidAlgebra.{u1, u2} k G _inst_1), (p f) -> (p g) -> (p (HAdd.hAdd.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (Distrib.toAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)))))) f g))) -> (forall (r : k) (f : MonoidAlgebra.{u1, u2} k G _inst_1), (p f) -> (p (HSMul.hSMul.{u1, max u1 u2, max u1 u2} k (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHSMul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toSMul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidWithZero.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.semiring.{u1, u2} k G _inst_1 _inst_2))) (MonoidAlgebra.smulZeroClass.{u1, u2, u1} k G k _inst_1 (SMulWithZero.toSMulZeroClass.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))))) r f))) -> (p f)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.induction_on MonoidAlgebra.induction_onₓ'. -/
theorem induction_on [Semiring k] [Monoid G] {p : MonoidAlgebra k G → Prop} (f : MonoidAlgebra k G)
    (hM : ∀ g, p (of k G g)) (hadd : ∀ f g : MonoidAlgebra k G, p f → p g → p (f + g))
    (hsmul : ∀ (r : k) (f), p f → p (r • f)) : p f :=
  by
  refine' Finsupp.induction_linear f _ (fun f g hf hg => hadd f g hf hg) fun g r => _
  · simpa using hsmul 0 (of k G 1) (hM 1)
  · convert hsmul r (of k G g) (hM g)
    simp only [mul_one, smul_single', of_apply]
#align monoid_algebra.induction_on MonoidAlgebra.induction_on

end Algebra

section lift

variable {k G} [CommSemiring k] [Monoid G]

variable {A : Type u₃} [Semiring A] [Algebra k A] {B : Type _} [Semiring B] [Algebra k B]

/- warning: monoid_algebra.lift_nc_alg_hom -> MonoidAlgebra.liftNCAlgHom is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Monoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] {B : Type.{u4}} [_inst_5 : Semiring.{u4} B] [_inst_6 : Algebra.{u1, u4} k B _inst_1 _inst_5] (f : AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) (g : MonoidHom.{u2, u4} G B (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))), (forall (x : A) (y : G), Commute.{u4} B (Distrib.toHasMul.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (coeFn.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) (fun (_x : AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) => A -> B) ([anonymous].{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) f x) (coeFn.{max (succ u4) (succ u2), max (succ u2) (succ u4)} (MonoidHom.{u2, u4} G B (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (fun (_x : MonoidHom.{u2, u4} G B (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) => G -> B) (MonoidHom.hasCoeToFun.{u2, u4} G B (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) g y)) -> (AlgHom.{u1, max u3 u2, u4} k (MonoidAlgebra.{u3, u2} A G _inst_3) B _inst_1 (MonoidAlgebra.semiring.{u3, u2} A G _inst_3 _inst_2) _inst_5 (MonoidAlgebra.algebra.{u1, u2, u3} k G A _inst_1 _inst_3 _inst_4 _inst_2) _inst_6)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Monoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] {B : Type.{u4}} [_inst_5 : Semiring.{u4} B] [_inst_6 : Algebra.{u1, u4} k B _inst_1 _inst_5] (f : AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) (g : MonoidHom.{u2, u4} G B (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))), (forall (x : A) (y : G), Commute.{u4} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) x) (NonUnitalNonAssocSemiring.toMul.{u4} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) x) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) x) (Semiring.toNonAssocSemiring.{u4} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) x) _inst_5))) (FunLike.coe.{max (succ u3) (succ u4), succ u3, succ u4} (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) _x) (SMulHomClass.toFunLike.{max u3 u4, u1, u3, u4} (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) k A B (SMulZeroClass.toSMul.{u1, u3} k A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribSMul.toSMulZeroClass.{u1, u3} k A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribMulAction.toDistribSMul.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4))))) (SMulZeroClass.toSMul.{u1, u4} k B (AddMonoid.toZero.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))))) (DistribSMul.toSMulZeroClass.{u1, u4} k B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))))) (DistribMulAction.toDistribSMul.{u1, u4} k B (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (Module.toDistribMulAction.{u1, u4} k B (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))) (Algebra.toModule.{u1, u4} k B _inst_1 _inst_5 _inst_6))))) (DistribMulActionHomClass.toSMulHomClass.{max u3 u4, u1, u3, u4} (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) k A B (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4)) (Module.toDistribMulAction.{u1, u4} k B (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))) (Algebra.toModule.{u1, u4} k B _inst_1 _inst_5 _inst_6)) (NonUnitalAlgHomClass.toDistribMulActionHomClass.{max u3 u4, u1, u3, u4} (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) k A B (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4)) (Module.toDistribMulAction.{u1, u4} k B (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))) (Algebra.toModule.{u1, u4} k B _inst_1 _inst_5 _inst_6)) (AlgHom.instNonUnitalAlgHomClassToMonoidToMonoidWithZeroToSemiringToNonUnitalNonAssocSemiringToNonAssocSemiringToNonUnitalNonAssocSemiringToNonAssocSemiringToDistribMulActionToAddCommMonoidToModuleToDistribMulActionToAddCommMonoidToModule.{u1, u3, u4, max u3 u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6 (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) (AlgHom.algHomClass.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6))))) f x) (FunLike.coe.{max (succ u2) (succ u4), succ u2, succ u4} (MonoidHom.{u2, u4} G B (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => B) _x) (MulHomClass.toFunLike.{max u2 u4, u2, u4} (MonoidHom.{u2, u4} G B (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) G B (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)) (MulOneClass.toMul.{u4} B (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (MonoidHomClass.toMulHomClass.{max u2 u4, u2, u4} (MonoidHom.{u2, u4} G B (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) G B (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))) (MonoidHom.monoidHomClass.{u2, u4} G B (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))))) g y)) -> (AlgHom.{u1, max u2 u3, u4} k (MonoidAlgebra.{u3, u2} A G _inst_3) B _inst_1 (MonoidAlgebra.semiring.{u3, u2} A G _inst_3 _inst_2) _inst_5 (MonoidAlgebra.algebra.{u1, u2, u3} k G A _inst_1 _inst_3 _inst_4 _inst_2) _inst_6)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.lift_nc_alg_hom MonoidAlgebra.liftNCAlgHomₓ'. -/
/-- `lift_nc_ring_hom` as a `alg_hom`, for when `f` is an `alg_hom` -/
def liftNCAlgHom (f : A →ₐ[k] B) (g : G →* B) (h_comm : ∀ x y, Commute (f x) (g y)) :
    MonoidAlgebra A G →ₐ[k] B :=
  {
    liftNCRingHom (f : A →+* B) g
      h_comm with
    toFun := liftNCRingHom (f : A →+* B) g h_comm
    commutes' := by simp [lift_nc_ring_hom] }
#align monoid_algebra.lift_nc_alg_hom MonoidAlgebra.liftNCAlgHom

#print MonoidAlgebra.algHom_ext /-
/-- A `k`-algebra homomorphism from `monoid_algebra k G` is uniquely defined by its
values on the functions `single a 1`. -/
theorem algHom_ext ⦃φ₁ φ₂ : MonoidAlgebra k G →ₐ[k] A⦄
    (h : ∀ x, φ₁ (single x 1) = φ₂ (single x 1)) : φ₁ = φ₂ :=
  AlgHom.toLinearMap_injective <| Finsupp.lhom_ext' fun a => LinearMap.ext_ring (h a)
#align monoid_algebra.alg_hom_ext MonoidAlgebra.algHom_ext
-/

/- warning: monoid_algebra.alg_hom_ext' -> MonoidAlgebra.algHom_ext' is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Monoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] {{φ₁ : AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4}} {{φ₂ : AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4}}, (Eq.{max (succ u3) (succ u2)} (MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (MonoidHom.comp.{u2, max u1 u2, u3} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) ((fun (a : Sort.{max (succ (max u1 u2)) (succ u3)}) (b : Sort.{max (succ u3) (succ (max u1 u2))}) [self : HasLiftT.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} a b] => self.0) (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (HasLiftT.mk.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (CoeTCₓ.coe.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (MonoidHom.hasCoeT.{max u1 u2, u3, max (max u1 u2) u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u1 u2) u3, max u1 u2, u3} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (AlgHomClass.toRingHomClass.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4 (AlgHom.algHomClass.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4)))))) φ₁) (MonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))) (MonoidHom.comp.{u2, max u1 u2, u3} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) ((fun (a : Sort.{max (succ (max u1 u2)) (succ u3)}) (b : Sort.{max (succ u3) (succ (max u1 u2))}) [self : HasLiftT.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} a b] => self.0) (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (HasLiftT.mk.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (CoeTCₓ.coe.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ (max u1 u2))} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (MonoidHom.hasCoeT.{max u1 u2, u3, max (max u1 u2) u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u1 u2) u3, max u1 u2, u3} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (AlgHomClass.toRingHomClass.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4 (AlgHom.algHomClass.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4)))))) φ₂) (MonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) -> (Eq.{max (succ (max u1 u2)) (succ u3)} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) φ₁ φ₂)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Monoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] {{φ₁ : AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4}} {{φ₂ : AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4}}, (Eq.{max (succ u2) (succ u3)} (MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (MonoidHom.comp.{u2, max u1 u2, u3} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (MonoidHomClass.toMonoidHom.{max u1 u2, u3, max (max u1 u2) u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u1 u2) u3, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (AlgHomClass.toRingHomClass.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4 (AlgHom.algHomClass.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4))) φ₁) (MonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))) (MonoidHom.comp.{u2, max u1 u2, u3} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (MonoidHomClass.toMonoidHom.{max u1 u2, u3, max (max u1 u2) u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u1 u2) u3, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (AlgHomClass.toRingHomClass.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4 (AlgHom.algHomClass.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4))) φ₂) (MonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) -> (Eq.{max (max (succ u1) (succ u2)) (succ u3)} (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) φ₁ φ₂)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.alg_hom_ext' MonoidAlgebra.algHom_ext'ₓ'. -/
/-- See note [partially-applied ext lemmas]. -/
@[ext]
theorem algHom_ext' ⦃φ₁ φ₂ : MonoidAlgebra k G →ₐ[k] A⦄
    (h :
      (φ₁ : MonoidAlgebra k G →* A).comp (of k G) = (φ₂ : MonoidAlgebra k G →* A).comp (of k G)) :
    φ₁ = φ₂ :=
  algHom_ext <| MonoidHom.congr_fun h
#align monoid_algebra.alg_hom_ext' MonoidAlgebra.algHom_ext'

variable (k G A)

#print MonoidAlgebra.lift /-
/-- Any monoid homomorphism `G →* A` can be lifted to an algebra homomorphism
`monoid_algebra k G →ₐ[k] A`. -/
def lift : (G →* A) ≃ (MonoidAlgebra k G →ₐ[k] A)
    where
  invFun f := (f : MonoidAlgebra k G →* A).comp (of k G)
  toFun F := liftNCAlgHom (Algebra.ofId k A) F fun _ _ => Algebra.commutes _ _
  left_inv f := by
    ext
    simp [lift_nc_alg_hom, lift_nc_ring_hom]
  right_inv F := by
    ext
    simp [lift_nc_alg_hom, lift_nc_ring_hom]
#align monoid_algebra.lift MonoidAlgebra.lift
-/

variable {k G A}

#print MonoidAlgebra.lift_apply' /-
theorem lift_apply' (F : G →* A) (f : MonoidAlgebra k G) :
    lift k G A F f = f.Sum fun a b => algebraMap k A b * F a :=
  rfl
#align monoid_algebra.lift_apply' MonoidAlgebra.lift_apply'
-/

#print MonoidAlgebra.lift_apply /-
theorem lift_apply (F : G →* A) (f : MonoidAlgebra k G) :
    lift k G A F f = f.Sum fun a b => b • F a := by simp only [lift_apply', Algebra.smul_def]
#align monoid_algebra.lift_apply MonoidAlgebra.lift_apply
-/

#print MonoidAlgebra.lift_def /-
theorem lift_def (F : G →* A) : ⇑(lift k G A F) = liftNC ((algebraMap k A : k →+* A) : k →+ A) F :=
  rfl
#align monoid_algebra.lift_def MonoidAlgebra.lift_def
-/

/- warning: monoid_algebra.lift_symm_apply -> MonoidAlgebra.lift_symm_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Monoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] (F : AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (x : G), Eq.{succ u3} A (coeFn.{max (succ u3) (succ u2), max (succ u2) (succ u3)} (MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (fun (_x : MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) => G -> A) (MonoidHom.hasCoeToFun.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (coeFn.{max 1 (max (max (succ (max u1 u2)) (succ u3)) (succ u3) (succ u2)) (max (succ u3) (succ u2)) (succ (max u1 u2)) (succ u3), max (max (succ (max u1 u2)) (succ u3)) (succ u3) (succ u2)} (Equiv.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ u2)} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (fun (_x : Equiv.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ u2)} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) => (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) -> (MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (Equiv.hasCoeToFun.{max (succ (max u1 u2)) (succ u3), max (succ u3) (succ u2)} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (Equiv.symm.{max (succ u3) (succ u2), max (succ (max u1 u2)) (succ u3)} (MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidAlgebra.lift.{u1, u2, u3} k G _inst_1 _inst_2 A _inst_3 _inst_4)) F) x) (coeFn.{max (succ (max u1 u2)) (succ u3), max (succ (max u1 u2)) (succ u3)} (AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (fun (_x : AlgHom.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) -> A) ([anonymous].{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) F (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) x (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Monoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] (F : AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (x : G), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => A) x) (FunLike.coe.{max (succ u2) (succ u3), succ u2, succ u3} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) F) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => A) _x) (MulHomClass.toFunLike.{max u2 u3, u2, u3} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) F) G A (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)) (MulOneClass.toMul.{u3} A (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (MonoidHomClass.toMulHomClass.{max u2 u3, u2, u3} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) F) G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (MonoidHom.monoidHomClass.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (FunLike.coe.{max (max (succ u1) (succ u2)) (succ u3), max (max (succ u1) (succ u2)) (succ u3), max (succ u2) (succ u3)} (Equiv.{max (max (succ u1) (succ u2)) (succ u3), max (succ u2) (succ u3)} (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (fun (_x : AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) _x) (Equiv.instFunLikeEquiv.{max (max (succ u1) (succ u2)) (succ u3), max (succ u2) (succ u3)} (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (Equiv.symm.{max (succ u2) (succ u3), max (max (succ u1) (succ u2)) (succ u3)} (MonoidHom.{u2, u3} G A (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidAlgebra.lift.{u1, u2, u3} k G _inst_1 _inst_2 A _inst_3 _inst_4)) F) x) (FunLike.coe.{max (max (succ u1) (succ u2)) (succ u3), max (succ u1) (succ u2), succ u3} (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (fun (_x : MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) => A) _x) (SMulHomClass.toFunLike.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (SMulZeroClass.toSMul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoid.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))))) (DistribSMul.toSMulZeroClass.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))))) (DistribMulAction.toDistribSMul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))))) (Module.toDistribMulAction.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))) (Algebra.toModule.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2)))))) (SMulZeroClass.toSMul.{u1, u3} k A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribSMul.toSMulZeroClass.{u1, u3} k A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribMulAction.toDistribSMul.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4))))) (DistribMulActionHomClass.toSMulHomClass.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Module.toDistribMulAction.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))) (Algebra.toModule.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2))) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4)) (NonUnitalAlgHomClass.toDistribMulActionHomClass.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (Module.toDistribMulAction.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))) (Algebra.toModule.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2))) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4)) (AlgHom.instNonUnitalAlgHomClassToMonoidToMonoidWithZeroToSemiringToNonUnitalNonAssocSemiringToNonAssocSemiringToNonUnitalNonAssocSemiringToNonAssocSemiringToDistribMulActionToAddCommMonoidToModuleToDistribMulActionToAddCommMonoidToModule.{u1, max u1 u2, u3, max (max u1 u2) u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4 (AlgHom.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (AlgHom.algHomClass.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4))))) F (MonoidAlgebra.single.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) x (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.lift_symm_apply MonoidAlgebra.lift_symm_applyₓ'. -/
@[simp]
theorem lift_symm_apply (F : MonoidAlgebra k G →ₐ[k] A) (x : G) :
    (lift k G A).symm F x = F (single x 1) :=
  rfl
#align monoid_algebra.lift_symm_apply MonoidAlgebra.lift_symm_apply

#print MonoidAlgebra.lift_of /-
theorem lift_of (F : G →* A) (x) : lift k G A F (of k G x) = F x := by
  rw [of_apply, ← lift_symm_apply, Equiv.symm_apply_apply]
#align monoid_algebra.lift_of MonoidAlgebra.lift_of
-/

#print MonoidAlgebra.lift_single /-
@[simp]
theorem lift_single (F : G →* A) (a b) : lift k G A F (single a b) = b • F a := by
  rw [lift_def, lift_nc_single, Algebra.smul_def, [anonymous]]
#align monoid_algebra.lift_single MonoidAlgebra.lift_single
-/

#print MonoidAlgebra.lift_unique' /-
theorem lift_unique' (F : MonoidAlgebra k G →ₐ[k] A) :
    F = lift k G A ((F : MonoidAlgebra k G →* A).comp (of k G)) :=
  ((lift k G A).apply_symm_apply F).symm
#align monoid_algebra.lift_unique' MonoidAlgebra.lift_unique'
-/

#print MonoidAlgebra.lift_unique /-
/-- Decomposition of a `k`-algebra homomorphism from `monoid_algebra k G` by
its values on `F (single a 1)`. -/
theorem lift_unique (F : MonoidAlgebra k G →ₐ[k] A) (f : MonoidAlgebra k G) :
    F f = f.Sum fun a b => b • F (single a 1) := by
  conv_lhs =>
    rw [lift_unique' F]
    simp [lift_apply]
#align monoid_algebra.lift_unique MonoidAlgebra.lift_unique
-/

#print MonoidAlgebra.mapDomainNonUnitalAlgHom /-
/-- If `f : G → H` is a homomorphism between two magmas, then
`finsupp.map_domain f` is a non-unital algebra homomorphism between their magma algebras. -/
@[simps]
def mapDomainNonUnitalAlgHom (k A : Type _) [CommSemiring k] [Semiring A] [Algebra k A]
    {G H F : Type _} [Mul G] [Mul H] [MulHomClass F G H] (f : F) :
    MonoidAlgebra A G →ₙₐ[k] MonoidAlgebra A H :=
  {
    (Finsupp.mapDomain.addMonoidHom f :
      MonoidAlgebra A G →+
        MonoidAlgebra A H) with
    map_mul' := fun x y => mapDomain_mul f x y
    map_smul' := fun r x => mapDomain_smul r x }
#align monoid_algebra.map_domain_non_unital_alg_hom MonoidAlgebra.mapDomainNonUnitalAlgHom
-/

/- warning: monoid_algebra.map_domain_algebra_map -> MonoidAlgebra.mapDomain_algebraMap is a dubious translation:
lean 3 declaration is
  forall {G : Type.{u1}} [_inst_2 : Monoid.{u1} G] (k : Type.{u2}) (A : Type.{u3}) {H : Type.{u4}} {F : Type.{u5}} [_inst_7 : CommSemiring.{u2} k] [_inst_8 : Semiring.{u3} A] [_inst_9 : Algebra.{u2, u3} k A _inst_7 _inst_8] [_inst_10 : Monoid.{u4} H] [_inst_11 : MonoidHomClass.{u5, u1, u4} F G H (Monoid.toMulOneClass.{u1} G _inst_2) (Monoid.toMulOneClass.{u4} H _inst_10)] (f : F) (r : k), Eq.{max (succ u4) (succ u3)} (Finsupp.{u4, u3} H A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_8))))))) (Finsupp.mapDomain.{u1, u4, u3} G H A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_8))) (coeFn.{succ u5, max (succ u1) (succ u4)} F (fun (_x : F) => G -> H) (FunLike.hasCoeToFun.{succ u5, succ u1, succ u4} F G (fun (_x : G) => H) (MulHomClass.toFunLike.{u5, u1, u4} F G H (MulOneClass.toHasMul.{u1} G (Monoid.toMulOneClass.{u1} G _inst_2)) (MulOneClass.toHasMul.{u4} H (Monoid.toMulOneClass.{u4} H _inst_10)) (MonoidHomClass.toMulHomClass.{u5, u1, u4} F G H (Monoid.toMulOneClass.{u1} G _inst_2) (Monoid.toMulOneClass.{u4} H _inst_10) _inst_11))) f) (coeFn.{max (succ u2) (succ (max u3 u1)), max (succ u2) (succ (max u3 u1))} (RingHom.{u2, max u3 u1} k (MonoidAlgebra.{u3, u1} A G _inst_8) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_7)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u3, u1} A G _inst_8) (MonoidAlgebra.semiring.{u3, u1} A G _inst_8 _inst_2))) (fun (_x : RingHom.{u2, max u3 u1} k (MonoidAlgebra.{u3, u1} A G _inst_8) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_7)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u3, u1} A G _inst_8) (MonoidAlgebra.semiring.{u3, u1} A G _inst_8 _inst_2))) => k -> (MonoidAlgebra.{u3, u1} A G _inst_8)) (RingHom.hasCoeToFun.{u2, max u3 u1} k (MonoidAlgebra.{u3, u1} A G _inst_8) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_7)) (Semiring.toNonAssocSemiring.{max u3 u1} (MonoidAlgebra.{u3, u1} A G _inst_8) (MonoidAlgebra.semiring.{u3, u1} A G _inst_8 _inst_2))) (algebraMap.{u2, max u3 u1} k (MonoidAlgebra.{u3, u1} A G _inst_8) _inst_7 (MonoidAlgebra.semiring.{u3, u1} A G _inst_8 _inst_2) (MonoidAlgebra.algebra.{u2, u1, u3} k G A _inst_7 _inst_8 _inst_9 _inst_2)) r)) (coeFn.{max (succ u2) (succ (max u3 u4)), max (succ u2) (succ (max u3 u4))} (RingHom.{u2, max u3 u4} k (MonoidAlgebra.{u3, u4} A H _inst_8) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_7)) (Semiring.toNonAssocSemiring.{max u3 u4} (MonoidAlgebra.{u3, u4} A H _inst_8) (MonoidAlgebra.semiring.{u3, u4} A H _inst_8 _inst_10))) (fun (_x : RingHom.{u2, max u3 u4} k (MonoidAlgebra.{u3, u4} A H _inst_8) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_7)) (Semiring.toNonAssocSemiring.{max u3 u4} (MonoidAlgebra.{u3, u4} A H _inst_8) (MonoidAlgebra.semiring.{u3, u4} A H _inst_8 _inst_10))) => k -> (MonoidAlgebra.{u3, u4} A H _inst_8)) (RingHom.hasCoeToFun.{u2, max u3 u4} k (MonoidAlgebra.{u3, u4} A H _inst_8) (Semiring.toNonAssocSemiring.{u2} k (CommSemiring.toSemiring.{u2} k _inst_7)) (Semiring.toNonAssocSemiring.{max u3 u4} (MonoidAlgebra.{u3, u4} A H _inst_8) (MonoidAlgebra.semiring.{u3, u4} A H _inst_8 _inst_10))) (algebraMap.{u2, max u3 u4} k (MonoidAlgebra.{u3, u4} A H _inst_8) _inst_7 (MonoidAlgebra.semiring.{u3, u4} A H _inst_8 _inst_10) (MonoidAlgebra.algebra.{u2, u4, u3} k H A _inst_7 _inst_8 _inst_9 _inst_10)) r)
but is expected to have type
  forall {G : Type.{u5}} [_inst_2 : Monoid.{u5} G] (k : Type.{u4}) (A : Type.{u3}) {H : Type.{u2}} {F : Type.{u1}} [_inst_7 : CommSemiring.{u4} k] [_inst_8 : Semiring.{u3} A] [_inst_9 : Algebra.{u4, u3} k A _inst_7 _inst_8] [_inst_10 : Monoid.{u2} H] [_inst_11 : MonoidHomClass.{u1, u5, u2} F G H (Monoid.toMulOneClass.{u5} G _inst_2) (Monoid.toMulOneClass.{u2} H _inst_10)] (f : F) (r : k), Eq.{max (succ u3) (succ u2)} (MonoidAlgebra.{u3, u2} A H _inst_8) (MonoidAlgebra.mapDomain.{u3, u5, u2} A G _inst_8 H (FunLike.coe.{succ u1, succ u5, succ u2} F G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => H) _x) (MulHomClass.toFunLike.{u1, u5, u2} F G H (MulOneClass.toMul.{u5} G (Monoid.toMulOneClass.{u5} G _inst_2)) (MulOneClass.toMul.{u2} H (Monoid.toMulOneClass.{u2} H _inst_10)) (MonoidHomClass.toMulHomClass.{u1, u5, u2} F G H (Monoid.toMulOneClass.{u5} G _inst_2) (Monoid.toMulOneClass.{u2} H _inst_10) _inst_11)) f) (FunLike.coe.{max (max (succ u5) (succ u4)) (succ u3), succ u4, max (succ u5) (succ u3)} (RingHom.{u4, max u5 u3} k (MonoidAlgebra.{u3, u5} A G _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u5 u3} (MonoidAlgebra.{u3, u5} A G _inst_8) (MonoidAlgebra.semiring.{u3, u5} A G _inst_8 _inst_2))) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u3, u5} A G _inst_8) _x) (MulHomClass.toFunLike.{max (max u5 u4) u3, u4, max u5 u3} (RingHom.{u4, max u5 u3} k (MonoidAlgebra.{u3, u5} A G _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u5 u3} (MonoidAlgebra.{u3, u5} A G _inst_8) (MonoidAlgebra.semiring.{u3, u5} A G _inst_8 _inst_2))) k (MonoidAlgebra.{u3, u5} A G _inst_8) (NonUnitalNonAssocSemiring.toMul.{u4} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} k (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)))) (NonUnitalNonAssocSemiring.toMul.{max u5 u3} (MonoidAlgebra.{u3, u5} A G _inst_8) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u5 u3} (MonoidAlgebra.{u3, u5} A G _inst_8) (Semiring.toNonAssocSemiring.{max u5 u3} (MonoidAlgebra.{u3, u5} A G _inst_8) (MonoidAlgebra.semiring.{u3, u5} A G _inst_8 _inst_2)))) (NonUnitalRingHomClass.toMulHomClass.{max (max u5 u4) u3, u4, max u5 u3} (RingHom.{u4, max u5 u3} k (MonoidAlgebra.{u3, u5} A G _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u5 u3} (MonoidAlgebra.{u3, u5} A G _inst_8) (MonoidAlgebra.semiring.{u3, u5} A G _inst_8 _inst_2))) k (MonoidAlgebra.{u3, u5} A G _inst_8) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} k (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u5 u3} (MonoidAlgebra.{u3, u5} A G _inst_8) (Semiring.toNonAssocSemiring.{max u5 u3} (MonoidAlgebra.{u3, u5} A G _inst_8) (MonoidAlgebra.semiring.{u3, u5} A G _inst_8 _inst_2))) (RingHomClass.toNonUnitalRingHomClass.{max (max u5 u4) u3, u4, max u5 u3} (RingHom.{u4, max u5 u3} k (MonoidAlgebra.{u3, u5} A G _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u5 u3} (MonoidAlgebra.{u3, u5} A G _inst_8) (MonoidAlgebra.semiring.{u3, u5} A G _inst_8 _inst_2))) k (MonoidAlgebra.{u3, u5} A G _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u5 u3} (MonoidAlgebra.{u3, u5} A G _inst_8) (MonoidAlgebra.semiring.{u3, u5} A G _inst_8 _inst_2)) (RingHom.instRingHomClassRingHom.{u4, max u5 u3} k (MonoidAlgebra.{u3, u5} A G _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u5 u3} (MonoidAlgebra.{u3, u5} A G _inst_8) (MonoidAlgebra.semiring.{u3, u5} A G _inst_8 _inst_2)))))) (algebraMap.{u4, max u5 u3} k (MonoidAlgebra.{u3, u5} A G _inst_8) _inst_7 (MonoidAlgebra.semiring.{u3, u5} A G _inst_8 _inst_2) (MonoidAlgebra.algebra.{u4, u5, u3} k G A _inst_7 _inst_8 _inst_9 _inst_2)) r)) (FunLike.coe.{max (max (succ u4) (succ u3)) (succ u2), succ u4, max (succ u3) (succ u2)} (RingHom.{u4, max u2 u3} k (MonoidAlgebra.{u3, u2} A H _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u3, u2} A H _inst_8) (MonoidAlgebra.semiring.{u3, u2} A H _inst_8 _inst_10))) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => MonoidAlgebra.{u3, u2} A H _inst_8) _x) (MulHomClass.toFunLike.{max (max u4 u3) u2, u4, max u3 u2} (RingHom.{u4, max u2 u3} k (MonoidAlgebra.{u3, u2} A H _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u3, u2} A H _inst_8) (MonoidAlgebra.semiring.{u3, u2} A H _inst_8 _inst_10))) k (MonoidAlgebra.{u3, u2} A H _inst_8) (NonUnitalNonAssocSemiring.toMul.{u4} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} k (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)))) (NonUnitalNonAssocSemiring.toMul.{max u3 u2} (MonoidAlgebra.{u3, u2} A H _inst_8) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u3 u2} (MonoidAlgebra.{u3, u2} A H _inst_8) (Semiring.toNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u3, u2} A H _inst_8) (MonoidAlgebra.semiring.{u3, u2} A H _inst_8 _inst_10)))) (NonUnitalRingHomClass.toMulHomClass.{max (max u4 u3) u2, u4, max u3 u2} (RingHom.{u4, max u2 u3} k (MonoidAlgebra.{u3, u2} A H _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u3, u2} A H _inst_8) (MonoidAlgebra.semiring.{u3, u2} A H _inst_8 _inst_10))) k (MonoidAlgebra.{u3, u2} A H _inst_8) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} k (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u3 u2} (MonoidAlgebra.{u3, u2} A H _inst_8) (Semiring.toNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u3, u2} A H _inst_8) (MonoidAlgebra.semiring.{u3, u2} A H _inst_8 _inst_10))) (RingHomClass.toNonUnitalRingHomClass.{max (max u4 u3) u2, u4, max u3 u2} (RingHom.{u4, max u2 u3} k (MonoidAlgebra.{u3, u2} A H _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u3, u2} A H _inst_8) (MonoidAlgebra.semiring.{u3, u2} A H _inst_8 _inst_10))) k (MonoidAlgebra.{u3, u2} A H _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u3, u2} A H _inst_8) (MonoidAlgebra.semiring.{u3, u2} A H _inst_8 _inst_10)) (RingHom.instRingHomClassRingHom.{u4, max u3 u2} k (MonoidAlgebra.{u3, u2} A H _inst_8) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_7)) (Semiring.toNonAssocSemiring.{max u2 u3} (MonoidAlgebra.{u3, u2} A H _inst_8) (MonoidAlgebra.semiring.{u3, u2} A H _inst_8 _inst_10)))))) (algebraMap.{u4, max u2 u3} k (MonoidAlgebra.{u3, u2} A H _inst_8) _inst_7 (MonoidAlgebra.semiring.{u3, u2} A H _inst_8 _inst_10) (MonoidAlgebra.algebra.{u4, u2, u3} k H A _inst_7 _inst_8 _inst_9 _inst_10)) r)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.map_domain_algebra_map MonoidAlgebra.mapDomain_algebraMapₓ'. -/
theorem mapDomain_algebraMap (k A : Type _) {H F : Type _} [CommSemiring k] [Semiring A]
    [Algebra k A] [Monoid H] [MonoidHomClass F G H] (f : F) (r : k) :
    mapDomain f (algebraMap k (MonoidAlgebra A G) r) = algebraMap k (MonoidAlgebra A H) r := by
  simp only [coe_algebra_map, map_domain_single, map_one]
#align monoid_algebra.map_domain_algebra_map MonoidAlgebra.mapDomain_algebraMap

#print MonoidAlgebra.mapDomainAlgHom /-
/-- If `f : G → H` is a multiplicative homomorphism between two monoids, then
`finsupp.map_domain f` is an algebra homomorphism between their monoid algebras. -/
@[simps]
def mapDomainAlgHom (k A : Type _) [CommSemiring k] [Semiring A] [Algebra k A] {H F : Type _}
    [Monoid H] [MonoidHomClass F G H] (f : F) : MonoidAlgebra A G →ₐ[k] MonoidAlgebra A H :=
  { mapDomainRingHom A f with commutes' := mapDomain_algebraMap k A f }
#align monoid_algebra.map_domain_alg_hom MonoidAlgebra.mapDomainAlgHom
-/

end lift

section

attribute [local reducible] MonoidAlgebra

variable (k)

#print MonoidAlgebra.GroupSmul.linearMap /-
/-- When `V` is a `k[G]`-module, multiplication by a group element `g` is a `k`-linear map. -/
def GroupSmul.linearMap [Monoid G] [CommSemiring k] (V : Type u₃) [AddCommMonoid V] [Module k V]
    [Module (MonoidAlgebra k G) V] [IsScalarTower k (MonoidAlgebra k G) V] (g : G) : V →ₗ[k] V
    where
  toFun v := (single g (1 : k) • v : V)
  map_add' x y := smul_add (single g (1 : k)) x y
  map_smul' c x := smul_algebra_smul_comm _ _ _
#align monoid_algebra.group_smul.linear_map MonoidAlgebra.GroupSmul.linearMap
-/

/- warning: monoid_algebra.group_smul.linear_map_apply -> MonoidAlgebra.GroupSmul.linearMap_apply is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Monoid.{u2} G] [_inst_2 : CommSemiring.{u1} k] (V : Type.{u3}) [_inst_3 : AddCommMonoid.{u3} V] [_inst_4 : Module.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_2) _inst_3] [_inst_5 : Module.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1) _inst_3] [_inst_6 : IsScalarTower.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (SMulZeroClass.toHasSmul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (AddZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (MonoidAlgebra.addCommMonoid.{u2, u1} k G (CommSemiring.toSemiring.{u1} k _inst_2))))) (MonoidAlgebra.smulZeroClass.{u1, u2, u1} k G k (CommSemiring.toSemiring.{u1} k _inst_2) (SMulWithZero.toSmulZeroClass.{u1, u1} k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2))))) (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2))))) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))))))) (SMulZeroClass.toHasSmul.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (SMulWithZero.toSmulZeroClass.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (MulZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (MulZeroOneClass.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (MonoidWithZero.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1))))) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (MulActionWithZero.toSMulWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1)) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (Module.toMulActionWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1) _inst_3 _inst_5)))) (SMulZeroClass.toHasSmul.{u1, u3} k V (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (SMulWithZero.toSmulZeroClass.{u1, u3} k V (MulZeroClass.toHasZero.{u1} k (MulZeroOneClass.toMulZeroClass.{u1} k (MonoidWithZero.toMulZeroOneClass.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2))))) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (MulActionWithZero.toSMulWithZero.{u1, u3} k V (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (Module.toMulActionWithZero.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_2) _inst_3 _inst_4))))] (g : G) (v : V), Eq.{succ u3} V (coeFn.{succ u3, succ u3} (LinearMap.{u1, u1, u3, u3} k k (CommSemiring.toSemiring.{u1} k _inst_2) (CommSemiring.toSemiring.{u1} k _inst_2) (RingHom.id.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2))) V V _inst_3 _inst_3 _inst_4 _inst_4) (fun (_x : LinearMap.{u1, u1, u3, u3} k k (CommSemiring.toSemiring.{u1} k _inst_2) (CommSemiring.toSemiring.{u1} k _inst_2) (RingHom.id.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2))) V V _inst_3 _inst_3 _inst_4 _inst_4) => V -> V) (LinearMap.hasCoeToFun.{u1, u1, u3, u3} k k V V (CommSemiring.toSemiring.{u1} k _inst_2) (CommSemiring.toSemiring.{u1} k _inst_2) _inst_3 _inst_3 _inst_4 _inst_4 (RingHom.id.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))) (MonoidAlgebra.GroupSmul.linearMap.{u1, u2, u3} k G _inst_1 _inst_2 V _inst_3 _inst_4 _inst_5 _inst_6 g) v) (SMul.smul.{max u2 u1, u3} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))))) V (SMulZeroClass.toHasSmul.{max u2 u1, u3} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))))) V (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (SMulWithZero.toSmulZeroClass.{max u2 u1, u3} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))))) V (MulZeroClass.toHasZero.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))))) (MulZeroOneClass.toMulZeroClass.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))))) (MonoidWithZero.toMulZeroOneClass.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))))) (Semiring.toMonoidWithZero.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))))) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1))))) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (MulActionWithZero.toSMulWithZero.{max u2 u1, u3} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))))) V (Semiring.toMonoidWithZero.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))))) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1)) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (Module.toMulActionWithZero.{max u2 u1, u3} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))))) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1) _inst_3 _inst_5)))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2))))) g (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2))))))))) v)
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Monoid.{u2} G] [_inst_2 : CommSemiring.{u1} k] (V : Type.{u3}) [_inst_3 : AddCommMonoid.{u3} V] [_inst_4 : Module.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_2) _inst_3] [_inst_5 : Module.{max u2 u1, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1) _inst_3] [_inst_6 : IsScalarTower.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (Algebra.toSMul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) _inst_2 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1) (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_2 (CommSemiring.toSemiring.{u1} k _inst_2) (Algebra.id.{u1} k _inst_2) _inst_1)) (SMulZeroClass.toSMul.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (SMulWithZero.toSMulZeroClass.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (MonoidWithZero.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1))) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (MulActionWithZero.toSMulWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1)) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (Module.toMulActionWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1) _inst_3 _inst_5)))) (SMulZeroClass.toSMul.{u1, u3} k V (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (SMulWithZero.toSMulZeroClass.{u1, u3} k V (CommMonoidWithZero.toZero.{u1} k (CommSemiring.toCommMonoidWithZero.{u1} k _inst_2)) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (MulActionWithZero.toSMulWithZero.{u1, u3} k V (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (Module.toMulActionWithZero.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_2) _inst_3 _inst_4))))] (g : G) (v : V), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => V) v) (FunLike.coe.{succ u3, succ u3, succ u3} (LinearMap.{u1, u1, u3, u3} k k (CommSemiring.toSemiring.{u1} k _inst_2) (CommSemiring.toSemiring.{u1} k _inst_2) (RingHom.id.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2))) V V _inst_3 _inst_3 _inst_4 _inst_4) V (fun (_x : V) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => V) _x) (LinearMap.instFunLikeLinearMap.{u1, u1, u3, u3} k k V V (CommSemiring.toSemiring.{u1} k _inst_2) (CommSemiring.toSemiring.{u1} k _inst_2) _inst_3 _inst_3 _inst_4 _inst_4 (RingHom.id.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2)))) (MonoidAlgebra.GroupSmul.linearMap.{u1, u2, u3} k G _inst_1 _inst_2 V _inst_3 _inst_4 _inst_5 _inst_6 g) v) (HSMul.hSMul.{max u2 u1, u3, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V V (instHSMul.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (SMulZeroClass.toSMul.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (SMulWithZero.toSMulZeroClass.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (MonoidWithZero.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1))) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (MulActionWithZero.toSMulWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1)) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (Module.toMulActionWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) _inst_1) _inst_3 _inst_5))))) (MonoidAlgebra.single.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_2) g (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k (CommSemiring.toSemiring.{u1} k _inst_2))))) v)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.group_smul.linear_map_apply MonoidAlgebra.GroupSmul.linearMap_applyₓ'. -/
@[simp]
theorem GroupSmul.linearMap_apply [Monoid G] [CommSemiring k] (V : Type u₃) [AddCommMonoid V]
    [Module k V] [Module (MonoidAlgebra k G) V] [IsScalarTower k (MonoidAlgebra k G) V] (g : G)
    (v : V) : (GroupSmul.linearMap k V g) v = (single g (1 : k) • v : V) :=
  rfl
#align monoid_algebra.group_smul.linear_map_apply MonoidAlgebra.GroupSmul.linearMap_apply

section

variable {k}

variable [Monoid G] [CommSemiring k] {V W : Type u₃} [AddCommMonoid V] [Module k V]
  [Module (MonoidAlgebra k G) V] [IsScalarTower k (MonoidAlgebra k G) V] [AddCommMonoid W]
  [Module k W] [Module (MonoidAlgebra k G) W] [IsScalarTower k (MonoidAlgebra k G) W]
  (f : V →ₗ[k] W)
  (h : ∀ (g : G) (v : V), f (single g (1 : k) • v : V) = (single g (1 : k) • f v : W))

include h

/- warning: monoid_algebra.equivariant_of_linear_of_comm -> MonoidAlgebra.equivariantOfLinearOfComm is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u₁}} {G : Type.{u₂}} [_inst_1 : Monoid.{u₂} G] [_inst_2 : CommSemiring.{u₁} k] {V : Type.{u₃}} {W : Type.{u₃}} [_inst_3 : AddCommMonoid.{u₃} V] [_inst_4 : Module.{u₁, u₃} k V (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3] [_inst_5 : Module.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3] [_inst_6 : IsScalarTower.{u₁, max u₁ u₂, u₃} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (SMulZeroClass.toHasSmul.{u₁, max u₁ u₂} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddZeroClass.toHasZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddMonoid.toAddZeroClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddCommMonoid.toAddMonoid.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.addCommMonoid.{u₂, u₁} k G (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MonoidAlgebra.smulZeroClass.{u₁, u₂, u₁} k G k (CommSemiring.toSemiring.{u₁} k _inst_2) (SMulWithZero.toSmulZeroClass.{u₁, u₁} k k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MulZeroClass.toSMulWithZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))))) (SMulZeroClass.toHasSmul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (SMulWithZero.toSmulZeroClass.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MulZeroClass.toHasZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MulZeroOneClass.toMulZeroClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidWithZero.toMulZeroOneClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))))) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (Module.toMulActionWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_5)))) (SMulZeroClass.toHasSmul.{u₁, u₃} k V (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (SMulWithZero.toSmulZeroClass.{u₁, u₃} k V (MulZeroClass.toHasZero.{u₁} k (MulZeroOneClass.toMulZeroClass.{u₁} k (MonoidWithZero.toMulZeroOneClass.{u₁} k (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (MulActionWithZero.toSMulWithZero.{u₁, u₃} k V (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (Module.toMulActionWithZero.{u₁, u₃} k V (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_4))))] [_inst_7 : AddCommMonoid.{u₃} W] [_inst_8 : Module.{u₁, u₃} k W (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_7] [_inst_9 : Module.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7] [_inst_10 : IsScalarTower.{u₁, max u₁ u₂, u₃} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (SMulZeroClass.toHasSmul.{u₁, max u₁ u₂} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddZeroClass.toHasZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddMonoid.toAddZeroClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddCommMonoid.toAddMonoid.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.addCommMonoid.{u₂, u₁} k G (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MonoidAlgebra.smulZeroClass.{u₁, u₂, u₁} k G k (CommSemiring.toSemiring.{u₁} k _inst_2) (SMulWithZero.toSmulZeroClass.{u₁, u₁} k k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MulZeroClass.toSMulWithZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))))) (SMulZeroClass.toHasSmul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (SMulWithZero.toSmulZeroClass.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MulZeroClass.toHasZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MulZeroOneClass.toMulZeroClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidWithZero.toMulZeroOneClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))))) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (Module.toMulActionWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7 _inst_9)))) (SMulZeroClass.toHasSmul.{u₁, u₃} k W (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (SMulWithZero.toSmulZeroClass.{u₁, u₃} k W (MulZeroClass.toHasZero.{u₁} k (MulZeroOneClass.toMulZeroClass.{u₁} k (MonoidWithZero.toMulZeroOneClass.{u₁} k (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (MulActionWithZero.toSMulWithZero.{u₁, u₃} k W (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (Module.toMulActionWithZero.{u₁, u₃} k W (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_7 _inst_8))))] (f : LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8), (forall (g : G) (v : V), Eq.{succ u₃} W (coeFn.{succ u₃, succ u₃} (LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) (fun (_x : LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) => V -> W) (LinearMap.hasCoeToFun.{u₁, u₁, u₃, u₃} k k V W (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_7 _inst_4 _inst_8 (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))) f (SMul.smul.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) V (SMulZeroClass.toHasSmul.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) V (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (SMulWithZero.toSmulZeroClass.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) V (MulZeroClass.toHasZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MulZeroOneClass.toMulZeroClass.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidWithZero.toMulZeroOneClass.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (Semiring.toMonoidWithZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))))) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (MulActionWithZero.toSMulWithZero.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) V (Semiring.toMonoidWithZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (Module.toMulActionWithZero.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_5)))) (Finsupp.single.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) g (OfNat.ofNat.{u₁} k 1 (OfNat.mk.{u₁} k 1 (One.one.{u₁} k (AddMonoidWithOne.toOne.{u₁} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u₁} k (NonAssocSemiring.toAddCommMonoidWithOne.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))))))) v)) (SMul.smul.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) W (SMulZeroClass.toHasSmul.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) W (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (SMulWithZero.toSmulZeroClass.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) W (MulZeroClass.toHasZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MulZeroOneClass.toMulZeroClass.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidWithZero.toMulZeroOneClass.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (Semiring.toMonoidWithZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))))) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (MulActionWithZero.toSMulWithZero.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) W (Semiring.toMonoidWithZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (Module.toMulActionWithZero.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7 _inst_9)))) (Finsupp.single.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) g (OfNat.ofNat.{u₁} k 1 (OfNat.mk.{u₁} k 1 (One.one.{u₁} k (AddMonoidWithOne.toOne.{u₁} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u₁} k (NonAssocSemiring.toAddCommMonoidWithOne.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))))))) (coeFn.{succ u₃, succ u₃} (LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) (fun (_x : LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) => V -> W) (LinearMap.hasCoeToFun.{u₁, u₁, u₃, u₃} k k V W (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_7 _inst_4 _inst_8 (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))) f v))) -> (LinearMap.{max u₁ u₂, max u₁ u₂, u₃, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (RingHom.id.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toNonAssocSemiring.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) V W _inst_3 _inst_7 _inst_5 _inst_9)
but is expected to have type
  forall {k : Type.{u₁}} {G : Type.{u₂}} [_inst_1 : Monoid.{u₂} G] [_inst_2 : CommSemiring.{u₁} k] {V : Type.{u₃}} {W : Type.{u₄}} [_inst_3 : AddCommMonoid.{u₃} V] [_inst_4 : Module.{u₁, u₃} k V (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3] [_inst_5 : Module.{max u₂ u₁, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3] [_inst_6 : IsScalarTower.{u₁, max u₂ u₁, u₃} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (Algebra.toSMul.{u₁, max u₁ u₂} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) _inst_2 (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (MonoidAlgebra.algebra.{u₁, u₂, u₁} k G k _inst_2 (CommSemiring.toSemiring.{u₁} k _inst_2) (Algebra.id.{u₁} k _inst_2) _inst_1)) (SMulZeroClass.toSMul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (SMulWithZero.toSMulZeroClass.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidWithZero.toZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (Module.toMulActionWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_5)))) (SMulZeroClass.toSMul.{u₁, u₃} k V (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (SMulWithZero.toSMulZeroClass.{u₁, u₃} k V (CommMonoidWithZero.toZero.{u₁} k (CommSemiring.toCommMonoidWithZero.{u₁} k _inst_2)) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (MulActionWithZero.toSMulWithZero.{u₁, u₃} k V (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (Module.toMulActionWithZero.{u₁, u₃} k V (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_4))))] [_inst_7 : AddCommMonoid.{u₄} W] [_inst_8 : Module.{u₁, u₄} k W (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_7] [_inst_9 : Module.{max u₂ u₁, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7] [_inst_10 : IsScalarTower.{u₁, max u₂ u₁, u₄} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (Algebra.toSMul.{u₁, max u₁ u₂} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) _inst_2 (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (MonoidAlgebra.algebra.{u₁, u₂, u₁} k G k _inst_2 (CommSemiring.toSemiring.{u₁} k _inst_2) (Algebra.id.{u₁} k _inst_2) _inst_1)) (SMulZeroClass.toSMul.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (SMulWithZero.toSMulZeroClass.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MonoidWithZero.toZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (Module.toMulActionWithZero.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7 _inst_9)))) (SMulZeroClass.toSMul.{u₁, u₄} k W (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (SMulWithZero.toSMulZeroClass.{u₁, u₄} k W (CommMonoidWithZero.toZero.{u₁} k (CommSemiring.toCommMonoidWithZero.{u₁} k _inst_2)) (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (MulActionWithZero.toSMulWithZero.{u₁, u₄} k W (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (Module.toMulActionWithZero.{u₁, u₄} k W (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_7 _inst_8))))] (f : LinearMap.{u₁, u₁, u₃, u₄} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8), (forall (g : G) (v : V), Eq.{succ u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) (HSMul.hSMul.{max u₂ u₁, u₃, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V V (instHSMul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (SMulZeroClass.toSMul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (SMulWithZero.toSMulZeroClass.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidWithZero.toZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (Module.toMulActionWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_5))))) (MonoidAlgebra.single.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) g (OfNat.ofNat.{u₁} k 1 (One.toOfNat1.{u₁} k (Semiring.toOne.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) v)) (FunLike.coe.{max (succ u₃) (succ u₄), succ u₃, succ u₄} (LinearMap.{u₁, u₁, u₃, u₄} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) V (fun (_x : V) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) _x) (LinearMap.instFunLikeLinearMap.{u₁, u₁, u₃, u₄} k k V W (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_7 _inst_4 _inst_8 (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))) f (HSMul.hSMul.{max u₂ u₁, u₃, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V V (instHSMul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (SMulZeroClass.toSMul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (SMulWithZero.toSMulZeroClass.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidWithZero.toZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (Module.toMulActionWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_5))))) (MonoidAlgebra.single.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) g (OfNat.ofNat.{u₁} k 1 (One.toOfNat1.{u₁} k (Semiring.toOne.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) v)) (HSMul.hSMul.{max u₂ u₁, u₄, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (instHSMul.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (SMulZeroClass.toSMul.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (AddMonoid.toZero.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (AddCommMonoid.toAddMonoid.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) _inst_7)) (SMulWithZero.toSMulZeroClass.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (MonoidWithZero.toZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) (AddMonoid.toZero.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (AddCommMonoid.toAddMonoid.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) _inst_7)) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddMonoid.toZero.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (AddCommMonoid.toAddMonoid.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) _inst_7)) (Module.toMulActionWithZero.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7 _inst_9))))) (MonoidAlgebra.single.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) g (OfNat.ofNat.{u₁} k 1 (One.toOfNat1.{u₁} k (Semiring.toOne.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (FunLike.coe.{max (succ u₃) (succ u₄), succ u₃, succ u₄} (LinearMap.{u₁, u₁, u₃, u₄} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) V (fun (_x : V) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) _x) (LinearMap.instFunLikeLinearMap.{u₁, u₁, u₃, u₄} k k V W (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_7 _inst_4 _inst_8 (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))) f v))) -> (LinearMap.{max u₁ u₂, max u₁ u₂, u₃, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (RingHom.id.{max u₂ u₁} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.nonAssocSemiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) (Monoid.toMulOneClass.{u₂} G _inst_1))) V W _inst_3 _inst_7 _inst_5 _inst_9)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.equivariant_of_linear_of_comm MonoidAlgebra.equivariantOfLinearOfCommₓ'. -/
/-- 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
    apply 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_algebra_map_mul_of, ← smul_smul]
      erw [algebraMap_smul (MonoidAlgebra k G) r, algebraMap_smul (MonoidAlgebra k G) r, f.map_smul,
        h g v, of_apply]
      all_goals infer_instance
#align monoid_algebra.equivariant_of_linear_of_comm MonoidAlgebra.equivariantOfLinearOfComm

/- warning: monoid_algebra.equivariant_of_linear_of_comm_apply -> MonoidAlgebra.equivariantOfLinearOfComm_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u₁}} {G : Type.{u₂}} [_inst_1 : Monoid.{u₂} G] [_inst_2 : CommSemiring.{u₁} k] {V : Type.{u₃}} {W : Type.{u₃}} [_inst_3 : AddCommMonoid.{u₃} V] [_inst_4 : Module.{u₁, u₃} k V (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3] [_inst_5 : Module.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3] [_inst_6 : IsScalarTower.{u₁, max u₁ u₂, u₃} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (SMulZeroClass.toHasSmul.{u₁, max u₁ u₂} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddZeroClass.toHasZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddMonoid.toAddZeroClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddCommMonoid.toAddMonoid.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.addCommMonoid.{u₂, u₁} k G (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MonoidAlgebra.smulZeroClass.{u₁, u₂, u₁} k G k (CommSemiring.toSemiring.{u₁} k _inst_2) (SMulWithZero.toSmulZeroClass.{u₁, u₁} k k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MulZeroClass.toSMulWithZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))))) (SMulZeroClass.toHasSmul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (SMulWithZero.toSmulZeroClass.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MulZeroClass.toHasZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MulZeroOneClass.toMulZeroClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidWithZero.toMulZeroOneClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))))) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (Module.toMulActionWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_5)))) (SMulZeroClass.toHasSmul.{u₁, u₃} k V (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (SMulWithZero.toSmulZeroClass.{u₁, u₃} k V (MulZeroClass.toHasZero.{u₁} k (MulZeroOneClass.toMulZeroClass.{u₁} k (MonoidWithZero.toMulZeroOneClass.{u₁} k (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (MulActionWithZero.toSMulWithZero.{u₁, u₃} k V (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (Module.toMulActionWithZero.{u₁, u₃} k V (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_4))))] [_inst_7 : AddCommMonoid.{u₃} W] [_inst_8 : Module.{u₁, u₃} k W (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_7] [_inst_9 : Module.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7] [_inst_10 : IsScalarTower.{u₁, max u₁ u₂, u₃} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (SMulZeroClass.toHasSmul.{u₁, max u₁ u₂} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddZeroClass.toHasZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddMonoid.toAddZeroClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddCommMonoid.toAddMonoid.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.addCommMonoid.{u₂, u₁} k G (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MonoidAlgebra.smulZeroClass.{u₁, u₂, u₁} k G k (CommSemiring.toSemiring.{u₁} k _inst_2) (SMulWithZero.toSmulZeroClass.{u₁, u₁} k k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (MulZeroClass.toSMulWithZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))))) (SMulZeroClass.toHasSmul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (SMulWithZero.toSmulZeroClass.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MulZeroClass.toHasZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MulZeroOneClass.toMulZeroClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidWithZero.toMulZeroOneClass.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))))) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (Module.toMulActionWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7 _inst_9)))) (SMulZeroClass.toHasSmul.{u₁, u₃} k W (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (SMulWithZero.toSmulZeroClass.{u₁, u₃} k W (MulZeroClass.toHasZero.{u₁} k (MulZeroOneClass.toMulZeroClass.{u₁} k (MonoidWithZero.toMulZeroOneClass.{u₁} k (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (MulActionWithZero.toSMulWithZero.{u₁, u₃} k W (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (Module.toMulActionWithZero.{u₁, u₃} k W (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_7 _inst_8))))] (f : LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) (h : forall (g : G) (v : V), Eq.{succ u₃} W (coeFn.{succ u₃, succ u₃} (LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) (fun (_x : LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) => V -> W) (LinearMap.hasCoeToFun.{u₁, u₁, u₃, u₃} k k V W (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_7 _inst_4 _inst_8 (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))) f (SMul.smul.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) V (SMulZeroClass.toHasSmul.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) V (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (SMulWithZero.toSmulZeroClass.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) V (MulZeroClass.toHasZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MulZeroOneClass.toMulZeroClass.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidWithZero.toMulZeroOneClass.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (Semiring.toMonoidWithZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))))) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (MulActionWithZero.toSMulWithZero.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) V (Semiring.toMonoidWithZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddZeroClass.toHasZero.{u₃} V (AddMonoid.toAddZeroClass.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3))) (Module.toMulActionWithZero.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_5)))) (Finsupp.single.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) g (OfNat.ofNat.{u₁} k 1 (OfNat.mk.{u₁} k 1 (One.one.{u₁} k (AddMonoidWithOne.toOne.{u₁} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u₁} k (NonAssocSemiring.toAddCommMonoidWithOne.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))))))) v)) (SMul.smul.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) W (SMulZeroClass.toHasSmul.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) W (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (SMulWithZero.toSmulZeroClass.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) W (MulZeroClass.toHasZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MulZeroOneClass.toMulZeroClass.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidWithZero.toMulZeroOneClass.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (Semiring.toMonoidWithZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))))) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (MulActionWithZero.toSMulWithZero.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) W (Semiring.toMonoidWithZero.{max u₂ u₁} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddZeroClass.toHasZero.{u₃} W (AddMonoid.toAddZeroClass.{u₃} W (AddCommMonoid.toAddMonoid.{u₃} W _inst_7))) (Module.toMulActionWithZero.{max u₂ u₁, u₃} (Finsupp.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))))) W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7 _inst_9)))) (Finsupp.single.{u₂, u₁} G k (MulZeroClass.toHasZero.{u₁} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u₁} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) g (OfNat.ofNat.{u₁} k 1 (OfNat.mk.{u₁} k 1 (One.one.{u₁} k (AddMonoidWithOne.toOne.{u₁} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u₁} k (NonAssocSemiring.toAddCommMonoidWithOne.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))))))) (coeFn.{succ u₃, succ u₃} (LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) (fun (_x : LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) => V -> W) (LinearMap.hasCoeToFun.{u₁, u₁, u₃, u₃} k k V W (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_7 _inst_4 _inst_8 (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))) f v))) (v : V), Eq.{succ u₃} W (coeFn.{succ u₃, succ u₃} (LinearMap.{max u₁ u₂, max u₁ u₂, u₃, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (RingHom.id.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toNonAssocSemiring.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) V W _inst_3 _inst_7 _inst_5 _inst_9) (fun (_x : LinearMap.{max u₁ u₂, max u₁ u₂, u₃, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (RingHom.id.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toNonAssocSemiring.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) V W _inst_3 _inst_7 _inst_5 _inst_9) => V -> W) (LinearMap.hasCoeToFun.{max u₁ u₂, max u₁ u₂, u₃, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_7 _inst_5 _inst_9 (RingHom.id.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toNonAssocSemiring.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)))) (MonoidAlgebra.equivariantOfLinearOfComm.{u₁, u₂, u₃} k G _inst_1 _inst_2 V W _inst_3 _inst_4 _inst_5 _inst_6 _inst_7 _inst_8 _inst_9 _inst_10 f h) v) (coeFn.{succ u₃, succ u₃} (LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) (fun (_x : LinearMap.{u₁, u₁, u₃, u₃} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) => V -> W) (LinearMap.hasCoeToFun.{u₁, u₁, u₃, u₃} k k V W (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_7 _inst_4 _inst_8 (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))) f v)
but is expected to have type
  forall {k : Type.{u₁}} {G : Type.{u₂}} [_inst_1 : Monoid.{u₂} G] [_inst_2 : CommSemiring.{u₁} k] {V : Type.{u₃}} {W : Type.{u₄}} [_inst_3 : AddCommMonoid.{u₃} V] [_inst_4 : Module.{u₁, u₃} k V (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3] [_inst_5 : Module.{max u₂ u₁, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3] [_inst_6 : IsScalarTower.{u₁, max u₂ u₁, u₃} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (Algebra.toSMul.{u₁, max u₁ u₂} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) _inst_2 (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (MonoidAlgebra.algebra.{u₁, u₂, u₁} k G k _inst_2 (CommSemiring.toSemiring.{u₁} k _inst_2) (Algebra.id.{u₁} k _inst_2) _inst_1)) (SMulZeroClass.toSMul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (SMulWithZero.toSMulZeroClass.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidWithZero.toZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (Module.toMulActionWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_5)))) (SMulZeroClass.toSMul.{u₁, u₃} k V (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (SMulWithZero.toSMulZeroClass.{u₁, u₃} k V (CommMonoidWithZero.toZero.{u₁} k (CommSemiring.toCommMonoidWithZero.{u₁} k _inst_2)) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (MulActionWithZero.toSMulWithZero.{u₁, u₃} k V (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (Module.toMulActionWithZero.{u₁, u₃} k V (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_4))))] [_inst_7 : AddCommMonoid.{u₄} W] [_inst_8 : Module.{u₁, u₄} k W (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_7] [_inst_9 : Module.{max u₂ u₁, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7] [_inst_10 : IsScalarTower.{u₁, max u₂ u₁, u₄} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (Algebra.toSMul.{u₁, max u₁ u₂} k (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) _inst_2 (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (MonoidAlgebra.algebra.{u₁, u₂, u₁} k G k _inst_2 (CommSemiring.toSemiring.{u₁} k _inst_2) (Algebra.id.{u₁} k _inst_2) _inst_1)) (SMulZeroClass.toSMul.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (SMulWithZero.toSMulZeroClass.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MonoidWithZero.toZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (Module.toMulActionWithZero.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7 _inst_9)))) (SMulZeroClass.toSMul.{u₁, u₄} k W (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (SMulWithZero.toSMulZeroClass.{u₁, u₄} k W (CommMonoidWithZero.toZero.{u₁} k (CommSemiring.toCommMonoidWithZero.{u₁} k _inst_2)) (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (MulActionWithZero.toSMulWithZero.{u₁, u₄} k W (Semiring.toMonoidWithZero.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)) (AddMonoid.toZero.{u₄} W (AddCommMonoid.toAddMonoid.{u₄} W _inst_7)) (Module.toMulActionWithZero.{u₁, u₄} k W (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_7 _inst_8))))] (f : LinearMap.{u₁, u₁, u₃, u₄} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) (h : forall (g : G) (v : V), Eq.{succ u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) (HSMul.hSMul.{max u₂ u₁, u₃, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V V (instHSMul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (SMulZeroClass.toSMul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (SMulWithZero.toSMulZeroClass.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidWithZero.toZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (Module.toMulActionWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_5))))) (MonoidAlgebra.single.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) g (OfNat.ofNat.{u₁} k 1 (One.toOfNat1.{u₁} k (Semiring.toOne.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) v)) (FunLike.coe.{max (succ u₃) (succ u₄), succ u₃, succ u₄} (LinearMap.{u₁, u₁, u₃, u₄} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) V (fun (_x : V) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) _x) (LinearMap.instFunLikeLinearMap.{u₁, u₁, u₃, u₄} k k V W (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_7 _inst_4 _inst_8 (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))) f (HSMul.hSMul.{max u₂ u₁, u₃, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V V (instHSMul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (SMulZeroClass.toSMul.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (SMulWithZero.toSMulZeroClass.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidWithZero.toZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddMonoid.toZero.{u₃} V (AddCommMonoid.toAddMonoid.{u₃} V _inst_3)) (Module.toMulActionWithZero.{max u₁ u₂, u₃} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_5))))) (MonoidAlgebra.single.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) g (OfNat.ofNat.{u₁} k 1 (One.toOfNat1.{u₁} k (Semiring.toOne.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) v)) (HSMul.hSMul.{max u₂ u₁, u₄, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (instHSMul.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (SMulZeroClass.toSMul.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (AddMonoid.toZero.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (AddCommMonoid.toAddMonoid.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) _inst_7)) (SMulWithZero.toSMulZeroClass.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (MonoidWithZero.toZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1))) (AddMonoid.toZero.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (AddCommMonoid.toAddMonoid.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) _inst_7)) (MulActionWithZero.toSMulWithZero.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (Semiring.toMonoidWithZero.{max u₁ u₂} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1)) (AddMonoid.toZero.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (AddCommMonoid.toAddMonoid.{u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) _inst_7)) (Module.toMulActionWithZero.{max u₁ u₂, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_7 _inst_9))))) (MonoidAlgebra.single.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) g (OfNat.ofNat.{u₁} k 1 (One.toOfNat1.{u₁} k (Semiring.toOne.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))))) (FunLike.coe.{max (succ u₃) (succ u₄), succ u₃, succ u₄} (LinearMap.{u₁, u₁, u₃, u₄} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) V (fun (_x : V) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) _x) (LinearMap.instFunLikeLinearMap.{u₁, u₁, u₃, u₄} k k V W (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_7 _inst_4 _inst_8 (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))) f v))) (v : V), Eq.{succ u₄} ((fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) v) (FunLike.coe.{max (succ u₃) (succ u₄), succ u₃, succ u₄} (LinearMap.{max u₁ u₂, max u₁ u₂, u₃, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (RingHom.id.{max u₂ u₁} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.nonAssocSemiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) (Monoid.toMulOneClass.{u₂} G _inst_1))) V W _inst_3 _inst_7 _inst_5 _inst_9) V (fun (_x : V) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) _x) (LinearMap.instFunLikeLinearMap.{max u₁ u₂, max u₁ u₂, u₃, u₄} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) V W (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) (MonoidAlgebra.semiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_1) _inst_3 _inst_7 _inst_5 _inst_9 (RingHom.id.{max u₂ u₁} (MonoidAlgebra.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2)) (MonoidAlgebra.nonAssocSemiring.{u₁, u₂} k G (CommSemiring.toSemiring.{u₁} k _inst_2) (Monoid.toMulOneClass.{u₂} G _inst_1)))) (MonoidAlgebra.equivariantOfLinearOfComm.{u₁, u₂, u₃, u₄} k G _inst_1 _inst_2 V W _inst_3 _inst_4 _inst_5 _inst_6 _inst_7 _inst_8 _inst_9 _inst_10 f h) v) (FunLike.coe.{max (succ u₃) (succ u₄), succ u₃, succ u₄} (LinearMap.{u₁, u₁, u₃, u₄} k k (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2))) V W _inst_3 _inst_7 _inst_4 _inst_8) V (fun (_x : V) => (fun (x._@.Mathlib.Algebra.Module.LinearMap._hyg.6190 : V) => W) _x) (LinearMap.instFunLikeLinearMap.{u₁, u₁, u₃, u₄} k k V W (CommSemiring.toSemiring.{u₁} k _inst_2) (CommSemiring.toSemiring.{u₁} k _inst_2) _inst_3 _inst_7 _inst_4 _inst_8 (RingHom.id.{u₁} k (Semiring.toNonAssocSemiring.{u₁} k (CommSemiring.toSemiring.{u₁} k _inst_2)))) f v)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.equivariant_of_linear_of_comm_apply MonoidAlgebra.equivariantOfLinearOfComm_applyₓ'. -/
@[simp]
theorem equivariantOfLinearOfComm_apply (v : V) : (equivariantOfLinearOfComm f h) v = f v :=
  rfl
#align monoid_algebra.equivariant_of_linear_of_comm_apply MonoidAlgebra.equivariantOfLinearOfComm_apply

end

end

section

universe ui

variable {ι : Type ui}

attribute [local reducible] MonoidAlgebra

/- warning: monoid_algebra.prod_single -> MonoidAlgebra.prod_single is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {ι : Type.{u3}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : CommMonoid.{u2} G] {s : Finset.{u3} ι} {a : ι -> G} {b : ι -> k}, Eq.{succ (max u2 u1)} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (Finset.prod.{max u2 u1, u3} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) ι (CommSemiring.toCommMonoid.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (MonoidAlgebra.commSemiring.{u1, u2} k G _inst_1 _inst_2)) s (fun (i : ι) => Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) (a i) (b i))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) (Finset.prod.{u2, u3} G ι _inst_2 s (fun (i : ι) => a i)) (Finset.prod.{u1, u3} k ι (CommSemiring.toCommMonoid.{u1} k _inst_1) s (fun (i : ι) => b i)))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} {ι : Type.{u3}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : CommMonoid.{u2} G] {s : Finset.{u3} ι} {a : ι -> G} {b : ι -> k}, Eq.{max (succ u1) (succ u2)} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Finset.prod.{max u2 u1, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) ι (CommSemiring.toCommMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.commSemiring.{u1, u2} k G _inst_1 _inst_2)) s (fun (i : ι) => MonoidAlgebra.single.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (a i) (b i))) (MonoidAlgebra.single.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Finset.prod.{u2, u3} G ι _inst_2 s (fun (i : ι) => a i)) (Finset.prod.{u1, u3} k ι (CommSemiring.toCommMonoid.{u1} k _inst_1) s (fun (i : ι) => b i)))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.prod_single MonoidAlgebra.prod_singleₓ'. -/
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
    rw [prod_cons has, ih, single_mul_single, prod_cons has, prod_cons has]
#align monoid_algebra.prod_single MonoidAlgebra.prod_single

end

section

-- We now prove some additional statements that hold for group algebras.
variable [Semiring k] [Group G]

attribute [local reducible] MonoidAlgebra

/- warning: monoid_algebra.mul_single_apply -> MonoidAlgebra.mul_single_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Group.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G) (y : G), Eq.{succ u1} k (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)))))) f (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x r)) y) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) y (Inv.inv.{u2} G (DivInvMonoid.toHasInv.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)) x))) r)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Group.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G) (y : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)))))) f (MonoidAlgebra.single.{u1, u2} k G _inst_1 x r)) y) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) y (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) x))) k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) y (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) x))) (instHMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) y (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) x))) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) y (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) x))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) y (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) x))) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) y (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) x))) _inst_1)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) y (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) x))) r)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.mul_single_apply MonoidAlgebra.mul_single_applyₓ'. -/
@[simp]
theorem mul_single_apply (f : MonoidAlgebra k G) (r : k) (x y : G) :
    (f * single x r) y = f (y * x⁻¹) * r :=
  f.mul_single_apply_aux fun a => eq_mul_inv_iff_mul_eq.symm
#align monoid_algebra.mul_single_apply MonoidAlgebra.mul_single_apply

/- warning: monoid_algebra.single_mul_apply -> MonoidAlgebra.single_mul_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Group.{u2} G] (r : k) (x : G) (f : MonoidAlgebra.{u1, u2} k G _inst_1) (y : G), Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (instHMul.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)))))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x r) f) y) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) r (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) (Inv.inv.{u2} G (DivInvMonoid.toHasInv.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)) x) y)))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Group.{u2} G] (r : k) (x : G) (f : MonoidAlgebra.{u1, u2} k G _inst_1) (y : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)))))) (MonoidAlgebra.single.{u1, u2} k G _inst_1 x r) f) y) (HMul.hMul.{u1, u1, u1} k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) x) y)) k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) r (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) x) y)))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.single_mul_apply MonoidAlgebra.single_mul_applyₓ'. -/
@[simp]
theorem single_mul_apply (r : k) (x : G) (f : MonoidAlgebra k G) (y : G) :
    (single x r * f) y = r * f (x⁻¹ * y) :=
  f.single_mul_apply_aux fun z => eq_inv_mul_iff_mul_eq.symm
#align monoid_algebra.single_mul_apply MonoidAlgebra.single_mul_apply

/- warning: monoid_algebra.mul_apply_left -> MonoidAlgebra.mul_apply_left is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Group.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (g : MonoidAlgebra.{u1, u2} k G _inst_1) (x : G), Eq.{succ u1} k (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)))))) f g) x) (Finsupp.sum.{u2, u1, u1} G k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) f (fun (a : G) (b : k) => HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) b (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) g (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) (Inv.inv.{u2} G (DivInvMonoid.toHasInv.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)) a) x))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Group.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (g : MonoidAlgebra.{u1, u2} k G _inst_1) (x : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)))))) f g) x) (Finsupp.sum.{u2, u1, u1} G k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) f (fun (a : G) (b : k) => HMul.hMul.{u1, u1, u1} k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) a) x)) k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) b (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) g (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) a) x))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.mul_apply_left MonoidAlgebra.mul_apply_leftₓ'. -/
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, f.sum_single]
    _ = _ := by simp only [single_mul_apply, Finsupp.sum]

#align monoid_algebra.mul_apply_left MonoidAlgebra.mul_apply_left

/- warning: monoid_algebra.mul_apply_right -> MonoidAlgebra.mul_apply_right is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Group.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (g : MonoidAlgebra.{u1, u2} k G _inst_1) (x : G), Eq.{succ u1} k (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)))))) f g) x) (Finsupp.sum.{u2, u1, u1} G k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) g (fun (a : G) (b : k) => HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (coeFn.{succ (max u1 u2), max (succ u2) (succ u1)} (MonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : MonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (MonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) x (Inv.inv.{u2} G (DivInvMonoid.toHasInv.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)) a))) b))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Group.{u2} G] (f : MonoidAlgebra.{u1, u2} k G _inst_1) (g : MonoidAlgebra.{u1, u2} k G _inst_1) (x : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2)))))) f g) x) (Finsupp.sum.{u2, u1, u1} G k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) g (fun (a : G) (b : k) => HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) x (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) a))) k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) x (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) a))) (instHMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) x (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) a))) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) x (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) a))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) x (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) a))) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) x (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) a))) _inst_1)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f (HMul.hMul.{u2, u2, u2} G G G (instHMul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G (DivInvMonoid.toMonoid.{u2} G (Group.toDivInvMonoid.{u2} G _inst_2))))) x (Inv.inv.{u2} G (InvOneClass.toInv.{u2} G (DivInvOneMonoid.toInvOneClass.{u2} G (DivisionMonoid.toDivInvOneMonoid.{u2} G (Group.toDivisionMonoid.{u2} G _inst_2)))) a))) b))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.mul_apply_right MonoidAlgebra.mul_apply_rightₓ'. -/
-- If we'd assumed `comm_semiring`, we could deduce this from `mul_apply_left`.
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, g.sum_single]
    _ = _ := by simp only [mul_single_apply, Finsupp.sum]

#align monoid_algebra.mul_apply_right MonoidAlgebra.mul_apply_right

end

section Opposite

open Finsupp MulOpposite

variable [Semiring k]

/- warning: monoid_algebra.op_ring_equiv -> MonoidAlgebra.opRingEquiv is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Monoid.{u2} G], RingEquiv.{max u1 u2, max u1 u2} (MulOpposite.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1)) (MonoidAlgebra.{u1, u2} (MulOpposite.{u1} k) (MulOpposite.{u2} G) (MulOpposite.semiring.{u1} k _inst_1)) (MulOpposite.hasMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulOpposite.hasAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (Distrib.toHasAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)))))) (MonoidAlgebra.mul.{u1, u2} (MulOpposite.{u1} k) (MulOpposite.{u2} G) (MulOpposite.semiring.{u1} k _inst_1) (MulOpposite.hasMul.{u2} G (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)))) (Distrib.toHasAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} (MulOpposite.{u1} k) (MulOpposite.{u2} G) (MulOpposite.semiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (MonoidAlgebra.{u1, u2} (MulOpposite.{u1} k) (MulOpposite.{u2} G) (MulOpposite.semiring.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} (MulOpposite.{u1} k) (MulOpposite.{u2} G) (MulOpposite.semiring.{u1} k _inst_1) (MulOpposite.hasMul.{u2} G (MulOneClass.toHasMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Monoid.{u2} G], RingEquiv.{max u2 u1, max u2 u1} (MulOpposite.{max u2 u1} (MonoidAlgebra.{u1, u2} k G _inst_1)) (MonoidAlgebra.{u1, u2} (MulOpposite.{u1} k) (MulOpposite.{u2} G) (MulOpposite.semiring.{u1} k _inst_1)) (MulOpposite.mul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)))) (MonoidAlgebra.mul.{u1, u2} (MulOpposite.{u1} k) (MulOpposite.{u2} G) (MulOpposite.semiring.{u1} k _inst_1) (MulOpposite.mul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)))) (MulOpposite.add.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (Distrib.toAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)))))) (Distrib.toAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} (MulOpposite.{u1} k) (MulOpposite.{u2} G) (MulOpposite.semiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (MonoidAlgebra.{u1, u2} (MulOpposite.{u1} k) (MulOpposite.{u2} G) (MulOpposite.semiring.{u1} k _inst_1)) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} (MulOpposite.{u1} k) (MulOpposite.{u2} G) (MulOpposite.semiring.{u1} k _inst_1) (MulOpposite.mul.{u2} G (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2))))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.op_ring_equiv MonoidAlgebra.opRingEquivₓ'. -/
/-- The opposite of an `monoid_algebra R I` equivalent as a ring to
the `monoid_algebra Rᵐᵒᵖ Iᵐᵒᵖ` over the opposite ring, taking elements to their opposite. -/
@[simps (config := { simpRhs := true })]
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
      dsimp only [[anonymous], ← AddEquiv.coe_toAddMonoidHom]
      rw [AddMonoidHom.map_mul_iff]
      ext (i₁ r₁ i₂ r₂) : 6
      simp }
#align monoid_algebra.op_ring_equiv MonoidAlgebra.opRingEquiv

#print MonoidAlgebra.opRingEquiv_single /-
@[simp]
theorem opRingEquiv_single [Monoid G] (r : k) (x : G) :
    MonoidAlgebra.opRingEquiv (op (single x r)) = single (op x) (op r) := by simp
#align monoid_algebra.op_ring_equiv_single MonoidAlgebra.opRingEquiv_single
-/

#print MonoidAlgebra.opRingEquiv_symm_single /-
@[simp]
theorem opRingEquiv_symm_single [Monoid G] (r : kᵐᵒᵖ) (x : Gᵐᵒᵖ) :
    MonoidAlgebra.opRingEquiv.symm (single x r) = op (single x.unop r.unop) := by simp
#align monoid_algebra.op_ring_equiv_symm_single MonoidAlgebra.opRingEquiv_symm_single
-/

end Opposite

section Submodule

variable {k G} [CommSemiring k] [Monoid G]

variable {V : Type _} [AddCommMonoid V]

variable [Module k V] [Module (MonoidAlgebra k G) V] [IsScalarTower k (MonoidAlgebra k G) V]

/- warning: monoid_algebra.submodule_of_smul_mem -> MonoidAlgebra.submoduleOfSmulMem is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Monoid.{u2} G] {V : Type.{u3}} [_inst_3 : AddCommMonoid.{u3} V] [_inst_4 : Module.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3] [_inst_5 : Module.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3] [_inst_6 : IsScalarTower.{u1, max u1 u2, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (SMulZeroClass.toHasSmul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoid.toAddZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.addCommMonoid.{u2, u1} k G (CommSemiring.toSemiring.{u1} k _inst_1))))) (MonoidAlgebra.smulZeroClass.{u1, u2, u1} k G k (CommSemiring.toSemiring.{u1} k _inst_1) (SMulWithZero.toSmulZeroClass.{u1, u1} k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))))) (SMulZeroClass.toHasSmul.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (SMulWithZero.toSmulZeroClass.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (MulZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MulZeroOneClass.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidWithZero.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))))) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (MulActionWithZero.toSMulWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (Module.toMulActionWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 _inst_5)))) (SMulZeroClass.toHasSmul.{u1, u3} k V (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (SMulWithZero.toSmulZeroClass.{u1, u3} k V (MulZeroClass.toHasZero.{u1} k (MulZeroOneClass.toMulZeroClass.{u1} k (MonoidWithZero.toMulZeroOneClass.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (MulActionWithZero.toSMulWithZero.{u1, u3} k V (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (Module.toMulActionWithZero.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4))))] (W : Submodule.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4), (forall (g : G) (v : V), (Membership.Mem.{u3, u3} V (Submodule.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4) (SetLike.hasMem.{u3, u3} (Submodule.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4) V (Submodule.setLike.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4)) v W) -> (Membership.Mem.{u3, u3} V (Submodule.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4) (SetLike.hasMem.{u3, u3} (Submodule.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4) V (Submodule.setLike.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4)) (SMul.smul.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (SMulZeroClass.toHasSmul.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (SMulWithZero.toSmulZeroClass.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (MulZeroClass.toHasZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MulZeroOneClass.toMulZeroClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidWithZero.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))))) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (MulActionWithZero.toSMulWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)) (AddZeroClass.toHasZero.{u3} V (AddMonoid.toAddZeroClass.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3))) (Module.toMulActionWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 _inst_5)))) (coeFn.{max (succ (max u1 u2)) (succ u2), max (succ u2) (succ (max u1 u2))} (MonoidHom.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) (fun (_x : MonoidHom.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) => G -> (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1))) (MonoidHom.hasCoeToFun.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) (MonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)) g) v) W)) -> (Submodule.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 _inst_5)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Monoid.{u2} G] {V : Type.{u3}} [_inst_3 : AddCommMonoid.{u3} V] [_inst_4 : Module.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3] [_inst_5 : Module.{max u2 u1, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3] [_inst_6 : IsScalarTower.{u1, max u2 u1, u3} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (Algebra.toSMul.{u1, max u1 u2} k (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _inst_1 (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) (MonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2)) (SMulZeroClass.toSMul.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (SMulWithZero.toSMulZeroClass.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (MonoidWithZero.toZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (MulActionWithZero.toSMulWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (Semiring.toMonoidWithZero.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (Module.toMulActionWithZero.{max u1 u2, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 _inst_5)))) (SMulZeroClass.toSMul.{u1, u3} k V (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (SMulWithZero.toSMulZeroClass.{u1, u3} k V (CommMonoidWithZero.toZero.{u1} k (CommSemiring.toCommMonoidWithZero.{u1} k _inst_1)) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (MulActionWithZero.toSMulWithZero.{u1, u3} k V (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (Module.toMulActionWithZero.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4))))] (W : Submodule.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4), (forall (g : G) (v : V), (Membership.mem.{u3, u3} V (Submodule.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4) (SetLike.instMembership.{u3, u3} (Submodule.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4) V (Submodule.setLike.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4)) v W) -> (Membership.mem.{u3, u3} V (Submodule.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4) (SetLike.instMembership.{u3, u3} (Submodule.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4) V (Submodule.setLike.{u1, u3} k V (CommSemiring.toSemiring.{u1} k _inst_1) _inst_3 _inst_4)) (HSMul.hSMul.{max u1 u2, u3, u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) g) V V (instHSMul.{max u1 u2, u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) g) V (SMulZeroClass.toSMul.{max u1 u2, u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) g) V (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (SMulWithZero.toSMulZeroClass.{max u1 u2, u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) g) V (MonoidWithZero.toZero.{max u1 u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) g) (Semiring.toMonoidWithZero.{max u1 u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) g) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (MulActionWithZero.toSMulWithZero.{max u1 u2, u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) g) V (Semiring.toMonoidWithZero.{max u1 u2} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) g) (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)) (AddMonoid.toZero.{u3} V (AddCommMonoid.toAddMonoid.{u3} V _inst_3)) (Module.toMulActionWithZero.{max u1 u2, u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) g) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 _inst_5))))) (FunLike.coe.{max (succ u1) (succ u2), succ u2, max (succ u1) (succ u2)} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : G) => MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _x) (MulHomClass.toFunLike.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MulOneClass.toMul.{u2} G (Monoid.toMulOneClass.{u2} G _inst_2)) (MulOneClass.toMul.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) (MonoidHomClass.toMulHomClass.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))) G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)))) (MonoidHom.monoidHomClass.{u2, max u1 u2} G (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Monoid.toMulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2))))))) (MonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Monoid.toMulOneClass.{u2} G _inst_2)) g) v) W)) -> (Submodule.{max u2 u1, u3} (MonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) V (MonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 _inst_5)
Case conversion may be inaccurate. Consider using '#align monoid_algebra.submodule_of_smul_mem MonoidAlgebra.submoduleOfSmulMemₓ'. -/
/-- A submodule over `k` which is stable under scalar multiplication by elements of `G` is a
submodule over `monoid_algebra k G`  -/
def submoduleOfSmulMem (W : Submodule k V) (h : ∀ (g : G) (v : V), v ∈ W → of k G g • v ∈ W) :
    Submodule (MonoidAlgebra k G) V where
  carrier := W
  zero_mem' := W.zero_mem'
  add_mem' _ _ := W.add_mem'
  smul_mem' := by
    intro f v hv
    rw [← Finsupp.sum_single f, Finsupp.sum, Finset.sum_smul]
    simp_rw [← smul_of, smul_assoc]
    exact Submodule.sum_smul_mem W _ fun g _ => h g v hv
#align monoid_algebra.submodule_of_smul_mem MonoidAlgebra.submoduleOfSmulMem

end Submodule

end MonoidAlgebra

/-! ### Additive monoids -/

section

variable [Semiring k]

#print AddMonoidAlgebra /-
/-- The monoid algebra over a semiring `k` generated by the additive monoid `G`.
It is the type of finite formal `k`-linear combinations of terms of `G`,
endowed with the convolution product.
-/
def AddMonoidAlgebra :=
  G →₀ k deriving Inhabited, AddCommMonoid
#align add_monoid_algebra AddMonoidAlgebra
-/

instance : CoeFun (AddMonoidAlgebra k G) fun _ => G → k :=
  Finsupp.coeFun

end

namespace AddMonoidAlgebra

variable {k G}

section

variable [Semiring k] [NonUnitalNonAssocSemiring R]

/- warning: add_monoid_algebra.lift_nc -> AddMonoidAlgebra.liftNC is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : NonUnitalNonAssocSemiring.{u3} R], (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) -> ((Multiplicative.{u2} G) -> R) -> (AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : NonUnitalNonAssocSemiring.{u3} R], (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) -> ((Multiplicative.{u2} G) -> R) -> (AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u1, u2} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.lift_nc AddMonoidAlgebra.liftNCₓ'. -/
/-- A non-commutative version of `add_monoid_algebra.lift`: given a additive homomorphism `f : k →+
R` and a map `g : multiplicative G → R`, returns the additive
homomorphism from `add_monoid_algebra k G` such that `lift_nc f g (single a b) = f b * g a`. If `f`
is a ring homomorphism and the range of either `f` or `g` is in center of `R`, then the result is a
ring homomorphism.  If `R` is a `k`-algebra and `f = algebra_map k R`, then the result is an algebra
homomorphism called `add_monoid_algebra.lift`. -/
def liftNC (f : k →+ R) (g : Multiplicative G → R) : AddMonoidAlgebra k G →+ R :=
  liftAddHom fun x : G => (AddMonoidHom.mulRight (g <| Multiplicative.ofAdd x)).comp f
#align add_monoid_algebra.lift_nc AddMonoidAlgebra.liftNC

/- warning: add_monoid_algebra.lift_nc_single -> AddMonoidAlgebra.liftNC_single is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : NonUnitalNonAssocSemiring.{u3} R] (f : AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) (g : (Multiplicative.{u2} G) -> R) (a : G) (b : k), Eq.{succ u3} R (coeFn.{max (succ u3) (succ (max u2 u1)), max (succ (max u2 u1)) (succ u3)} (AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) (fun (_x : AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) (AddMonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 _inst_2 f g) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a b)) (HMul.hMul.{u3, u3, u3} R R R (instHMul.{u3} R (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R _inst_2))) (coeFn.{max (succ u3) (succ u1), max (succ u1) (succ u3)} (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) (fun (_x : AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) => k -> R) (AddMonoidHom.hasCoeToFun.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R _inst_2)))) f b) (g (coeFn.{succ u2, succ u2} (Equiv.{succ u2, succ u2} G (Multiplicative.{u2} G)) (fun (_x : Equiv.{succ u2, succ u2} G (Multiplicative.{u2} G)) => G -> (Multiplicative.{u2} G)) (Equiv.hasCoeToFun.{succ u2, succ u2} G (Multiplicative.{u2} G)) (Multiplicative.ofAdd.{u2} G) a)))
but is expected to have type
  forall {k : Type.{u2}} {G : Type.{u3}} {R : Type.{u1}} [_inst_1 : Semiring.{u2} k] [_inst_2 : NonUnitalNonAssocSemiring.{u1} R] (f : AddMonoidHom.{u2, u1} k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (g : (Multiplicative.{u3} G) -> R) (a : G) (b : k), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) (AddMonoidAlgebra.single.{u2, u3} k G _inst_1 a b)) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (AddMonoidHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (AddMonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddZeroClass.toAdd.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (AddMonoidHomClass.toAddHomClass.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2))) (AddMonoidHom.addMonoidHomClass.{max u2 u3, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))))) (AddMonoidAlgebra.liftNC.{u2, u3, u1} k G R _inst_1 _inst_2 f g) (AddMonoidAlgebra.single.{u2, u3} k G _inst_1 a b)) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : k) => R) b) R ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : k) => R) b) (instHMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : k) => R) b) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : k) => R) b) _inst_2)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (AddMonoidHom.{u2, u1} k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : k) => R) _x) (AddHomClass.toFunLike.{max u2 u1, u2, u1} (AddMonoidHom.{u2, u1} k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) k R (AddZeroClass.toAdd.{u2} k (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1)))))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) (AddMonoidHomClass.toAddHomClass.{max u2 u1, u2, u1} (AddMonoidHom.{u2, u1} k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))) k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2))) (AddMonoidHom.addMonoidHomClass.{u2, u1} k R (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R _inst_2)))))) f b) (g (FunLike.coe.{succ u3, succ u3, succ u3} (Equiv.{succ u3, succ u3} G (Multiplicative.{u3} G)) G (fun (_x : G) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : G) => Multiplicative.{u3} G) _x) (Equiv.instFunLikeEquiv.{succ u3, succ u3} G (Multiplicative.{u3} G)) (Multiplicative.ofAdd.{u3} G) a)))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.lift_nc_single AddMonoidAlgebra.liftNC_singleₓ'. -/
@[simp]
theorem liftNC_single (f : k →+ R) (g : Multiplicative G → R) (a : G) (b : k) :
    liftNC f g (single a b) = f b * g (Multiplicative.ofAdd a) :=
  liftAddHom_apply_single _ _ _
#align add_monoid_algebra.lift_nc_single AddMonoidAlgebra.liftNC_single

end

section Mul

variable [Semiring k] [Add G]

/-- The product of `f g : add_monoid_algebra k G` is the finitely supported function
  whose value at `a` is the sum of `f x * g y` over all pairs `x, y`
  such that `x + y = a`. (Think of the product of multivariate
  polynomials where `α` is the additive monoid of monomial exponents.) -/
instance : Mul (AddMonoidAlgebra k G) :=
  ⟨fun f g => f.Sum fun a₁ b₁ => g.Sum fun a₂ b₂ => single (a₁ + a₂) (b₁ * b₂)⟩

/- warning: add_monoid_algebra.mul_def -> AddMonoidAlgebra.mul_def is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] {f : AddMonoidAlgebra.{u1, u2} k G _inst_1} {g : AddMonoidAlgebra.{u1, u2} k G _inst_1}, Eq.{succ (max u2 u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) f g) (Finsupp.sum.{u2, u1, max u2 u1} G k (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1) f (fun (a₁ : G) (b₁ : k) => Finsupp.sum.{u2, u1, max u2 u1} G k (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1) g (fun (a₂ : G) (b₂ : k) => Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) a₁ a₂) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) b₁ b₂))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] {f : AddMonoidAlgebra.{u1, u2} k G _inst_1} {g : AddMonoidAlgebra.{u1, u2} k G _inst_1}, Eq.{max (succ u1) (succ u2)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) f g) (Finsupp.sum.{u2, u1, max u2 u1} G k (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.addCommMonoid.{u1, u2} k G _inst_1) f (fun (a₁ : G) (b₁ : k) => Finsupp.sum.{u2, u1, max u2 u1} G k (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.addCommMonoid.{u1, u2} k G _inst_1) g (fun (a₂ : G) (b₂ : k) => AddMonoidAlgebra.single.{u1, u2} k G _inst_1 (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) a₁ a₂) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) b₁ b₂))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.mul_def AddMonoidAlgebra.mul_defₓ'. -/
theorem mul_def {f g : AddMonoidAlgebra k G} :
    f * g = f.Sum fun a₁ b₁ => g.Sum fun a₂ b₂ => single (a₁ + a₂) (b₁ * b₂) :=
  rfl
#align add_monoid_algebra.mul_def AddMonoidAlgebra.mul_def

instance : NonUnitalNonAssocSemiring (AddMonoidAlgebra k G) :=
  { Finsupp.addCommMonoid with
    zero := 0
    mul := (· * ·)
    add := (· + ·)
    left_distrib := fun f g h => by
      haveI := Classical.decEq G <;>
        simp only [mul_def, sum_add_index, mul_add, MulZeroClass.mul_zero, single_zero, single_add,
          eq_self_iff_true, forall_true_iff, forall₃_true_iff, sum_add]
    right_distrib := fun f g h => by
      haveI := Classical.decEq G <;>
        simp only [mul_def, sum_add_index, add_mul, MulZeroClass.mul_zero, MulZeroClass.zero_mul,
          single_zero, single_add, eq_self_iff_true, forall_true_iff, forall₃_true_iff, sum_zero,
          sum_add]
    zero_mul := fun f => by simp only [mul_def, sum_zero_index]
    mul_zero := fun f => by simp only [mul_def, sum_zero_index, sum_zero]
    nsmul := fun n f => n • f
    nsmul_zero := by
      intros
      ext
      simp [-nsmul_eq_mul, add_smul]
    nsmul_succ := by
      intros
      ext
      simp [-nsmul_eq_mul, Nat.succ_eq_one_add, add_smul] }

variable [Semiring R]

/- warning: add_monoid_algebra.lift_nc_mul -> AddMonoidAlgebra.liftNC_mul is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] [_inst_3 : Semiring.{u3} R] {g_hom : Type.{u4}} [_inst_4 : MulHomClass.{u4, u2, u3} g_hom (Multiplicative.{u2} G) R (Multiplicative.hasMul.{u2} G _inst_2) (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))] (f : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (g : g_hom) (a : AddMonoidAlgebra.{u1, u2} k G _inst_1) (b : AddMonoidAlgebra.{u1, u2} k G _inst_1), (forall {x : G} {y : G}, (Membership.Mem.{u2, u2} G (Finset.{u2} G) (Finset.hasMem.{u2} G) y (Finsupp.support.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a)) -> (Commute.{u3} R (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => k -> R) (RingHom.hasCoeToFun.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) b x)) (coeFn.{succ u4, max (succ u2) (succ u3)} g_hom (fun (_x : g_hom) => (Multiplicative.{u2} G) -> R) (FunLike.hasCoeToFun.{succ u4, succ u2, succ u3} g_hom (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => R) (MulHomClass.toFunLike.{u4, u2, u3} g_hom (Multiplicative.{u2} G) R (Multiplicative.hasMul.{u2} G _inst_2) (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) _inst_4)) g (coeFn.{succ u2, succ u2} (Equiv.{succ u2, succ u2} G (Multiplicative.{u2} G)) (fun (_x : Equiv.{succ u2, succ u2} G (Multiplicative.{u2} G)) => G -> (Multiplicative.{u2} G)) (Equiv.hasCoeToFun.{succ u2, succ u2} G (Multiplicative.{u2} G)) (Multiplicative.ofAdd.{u2} G) y)))) -> (Eq.{succ u3} R (coeFn.{max (succ u3) (succ (max u2 u1)), max (succ (max u2 u1)) (succ u3)} (AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (fun (_x : AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (coeFn.{succ u4, max (succ u2) (succ u3)} g_hom (fun (_x : g_hom) => (Multiplicative.{u2} G) -> R) (FunLike.hasCoeToFun.{succ u4, succ u2, succ u3} g_hom (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => R) (MulHomClass.toFunLike.{u4, u2, u3} g_hom (Multiplicative.{u2} G) R (Multiplicative.hasMul.{u2} G _inst_2) (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) _inst_4)) g)) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) a b)) (HMul.hMul.{u3, u3, u3} R R R (instHMul.{u3} R (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (coeFn.{max (succ u3) (succ (max u2 u1)), max (succ (max u2 u1)) (succ u3)} (AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (fun (_x : AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (coeFn.{succ u4, max (succ u2) (succ u3)} g_hom (fun (_x : g_hom) => (Multiplicative.{u2} G) -> R) (FunLike.hasCoeToFun.{succ u4, succ u2, succ u3} g_hom (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => R) (MulHomClass.toFunLike.{u4, u2, u3} g_hom (Multiplicative.{u2} G) R (Multiplicative.hasMul.{u2} G _inst_2) (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) _inst_4)) g)) a) (coeFn.{max (succ u3) (succ (max u2 u1)), max (succ (max u2 u1)) (succ u3)} (AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (fun (_x : AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (coeFn.{succ u4, max (succ u2) (succ u3)} g_hom (fun (_x : g_hom) => (Multiplicative.{u2} G) -> R) (FunLike.hasCoeToFun.{succ u4, succ u2, succ u3} g_hom (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => R) (MulHomClass.toFunLike.{u4, u2, u3} g_hom (Multiplicative.{u2} G) R (Multiplicative.hasMul.{u2} G _inst_2) (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) _inst_4)) g)) b)))
but is expected to have type
  forall {k : Type.{u3}} {G : Type.{u4}} {R : Type.{u1}} [_inst_1 : Semiring.{u3} k] [_inst_2 : Add.{u4} G] [_inst_3 : Semiring.{u1} R] {g_hom : Type.{u2}} [_inst_4 : MulHomClass.{u2, u4, u1} g_hom (Multiplicative.{u4} G) R (Multiplicative.mul.{u4} G _inst_2) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))] (f : RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (g : g_hom) (a : AddMonoidAlgebra.{u3, u4} k G _inst_1) (b : AddMonoidAlgebra.{u3, u4} k G _inst_1), (forall {x : G} {y : G}, (Membership.mem.{u4, u4} G (Finset.{u4} G) (Finset.instMembershipFinset.{u4} G) y (Finsupp.support.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1)) a)) -> (Commute.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) (FunLike.coe.{max (succ u4) (succ u3), succ u4, succ u3} (Finsupp.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) G (fun (a : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) a) (Finsupp.funLike.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) b x)) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) (FunLike.coe.{max (succ u4) (succ u3), succ u4, succ u3} (Finsupp.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) G (fun (a : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) a) (Finsupp.funLike.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) b x)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) (FunLike.coe.{max (succ u4) (succ u3), succ u4, succ u3} (Finsupp.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) G (fun (a : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) a) (Finsupp.funLike.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) b x)) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) (FunLike.coe.{max (succ u4) (succ u3), succ u4, succ u3} (Finsupp.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) G (fun (a : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) a) (Finsupp.funLike.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) b x)) _inst_3))) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) _x) (MulHomClass.toFunLike.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (NonUnitalNonAssocSemiring.toMul.{u3} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) f (FunLike.coe.{max (succ u4) (succ u3), succ u4, succ u3} (Finsupp.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u4, u3} G k (MonoidWithZero.toZero.{u3} k (Semiring.toMonoidWithZero.{u3} k _inst_1))) b x)) (FunLike.coe.{succ u2, succ u4, succ u1} g_hom (Multiplicative.{u4} G) (fun (_x : Multiplicative.{u4} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u4} G) => R) _x) (MulHomClass.toFunLike.{u2, u4, u1} g_hom (Multiplicative.{u4} G) R (Multiplicative.mul.{u4} G _inst_2) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) _inst_4) g (FunLike.coe.{succ u4, succ u4, succ u4} (Equiv.{succ u4, succ u4} G (Multiplicative.{u4} G)) G (fun (_x : G) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : G) => Multiplicative.{u4} G) _x) (Equiv.instFunLikeEquiv.{succ u4, succ u4} G (Multiplicative.{u4} G)) (Multiplicative.ofAdd.{u4} G) y)))) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) (HMul.hMul.{max u3 u4, max u3 u4, max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.{u3, u4} k G _inst_1) (instHMul.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.hasMul.{u3, u4} k G _inst_1 _inst_2)) a b)) (FunLike.coe.{max (max (succ u3) (succ u4)) (succ u1), max (succ u3) (succ u4), succ u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u3, u4} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddZeroClass.toAdd.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidHomClass.toAddHomClass.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidHom.addMonoidHomClass.{max u3 u4, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))))) (AddMonoidAlgebra.liftNC.{u3, u4, u1} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidHomClass.toAddMonoidHom.{u3, u1, max u3 u1} k R (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoid.toAddZeroClass.{u3} k (AddMonoidWithOne.toAddMonoid.{u3} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} k (NonAssocSemiring.toAddCommMonoidWithOne.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (FunLike.coe.{succ u2, succ u4, succ u1} g_hom (Multiplicative.{u4} G) (fun (_x : Multiplicative.{u4} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u4} G) => R) _x) (MulHomClass.toFunLike.{u2, u4, u1} g_hom (Multiplicative.{u4} G) R (Multiplicative.mul.{u4} G _inst_2) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) _inst_4) g)) (HMul.hMul.{max u3 u4, max u3 u4, max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.{u3, u4} k G _inst_1) (instHMul.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.hasMul.{u3, u4} k G _inst_1 _inst_2)) a b)) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) a) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) b) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) a) (instHMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) a) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) a) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) a) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) a) _inst_3)))) (FunLike.coe.{max (max (succ u3) (succ u4)) (succ u1), max (succ u3) (succ u4), succ u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u3, u4} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddZeroClass.toAdd.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidHomClass.toAddHomClass.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidHom.addMonoidHomClass.{max u3 u4, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))))) (AddMonoidAlgebra.liftNC.{u3, u4, u1} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidHomClass.toAddMonoidHom.{u3, u1, max u3 u1} k R (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoid.toAddZeroClass.{u3} k (AddMonoidWithOne.toAddMonoid.{u3} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} k (NonAssocSemiring.toAddCommMonoidWithOne.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (FunLike.coe.{succ u2, succ u4, succ u1} g_hom (Multiplicative.{u4} G) (fun (_x : Multiplicative.{u4} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u4} G) => R) _x) (MulHomClass.toFunLike.{u2, u4, u1} g_hom (Multiplicative.{u4} G) R (Multiplicative.mul.{u4} G _inst_2) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) _inst_4) g)) a) (FunLike.coe.{max (max (succ u3) (succ u4)) (succ u1), max (succ u3) (succ u4), succ u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u3, u4} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddZeroClass.toAdd.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidHomClass.toAddHomClass.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidHom.addMonoidHomClass.{max u3 u4, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))))) (AddMonoidAlgebra.liftNC.{u3, u4, u1} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidHomClass.toAddMonoidHom.{u3, u1, max u3 u1} k R (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoid.toAddZeroClass.{u3} k (AddMonoidWithOne.toAddMonoid.{u3} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} k (NonAssocSemiring.toAddCommMonoidWithOne.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (FunLike.coe.{succ u2, succ u4, succ u1} g_hom (Multiplicative.{u4} G) (fun (_x : Multiplicative.{u4} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u4} G) => R) _x) (MulHomClass.toFunLike.{u2, u4, u1} g_hom (Multiplicative.{u4} G) R (Multiplicative.mul.{u4} G _inst_2) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) _inst_4) g)) b)))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.lift_nc_mul AddMonoidAlgebra.liftNC_mulₓ'. -/
theorem liftNC_mul {g_hom : Type _} [MulHomClass g_hom (Multiplicative G) R] (f : k →+* R)
    (g : g_hom) (a b : AddMonoidAlgebra k G)
    (h_comm : ∀ {x y}, y ∈ a.support → Commute (f (b x)) (g <| Multiplicative.ofAdd y)) :
    liftNC (f : k →+ R) g (a * b) = liftNC (f : k →+ R) g a * liftNC (f : k →+ R) g b :=
  (MonoidAlgebra.liftNC_mul f g _ _ @h_comm : _)
#align add_monoid_algebra.lift_nc_mul AddMonoidAlgebra.liftNC_mul

end Mul

section One

variable [Semiring k] [Zero G] [NonAssocSemiring R]

/-- The unit of the multiplication is `single 1 1`, i.e. the function
  that is `1` at `0` and zero elsewhere. -/
instance : One (AddMonoidAlgebra k G) :=
  ⟨single 0 1⟩

/- warning: add_monoid_algebra.one_def -> AddMonoidAlgebra.one_def is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Zero.{u2} G], Eq.{max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (OfNat.ofNat.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) 1 (OfNat.mk.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) 1 (One.one.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.one.{u1, u2} k G _inst_1 _inst_2)))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (OfNat.ofNat.{u2} G 0 (OfNat.mk.{u2} G 0 (Zero.zero.{u2} G _inst_2))) (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Zero.{u2} G], Eq.{max (succ u1) (succ u2)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (OfNat.ofNat.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) 1 (One.toOfNat1.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.one.{u1, u2} k G _inst_1 _inst_2))) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 (OfNat.ofNat.{u2} G 0 (Zero.toOfNat0.{u2} G _inst_2)) (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k _inst_1))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.one_def AddMonoidAlgebra.one_defₓ'. -/
theorem one_def : (1 : AddMonoidAlgebra k G) = single 0 1 :=
  rfl
#align add_monoid_algebra.one_def AddMonoidAlgebra.one_def

/- warning: add_monoid_algebra.lift_nc_one -> AddMonoidAlgebra.liftNC_one is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Zero.{u2} G] [_inst_3 : NonAssocSemiring.{u3} R] {g_hom : Type.{u4}} [_inst_4 : OneHomClass.{u4, u2, u3} g_hom (Multiplicative.{u2} G) R (Multiplicative.hasOne.{u2} G _inst_2) (AddMonoidWithOne.toOne.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_3)))] (f : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) _inst_3) (g : g_hom), Eq.{succ u3} R (coeFn.{max (succ u3) (succ (max u2 u1)), max (succ (max u2 u1)) (succ u3)} (AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R _inst_3))))) (fun (_x : AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R _inst_3))))) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R _inst_3))))) (AddMonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R _inst_3) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) _inst_3) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_3))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) _inst_3) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_3))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) _inst_3) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_3))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) _inst_3) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_3)))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) _inst_3) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) _inst_3 (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) _inst_3))))) f) (coeFn.{succ u4, max (succ u2) (succ u3)} g_hom (fun (_x : g_hom) => (Multiplicative.{u2} G) -> R) (FunLike.hasCoeToFun.{succ u4, succ u2, succ u3} g_hom (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => R) (OneHomClass.toFunLike.{u4, u2, u3} g_hom (Multiplicative.{u2} G) R (Multiplicative.hasOne.{u2} G _inst_2) (AddMonoidWithOne.toOne.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_3))) _inst_4)) g)) (OfNat.ofNat.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) 1 (OfNat.mk.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) 1 (One.one.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.one.{u1, u2} k G _inst_1 _inst_2))))) (OfNat.ofNat.{u3} R 1 (OfNat.mk.{u3} R 1 (One.one.{u3} R (AddMonoidWithOne.toOne.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R _inst_3))))))
but is expected to have type
  forall {k : Type.{u3}} {G : Type.{u4}} {R : Type.{u1}} [_inst_1 : Semiring.{u3} k] [_inst_2 : Zero.{u4} G] [_inst_3 : NonAssocSemiring.{u1} R] {g_hom : Type.{u2}} [_inst_4 : OneHomClass.{u2, u4, u1} g_hom (Multiplicative.{u4} G) R (instOneMultiplicative.{u4} G _inst_2) (NonAssocSemiring.toOne.{u1} R _inst_3)] (f : RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) _inst_3) (g : g_hom), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) (OfNat.ofNat.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) 1 (One.toOfNat1.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.one.{u3, u4} k G _inst_1 _inst_2)))) (FunLike.coe.{max (max (succ u3) (succ u4)) (succ u1), max (succ u3) (succ u4), succ u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u3, u4} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddZeroClass.toAdd.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidHomClass.toAddHomClass.{max (max u3 u4) u1, max u3 u4, u1} (AddMonoidHom.{max u4 u3, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_3)))) (AddMonoidHom.addMonoidHomClass.{max u3 u4, u1} (AddMonoidAlgebra.{u3, u4} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u3, u4} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_3))))))) (AddMonoidAlgebra.liftNC.{u3, u4, u1} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R _inst_3) (AddMonoidHomClass.toAddMonoidHom.{u3, u1, max u3 u1} k R (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) _inst_3) (AddMonoid.toAddZeroClass.{u3} k (AddMonoidWithOne.toAddMonoid.{u3} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} k (NonAssocSemiring.toAddCommMonoidWithOne.{u3} k (Semiring.toNonAssocSemiring.{u3} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R _inst_3)))) (RingHomClass.toAddMonoidHomClass.{max u3 u1, u3, u1} (RingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) _inst_3) k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) _inst_3 (RingHom.instRingHomClassRingHom.{u3, u1} k R (Semiring.toNonAssocSemiring.{u3} k _inst_1) _inst_3)) f) (FunLike.coe.{succ u2, succ u4, succ u1} g_hom (Multiplicative.{u4} G) (fun (_x : Multiplicative.{u4} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.1262 : Multiplicative.{u4} G) => R) _x) (OneHomClass.toFunLike.{u2, u4, u1} g_hom (Multiplicative.{u4} G) R (instOneMultiplicative.{u4} G _inst_2) (NonAssocSemiring.toOne.{u1} R _inst_3) _inst_4) g)) (OfNat.ofNat.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) 1 (One.toOfNat1.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.one.{u3, u4} k G _inst_1 _inst_2)))) (OfNat.ofNat.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) (OfNat.ofNat.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) 1 (One.toOfNat1.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.one.{u3, u4} k G _inst_1 _inst_2)))) 1 (One.toOfNat1.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) (OfNat.ofNat.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) 1 (One.toOfNat1.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.one.{u3, u4} k G _inst_1 _inst_2)))) (NonAssocSemiring.toOne.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u3, u4} k G _inst_1) => R) (OfNat.ofNat.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) 1 (One.toOfNat1.{max u3 u4} (AddMonoidAlgebra.{u3, u4} k G _inst_1) (AddMonoidAlgebra.one.{u3, u4} k G _inst_1 _inst_2)))) _inst_3)))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.lift_nc_one AddMonoidAlgebra.liftNC_oneₓ'. -/
@[simp]
theorem liftNC_one {g_hom : Type _} [OneHomClass g_hom (Multiplicative G) R] (f : k →+* R)
    (g : g_hom) : liftNC (f : k →+ R) g 1 = 1 :=
  (MonoidAlgebra.liftNC_one f g : _)
#align add_monoid_algebra.lift_nc_one AddMonoidAlgebra.liftNC_one

end One

section Semigroup

variable [Semiring k] [AddSemigroup G]

instance : NonUnitalSemiring (AddMonoidAlgebra k G) :=
  {
    AddMonoidAlgebra.nonUnitalNonAssocSemiring with
    zero := 0
    mul := (· * ·)
    add := (· + ·)
    mul_assoc := fun f g h => by
      simp only [mul_def, sum_sum_index, sum_zero_index, sum_add_index, sum_single_index,
        single_zero, single_add, eq_self_iff_true, forall_true_iff, forall₃_true_iff, add_mul,
        mul_add, add_assoc, mul_assoc, MulZeroClass.zero_mul, MulZeroClass.mul_zero, sum_zero,
        sum_add] }

end Semigroup

section MulOneClass

variable [Semiring k] [AddZeroClass G]

instance : NonAssocSemiring (AddMonoidAlgebra k G) :=
  {
    AddMonoidAlgebra.nonUnitalNonAssocSemiring with
    one := 1
    mul := (· * ·)
    zero := 0
    add := (· + ·)
    natCast := fun n => single 0 n
    natCast_zero := by simp [Nat.cast]
    natCast_succ := fun _ => by simp [Nat.cast] <;> rfl
    one_mul := fun f => by
      simp only [mul_def, one_def, sum_single_index, MulZeroClass.zero_mul, single_zero, sum_zero,
        zero_add, one_mul, sum_single]
    mul_one := fun f => by
      simp only [mul_def, one_def, sum_single_index, MulZeroClass.mul_zero, single_zero, sum_zero,
        add_zero, mul_one, sum_single] }

/- warning: add_monoid_algebra.nat_cast_def -> AddMonoidAlgebra.nat_cast_def is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (n : Nat), Eq.{max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) ((fun (a : Type) (b : Sort.{max (succ u2) (succ u1)}) [self : HasLiftT.{1, max (succ u2) (succ u1)} a b] => self.0) Nat (AddMonoidAlgebra.{u1, u2} k G _inst_1) (HasLiftT.mk.{1, max (succ u2) (succ u1)} Nat (AddMonoidAlgebra.{u1, u2} k G _inst_1) (CoeTCₓ.coe.{1, max (succ u2) (succ u1)} Nat (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Nat.castCoe.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidWithOne.toNatCast.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoidWithOne.toAddMonoidWithOne.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toAddCommMonoidWithOne.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))))))) n) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (OfNat.ofNat.{u2} G 0 (OfNat.mk.{u2} G 0 (Zero.zero.{u2} G (AddZeroClass.toHasZero.{u2} G _inst_2)))) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Nat k (HasLiftT.mk.{1, succ u1} Nat k (CoeTCₓ.coe.{1, succ u1} Nat k (Nat.castCoe.{u1} k (AddMonoidWithOne.toNatCast.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))) n))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (n : Nat), Eq.{max (succ u1) (succ u2)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Nat.cast.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toNatCast.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)) n) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 (OfNat.ofNat.{u2} G 0 (Zero.toOfNat0.{u2} G (AddZeroClass.toZero.{u2} G _inst_2))) (Nat.cast.{u1} k (Semiring.toNatCast.{u1} k _inst_1) n))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.nat_cast_def AddMonoidAlgebra.nat_cast_defₓ'. -/
theorem nat_cast_def (n : ℕ) : (n : AddMonoidAlgebra k G) = single 0 n :=
  rfl
#align add_monoid_algebra.nat_cast_def AddMonoidAlgebra.nat_cast_def

end MulOneClass

/-! #### Semiring structure -/

section Semiring

instance {R : Type _} [Semiring k] [SMulZeroClass R k] : SMulZeroClass R (AddMonoidAlgebra k G) :=
  Finsupp.smulZeroClass

variable [Semiring k] [AddMonoid G]

instance : Semiring (AddMonoidAlgebra k G) :=
  { AddMonoidAlgebra.nonUnitalSemiring,
    AddMonoidAlgebra.nonAssocSemiring with
    one := 1
    mul := (· * ·)
    zero := 0
    add := (· + ·) }

variable [Semiring R]

/- warning: add_monoid_algebra.lift_nc_ring_hom -> AddMonoidAlgebra.liftNCRingHom is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] [_inst_3 : Semiring.{u3} R] (f : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (g : MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))), (forall (x : k) (y : Multiplicative.{u2} G), Commute.{u3} R (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => k -> R) (RingHom.hasCoeToFun.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f x) (coeFn.{max (succ u3) (succ u2), max (succ u2) (succ u3)} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (fun (_x : MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) => (Multiplicative.{u2} G) -> R) (MonoidHom.hasCoeToFun.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) g y)) -> (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] [_inst_3 : Semiring.{u3} R] (f : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (g : MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))), (forall (x : k) (y : Multiplicative.{u2} G), Commute.{u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) x) (NonUnitalNonAssocSemiring.toMul.{u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) x) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) x) (Semiring.toNonAssocSemiring.{u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) x) _inst_3))) (FunLike.coe.{max (succ u1) (succ u3), succ u1, succ u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) _x) (MulHomClass.toFunLike.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.instRingHomClassRingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) f x) (FunLike.coe.{max (succ u2) (succ u3), succ u2, succ u3} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u2} G) => R) _x) (MulHomClass.toFunLike.{max u2 u3, u2, u3} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (Multiplicative.{u2} G) R (MulOneClass.toMul.{u2} (Multiplicative.{u2} G) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2))) (MulOneClass.toMul.{u3} R (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (MonoidHomClass.toMulHomClass.{max u2 u3, u2, u3} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) (MonoidHom.monoidHomClass.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) g y)) -> (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.lift_nc_ring_hom AddMonoidAlgebra.liftNCRingHomₓ'. -/
/-- `lift_nc` as a `ring_hom`, for when `f` and `g` commute -/
def liftNCRingHom (f : k →+* R) (g : Multiplicative G →* R) (h_comm : ∀ x y, Commute (f x) (g y)) :
    AddMonoidAlgebra k G →+* R :=
  { liftNC (f : k →+ R) g with
    toFun := liftNC (f : k →+ R) g
    map_one' := liftNC_one _ _
    map_mul' := fun a b => liftNC_mul _ _ _ _ fun _ _ _ => h_comm _ _ }
#align add_monoid_algebra.lift_nc_ring_hom AddMonoidAlgebra.liftNCRingHom

end Semiring

instance [CommSemiring k] [AddCommSemigroup G] : NonUnitalCommSemiring (AddMonoidAlgebra k G) :=
  { AddMonoidAlgebra.nonUnitalSemiring with
    mul_comm := @mul_comm (MonoidAlgebra k <| Multiplicative G) _ }

instance [Semiring k] [Nontrivial k] [Nonempty G] : Nontrivial (AddMonoidAlgebra k G) :=
  Finsupp.nontrivial

/-! #### Derived instances -/

section DerivedInstances

instance [CommSemiring k] [AddCommMonoid G] : CommSemiring (AddMonoidAlgebra k G) :=
  { AddMonoidAlgebra.nonUnitalCommSemiring, AddMonoidAlgebra.semiring with }

instance [Semiring k] [Subsingleton k] : Unique (AddMonoidAlgebra k G) :=
  Finsupp.uniqueOfRight

instance [Ring k] : AddCommGroup (AddMonoidAlgebra k G) :=
  Finsupp.addCommGroup

instance [Ring k] [Add G] : NonUnitalNonAssocRing (AddMonoidAlgebra k G) :=
  { AddMonoidAlgebra.addCommGroup, AddMonoidAlgebra.nonUnitalNonAssocSemiring with }

instance [Ring k] [AddSemigroup G] : NonUnitalRing (AddMonoidAlgebra k G) :=
  { AddMonoidAlgebra.addCommGroup, AddMonoidAlgebra.nonUnitalSemiring with }

instance [Ring k] [AddZeroClass G] : NonAssocRing (AddMonoidAlgebra k G) :=
  { AddMonoidAlgebra.addCommGroup,
    AddMonoidAlgebra.nonAssocSemiring with
    intCast := fun z => single 0 (z : k)
    intCast_ofNat := fun n => by simpa
    intCast_negSucc := fun n => by simpa }

/- warning: add_monoid_algebra.int_cast_def -> AddMonoidAlgebra.int_cast_def is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Ring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (z : Int), Eq.{max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) ((fun (a : Type) (b : Sort.{max (succ u2) (succ u1)}) [self : HasLiftT.{1, max (succ u2) (succ u1)} a b] => self.0) Int (AddMonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (HasLiftT.mk.{1, max (succ u2) (succ u1)} Int (AddMonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (CoeTCₓ.coe.{1, max (succ u2) (succ u1)} Int (AddMonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (Int.castCoe.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (AddGroupWithOne.toHasIntCast.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (AddCommGroupWithOne.toAddGroupWithOne.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (NonAssocRing.toAddCommGroupWithOne.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocRing.{u1, u2} k G _inst_1 _inst_2))))))) z) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (Ring.toSemiring.{u1} k _inst_1))))) (OfNat.ofNat.{u2} G 0 (OfNat.mk.{u2} G 0 (Zero.zero.{u2} G (AddZeroClass.toHasZero.{u2} G _inst_2)))) ((fun (a : Type) (b : Type.{u1}) [self : HasLiftT.{1, succ u1} a b] => self.0) Int k (HasLiftT.mk.{1, succ u1} Int k (CoeTCₓ.coe.{1, succ u1} Int k (Int.castCoe.{u1} k (AddGroupWithOne.toHasIntCast.{u1} k (AddCommGroupWithOne.toAddGroupWithOne.{u1} k (Ring.toAddCommGroupWithOne.{u1} k _inst_1)))))) z))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Ring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (z : Int), Eq.{max (succ u1) (succ u2)} (AddMonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (Int.cast.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (NonAssocRing.toIntCast.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocRing.{u1, u2} k G _inst_1 _inst_2)) z) (AddMonoidAlgebra.single.{u1, u2} k G (Ring.toSemiring.{u1} k _inst_1) (OfNat.ofNat.{u2} G 0 (Zero.toOfNat0.{u2} G (AddZeroClass.toZero.{u2} G _inst_2))) (Int.cast.{u1} k (Ring.toIntCast.{u1} k _inst_1) z))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.int_cast_def AddMonoidAlgebra.int_cast_defₓ'. -/
theorem int_cast_def [Ring k] [AddZeroClass G] (z : ℤ) : (z : AddMonoidAlgebra k G) = single 0 z :=
  rfl
#align add_monoid_algebra.int_cast_def AddMonoidAlgebra.int_cast_def

instance [Ring k] [AddMonoid G] : Ring (AddMonoidAlgebra k G) :=
  { AddMonoidAlgebra.nonAssocRing, AddMonoidAlgebra.semiring with }

instance [CommRing k] [AddCommSemigroup G] : NonUnitalCommRing (AddMonoidAlgebra k G) :=
  { AddMonoidAlgebra.nonUnitalCommSemiring, AddMonoidAlgebra.nonUnitalRing with }

instance [CommRing k] [AddCommMonoid G] : CommRing (AddMonoidAlgebra k G) :=
  { AddMonoidAlgebra.nonUnitalCommRing, AddMonoidAlgebra.ring with }

variable {S : Type _}

instance [Monoid R] [Semiring k] [DistribMulAction R k] :
    DistribMulAction R (AddMonoidAlgebra k G) :=
  Finsupp.distribMulAction G k

instance [Monoid R] [Semiring k] [DistribMulAction R k] [FaithfulSMul R k] [Nonempty G] :
    FaithfulSMul R (AddMonoidAlgebra k G) :=
  Finsupp.faithfulSMul

instance [Semiring R] [Semiring k] [Module R k] : Module R (AddMonoidAlgebra k G) :=
  Finsupp.module G k

instance [Monoid R] [Monoid S] [Semiring k] [DistribMulAction R k] [DistribMulAction S k] [SMul R S]
    [IsScalarTower R S k] : IsScalarTower R S (AddMonoidAlgebra k G) :=
  Finsupp.isScalarTower G k

instance [Monoid R] [Monoid S] [Semiring k] [DistribMulAction R k] [DistribMulAction S k]
    [SMulCommClass R S k] : SMulCommClass R S (AddMonoidAlgebra k G) :=
  Finsupp.smulCommClass G k

instance [Monoid R] [Semiring k] [DistribMulAction R k] [DistribMulAction Rᵐᵒᵖ k]
    [IsCentralScalar R k] : IsCentralScalar R (AddMonoidAlgebra k G) :=
  Finsupp.isCentralScalar G k

/-! It is hard to state the equivalent of `distrib_mul_action G (add_monoid_algebra k G)`
because we've never discussed actions of additive groups. -/

end DerivedInstances

section MiscTheorems

variable [Semiring k]

/- warning: add_monoid_algebra.mul_apply -> AddMonoidAlgebra.mul_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DecidableEq.{succ u2} G] [_inst_3 : Add.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (g : AddMonoidAlgebra.{u1, u2} k G _inst_1) (x : G), Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_3)) f g) x) (Finsupp.sum.{u2, u1, u1} G k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) f (fun (a₁ : G) (b₁ : k) => Finsupp.sum.{u2, u1, u1} G k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) g (fun (a₂ : G) (b₂ : k) => ite.{succ u1} k (Eq.{succ u2} G (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_3) a₁ a₂) x) (_inst_2 (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_3) a₁ a₂) x) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) b₁ b₂) (OfNat.ofNat.{u1} k 0 (OfNat.mk.{u1} k 0 (Zero.zero.{u1} k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DecidableEq.{succ u2} G] [_inst_3 : Add.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (g : AddMonoidAlgebra.{u1, u2} k G _inst_1) (x : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_3)) f g) x) (Finsupp.sum.{u2, u1, u1} G k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) f (fun (a₁ : G) (b₁ : k) => Finsupp.sum.{u2, u1, u1} G k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) g (fun (a₂ : G) (b₂ : k) => ite.{succ u1} k (Eq.{succ u2} G (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_3) a₁ a₂) x) (_inst_2 (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_3) a₁ a₂) x) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) b₁ b₂) (OfNat.ofNat.{u1} k 0 (Zero.toOfNat0.{u1} k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.mul_apply AddMonoidAlgebra.mul_applyₓ'. -/
theorem mul_apply [DecidableEq G] [Add G] (f g : AddMonoidAlgebra k G) (x : G) :
    (f * g) x = f.Sum fun a₁ b₁ => g.Sum fun a₂ b₂ => if a₁ + a₂ = x then b₁ * b₂ else 0 :=
  @MonoidAlgebra.mul_apply k (Multiplicative G) _ _ _ _ _ _
#align add_monoid_algebra.mul_apply AddMonoidAlgebra.mul_apply

/- warning: add_monoid_algebra.mul_apply_antidiagonal -> AddMonoidAlgebra.mul_apply_antidiagonal is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (g : AddMonoidAlgebra.{u1, u2} k G _inst_1) (x : G) (s : Finset.{u2} (Prod.{u2, u2} G G)), (forall {p : Prod.{u2, u2} G G}, Iff (Membership.Mem.{u2, u2} (Prod.{u2, u2} G G) (Finset.{u2} (Prod.{u2, u2} G G)) (Finset.hasMem.{u2} (Prod.{u2, u2} G G)) p s) (Eq.{succ u2} G (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) (Prod.fst.{u2, u2} G G p) (Prod.snd.{u2, u2} G G p)) x)) -> (Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) f g) x) (Finset.sum.{u1, u2} k (Prod.{u2, u2} G G) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) s (fun (p : Prod.{u2, u2} G G) => HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f (Prod.fst.{u2, u2} G G p)) (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) g (Prod.snd.{u2, u2} G G p)))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (g : AddMonoidAlgebra.{u1, u2} k G _inst_1) (x : G) (s : Finset.{u2} (Prod.{u2, u2} G G)), (forall {p : Prod.{u2, u2} G G}, Iff (Membership.mem.{u2, u2} (Prod.{u2, u2} G G) (Finset.{u2} (Prod.{u2, u2} G G)) (Finset.instMembershipFinset.{u2} (Prod.{u2, u2} G G)) p s) (Eq.{succ u2} G (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) (Prod.fst.{u2, u2} G G p) (Prod.snd.{u2, u2} G G p)) x)) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) f g) x) (Finset.sum.{u1, u2} k (Prod.{u2, u2} G G) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) s (fun (p : Prod.{u2, u2} G G) => HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.snd.{u2, u2} G G p)) ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) (instHMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (Prod.fst.{u2, u2} G G p)) _inst_1)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f (Prod.fst.{u2, u2} G G p)) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) g (Prod.snd.{u2, u2} G G p)))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.mul_apply_antidiagonal AddMonoidAlgebra.mul_apply_antidiagonalₓ'. -/
theorem mul_apply_antidiagonal [Add G] (f g : AddMonoidAlgebra k G) (x : G) (s : Finset (G × G))
    (hs : ∀ {p : G × G}, p ∈ s ↔ p.1 + p.2 = x) : (f * g) x = ∑ p in s, f p.1 * g p.2 :=
  @MonoidAlgebra.mul_apply_antidiagonal k (Multiplicative G) _ _ _ _ _ s @hs
#align add_monoid_algebra.mul_apply_antidiagonal AddMonoidAlgebra.mul_apply_antidiagonal

/- warning: add_monoid_algebra.single_mul_single -> AddMonoidAlgebra.single_mul_single is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] {a₁ : G} {a₂ : G} {b₁ : k} {b₂ : k}, Eq.{max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a₁ b₁) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a₂ b₂)) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) a₁ a₂) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) b₁ b₂))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] {a₁ : G} {a₂ : G} {b₁ : k} {b₂ : k}, Eq.{max (succ u1) (succ u2)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 a₁ b₁) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 a₂ b₂)) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) a₁ a₂) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) b₁ b₂))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.single_mul_single AddMonoidAlgebra.single_mul_singleₓ'. -/
theorem single_mul_single [Add G] {a₁ a₂ : G} {b₁ b₂ : k} :
    (single a₁ b₁ * single a₂ b₂ : AddMonoidAlgebra k G) = single (a₁ + a₂) (b₁ * b₂) :=
  @MonoidAlgebra.single_mul_single k (Multiplicative G) _ _ _ _ _ _
#align add_monoid_algebra.single_mul_single AddMonoidAlgebra.single_mul_single

/- warning: add_monoid_algebra.single_pow -> AddMonoidAlgebra.single_pow is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] {a : G} {b : k} (n : Nat), Eq.{max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (HPow.hPow.{max u2 u1, 0, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) Nat (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHPow.{max u2 u1, 0} (AddMonoidAlgebra.{u1, u2} k G _inst_1) Nat (Monoid.Pow.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MonoidWithZero.toMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Semiring.toMonoidWithZero.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.semiring.{u1, u2} k G _inst_1 _inst_2))))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a b) n) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (SMul.smul.{0, u2} Nat G (AddMonoid.SMul.{u2} G _inst_2) n a) (HPow.hPow.{u1, 0, u1} k Nat k (instHPow.{u1, 0} k Nat (Monoid.Pow.{u1} k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))) b n))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] {a : G} {b : k} (n : Nat), Eq.{max (succ u1) (succ u2)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (HPow.hPow.{max u1 u2, 0, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) Nat (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHPow.{max u1 u2, 0} (AddMonoidAlgebra.{u1, u2} k G _inst_1) Nat (Monoid.Pow.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MonoidWithZero.toMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Semiring.toMonoidWithZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.semiring.{u1, u2} k G _inst_1 _inst_2))))) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 a b) n) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 (HSMul.hSMul.{0, u2, u2} Nat G G (instHSMul.{0, u2} Nat G (AddMonoid.SMul.{u2} G _inst_2)) n a) (HPow.hPow.{u1, 0, u1} k Nat k (instHPow.{u1, 0} k Nat (Monoid.Pow.{u1} k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))) b n))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.single_pow AddMonoidAlgebra.single_powₓ'. -/
-- This should be a `@[simp]` lemma, but the simp_nf linter times out if we add this.
-- Probably the correct fix is to make a `[add_]monoid_algebra.single` with the correct type,
-- instead of relying on `finsupp.single`.
theorem single_pow [AddMonoid G] {a : G} {b : k} :
    ∀ n : ℕ, (single a b ^ n : AddMonoidAlgebra k G) = single (n • a) (b ^ n)
  | 0 => by
    simp only [pow_zero, zero_nsmul]
    rfl
  | n + 1 => by
    rw [pow_succ, pow_succ, single_pow n, single_mul_single, add_comm, add_nsmul, one_nsmul]
#align add_monoid_algebra.single_pow AddMonoidAlgebra.single_pow

/- warning: add_monoid_algebra.map_domain_one -> AddMonoidAlgebra.mapDomain_one is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} {α₂ : Type.{u3}} [_inst_2 : Semiring.{u2} β] [_inst_3 : Zero.{u1} α] [_inst_4 : Zero.{u3} α₂] {F : Type.{u4}} [_inst_5 : ZeroHomClass.{u4, u1, u3} F α α₂ _inst_3 _inst_4] (f : F), Eq.{max (succ u3) (succ u2)} (Finsupp.{u3, u2} α₂ β (AddZeroClass.toHasZero.{u2} β (AddMonoid.toAddZeroClass.{u2} β (AddCommMonoid.toAddMonoid.{u2} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))))))) (Finsupp.mapDomain.{u1, u3, u2} α α₂ β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))) (coeFn.{succ u4, max (succ u1) (succ u3)} F (fun (_x : F) => α -> α₂) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} F α (fun (_x : α) => α₂) (ZeroHomClass.toFunLike.{u4, u1, u3} F α α₂ _inst_3 _inst_4 _inst_5)) f) (OfNat.ofNat.{max u1 u2} (AddMonoidAlgebra.{u2, u1} β α _inst_2) 1 (OfNat.mk.{max u1 u2} (AddMonoidAlgebra.{u2, u1} β α _inst_2) 1 (One.one.{max u1 u2} (AddMonoidAlgebra.{u2, u1} β α _inst_2) (AddMonoidAlgebra.one.{u2, u1} β α _inst_2 _inst_3))))) (OfNat.ofNat.{max u3 u2} (AddMonoidAlgebra.{u2, u3} β α₂ _inst_2) 1 (OfNat.mk.{max u3 u2} (AddMonoidAlgebra.{u2, u3} β α₂ _inst_2) 1 (One.one.{max u3 u2} (AddMonoidAlgebra.{u2, u3} β α₂ _inst_2) (AddMonoidAlgebra.one.{u2, u3} β α₂ _inst_2 _inst_4))))
but is expected to have type
  forall {α : Type.{u4}} {β : Type.{u3}} {α₂ : Type.{u2}} [_inst_2 : Semiring.{u3} β] [_inst_3 : Zero.{u4} α] [_inst_4 : Zero.{u2} α₂] {F : Type.{u1}} [_inst_5 : ZeroHomClass.{u1, u4, u2} F α α₂ _inst_3 _inst_4] (f : F), Eq.{max (succ u3) (succ u2)} (AddMonoidAlgebra.{u3, u2} β α₂ _inst_2) (AddMonoidAlgebra.mapDomain.{u3, u4, u2} β α _inst_2 α₂ (FunLike.coe.{succ u1, succ u4, succ u2} F α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.124 : α) => α₂) _x) (ZeroHomClass.toFunLike.{u1, u4, u2} F α α₂ _inst_3 _inst_4 _inst_5) f) (OfNat.ofNat.{max u4 u3} (AddMonoidAlgebra.{u3, u4} β α _inst_2) 1 (One.toOfNat1.{max u4 u3} (AddMonoidAlgebra.{u3, u4} β α _inst_2) (AddMonoidAlgebra.one.{u3, u4} β α _inst_2 _inst_3)))) (OfNat.ofNat.{max u3 u2} (AddMonoidAlgebra.{u3, u2} β α₂ _inst_2) 1 (One.toOfNat1.{max u3 u2} (AddMonoidAlgebra.{u3, u2} β α₂ _inst_2) (AddMonoidAlgebra.one.{u3, u2} β α₂ _inst_2 _inst_4)))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.map_domain_one AddMonoidAlgebra.mapDomain_oneₓ'. -/
/-- Like `finsupp.map_domain_zero`, but for the `1` we define in this file -/
@[simp]
theorem mapDomain_one {α : Type _} {β : Type _} {α₂ : Type _} [Semiring β] [Zero α] [Zero α₂]
    {F : Type _} [ZeroHomClass F α α₂] (f : F) :
    (mapDomain f (1 : AddMonoidAlgebra β α) : AddMonoidAlgebra β α₂) =
      (1 : AddMonoidAlgebra β α₂) :=
  by simp_rw [one_def, map_domain_single, map_zero]
#align add_monoid_algebra.map_domain_one AddMonoidAlgebra.mapDomain_one

/- warning: add_monoid_algebra.map_domain_mul -> AddMonoidAlgebra.mapDomain_mul is a dubious translation:
lean 3 declaration is
  forall {α : Type.{u1}} {β : Type.{u2}} {α₂ : Type.{u3}} [_inst_2 : Semiring.{u2} β] [_inst_3 : Add.{u1} α] [_inst_4 : Add.{u3} α₂] {F : Type.{u4}} [_inst_5 : AddHomClass.{u4, u1, u3} F α α₂ _inst_3 _inst_4] (f : F) (x : AddMonoidAlgebra.{u2, u1} β α _inst_2) (y : AddMonoidAlgebra.{u2, u1} β α _inst_2), Eq.{max (succ u3) (succ u2)} (Finsupp.{u3, u2} α₂ β (AddZeroClass.toHasZero.{u2} β (AddMonoid.toAddZeroClass.{u2} β (AddCommMonoid.toAddMonoid.{u2} β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))))))) (Finsupp.mapDomain.{u1, u3, u2} α α₂ β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))) (coeFn.{succ u4, max (succ u1) (succ u3)} F (fun (_x : F) => α -> α₂) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} F α (fun (_x : α) => α₂) (AddHomClass.toFunLike.{u4, u1, u3} F α α₂ _inst_3 _inst_4 _inst_5)) f) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u2, u1} β α _inst_2) (AddMonoidAlgebra.{u2, u1} β α _inst_2) (AddMonoidAlgebra.{u2, u1} β α _inst_2) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u2, u1} β α _inst_2) (AddMonoidAlgebra.hasMul.{u2, u1} β α _inst_2 _inst_3)) x y)) (HMul.hMul.{max u3 u2, max u3 u2, max u3 u2} (AddMonoidAlgebra.{u2, u3} β α₂ _inst_2) (AddMonoidAlgebra.{u2, u3} β α₂ _inst_2) (AddMonoidAlgebra.{u2, u3} β α₂ _inst_2) (instHMul.{max u3 u2} (AddMonoidAlgebra.{u2, u3} β α₂ _inst_2) (AddMonoidAlgebra.hasMul.{u2, u3} β α₂ _inst_2 _inst_4)) (Finsupp.mapDomain.{u1, u3, u2} α α₂ β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))) (coeFn.{succ u4, max (succ u1) (succ u3)} F (fun (_x : F) => α -> α₂) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} F α (fun (_x : α) => α₂) (AddHomClass.toFunLike.{u4, u1, u3} F α α₂ _inst_3 _inst_4 _inst_5)) f) x) (Finsupp.mapDomain.{u1, u3, u2} α α₂ β (NonUnitalNonAssocSemiring.toAddCommMonoid.{u2} β (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} β (Semiring.toNonAssocSemiring.{u2} β _inst_2))) (coeFn.{succ u4, max (succ u1) (succ u3)} F (fun (_x : F) => α -> α₂) (FunLike.hasCoeToFun.{succ u4, succ u1, succ u3} F α (fun (_x : α) => α₂) (AddHomClass.toFunLike.{u4, u1, u3} F α α₂ _inst_3 _inst_4 _inst_5)) f) y))
but is expected to have type
  forall {α : Type.{u4}} {β : Type.{u3}} {α₂ : Type.{u2}} [_inst_2 : Semiring.{u3} β] [_inst_3 : Add.{u4} α] [_inst_4 : Add.{u2} α₂] {F : Type.{u1}} [_inst_5 : AddHomClass.{u1, u4, u2} F α α₂ _inst_3 _inst_4] (f : F) (x : AddMonoidAlgebra.{u3, u4} β α _inst_2) (y : AddMonoidAlgebra.{u3, u4} β α _inst_2), Eq.{max (succ u3) (succ u2)} (AddMonoidAlgebra.{u3, u2} β α₂ _inst_2) (AddMonoidAlgebra.mapDomain.{u3, u4, u2} β α _inst_2 α₂ (FunLike.coe.{succ u1, succ u4, succ u2} F α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : α) => α₂) _x) (AddHomClass.toFunLike.{u1, u4, u2} F α α₂ _inst_3 _inst_4 _inst_5) f) (HMul.hMul.{max u4 u3, max u4 u3, max u4 u3} (AddMonoidAlgebra.{u3, u4} β α _inst_2) (AddMonoidAlgebra.{u3, u4} β α _inst_2) (AddMonoidAlgebra.{u3, u4} β α _inst_2) (instHMul.{max u4 u3} (AddMonoidAlgebra.{u3, u4} β α _inst_2) (AddMonoidAlgebra.hasMul.{u3, u4} β α _inst_2 _inst_3)) x y)) (HMul.hMul.{max u3 u2, max u3 u2, max u3 u2} (AddMonoidAlgebra.{u3, u2} β α₂ _inst_2) (AddMonoidAlgebra.{u3, u2} β α₂ _inst_2) (AddMonoidAlgebra.{u3, u2} β α₂ _inst_2) (instHMul.{max u3 u2} (AddMonoidAlgebra.{u3, u2} β α₂ _inst_2) (AddMonoidAlgebra.hasMul.{u3, u2} β α₂ _inst_2 _inst_4)) (AddMonoidAlgebra.mapDomain.{u3, u4, u2} β α _inst_2 α₂ (FunLike.coe.{succ u1, succ u4, succ u2} F α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : α) => α₂) _x) (AddHomClass.toFunLike.{u1, u4, u2} F α α₂ _inst_3 _inst_4 _inst_5) f) x) (AddMonoidAlgebra.mapDomain.{u3, u4, u2} β α _inst_2 α₂ (FunLike.coe.{succ u1, succ u4, succ u2} F α (fun (_x : α) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : α) => α₂) _x) (AddHomClass.toFunLike.{u1, u4, u2} F α α₂ _inst_3 _inst_4 _inst_5) f) y))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.map_domain_mul AddMonoidAlgebra.mapDomain_mulₓ'. -/
/-- Like `finsupp.map_domain_add`, but for the convolutive multiplication we define in this file -/
theorem mapDomain_mul {α : Type _} {β : Type _} {α₂ : Type _} [Semiring β] [Add α] [Add α₂]
    {F : Type _} [AddHomClass F α α₂] (f : F) (x y : AddMonoidAlgebra β α) :
    (mapDomain f (x * y : AddMonoidAlgebra β α) : AddMonoidAlgebra β α₂) =
      (mapDomain f x * mapDomain f y : AddMonoidAlgebra β α₂) :=
  by
  simp_rw [mul_def, map_domain_sum, map_domain_single, map_add]
  rw [Finsupp.sum_mapDomain_index]
  · congr
    ext (a b)
    rw [Finsupp.sum_mapDomain_index]
    · simp
    · simp [mul_add]
  · simp
  · simp [add_mul]
#align add_monoid_algebra.map_domain_mul AddMonoidAlgebra.mapDomain_mul

section

variable (k G)

/- warning: add_monoid_algebra.of_magma -> AddMonoidAlgebra.ofMagma is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) (G : Type.{u2}) [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G], MulHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.hasMul.{u2} G _inst_2) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)
but is expected to have type
  forall (k : Type.{u1}) (G : Type.{u2}) [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G], MulHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mul.{u2} G _inst_2) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.of_magma AddMonoidAlgebra.ofMagmaₓ'. -/
/-- The embedding of an additive magma into its additive magma algebra. -/
@[simps]
def ofMagma [Add G] : Multiplicative G →ₙ* AddMonoidAlgebra k G
    where
  toFun a := single a 1
  map_mul' a b := by
    simpa only [mul_def, mul_one, sum_single_index, single_eq_zero, MulZeroClass.mul_zero]
#align add_monoid_algebra.of_magma AddMonoidAlgebra.ofMagma

#print AddMonoidAlgebra.of /-
/-- Embedding of a magma with zero into its magma algebra. -/
def of [AddZeroClass G] : Multiplicative G →* AddMonoidAlgebra k G :=
  { ofMagma k G with
    toFun := fun a => single a 1
    map_one' := rfl }
#align add_monoid_algebra.of AddMonoidAlgebra.of
-/

#print AddMonoidAlgebra.of' /-
/-- Embedding of a magma with zero `G`, into its magma algebra, having `G` as source. -/
def of' : G → AddMonoidAlgebra k G := fun a => single a 1
#align add_monoid_algebra.of' AddMonoidAlgebra.of'
-/

end

/- warning: add_monoid_algebra.of_apply -> AddMonoidAlgebra.of_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (a : Multiplicative.{u2} G), Eq.{max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (coeFn.{max (succ (max u2 u1)) (succ u2), max (succ u2) (succ (max u2 u1))} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (fun (_x : MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) => (Multiplicative.{u2} G) -> (AddMonoidAlgebra.{u1, u2} k G _inst_1)) (MonoidHom.hasCoeToFun.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (AddMonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_2) a) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (coeFn.{succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} G) G) (fun (_x : Equiv.{succ u2, succ u2} (Multiplicative.{u2} G) G) => (Multiplicative.{u2} G) -> G) (Equiv.hasCoeToFun.{succ u2, succ u2} (Multiplicative.{u2} G) G) (Multiplicative.toAdd.{u2} G) a) (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (a : Multiplicative.{u2} G), Eq.{max (succ u1) (succ u2)} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u2} G) => AddMonoidAlgebra.{u1, u2} k G _inst_1) a) (FunLike.coe.{max (succ u1) (succ u2), succ u2, max (succ u1) (succ u2)} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u2} G) => AddMonoidAlgebra.{u1, u2} k G _inst_1) _x) (MulHomClass.toFunLike.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulOneClass.toMul.{u2} (Multiplicative.{u2} G) (Multiplicative.mulOneClass.{u2} G _inst_2)) (MulOneClass.toMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (MonoidHomClass.toMulHomClass.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MonoidHom.monoidHomClass.{u2, max u1 u2} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))))) (AddMonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_2) a) (AddMonoidAlgebra.single.{u1, u2} k ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Multiplicative.{u2} G) => G) a) _inst_1 (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} G) G) (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Multiplicative.{u2} G) => G) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} G) G) (Multiplicative.toAdd.{u2} G) a) (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k _inst_1))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.of_apply AddMonoidAlgebra.of_applyₓ'. -/
@[simp]
theorem of_apply [AddZeroClass G] (a : Multiplicative G) : of k G a = single a.toAdd 1 :=
  rfl
#align add_monoid_algebra.of_apply AddMonoidAlgebra.of_apply

/- warning: add_monoid_algebra.of'_apply -> AddMonoidAlgebra.of'_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] (a : G), Eq.{max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.of'.{u1, u2} k G _inst_1 a) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] (a : G), Eq.{max (succ u1) (succ u2)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.of'.{u1, u2} k G _inst_1 a) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 a (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k _inst_1))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.of'_apply AddMonoidAlgebra.of'_applyₓ'. -/
@[simp]
theorem of'_apply (a : G) : of' k G a = single a 1 :=
  rfl
#align add_monoid_algebra.of'_apply AddMonoidAlgebra.of'_apply

/- warning: add_monoid_algebra.of'_eq_of -> AddMonoidAlgebra.of'_eq_of is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (a : G), Eq.{max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.of'.{u1, u2} k G _inst_1 a) (coeFn.{max (succ (max u2 u1)) (succ u2), max (succ u2) (succ (max u2 u1))} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (fun (_x : MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) => (Multiplicative.{u2} G) -> (AddMonoidAlgebra.{u1, u2} k G _inst_1)) (MonoidHom.hasCoeToFun.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (AddMonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_2) a)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (a : G), Eq.{max (succ u1) (succ u2)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.of'.{u1, u2} k G _inst_1 a) (FunLike.coe.{max (succ u1) (succ u2), succ u2, max (succ u1) (succ u2)} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u2} G) => AddMonoidAlgebra.{u1, u2} k G _inst_1) _x) (MulHomClass.toFunLike.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulOneClass.toMul.{u2} (Multiplicative.{u2} G) (Multiplicative.mulOneClass.{u2} G _inst_2)) (MulOneClass.toMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (MonoidHomClass.toMulHomClass.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))) (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MonoidHom.monoidHomClass.{u2, max u1 u2} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))))) (AddMonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_2) a)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.of'_eq_of AddMonoidAlgebra.of'_eq_ofₓ'. -/
theorem of'_eq_of [AddZeroClass G] (a : G) : of' k G a = of k G a :=
  rfl
#align add_monoid_algebra.of'_eq_of AddMonoidAlgebra.of'_eq_of

/- warning: add_monoid_algebra.of_injective -> AddMonoidAlgebra.of_injective is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Nontrivial.{u1} k] [_inst_3 : AddZeroClass.{u2} G], Function.Injective.{succ u2, max (succ u2) (succ u1)} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (coeFn.{max (succ (max u2 u1)) (succ u2), max (succ u2) (succ (max u2 u1))} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_3) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)))) (fun (_x : MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_3) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)))) => (Multiplicative.{u2} G) -> (AddMonoidAlgebra.{u1, u2} k G _inst_1)) (MonoidHom.hasCoeToFun.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_3) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)))) (AddMonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_3))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Nontrivial.{u1} k] [_inst_3 : AddZeroClass.{u2} G], Function.Injective.{succ u2, max (succ u1) (succ u2)} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (FunLike.coe.{max (succ u1) (succ u2), succ u2, max (succ u1) (succ u2)} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_3) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)))) (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u2} G) => AddMonoidAlgebra.{u1, u2} k G _inst_1) _x) (MulHomClass.toFunLike.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_3) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)))) (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulOneClass.toMul.{u2} (Multiplicative.{u2} G) (Multiplicative.mulOneClass.{u2} G _inst_3)) (MulOneClass.toMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)))) (MonoidHomClass.toMulHomClass.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_3) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)))) (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_3) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MonoidHom.monoidHomClass.{u2, max u1 u2} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G _inst_3) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)))))) (AddMonoidAlgebra.of.{u1, u2} k G _inst_1 _inst_3))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.of_injective AddMonoidAlgebra.of_injectiveₓ'. -/
theorem of_injective [Nontrivial k] [AddZeroClass G] : Function.Injective (of k G) := fun a b h =>
  by simpa using (single_eq_single_iff _ _ _ _).mp h
#align add_monoid_algebra.of_injective AddMonoidAlgebra.of_injective

/- warning: add_monoid_algebra.single_hom -> AddMonoidAlgebra.singleHom is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G], MonoidHom.{max u1 u2, max u2 u1} (Prod.{u1, u2} k (Multiplicative.{u2} G)) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Prod.mulOneClass.{u1, u2} k (Multiplicative.{u2} G) (MulZeroOneClass.toMulOneClass.{u1} k (NonAssocSemiring.toMulZeroOneClass.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Multiplicative.mulOneClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G], MonoidHom.{max u2 u1, max u2 u1} (Prod.{u1, u2} k (Multiplicative.{u2} G)) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Prod.instMulOneClassProd.{u1, u2} k (Multiplicative.{u2} G) (MulZeroOneClass.toMulOneClass.{u1} k (NonAssocSemiring.toMulZeroOneClass.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Multiplicative.mulOneClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 _inst_2)))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.single_hom AddMonoidAlgebra.singleHomₓ'. -/
/-- `finsupp.single` as a `monoid_hom` from the product type into the additive monoid algebra.

Note the order of the elements of the product are reversed compared to the arguments of
`finsupp.single`.
-/
@[simps]
def singleHom [AddZeroClass G] : k × Multiplicative G →* AddMonoidAlgebra k G
    where
  toFun a := single a.2.toAdd a.1
  map_one' := rfl
  map_mul' a b := single_mul_single.symm
#align add_monoid_algebra.single_hom AddMonoidAlgebra.singleHom

/- warning: add_monoid_algebra.mul_single_apply_aux -> AddMonoidAlgebra.mul_single_apply_aux is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G) (y : G) (z : G), (forall (a : G), Iff (Eq.{succ u2} G (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) a x) z) (Eq.{succ u2} G a y)) -> (Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) f (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x r)) z) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f y) r))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G) (y : G) (z : G), (forall (a : G), Iff (Eq.{succ u2} G (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) a x) z) (Eq.{succ u2} G a y)) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) z) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) f (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 x r)) z) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (instHMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) _inst_1)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f y) r))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.mul_single_apply_aux AddMonoidAlgebra.mul_single_apply_auxₓ'. -/
theorem mul_single_apply_aux [Add G] (f : AddMonoidAlgebra k G) (r : k) (x y z : G)
    (H : ∀ a, a + x = z ↔ a = y) : (f * single x r) z = f y * r :=
  @MonoidAlgebra.mul_single_apply_aux k (Multiplicative G) _ _ _ _ _ _ _ H
#align add_monoid_algebra.mul_single_apply_aux AddMonoidAlgebra.mul_single_apply_aux

/- warning: add_monoid_algebra.mul_single_zero_apply -> AddMonoidAlgebra.mul_single_zero_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G), Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 (AddZeroClass.toHasAdd.{u2} G _inst_2))) f (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (OfNat.ofNat.{u2} G 0 (OfNat.mk.{u2} G 0 (Zero.zero.{u2} G (AddZeroClass.toHasZero.{u2} G _inst_2)))) r)) x) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f x) r)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 (AddZeroClass.toAdd.{u2} G _inst_2))) f (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 (OfNat.ofNat.{u2} G 0 (Zero.toOfNat0.{u2} G (AddZeroClass.toZero.{u2} G _inst_2))) r)) x) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (instHMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) _inst_1)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f x) r)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.mul_single_zero_apply AddMonoidAlgebra.mul_single_zero_applyₓ'. -/
theorem mul_single_zero_apply [AddZeroClass G] (f : AddMonoidAlgebra k G) (r : k) (x : G) :
    (f * single 0 r) x = f x * r :=
  f.mul_single_apply_aux r _ _ _ fun a => by rw [add_zero]
#align add_monoid_algebra.mul_single_zero_apply AddMonoidAlgebra.mul_single_zero_apply

/- warning: add_monoid_algebra.mul_single_apply_of_not_exists_add -> AddMonoidAlgebra.mul_single_apply_of_not_exists_add is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] (r : k) {g : G} {g' : G} (x : AddMonoidAlgebra.{u1, u2} k G _inst_1), (Not (Exists.{succ u2} G (fun (d : G) => Eq.{succ u2} G g' (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) d g)))) -> (Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) x (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) g r)) g') (OfNat.ofNat.{u1} k 0 (OfNat.mk.{u1} k 0 (Zero.zero.{u1} k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] (r : k) {g : G} {g' : G} (x : AddMonoidAlgebra.{u1, u2} k G _inst_1), (Not (Exists.{succ u2} G (fun (d : G) => Eq.{succ u2} G g' (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) d g)))) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) x (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 g r)) g') (OfNat.ofNat.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') 0 (Zero.toOfNat0.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (MonoidWithZero.toZero.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (Semiring.toMonoidWithZero.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') _inst_1)))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.mul_single_apply_of_not_exists_add AddMonoidAlgebra.mul_single_apply_of_not_exists_addₓ'. -/
theorem mul_single_apply_of_not_exists_add [Add G] (r : k) {g g' : G} (x : AddMonoidAlgebra k G)
    (h : ¬∃ d, g' = d + g) : (x * Finsupp.single g r : AddMonoidAlgebra k G) g' = 0 :=
  @MonoidAlgebra.mul_single_apply_of_not_exists_mul k (Multiplicative G) _ _ _ _ _ _ h
#align add_monoid_algebra.mul_single_apply_of_not_exists_add AddMonoidAlgebra.mul_single_apply_of_not_exists_add

/- warning: add_monoid_algebra.single_mul_apply_aux -> AddMonoidAlgebra.single_mul_apply_aux is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G) (y : G) (z : G), (forall (a : G), Iff (Eq.{succ u2} G (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) x a) y) (Eq.{succ u2} G a z)) -> (Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x r) f) y) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) r (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f z)))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G) (y : G) (z : G), (forall (a : G), Iff (Eq.{succ u2} G (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) x a) y) (Eq.{succ u2} G a z)) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 x r) f) y) (HMul.hMul.{u1, u1, u1} k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) z) k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) r (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f z)))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.single_mul_apply_aux AddMonoidAlgebra.single_mul_apply_auxₓ'. -/
theorem single_mul_apply_aux [Add G] (f : AddMonoidAlgebra k G) (r : k) (x y z : G)
    (H : ∀ a, x + a = y ↔ a = z) : (single x r * f : AddMonoidAlgebra k G) y = r * f z :=
  @MonoidAlgebra.single_mul_apply_aux k (Multiplicative G) _ _ _ _ _ _ _ H
#align add_monoid_algebra.single_mul_apply_aux AddMonoidAlgebra.single_mul_apply_aux

/- warning: add_monoid_algebra.single_zero_mul_apply -> AddMonoidAlgebra.single_zero_mul_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G), Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 (AddZeroClass.toHasAdd.{u2} G _inst_2))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (OfNat.ofNat.{u2} G 0 (OfNat.mk.{u2} G 0 (Zero.zero.{u2} G (AddZeroClass.toHasZero.{u2} G _inst_2)))) r) f) x) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) r (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f x))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddZeroClass.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 (AddZeroClass.toAdd.{u2} G _inst_2))) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 (OfNat.ofNat.{u2} G 0 (Zero.toOfNat0.{u2} G (AddZeroClass.toZero.{u2} G _inst_2))) r) f) x) (HMul.hMul.{u1, u1, u1} k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) x) k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) r (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f x))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.single_zero_mul_apply AddMonoidAlgebra.single_zero_mul_applyₓ'. -/
theorem single_zero_mul_apply [AddZeroClass G] (f : AddMonoidAlgebra k G) (r : k) (x : G) :
    (single 0 r * f : AddMonoidAlgebra k G) x = r * f x :=
  f.single_mul_apply_aux r _ _ _ fun a => by rw [zero_add]
#align add_monoid_algebra.single_zero_mul_apply AddMonoidAlgebra.single_zero_mul_apply

/- warning: add_monoid_algebra.single_mul_apply_of_not_exists_add -> AddMonoidAlgebra.single_mul_apply_of_not_exists_add is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] (r : k) {g : G} {g' : G} (x : AddMonoidAlgebra.{u1, u2} k G _inst_1), (Not (Exists.{succ u2} G (fun (d : G) => Eq.{succ u2} G g' (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) g d)))) -> (Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) g r) x) g') (OfNat.ofNat.{u1} k 0 (OfNat.mk.{u1} k 0 (Zero.zero.{u1} k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G] (r : k) {g : G} {g' : G} (x : AddMonoidAlgebra.{u1, u2} k G _inst_1), (Not (Exists.{succ u2} G (fun (d : G) => Eq.{succ u2} G g' (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G _inst_2) g d)))) -> (Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2)) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 g r) x) g') (OfNat.ofNat.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') 0 (Zero.toOfNat0.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (MonoidWithZero.toZero.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') (Semiring.toMonoidWithZero.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) g') _inst_1)))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.single_mul_apply_of_not_exists_add AddMonoidAlgebra.single_mul_apply_of_not_exists_addₓ'. -/
theorem single_mul_apply_of_not_exists_add [Add G] (r : k) {g g' : G} (x : AddMonoidAlgebra k G)
    (h : ¬∃ d, g' = g + d) : (Finsupp.single g r * x : AddMonoidAlgebra k G) g' = 0 :=
  @MonoidAlgebra.single_mul_apply_of_not_exists_mul k (Multiplicative G) _ _ _ _ _ _ h
#align add_monoid_algebra.single_mul_apply_of_not_exists_add AddMonoidAlgebra.single_mul_apply_of_not_exists_add

/- warning: add_monoid_algebra.mul_single_apply -> AddMonoidAlgebra.mul_single_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddGroup.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G) (y : G), Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 (AddZeroClass.toHasAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (SubNegMonoid.toAddMonoid.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2)))))) f (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x r)) y) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f (HSub.hSub.{u2, u2, u2} G G G (instHSub.{u2} G (SubNegMonoid.toHasSub.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2))) y x)) r)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddGroup.{u2} G] (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (r : k) (x : G) (y : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 (AddZeroClass.toAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (SubNegMonoid.toAddMonoid.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2)))))) f (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 x r)) y) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HSub.hSub.{u2, u2, u2} G G G (instHSub.{u2} G (SubNegMonoid.toSub.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2))) y x)) k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HSub.hSub.{u2, u2, u2} G G G (instHSub.{u2} G (SubNegMonoid.toSub.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2))) y x)) (instHMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HSub.hSub.{u2, u2, u2} G G G (instHSub.{u2} G (SubNegMonoid.toSub.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2))) y x)) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HSub.hSub.{u2, u2, u2} G G G (instHSub.{u2} G (SubNegMonoid.toSub.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2))) y x)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HSub.hSub.{u2, u2, u2} G G G (instHSub.{u2} G (SubNegMonoid.toSub.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2))) y x)) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HSub.hSub.{u2, u2, u2} G G G (instHSub.{u2} G (SubNegMonoid.toSub.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2))) y x)) _inst_1)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f (HSub.hSub.{u2, u2, u2} G G G (instHSub.{u2} G (SubNegMonoid.toSub.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2))) y x)) r)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.mul_single_apply AddMonoidAlgebra.mul_single_applyₓ'. -/
theorem mul_single_apply [AddGroup G] (f : AddMonoidAlgebra k G) (r : k) (x y : G) :
    (f * single x r) y = f (y - x) * r :=
  (sub_eq_add_neg y x).symm ▸ @MonoidAlgebra.mul_single_apply k (Multiplicative G) _ _ _ _ _ _
#align add_monoid_algebra.mul_single_apply AddMonoidAlgebra.mul_single_apply

/- warning: add_monoid_algebra.single_mul_apply -> AddMonoidAlgebra.single_mul_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddGroup.{u2} G] (r : k) (x : G) (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (y : G), Eq.{succ u1} k (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) (HMul.hMul.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 (AddZeroClass.toHasAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (SubNegMonoid.toAddMonoid.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2)))))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x r) f) y) (HMul.hMul.{u1, u1, u1} k k k (instHMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) r (coeFn.{max (succ u2) (succ u1), max (succ u2) (succ u1)} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => G -> k) (AddMonoidAlgebra.coeFun.{u1, u2} k G _inst_1) f (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G (AddZeroClass.toHasAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (SubNegMonoid.toAddMonoid.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2))))) (Neg.neg.{u2} G (SubNegMonoid.toHasNeg.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2)) x) y)))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddGroup.{u2} G] (r : k) (x : G) (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (y : G), Eq.{succ u1} ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) y) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) (HMul.hMul.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 (AddZeroClass.toAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (SubNegMonoid.toAddMonoid.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2)))))) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 x r) f) y) (HMul.hMul.{u1, u1, u1} k ((fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G (AddZeroClass.toAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (SubNegMonoid.toAddMonoid.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2))))) (Neg.neg.{u2} G (NegZeroClass.toNeg.{u2} G (SubNegZeroMonoid.toNegZeroClass.{u2} G (SubtractionMonoid.toSubNegZeroMonoid.{u2} G (AddGroup.toSubtractionMonoid.{u2} G _inst_2)))) x) y)) k (instHMul.{u1} k (NonUnitalNonAssocSemiring.toMul.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) r (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (Finsupp.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) G (fun (_x : G) => (fun (x._@.Mathlib.Data.Finsupp.Defs._hyg.779 : G) => k) _x) (Finsupp.funLike.{u2, u1} G k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1))) f (HAdd.hAdd.{u2, u2, u2} G G G (instHAdd.{u2} G (AddZeroClass.toAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (SubNegMonoid.toAddMonoid.{u2} G (AddGroup.toSubNegMonoid.{u2} G _inst_2))))) (Neg.neg.{u2} G (NegZeroClass.toNeg.{u2} G (SubNegZeroMonoid.toNegZeroClass.{u2} G (SubtractionMonoid.toSubNegZeroMonoid.{u2} G (AddGroup.toSubtractionMonoid.{u2} G _inst_2)))) x) y)))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.single_mul_apply AddMonoidAlgebra.single_mul_applyₓ'. -/
theorem single_mul_apply [AddGroup G] (r : k) (x : G) (f : AddMonoidAlgebra k G) (y : G) :
    (single x r * f : AddMonoidAlgebra k G) y = r * f (-x + y) :=
  @MonoidAlgebra.single_mul_apply k (Multiplicative G) _ _ _ _ _ _
#align add_monoid_algebra.single_mul_apply AddMonoidAlgebra.single_mul_apply

/- warning: add_monoid_algebra.lift_nc_smul -> AddMonoidAlgebra.liftNC_smul is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] {R : Type.{u3}} [_inst_2 : AddZeroClass.{u2} G] [_inst_3 : Semiring.{u3} R] (f : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (g : MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (c : k) (φ : MonoidAlgebra.{u1, u2} k G _inst_1), Eq.{succ u3} R (coeFn.{max (succ u3) (succ (max u2 u1)), max (succ (max u2 u1)) (succ u3)} (AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (fun (_x : AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (coeFn.{max (succ u3) (succ u2), max (succ u2) (succ u3)} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (fun (_x : MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) => (Multiplicative.{u2} G) -> R) (MonoidHom.hasCoeToFun.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) g)) (SMul.smul.{u1, max u2 u1} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toHasSmul.{u1, max u2 u1} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (AddMonoidAlgebra.smulZeroClass.{u1, u2, u1} k G k _inst_1 (SMulWithZero.toSmulZeroClass.{u1, u1} k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))) c φ)) (HMul.hMul.{u3, u3, u3} R R R (instHMul.{u3} R (Distrib.toHasMul.{u3} R (NonUnitalNonAssocSemiring.toDistrib.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (coeFn.{max (succ u1) (succ u3), max (succ u1) (succ u3)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => k -> R) (RingHom.hasCoeToFun.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f c) (coeFn.{max (succ u3) (succ (max u2 u1)), max (succ (max u2 u1)) (succ u3)} (AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (fun (_x : AddMonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> R) (AddMonoidHom.hasCoeToFun.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1))) (AddMonoid.toAddZeroClass.{u3} R (AddCommMonoid.toAddMonoid.{u3} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidAlgebra.liftNC.{u1, u2, u3} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)) ((fun (a : Sort.{max (succ u1) (succ u3)}) (b : Sort.{max (succ u3) (succ u1)}) [self : HasLiftT.{max (succ u1) (succ u3), max (succ u3) (succ u1)} a b] => self.0) (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (HasLiftT.mk.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (CoeTCₓ.coe.{max (succ u1) (succ u3), max (succ u3) (succ u1)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidHom.{u1, u3} k R (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) (AddMonoidHom.hasCoeT.{u1, u3, max u1 u3} k R (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (AddMonoid.toAddZeroClass.{u3} R (AddMonoidWithOne.toAddMonoid.{u3} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u3} R (NonAssocSemiring.toAddCommMonoidWithOne.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u1 u3, u1, u3} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (coeFn.{max (succ u3) (succ u2), max (succ u2) (succ u3)} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (fun (_x : MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) => (Multiplicative.{u2} G) -> R) (MonoidHom.hasCoeToFun.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G _inst_2) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) g)) φ))
but is expected to have type
  forall {k : Type.{u2}} {G : Type.{u3}} [_inst_1 : Semiring.{u2} k] {R : Type.{u1}} [_inst_2 : AddZeroClass.{u3} G] [_inst_3 : Semiring.{u1} R] (f : RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (g : MonoidHom.{u3, u1} (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G _inst_2) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (c : k) (φ : MonoidAlgebra.{u2, u3} k G _inst_1), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) (HSMul.hSMul.{u2, max u2 u3, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.{u2, u3} k G _inst_1) (instHSMul.{u2, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (SMulZeroClass.toSMul.{u2, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoid.toZero.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (MonoidAlgebra.smulZeroClass.{u2, u3, u2} k G k _inst_1 (SMulWithZero.toSMulZeroClass.{u2, u2} k k (MonoidWithZero.toZero.{u2} k (Semiring.toMonoidWithZero.{u2} k _inst_1)) (MonoidWithZero.toZero.{u2} k (Semiring.toMonoidWithZero.{u2} k _inst_1)) (MulZeroClass.toSMulWithZero.{u2} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1)))))))) c φ)) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (AddMonoidHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddZeroClass.toAdd.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidHomClass.toAddHomClass.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidHom.addMonoidHomClass.{max u2 u3, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))))) (AddMonoidAlgebra.liftNC.{u2, u3, u1} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidHomClass.toAddMonoidHom.{u2, u1, max u2 u1} k R (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (MonoidHom.{u3, u1} (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G _inst_2) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (Multiplicative.{u3} G) (fun (_x : Multiplicative.{u3} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u3} G) => R) _x) (MulHomClass.toFunLike.{max u3 u1, u3, u1} (MonoidHom.{u3, u1} (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G _inst_2) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (Multiplicative.{u3} G) R (MulOneClass.toMul.{u3} (Multiplicative.{u3} G) (Multiplicative.mulOneClass.{u3} G _inst_2)) (MulOneClass.toMul.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (MonoidHomClass.toMulHomClass.{max u3 u1, u3, u1} (MonoidHom.{u3, u1} (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G _inst_2) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G _inst_2) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (MonoidHom.monoidHomClass.{u3, u1} (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G _inst_2) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) g)) (HSMul.hSMul.{u2, max u2 u3, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.{u2, u3} k G _inst_1) (instHSMul.{u2, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (SMulZeroClass.toSMul.{u2, max u2 u3} k (MonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoid.toZero.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (MonoidAlgebra.{u2, u3} k G _inst_1) (MonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (MonoidAlgebra.smulZeroClass.{u2, u3, u2} k G k _inst_1 (SMulWithZero.toSMulZeroClass.{u2, u2} k k (MonoidWithZero.toZero.{u2} k (Semiring.toMonoidWithZero.{u2} k _inst_1)) (MonoidWithZero.toZero.{u2} k (Semiring.toMonoidWithZero.{u2} k _inst_1)) (MulZeroClass.toSMulWithZero.{u2} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u2} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1)))))))) c φ)) (HMul.hMul.{u1, u1, u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) φ) ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) (instHMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) (NonUnitalNonAssocSemiring.toMul.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) (Semiring.toNonAssocSemiring.{u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) c) _inst_3)))) (FunLike.coe.{max (succ u2) (succ u1), succ u2, succ u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => R) _x) (MulHomClass.toFunLike.{max u2 u1, u2, u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (NonUnitalNonAssocSemiring.toMul.{u2} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) f c) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (AddMonoidHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (AddHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddZeroClass.toAdd.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1)))) (AddZeroClass.toAdd.{u1} R (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidHomClass.toAddHomClass.{max (max u2 u3) u1, max u2 u3, u1} (AddMonoidHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (AddMonoidHom.addMonoidHomClass.{max u2 u3, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoid.toAddZeroClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u3} k G _inst_1))) (AddMonoid.toAddZeroClass.{u1} R (AddCommMonoid.toAddMonoid.{u1} R (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))))) (AddMonoidAlgebra.liftNC.{u2, u3, u1} k G R _inst_1 (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidHomClass.toAddMonoidHom.{u2, u1, max u2 u1} k R (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoid.toAddZeroClass.{u2} k (AddMonoidWithOne.toAddMonoid.{u2} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u2} k (NonAssocSemiring.toAddCommMonoidWithOne.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_1))))) (AddMonoid.toAddZeroClass.{u1} R (AddMonoidWithOne.toAddMonoid.{u1} R (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} R (NonAssocSemiring.toAddCommMonoidWithOne.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) (RingHomClass.toAddMonoidHomClass.{max u2 u1, u2, u1} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (FunLike.coe.{max (succ u3) (succ u1), succ u3, succ u1} (MonoidHom.{u3, u1} (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G _inst_2) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (Multiplicative.{u3} G) (fun (_x : Multiplicative.{u3} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u3} G) => R) _x) (MulHomClass.toFunLike.{max u3 u1, u3, u1} (MonoidHom.{u3, u1} (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G _inst_2) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (Multiplicative.{u3} G) R (MulOneClass.toMul.{u3} (Multiplicative.{u3} G) (Multiplicative.mulOneClass.{u3} G _inst_2)) (MulOneClass.toMul.{u1} R (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (MonoidHomClass.toMulHomClass.{max u3 u1, u3, u1} (MonoidHom.{u3, u1} (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G _inst_2) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G _inst_2) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (MonoidHom.monoidHomClass.{u3, u1} (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G _inst_2) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))))) g)) φ))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.lift_nc_smul AddMonoidAlgebra.liftNC_smulₓ'. -/
theorem liftNC_smul {R : Type _} [AddZeroClass G] [Semiring R] (f : k →+* R)
    (g : Multiplicative G →* R) (c : k) (φ : MonoidAlgebra k G) :
    liftNC (f : k →+ R) g (c • φ) = f c * liftNC (f : k →+ R) g φ :=
  @MonoidAlgebra.liftNC_smul k (Multiplicative G) _ _ _ _ f g c φ
#align add_monoid_algebra.lift_nc_smul AddMonoidAlgebra.liftNC_smul

/- warning: add_monoid_algebra.induction_on -> AddMonoidAlgebra.induction_on is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] {p : (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> Prop} (f : AddMonoidAlgebra.{u1, u2} k G _inst_1), (forall (g : G), p (coeFn.{max (succ (max u2 u1)) (succ u2), max (succ u2) (succ (max u2 u1))} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2))))) (fun (_x : MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2))))) => (Multiplicative.{u2} G) -> (AddMonoidAlgebra.{u1, u2} k G _inst_1)) (MonoidHom.hasCoeToFun.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2))))) (AddMonoidAlgebra.of.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (coeFn.{succ u2, succ u2} (Equiv.{succ u2, succ u2} G (Multiplicative.{u2} G)) (fun (_x : Equiv.{succ u2, succ u2} G (Multiplicative.{u2} G)) => G -> (Multiplicative.{u2} G)) (Equiv.hasCoeToFun.{succ u2, succ u2} G (Multiplicative.{u2} G)) (Multiplicative.ofAdd.{u2} G) g))) -> (forall (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (g : AddMonoidAlgebra.{u1, u2} k G _inst_1), (p f) -> (p g) -> (p (HAdd.hAdd.{max u2 u1, max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHAdd.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Distrib.toHasAdd.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 (AddZeroClass.toHasAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)))))) f g))) -> (forall (r : k) (f : AddMonoidAlgebra.{u1, u2} k G _inst_1), (p f) -> (p (SMul.smul.{u1, max u2 u1} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toHasSmul.{u1, max u2 u1} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (AddMonoidAlgebra.smulZeroClass.{u1, u2, u1} k G k _inst_1 (SMulWithZero.toSmulZeroClass.{u1, u1} k k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))) r f))) -> (p f)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] {p : (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> Prop} (f : AddMonoidAlgebra.{u1, u2} k G _inst_1), (forall (g : G), p (FunLike.coe.{max (succ u1) (succ u2), succ u2, max (succ u1) (succ u2)} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2))))) (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u2} G) => AddMonoidAlgebra.{u1, u2} k G _inst_1) _x) (MulHomClass.toFunLike.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2))))) (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulOneClass.toMul.{u2} (Multiplicative.{u2} G) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2))) (MulOneClass.toMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2))))) (MonoidHomClass.toMulHomClass.{max u1 u2, u2, max u1 u2} (MonoidHom.{u2, max u2 u1} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2))))) (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MonoidHom.monoidHomClass.{u2, max u1 u2} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2))))))) (AddMonoidAlgebra.of.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} G (Multiplicative.{u2} G)) G (fun (_x : G) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : G) => Multiplicative.{u2} G) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} G (Multiplicative.{u2} G)) (Multiplicative.ofAdd.{u2} G) g))) -> (forall (f : AddMonoidAlgebra.{u1, u2} k G _inst_1) (g : AddMonoidAlgebra.{u1, u2} k G _inst_1), (p f) -> (p g) -> (p (HAdd.hAdd.{max u1 u2, max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHAdd.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Distrib.toAdd.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 (AddZeroClass.toAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)))))) f g))) -> (forall (r : k) (f : AddMonoidAlgebra.{u1, u2} k G _inst_1), (p f) -> (p (HSMul.hSMul.{u1, max u1 u2, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (instHSMul.{u1, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toSMul.{u1, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MonoidWithZero.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Semiring.toMonoidWithZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.semiring.{u1, u2} k G _inst_1 _inst_2))) (AddMonoidAlgebra.smulZeroClass.{u1, u2, u1} k G k _inst_1 (SMulWithZero.toSMulZeroClass.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))))) r f))) -> (p f)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.induction_on AddMonoidAlgebra.induction_onₓ'. -/
theorem induction_on [AddMonoid G] {p : AddMonoidAlgebra k G → Prop} (f : AddMonoidAlgebra k G)
    (hM : ∀ g, p (of k G (Multiplicative.ofAdd g)))
    (hadd : ∀ f g : AddMonoidAlgebra k G, p f → p g → p (f + g))
    (hsmul : ∀ (r : k) (f), p f → p (r • f)) : p f :=
  by
  refine' Finsupp.induction_linear f _ (fun f g hf hg => hadd f g hf hg) fun g r => _
  · simpa using hsmul 0 (of k G (Multiplicative.ofAdd 0)) (hM 0)
  · convert hsmul r (of k G (Multiplicative.ofAdd g)) (hM g)
    simp only [mul_one, toAdd_ofAdd, smul_single', of_apply]
#align add_monoid_algebra.induction_on AddMonoidAlgebra.induction_on

#print AddMonoidAlgebra.mapDomainRingHom /-
/-- If `f : G → H` is an additive homomorphism between two additive monoids, then
`finsupp.map_domain f` is a ring homomorphism between their add monoid algebras. -/
@[simps]
def mapDomainRingHom (k : Type _) [Semiring k] {H F : Type _} [AddMonoid G] [AddMonoid H]
    [AddMonoidHomClass F G H] (f : F) : AddMonoidAlgebra k G →+* AddMonoidAlgebra k H :=
  {
    (Finsupp.mapDomain.addMonoidHom f :
      MonoidAlgebra k G →+
        MonoidAlgebra k H) with
    map_one' := mapDomain_one f
    map_mul' := fun x y => mapDomain_mul f x y }
#align add_monoid_algebra.map_domain_ring_hom AddMonoidAlgebra.mapDomainRingHom
-/

end MiscTheorems

end AddMonoidAlgebra

/-!
#### Conversions between `add_monoid_algebra` and `monoid_algebra`

We have not defined `add_monoid_algebra k G = monoid_algebra k (multiplicative G)`
because historically this caused problems;
since the changes that have made `nsmul` definitional, this would be possible,
but for now we just contruct the ring isomorphisms using `ring_equiv.refl _`.
-/

/- warning: add_monoid_algebra.to_multiplicative -> AddMonoidAlgebra.toMultiplicative is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) (G : Type.{u2}) [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G], RingEquiv.{max u2 u1, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k (Multiplicative.{u2} G) _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2) (Distrib.toHasAdd.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (MonoidAlgebra.mul.{u1, u2} k (Multiplicative.{u2} G) _inst_1 (Multiplicative.hasMul.{u2} G _inst_2)) (Distrib.toHasAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} k (Multiplicative.{u2} G) _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (MonoidAlgebra.{u1, u2} k (Multiplicative.{u2} G) _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k (Multiplicative.{u2} G) _inst_1 (Multiplicative.hasMul.{u2} G _inst_2))))
but is expected to have type
  forall (k : Type.{u1}) (G : Type.{u2}) [_inst_1 : Semiring.{u1} k] [_inst_2 : Add.{u2} G], RingEquiv.{max u2 u1, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.{u1, u2} k (Multiplicative.{u2} G) _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_2) (MonoidAlgebra.mul.{u1, u2} k (Multiplicative.{u2} G) _inst_1 (Multiplicative.mul.{u2} G _inst_2)) (Distrib.toAdd.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (Distrib.toAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} k (Multiplicative.{u2} G) _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (MonoidAlgebra.{u1, u2} k (Multiplicative.{u2} G) _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k (Multiplicative.{u2} G) _inst_1 (Multiplicative.mul.{u2} G _inst_2))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.to_multiplicative AddMonoidAlgebra.toMultiplicativeₓ'. -/
/-- The equivalence between `add_monoid_algebra` and `monoid_algebra` in terms of
`multiplicative` -/
protected def AddMonoidAlgebra.toMultiplicative [Semiring k] [Add G] :
    AddMonoidAlgebra k G ≃+* MonoidAlgebra k (Multiplicative G) :=
  {
    Finsupp.domCongr
      Multiplicative.ofAdd with
    toFun := equivMapDomain Multiplicative.ofAdd
    map_mul' := fun x y => by
      repeat' rw [equiv_map_domain_eq_map_domain]
      dsimp [Multiplicative.ofAdd]
      convert MonoidAlgebra.mapDomain_mul (MulHom.id (Multiplicative G)) _ _ }
#align add_monoid_algebra.to_multiplicative AddMonoidAlgebra.toMultiplicative

/- warning: monoid_algebra.to_additive -> MonoidAlgebra.toAdditive is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) (G : Type.{u2}) [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G], RingEquiv.{max u1 u2, max u2 u1} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k (Additive.{u2} G) _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2) (Distrib.toHasAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (AddMonoidAlgebra.hasMul.{u1, u2} k (Additive.{u2} G) _inst_1 (Additive.hasAdd.{u2} G _inst_2)) (Distrib.toHasAdd.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k (Additive.{u2} G) _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k (Additive.{u2} G) _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k (Additive.{u2} G) _inst_1 (Additive.hasAdd.{u2} G _inst_2))))
but is expected to have type
  forall (k : Type.{u1}) (G : Type.{u2}) [_inst_1 : Semiring.{u1} k] [_inst_2 : Mul.{u2} G], RingEquiv.{max u2 u1, max u2 u1} (MonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k (Additive.{u2} G) _inst_1) (MonoidAlgebra.mul.{u1, u2} k G _inst_1 _inst_2) (AddMonoidAlgebra.hasMul.{u1, u2} k (Additive.{u2} G) _inst_1 (Additive.add.{u2} G _inst_2)) (Distrib.toAdd.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (MonoidAlgebra.{u1, u2} k G _inst_1) (MonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_2))) (Distrib.toAdd.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k (Additive.{u2} G) _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k (Additive.{u2} G) _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k (Additive.{u2} G) _inst_1 (Additive.add.{u2} G _inst_2))))
Case conversion may be inaccurate. Consider using '#align monoid_algebra.to_additive MonoidAlgebra.toAdditiveₓ'. -/
/-- The equivalence between `monoid_algebra` and `add_monoid_algebra` in terms of `additive` -/
protected def MonoidAlgebra.toAdditive [Semiring k] [Mul G] :
    MonoidAlgebra k G ≃+* AddMonoidAlgebra k (Additive G) :=
  {
    Finsupp.domCongr Additive.ofMul with
    toFun := equivMapDomain Additive.ofMul
    map_mul' := fun x y => by
      repeat' rw [equiv_map_domain_eq_map_domain]
      dsimp [Additive.ofMul]
      convert MonoidAlgebra.mapDomain_mul (MulHom.id G) _ _ }
#align monoid_algebra.to_additive MonoidAlgebra.toAdditive

namespace AddMonoidAlgebra

variable {k G}

/-! #### Non-unital, non-associative algebra structure -/

section NonUnitalNonAssocAlgebra

variable (k) [Semiring k] [DistribSMul R k] [Add G]

/- warning: add_monoid_algebra.is_scalar_tower_self -> AddMonoidAlgebra.isScalarTower_self is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Add.{u2} G] [_inst_4 : IsScalarTower.{u3, u1, u1} R k k (SMulZeroClass.toHasSmul.{u3, u1} R k (AddZeroClass.toHasZero.{u1} k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)) (Mul.toSMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (SMulZeroClass.toHasSmul.{u3, u1} R k (AddZeroClass.toHasZero.{u1} k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))], IsScalarTower.{u3, max u2 u1, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toHasSmul.{u3, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (AddMonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))) (Mul.toSMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_3)) (SMulZeroClass.toHasSmul.{u3, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (AddMonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)))
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Add.{u2} G] [_inst_4 : IsScalarTower.{u3, u1, u1} R k k (SMulZeroClass.toSMul.{u3, u1} R k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)) (SMulZeroClass.toSMul.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (SMulZeroClass.toSMul.{u3, u1} R k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))], IsScalarTower.{u3, max u2 u1, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toSMul.{u3, max u1 u2} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (AddMonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))) (SMulZeroClass.toSMul.{max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (SMulWithZero.toSMulZeroClass.{max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toSMulWithZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))))) (SMulZeroClass.toSMul.{u3, max u1 u2} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (AddMonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.is_scalar_tower_self AddMonoidAlgebra.isScalarTower_selfₓ'. -/
instance isScalarTower_self [IsScalarTower R k k] :
    IsScalarTower R (AddMonoidAlgebra k G) (AddMonoidAlgebra k G) :=
  @MonoidAlgebra.isScalarTower_self k (Multiplicative G) R _ _ _ _
#align add_monoid_algebra.is_scalar_tower_self AddMonoidAlgebra.isScalarTower_self

/- warning: add_monoid_algebra.smul_comm_class_self -> AddMonoidAlgebra.sMulCommClass_self is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Add.{u2} G] [_inst_4 : SMulCommClass.{u3, u1, u1} R k k (SMulZeroClass.toHasSmul.{u3, u1} R k (AddZeroClass.toHasZero.{u1} k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)) (Mul.toSMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))], SMulCommClass.{u3, max u2 u1, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toHasSmul.{u3, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (AddMonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))) (Mul.toSMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_3))
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Add.{u2} G] [_inst_4 : SMulCommClass.{u3, u1, u1} R k k (SMulZeroClass.toSMul.{u3, u1} R k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)) (SMulZeroClass.toSMul.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))], SMulCommClass.{u3, max u2 u1, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toSMul.{u3, max u1 u2} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (AddMonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))) (SMulZeroClass.toSMul.{max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (SMulWithZero.toSMulZeroClass.{max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toSMulWithZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.smul_comm_class_self AddMonoidAlgebra.sMulCommClass_selfₓ'. -/
/-- Note that if `k` is a `comm_semiring` then we have `smul_comm_class k k k` and so we can take
`R = k` in the below. In other words, if the coefficients are commutative amongst themselves, they
also commute with the algebra multiplication. -/
instance sMulCommClass_self [SMulCommClass R k k] :
    SMulCommClass R (AddMonoidAlgebra k G) (AddMonoidAlgebra k G) :=
  @MonoidAlgebra.sMulCommClass_self k (Multiplicative G) R _ _ _ _
#align add_monoid_algebra.smul_comm_class_self AddMonoidAlgebra.sMulCommClass_self

/- warning: add_monoid_algebra.smul_comm_class_symm_self -> AddMonoidAlgebra.sMulCommClass_symm_self is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Add.{u2} G] [_inst_4 : SMulCommClass.{u1, u3, u1} k R k (Mul.toSMul.{u1} k (Distrib.toHasMul.{u1} k (NonUnitalNonAssocSemiring.toDistrib.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) (SMulZeroClass.toHasSmul.{u3, u1} R k (AddZeroClass.toHasZero.{u1} k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))], SMulCommClass.{max u2 u1, u3, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Mul.toSMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 _inst_3)) (SMulZeroClass.toHasSmul.{u3, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddZeroClass.toHasZero.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoid.toAddZeroClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddCommMonoid.toAddMonoid.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.addCommMonoid.{u2, u1} k G _inst_1)))) (AddMonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSmulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)))
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : DistribSMul.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))] [_inst_3 : Add.{u2} G] [_inst_4 : SMulCommClass.{u1, u3, u1} k R k (SMulZeroClass.toSMul.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (SMulWithZero.toSMulZeroClass.{u1, u1} k k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toSMulWithZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))) (SMulZeroClass.toSMul.{u3, u1} R k (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2))], SMulCommClass.{max u2 u1, u3, max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (SMulZeroClass.toSMul.{max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (SMulWithZero.toSMulZeroClass.{max u1 u2, max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (MulZeroClass.toSMulWithZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))))) (SMulZeroClass.toSMul.{u3, max u1 u2} R (AddMonoidAlgebra.{u1, u2} k G _inst_1) (MulZeroClass.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toMulZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (AddMonoidAlgebra.smulZeroClass.{u1, u2, u3} k G R _inst_1 (DistribSMul.toSMulZeroClass.{u3, u1} R k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))) _inst_2)))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.smul_comm_class_symm_self AddMonoidAlgebra.sMulCommClass_symm_selfₓ'. -/
instance sMulCommClass_symm_self [SMulCommClass k R k] :
    SMulCommClass (AddMonoidAlgebra k G) R (AddMonoidAlgebra k G) :=
  @MonoidAlgebra.sMulCommClass_symm_self k (Multiplicative G) R _ _ _ _
#align add_monoid_algebra.smul_comm_class_symm_self AddMonoidAlgebra.sMulCommClass_symm_self

variable {A : Type u₃} [NonUnitalNonAssocSemiring A]

/- warning: add_monoid_algebra.non_unital_alg_hom_ext -> AddMonoidAlgebra.nonUnitalAlgHom_ext is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Add.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : DistribMulAction.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4))] {φ₁ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5} {φ₂ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5}, (forall (x : G), Eq.{succ u3} A (coeFn.{max (succ (max u2 u1)) (succ u3), max (succ (max u2 u1)) (succ u3)} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) (fun (_x : NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> A) (NonUnitalAlgHom.hasCoeToFun.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))) (coeFn.{max (succ (max u2 u1)) (succ u3), max (succ (max u2 u1)) (succ u3)} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) (fun (_x : NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> A) (NonUnitalAlgHom.hasCoeToFun.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₂ (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) x (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))))))) -> (Eq.{max (succ (max u2 u1)) (succ u3)} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ φ₂)
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Add.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : DistribMulAction.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4))] {φ₁ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5} {φ₂ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5}, (forall (x : G), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.NonUnitalAlg._hyg.1412 : AddMonoidAlgebra.{u1, u2} k G _inst_1) => A) (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 x (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k _inst_1))))) (FunLike.coe.{max (max (succ u1) (succ u2)) (succ u3), max (succ u1) (succ u2), succ u3} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.NonUnitalAlg._hyg.1412 : AddMonoidAlgebra.{u1, u2} k G _inst_1) => A) _x) (NonUnitalAlgHom.instFunLikeNonUnitalAlgHom.{u1, max u1 u2, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 x (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k _inst_1))))) (FunLike.coe.{max (max (succ u1) (succ u2)) (succ u3), max (succ u1) (succ u2), succ u3} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) (AddMonoidAlgebra.{u1, u2} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u1, u2} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.NonUnitalAlg._hyg.1412 : AddMonoidAlgebra.{u1, u2} k G _inst_1) => A) _x) (NonUnitalAlgHom.instFunLikeNonUnitalAlgHom.{u1, max u1 u2, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₂ (AddMonoidAlgebra.single.{u1, u2} k G _inst_1 x (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k _inst_1)))))) -> (Eq.{max (max (succ u1) (succ u2)) (succ u3)} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ φ₂)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.non_unital_alg_hom_ext AddMonoidAlgebra.nonUnitalAlgHom_extₓ'. -/
/-- A non_unital `k`-algebra homomorphism from `add_monoid_algebra k G` is uniquely defined by its
values on the functions `single a 1`. -/
theorem nonUnitalAlgHom_ext [DistribMulAction k A] {φ₁ φ₂ : AddMonoidAlgebra k G →ₙₐ[k] A}
    (h : ∀ x, φ₁ (single x 1) = φ₂ (single x 1)) : φ₁ = φ₂ :=
  @MonoidAlgebra.nonUnitalAlgHom_ext k (Multiplicative G) _ _ _ _ _ φ₁ φ₂ h
#align add_monoid_algebra.non_unital_alg_hom_ext AddMonoidAlgebra.nonUnitalAlgHom_ext

/- warning: add_monoid_algebra.non_unital_alg_hom_ext' -> AddMonoidAlgebra.nonUnitalAlgHom_ext' is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Add.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : DistribMulAction.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4))] {φ₁ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5} {φ₂ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5}, (Eq.{max (succ u3) (succ u2)} (MulHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.hasMul.{u2} G _inst_3) (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4))) (MulHom.comp.{u2, max u2 u1, u3} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (Multiplicative.hasMul.{u2} G _inst_3) (Distrib.toHasMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4)) (NonUnitalAlgHom.toMulHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5 φ₁) (AddMonoidAlgebra.ofMagma.{u1, u2} k G _inst_1 _inst_3)) (MulHom.comp.{u2, max u2 u1, u3} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (Multiplicative.hasMul.{u2} G _inst_3) (Distrib.toHasMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3))) (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4)) (NonUnitalAlgHom.toMulHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5 φ₂) (AddMonoidAlgebra.ofMagma.{u1, u2} k G _inst_1 _inst_3))) -> (Eq.{max (succ (max u2 u1)) (succ u3)} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ φ₂)
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Add.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : DistribMulAction.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4))] {φ₁ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5} {φ₂ : NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5}, (Eq.{max (succ u2) (succ u3)} (MulHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mul.{u2} G _inst_3) (NonUnitalNonAssocSemiring.toMul.{u3} A _inst_4)) (MulHom.comp.{u2, max u1 u2, u3} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (Multiplicative.mul.{u2} G _inst_3) (NonUnitalNonAssocSemiring.toMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)) (NonUnitalNonAssocSemiring.toMul.{u3} A _inst_4) (NonUnitalAlgHom.toMulHom.{u1, max u1 u2, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5 φ₁) (AddMonoidAlgebra.ofMagma.{u1, u2} k G _inst_1 _inst_3)) (MulHom.comp.{u2, max u1 u2, u3} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (Multiplicative.mul.{u2} G _inst_3) (NonUnitalNonAssocSemiring.toMul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3)) (NonUnitalNonAssocSemiring.toMul.{u3} A _inst_4) (NonUnitalAlgHom.toMulHom.{u1, max u1 u2, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5 φ₂) (AddMonoidAlgebra.ofMagma.{u1, u2} k G _inst_1 _inst_3))) -> (Eq.{max (max (succ u1) (succ u2)) (succ u3)} (NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 _inst_5) φ₁ φ₂)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.non_unital_alg_hom_ext' AddMonoidAlgebra.nonUnitalAlgHom_ext'ₓ'. -/
/-- See note [partially-applied ext lemmas]. -/
@[ext]
theorem nonUnitalAlgHom_ext' [DistribMulAction k A] {φ₁ φ₂ : AddMonoidAlgebra k G →ₙₐ[k] A}
    (h : φ₁.toMulHom.comp (ofMagma k G) = φ₂.toMulHom.comp (ofMagma k G)) : φ₁ = φ₂ :=
  @MonoidAlgebra.nonUnitalAlgHom_ext' k (Multiplicative G) _ _ _ _ _ φ₁ φ₂ h
#align add_monoid_algebra.non_unital_alg_hom_ext' AddMonoidAlgebra.nonUnitalAlgHom_ext'

/- warning: add_monoid_algebra.lift_magma -> AddMonoidAlgebra.liftMagma is a dubious translation:
lean 3 declaration is
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Add.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : Module.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)] [_inst_6 : IsScalarTower.{u1, u3, u3} k A A (SMulZeroClass.toHasSmul.{u1, u3} k A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (SMulWithZero.toSmulZeroClass.{u1, u3} k A (MulZeroClass.toHasZero.{u1} k (MulZeroOneClass.toMulZeroClass.{u1} k (MonoidWithZero.toMulZeroOneClass.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5)))) (Mul.toSMul.{u3} A (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4))) (SMulZeroClass.toHasSmul.{u1, u3} k A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (SMulWithZero.toSmulZeroClass.{u1, u3} k A (MulZeroClass.toHasZero.{u1} k (MulZeroOneClass.toMulZeroClass.{u1} k (MonoidWithZero.toMulZeroOneClass.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5))))] [_inst_7 : SMulCommClass.{u1, u3, u3} k A A (SMulZeroClass.toHasSmul.{u1, u3} k A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (SMulWithZero.toSmulZeroClass.{u1, u3} k A (MulZeroClass.toHasZero.{u1} k (MulZeroOneClass.toMulZeroClass.{u1} k (MonoidWithZero.toMulZeroOneClass.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)))) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)))) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5)))) (Mul.toSMul.{u3} A (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4)))], Equiv.{max (succ u3) (succ u2), max (succ (max u2 u1)) (succ u3)} (MulHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.hasMul.{u2} G _inst_3) (Distrib.toHasMul.{u3} A (NonUnitalNonAssocSemiring.toDistrib.{u3} A _inst_4))) (NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 (Module.toDistribMulAction.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5))
but is expected to have type
  forall (k : Type.{u1}) {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_3 : Add.{u2} G] {A : Type.{u3}} [_inst_4 : NonUnitalNonAssocSemiring.{u3} A] [_inst_5 : Module.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4)] [_inst_6 : IsScalarTower.{u1, u3, u3} k A A (SMulZeroClass.toSMul.{u1, u3} k A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (SMulWithZero.toSMulZeroClass.{u1, u3} k A (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5)))) (SMulZeroClass.toSMul.{u3, u3} A A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (SMulWithZero.toSMulZeroClass.{u3, u3} A A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulZeroClass.toSMulWithZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)))) (SMulZeroClass.toSMul.{u1, u3} k A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (SMulWithZero.toSMulZeroClass.{u1, u3} k A (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5))))] [_inst_7 : SMulCommClass.{u1, u3, u3} k A A (SMulZeroClass.toSMul.{u1, u3} k A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (SMulWithZero.toSMulZeroClass.{u1, u3} k A (MonoidWithZero.toZero.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulActionWithZero.toSMulWithZero.{u1, u3} k A (Semiring.toMonoidWithZero.{u1} k _inst_1) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (Module.toMulActionWithZero.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5)))) (SMulZeroClass.toSMul.{u3, u3} A A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (SMulWithZero.toSMulZeroClass.{u3, u3} A A (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulZeroClass.toZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4)) (MulZeroClass.toSMulWithZero.{u3} A (NonUnitalNonAssocSemiring.toMulZeroClass.{u3} A _inst_4))))], Equiv.{max (succ u3) (succ u2), max (succ u3) (succ (max u2 u1))} (MulHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mul.{u2} G _inst_3) (NonUnitalNonAssocSemiring.toMul.{u3} A _inst_4)) (NonUnitalAlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 _inst_3) (AddMonoidAlgebra.distribMulAction.{u1, u2, u1} k G k (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k _inst_1)) _inst_1 (Module.toDistribMulAction.{u1, u1} k k _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))) (Semiring.toModule.{u1} k _inst_1))) _inst_4 (Module.toDistribMulAction.{u1, u3} k A _inst_1 (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A _inst_4) _inst_5))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.lift_magma AddMonoidAlgebra.liftMagmaₓ'. -/
/-- The functor `G ↦ add_monoid_algebra k G`, from the category of magmas to the category of
non-unital, non-associative algebras over `k` is adjoint to the forgetful functor in the other
direction. -/
@[simps]
def liftMagma [Module k A] [IsScalarTower k A A] [SMulCommClass k A A] :
    (Multiplicative G →ₙ* A) ≃ (AddMonoidAlgebra k G →ₙₐ[k] A) :=
  {
    (MonoidAlgebra.liftMagma k :
      (Multiplicative G →ₙ* A) ≃
        (_ →ₙₐ[k]
          A)) with
    toFun := fun f =>
      { (MonoidAlgebra.liftMagma k f : _) with
        toFun := fun a => Sum a fun m t => t • f (Multiplicative.ofAdd m) }
    invFun := fun F => F.toMulHom.comp (ofMagma k G) }
#align add_monoid_algebra.lift_magma AddMonoidAlgebra.liftMagma

end NonUnitalNonAssocAlgebra

/-! #### Algebra structure -/

section Algebra

attribute [local reducible] AddMonoidAlgebra

#print AddMonoidAlgebra.singleZeroRingHom /-
/-- `finsupp.single 0` as a `ring_hom` -/
@[simps]
def singleZeroRingHom [Semiring k] [AddMonoid G] : k →+* AddMonoidAlgebra k G :=
  { Finsupp.singleAddHom 0 with
    map_one' := rfl
    map_mul' := fun x y => by rw [single_add_hom, single_mul_single, zero_add] }
#align add_monoid_algebra.single_zero_ring_hom AddMonoidAlgebra.singleZeroRingHom
-/

/- warning: add_monoid_algebra.ring_hom_ext -> AddMonoidAlgebra.ringHom_ext is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] [_inst_3 : Semiring.{u3} R] {f : RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)} {g : RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)}, (forall (b : k), Eq.{succ u3} R (coeFn.{max (succ (max u2 u1)) (succ u3), max (succ (max u2 u1)) (succ u3)} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> R) (RingHom.hasCoeToFun.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (OfNat.ofNat.{u2} G 0 (OfNat.mk.{u2} G 0 (Zero.zero.{u2} G (AddZeroClass.toHasZero.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2))))) b)) (coeFn.{max (succ (max u2 u1)) (succ u3), max (succ (max u2 u1)) (succ u3)} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> R) (RingHom.hasCoeToFun.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) g (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) (OfNat.ofNat.{u2} G 0 (OfNat.mk.{u2} G 0 (Zero.zero.{u2} G (AddZeroClass.toHasZero.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2))))) b))) -> (forall (a : G), Eq.{succ u3} R (coeFn.{max (succ (max u2 u1)) (succ u3), max (succ (max u2 u1)) (succ u3)} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> R) (RingHom.hasCoeToFun.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))))) (coeFn.{max (succ (max u2 u1)) (succ u3), max (succ (max u2 u1)) (succ u3)} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (fun (_x : RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) => (AddMonoidAlgebra.{u1, u2} k G _inst_1) -> R) (RingHom.hasCoeToFun.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) g (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))) a (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))))))) -> (Eq.{max (succ (max u2 u1)) (succ u3)} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f g)
but is expected to have type
  forall {k : Type.{u2}} {G : Type.{u3}} {R : Type.{u1}} [_inst_1 : Semiring.{u2} k] [_inst_2 : AddMonoid.{u3} G] [_inst_3 : Semiring.{u1} R] {f : RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)} {g : RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)}, (forall (b : k), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) (AddMonoidAlgebra.single.{u2, u3} k G _inst_1 (OfNat.ofNat.{u3} G 0 (Zero.toOfNat0.{u3} G (AddMonoid.toZero.{u3} G _inst_2))) b)) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (MulHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (NonUnitalNonAssocSemiring.toMul.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) f (AddMonoidAlgebra.single.{u2, u3} k G _inst_1 (OfNat.ofNat.{u3} G 0 (Zero.toOfNat0.{u3} G (AddMonoid.toZero.{u3} G _inst_2))) b)) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (MulHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (NonUnitalNonAssocSemiring.toMul.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) g (AddMonoidAlgebra.single.{u2, u3} k G _inst_1 (OfNat.ofNat.{u3} G 0 (Zero.toOfNat0.{u3} G (AddMonoid.toZero.{u3} G _inst_2))) b))) -> (forall (a : G), Eq.{succ u1} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) (AddMonoidAlgebra.single.{u2, u3} k G _inst_1 a (OfNat.ofNat.{u2} k 1 (One.toOfNat1.{u2} k (Semiring.toOne.{u2} k _inst_1))))) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (MulHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (NonUnitalNonAssocSemiring.toMul.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) f (AddMonoidAlgebra.single.{u2, u3} k G _inst_1 a (OfNat.ofNat.{u2} k 1 (One.toOfNat1.{u2} k (Semiring.toOne.{u2} k _inst_1))))) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), max (succ u2) (succ u3), succ u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) (fun (_x : AddMonoidAlgebra.{u2, u3} k G _inst_1) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : AddMonoidAlgebra.{u2, u3} k G _inst_1) => R) _x) (MulHomClass.toFunLike.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (NonUnitalNonAssocSemiring.toMul.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)))) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (NonUnitalRingHomClass.toMulHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHomClass.toNonUnitalRingHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3))))) g (AddMonoidAlgebra.single.{u2, u3} k G _inst_1 a (OfNat.ofNat.{u2} k 1 (One.toOfNat1.{u2} k (Semiring.toOne.{u2} k _inst_1)))))) -> (Eq.{max (max (succ u2) (succ u3)) (succ u1)} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) f g)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.ring_hom_ext AddMonoidAlgebra.ringHom_extₓ'. -/
/-- If two ring homomorphisms from `add_monoid_algebra k G` are equal on all `single a 1`
and `single 0 b`, then they are equal. -/
theorem ringHom_ext {R} [Semiring k] [AddMonoid G] [Semiring R] {f g : AddMonoidAlgebra k G →+* R}
    (h₀ : ∀ b, f (single 0 b) = g (single 0 b)) (h_of : ∀ a, f (single a 1) = g (single a 1)) :
    f = g :=
  @MonoidAlgebra.ringHom_ext k (Multiplicative G) R _ _ _ _ _ h₀ h_of
#align add_monoid_algebra.ring_hom_ext AddMonoidAlgebra.ringHom_ext

/- warning: add_monoid_algebra.ring_hom_ext' -> AddMonoidAlgebra.ringHom_ext' is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] [_inst_3 : Semiring.{u3} R] {f : RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)} {g : RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)}, (Eq.{max (succ u1) (succ u3)} (RingHom.{u1, u3} k R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (RingHom.comp.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3) f (AddMonoidAlgebra.singleZeroRingHom.{u1, u2} k G _inst_1 _inst_2)) (RingHom.comp.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (Semiring.toNonAssocSemiring.{u1} k _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3) g (AddMonoidAlgebra.singleZeroRingHom.{u1, u2} k G _inst_1 _inst_2))) -> (Eq.{max (succ u3) (succ u2)} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (MonoidHom.comp.{u2, max u2 u1, u3} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) ((fun (a : Sort.{max (succ (max u2 u1)) (succ u3)}) (b : Sort.{max (succ u3) (succ (max u2 u1))}) [self : HasLiftT.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} a b] => self.0) (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (HasLiftT.mk.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (CoeTCₓ.coe.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (MonoidHom.hasCoeT.{max u2 u1, u3, max (max u2 u1) u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u2 u1) u3, max u2 u1, u3} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) f) (AddMonoidAlgebra.of.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2))) (MonoidHom.comp.{u2, max u2 u1, u3} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) ((fun (a : Sort.{max (succ (max u2 u1)) (succ u3)}) (b : Sort.{max (succ u3) (succ (max u2 u1))}) [self : HasLiftT.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} a b] => self.0) (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (HasLiftT.mk.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (CoeTCₓ.coe.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3)))) (MonoidHom.hasCoeT.{max u2 u1, u3, max (max u2 u1) u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} R (NonAssocSemiring.toMulZeroOneClass.{u3} R (Semiring.toNonAssocSemiring.{u3} R _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u2 u1) u3, max u2 u1, u3} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3) (RingHom.ringHomClass.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)))))) g) (AddMonoidAlgebra.of.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) -> (Eq.{max (succ (max u2 u1)) (succ u3)} (RingHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G _inst_1 (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} R _inst_3)) f g)
but is expected to have type
  forall {k : Type.{u2}} {G : Type.{u3}} {R : Type.{u1}} [_inst_1 : Semiring.{u2} k] [_inst_2 : AddMonoid.{u3} G] [_inst_3 : Semiring.{u1} R] {f : RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)} {g : RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)}, (Eq.{max (succ u2) (succ u1)} (RingHom.{u2, u1} k R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (RingHom.comp.{u2, max u2 u3, u1} k (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3) f (AddMonoidAlgebra.singleZeroRingHom.{u2, u3} k G _inst_1 _inst_2)) (RingHom.comp.{u2, max u2 u3, u1} k (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (Semiring.toNonAssocSemiring.{u2} k _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3) g (AddMonoidAlgebra.singleZeroRingHom.{u2, u3} k G _inst_1 _inst_2))) -> (Eq.{max (succ u3) (succ u1)} (MonoidHom.{u3, u1} (Multiplicative.{u3} G) R (Multiplicative.mulOneClass.{u3} G (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3)))) (MonoidHom.comp.{u3, max u2 u3, u1} (Multiplicative.{u3} G) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (Multiplicative.mulOneClass.{u3} G (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (MonoidHomClass.toMonoidHom.{max u2 u3, u1, max (max u2 u3) u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MulZeroOneClass.toMulOneClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) f) (AddMonoidAlgebra.of.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2))) (MonoidHom.comp.{u3, max u2 u3, u1} (Multiplicative.{u3} G) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (Multiplicative.mulOneClass.{u3} G (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (MonoidHomClass.toMonoidHom.{max u2 u3, u1, max (max u2 u3) u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (MulZeroOneClass.toMulOneClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (NonAssocSemiring.toMulZeroOneClass.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_1) (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u1} R (NonAssocSemiring.toMulZeroOneClass.{u1} R (Semiring.toNonAssocSemiring.{u1} R _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u2 u3) u1, max u2 u3, u1} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3) (RingHom.instRingHomClassRingHom.{max u2 u3, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3))) g) (AddMonoidAlgebra.of.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)))) -> (Eq.{max (max (succ u2) (succ u3)) (succ u1)} (RingHom.{max u3 u2, u1} (AddMonoidAlgebra.{u2, u3} k G _inst_1) R (AddMonoidAlgebra.nonAssocSemiring.{u2, u3} k G _inst_1 (AddMonoid.toAddZeroClass.{u3} G _inst_2)) (Semiring.toNonAssocSemiring.{u1} R _inst_3)) f g)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.ring_hom_ext' AddMonoidAlgebra.ringHom_ext'ₓ'. -/
/-- If two ring homomorphisms from `add_monoid_algebra k G` are equal on all `single a 1`
and `single 0 b`, then they are equal.

See note [partially-applied ext lemmas]. -/
@[ext]
theorem ringHom_ext' {R} [Semiring k] [AddMonoid G] [Semiring R] {f g : AddMonoidAlgebra k G →+* R}
    (h₁ : f.comp singleZeroRingHom = g.comp singleZeroRingHom)
    (h_of :
      (f : AddMonoidAlgebra k G →* R).comp (of k G) =
        (g : AddMonoidAlgebra k G →* R).comp (of k G)) :
    f = g :=
  ringHom_ext (RingHom.congr_fun h₁) (MonoidHom.congr_fun h_of)
#align add_monoid_algebra.ring_hom_ext' AddMonoidAlgebra.ringHom_ext'

section Opposite

open Finsupp MulOpposite

variable [Semiring k]

/- warning: add_monoid_algebra.op_ring_equiv -> AddMonoidAlgebra.opRingEquiv is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddCommMonoid.{u2} G], RingEquiv.{max u2 u1, max u2 u1} (MulOpposite.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1)) (AddMonoidAlgebra.{u1, u2} (MulOpposite.{u1} k) G (MulOpposite.semiring.{u1} k _inst_1)) (MulOpposite.hasMul.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 (AddZeroClass.toHasAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (AddCommMonoid.toAddMonoid.{u2} G _inst_2))))) (MulOpposite.hasAdd.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Finsupp.add.{u2, u1} G k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1))))))) (AddMonoidAlgebra.hasMul.{u1, u2} (MulOpposite.{u1} k) G (MulOpposite.semiring.{u1} k _inst_1) (AddZeroClass.toHasAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (AddCommMonoid.toAddMonoid.{u2} G _inst_2)))) (Finsupp.add.{u2, u1} G (MulOpposite.{u1} k) (MulOpposite.addZeroClass.{u1} k (AddMonoid.toAddZeroClass.{u1} k (AddMonoidWithOne.toAddMonoid.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_1)))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : Semiring.{u1} k] [_inst_2 : AddCommMonoid.{u2} G], RingEquiv.{max u2 u1, max u2 u1} (MulOpposite.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_1)) (AddMonoidAlgebra.{u1, u2} (MulOpposite.{u1} k) G (MulOpposite.semiring.{u1} k _inst_1)) (MulOpposite.mul.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.hasMul.{u1, u2} k G _inst_1 (AddZeroClass.toAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (AddCommMonoid.toAddMonoid.{u2} G _inst_2))))) (AddMonoidAlgebra.hasMul.{u1, u2} (MulOpposite.{u1} k) G (MulOpposite.semiring.{u1} k _inst_1) (AddZeroClass.toAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (AddCommMonoid.toAddMonoid.{u2} G _inst_2)))) (MulOpposite.add.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (Distrib.toAdd.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G _inst_1) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} k G _inst_1 (AddZeroClass.toAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (AddCommMonoid.toAddMonoid.{u2} G _inst_2))))))) (Distrib.toAdd.{max u1 u2} (AddMonoidAlgebra.{u1, u2} (MulOpposite.{u1} k) G (MulOpposite.semiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toDistrib.{max u1 u2} (AddMonoidAlgebra.{u1, u2} (MulOpposite.{u1} k) G (MulOpposite.semiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonUnitalNonAssocSemiring.{u1, u2} (MulOpposite.{u1} k) G (MulOpposite.semiring.{u1} k _inst_1) (AddZeroClass.toAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G (AddCommMonoid.toAddMonoid.{u2} G _inst_2))))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.op_ring_equiv AddMonoidAlgebra.opRingEquivₓ'. -/
/-- The opposite of an `add_monoid_algebra R I` is ring equivalent to
the `add_monoid_algebra Rᵐᵒᵖ I` over the opposite ring, taking elements to their opposite. -/
@[simps (config := { simpRhs := true })]
protected noncomputable def opRingEquiv [AddCommMonoid G] :
    (AddMonoidAlgebra k G)ᵐᵒᵖ ≃+* AddMonoidAlgebra kᵐᵒᵖ G :=
  {
    MulOpposite.opAddEquiv.symm.trans
      (Finsupp.mapRange.addEquiv (MulOpposite.opAddEquiv : k ≃+ kᵐᵒᵖ)) with
    map_mul' := by
      dsimp only [[anonymous], ← AddEquiv.coe_toAddMonoidHom]
      rw [AddMonoidHom.map_mul_iff]
      ext (i r i' r') : 6
      dsimp
      simp only [map_range_single, single_mul_single, ← op_mul, add_comm] }
#align add_monoid_algebra.op_ring_equiv AddMonoidAlgebra.opRingEquiv

#print AddMonoidAlgebra.opRingEquiv_single /-
@[simp]
theorem opRingEquiv_single [AddCommMonoid G] (r : k) (x : G) :
    AddMonoidAlgebra.opRingEquiv (op (single x r)) = single x (op r) := by simp
#align add_monoid_algebra.op_ring_equiv_single AddMonoidAlgebra.opRingEquiv_single
-/

#print AddMonoidAlgebra.opRingEquiv_symm_single /-
@[simp]
theorem opRingEquiv_symm_single [AddCommMonoid G] (r : kᵐᵒᵖ) (x : Gᵐᵒᵖ) :
    AddMonoidAlgebra.opRingEquiv.symm (single x r) = op (single x r.unop) := by simp
#align add_monoid_algebra.op_ring_equiv_symm_single AddMonoidAlgebra.opRingEquiv_symm_single
-/

end Opposite

/-- The instance `algebra R (add_monoid_algebra k G)` whenever we have `algebra R k`.

In particular this provides the instance `algebra k (add_monoid_algebra k G)`.
-/
instance [CommSemiring R] [Semiring k] [Algebra R k] [AddMonoid G] :
    Algebra R (AddMonoidAlgebra k G) :=
  {
    singleZeroRingHom.comp
      (algebraMap R
        k) with
    smul_def' := fun r a => by
      ext
      simp [single_zero_mul_apply, Algebra.smul_def, Pi.smul_apply]
    commutes' := fun r f => by
      ext
      simp [single_zero_mul_apply, mul_single_zero_apply, Algebra.commutes] }

#print AddMonoidAlgebra.singleZeroAlgHom /-
/-- `finsupp.single 0` as a `alg_hom` -/
@[simps]
def singleZeroAlgHom [CommSemiring R] [Semiring k] [Algebra R k] [AddMonoid G] :
    k →ₐ[R] AddMonoidAlgebra k G :=
  { singleZeroRingHom with
    commutes' := fun r => by
      ext
      simp
      rfl }
#align add_monoid_algebra.single_zero_alg_hom AddMonoidAlgebra.singleZeroAlgHom
-/

/- warning: add_monoid_algebra.coe_algebra_map -> AddMonoidAlgebra.coe_algebraMap is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {R : Type.{u3}} [_inst_1 : CommSemiring.{u3} R] [_inst_2 : Semiring.{u1} k] [_inst_3 : Algebra.{u3, u1} R k _inst_1 _inst_2] [_inst_4 : AddMonoid.{u2} G], Eq.{max (succ u3) (succ u2) (succ u1)} ((fun (_x : RingHom.{u3, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_2) (Semiring.toNonAssocSemiring.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_2) (AddMonoidAlgebra.semiring.{u1, u2} k G _inst_2 _inst_4))) => R -> (AddMonoidAlgebra.{u1, u2} k G _inst_2)) (algebraMap.{u3, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_2) _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G _inst_2 _inst_4) (AddMonoidAlgebra.algebra.{u1, u2, u3} k G R _inst_1 _inst_2 _inst_3 _inst_4))) (coeFn.{max (succ u3) (succ (max u2 u1)), max (succ u3) (succ (max u2 u1))} (RingHom.{u3, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_2) (Semiring.toNonAssocSemiring.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_2) (AddMonoidAlgebra.semiring.{u1, u2} k G _inst_2 _inst_4))) (fun (_x : RingHom.{u3, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_2) (Semiring.toNonAssocSemiring.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_2) (AddMonoidAlgebra.semiring.{u1, u2} k G _inst_2 _inst_4))) => R -> (AddMonoidAlgebra.{u1, u2} k G _inst_2)) (RingHom.hasCoeToFun.{u3, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_2) (Semiring.toNonAssocSemiring.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G _inst_2) (AddMonoidAlgebra.semiring.{u1, u2} k G _inst_2 _inst_4))) (algebraMap.{u3, max u2 u1} R (AddMonoidAlgebra.{u1, u2} k G _inst_2) _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G _inst_2 _inst_4) (AddMonoidAlgebra.algebra.{u1, u2, u3} k G R _inst_1 _inst_2 _inst_3 _inst_4))) (Function.comp.{succ u3, succ u1, max (succ u2) (succ u1)} R k (AddMonoidAlgebra.{u1, u2} k G _inst_2) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k _inst_2)))) (OfNat.ofNat.{u2} G 0 (OfNat.mk.{u2} G 0 (Zero.zero.{u2} G (AddZeroClass.toHasZero.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_4)))))) (coeFn.{max (succ u3) (succ u1), max (succ u3) (succ u1)} (RingHom.{u3, u1} R k (Semiring.toNonAssocSemiring.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (Semiring.toNonAssocSemiring.{u1} k _inst_2)) (fun (_x : RingHom.{u3, u1} R k (Semiring.toNonAssocSemiring.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (Semiring.toNonAssocSemiring.{u1} k _inst_2)) => R -> k) (RingHom.hasCoeToFun.{u3, u1} R k (Semiring.toNonAssocSemiring.{u3} R (CommSemiring.toSemiring.{u3} R _inst_1)) (Semiring.toNonAssocSemiring.{u1} k _inst_2)) (algebraMap.{u3, u1} R k _inst_1 _inst_2 _inst_3)))
but is expected to have type
  forall {k : Type.{u2}} {G : Type.{u3}} {R : Type.{u1}} [_inst_1 : CommSemiring.{u1} R] [_inst_2 : Semiring.{u2} k] [_inst_3 : Algebra.{u1, u2} R k _inst_1 _inst_2] [_inst_4 : AddMonoid.{u3} G], Eq.{max (max (succ u2) (succ u3)) (succ u1)} (forall (a : R), (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => AddMonoidAlgebra.{u2, u3} k G _inst_2) a) (FunLike.coe.{max (max (succ u2) (succ u3)) (succ u1), succ u1, max (succ u2) (succ u3)} (RingHom.{u1, max u3 u2} R (AddMonoidAlgebra.{u2, u3} k G _inst_2) (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (AddMonoidAlgebra.{u2, u3} k G _inst_2) (AddMonoidAlgebra.semiring.{u2, u3} k G _inst_2 _inst_4))) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => AddMonoidAlgebra.{u2, u3} k G _inst_2) _x) (MulHomClass.toFunLike.{max (max u2 u3) u1, u1, max u2 u3} (RingHom.{u1, max u3 u2} R (AddMonoidAlgebra.{u2, u3} k G _inst_2) (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (AddMonoidAlgebra.{u2, u3} k G _inst_2) (AddMonoidAlgebra.semiring.{u2, u3} k G _inst_2 _inst_4))) R (AddMonoidAlgebra.{u2, u3} k G _inst_2) (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_2) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_2) (Semiring.toNonAssocSemiring.{max u3 u2} (AddMonoidAlgebra.{u2, u3} k G _inst_2) (AddMonoidAlgebra.semiring.{u2, u3} k G _inst_2 _inst_4)))) (NonUnitalRingHomClass.toMulHomClass.{max (max u2 u3) u1, u1, max u2 u3} (RingHom.{u1, max u3 u2} R (AddMonoidAlgebra.{u2, u3} k G _inst_2) (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (AddMonoidAlgebra.{u2, u3} k G _inst_2) (AddMonoidAlgebra.semiring.{u2, u3} k G _inst_2 _inst_4))) R (AddMonoidAlgebra.{u2, u3} k G _inst_2) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u2, u3} k G _inst_2) (Semiring.toNonAssocSemiring.{max u3 u2} (AddMonoidAlgebra.{u2, u3} k G _inst_2) (AddMonoidAlgebra.semiring.{u2, u3} k G _inst_2 _inst_4))) (RingHomClass.toNonUnitalRingHomClass.{max (max u2 u3) u1, u1, max u2 u3} (RingHom.{u1, max u3 u2} R (AddMonoidAlgebra.{u2, u3} k G _inst_2) (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (AddMonoidAlgebra.{u2, u3} k G _inst_2) (AddMonoidAlgebra.semiring.{u2, u3} k G _inst_2 _inst_4))) R (AddMonoidAlgebra.{u2, u3} k G _inst_2) (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (AddMonoidAlgebra.{u2, u3} k G _inst_2) (AddMonoidAlgebra.semiring.{u2, u3} k G _inst_2 _inst_4)) (RingHom.instRingHomClassRingHom.{u1, max u2 u3} R (AddMonoidAlgebra.{u2, u3} k G _inst_2) (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{max u3 u2} (AddMonoidAlgebra.{u2, u3} k G _inst_2) (AddMonoidAlgebra.semiring.{u2, u3} k G _inst_2 _inst_4)))))) (algebraMap.{u1, max u3 u2} R (AddMonoidAlgebra.{u2, u3} k G _inst_2) _inst_1 (AddMonoidAlgebra.semiring.{u2, u3} k G _inst_2 _inst_4) (AddMonoidAlgebra.algebra.{u2, u3, u1} k G R _inst_1 _inst_2 _inst_3 _inst_4))) (Function.comp.{succ u1, succ u2, max (succ u3) (succ u2)} R k (AddMonoidAlgebra.{u2, u3} k G _inst_2) (AddMonoidAlgebra.single.{u2, u3} k G _inst_2 (OfNat.ofNat.{u3} G 0 (Zero.toOfNat0.{u3} G (AddMonoid.toZero.{u3} G _inst_4)))) (FunLike.coe.{max (succ u2) (succ u1), succ u1, succ u2} (RingHom.{u1, u2} R k (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} k _inst_2)) R (fun (_x : R) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : R) => k) _x) (MulHomClass.toFunLike.{max u2 u1, u1, u2} (RingHom.{u1, u2} R k (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} k _inst_2)) R k (NonUnitalNonAssocSemiring.toMul.{u1} R (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{u2} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_2))) (NonUnitalRingHomClass.toMulHomClass.{max u2 u1, u1, u2} (RingHom.{u1, u2} R k (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} k _inst_2)) R k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} R (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u2} k (Semiring.toNonAssocSemiring.{u2} k _inst_2)) (RingHomClass.toNonUnitalRingHomClass.{max u2 u1, u1, u2} (RingHom.{u1, u2} R k (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} k _inst_2)) R k (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} k _inst_2) (RingHom.instRingHomClassRingHom.{u1, u2} R k (Semiring.toNonAssocSemiring.{u1} R (CommSemiring.toSemiring.{u1} R _inst_1)) (Semiring.toNonAssocSemiring.{u2} k _inst_2))))) (algebraMap.{u1, u2} R k _inst_1 _inst_2 _inst_3)))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.coe_algebra_map AddMonoidAlgebra.coe_algebraMapₓ'. -/
@[simp]
theorem coe_algebraMap [CommSemiring R] [Semiring k] [Algebra R k] [AddMonoid G] :
    (algebraMap R (AddMonoidAlgebra k G) : R → AddMonoidAlgebra k G) = single 0 ∘ algebraMap R k :=
  rfl
#align add_monoid_algebra.coe_algebra_map AddMonoidAlgebra.coe_algebraMap

end Algebra

section lift

variable {k G} [CommSemiring k] [AddMonoid G]

variable {A : Type u₃} [Semiring A] [Algebra k A] {B : Type _} [Semiring B] [Algebra k B]

/- warning: add_monoid_algebra.lift_nc_alg_hom -> AddMonoidAlgebra.liftNCAlgHom is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] {B : Type.{u4}} [_inst_5 : Semiring.{u4} B] [_inst_6 : Algebra.{u1, u4} k B _inst_1 _inst_5] (f : AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) (g : MonoidHom.{u2, u4} (Multiplicative.{u2} G) B (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))), (forall (x : A) (y : Multiplicative.{u2} G), Commute.{u4} B (Distrib.toHasMul.{u4} B (NonUnitalNonAssocSemiring.toDistrib.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (coeFn.{max (succ u3) (succ u4), max (succ u3) (succ u4)} (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) (fun (_x : AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) => A -> B) ([anonymous].{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) f x) (coeFn.{max (succ u4) (succ u2), max (succ u2) (succ u4)} (MonoidHom.{u2, u4} (Multiplicative.{u2} G) B (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (fun (_x : MonoidHom.{u2, u4} (Multiplicative.{u2} G) B (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) => (Multiplicative.{u2} G) -> B) (MonoidHom.hasCoeToFun.{u2, u4} (Multiplicative.{u2} G) B (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) g y)) -> (AlgHom.{u1, max u2 u3, u4} k (AddMonoidAlgebra.{u3, u2} A G _inst_3) B _inst_1 (AddMonoidAlgebra.semiring.{u3, u2} A G _inst_3 _inst_2) _inst_5 (AddMonoidAlgebra.algebra.{u3, u2, u1} A G k _inst_1 _inst_3 _inst_4 _inst_2) _inst_6)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] {B : Type.{u4}} [_inst_5 : Semiring.{u4} B] [_inst_6 : Algebra.{u1, u4} k B _inst_1 _inst_5] (f : AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) (g : MonoidHom.{u2, u4} (Multiplicative.{u2} G) B (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))), (forall (x : A) (y : Multiplicative.{u2} G), Commute.{u4} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) x) (NonUnitalNonAssocSemiring.toMul.{u4} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) x) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) x) (Semiring.toNonAssocSemiring.{u4} ((fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) x) _inst_5))) (FunLike.coe.{max (succ u3) (succ u4), succ u3, succ u4} (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) A (fun (_x : A) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : A) => B) _x) (SMulHomClass.toFunLike.{max u3 u4, u1, u3, u4} (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) k A B (SMulZeroClass.toSMul.{u1, u3} k A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribSMul.toSMulZeroClass.{u1, u3} k A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribMulAction.toDistribSMul.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4))))) (SMulZeroClass.toSMul.{u1, u4} k B (AddMonoid.toZero.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))))) (DistribSMul.toSMulZeroClass.{u1, u4} k B (AddMonoid.toAddZeroClass.{u4} B (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))))) (DistribMulAction.toDistribSMul.{u1, u4} k B (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (Module.toDistribMulAction.{u1, u4} k B (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))) (Algebra.toModule.{u1, u4} k B _inst_1 _inst_5 _inst_6))))) (DistribMulActionHomClass.toSMulHomClass.{max u3 u4, u1, u3, u4} (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) k A B (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (AddCommMonoid.toAddMonoid.{u4} B (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4)) (Module.toDistribMulAction.{u1, u4} k B (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))) (Algebra.toModule.{u1, u4} k B _inst_1 _inst_5 _inst_6)) (NonUnitalAlgHomClass.toDistribMulActionHomClass.{max u3 u4, u1, u3, u4} (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) k A B (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4)) (Module.toDistribMulAction.{u1, u4} k B (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u4} B (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))) (Algebra.toModule.{u1, u4} k B _inst_1 _inst_5 _inst_6)) (AlgHom.instNonUnitalAlgHomClassToMonoidToMonoidWithZeroToSemiringToNonUnitalNonAssocSemiringToNonAssocSemiringToNonUnitalNonAssocSemiringToNonAssocSemiringToDistribMulActionToAddCommMonoidToModuleToDistribMulActionToAddCommMonoidToModule.{u1, u3, u4, max u3 u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6 (AlgHom.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6) (AlgHom.algHomClass.{u1, u3, u4} k A B _inst_1 _inst_3 _inst_5 _inst_4 _inst_6))))) f x) (FunLike.coe.{max (succ u2) (succ u4), succ u2, succ u4} (MonoidHom.{u2, u4} (Multiplicative.{u2} G) B (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u2} G) => B) _x) (MulHomClass.toFunLike.{max u2 u4, u2, u4} (MonoidHom.{u2, u4} (Multiplicative.{u2} G) B (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (Multiplicative.{u2} G) B (MulOneClass.toMul.{u2} (Multiplicative.{u2} G) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2))) (MulOneClass.toMul.{u4} B (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (MonoidHomClass.toMulHomClass.{max u2 u4, u2, u4} (MonoidHom.{u2, u4} (Multiplicative.{u2} G) B (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))) (Multiplicative.{u2} G) B (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5))) (MonoidHom.monoidHomClass.{u2, u4} (Multiplicative.{u2} G) B (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u4} B (NonAssocSemiring.toMulZeroOneClass.{u4} B (Semiring.toNonAssocSemiring.{u4} B _inst_5)))))) g y)) -> (AlgHom.{u1, max u2 u3, u4} k (AddMonoidAlgebra.{u3, u2} A G _inst_3) B _inst_1 (AddMonoidAlgebra.semiring.{u3, u2} A G _inst_3 _inst_2) _inst_5 (AddMonoidAlgebra.algebra.{u3, u2, u1} A G k _inst_1 _inst_3 _inst_4 _inst_2) _inst_6)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.lift_nc_alg_hom AddMonoidAlgebra.liftNCAlgHomₓ'. -/
/-- `lift_nc_ring_hom` as a `alg_hom`, for when `f` is an `alg_hom` -/
def liftNCAlgHom (f : A →ₐ[k] B) (g : Multiplicative G →* B) (h_comm : ∀ x y, Commute (f x) (g y)) :
    AddMonoidAlgebra A G →ₐ[k] B :=
  {
    liftNCRingHom (f : A →+* B) g
      h_comm with
    toFun := liftNCRingHom (f : A →+* B) g h_comm
    commutes' := by simp [lift_nc_ring_hom] }
#align add_monoid_algebra.lift_nc_alg_hom AddMonoidAlgebra.liftNCAlgHom

#print AddMonoidAlgebra.algHom_ext /-
/-- A `k`-algebra homomorphism from `monoid_algebra k G` is uniquely defined by its
values on the functions `single a 1`. -/
theorem algHom_ext ⦃φ₁ φ₂ : AddMonoidAlgebra k G →ₐ[k] A⦄
    (h : ∀ x, φ₁ (single x 1) = φ₂ (single x 1)) : φ₁ = φ₂ :=
  @MonoidAlgebra.algHom_ext k (Multiplicative G) _ _ _ _ _ _ _ h
#align add_monoid_algebra.alg_hom_ext AddMonoidAlgebra.algHom_ext
-/

/- warning: add_monoid_algebra.alg_hom_ext' -> AddMonoidAlgebra.algHom_ext' is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] {{φ₁ : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4}} {{φ₂ : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4}}, (Eq.{max (succ u3) (succ u2)} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (MonoidHom.comp.{u2, max u2 u1, u3} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) ((fun (a : Sort.{max (succ (max u2 u1)) (succ u3)}) (b : Sort.{max (succ u3) (succ (max u2 u1))}) [self : HasLiftT.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} a b] => self.0) (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (HasLiftT.mk.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (CoeTCₓ.coe.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (MonoidHom.hasCoeT.{max u2 u1, u3, max (max u2 u1) u3} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u2 u1) u3, max u2 u1, u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (AlgHomClass.toRingHomClass.{max (max u2 u1) u3, u1, max u2 u1, u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4 (AlgHom.algHomClass.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4)))))) φ₁) (AddMonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2))) (MonoidHom.comp.{u2, max u2 u1, u3} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) ((fun (a : Sort.{max (succ (max u2 u1)) (succ u3)}) (b : Sort.{max (succ u3) (succ (max u2 u1))}) [self : HasLiftT.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} a b] => self.0) (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (HasLiftT.mk.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (CoeTCₓ.coe.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ (max u2 u1))} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (MonoidHom.hasCoeT.{max u2 u1, u3, max (max u2 u1) u3} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MulZeroOneClass.toMulOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u2 u1} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u2 u1) u3, max u2 u1, u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (AlgHomClass.toRingHomClass.{max (max u2 u1) u3, u1, max u2 u1, u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4 (AlgHom.algHomClass.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4)))))) φ₂) (AddMonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) -> (Eq.{max (succ (max u2 u1)) (succ u3)} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) φ₁ φ₂)
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] {{φ₁ : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4}} {{φ₂ : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4}}, (Eq.{max (succ u2) (succ u3)} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (MonoidHom.comp.{u2, max u1 u2, u3} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (MonoidHomClass.toMonoidHom.{max u1 u2, u3, max (max u1 u2) u3} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u1 u2) u3, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (AlgHomClass.toRingHomClass.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4 (AlgHom.algHomClass.{u1, max u1 u2, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4))) φ₁) (AddMonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2))) (MonoidHom.comp.{u2, max u1 u2, u3} (Multiplicative.{u2} G) (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (MonoidHomClass.toMonoidHom.{max u1 u2, u3, max (max u1 u2) u3} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MulZeroOneClass.toMulOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toMulZeroOneClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (RingHomClass.toMonoidHomClass.{max (max u1 u2) u3, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (AddMonoidAlgebra.nonAssocSemiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (Semiring.toNonAssocSemiring.{u3} A _inst_3) (AlgHomClass.toRingHomClass.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4 (AlgHom.algHomClass.{u1, max u1 u2, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4))) φ₂) (AddMonoidAlgebra.of.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (AddMonoid.toAddZeroClass.{u2} G _inst_2)))) -> (Eq.{max (max (succ u1) (succ u2)) (succ u3)} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) φ₁ φ₂)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.alg_hom_ext' AddMonoidAlgebra.algHom_ext'ₓ'. -/
/-- See note [partially-applied ext lemmas]. -/
@[ext]
theorem algHom_ext' ⦃φ₁ φ₂ : AddMonoidAlgebra k G →ₐ[k] A⦄
    (h :
      (φ₁ : AddMonoidAlgebra k G →* A).comp (of k G) =
        (φ₂ : AddMonoidAlgebra k G →* A).comp (of k G)) :
    φ₁ = φ₂ :=
  algHom_ext <| MonoidHom.congr_fun h
#align add_monoid_algebra.alg_hom_ext' AddMonoidAlgebra.algHom_ext'

variable (k G A)

#print AddMonoidAlgebra.lift /-
/-- Any monoid homomorphism `G →* A` can be lifted to an algebra homomorphism
`monoid_algebra k G →ₐ[k] A`. -/
def lift : (Multiplicative G →* A) ≃ (AddMonoidAlgebra k G →ₐ[k] A) :=
  {
    @MonoidAlgebra.lift k (Multiplicative G) _ _ A _
      _ with
    invFun := fun f => (f : AddMonoidAlgebra k G →* A).comp (of k G)
    toFun := fun F =>
      { @MonoidAlgebra.lift k (Multiplicative G) _ _ A _ _ F with
        toFun := liftNCAlgHom (Algebra.ofId k A) F fun _ _ => Algebra.commutes _ _ } }
#align add_monoid_algebra.lift AddMonoidAlgebra.lift
-/

variable {k G A}

#print AddMonoidAlgebra.lift_apply' /-
theorem lift_apply' (F : Multiplicative G →* A) (f : MonoidAlgebra k G) :
    lift k G A F f = f.Sum fun a b => algebraMap k A b * F (Multiplicative.ofAdd a) :=
  rfl
#align add_monoid_algebra.lift_apply' AddMonoidAlgebra.lift_apply'
-/

#print AddMonoidAlgebra.lift_apply /-
theorem lift_apply (F : Multiplicative G →* A) (f : MonoidAlgebra k G) :
    lift k G A F f = f.Sum fun a b => b • F (Multiplicative.ofAdd a) := by
  simp only [lift_apply', Algebra.smul_def]
#align add_monoid_algebra.lift_apply AddMonoidAlgebra.lift_apply
-/

#print AddMonoidAlgebra.lift_def /-
theorem lift_def (F : Multiplicative G →* A) :
    ⇑(lift k G A F) = liftNC ((algebraMap k A : k →+* A) : k →+ A) F :=
  rfl
#align add_monoid_algebra.lift_def AddMonoidAlgebra.lift_def
-/

/- warning: add_monoid_algebra.lift_symm_apply -> AddMonoidAlgebra.lift_symm_apply is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] (F : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (x : Multiplicative.{u2} G), Eq.{succ u3} A (coeFn.{max (succ u3) (succ u2), max (succ u2) (succ u3)} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (fun (_x : MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) => (Multiplicative.{u2} G) -> A) (MonoidHom.hasCoeToFun.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (coeFn.{max 1 (max (max (succ (max u2 u1)) (succ u3)) (succ u3) (succ u2)) (max (succ u3) (succ u2)) (succ (max u2 u1)) (succ u3), max (max (succ (max u2 u1)) (succ u3)) (succ u3) (succ u2)} (Equiv.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ u2)} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (fun (_x : Equiv.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ u2)} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) => (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) -> (MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (Equiv.hasCoeToFun.{max (succ (max u2 u1)) (succ u3), max (succ u3) (succ u2)} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (Equiv.symm.{max (succ u3) (succ u2), max (succ (max u2 u1)) (succ u3)} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (AddMonoidAlgebra.lift.{u1, u2, u3} k G _inst_1 _inst_2 A _inst_3 _inst_4)) F) x) (coeFn.{max (succ (max u2 u1)) (succ u3), max (succ (max u2 u1)) (succ u3)} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (fun (_x : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) -> A) ([anonymous].{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) F (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) (coeFn.{succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} G) G) (fun (_x : Equiv.{succ u2, succ u2} (Multiplicative.{u2} G) G) => (Multiplicative.{u2} G) -> G) (Equiv.hasCoeToFun.{succ u2, succ u2} (Multiplicative.{u2} G) G) (Multiplicative.toAdd.{u2} G) x) (OfNat.ofNat.{u1} k 1 (OfNat.mk.{u1} k 1 (One.one.{u1} k (AddMonoidWithOne.toOne.{u1} k (AddCommMonoidWithOne.toAddMonoidWithOne.{u1} k (NonAssocSemiring.toAddCommMonoidWithOne.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))))))))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : AddMonoid.{u2} G] {A : Type.{u3}} [_inst_3 : Semiring.{u3} A] [_inst_4 : Algebra.{u1, u3} k A _inst_1 _inst_3] (F : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (x : Multiplicative.{u2} G), Eq.{succ u3} ((fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u2} G) => A) x) (FunLike.coe.{max (succ u2) (succ u3), succ u2, succ u3} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) F) (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : Multiplicative.{u2} G) => A) _x) (MulHomClass.toFunLike.{max u2 u3, u2, u3} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) F) (Multiplicative.{u2} G) A (MulOneClass.toMul.{u2} (Multiplicative.{u2} G) (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2))) (MulOneClass.toMul.{u3} A (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (MonoidHomClass.toMulHomClass.{max u2 u3, u2, u3} ((fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) F) (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (MonoidHom.monoidHomClass.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))))) (FunLike.coe.{max (max (succ u1) (succ u2)) (succ u3), max (max (succ u1) (succ u2)) (succ u3), max (succ u2) (succ u3)} (Equiv.{max (max (succ u1) (succ u2)) (succ u3), max (succ u2) (succ u3)} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (fun (_x : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) => MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) _x) (Equiv.instFunLikeEquiv.{max (max (succ u1) (succ u2)) (succ u3), max (succ u2) (succ u3)} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (Equiv.symm.{max (succ u2) (succ u3), max (max (succ u1) (succ u2)) (succ u3)} (MonoidHom.{u2, u3} (Multiplicative.{u2} G) A (Multiplicative.mulOneClass.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_2)) (MulZeroOneClass.toMulOneClass.{u3} A (NonAssocSemiring.toMulZeroOneClass.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (AddMonoidAlgebra.lift.{u1, u2, u3} k G _inst_1 _inst_2 A _inst_3 _inst_4)) F) x) (FunLike.coe.{max (max (succ u1) (succ u2)) (succ u3), max (succ u1) (succ u2), succ u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (fun (_x : AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) => (fun (x._@.Mathlib.Algebra.Hom.GroupAction._hyg.2186 : AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) => A) _x) (SMulHomClass.toFunLike.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (SMulZeroClass.toSMul.{u1, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoid.toZero.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))))) (DistribSMul.toSMulZeroClass.{u1, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoid.toAddZeroClass.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddCommMonoid.toAddMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))))) (DistribMulAction.toDistribSMul.{u1, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))))) (Module.toDistribMulAction.{u1, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))) (Algebra.toModule.{u1, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2)))))) (SMulZeroClass.toSMul.{u1, u3} k A (AddMonoid.toZero.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribSMul.toSMulZeroClass.{u1, u3} k A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))))) (DistribMulAction.toDistribSMul.{u1, u3} k A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4))))) (DistribMulActionHomClass.toSMulHomClass.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (AddCommMonoid.toAddMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))))) (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)))) (Module.toDistribMulAction.{u1, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))) (Algebra.toModule.{u1, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2))) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4)) (NonUnitalAlgHomClass.toDistribMulActionHomClass.{max (max u1 u2) u3, u1, max u1 u2, u3} (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A (MonoidWithZero.toMonoid.{u1} k (Semiring.toMonoidWithZero.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3)) (Module.toDistribMulAction.{u1, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2)))) (Algebra.toModule.{u1, max u1 u2} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2))) (Module.toDistribMulAction.{u1, u3} k A (CommSemiring.toSemiring.{u1} k _inst_1) (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_3))) (Algebra.toModule.{u1, u3} k A _inst_1 _inst_3 _inst_4)) (AlgHom.instNonUnitalAlgHomClassToMonoidToMonoidWithZeroToSemiringToNonUnitalNonAssocSemiringToNonAssocSemiringToNonUnitalNonAssocSemiringToNonAssocSemiringToDistribMulActionToAddCommMonoidToModuleToDistribMulActionToAddCommMonoidToModule.{u1, max u1 u2, u3, max (max u1 u2) u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4 (AlgHom.{u1, max u2 u1, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4) (AlgHom.algHomClass.{u1, max u1 u2, u3} k (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) A _inst_1 (AddMonoidAlgebra.semiring.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) _inst_2) _inst_3 (AddMonoidAlgebra.algebra.{u1, u2, u1} k G k _inst_1 (CommSemiring.toSemiring.{u1} k _inst_1) (Algebra.id.{u1} k _inst_1) _inst_2) _inst_4))))) F (AddMonoidAlgebra.single.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (FunLike.coe.{succ u2, succ u2, succ u2} (Equiv.{succ u2, succ u2} (Multiplicative.{u2} G) G) (Multiplicative.{u2} G) (fun (_x : Multiplicative.{u2} G) => (fun (x._@.Mathlib.Logic.Equiv.Defs._hyg.808 : Multiplicative.{u2} G) => G) _x) (Equiv.instFunLikeEquiv.{succ u2, succ u2} (Multiplicative.{u2} G) G) (Multiplicative.toAdd.{u2} G) x) (OfNat.ofNat.{u1} k 1 (One.toOfNat1.{u1} k (Semiring.toOne.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.lift_symm_apply AddMonoidAlgebra.lift_symm_applyₓ'. -/
@[simp]
theorem lift_symm_apply (F : AddMonoidAlgebra k G →ₐ[k] A) (x : Multiplicative G) :
    (lift k G A).symm F x = F (single x.toAdd 1) :=
  rfl
#align add_monoid_algebra.lift_symm_apply AddMonoidAlgebra.lift_symm_apply

#print AddMonoidAlgebra.lift_of /-
theorem lift_of (F : Multiplicative G →* A) (x : Multiplicative G) :
    lift k G A F (of k G x) = F x := by rw [of_apply, ← lift_symm_apply, Equiv.symm_apply_apply]
#align add_monoid_algebra.lift_of AddMonoidAlgebra.lift_of
-/

#print AddMonoidAlgebra.lift_single /-
@[simp]
theorem lift_single (F : Multiplicative G →* A) (a b) :
    lift k G A F (single a b) = b • F (Multiplicative.ofAdd a) := by
  rw [lift_def, lift_nc_single, Algebra.smul_def, [anonymous]]
#align add_monoid_algebra.lift_single AddMonoidAlgebra.lift_single
-/

#print AddMonoidAlgebra.lift_unique' /-
theorem lift_unique' (F : AddMonoidAlgebra k G →ₐ[k] A) :
    F = lift k G A ((F : AddMonoidAlgebra k G →* A).comp (of k G)) :=
  ((lift k G A).apply_symm_apply F).symm
#align add_monoid_algebra.lift_unique' AddMonoidAlgebra.lift_unique'
-/

#print AddMonoidAlgebra.lift_unique /-
/-- Decomposition of a `k`-algebra homomorphism from `monoid_algebra k G` by
its values on `F (single a 1)`. -/
theorem lift_unique (F : AddMonoidAlgebra k G →ₐ[k] A) (f : MonoidAlgebra k G) :
    F f = f.Sum fun a b => b • F (single a 1) := by
  conv_lhs =>
    rw [lift_unique' F]
    simp [lift_apply]
#align add_monoid_algebra.lift_unique AddMonoidAlgebra.lift_unique
-/

#print AddMonoidAlgebra.algHom_ext_iff /-
theorem algHom_ext_iff {φ₁ φ₂ : AddMonoidAlgebra k G →ₐ[k] A} :
    (∀ x, φ₁ (Finsupp.single x 1) = φ₂ (Finsupp.single x 1)) ↔ φ₁ = φ₂ :=
  ⟨fun h => algHom_ext h, by rintro rfl _ <;> rfl⟩
#align add_monoid_algebra.alg_hom_ext_iff AddMonoidAlgebra.algHom_ext_iff
-/

end lift

section

attribute [local reducible] AddMonoidAlgebra

universe ui

variable {ι : Type ui}

/- warning: add_monoid_algebra.prod_single -> AddMonoidAlgebra.prod_single is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {ι : Type.{u3}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : AddCommMonoid.{u2} G] {s : Finset.{u3} ι} {a : ι -> G} {b : ι -> k}, Eq.{succ (max u2 u1)} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (Finset.prod.{max u2 u1, u3} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) ι (CommSemiring.toCommMonoid.{max u2 u1} (Finsupp.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)))))) (AddMonoidAlgebra.commSemiring.{u1, u2} k G _inst_1 _inst_2)) s (fun (i : ι) => Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) (a i) (b i))) (Finsupp.single.{u2, u1} G k (MulZeroClass.toHasZero.{u1} k (NonUnitalNonAssocSemiring.toMulZeroClass.{u1} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u1} k (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1))))) (Finset.sum.{u2, u3} G ι _inst_2 s (fun (i : ι) => a i)) (Finset.prod.{u1, u3} k ι (CommSemiring.toCommMonoid.{u1} k _inst_1) s (fun (i : ι) => b i)))
but is expected to have type
  forall {k : Type.{u1}} {G : Type.{u2}} {ι : Type.{u3}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : AddCommMonoid.{u2} G] {s : Finset.{u3} ι} {a : ι -> G} {b : ι -> k}, Eq.{max (succ u1) (succ u2)} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (Finset.prod.{max u2 u1, u3} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) ι (CommSemiring.toCommMonoid.{max u1 u2} (AddMonoidAlgebra.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1)) (AddMonoidAlgebra.commSemiring.{u1, u2} k G _inst_1 _inst_2)) s (fun (i : ι) => AddMonoidAlgebra.single.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (a i) (b i))) (AddMonoidAlgebra.single.{u1, u2} k G (CommSemiring.toSemiring.{u1} k _inst_1) (Finset.sum.{u2, u3} G ι _inst_2 s (fun (i : ι) => a i)) (Finset.prod.{u1, u3} k ι (CommSemiring.toCommMonoid.{u1} k _inst_1) s (fun (i : ι) => b i)))
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.prod_single AddMonoidAlgebra.prod_singleₓ'. -/
theorem prod_single [CommSemiring k] [AddCommMonoid 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
    rw [prod_cons has, ih, single_mul_single, sum_cons has, prod_cons has]
#align add_monoid_algebra.prod_single AddMonoidAlgebra.prod_single

end

/- warning: add_monoid_algebra.map_domain_algebra_map -> AddMonoidAlgebra.mapDomain_algebraMap is a dubious translation:
lean 3 declaration is
  forall {k : Type.{u1}} {G : Type.{u2}} {A : Type.{u3}} {H : Type.{u4}} {F : Type.{u5}} [_inst_1 : CommSemiring.{u1} k] [_inst_2 : Semiring.{u3} A] [_inst_3 : Algebra.{u1, u3} k A _inst_1 _inst_2] [_inst_4 : AddMonoid.{u2} G] [_inst_5 : AddMonoid.{u4} H] [_inst_6 : AddMonoidHomClass.{u5, u2, u4} F G H (AddMonoid.toAddZeroClass.{u2} G _inst_4) (AddMonoid.toAddZeroClass.{u4} H _inst_5)] (f : F) (r : k), Eq.{max (succ u4) (succ u3)} (Finsupp.{u4, u3} H A (AddZeroClass.toHasZero.{u3} A (AddMonoid.toAddZeroClass.{u3} A (AddCommMonoid.toAddMonoid.{u3} A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_2))))))) (Finsupp.mapDomain.{u2, u4, u3} G H A (NonUnitalNonAssocSemiring.toAddCommMonoid.{u3} A (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u3} A (Semiring.toNonAssocSemiring.{u3} A _inst_2))) (coeFn.{succ u5, max (succ u2) (succ u4)} F (fun (_x : F) => G -> H) (FunLike.hasCoeToFun.{succ u5, succ u2, succ u4} F G (fun (_x : G) => H) (AddHomClass.toFunLike.{u5, u2, u4} F G H (AddZeroClass.toHasAdd.{u2} G (AddMonoid.toAddZeroClass.{u2} G _inst_4)) (AddZeroClass.toHasAdd.{u4} H (AddMonoid.toAddZeroClass.{u4} H _inst_5)) (AddMonoidHomClass.toAddHomClass.{u5, u2, u4} F G H (AddMonoid.toAddZeroClass.{u2} G _inst_4) (AddMonoid.toAddZeroClass.{u4} H _inst_5) _inst_6))) f) (coeFn.{max (succ u1) (succ (max u2 u3)), max (succ u1) (succ (max u2 u3))} (RingHom.{u1, max u2 u3} k (AddMonoidAlgebra.{u3, u2} A G _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u3, u2} A G _inst_2) (AddMonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4))) (fun (_x : RingHom.{u1, max u2 u3} k (AddMonoidAlgebra.{u3, u2} A G _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u3, u2} A G _inst_2) (AddMonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4))) => k -> (AddMonoidAlgebra.{u3, u2} A G _inst_2)) (RingHom.hasCoeToFun.{u1, max u2 u3} k (AddMonoidAlgebra.{u3, u2} A G _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u3, u2} A G _inst_2) (AddMonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4))) (algebraMap.{u1, max u2 u3} k (AddMonoidAlgebra.{u3, u2} A G _inst_2) _inst_1 (AddMonoidAlgebra.semiring.{u3, u2} A G _inst_2 _inst_4) (AddMonoidAlgebra.algebra.{u3, u2, u1} A G k _inst_1 _inst_2 _inst_3 _inst_4)) r)) (coeFn.{max (succ u1) (succ (max u4 u3)), max (succ u1) (succ (max u4 u3))} (RingHom.{u1, max u4 u3} k (AddMonoidAlgebra.{u3, u4} A H _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u4 u3} (AddMonoidAlgebra.{u3, u4} A H _inst_2) (AddMonoidAlgebra.semiring.{u3, u4} A H _inst_2 _inst_5))) (fun (_x : RingHom.{u1, max u4 u3} k (AddMonoidAlgebra.{u3, u4} A H _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u4 u3} (AddMonoidAlgebra.{u3, u4} A H _inst_2) (AddMonoidAlgebra.semiring.{u3, u4} A H _inst_2 _inst_5))) => k -> (AddMonoidAlgebra.{u3, u4} A H _inst_2)) (RingHom.hasCoeToFun.{u1, max u4 u3} k (AddMonoidAlgebra.{u3, u4} A H _inst_2) (Semiring.toNonAssocSemiring.{u1} k (CommSemiring.toSemiring.{u1} k _inst_1)) (Semiring.toNonAssocSemiring.{max u4 u3} (AddMonoidAlgebra.{u3, u4} A H _inst_2) (AddMonoidAlgebra.semiring.{u3, u4} A H _inst_2 _inst_5))) (algebraMap.{u1, max u4 u3} k (AddMonoidAlgebra.{u3, u4} A H _inst_2) _inst_1 (AddMonoidAlgebra.semiring.{u3, u4} A H _inst_2 _inst_5) (AddMonoidAlgebra.algebra.{u3, u4, u1} A H k _inst_1 _inst_2 _inst_3 _inst_5)) r)
but is expected to have type
  forall {k : Type.{u4}} {G : Type.{u5}} {A : Type.{u3}} {H : Type.{u2}} {F : Type.{u1}} [_inst_1 : CommSemiring.{u4} k] [_inst_2 : Semiring.{u3} A] [_inst_3 : Algebra.{u4, u3} k A _inst_1 _inst_2] [_inst_4 : AddMonoid.{u5} G] [_inst_5 : AddMonoid.{u2} H] [_inst_6 : AddMonoidHomClass.{u1, u5, u2} F G H (AddMonoid.toAddZeroClass.{u5} G _inst_4) (AddMonoid.toAddZeroClass.{u2} H _inst_5)] (f : F) (r : k), Eq.{max (succ u3) (succ u2)} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (AddMonoidAlgebra.mapDomain.{u3, u5, u2} A G _inst_2 H (FunLike.coe.{succ u1, succ u5, succ u2} F G (fun (_x : G) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.403 : G) => H) _x) (AddHomClass.toFunLike.{u1, u5, u2} F G H (AddZeroClass.toAdd.{u5} G (AddMonoid.toAddZeroClass.{u5} G _inst_4)) (AddZeroClass.toAdd.{u2} H (AddMonoid.toAddZeroClass.{u2} H _inst_5)) (AddMonoidHomClass.toAddHomClass.{u1, u5, u2} F G H (AddMonoid.toAddZeroClass.{u5} G _inst_4) (AddMonoid.toAddZeroClass.{u2} H _inst_5) _inst_6)) f) (FunLike.coe.{max (max (succ u4) (succ u5)) (succ u3), succ u4, max (succ u5) (succ u3)} (RingHom.{u4, max u5 u3} k (AddMonoidAlgebra.{u3, u5} A G _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u5 u3} (AddMonoidAlgebra.{u3, u5} A G _inst_2) (AddMonoidAlgebra.semiring.{u3, u5} A G _inst_2 _inst_4))) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => AddMonoidAlgebra.{u3, u5} A G _inst_2) _x) (MulHomClass.toFunLike.{max (max u4 u5) u3, u4, max u5 u3} (RingHom.{u4, max u5 u3} k (AddMonoidAlgebra.{u3, u5} A G _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u5 u3} (AddMonoidAlgebra.{u3, u5} A G _inst_2) (AddMonoidAlgebra.semiring.{u3, u5} A G _inst_2 _inst_4))) k (AddMonoidAlgebra.{u3, u5} A G _inst_2) (NonUnitalNonAssocSemiring.toMul.{u4} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} k (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{max u5 u3} (AddMonoidAlgebra.{u3, u5} A G _inst_2) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u5 u3} (AddMonoidAlgebra.{u3, u5} A G _inst_2) (Semiring.toNonAssocSemiring.{max u5 u3} (AddMonoidAlgebra.{u3, u5} A G _inst_2) (AddMonoidAlgebra.semiring.{u3, u5} A G _inst_2 _inst_4)))) (NonUnitalRingHomClass.toMulHomClass.{max (max u4 u5) u3, u4, max u5 u3} (RingHom.{u4, max u5 u3} k (AddMonoidAlgebra.{u3, u5} A G _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u5 u3} (AddMonoidAlgebra.{u3, u5} A G _inst_2) (AddMonoidAlgebra.semiring.{u3, u5} A G _inst_2 _inst_4))) k (AddMonoidAlgebra.{u3, u5} A G _inst_2) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} k (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u5 u3} (AddMonoidAlgebra.{u3, u5} A G _inst_2) (Semiring.toNonAssocSemiring.{max u5 u3} (AddMonoidAlgebra.{u3, u5} A G _inst_2) (AddMonoidAlgebra.semiring.{u3, u5} A G _inst_2 _inst_4))) (RingHomClass.toNonUnitalRingHomClass.{max (max u4 u5) u3, u4, max u5 u3} (RingHom.{u4, max u5 u3} k (AddMonoidAlgebra.{u3, u5} A G _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u5 u3} (AddMonoidAlgebra.{u3, u5} A G _inst_2) (AddMonoidAlgebra.semiring.{u3, u5} A G _inst_2 _inst_4))) k (AddMonoidAlgebra.{u3, u5} A G _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u5 u3} (AddMonoidAlgebra.{u3, u5} A G _inst_2) (AddMonoidAlgebra.semiring.{u3, u5} A G _inst_2 _inst_4)) (RingHom.instRingHomClassRingHom.{u4, max u5 u3} k (AddMonoidAlgebra.{u3, u5} A G _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u5 u3} (AddMonoidAlgebra.{u3, u5} A G _inst_2) (AddMonoidAlgebra.semiring.{u3, u5} A G _inst_2 _inst_4)))))) (algebraMap.{u4, max u5 u3} k (AddMonoidAlgebra.{u3, u5} A G _inst_2) _inst_1 (AddMonoidAlgebra.semiring.{u3, u5} A G _inst_2 _inst_4) (AddMonoidAlgebra.algebra.{u3, u5, u4} A G k _inst_1 _inst_2 _inst_3 _inst_4)) r)) (FunLike.coe.{max (max (succ u4) (succ u3)) (succ u2), succ u4, max (succ u3) (succ u2)} (RingHom.{u4, max u2 u3} k (AddMonoidAlgebra.{u3, u2} A H _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (AddMonoidAlgebra.semiring.{u3, u2} A H _inst_2 _inst_5))) k (fun (_x : k) => (fun (x._@.Mathlib.Algebra.Hom.Group._hyg.2391 : k) => AddMonoidAlgebra.{u3, u2} A H _inst_2) _x) (MulHomClass.toFunLike.{max (max u4 u3) u2, u4, max u3 u2} (RingHom.{u4, max u2 u3} k (AddMonoidAlgebra.{u3, u2} A H _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (AddMonoidAlgebra.semiring.{u3, u2} A H _inst_2 _inst_5))) k (AddMonoidAlgebra.{u3, u2} A H _inst_2) (NonUnitalNonAssocSemiring.toMul.{u4} k (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} k (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)))) (NonUnitalNonAssocSemiring.toMul.{max u3 u2} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u3 u2} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (Semiring.toNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (AddMonoidAlgebra.semiring.{u3, u2} A H _inst_2 _inst_5)))) (NonUnitalRingHomClass.toMulHomClass.{max (max u4 u3) u2, u4, max u3 u2} (RingHom.{u4, max u2 u3} k (AddMonoidAlgebra.{u3, u2} A H _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (AddMonoidAlgebra.semiring.{u3, u2} A H _inst_2 _inst_5))) k (AddMonoidAlgebra.{u3, u2} A H _inst_2) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{u4} k (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1))) (NonAssocSemiring.toNonUnitalNonAssocSemiring.{max u3 u2} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (Semiring.toNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (AddMonoidAlgebra.semiring.{u3, u2} A H _inst_2 _inst_5))) (RingHomClass.toNonUnitalRingHomClass.{max (max u4 u3) u2, u4, max u3 u2} (RingHom.{u4, max u2 u3} k (AddMonoidAlgebra.{u3, u2} A H _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (AddMonoidAlgebra.semiring.{u3, u2} A H _inst_2 _inst_5))) k (AddMonoidAlgebra.{u3, u2} A H _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (AddMonoidAlgebra.semiring.{u3, u2} A H _inst_2 _inst_5)) (RingHom.instRingHomClassRingHom.{u4, max u3 u2} k (AddMonoidAlgebra.{u3, u2} A H _inst_2) (Semiring.toNonAssocSemiring.{u4} k (CommSemiring.toSemiring.{u4} k _inst_1)) (Semiring.toNonAssocSemiring.{max u2 u3} (AddMonoidAlgebra.{u3, u2} A H _inst_2) (AddMonoidAlgebra.semiring.{u3, u2} A H _inst_2 _inst_5)))))) (algebraMap.{u4, max u2 u3} k (AddMonoidAlgebra.{u3, u2} A H _inst_2) _inst_1 (AddMonoidAlgebra.semiring.{u3, u2} A H _inst_2 _inst_5) (AddMonoidAlgebra.algebra.{u3, u2, u4} A H k _inst_1 _inst_2 _inst_3 _inst_5)) r)
Case conversion may be inaccurate. Consider using '#align add_monoid_algebra.map_domain_algebra_map AddMonoidAlgebra.mapDomain_algebraMapₓ'. -/
theorem mapDomain_algebraMap {A H F : Type _} [CommSemiring k] [Semiring A] [Algebra k A]
    [AddMonoid G] [AddMonoid H] [AddMonoidHomClass F G H] (f : F) (r : k) :
    mapDomain f (algebraMap k (AddMonoidAlgebra A G) r) = algebraMap k (AddMonoidAlgebra A H) r :=
  by simp only [Function.comp_apply, map_domain_single, AddMonoidAlgebra.coe_algebraMap, map_zero]
#align add_monoid_algebra.map_domain_algebra_map AddMonoidAlgebra.mapDomain_algebraMap

#print AddMonoidAlgebra.mapDomainNonUnitalAlgHom /-
/-- If `f : G → H` is a homomorphism between two additive magmas, then `finsupp.map_domain f` is a
non-unital algebra homomorphism between their additive magma algebras. -/
@[simps]
def mapDomainNonUnitalAlgHom (k A : Type _) [CommSemiring k] [Semiring A] [Algebra k A]
    {G H F : Type _} [Add G] [Add H] [AddHomClass F G H] (f : F) :
    AddMonoidAlgebra A G →ₙₐ[k] AddMonoidAlgebra A H :=
  {
    (Finsupp.mapDomain.addMonoidHom f :
      MonoidAlgebra A G →+
        MonoidAlgebra A H) with
    map_mul' := fun x y => mapDomain_mul f x y
    map_smul' := fun r x => mapDomain_smul r x }
#align add_monoid_algebra.map_domain_non_unital_alg_hom AddMonoidAlgebra.mapDomainNonUnitalAlgHom
-/

#print AddMonoidAlgebra.mapDomainAlgHom /-
/-- If `f : G → H` is an additive homomorphism between two additive monoids, then
`finsupp.map_domain f` is an algebra homomorphism between their add monoid algebras. -/
@[simps]
def mapDomainAlgHom (k A : Type _) [CommSemiring k] [Semiring A] [Algebra k A] [AddMonoid G]
    {H F : Type _} [AddMonoid H] [AddMonoidHomClass F G H] (f : F) :
    AddMonoidAlgebra A G →ₐ[k] AddMonoidAlgebra A H :=
  { mapDomainRingHom A f with commutes' := mapDomain_algebraMap f }
#align add_monoid_algebra.map_domain_alg_hom AddMonoidAlgebra.mapDomainAlgHom
-/

end AddMonoidAlgebra

variable [CommSemiring R] (k G)

#print AddMonoidAlgebra.toMultiplicativeAlgEquiv /-
/-- The algebra equivalence between `add_monoid_algebra` and `monoid_algebra` in terms of
`multiplicative`. -/
def AddMonoidAlgebra.toMultiplicativeAlgEquiv [Semiring k] [Algebra R k] [AddMonoid G] :
    AddMonoidAlgebra k G ≃ₐ[R] MonoidAlgebra k (Multiplicative G) :=
  { AddMonoidAlgebra.toMultiplicative k G with
    commutes' := fun r => by simp [AddMonoidAlgebra.toMultiplicative] }
#align add_monoid_algebra.to_multiplicative_alg_equiv AddMonoidAlgebra.toMultiplicativeAlgEquiv
-/

#print MonoidAlgebra.toAdditiveAlgEquiv /-
/-- The algebra equivalence between `monoid_algebra` and `add_monoid_algebra` in terms of
`additive`. -/
def MonoidAlgebra.toAdditiveAlgEquiv [Semiring k] [Algebra R k] [Monoid G] :
    MonoidAlgebra k G ≃ₐ[R] AddMonoidAlgebra k (Additive G) :=
  { MonoidAlgebra.toAdditive k G with commutes' := fun r => by simp [MonoidAlgebra.toAdditive] }
#align monoid_algebra.to_additive_alg_equiv MonoidAlgebra.toAdditiveAlgEquiv
-/