l3lab/ntp-mathlib huggingface dataset:
/-- The inclusion of each component into a direct sum as a morphism of Lie modules. -/
def lieModuleOf [DecidableEq ι] (j : ι) : M j →ₗ⁅R,L⁆ ⨁ i, M i :=
  { lof R ι M j with
    map_lie' := fun {x m} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]; simp
      · -- This used to be the end of the proof before leanprover/lean4#2644
        -- old proof `simp [lof, lsingle, h]`
        simp only [lof, lsingle, AddHom.toFun_eq_coe, lie_module_bracket_apply]
        

Proof state:
case neg
R : Type u
ι : Type v
inst✝⁷ : CommRing R
L : Type w₁
M : ι → Type w
inst✝⁶ : LieRing L
inst✝⁵ : LieAlgebra R L
inst✝⁴ : (i : ι) → AddCommGroup (M i)
inst✝³ : (i : ι) → Module R (M i)
inst✝² : (i : ι) → LieRingModule L (M i)
inst✝¹ : ∀ (i : ι), LieModule R L (M i)
inst✝ : DecidableEq ι
j : ι
src✝ : M j →ₗ[R] ⨁ (i : ι), M i := lof R ι M j
x : L
m : M j
i : ι
h : ¬j = i
⊢ ({ toFun := single j,
          map_add' :=
            (_ :
              ∀ (x y : M j),
                ZeroHom.toFun (↑(singleAddHom (fun i => M i) j)) (x + y) =
                  ZeroHom.toFun (↑(singleAddHom (fun i => M i) j)) x +
                    ZeroHom.toFun (↑(singleAddHom (fun i => M i) j)) y) }
        ⁅x, m⁆)
      i =
    ⁅x,
      ({ toFun := single j,
            map_add' :=
              (_ :
                ∀ (x y : M j),
                  ZeroHom.toFun (↑(singleAddHom (fun i => M i) j)) (x + y) =
                    ZeroHom.toFun (↑(singleAddHom (fun i => M i) j)) x +
                      ZeroHom.toFun (↑(singleAddHom (fun i => M i) j)) y) }
          m)
        i⁆

Next tactic:
erw [AddHom.coe_mk]
/-- The inclusion of each component into a direct sum as a morphism of Lie modules. -/
def lieModuleOf [DecidableEq ι] (j : ι) : M j →ₗ⁅R,L⁆ ⨁ i, M i :=
  { lof R ι M j with
    map_lie' := fun {x m} => by
      refine' DFinsupp.ext fun i => _ -- Porting note: Originally `ext i`
      by_cases h : j = i
      · rw [← h]; simp
      · -- This used to be the end of the proof before leanprover/lean4#2644
        -- old proof `simp [lof, lsingle, h]`
        simp only [lof, lsingle, AddHom.toFun_eq_coe, lie_module_bracket_apply]
        erw [AddHom.coe_mk]
        

Proof state:
case neg
R : Type u
ι : Type v
inst✝⁷ : CommRing R
L : Type w₁
M : ι → Type w
inst✝⁶ : LieRing L
inst✝⁵ : LieAlgebra R L
inst✝⁴ : (i : ι) → AddCommGroup (M i)
inst✝³ : (i : ι) → Module R (M i)
inst✝² : (i : ι) → LieRingModule L (M i)
inst✝¹ : ∀ (i : ι), LieModule R L (M i)
inst✝ : DecidableEq ι
j : ι
src✝ : M j →ₗ[R] ⨁ (i : ι), M i := lof R ι M j
x : L
m : M j
i : ι
h : ¬j = i
⊢ (single j ⁅x, m⁆) i = ⁅x, (single j m) i⁆

Next tactic:
simp [h]
/-- The projection map onto one component, as a morphism of Lie modules. -/
def lieModuleComponent (j : ι) : (⨁ i, M i) →ₗ⁅R,L⁆ M j :=
  { component R ι M j with
    map_lie' := fun {x m} => by 

Proof state:
R : Type u
ι : Type v
inst✝⁶ : CommRing R
L : Type w₁
M : ι → Type w
inst✝⁵ : LieRing L
inst✝⁴ : LieAlgebra R L
inst✝³ : (i : ι) → AddCommGroup (M i)
inst✝² : (i : ι) → Module R (M i)
inst✝¹ : (i : ι) → LieRingModule L (M i)
inst✝ : ∀ (i : ι), LieModule R L (M i)
j : ι
src✝ : (⨁ (i : ι), M i) →ₗ[R] M j := component R ι M j
x : L
m : ⨁ (i : ι), M i
⊢ AddHom.toFun
      { toAddHom := src✝.toAddHom,
          map_smul' :=
            (_ :
              ∀ (r : R) (x : ⨁ (i : ι), M i),
                AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
      ⁅x, m⁆ =
    ⁅x,
      AddHom.toFun
        { toAddHom := src✝.toAddHom,
            map_smul' :=
              (_ :
                ∀ (r : R) (x : ⨁ (i : ι), M i),
                  AddHom.toFun src✝.toAddHom (r • x) = (RingHom.id R) r • AddHom.toFun src✝.toAddHom x) }.toAddHom
        m⁆

Next tactic:
simp [component, lapply]
instance lieRing : LieRing (⨁ i, L i) :=
  { (inferInstance : AddCommGroup _) with
    bracket := zipWith (fun i => fun x y => ⁅x, y⁆) fun i => lie_zero 0
    add_lie := fun x y z => 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)
src✝ : AddCommGroup (⨁ (i : ι), L i) := inferInstance
x y z : ⨁ (i : ι), L i
⊢ ⁅x + y, z⁆ = ⁅x, z⁆ + ⁅y, z⁆

Next tactic:
refine' DFinsupp.ext fun _ => _
instance lieRing : LieRing (⨁ i, L i) :=
  { (inferInstance : AddCommGroup _) with
    bracket := zipWith (fun i => fun x y => ⁅x, y⁆) fun i => lie_zero 0
    add_lie := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      

Proof state:
R : Type u
ι : Type v
inst✝² : CommRing R
L : ι → Type w
inst✝¹ : (i : ι) → LieRing (L i)
inst✝ : (i : ι) → LieAlgebra R (L i)
src✝ : AddCommGroup (⨁ (i : ι), L i) := inferInstance
x y z : ⨁ (i : ι), L i
x✝ : ι
⊢ ⁅x + y, z⁆ x✝ = (⁅x, z⁆ + ⁅y, z⁆) x✝

Next tactic:
simp only [zipWith_apply, add_apply, add_lie]
instance lieRing : LieRing (⨁ i, L i) :=
  { (inferInstance : AddCommGroup _) with
    bracket := zipWith (fun i => fun x y => ⁅x, y⁆) fun i => lie_zero 0
    add_lie := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, add_lie]
    lie_add := fun x y z => 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)
src✝ : AddCommGroup (⨁ (i : ι), L i) := inferInstance
x y z : ⨁ (i : ι), L i
⊢ ⁅x, y + z⁆ = ⁅x, y⁆ + ⁅x, z⁆

Next tactic:
refine' DFinsupp.ext fun _ => _
instance lieRing : LieRing (⨁ i, L i) :=
  { (inferInstance : AddCommGroup _) with
    bracket := zipWith (fun i => fun x y => ⁅x, y⁆) fun i => lie_zero 0
    add_lie := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, add_lie]
    lie_add := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      

Proof state:
R : Type u
ι : Type v
inst✝² : CommRing R
L : ι → Type w
inst✝¹ : (i : ι) → LieRing (L i)
inst✝ : (i : ι) → LieAlgebra R (L i)
src✝ : AddCommGroup (⨁ (i : ι), L i) := inferInstance
x y z : ⨁ (i : ι), L i
x✝ : ι
⊢ ⁅x, y + z⁆ x✝ = (⁅x, y⁆ + ⁅x, z⁆) x✝

Next tactic:
simp only [zipWith_apply, add_apply, lie_add]
instance lieRing : LieRing (⨁ i, L i) :=
  { (inferInstance : AddCommGroup _) with
    bracket := zipWith (fun i => fun x y => ⁅x, y⁆) fun i => lie_zero 0
    add_lie := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, add_lie]
    lie_add := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, lie_add]
    lie_self := fun x => 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)
src✝ : AddCommGroup (⨁ (i : ι), L i) := inferInstance
x : ⨁ (i : ι), L i
⊢ ⁅x, x⁆ = 0

Next tactic:
refine' DFinsupp.ext fun _ => _
instance lieRing : LieRing (⨁ i, L i) :=
  { (inferInstance : AddCommGroup _) with
    bracket := zipWith (fun i => fun x y => ⁅x, y⁆) fun i => lie_zero 0
    add_lie := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, add_lie]
    lie_add := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, lie_add]
    lie_self := fun x => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      

Proof state:
R : Type u
ι : Type v
inst✝² : CommRing R
L : ι → Type w
inst✝¹ : (i : ι) → LieRing (L i)
inst✝ : (i : ι) → LieAlgebra R (L i)
src✝ : AddCommGroup (⨁ (i : ι), L i) := inferInstance
x : ⨁ (i : ι), L i
x✝ : ι
⊢ ⁅x, x⁆ x✝ = 0 x✝

Next tactic:
simp only [zipWith_apply, add_apply, lie_self, zero_apply]
instance lieRing : LieRing (⨁ i, L i) :=
  { (inferInstance : AddCommGroup _) with
    bracket := zipWith (fun i => fun x y => ⁅x, y⁆) fun i => lie_zero 0
    add_lie := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, add_lie]
    lie_add := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, lie_add]
    lie_self := fun x => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, lie_self, zero_apply]
    leibniz_lie := fun x y z => 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)
