/-- The piecewise multiplication from the `Mul` instance, as a bundled linear homomorphism.

This is the graded version of `LinearMap.mul`, and the linear version of `DirectSum.gMulHom` -/
@[simps]
def gMulLHom {i j} : A i →ₗ[R] A j →ₗ[R] A (i + j) where
  toFun a :=
    { toFun := fun b => GradedMonoid.GMul.mul a b
      map_smul' := fun r x => by
        injection (smul_comm r (GradedMonoid.mk _ a) (GradedMonoid.mk _ x)).symm
      map_add' := GNonUnitalNonAssocSemiring.mul_add _ }
  map_smul' r x := LinearMap.ext fun y => by
    

Proof state:
ι : Type uι
R : Type uR
A : ι → Type uA
B : Type uB
inst✝⁸ : DecidableEq ι
inst✝⁷ : CommSemiring R
inst✝⁶ : (i : ι) → AddCommMonoid (A i)
inst✝⁵ : (i : ι) → Module R (A i)
inst✝⁴ : AddMonoid ι
inst✝³ : GSemiring A
inst✝² : Semiring B
inst✝¹ : GAlgebra R A
inst✝ : Algebra R B
i j : ι
r : R
x : A i
y : A j
⊢ (AddHom.toFun
        {
          toFun := fun a =>
            {
              toAddHom :=
                { toFun := fun b => GradedMonoid.GMul.mul a b,
                  map_add' :=
                    (_ :
                      ∀ (b c : A j),
                        GradedMonoid.GMul.mul a (b + c) = GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (x : A j),
                    AddHom.toFun
                        { toFun := fun b => GradedMonoid.GMul.mul a b,
                          map_add' :=
                            (_ :
                              ∀ (b c : A j),
                                GradedMonoid.GMul.mul a (b + c) =
                                  GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                        (r • x) =
                      (RingHom.id R) r •
                        AddHom.toFun
                          { toFun := fun b => GradedMonoid.GMul.mul a b,
                            map_add' :=
                              (_ :
                                ∀ (b c : A j),
                                  GradedMonoid.GMul.mul a (b + c) =
                                    GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                          x) },
          map_add' :=
            (_ :
              ∀ (x x_1 : A i),
                (fun a =>
                      {
                        toAddHom :=
                          { toFun := fun b => GradedMonoid.GMul.mul a b,
                            map_add' :=
                              (_ :
                                ∀ (b c : A j),
                                  GradedMonoid.GMul.mul a (b + c) =
                                    GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) },
                        map_smul' :=
                          (_ :
                            ∀ (r : R) (x : A j),
                              AddHom.toFun
                                  { toFun := fun b => GradedMonoid.GMul.mul a b,
                                    map_add' :=
                                      (_ :
                                        ∀ (b c : A j),
                                          GradedMonoid.GMul.mul a (b + c) =
                                            GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                  (r • x) =
                                (RingHom.id R) r •
                                  AddHom.toFun
                                    { toFun := fun b => GradedMonoid.GMul.mul a b,
                                      map_add' :=
                                        (_ :
                                          ∀ (b c : A j),
                                            GradedMonoid.GMul.mul a (b + c) =
                                              GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                    x) })
                    (x + x_1) =
                  (fun a =>
                        {
                          toAddHom :=
                            { toFun := fun b => GradedMonoid.GMul.mul a b,
                              map_add' :=
                                (_ :
                                  ∀ (b c : A j),
                                    GradedMonoid.GMul.mul a (b + c) =
                                      GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) },
                          map_smul' :=
                            (_ :
                              ∀ (r : R) (x : A j),
                                AddHom.toFun
                                    { toFun := fun b => GradedMonoid.GMul.mul a b,
                                      map_add' :=
                                        (_ :
                                          ∀ (b c : A j),
                                            GradedMonoid.GMul.mul a (b + c) =
                                              GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                    (r • x) =
                                  (RingHom.id R) r •
                                    AddHom.toFun
                                      { toFun := fun b => GradedMonoid.GMul.mul a b,
                                        map_add' :=
                                          (_ :
                                            ∀ (b c : A j),
                                              GradedMonoid.GMul.mul a (b + c) =
                                                GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                      x) })
                      x +
                    (fun a =>
                        {
                          toAddHom :=
                            { toFun := fun b => GradedMonoid.GMul.mul a b,
                              map_add' :=
                                (_ :
                                  ∀ (b c : A j),
                                    GradedMonoid.GMul.mul a (b + c) =
                                      GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) },
                          map_smul' :=
                            (_ :
                              ∀ (r : R) (x : A j),
                                AddHom.toFun
                                    { toFun := fun b => GradedMonoid.GMul.mul a b,
                                      map_add' :=
                                        (_ :
                                          ∀ (b c : A j),
                                            GradedMonoid.GMul.mul a (b + c) =
                                              GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                    (r • x) =
                                  (RingHom.id R) r •
                                    AddHom.toFun
                                      { toFun := fun b => GradedMonoid.GMul.mul a b,
                                        map_add' :=
                                          (_ :
                                            ∀ (b c : A j),
                                              GradedMonoid.GMul.mul a (b + c) =
                                                GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                      x) })
                      x_1) }
        (r • x))
      y =
    ((RingHom.id R) r •
        AddHom.toFun
          {
            toFun := fun a =>
              {
                toAddHom :=
                  { toFun := fun b => GradedMonoid.GMul.mul a b,
                    map_add' :=
                      (_ :
                        ∀ (b c : A j),
                          GradedMonoid.GMul.mul a (b + c) = GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) },
                map_smul' :=
                  (_ :
                    ∀ (r : R) (x : A j),
                      AddHom.toFun
                          { toFun := fun b => GradedMonoid.GMul.mul a b,
                            map_add' :=
                              (_ :
                                ∀ (b c : A j),
                                  GradedMonoid.GMul.mul a (b + c) =
                                    GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                          (r • x) =
                        (RingHom.id R) r •
                          AddHom.toFun
                            { toFun := fun b => GradedMonoid.GMul.mul a b,
                              map_add' :=
                                (_ :
                                  ∀ (b c : A j),
                                    GradedMonoid.GMul.mul a (b + c) =
                                      GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                            x) },
            map_add' :=
              (_ :
                ∀ (x x_1 : A i),
                  (fun a =>
                        {
                          toAddHom :=
                            { toFun := fun b => GradedMonoid.GMul.mul a b,
                              map_add' :=
                                (_ :
                                  ∀ (b c : A j),
                                    GradedMonoid.GMul.mul a (b + c) =
                                      GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) },
                          map_smul' :=
                            (_ :
                              ∀ (r : R) (x : A j),
                                AddHom.toFun
                                    { toFun := fun b => GradedMonoid.GMul.mul a b,
                                      map_add' :=
                                        (_ :
                                          ∀ (b c : A j),
                                            GradedMonoid.GMul.mul a (b + c) =
                                              GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                    (r • x) =
                                  (RingHom.id R) r •
                                    AddHom.toFun
                                      { toFun := fun b => GradedMonoid.GMul.mul a b,
                                        map_add' :=
                                          (_ :
                                            ∀ (b c : A j),
                                              GradedMonoid.GMul.mul a (b + c) =
                                                GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                      x) })
                      (x + x_1) =
                    (fun a =>
                          {
                            toAddHom :=
                              { toFun := fun b => GradedMonoid.GMul.mul a b,
                                map_add' :=
                                  (_ :
                                    ∀ (b c : A j),
                                      GradedMonoid.GMul.mul a (b + c) =
                                        GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) },
                            map_smul' :=
                              (_ :
                                ∀ (r : R) (x : A j),
                                  AddHom.toFun
                                      { toFun := fun b => GradedMonoid.GMul.mul a b,
                                        map_add' :=
                                          (_ :
                                            ∀ (b c : A j),
                                              GradedMonoid.GMul.mul a (b + c) =
                                                GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                      (r • x) =
                                    (RingHom.id R) r •
                                      AddHom.toFun
                                        { toFun := fun b => GradedMonoid.GMul.mul a b,
                                          map_add' :=
                                            (_ :
                                              ∀ (b c : A j),
                                                GradedMonoid.GMul.mul a (b + c) =
                                                  GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                        x) })
                        x +
                      (fun a =>
                          {
                            toAddHom :=
                              { toFun := fun b => GradedMonoid.GMul.mul a b,
                                map_add' :=
                                  (_ :
                                    ∀ (b c : A j),
                                      GradedMonoid.GMul.mul a (b + c) =
                                        GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) },
                            map_smul' :=
                              (_ :
                                ∀ (r : R) (x : A j),
                                  AddHom.toFun
                                      { toFun := fun b => GradedMonoid.GMul.mul a b,
                                        map_add' :=
                                          (_ :
                                            ∀ (b c : A j),
                                              GradedMonoid.GMul.mul a (b + c) =
                                                GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                      (r • x) =
                                    (RingHom.id R) r •
                                      AddHom.toFun
                                        { toFun := fun b => GradedMonoid.GMul.mul a b,
                                          map_add' :=
                                            (_ :
                                              ∀ (b c : A j),
                                                GradedMonoid.GMul.mul a (b + c) =
                                                  GradedMonoid.GMul.mul a b + GradedMonoid.GMul.mul a c) }
                                        x) })
                        x_1) }
          x)
      y

Next tactic:
injection smul_assoc r (GradedMonoid.mk _ x) (GradedMonoid.mk _ y)