/-- Turns a `k`-module `A` with a compatible `DistribMulAction` of a monoid `G` into a
`k`-linear `G`-representation on `A`. -/
def ofDistribMulAction : Representation k G A where
  toFun := fun m =>
    { DistribMulAction.toAddMonoidEnd G A m with
      map_smul' := smul_comm _ }
  map_one' := by ext; exact one_smul _ _
  map_mul' := by 

Proof state:
k : Type u_1
G : Type u_2
A : Type u_3
inst✝⁵ : CommSemiring k
inst✝⁴ : Monoid G
inst✝³ : AddCommGroup A
inst✝² : Module k A
inst✝¹ : DistribMulAction G A
inst✝ : SMulCommClass G k A
⊢ ∀ (x y : G),
    OneHom.toFun
        {
          toFun := fun m =>
            let src := (DistribMulAction.toAddMonoidEnd G A) m;
            {
              toAddHom :=
                { toFun := src.toFun,
                  map_add' :=
                    (_ : ∀ (x y : A), ZeroHom.toFun (↑src) (x + y) = ZeroHom.toFun (↑src) x + ZeroHom.toFun (↑src) y) },
              map_smul' := (_ : ∀ (n : k) (a : A), m • n • a = n • m • a) },
          map_one' :=
            (_ :
              (fun m =>
                    let src := (DistribMulAction.toAddMonoidEnd G A) m;
                    {
                      toAddHom :=
                        { toFun := src.toFun,
                          map_add' :=
                            (_ :
                              ∀ (x y : A),
                                ZeroHom.toFun (↑src) (x + y) = ZeroHom.toFun (↑src) x + ZeroHom.toFun (↑src) y) },
                      map_smul' := (_ : ∀ (n : k) (a : A), m • n • a = n • m • a) })
                  1 =
                1) }
        (x * y) =
      OneHom.toFun
          {
            toFun := fun m =>
              let src := (DistribMulAction.toAddMonoidEnd G A) m;
              {
                toAddHom :=
                  { toFun := src.toFun,
                    map_add' :=
                      (_ :
                        ∀ (x y : A), ZeroHom.toFun (↑src) (x + y) = ZeroHom.toFun (↑src) x + ZeroHom.toFun (↑src) y) },
                map_smul' := (_ : ∀ (n : k) (a : A), m • n • a = n • m • a) },
            map_one' :=
              (_ :
                (fun m =>
                      let src := (DistribMulAction.toAddMonoidEnd G A) m;
                      {
                        toAddHom :=
                          { toFun := src.toFun,
                            map_add' :=
                              (_ :
                                ∀ (x y : A),
                                  ZeroHom.toFun (↑src) (x + y) = ZeroHom.toFun (↑src) x + ZeroHom.toFun (↑src) y) },
                        map_smul' := (_ : ∀ (n : k) (a : A), m • n • a = n • m • a) })
                    1 =
                  1) }
          x *
        OneHom.toFun
          {
            toFun := fun m =>
              let src := (DistribMulAction.toAddMonoidEnd G A) m;
              {
                toAddHom :=
                  { toFun := src.toFun,
                    map_add' :=
                      (_ :
                        ∀ (x y : A), ZeroHom.toFun (↑src) (x + y) = ZeroHom.toFun (↑src) x + ZeroHom.toFun (↑src) y) },
                map_smul' := (_ : ∀ (n : k) (a : A), m • n • a = n • m • a) },
            map_one' :=
              (_ :
                (fun m =>
                      let src := (DistribMulAction.toAddMonoidEnd G A) m;
                      {
                        toAddHom :=
                          { toFun := src.toFun,
                            map_add' :=
                              (_ :
                                ∀ (x y : A),
                                  ZeroHom.toFun (↑src) (x + y) = ZeroHom.toFun (↑src) x + ZeroHom.toFun (↑src) y) },
                        map_smul' := (_ : ∀ (n : k) (a : A), m • n • a = n • m • a) })
                    1 =
                  1) }
          y

Next tactic:
intros