src✝ : AddCommGroup (⨁ (i : ι), L i) := inferInstance
x y z : ⨁ (i : ι), L i
⊢ ⁅x, ⁅y, z⁆⁆ = ⁅⁅x, y⁆, z⁆ + ⁅y, ⁅x, z⁆⁆

Next tactic:
refine' DFinsupp.ext fun _ => _
instance lieRing : LieRing (⨁ i, L i) :=
  { (inferInstance : AddCommGroup _) with
    bracket := zipWith (fun i => fun x y => ⁅x, y⁆) fun i => lie_zero 0
    add_lie := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, add_lie]
    lie_add := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, lie_add]
    lie_self := fun x => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, lie_self, zero_apply]
    leibniz_lie := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      

Proof state:
R : Type u
ι : Type v
inst✝² : CommRing R
L : ι → Type w
inst✝¹ : (i : ι) → LieRing (L i)
inst✝ : (i : ι) → LieAlgebra R (L i)
src✝ : AddCommGroup (⨁ (i : ι), L i) := inferInstance
x y z : ⨁ (i : ι), L i
x✝ : ι
⊢ ⁅x, ⁅y, z⁆⁆ x✝ = (⁅⁅x, y⁆, z⁆ + ⁅y, ⁅x, z⁆⁆) x✝

