l3lab/ntp-mathlib huggingface dataset:
/-- An encoding of bounded formulas as lists. -/
@[simps]
protected def encoding : Encoding (Σn, L.BoundedFormula α n) where
  Γ := Sum (Σk, L.Term (Sum α (Fin k))) (Sum (Σn, L.Relations n) ℕ)
  encode φ := φ.2.listEncode
  decode l := (listDecode l).1
  decode_encode φ := by
    have h := listDecode_encode_list [φ]
    rw [bind_singleton] at h
    simp only
    

Proof state:
L : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
φ : (n : ℕ) × BoundedFormula L α n
h : (listDecode (listEncode φ.snd)).1 = headI [φ]
⊢ some (listDecode (listEncode φ.snd)).1 = some φ

Next tactic:
rw [h]
/-- An encoding of bounded formulas as lists. -/
@[simps]
protected def encoding : Encoding (Σn, L.BoundedFormula α n) where
  Γ := Sum (Σk, L.Term (Sum α (Fin k))) (Sum (Σn, L.Relations n) ℕ)
  encode φ := φ.2.listEncode
  decode l := (listDecode l).1
  decode_encode φ := by
    have h := listDecode_encode_list [φ]
    rw [bind_singleton] at h
    simp only
    rw [h]
    

Proof state:
L : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
φ : (n : ℕ) × BoundedFormula L α n
h : (listDecode (listEncode φ.snd)).1 = headI [φ]
⊢ some (headI [φ]) = some φ

