/--
The family of linear maps `M₂ → M` parameterised by `f ∈ M₂ → R`, `x ∈ M`, is linear in `f`, `x`.
-/
def smulRightₗ : (M₂ →ₗ[R] R) →ₗ[R] M →ₗ[R] M₂ →ₗ[R] M where
  toFun f :=
    { toFun := LinearMap.smulRight f
      map_add' := fun m m' => by
        ext
        apply smul_add
      map_smul' := fun c m => by
        ext
        apply smul_comm }
  map_add' f f' := by
    ext
    apply add_smul
  map_smul' c f := by
    

Proof state:
R : Type u_1
R₁ : Type u_2
R₂ : Type u_3
R₃ : Type u_4
k : Type u_5
S : Type u_6
S₃ : Type u_7
T : Type u_8
M : Type u_9
M₁ : Type u_10
M₂ : Type u_11
M₃ : Type u_12
N₁ : Type u_13
N₂ : Type u_14
N₃ : Type u_15
ι : Type u_16
inst✝⁶ : CommSemiring R
inst✝⁵ : AddCommMonoid M
inst✝⁴ : AddCommMonoid M₂
inst✝³ : AddCommMonoid M₃
inst✝² : Module R M
inst✝¹ : Module R M₂
inst✝ : Module R M₃
f✝ g : M →ₗ[R] M₂
c : R
f : M₂ →ₗ[R] R
⊢ AddHom.toFun
      {
        toFun := fun f =>
          {
            toAddHom :=
              { toFun := smulRight f,
                map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') },
            map_smul' :=
              (_ :
                ∀ (c : R) (m : M),
                  AddHom.toFun
                      { toFun := smulRight f,
                        map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                      (c • m) =
                    (RingHom.id R) c •
                      AddHom.toFun
                        { toFun := smulRight f,
                          map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                        m) },
        map_add' :=
          (_ :
            ∀ (f f' : M₂ →ₗ[R] R),
              (fun f =>
                    {
                      toAddHom :=
                        { toFun := smulRight f,
                          map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') },
                      map_smul' :=
                        (_ :
                          ∀ (c : R) (m : M),
                            AddHom.toFun
                                { toFun := smulRight f,
                                  map_add' :=
                                    (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                (c • m) =
                              (RingHom.id R) c •
                                AddHom.toFun
                                  { toFun := smulRight f,
                                    map_add' :=
                                      (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                  m) })
                  (f + f') =
                (fun f =>
                      {
                        toAddHom :=
                          { toFun := smulRight f,
                            map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') },
                        map_smul' :=
                          (_ :
                            ∀ (c : R) (m : M),
                              AddHom.toFun
                                  { toFun := smulRight f,
                                    map_add' :=
                                      (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                  (c • m) =
                                (RingHom.id R) c •
                                  AddHom.toFun
                                    { toFun := smulRight f,
                                      map_add' :=
                                        (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                    m) })
                    f +
                  (fun f =>
                      {
                        toAddHom :=
                          { toFun := smulRight f,
                            map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') },
                        map_smul' :=
                          (_ :
                            ∀ (c : R) (m : M),
                              AddHom.toFun
                                  { toFun := smulRight f,
                                    map_add' :=
                                      (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                  (c • m) =
                                (RingHom.id R) c •
                                  AddHom.toFun
                                    { toFun := smulRight f,
                                      map_add' :=
                                        (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                    m) })
                    f') }
      (c • f) =
    (RingHom.id R) c •
      AddHom.toFun
        {
          toFun := fun f =>
            {
              toAddHom :=
                { toFun := smulRight f,
                  map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') },
              map_smul' :=
                (_ :
                  ∀ (c : R) (m : M),
                    AddHom.toFun
                        { toFun := smulRight f,
                          map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                        (c • m) =
                      (RingHom.id R) c •
                        AddHom.toFun
                          { toFun := smulRight f,
                            map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                          m) },
          map_add' :=
            (_ :
              ∀ (f f' : M₂ →ₗ[R] R),
                (fun f =>
                      {
                        toAddHom :=
                          { toFun := smulRight f,
                            map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') },
                        map_smul' :=
                          (_ :
                            ∀ (c : R) (m : M),
                              AddHom.toFun
                                  { toFun := smulRight f,
                                    map_add' :=
                                      (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                  (c • m) =
                                (RingHom.id R) c •
                                  AddHom.toFun
                                    { toFun := smulRight f,
                                      map_add' :=
                                        (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                    m) })
                    (f + f') =
                  (fun f =>
                        {
                          toAddHom :=
                            { toFun := smulRight f,
                              map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') },
                          map_smul' :=
                            (_ :
                              ∀ (c : R) (m : M),
                                AddHom.toFun
                                    { toFun := smulRight f,
                                      map_add' :=
                                        (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                    (c • m) =
                                  (RingHom.id R) c •
                                    AddHom.toFun
                                      { toFun := smulRight f,
                                        map_add' :=
                                          (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                      m) })
                      f +
                    (fun f =>
                        {
                          toAddHom :=
                            { toFun := smulRight f,
                              map_add' := (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') },
                          map_smul' :=
                            (_ :
                              ∀ (c : R) (m : M),
                                AddHom.toFun
                                    { toFun := smulRight f,
                                      map_add' :=
                                        (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                    (c • m) =
                                  (RingHom.id R) c •
                                    AddHom.toFun
                                      { toFun := smulRight f,
                                        map_add' :=
                                          (_ : ∀ (m m' : M), smulRight f (m + m') = smulRight f m + smulRight f m') }
                                      m) })
                      f') }
        f

Next tactic:
ext