l3lab/ntp-mathlib huggingface dataset:
/-- The inclusion of each component into the direct sum as morphism of Lie algebras. -/
@[simps]
def lieAlgebraOf [DecidableEq ι] (j : ι) : L j →ₗ⁅R⁆ ⨁ i, L i :=
  { lof R ι L j with
    toFun := of L j
    map_lie' := fun {x y} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]
        -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        

Proof state:
case pos
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : j = i
⊢ (AddHom.toFun
        {
            toAddHom :=
              { toFun := ⇑(of L j),
                map_add' :=
                  (_ :
                    ∀ (x y : L j),
                      AddHom.toFun src✝.toAddHom (x + y) =
                        AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (x : L j),
                  AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
        ⁅x, y⁆)
      j =
    ⁅AddHom.toFun
          {
              toAddHom :=
                { toFun := ⇑(of L j),
                  map_add' :=
                    (_ :
                      ∀ (x y : L j),
                        AddHom.toFun src✝.toAddHom (x + y) =
                          AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (x : L j),
                    AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
          x,
        AddHom.toFun
          {
              toAddHom :=
                { toFun := ⇑(of L j),
                  map_add' :=
                    (_ :
                      ∀ (x y : L j),
                        AddHom.toFun src✝.toAddHom (x + y) =
                          AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (x : L j),
                    AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
          y⁆
      j

Next tactic:
simp only [of, singleAddHom, bracket_apply]
/-- The inclusion of each component into the direct sum as morphism of Lie algebras. -/
@[simps]
def lieAlgebraOf [DecidableEq ι] (j : ι) : L j →ₗ⁅R⁆ ⨁ i, L i :=
  { lof R ι L j with
    toFun := of L j
    map_lie' := fun {x y} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]
        -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        

Proof state:
case pos
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : j = i
⊢ ({ toZeroHom := { toFun := single j, map_zero' := (_ : single j 0 = 0) },
          map_add' := (_ : ∀ (b₁ b₂ : L j), single j (b₁ + b₂) = single j b₁ + single j b₂) }
        ⁅x, y⁆)
      j =
    ⁅({ toZeroHom := { toFun := single j, map_zero' := (_ : single j 0 = 0) },
            map_add' := (_ : ∀ (b₁ b₂ : L j), single j (b₁ + b₂) = single j b₁ + single j b₂) }
          x)
        j,
      ({ toZeroHom := { toFun := single j, map_zero' := (_ : single j 0 = 0) },
            map_add' := (_ : ∀ (b₁ b₂ : L j), single j (b₁ + b₂) = single j b₁ + single j b₂) }
          y)
        j⁆

Next tactic:
erw [AddHom.coe_mk, single_apply, single_apply]
/-- The inclusion of each component into the direct sum as morphism of Lie algebras. -/
@[simps]
def lieAlgebraOf [DecidableEq ι] (j : ι) : L j →ₗ⁅R⁆ ⨁ i, L i :=
  { lof R ι L j with
    toFun := of L j
    map_lie' := fun {x y} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]
        -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        

Proof state:
case pos
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : j = i
⊢ (if h : j = j then Eq.recOn h ⁅x, y⁆ else 0) = ⁅if h : j = j then Eq.recOn h x else 0, (single j y) j⁆
case pos.hmul
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : j = i
⊢ ∀ (x y : L j), single j (x + y) = single j x + single j y

Next tactic:
simp? [h] says simp only [h, dite_eq_ite, ite_true, single_apply]
/-- The inclusion of each component into the direct sum as morphism of Lie algebras. -/
@[simps]
def lieAlgebraOf [DecidableEq ι] (j : ι) : L j →ₗ⁅R⁆ ⨁ i, L i :=
  { lof R ι L j with
    toFun := of L j
    map_lie' := fun {x y} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]
        -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        simp? [h] says 

Proof state:
case pos
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : j = i
⊢ (if h : j = j then Eq.recOn h ⁅x, y⁆ else 0) = ⁅if h : j = j then Eq.recOn h x else 0, (single j y) j⁆
case pos.hmul
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : j = i
⊢ ∀ (x y : L j), single j (x + y) = single j x + single j y

Next tactic:
simp only [h, dite_eq_ite, ite_true, single_apply]
/-- The inclusion of each component into the direct sum as morphism of Lie algebras. -/
@[simps]
def lieAlgebraOf [DecidableEq ι] (j : ι) : L j →ₗ⁅R⁆ ⨁ i, L i :=
  { lof R ι L j with
    toFun := of L j
    map_lie' := fun {x y} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]
        -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        simp? [h] says simp only [h, dite_eq_ite, ite_true, single_apply]
        

Proof state:
case pos.hmul
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : j = i
⊢ ∀ (x y : L j), single j (x + y) = single j x + single j y

Next tactic:
intros
/-- The inclusion of each component into the direct sum as morphism of Lie algebras. -/
@[simps]
def lieAlgebraOf [DecidableEq ι] (j : ι) : L j →ₗ⁅R⁆ ⨁ i, L i :=
  { lof R ι L j with
    toFun := of L j
    map_lie' := fun {x y} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]
        -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        simp? [h] says simp only [h, dite_eq_ite, ite_true, single_apply]
        intros
        

Proof state:
case pos.hmul
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : j = i
x✝ y✝ : L j
⊢ single j (x✝ + y✝) = single j x✝ + single j y✝

Next tactic:
erw [single_add]
/-- The inclusion of each component into the direct sum as morphism of Lie algebras. -/
@[simps]
def lieAlgebraOf [DecidableEq ι] (j : ι) : L j →ₗ⁅R⁆ ⨁ i, L i :=
  { lof R ι L j with
    toFun := of L j
    map_lie' := fun {x y} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]
        -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        simp? [h] says simp only [h, dite_eq_ite, ite_true, single_apply]
        intros
        erw [single_add]
      · -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        

Proof state:
case neg
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : ¬j = i
⊢ (AddHom.toFun
        {
            toAddHom :=
              { toFun := ⇑(of L j),
                map_add' :=
                  (_ :
                    ∀ (x y : L j),
                      AddHom.toFun src✝.toAddHom (x + y) =
                        AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (x : L j),
                  AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
        ⁅x, y⁆)
      i =
    ⁅AddHom.toFun
          {
              toAddHom :=
                { toFun := ⇑(of L j),
                  map_add' :=
                    (_ :
                      ∀ (x y : L j),
                        AddHom.toFun src✝.toAddHom (x + y) =
                          AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (x : L j),
                    AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
          x,
        AddHom.toFun
          {
              toAddHom :=
                { toFun := ⇑(of L j),
                  map_add' :=
                    (_ :
                      ∀ (x y : L j),
                        AddHom.toFun src✝.toAddHom (x + y) =
                          AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
              map_smul' :=
                (_ :
                  ∀ (r : R) (x : L j),
                    AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
          y⁆
      i

Next tactic:
simp only [of, singleAddHom, bracket_apply]
/-- The inclusion of each component into the direct sum as morphism of Lie algebras. -/
@[simps]
def lieAlgebraOf [DecidableEq ι] (j : ι) : L j →ₗ⁅R⁆ ⨁ i, L i :=
  { lof R ι L j with
    toFun := of L j
    map_lie' := fun {x y} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]
        -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        simp? [h] says simp only [h, dite_eq_ite, ite_true, single_apply]
        intros
        erw [single_add]
      · -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        

Proof state:
case neg
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : ¬j = i
⊢ ({ toZeroHom := { toFun := single j, map_zero' := (_ : single j 0 = 0) },
          map_add' := (_ : ∀ (b₁ b₂ : L j), single j (b₁ + b₂) = single j b₁ + single j b₂) }
        ⁅x, y⁆)
      i =
    ⁅({ toZeroHom := { toFun := single j, map_zero' := (_ : single j 0 = 0) },
            map_add' := (_ : ∀ (b₁ b₂ : L j), single j (b₁ + b₂) = single j b₁ + single j b₂) }
          x)
        i,
      ({ toZeroHom := { toFun := single j, map_zero' := (_ : single j 0 = 0) },
            map_add' := (_ : ∀ (b₁ b₂ : L j), single j (b₁ + b₂) = single j b₁ + single j b₂) }
          y)
        i⁆

Next tactic:
erw [AddHom.coe_mk, single_apply, single_apply]
/-- The inclusion of each component into the direct sum as morphism of Lie algebras. -/
@[simps]
def lieAlgebraOf [DecidableEq ι] (j : ι) : L j →ₗ⁅R⁆ ⨁ i, L i :=
  { lof R ι L j with
    toFun := of L j
    map_lie' := fun {x y} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]
        -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        simp? [h] says simp only [h, dite_eq_ite, ite_true, single_apply]
        intros
        erw [single_add]
      · -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        

Proof state:
case neg
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : ¬j = i
⊢ (if h : j = i then Eq.recOn h ⁅x, y⁆ else 0) = ⁅if h : j = i then Eq.recOn h x else 0, (single j y) i⁆
case neg.hmul
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : ¬j = i
⊢ ∀ (x y : L j), single j (x + y) = single j x + single j y

Next tactic:
simp only [h, dite_false, single_apply, lie_self]
/-- The inclusion of each component into the direct sum as morphism of Lie algebras. -/
@[simps]
def lieAlgebraOf [DecidableEq ι] (j : ι) : L j →ₗ⁅R⁆ ⨁ i, L i :=
  { lof R ι L j with
    toFun := of L j
    map_lie' := fun {x y} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]
        -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        simp? [h] says simp only [h, dite_eq_ite, ite_true, single_apply]
        intros
        erw [single_add]
      · -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        simp only [h, dite_false, single_apply, lie_self]
        

Proof state:
case neg.hmul
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : ¬j = i
⊢ ∀ (x y : L j), single j (x + y) = single j x + single j y

Next tactic:
intros
/-- The inclusion of each component into the direct sum as morphism of Lie algebras. -/
@[simps]
def lieAlgebraOf [DecidableEq ι] (j : ι) : L j →ₗ⁅R⁆ ⨁ i, L i :=
  { lof R ι L j with
    toFun := of L j
    map_lie' := fun {x y} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]
        -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        simp? [h] says simp only [h, dite_eq_ite, ite_true, single_apply]
        intros
        erw [single_add]
      · -- This used to be the end of the proof before leanprover/lean4#2644
        -- with `simp [of, singleAddHom]`
        simp only [of, singleAddHom, bracket_apply]
        erw [AddHom.coe_mk, single_apply, single_apply]
        simp only [h, dite_false, single_apply, lie_self]
        intros
        

Proof state:
case neg.hmul
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L j
i : ι
h : ¬j = i
x✝ y✝ : L j
⊢ single j (x✝ + y✝) = single j x✝ + single j y✝

Next tactic:
erw [single_add]
/-- The projection map onto one component, as a morphism of Lie algebras. -/
@[simps]
def lieAlgebraComponent (j : ι) : (⨁ i, L i) →ₗ⁅R⁆ L j :=
  { component R ι L j with
    toFun := component R ι L j
    map_lie' := fun {x y} => by 

Proof state:
R : Type u
ι : Type v
inst✝² : CommRing R
L : ι → Type w
inst✝¹ : (i : ι) → LieRing (L i)
inst✝ : (i : ι) → LieAlgebra R (L i)
j : ι
src✝ : (⨁ (i : ι), L i) →ₗ[R] L j := component R ι L j
x y : ⨁ (i : ι), L i
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := ⇑(component R ι L j),
              map_add' :=
                (_ :
                  ∀ (x y : ⨁ (i : ι), L i),
                    AddHom.toFun src✝.toAddHom (x + y) = AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
          map_smul' :=
            (_ :
              ∀ (r : R) (x : ⨁ (i : ι), L i),
                AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
      ⁅x, y⁆ =
    ⁅AddHom.toFun
        {
            toAddHom :=
              { toFun := ⇑(component R ι L j),
                map_add' :=
                  (_ :
                    ∀ (x y : ⨁ (i : ι), L i),
                      AddHom.toFun src✝.toAddHom (x + y) =
                        AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (x : ⨁ (i : ι), L i),
                  AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
        x,
      AddHom.toFun
        {
            toAddHom :=
              { toFun := ⇑(component R ι L j),
                map_add' :=
                  (_ :
                    ∀ (x y : ⨁ (i : ι), L i),
                      AddHom.toFun src✝.toAddHom (x + y) =
                        AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (x : ⨁ (i : ι), L i),
                  AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
        y⁆

Next tactic:
simp [component, lapply]
/-- Given a family of Lie algebras `L i`, together with a family of morphisms of Lie algebras
`f i : L i →ₗ⁅R⁆ L'` into a fixed Lie algebra `L'`, we have a natural linear map:
`(⨁ i, L i) →ₗ[R] L'`. If in addition `⁅f i x, f j y⁆ = 0` for any `x ∈ L i` and `y ∈ L j` (`i ≠ j`)
then this map is a morphism of Lie algebras. -/
@[simps]
def toLieAlgebra [DecidableEq ι] (L' : Type w₁) [LieRing L'] [LieAlgebra R L']
    (f : ∀ i, L i →ₗ⁅R⁆ L') (hf : ∀ i j : ι, i ≠ j → ∀ (x : L i) (y : L j), ⁅f i x, f j y⁆ = 0) :
    (⨁ i, L i) →ₗ⁅R⁆ L' :=
  { toModule R ι L' fun i => (f i : L i →ₗ[R] L') with
    toFun := toModule R ι L' fun i => (f i : L i →ₗ[R] L')
    map_lie' := fun {x y} => by
      

Proof state:
R : Type u
ι : Type v
inst✝⁵ : CommRing R
L : ι → Type w
inst✝⁴ : (i : ι) → LieRing (L i)
inst✝³ : (i : ι) → LieAlgebra R (L i)
inst✝² : DecidableEq ι
L' : Type w₁
inst✝¹ : LieRing L'
inst✝ : LieAlgebra R L'
f : (i : ι) → L i →ₗ⁅R⁆ L'
hf : ∀ (i j : ι), i ≠ j → ∀ (x : L i) (y : L j), ⁅(f i) x, (f j) y⁆ = 0
src✝ : (⨁ (i : ι), L i) →ₗ[R] L' := toModule R ι L' fun i => ↑(f i)
x y : ⨁ (i : ι), L i
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := ⇑(toModule R ι L' fun i => ↑(f i)),
              map_add' :=
                (_ :
                  ∀ (x y : ⨁ (i : ι), L i),
                    AddHom.toFun src✝.toAddHom (x + y) = AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
          map_smul' :=
            (_ :
              ∀ (r : R) (x : ⨁ (i : ι), L i),
                AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
      ⁅x, y⁆ =
    ⁅AddHom.toFun
        {
            toAddHom :=
              { toFun := ⇑(toModule R ι L' fun i => ↑(f i)),
                map_add' :=
                  (_ :
                    ∀ (x y : ⨁ (i : ι), L i),
                      AddHom.toFun src✝.toAddHom (x + y) =
                        AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (x : ⨁ (i : ι), L i),
                  AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
        x,
      AddHom.toFun
        {
            toAddHom :=
              { toFun := ⇑(toModule R ι L' fun i => ↑(f i)),
                map_add' :=
                  (_ :
                    ∀ (x y : ⨁ (i : ι), L i),
                      AddHom.toFun src✝.toAddHom (x + y) =
                        AddHom.toFun src✝.toAddHom x + AddHom.toFun src✝.toAddHom y) },
            map_smul' :=
              (_ :
                ∀ (r : R) (x : ⨁ (i : ι), L i),
                  AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
        y⁆

Next tactic:
let f' i := (f i : L i →ₗ[R] L')
/-- Given a family of Lie algebras `L i`, together with a family of morphisms of Lie algebras
`f i : L i →ₗ⁅R⁆ L'` into a fixed Lie algebra `L'`, we have a natural linear map:
`(⨁ i, L i) →ₗ[R] L'`. If in addition `⁅f i x, f j y⁆ = 0` for any `x ∈ L i` and `y ∈ L j` (`i ≠ j`)
then this map is a morphism of Lie algebras. -/
@[simps]
def toLieAlgebra [DecidableEq ι] (L' : Type w₁) [LieRing L'] [LieAlgebra R L']
    (f : ∀ i, L i →ₗ⁅R⁆ L') (hf : ∀ i j : ι, i ≠ j → ∀ (x : L i) (y : L j), ⁅f i x, f j y⁆ = 0) :
    (⨁ i, L i) →ₗ⁅R⁆ L' :=
  { toModule R ι L' fun i => (f i : L i →ₗ[R] L') with
    toFun := toModule R ι L' fun i => (f i : L i →ₗ[R] L')
    map_lie' := fun {x y} => by
      let f' i := (f i : L i →ₗ[R] L')
      /- The goal is linear in `y`. We can use this to reduce to the case that `y` has only one
        non-zero component. -/
      suffices ∀ (i : ι) (y : L i),
          toModule R ι L' f' ⁅x, of L i y⁆ =
            ⁅toModule R ι L' f' x, toModule R ι L' f' (of L i y)⁆ by
        simp only [← LieAlgebra.ad_apply R]
        

Proof state:
R : Type u
ι : Type v
inst✝⁵ : CommRing R
L : ι → Type w
inst✝⁴ : (i : ι) → LieRing (L i)
inst✝³ : (i : ι) → LieAlgebra R (L i)
inst✝² : DecidableEq ι
L' : Type w₁
inst✝¹ : LieRing L'
inst✝ : LieAlgebra R L'
f : (i : ι) → L i →ₗ⁅R⁆ L'
hf : ∀ (i j : ι), i ≠ j → ∀ (x : L i) (y : L j), ⁅(f i) x, (f j) y⁆ = 0
src✝ : (⨁ (i : ι), L i) →ₗ[R] L' := toModule R ι L' fun i => ↑(f i)
x y : ⨁ (i : ι), L i
f' : (i : ι) → L i →ₗ[R] L' := fun i => ↑(f i)
this :
  ∀ (i : ι) (y : L i),
    (toModule R ι L' f') ⁅x, (of L i) y⁆ = ⁅(toModule R ι L' f') x, (toModule R ι L' f') ((of L i) y)⁆
⊢ (toModule R ι L' fun i => ↑(f i)) (((LieAlgebra.ad R (⨁ (i : ι), L i)) x) y) =
    ((LieAlgebra.ad R L') ((toModule R ι L' fun i => ↑(f i)) x)) ((toModule R ι L' fun i => ↑(f i)) y)

Next tactic:
rw [← LinearMap.comp_apply, ← LinearMap.comp_apply]