/-- A Lie module yields a Lie algebra morphism into the linear endomorphisms of the module.

See also `LieModule.toModuleHom`. -/
@[simps]
def LieModule.toEndomorphism : L →ₗ⁅R⁆ Module.End R M where
  toFun x :=
    { toFun := fun m => ⁅x, m⁆
      map_add' := lie_add x
      map_smul' := fun t => lie_smul t x }
  map_add' x y := by ext m; apply add_lie
  map_smul' t x := by ext m; apply smul_lie
  map_lie' {x y} := by 

Proof state:
R : Type u
L : Type v
M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : LieRing L
inst✝⁴ : LieAlgebra R L
inst✝³ : AddCommGroup M
inst✝² : Module R M
inst✝¹ : LieRingModule L M
inst✝ : LieModule R L M
x y : L
⊢ AddHom.toFun
      {
          toAddHom :=
            {
              toFun := fun x =>
                { toAddHom := { toFun := fun m => ⁅x, m⁆, map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                  map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) },
              map_add' :=
                (_ :
                  ∀ (x y : L),
                    (fun x =>
                          {
                            toAddHom :=
                              { toFun := fun m => ⁅x, m⁆, map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                            map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                        (x + y) =
                      (fun x =>
                            {
                              toAddHom :=
                                { toFun := fun m => ⁅x, m⁆,
                                  map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                              map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                          x +
                        (fun x =>
                            {
                              toAddHom :=
                                { toFun := fun m => ⁅x, m⁆,
                                  map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                              map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                          y) },
          map_smul' :=
            (_ :
              ∀ (t : R) (x : L),
                AddHom.toFun
                    {
                      toFun := fun x =>
                        {
                          toAddHom :=
                            { toFun := fun m => ⁅x, m⁆, map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                          map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) },
                      map_add' :=
                        (_ :
                          ∀ (x y : L),
                            (fun x =>
                                  {
                                    toAddHom :=
                                      { toFun := fun m => ⁅x, m⁆,
                                        map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                    map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                (x + y) =
                              (fun x =>
                                    {
                                      toAddHom :=
                                        { toFun := fun m => ⁅x, m⁆,
                                          map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                      map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                  x +
                                (fun x =>
                                    {
                                      toAddHom :=
                                        { toFun := fun m => ⁅x, m⁆,
                                          map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                      map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                  y) }
                    (t • x) =
                  (RingHom.id R) t •
                    AddHom.toFun
                      {
                        toFun := fun x =>
                          {
                            toAddHom :=
                              { toFun := fun m => ⁅x, m⁆, map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                            map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) },
                        map_add' :=
                          (_ :
                            ∀ (x y : L),
                              (fun x =>
                                    {
                                      toAddHom :=
                                        { toFun := fun m => ⁅x, m⁆,
                                          map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                      map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                  (x + y) =
                                (fun x =>
                                      {
                                        toAddHom :=
                                          { toFun := fun m => ⁅x, m⁆,
                                            map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                        map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                    x +
                                  (fun x =>
                                      {
                                        toAddHom :=
                                          { toFun := fun m => ⁅x, m⁆,
                                            map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                        map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                    y) }
                      x) }.toAddHom
      ⁅x, y⁆ =
    ⁅AddHom.toFun
        {
            toAddHom :=
              {
                toFun := fun x =>
                  {
                    toAddHom :=
                      { toFun := fun m => ⁅x, m⁆, map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                    map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) },
                map_add' :=
                  (_ :
                    ∀ (x y : L),
                      (fun x =>
                            {
                              toAddHom :=
                                { toFun := fun m => ⁅x, m⁆,
                                  map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                              map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                          (x + y) =
                        (fun x =>
                              {
                                toAddHom :=
                                  { toFun := fun m => ⁅x, m⁆,
                                    map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                            x +
                          (fun x =>
                              {
                                toAddHom :=
                                  { toFun := fun m => ⁅x, m⁆,
                                    map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                            y) },
            map_smul' :=
              (_ :
                ∀ (t : R) (x : L),
                  AddHom.toFun
                      {
                        toFun := fun x =>
                          {
                            toAddHom :=
                              { toFun := fun m => ⁅x, m⁆, map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                            map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) },
                        map_add' :=
                          (_ :
                            ∀ (x y : L),
                              (fun x =>
                                    {
                                      toAddHom :=
                                        { toFun := fun m => ⁅x, m⁆,
                                          map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                      map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                  (x + y) =
                                (fun x =>
                                      {
                                        toAddHom :=
                                          { toFun := fun m => ⁅x, m⁆,
                                            map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                        map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                    x +
                                  (fun x =>
                                      {
                                        toAddHom :=
                                          { toFun := fun m => ⁅x, m⁆,
                                            map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                        map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                    y) }
                      (t • x) =
                    (RingHom.id R) t •
                      AddHom.toFun
                        {
                          toFun := fun x =>
                            {
                              toAddHom :=
                                { toFun := fun m => ⁅x, m⁆,
                                  map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                              map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) },
                          map_add' :=
                            (_ :
                              ∀ (x y : L),
                                (fun x =>
                                      {
                                        toAddHom :=
                                          { toFun := fun m => ⁅x, m⁆,
                                            map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                        map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                    (x + y) =
                                  (fun x =>
                                        {
                                          toAddHom :=
                                            { toFun := fun m => ⁅x, m⁆,
                                              map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                          map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                      x +
                                    (fun x =>
                                        {
                                          toAddHom :=
                                            { toFun := fun m => ⁅x, m⁆,
                                              map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                          map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                      y) }
                        x) }.toAddHom
        x,
      AddHom.toFun
        {
            toAddHom :=
              {
                toFun := fun x =>
                  {
                    toAddHom :=
                      { toFun := fun m => ⁅x, m⁆, map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                    map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) },
                map_add' :=
                  (_ :
                    ∀ (x y : L),
                      (fun x =>
                            {
                              toAddHom :=
                                { toFun := fun m => ⁅x, m⁆,
                                  map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                              map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                          (x + y) =
                        (fun x =>
                              {
                                toAddHom :=
                                  { toFun := fun m => ⁅x, m⁆,
                                    map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                            x +
                          (fun x =>
                              {
                                toAddHom :=
                                  { toFun := fun m => ⁅x, m⁆,
                                    map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                            y) },
            map_smul' :=
              (_ :
                ∀ (t : R) (x : L),
                  AddHom.toFun
                      {
                        toFun := fun x =>
                          {
                            toAddHom :=
                              { toFun := fun m => ⁅x, m⁆, map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                            map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) },
                        map_add' :=
                          (_ :
                            ∀ (x y : L),
                              (fun x =>
                                    {
                                      toAddHom :=
                                        { toFun := fun m => ⁅x, m⁆,
                                          map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                      map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                  (x + y) =
                                (fun x =>
                                      {
                                        toAddHom :=
                                          { toFun := fun m => ⁅x, m⁆,
                                            map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                        map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                    x +
                                  (fun x =>
                                      {
                                        toAddHom :=
                                          { toFun := fun m => ⁅x, m⁆,
                                            map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                        map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                    y) }
                      (t • x) =
                    (RingHom.id R) t •
                      AddHom.toFun
                        {
                          toFun := fun x =>
                            {
                              toAddHom :=
                                { toFun := fun m => ⁅x, m⁆,
                                  map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                              map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) },
                          map_add' :=
                            (_ :
                              ∀ (x y : L),
                                (fun x =>
                                      {
                                        toAddHom :=
                                          { toFun := fun m => ⁅x, m⁆,
                                            map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                        map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                    (x + y) =
                                  (fun x =>
                                        {
                                          toAddHom :=
                                            { toFun := fun m => ⁅x, m⁆,
                                              map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                          map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                      x +
                                    (fun x =>
                                        {
                                          toAddHom :=
                                            { toFun := fun m => ⁅x, m⁆,
                                              map_add' := (_ : ∀ (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆) },
                                          map_smul' := (_ : ∀ (t : R) (m : M), ⁅x, t • m⁆ = t • ⁅x, m⁆) })
                                      y) }
                        x) }.toAddHom
        y⁆

Next tactic:
ext m