Next tactic:
simp only [sub_apply, zipWith_apply, add_apply, zero_apply]
instance lieRing : LieRing (⨁ i, L i) :=
  { (inferInstance : AddCommGroup _) with
    bracket := zipWith (fun i => fun x y => ⁅x, y⁆) fun i => lie_zero 0
    add_lie := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, add_lie]
    lie_add := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, lie_add]
    lie_self := fun x => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [zipWith_apply, add_apply, lie_self, zero_apply]
    leibniz_lie := fun x y z => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      simp only [sub_apply, zipWith_apply, add_apply, zero_apply]
      

Proof state:
R : Type u
ι : Type v
inst✝² : CommRing R
L : ι → Type w
inst✝¹ : (i : ι) → LieRing (L i)
inst✝ : (i : ι) → LieAlgebra R (L i)
src✝ : AddCommGroup (⨁ (i : ι), L i) := inferInstance
x y z : ⨁ (i : ι), L i
x✝ : ι
⊢ ⁅x x✝, ⁅y x✝, z x✝⁆⁆ = ⁅⁅x x✝, y x✝⁆, z x✝⁆ + ⁅y x✝, ⁅x x✝, z x✝⁆⁆

Next tactic:
apply leibniz_lie
theorem lie_of_of_ne [DecidableEq ι] {i j : ι} (hij : i ≠ j) (x : L i) (y : L j) :
    ⁅of L i x, of L j y⁆ = 0 := 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 ι
i j : ι
hij : i ≠ j
x : L i
y : L j
⊢ ⁅(of L i) x, (of L j) y⁆ = 0

Next tactic:
refine DFinsupp.ext fun k => ?_
theorem lie_of_of_ne [DecidableEq ι] {i j : ι} (hij : i ≠ j) (x : L i) (y : L j) :
    ⁅of L i x, of L j y⁆ = 0 := by
  refine DFinsupp.ext fun k => ?_
  

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 ι
i j : ι
hij : i ≠ j
x : L i
y : L j
k : ι
⊢ ⁅(of L i) x, (of L j) y⁆ k = 0 k

Next tactic:
rw [bracket_apply]
theorem lie_of_of_ne [DecidableEq ι] {i j : ι} (hij : i ≠ j) (x : L i) (y : L j) :
    ⁅of L i x, of L j y⁆ = 0 := by
  refine DFinsupp.ext fun k => ?_
  rw [bracket_apply]
  

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 ι
i j : ι
hij : i ≠ j
x : L i
y : L j
k : ι
⊢ ⁅((of L i) x) k, ((of L j) y) k⁆ = 0 k

Next tactic:
obtain rfl | hik := Decidable.eq_or_ne i k
theorem lie_of_of_ne [DecidableEq ι] {i j : ι} (hij : i ≠ j) (x : L i) (y : L j) :
    ⁅of L i x, of L j y⁆ = 0 := by
  refine DFinsupp.ext fun k => ?_
  rw [bracket_apply]
  obtain rfl | hik := Decidable.eq_or_ne i k
  · 

Proof state:
case inl
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
i j : ι
hij : i ≠ j
x : L i
y : L j
⊢ ⁅((of L i) x) i, ((of L j) y) i⁆ = 0 i