Next tactic:
rfl
theorem card_le : #(Σn, L.BoundedFormula α n) ≤
    max ℵ₀ (Cardinal.lift.{max u v} #α + Cardinal.lift.{u'} L.card) := by
  

Proof state:
L : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
⊢ #((n : ℕ) × BoundedFormula L α n) ≤ max ℵ₀ (lift.{max u v, u'} #α + lift.{u', max u v} (card L))

Next tactic:
refine' lift_le.1 (BoundedFormula.encoding.card_le_card_list.trans _)
theorem card_le : #(Σn, L.BoundedFormula α n) ≤
    max ℵ₀ (Cardinal.lift.{max u v} #α + Cardinal.lift.{u'} L.card) := by
  refine' lift_le.1 (BoundedFormula.encoding.card_le_card_list.trans _)
  

Proof state:
L : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
⊢ lift.{max (max u' v) u, max (max u' v) u} #(List BoundedFormula.encoding.Γ) ≤
    lift.{max (max u u') v, max (max u u') v} (max ℵ₀ (lift.{max u v, u'} #α + lift.{u', max u v} (card L)))

Next tactic:
rw [encoding_Γ, mk_list_eq_max_mk_aleph0, lift_max, lift_aleph0, lift_max, lift_aleph0,
    max_le_iff]
theorem card_le : #(Σn, L.BoundedFormula α n) ≤
    max ℵ₀ (Cardinal.lift.{max u v} #α + Cardinal.lift.{u'} L.card) := by
  refine' lift_le.1 (BoundedFormula.encoding.card_le_card_list.trans _)
  rw [encoding_Γ, mk_list_eq_max_mk_aleph0, lift_max, lift_aleph0, lift_max, lift_aleph0,
    max_le_iff]
  

Proof state:
L : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
⊢ lift.{max (max u u') v, max (max u u') v} #((k : ℕ) × Term L (α ⊕ Fin k) ⊕ (n : ℕ) × Relations L n ⊕ ℕ) ≤
      max ℵ₀ (lift.{max (max u u') v, max (max u u') v} (lift.{max u v, u'} #α + lift.{u', max u v} (card L))) ∧
    ℵ₀ ≤ max ℵ₀ (lift.{max (max u u') v, max (max u u') v} (lift.{max u v, u'} #α + lift.{u', max u v} (card L)))

Next tactic:
refine' ⟨_, le_max_left _ _⟩
theorem card_le : #(Σn, L.BoundedFormula α n) ≤
    max ℵ₀ (Cardinal.lift.{max u v} #α + Cardinal.lift.{u'} L.card) := by
  refine' lift_le.1 (BoundedFormula.encoding.card_le_card_list.trans _)
  rw [encoding_Γ, mk_list_eq_max_mk_aleph0, lift_max, lift_aleph0, lift_max, lift_aleph0,
    max_le_iff]
  refine' ⟨_, le_max_left _ _⟩
  

Proof state:
L : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
⊢ lift.{max (max u u') v, max (max u u') v} #((k : ℕ) × Term L (α ⊕ Fin k) ⊕ (n : ℕ) × Relations L n ⊕ ℕ) ≤
    max ℵ₀ (lift.{max (max u u') v, max (max u u') v} (lift.{max u v, u'} #α + lift.{u', max u v} (card L)))

Next tactic:
rw [mk_sum, Term.card_sigma, mk_sum, ← add_eq_max le_rfl, mk_sum, mk_nat]
theorem card_le : #(Σn, L.BoundedFormula α n) ≤
    max ℵ₀ (Cardinal.lift.{max u v} #α + Cardinal.lift.{u'} L.card) := by
  refine' lift_le.1 (BoundedFormula.encoding.card_le_card_list.trans _)
  rw [encoding_Γ, mk_list_eq_max_mk_aleph0, lift_max, lift_aleph0, lift_max, lift_aleph0,
    max_le_iff]
  refine' ⟨_, le_max_left _ _⟩
  rw [mk_sum, Term.card_sigma, mk_sum, ← add_eq_max le_rfl, mk_sum, mk_nat]
  

Proof state:
L : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
⊢ lift.{max (max u u') v, max (max u u') v}
      (lift.{v, max u u'} (ℵ₀ + (lift.{u, u'} #α + lift.{u', u} #((i : ℕ) × Functions L i))) +
        lift.{max u u', v} (lift.{0, v} #((n : ℕ) × Relations L n) + lift.{v, 0} ℵ₀)) ≤
    max ℵ₀ (lift.{max (max u u') v, max (max u u') v} (lift.{max u v, u'} #α + lift.{u', max u v} (card L)))

Next tactic:
simp only [lift_add, lift_lift, lift_aleph0]
theorem card_le : #(Σn, L.BoundedFormula α n) ≤
    max ℵ₀ (Cardinal.lift.{max u v} #α + Cardinal.lift.{u'} L.card) := by
  refine' lift_le.1 (BoundedFormula.encoding.card_le_card_list.trans _)
  rw [encoding_Γ, mk_list_eq_max_mk_aleph0, lift_max, lift_aleph0, lift_max, lift_aleph0,
    max_le_iff]
  refine' ⟨_, le_max_left _ _⟩
  rw [mk_sum, Term.card_sigma, mk_sum, ← add_eq_max le_rfl, mk_sum, mk_nat]
  simp only [lift_add, lift_lift, lift_aleph0]
  

Proof state:
L : Language
M : Type w
N : Type u_1
P : Type u_2
inst✝² : Structure L M
inst✝¹ : Structure L N
inst✝ : Structure L P
α : Type u'
β : Type v'
⊢ ℵ₀ + (lift.{max (max u v) (max u u') v, u'} #α + lift.{max (max u' v) (max u u') v, u} #((i : ℕ) × Functions L i)) +
      (lift.{max (max u u') v, v} #((n : ℕ) × Relations L n) + ℵ₀) ≤
    max ℵ₀ (lift.{max (max u v) (max u u') v, u'} #α + lift.{max u' (max u u') v, max u v} (card L))

Next tactic:
rw [← add_assoc, add_comm, ← add_assoc, ← add_assoc, aleph0_add_aleph0, add_assoc,
    add_eq_max le_rfl, add_assoc, card, Symbols, mk_sum, lift_add, lift_lift, lift_lift]
/-- The zero algebra is a subalgebra of any Lie algebra. -/
instance : Zero (LieSubalgebra R L) :=
  ⟨⟨0, @fun x y hx _hy ↦ by
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
x y : L
hx : x ∈ 0.carrier
_hy : y ∈ 0.carrier
⊢ ⁅x, y⁆ ∈ 0.carrier

Next tactic:
rw [(Submodule.mem_bot R).1 hx, zero_lie]
/-- The zero algebra is a subalgebra of any Lie algebra. -/
instance : Zero (LieSubalgebra R L) :=
  ⟨⟨0, @fun x y hx _hy ↦ by
    rw [(Submodule.mem_bot R).1 hx, zero_lie]
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
x y : L
hx : x ∈ 0.carrier
_hy : y ∈ 0.carrier
⊢ 0 ∈ 0.carrier

Next tactic:
exact Submodule.zero_mem 0
instance : SetLike (LieSubalgebra R L) L
    where
  coe L' := L'.carrier
  coe_injective' L' L'' h := by
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' L'' : LieSubalgebra R L
h : (fun L' => L'.carrier) L' = (fun L' => L'.carrier) L''
⊢ L' = L''

Next tactic:
rcases L' with ⟨⟨⟩⟩
instance : SetLike (LieSubalgebra R L) L
    where
  coe L' := L'.carrier
  coe_injective' L' L'' h := by
    rcases L' with ⟨⟨⟩⟩
    

Proof state:
case mk.mk
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L'' : LieSubalgebra R L
toAddSubmonoid✝ : AddSubmonoid L
smul_mem'✝ : ∀ (c : R) {x : L}, x ∈ toAddSubmonoid✝.carrier → c • x ∈ toAddSubmonoid✝.carrier
lie_mem'✝ :
  ∀ {x y : L},
    x ∈ { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }.toAddSubmonoid.toAddSubsemigroup.carrier →
      y ∈ { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }.toAddSubmonoid.toAddSubsemigroup.carrier →
        ⁅x, y⁆ ∈ { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }.toAddSubmonoid.toAddSubsemigroup.carrier
h :
  (fun L' => L'.carrier)
      { toSubmodule := { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }, lie_mem' := lie_mem'✝ } =
    (fun L' => L'.carrier) L''
⊢ { toSubmodule := { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }, lie_mem' := lie_mem'✝ } = L''

Next tactic:
rcases L'' with ⟨⟨⟩⟩
instance : SetLike (LieSubalgebra R L) L
    where
  coe L' := L'.carrier
  coe_injective' L' L'' h := by
    rcases L' with ⟨⟨⟩⟩
    rcases L'' with ⟨⟨⟩⟩
    

Proof state:
case mk.mk.mk.mk
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
toAddSubmonoid✝¹ : AddSubmonoid L
smul_mem'✝¹ : ∀ (c : R) {x : L}, x ∈ toAddSubmonoid✝¹.carrier → c • x ∈ toAddSubmonoid✝¹.carrier
lie_mem'✝¹ :
  ∀ {x y : L},
    x ∈ { toAddSubmonoid := toAddSubmonoid✝¹, smul_mem' := smul_mem'✝¹ }.toAddSubmonoid.toAddSubsemigroup.carrier →
      y ∈ { toAddSubmonoid := toAddSubmonoid✝¹, smul_mem' := smul_mem'✝¹ }.toAddSubmonoid.toAddSubsemigroup.carrier →
        ⁅x, y⁆ ∈
          { toAddSubmonoid := toAddSubmonoid✝¹, smul_mem' := smul_mem'✝¹ }.toAddSubmonoid.toAddSubsemigroup.carrier
toAddSubmonoid✝ : AddSubmonoid L
smul_mem'✝ : ∀ (c : R) {x : L}, x ∈ toAddSubmonoid✝.carrier → c • x ∈ toAddSubmonoid✝.carrier
lie_mem'✝ :
  ∀ {x y : L},
    x ∈ { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }.toAddSubmonoid.toAddSubsemigroup.carrier →
      y ∈ { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }.toAddSubmonoid.toAddSubsemigroup.carrier →
        ⁅x, y⁆ ∈ { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }.toAddSubmonoid.toAddSubsemigroup.carrier
h :
  (fun L' => L'.carrier)
      { toSubmodule := { toAddSubmonoid := toAddSubmonoid✝¹, smul_mem' := smul_mem'✝¹ }, lie_mem' := lie_mem'✝¹ } =
    (fun L' => L'.carrier)
      { toSubmodule := { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }, lie_mem' := lie_mem'✝ }
⊢ { toSubmodule := { toAddSubmonoid := toAddSubmonoid✝¹, smul_mem' := smul_mem'✝¹ }, lie_mem' := lie_mem'✝¹ } =
    { toSubmodule := { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }, lie_mem' := lie_mem'✝ }

Next tactic:
congr
instance : SetLike (LieSubalgebra R L) L
    where
  coe L' := L'.carrier
  coe_injective' L' L'' h := by
    rcases L' with ⟨⟨⟩⟩
    rcases L'' with ⟨⟨⟩⟩
    congr
    

Proof state:
case mk.mk.mk.mk.e_toSubmodule.e_toAddSubmonoid
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
toAddSubmonoid✝¹ : AddSubmonoid L
smul_mem'✝¹ : ∀ (c : R) {x : L}, x ∈ toAddSubmonoid✝¹.carrier → c • x ∈ toAddSubmonoid✝¹.carrier
lie_mem'✝¹ :
  ∀ {x y : L},
    x ∈ { toAddSubmonoid := toAddSubmonoid✝¹, smul_mem' := smul_mem'✝¹ }.toAddSubmonoid.toAddSubsemigroup.carrier →
      y ∈ { toAddSubmonoid := toAddSubmonoid✝¹, smul_mem' := smul_mem'✝¹ }.toAddSubmonoid.toAddSubsemigroup.carrier →
        ⁅x, y⁆ ∈
          { toAddSubmonoid := toAddSubmonoid✝¹, smul_mem' := smul_mem'✝¹ }.toAddSubmonoid.toAddSubsemigroup.carrier
toAddSubmonoid✝ : AddSubmonoid L
smul_mem'✝ : ∀ (c : R) {x : L}, x ∈ toAddSubmonoid✝.carrier → c • x ∈ toAddSubmonoid✝.carrier
lie_mem'✝ :
  ∀ {x y : L},
    x ∈ { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }.toAddSubmonoid.toAddSubsemigroup.carrier →
      y ∈ { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }.toAddSubmonoid.toAddSubsemigroup.carrier →
        ⁅x, y⁆ ∈ { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }.toAddSubmonoid.toAddSubsemigroup.carrier
h :
  (fun L' => L'.carrier)
      { toSubmodule := { toAddSubmonoid := toAddSubmonoid✝¹, smul_mem' := smul_mem'✝¹ }, lie_mem' := lie_mem'✝¹ } =
    (fun L' => L'.carrier)
      { toSubmodule := { toAddSubmonoid := toAddSubmonoid✝, smul_mem' := smul_mem'✝ }, lie_mem' := lie_mem'✝ }
⊢ toAddSubmonoid✝¹ = toAddSubmonoid✝

Next tactic:
exact SetLike.coe_injective' h
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    intros
    apply SetCoe.ext
    apply lie_add
  add_lie := by
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
⊢ ∀ (x y z : ↥L'), ⁅x + y, z⁆ = ⁅x, z⁆ + ⁅y, z⁆

Next tactic:
intros
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    intros
    apply SetCoe.ext
    apply lie_add
  add_lie := by
    intros
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
x✝ y✝ z✝ : ↥L'
⊢ ⁅x✝ + y✝, z✝⁆ = ⁅x✝, z✝⁆ + ⁅y✝, z✝⁆

Next tactic:
apply SetCoe.ext
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    intros
    apply SetCoe.ext
    apply lie_add
  add_lie := by
    intros
    apply SetCoe.ext
    

Proof state:
case a
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
x✝ y✝ z✝ : ↥L'
⊢ ↑⁅x✝ + y✝, z✝⁆ = ↑(⁅x✝, z✝⁆ + ⁅y✝, z✝⁆)

Next tactic:
apply add_lie
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
⊢ ∀ (x y z : ↥L'), ⁅x, y + z⁆ = ⁅x, y⁆ + ⁅x, z⁆

Next tactic:
intros
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    intros
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
x✝ y✝ z✝ : ↥L'
⊢ ⁅x✝, y✝ + z✝⁆ = ⁅x✝, y✝⁆ + ⁅x✝, z✝⁆

Next tactic:
apply SetCoe.ext
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    intros
    apply SetCoe.ext
    

Proof state:
case a
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
x✝ y✝ z✝ : ↥L'
⊢ ↑⁅x✝, y✝ + z✝⁆ = ↑(⁅x✝, y✝⁆ + ⁅x✝, z✝⁆)

Next tactic:
apply lie_add
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    intros
    apply SetCoe.ext
    apply lie_add
  add_lie := by
    intros
    apply SetCoe.ext
    apply add_lie
  lie_self := by
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
⊢ ∀ (x : ↥L'), ⁅x, x⁆ = 0

Next tactic:
intros
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    intros
    apply SetCoe.ext
    apply lie_add
  add_lie := by
    intros
    apply SetCoe.ext
    apply add_lie
  lie_self := by
    intros
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
x✝ : ↥L'
⊢ ⁅x✝, x✝⁆ = 0

Next tactic:
apply SetCoe.ext
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    intros
    apply SetCoe.ext
    apply lie_add
  add_lie := by
    intros
    apply SetCoe.ext
    apply add_lie
  lie_self := by
    intros
    apply SetCoe.ext
    

Proof state:
case a
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
x✝ : ↥L'
⊢ ↑⁅x✝, x✝⁆ = ↑0

Next tactic:
apply lie_self
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    intros
    apply SetCoe.ext
    apply lie_add
  add_lie := by
    intros
    apply SetCoe.ext
    apply add_lie
  lie_self := by
    intros
    apply SetCoe.ext
    apply lie_self
  leibniz_lie := by
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
⊢ ∀ (x y z : ↥L'), ⁅x, ⁅y, z⁆⁆ = ⁅⁅x, y⁆, z⁆ + ⁅y, ⁅x, z⁆⁆

Next tactic:
intros
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    intros
    apply SetCoe.ext
    apply lie_add
  add_lie := by
    intros
    apply SetCoe.ext
    apply add_lie
  lie_self := by
    intros
    apply SetCoe.ext
    apply lie_self
  leibniz_lie := by
    intros
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
x✝ y✝ z✝ : ↥L'
⊢ ⁅x✝, ⁅y✝, z✝⁆⁆ = ⁅⁅x✝, y✝⁆, z✝⁆ + ⁅y✝, ⁅x✝, z✝⁆⁆

Next tactic:
apply SetCoe.ext
/-- A Lie subalgebra forms a new Lie ring. -/
instance lieRing (L' : LieSubalgebra R L) : LieRing L'
    where
  bracket x y := ⟨⁅x.val, y.val⁆, L'.lie_mem' x.property y.property⟩
  lie_add := by
    intros
    apply SetCoe.ext
    apply lie_add
  add_lie := by
    intros
    apply SetCoe.ext
    apply add_lie
  lie_self := by
    intros
    apply SetCoe.ext
    apply lie_self
  leibniz_lie := by
    intros
    apply SetCoe.ext
    

Proof state:
case a
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
x✝ y✝ z✝ : ↥L'
⊢ ↑⁅x✝, ⁅y✝, z✝⁆⁆ = ↑(⁅⁅x✝, y✝⁆, z✝⁆ + ⁅y✝, ⁅x✝, z✝⁆⁆)

Next tactic:
apply leibniz_lie
/-- A Lie subalgebra forms a new Lie algebra. -/
instance lieAlgebra (L' : LieSubalgebra R L) : LieAlgebra R L' where
  lie_smul := by
    

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
⊢ ∀ (t : R) (x y : ↥L'), ⁅x, t • y⁆ = t • ⁅x, y⁆

Next tactic:
{ intros
      apply SetCoe.ext
      apply lie_smul }
/-- A Lie subalgebra forms a new Lie algebra. -/
instance lieAlgebra (L' : LieSubalgebra R L) : LieAlgebra R L' where
  lie_smul := by
    { 

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
⊢ ∀ (t : R) (x y : ↥L'), ⁅x, t • y⁆ = t • ⁅x, y⁆

Next tactic:
intros
/-- A Lie subalgebra forms a new Lie algebra. -/
instance lieAlgebra (L' : LieSubalgebra R L) : LieAlgebra R L' where
  lie_smul := by
    { intros
      

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
t✝ : R
x✝ y✝ : ↥L'
⊢ ⁅x✝, t✝ • y✝⁆ = t✝ • ⁅x✝, y✝⁆

Next tactic:
apply SetCoe.ext
/-- A Lie subalgebra forms a new Lie algebra. -/
instance lieAlgebra (L' : LieSubalgebra R L) : LieAlgebra R L' where
  lie_smul := by
    { intros
      apply SetCoe.ext
      

Proof state:
case a
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
t✝ : R
x✝ y✝ : ↥L'
⊢ ↑⁅x✝, t✝ • y✝⁆ = ↑(t✝ • ⁅x✝, y✝⁆)

Next tactic:
apply lie_smul
@[simp]
theorem coe_to_submodule_mk (p : Submodule R L) (h) :
    (({ p with lie_mem' := h } : LieSubalgebra R L) : Submodule R L) = p := by
  

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' : LieSubalgebra R L
p : Submodule R L
h :
  ∀ {x y : L},
    x ∈
        { toAddSubmonoid := p.toAddSubmonoid,
                smul_mem' :=
                  (_ :
                    ∀ (c : R) {x : L}, x ∈ p.carrier → c • x ∈ p.carrier) }.toAddSubmonoid.toAddSubsemigroup.carrier →
      y ∈
          { toAddSubmonoid := p.toAddSubmonoid,
                  smul_mem' :=
                    (_ :
                      ∀ (c : R) {x : L}, x ∈ p.carrier → c • x ∈ p.carrier) }.toAddSubmonoid.toAddSubsemigroup.carrier →
        ⁅x, y⁆ ∈
          { toAddSubmonoid := p.toAddSubmonoid,
                  smul_mem' :=
                    (_ :
                      ∀ (c : R) {x : L}, x ∈ p.carrier → c • x ∈ p.carrier) }.toAddSubmonoid.toAddSubsemigroup.carrier
⊢ {
        toSubmodule :=
          { toAddSubmonoid := p.toAddSubmonoid,
            smul_mem' := (_ : ∀ (c : R) {x : L}, x ∈ p.carrier → c • x ∈ p.carrier) },
        lie_mem' := h }.toSubmodule =
    p

Next tactic:
cases p
theorem to_submodule_injective : Function.Injective ((↑) : LieSubalgebra R L → Submodule R L) :=
  fun L₁' L₂' h ↦ by
  

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' L₁' L₂' : LieSubalgebra R L
h : L₁'.toSubmodule = L₂'.toSubmodule
⊢ L₁' = L₂'

Next tactic:
rw [SetLike.ext'_iff] at h
theorem to_submodule_injective : Function.Injective ((↑) : LieSubalgebra R L → Submodule R L) :=
  fun L₁' L₂' h ↦ by
  rw [SetLike.ext'_iff] at h
  

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' L₁' L₂' : LieSubalgebra R L
h : ↑L₁'.toSubmodule = ↑L₂'.toSubmodule
⊢ L₁' = L₂'

Next tactic:
rw [← coe_set_eq]
theorem to_submodule_injective : Function.Injective ((↑) : LieSubalgebra R L → Submodule R L) :=
  fun L₁' L₂' h ↦ by
  rw [SetLike.ext'_iff] at h
  rw [← coe_set_eq]
  

Proof state:
R : Type u
L : Type v
inst✝² : CommRing R
inst✝¹ : LieRing L
inst✝ : LieAlgebra R L
L' L₁' L₂' : LieSubalgebra R L
h : ↑L₁'.toSubmodule = ↑L₂'.toSubmodule
⊢ ↑L₁' = ↑L₂'

Next tactic:
exact h
/-- Given a Lie algebra `L` containing a Lie subalgebra `L' ⊆ L`, together with a Lie module `M` of
`L`, we may regard `M` as a Lie module of `L'` by restriction. -/
instance lieModule : LieModule R L' M
    where
  smul_lie t x m := by 

Proof state:
R : Type u
L : Type v
inst✝¹⁰ : CommRing R
inst✝⁹ : LieRing L
inst✝⁸ : LieAlgebra R L
L' : LieSubalgebra R L
M : Type w
inst✝⁷ : AddCommGroup M
inst✝⁶ : LieRingModule L M
N : Type w₁
inst✝⁵ : AddCommGroup N
inst✝⁴ : LieRingModule L N
inst✝³ : Module R N
inst✝² : LieModule R L N
inst✝¹ : Module R M
inst✝ : LieModule R L M
t : R
x : ↥L'
m : M
⊢ ⁅t • x, m⁆ = t • ⁅x, m⁆

Next tactic:
simp only [coe_bracket_of_module, smul_lie, Submodule.coe_smul_of_tower]
/-- Given a Lie algebra `L` containing a Lie subalgebra `L' ⊆ L`, together with a Lie module `M` of
`L`, we may regard `M` as a Lie module of `L'` by restriction. -/
instance lieModule : LieModule R L' M
    where
  smul_lie t x m := by simp only [coe_bracket_of_module, smul_lie, Submodule.coe_smul_of_tower]
  lie_smul t x m := by 

Proof state:
R : Type u
L : Type v
inst✝¹⁰ : CommRing R
inst✝⁹ : LieRing L
inst✝⁸ : LieAlgebra R L
L' : LieSubalgebra R L
M : Type w
inst✝⁷ : AddCommGroup M
inst✝⁶ : LieRingModule L M
N : Type w₁
inst✝⁵ : AddCommGroup N
inst✝⁴ : LieRingModule L N
inst✝³ : Module R N
inst✝² : LieModule R L N
inst✝¹ : Module R M
inst✝ : LieModule R L M
t : R
x : ↥L'
m : M
⊢ ⁅x, t • m⁆ = t • ⁅x, m⁆

Next tactic:
simp only [coe_bracket_of_module, lie_smul]