l3lab/ntp-mathlib huggingface dataset:
instance isScalarTower_self [IsScalarTower R k k] :
    IsScalarTower R (MonoidAlgebra k G) (MonoidAlgebra k G) :=
  ⟨fun t a b => by
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    refine Finsupp.ext fun m => ?_
    -- Porting note: `refine` & `rw` are required because `simp` behaves differently.
    classical
      simp only [smul_eq_mul, mul_apply]
      rw [coe_smul]
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : IsScalarTower R k k
t : R
a b : MonoidAlgebra k G
m : G
⊢ (sum (t • a) fun a₁ b₁ => sum b fun a₂ b₂ => if a₁ * a₂ = m then b₁ * b₂ else 0) = (t • ⇑(a * b)) m

Next tactic:
refine Eq.trans (sum_smul_index' (g := a) (b := t) ?_) ?_
instance isScalarTower_self [IsScalarTower R k k] :
    IsScalarTower R (MonoidAlgebra k G) (MonoidAlgebra k G) :=
  ⟨fun t a b => by
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    refine Finsupp.ext fun m => ?_
    -- Porting note: `refine` & `rw` are required because `simp` behaves differently.
    classical
      simp only [smul_eq_mul, mul_apply]
      rw [coe_smul]
      refine Eq.trans (sum_smul_index' (g := a) (b := t) ?_) ?_ <;>
        

Proof state:
case refine_1
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : IsScalarTower R k k
t : R
a b : MonoidAlgebra k G
m : G
⊢ ∀ (i : G), (sum b fun a₂ b₂ => if i * a₂ = m then 0 * b₂ else 0) = 0

Next tactic:
simp only [mul_apply, Finsupp.smul_sum, smul_ite, smul_mul_assoc,
          zero_mul, ite_self, imp_true_iff, sum_zero, Pi.smul_apply, smul_zero]
instance isScalarTower_self [IsScalarTower R k k] :
    IsScalarTower R (MonoidAlgebra k G) (MonoidAlgebra k G) :=
  ⟨fun t a b => by
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    refine Finsupp.ext fun m => ?_
    -- Porting note: `refine` & `rw` are required because `simp` behaves differently.
    classical
      simp only [smul_eq_mul, mul_apply]
      rw [coe_smul]
      refine Eq.trans (sum_smul_index' (g := a) (b := t) ?_) ?_ <;>
        

Proof state:
case refine_2
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : IsScalarTower R k k
t : R
a b : MonoidAlgebra k G
m : G
⊢ (sum a fun i c => sum b fun a₂ b₂ => if i * a₂ = m then t • c * b₂ else 0) = (t • ⇑(a * b)) m

Next tactic:
simp only [mul_apply, Finsupp.smul_sum, smul_ite, smul_mul_assoc,
          zero_mul, ite_self, imp_true_iff, sum_zero, Pi.smul_apply, smul_zero]
/-- Note that if `k` is a `CommSemiring` then we have `SMulCommClass 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
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : SMulCommClass R k k
t : R
a b : MonoidAlgebra k G
⊢ t • a • b = a • t • b

Next tactic:
refine Finsupp.ext fun m => ?_
/-- Note that if `k` is a `CommSemiring` then we have `SMulCommClass 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
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    refine Finsupp.ext fun m => ?_
    -- Porting note: `refine` & `rw` are required because `simp` behaves differently.
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : SMulCommClass R k k
t : R
a b : MonoidAlgebra k G
m : G
⊢ (t • a • b) m = (a • t • b) m

Next tactic:
classical
      simp only [smul_eq_mul, mul_apply]
      rw [coe_smul]
      refine Eq.symm (Eq.trans (congr_arg (sum a)
        (funext₂ fun a₁ b₁ => sum_smul_index' (g := b) (b := t) ?_)) ?_) <;>
      simp only [mul_apply, Finsupp.sum, Finset.smul_sum, smul_ite, mul_smul_comm,
        imp_true_iff, ite_eq_right_iff, Pi.smul_apply, mul_zero, smul_zero]
/-- Note that if `k` is a `CommSemiring` then we have `SMulCommClass 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
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    refine Finsupp.ext fun m => ?_
    -- Porting note: `refine` & `rw` are required because `simp` behaves differently.
    classical
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : SMulCommClass R k k
t : R
a b : MonoidAlgebra k G
m : G
⊢ (t • a • b) m = (a • t • b) m

Next tactic:
simp only [smul_eq_mul, mul_apply]
/-- Note that if `k` is a `CommSemiring` then we have `SMulCommClass 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
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    refine Finsupp.ext fun m => ?_
    -- Porting note: `refine` & `rw` are required because `simp` behaves differently.
    classical
      simp only [smul_eq_mul, mul_apply]
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : SMulCommClass R k k
t : R
a b : MonoidAlgebra k G
m : G
⊢ (t • (a * b)) m = sum a fun a₁ b₁ => sum (t • b) fun a₂ b₂ => if a₁ * a₂ = m then b₁ * b₂ else 0

Next tactic:
rw [coe_smul]
/-- Note that if `k` is a `CommSemiring` then we have `SMulCommClass 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
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    refine Finsupp.ext fun m => ?_
    -- Porting note: `refine` & `rw` are required because `simp` behaves differently.
    classical
      simp only [smul_eq_mul, mul_apply]
      rw [coe_smul]
      

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : SMulCommClass R k k
t : R
a b : MonoidAlgebra k G
m : G
⊢ (t • ⇑(a * b)) m = sum a fun a₁ b₁ => sum (t • b) fun a₂ b₂ => if a₁ * a₂ = m then b₁ * b₂ else 0

Next tactic:
refine Eq.symm (Eq.trans (congr_arg (sum a)
        (funext₂ fun a₁ b₁ => sum_smul_index' (g := b) (b := t) ?_)) ?_)
/-- Note that if `k` is a `CommSemiring` then we have `SMulCommClass 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
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    refine Finsupp.ext fun m => ?_
    -- Porting note: `refine` & `rw` are required because `simp` behaves differently.
    classical
      simp only [smul_eq_mul, mul_apply]
      rw [coe_smul]
      refine Eq.symm (Eq.trans (congr_arg (sum a)
        (funext₂ fun a₁ b₁ => sum_smul_index' (g := b) (b := t) ?_)) ?_) <;>
      

Proof state:
case refine_1
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : SMulCommClass R k k
t : R
a b : MonoidAlgebra k G
m a₁ : G
b₁ : k
⊢ ∀ (i : G), (if a₁ * i = m then b₁ * 0 else 0) = 0

Next tactic:
simp only [mul_apply, Finsupp.sum, Finset.smul_sum, smul_ite, mul_smul_comm,
        imp_true_iff, ite_eq_right_iff, Pi.smul_apply, mul_zero, smul_zero]
/-- Note that if `k` is a `CommSemiring` then we have `SMulCommClass 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
    -- Porting note: `ext` → `refine Finsupp.ext fun _ => ?_`
    refine Finsupp.ext fun m => ?_
    -- Porting note: `refine` & `rw` are required because `simp` behaves differently.
    classical
      simp only [smul_eq_mul, mul_apply]
      rw [coe_smul]
      refine Eq.symm (Eq.trans (congr_arg (sum a)
        (funext₂ fun a₁ b₁ => sum_smul_index' (g := b) (b := t) ?_)) ?_) <;>
      

Proof state:
case refine_2
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : SMulCommClass R k k
t : R
a b : MonoidAlgebra k G
m : G
⊢ (sum a fun a₁ b₁ => sum b fun i c => if a₁ * i = m then b₁ * t • c else 0) = (t • ⇑(a * b)) m

Next tactic:
simp only [mul_apply, Finsupp.sum, Finset.smul_sum, smul_ite, mul_smul_comm,
        imp_true_iff, ite_eq_right_iff, Pi.smul_apply, mul_zero, smul_zero]
instance smulCommClass_symm_self [SMulCommClass k R k] :
    SMulCommClass (MonoidAlgebra k G) R (MonoidAlgebra k G) :=
  ⟨fun t a b => by
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : SMulCommClass k R k
t : MonoidAlgebra k G
a : R
b : MonoidAlgebra k G
⊢ t • a • b = a • t • b

Next tactic:
haveI := SMulCommClass.symm k R k
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
    

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝³ : Semiring k
inst✝² : DistribSMul R k
inst✝¹ : Mul G
inst✝ : SMulCommClass k R k
t : MonoidAlgebra k G
a : R
b : MonoidAlgebra k G
this : SMulCommClass R k k
⊢ t • a • b = a • t • b

Next tactic:
rw [← smul_comm]
/-- The functor `G ↦ MonoidAlgebra 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 apply_apply symm_apply]
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
        -- Porting note: `dsimp` is required for beta reduction.
        

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : Semiring k
inst✝⁵ : DistribSMul R k
inst✝⁴ : Mul G
A : Type u₃
inst✝³ : NonUnitalNonAssocSemiring A
inst✝² : Module k A
inst✝¹ : IsScalarTower k A A
inst✝ : SMulCommClass k A A
f : G →ₙ* A
src✝ : (G →₀ k) →+ A := liftAddHom fun x => (AddMonoidHom.flip (smulAddHom k A)) (f x)
t' : k
a : MonoidAlgebra k G
⊢ (fun a => sum a fun m t => t • f m) (t' • a) = t' • (fun a => sum a fun m t => t • f m) a

Next tactic:
dsimp only []
/-- The functor `G ↦ MonoidAlgebra 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 apply_apply symm_apply]
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
        -- Porting note: `dsimp` is required for beta reduction.
        dsimp only []
        

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : Semiring k
inst✝⁵ : DistribSMul R k
inst✝⁴ : Mul G
A : Type u₃
inst✝³ : NonUnitalNonAssocSemiring A
inst✝² : Module k A
inst✝¹ : IsScalarTower k A A
inst✝ : SMulCommClass k A A
f : G →ₙ* A
src✝ : (G →₀ k) →+ A := liftAddHom fun x => (AddMonoidHom.flip (smulAddHom k A)) (f x)
t' : k
a : MonoidAlgebra k G
⊢ (sum (t' • a) fun m t => t • f m) = t' • sum a fun m t => t • f m

Next tactic:
rw [Finsupp.smul_sum, sum_smul_index']
/-- The functor `G ↦ MonoidAlgebra 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 apply_apply symm_apply]
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
        -- Porting note: `dsimp` is required for beta reduction.
        dsimp only []
        rw [Finsupp.smul_sum, sum_smul_index']
        · 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : Semiring k
inst✝⁵ : DistribSMul R k
inst✝⁴ : Mul G
A : Type u₃
inst✝³ : NonUnitalNonAssocSemiring A
inst✝² : Module k A
inst✝¹ : IsScalarTower k A A
inst✝ : SMulCommClass k A A
f : G →ₙ* A
src✝ : (G →₀ k) →+ A := liftAddHom fun x => (AddMonoidHom.flip (smulAddHom k A)) (f x)
t' : k
a : MonoidAlgebra k G
⊢ (sum a fun i c => (t' • c) • f i) = sum a fun a b => t' • b • f a

Next tactic:
simp_rw [smul_assoc]
/-- The functor `G ↦ MonoidAlgebra 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 apply_apply symm_apply]
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
        -- Porting note: `dsimp` is required for beta reduction.
        dsimp only []
        rw [Finsupp.smul_sum, sum_smul_index']
        · simp_rw [smul_assoc]
        · 

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : Semiring k
inst✝⁵ : DistribSMul R k
inst✝⁴ : Mul G
A : Type u₃
inst✝³ : NonUnitalNonAssocSemiring A
inst✝² : Module k A
inst✝¹ : IsScalarTower k A A
inst✝ : SMulCommClass k A A
f : G →ₙ* A
src✝ : (G →₀ k) →+ A := liftAddHom fun x => (AddMonoidHom.flip (smulAddHom k A)) (f x)
t' : k
a : MonoidAlgebra k G
⊢ ∀ (i : G), 0 • f i = 0

Next tactic:
intro m
/-- The functor `G ↦ MonoidAlgebra 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 apply_apply symm_apply]
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
        -- Porting note: `dsimp` is required for beta reduction.
        dsimp only []
        rw [Finsupp.smul_sum, sum_smul_index']
        · simp_rw [smul_assoc]
        · intro m
          

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : Semiring k
inst✝⁵ : DistribSMul R k
inst✝⁴ : Mul G
A : Type u₃
inst✝³ : NonUnitalNonAssocSemiring A
inst✝² : Module k A
inst✝¹ : IsScalarTower k A A
inst✝ : SMulCommClass k A A
f : G →ₙ* A
src✝ : (G →₀ k) →+ A := liftAddHom fun x => (AddMonoidHom.flip (smulAddHom k A)) (f x)
t' : k
a : MonoidAlgebra k G
m : G
⊢ 0 • f m = 0

Next tactic:
exact zero_smul k (f m)
/-- The functor `G ↦ MonoidAlgebra 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 apply_apply symm_apply]
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
        -- Porting note: `dsimp` is required for beta reduction.
        dsimp only []
        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
        

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : Semiring k
inst✝⁵ : DistribSMul R k
inst✝⁴ : Mul G
A : Type u₃
inst✝³ : NonUnitalNonAssocSemiring A
inst✝² : Module k A
inst✝¹ : IsScalarTower k A A
inst✝ : SMulCommClass k A A
f : G →ₙ* A
src✝ : (G →₀ k) →+ A := liftAddHom fun x => (AddMonoidHom.flip (smulAddHom k A)) (f x)
a₁ a₂ : MonoidAlgebra k G
⊢ MulActionHom.toFun
      {
          toMulActionHom :=
            { toFun := fun a => sum a fun m t => t • f m,
              map_smul' :=
                (_ :
                  ∀ (t' : k) (a : MonoidAlgebra k G),
                    (fun a => sum a fun m t => t • f m) (t' • a) = t' • (fun a => sum a fun m t => t • f m) a) },
          map_zero' := (_ : ZeroHom.toFun (↑src✝) 0 = 0),
          map_add' :=
            (_ :
              ∀ (x y : G →₀ k),
                ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }.toMulActionHom
      (a₁ * a₂) =
    MulActionHom.toFun
        {
            toMulActionHom :=
              { toFun := fun a => sum a fun m t => t • f m,
                map_smul' :=
                  (_ :
                    ∀ (t' : k) (a : MonoidAlgebra k G),
                      (fun a => sum a fun m t => t • f m) (t' • a) = t' • (fun a => sum a fun m t => t • f m) a) },
            map_zero' := (_ : ZeroHom.toFun (↑src✝) 0 = 0),
            map_add' :=
              (_ :
                ∀ (x y : G →₀ k),
                  ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }.toMulActionHom
        a₁ *
      MulActionHom.toFun
        {
            toMulActionHom :=
              { toFun := fun a => sum a fun m t => t • f m,
                map_smul' :=
                  (_ :
                    ∀ (t' : k) (a : MonoidAlgebra k G),
                      (fun a => sum a fun m t => t • f m) (t' • a) = t' • (fun a => sum a fun m t => t • f m) a) },
            map_zero' := (_ : ZeroHom.toFun (↑src✝) 0 = 0),
            map_add' :=
              (_ :
                ∀ (x y : G →₀ k),
                  ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }.toMulActionHom
        a₂

Next tactic:
let g : G → k → A := fun m t => t • f m
/-- The functor `G ↦ MonoidAlgebra 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 apply_apply symm_apply]
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
        -- Porting note: `dsimp` is required for beta reduction.
        dsimp only []
        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
        

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : Semiring k
inst✝⁵ : DistribSMul R k
inst✝⁴ : Mul G
A : Type u₃
inst✝³ : NonUnitalNonAssocSemiring A
inst✝² : Module k A
inst✝¹ : IsScalarTower k A A
inst✝ : SMulCommClass k A A
f : G →ₙ* A
src✝ : (G →₀ k) →+ A := liftAddHom fun x => (AddMonoidHom.flip (smulAddHom k A)) (f x)
a₁ a₂ : MonoidAlgebra k G
g : G → k → A := fun m t => t • f m
⊢ MulActionHom.toFun
      {
          toMulActionHom :=
            { toFun := fun a => sum a fun m t => t • f m,
              map_smul' :=
                (_ :
                  ∀ (t' : k) (a : MonoidAlgebra k G),
                    (fun a => sum a fun m t => t • f m) (t' • a) = t' • (fun a => sum a fun m t => t • f m) a) },
          map_zero' := (_ : ZeroHom.toFun (↑src✝) 0 = 0),
          map_add' :=
            (_ :
              ∀ (x y : G →₀ k),
                ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }.toMulActionHom
      (a₁ * a₂) =
    MulActionHom.toFun
        {
            toMulActionHom :=
              { toFun := fun a => sum a fun m t => t • f m,
                map_smul' :=
                  (_ :
                    ∀ (t' : k) (a : MonoidAlgebra k G),
                      (fun a => sum a fun m t => t • f m) (t' • a) = t' • (fun a => sum a fun m t => t • f m) a) },
            map_zero' := (_ : ZeroHom.toFun (↑src✝) 0 = 0),
            map_add' :=
              (_ :
                ∀ (x y : G →₀ k),
                  ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }.toMulActionHom
        a₁ *
      MulActionHom.toFun
        {
            toMulActionHom :=
              { toFun := fun a => sum a fun m t => t • f m,
                map_smul' :=
                  (_ :
                    ∀ (t' : k) (a : MonoidAlgebra k G),
                      (fun a => sum a fun m t => t • f m) (t' • a) = t' • (fun a => sum a fun m t => t • f m) a) },
            map_zero' := (_ : ZeroHom.toFun (↑src✝) 0 = 0),
            map_add' :=
              (_ :
                ∀ (x y : G →₀ k),
                  ZeroHom.toFun (↑src✝) (x + y) = ZeroHom.toFun (↑src✝) x + ZeroHom.toFun (↑src✝) y) }.toMulActionHom
        a₂

Next tactic:
have h₁ : ∀ m, g m 0 = 0 := by
          intro m
          exact zero_smul k (f m)
/-- The functor `G ↦ MonoidAlgebra 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 apply_apply symm_apply]
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
        -- Porting note: `dsimp` is required for beta reduction.
        dsimp only []
        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
          

Proof state:
k : Type u₁
G : Type u₂
H : Type u_1
R : Type u_2
inst✝⁶ : Semiring k
inst✝⁵ : DistribSMul R k
inst✝⁴ : Mul G
A : Type u₃
inst✝³ : NonUnitalNonAssocSemiring A
inst✝² : Module k A
inst✝¹ : IsScalarTower k A A
inst✝ : SMulCommClass k A A
f : G →ₙ* A
src✝ : (G →₀ k) →+ A := liftAddHom fun x => (AddMonoidHom.flip (smulAddHom k A)) (f x)
a₁ a₂ : MonoidAlgebra k G
g : G → k → A := fun m t => t • f m
⊢ ∀ (m : G), g m 0 = 0

Next tactic:
intro m