Next tactic:
rw [of_eq_of_ne _ _ _ _ hij.symm, lie_zero, zero_apply]
theorem lie_of_of_ne [DecidableEq ι] {i j : ι} (hij : i ≠ j) (x : L i) (y : L j) :
    ⁅of L i x, of L j y⁆ = 0 := by
  refine DFinsupp.ext fun k => ?_
  rw [bracket_apply]
  obtain rfl | hik := Decidable.eq_or_ne i k
  · rw [of_eq_of_ne _ _ _ _ hij.symm, lie_zero, zero_apply]
  · 

Proof state:
case inr
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
i j : ι
hij : i ≠ j
x : L i
y : L j
k : ι
hik : i ≠ k
⊢ ⁅((of L i) x) k, ((of L j) y) k⁆ = 0 k

Next tactic:
rw [of_eq_of_ne _ _ _ _ hik, zero_lie, zero_apply]
@[simp]
theorem lie_of [DecidableEq ι] {i j : ι} (x : L i) (y : L j) :
    ⁅of L i x, of L j y⁆ = if hij : i = j then of L i ⁅x, hij.symm.recOn y⁆ else 0 := 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 ι
i j : ι
x : L i
y : L j
⊢ ⁅(of L i) x, (of L j) y⁆ = if hij : i = j then (of L i) ⁅x, Eq.recOn (_ : j = i) y⁆ else 0

Next tactic:
obtain rfl | hij := Decidable.eq_or_ne i j
@[simp]
theorem lie_of [DecidableEq ι] {i j : ι} (x : L i) (y : L j) :
    ⁅of L i x, of L j y⁆ = if hij : i = j then of L i ⁅x, hij.symm.recOn y⁆ else 0 := by
  obtain rfl | hij := Decidable.eq_or_ne i j
  · 

Proof state:
case inl
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
i : ι
x y : L i
⊢ ⁅(of L i) x, (of L i) y⁆ = if hij : i = i then (of L i) ⁅x, Eq.recOn (_ : i = i) y⁆ else 0

Next tactic:
simp only [lie_of_same L x y, dif_pos]
@[simp]
theorem lie_of [DecidableEq ι] {i j : ι} (x : L i) (y : L j) :
    ⁅of L i x, of L j y⁆ = if hij : i = j then of L i ⁅x, hij.symm.recOn y⁆ else 0 := by
  obtain rfl | hij := Decidable.eq_or_ne i j
  · simp only [lie_of_same L x y, dif_pos]
  · 

Proof state:
case inr
R : Type u
ι : Type v
inst✝³ : CommRing R
L : ι → Type w
inst✝² : (i : ι) → LieRing (L i)
inst✝¹ : (i : ι) → LieAlgebra R (L i)
inst✝ : DecidableEq ι
i j : ι
x : L i
y : L j
hij : i ≠ j
⊢ ⁅(of L i) x, (of L j) y⁆ = if hij : i = j then (of L i) ⁅x, Eq.recOn (_ : j = i) y⁆ else 0

Next tactic:
simp only [lie_of_of_ne L hij x y, hij, dif_neg, dite_false]
instance lieAlgebra : LieAlgebra R (⨁ i, L i) :=
  { (inferInstance : Module R _) with
    lie_smul := fun c 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)
src✝ : Module R (⨁ (i : ι), L i) := inferInstance
c : R
x y : ⨁ (i : ι), L i
⊢ ⁅x, c • y⁆ = c • ⁅x, y⁆

Next tactic:
refine' DFinsupp.ext fun _ => _
instance lieAlgebra : LieAlgebra R (⨁ i, L i) :=
  { (inferInstance : Module R _) with
    lie_smul := fun c x y => by
      refine' DFinsupp.ext fun _ => _ -- Porting note: Originally `ext`
      

Proof state:
R : Type u
ι : Type v
inst✝² : CommRing R
L : ι → Type w
inst✝¹ : (i : ι) → LieRing (L i)
inst✝ : (i : ι) → LieAlgebra R (L i)
src✝ : Module R (⨁ (i : ι), L i) := inferInstance
c : R
x y : ⨁ (i : ι), L i
x✝ : ι
⊢ ⁅x, c • y⁆ x✝ = (c • ⁅x, y⁆) x✝

Next tactic:
simp only [zipWith_apply, smul_apply, bracket_apply, lie_smul]
/-- 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
      

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 ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L 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, y⁆ =
    ⁅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⁆

Next tactic:
refine' DFinsupp.ext fun i => _
/-- 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`
      

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 ι
j : ι
src✝ : L j →ₗ[R] ⨁ (i : ι), L i := lof R ι L j
x y : L 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:
by_cases h : j = i
/-- 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
      · 

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⁆)
      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:
rw [← h]