l3lab/ntp-mathlib huggingface dataset:
/-- For an Abelian Lie algebra, the weights of any Lie module are linear. -/
instance instLinearWeightsOfIsLieAbelian [IsLieAbelian L] [NoZeroSMulDivisors R M] :
    LinearWeights R L M :=
  have aux : ∀ (χ : L → R), weightSpace M χ ≠ ⊥ → ∀ (x y : L), χ (x + y) = χ x + χ y := by
    have h : ∀ x y, Commute (toEndomorphism R L M x) (toEndomorphism R L M y) := fun x y ↦ by
      rw [commute_iff_lie_eq, ← LieHom.map_lie, trivial_lie_zero, LieHom.map_zero]
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : IsLieAbelian L
inst✝ : NoZeroSMulDivisors R M
h : ∀ (x y : L), Commute ((toEndomorphism R L M) x) ((toEndomorphism R L M) y)
⊢ ∀ (χ : L → R), weightSpace M χ ≠ ⊥ → ∀ (x y : L), χ (x + y) = χ x + χ y

Next tactic:
intro χ hχ x y
/-- For an Abelian Lie algebra, the weights of any Lie module are linear. -/
instance instLinearWeightsOfIsLieAbelian [IsLieAbelian L] [NoZeroSMulDivisors R M] :
    LinearWeights R L M :=
  have aux : ∀ (χ : L → R), weightSpace M χ ≠ ⊥ → ∀ (x y : L), χ (x + y) = χ x + χ y := by
    have h : ∀ x y, Commute (toEndomorphism R L M x) (toEndomorphism R L M y) := fun x y ↦ by
      rw [commute_iff_lie_eq, ← LieHom.map_lie, trivial_lie_zero, LieHom.map_zero]
    intro χ hχ x y
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : IsLieAbelian L
inst✝ : NoZeroSMulDivisors R M
h : ∀ (x y : L), Commute ((toEndomorphism R L M) x) ((toEndomorphism R L M) y)
χ : L → R
hχ : weightSpace M χ ≠ ⊥
x y : L
⊢ χ (x + y) = χ x + χ y

Next tactic:
simp_rw [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, weightSpace, weightSpaceOf,
      LieSubmodule.iInf_coe_toSubmodule, LieSubmodule.bot_coeSubmodule, Submodule.eta] at hχ
/-- For an Abelian Lie algebra, the weights of any Lie module are linear. -/
instance instLinearWeightsOfIsLieAbelian [IsLieAbelian L] [NoZeroSMulDivisors R M] :
    LinearWeights R L M :=
  have aux : ∀ (χ : L → R), weightSpace M χ ≠ ⊥ → ∀ (x y : L), χ (x + y) = χ x + χ y := by
    have h : ∀ x y, Commute (toEndomorphism R L M x) (toEndomorphism R L M y) := fun x y ↦ by
      rw [commute_iff_lie_eq, ← LieHom.map_lie, trivial_lie_zero, LieHom.map_zero]
    intro χ hχ x y
    simp_rw [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, weightSpace, weightSpaceOf,
      LieSubmodule.iInf_coe_toSubmodule, LieSubmodule.bot_coeSubmodule, Submodule.eta] at hχ
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : IsLieAbelian L
inst✝ : NoZeroSMulDivisors R M
h : ∀ (x y : L), Commute ((toEndomorphism R L M) x) ((toEndomorphism R L M) y)
χ : L → R
x y : L
hχ : ¬⨅ i, Module.End.maximalGeneralizedEigenspace ((toEndomorphism R L M) i) (χ i) = ⊥
⊢ χ (x + y) = χ x + χ y

Next tactic:
exact Module.End.map_add_of_iInf_generalizedEigenspace_ne_bot_of_commute
      (toEndomorphism R L M).toLinearMap χ hχ h x y
/-- For an Abelian Lie algebra, the weights of any Lie module are linear. -/
instance instLinearWeightsOfIsLieAbelian [IsLieAbelian L] [NoZeroSMulDivisors R M] :
    LinearWeights R L M :=
  have aux : ∀ (χ : L → R), weightSpace M χ ≠ ⊥ → ∀ (x y : L), χ (x + y) = χ x + χ y := by
    have h : ∀ x y, Commute (toEndomorphism R L M x) (toEndomorphism R L M y) := fun x y ↦ by
      rw [commute_iff_lie_eq, ← LieHom.map_lie, trivial_lie_zero, LieHom.map_zero]
    intro χ hχ x y
    simp_rw [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, weightSpace, weightSpaceOf,
      LieSubmodule.iInf_coe_toSubmodule, LieSubmodule.bot_coeSubmodule, Submodule.eta] at hχ
    exact Module.End.map_add_of_iInf_generalizedEigenspace_ne_bot_of_commute
      (toEndomorphism R L M).toLinearMap χ hχ h x y
  { map_add := aux
    map_smul := fun χ hχ t x ↦ by
      

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : IsLieAbelian L
inst✝ : NoZeroSMulDivisors R M
aux : ∀ (χ : L → R), weightSpace M χ ≠ ⊥ → ∀ (x y : L), χ (x + y) = χ x + χ y
χ : L → R
hχ : weightSpace M χ ≠ ⊥
t : R
x : L
⊢ χ (t • x) = t • χ x

Next tactic:
simp_rw [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, weightSpace, weightSpaceOf,
        LieSubmodule.iInf_coe_toSubmodule, LieSubmodule.bot_coeSubmodule, Submodule.eta] at hχ
/-- For an Abelian Lie algebra, the weights of any Lie module are linear. -/
instance instLinearWeightsOfIsLieAbelian [IsLieAbelian L] [NoZeroSMulDivisors R M] :
    LinearWeights R L M :=
  have aux : ∀ (χ : L → R), weightSpace M χ ≠ ⊥ → ∀ (x y : L), χ (x + y) = χ x + χ y := by
    have h : ∀ x y, Commute (toEndomorphism R L M x) (toEndomorphism R L M y) := fun x y ↦ by
      rw [commute_iff_lie_eq, ← LieHom.map_lie, trivial_lie_zero, LieHom.map_zero]
    intro χ hχ x y
    simp_rw [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, weightSpace, weightSpaceOf,
      LieSubmodule.iInf_coe_toSubmodule, LieSubmodule.bot_coeSubmodule, Submodule.eta] at hχ
    exact Module.End.map_add_of_iInf_generalizedEigenspace_ne_bot_of_commute
      (toEndomorphism R L M).toLinearMap χ hχ h x y
  { map_add := aux
    map_smul := fun χ hχ t x ↦ by
      simp_rw [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, weightSpace, weightSpaceOf,
        LieSubmodule.iInf_coe_toSubmodule, LieSubmodule.bot_coeSubmodule, Submodule.eta] at hχ
      

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : IsLieAbelian L
inst✝ : NoZeroSMulDivisors R M
aux : ∀ (χ : L → R), weightSpace M χ ≠ ⊥ → ∀ (x y : L), χ (x + y) = χ x + χ y
χ : L → R
t : R
x : L
hχ : ¬⨅ i, Module.End.maximalGeneralizedEigenspace ((toEndomorphism R L M) i) (χ i) = ⊥
⊢ χ (t • x) = t • χ x

Next tactic:
exact Module.End.map_smul_of_iInf_generalizedEigenspace_ne_bot
        (toEndomorphism R L M).toLinearMap χ hχ t x
/-- For an Abelian Lie algebra, the weights of any Lie module are linear. -/
instance instLinearWeightsOfIsLieAbelian [IsLieAbelian L] [NoZeroSMulDivisors R M] :
    LinearWeights R L M :=
  have aux : ∀ (χ : L → R), weightSpace M χ ≠ ⊥ → ∀ (x y : L), χ (x + y) = χ x + χ y := by
    have h : ∀ x y, Commute (toEndomorphism R L M x) (toEndomorphism R L M y) := fun x y ↦ by
      rw [commute_iff_lie_eq, ← LieHom.map_lie, trivial_lie_zero, LieHom.map_zero]
    intro χ hχ x y
    simp_rw [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, weightSpace, weightSpaceOf,
      LieSubmodule.iInf_coe_toSubmodule, LieSubmodule.bot_coeSubmodule, Submodule.eta] at hχ
    exact Module.End.map_add_of_iInf_generalizedEigenspace_ne_bot_of_commute
      (toEndomorphism R L M).toLinearMap χ hχ h x y
  { map_add := aux
    map_smul := fun χ hχ t x ↦ by
      simp_rw [Ne.def, ← LieSubmodule.coe_toSubmodule_eq_iff, weightSpace, weightSpaceOf,
        LieSubmodule.iInf_coe_toSubmodule, LieSubmodule.bot_coeSubmodule, Submodule.eta] at hχ
      exact Module.End.map_smul_of_iInf_generalizedEigenspace_ne_bot
        (toEndomorphism R L M).toLinearMap χ hχ t x
    map_lie := fun χ hχ t x ↦ by
      

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : IsLieAbelian L
inst✝ : NoZeroSMulDivisors R M
aux : ∀ (χ : L → R), weightSpace M χ ≠ ⊥ → ∀ (x y : L), χ (x + y) = χ x + χ y
χ : L → R
hχ : weightSpace M χ ≠ ⊥
t x : L
⊢ χ ⁅t, x⁆ = 0

Next tactic:
rw [trivial_lie_zero, ← add_left_inj (χ 0), ← aux χ hχ, zero_add, zero_add]
lemma trace_comp_toEndomorphism_weight_space_eq (χ : L → R) :
    LinearMap.trace R _ ∘ₗ (toEndomorphism R L (weightSpace M χ)).toLinearMap =
    finrank R (weightSpace M χ) • χ := by
  

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝⁴ : IsDomain R
inst✝³ : IsPrincipalIdealRing R
inst✝² : Module.Free R M
inst✝¹ : Module.Finite R M
inst✝ : LieAlgebra.IsNilpotent R L
χ : L → R
⊢ ⇑(LinearMap.trace R ↥↑(weightSpace M χ) ∘ₗ ↑(toEndomorphism R L ↥↑(weightSpace M χ))) =
    finrank R ↥↑(weightSpace M χ) • χ

Next tactic:
ext x
lemma trace_comp_toEndomorphism_weight_space_eq (χ : L → R) :
    LinearMap.trace R _ ∘ₗ (toEndomorphism R L (weightSpace M χ)).toLinearMap =
    finrank R (weightSpace M χ) • χ := by
  ext x
  

Proof state:
case h
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝⁴ : IsDomain R
inst✝³ : IsPrincipalIdealRing R
inst✝² : Module.Free R M
inst✝¹ : Module.Finite R M
inst✝ : LieAlgebra.IsNilpotent R L
χ : L → R
x : L
⊢ (LinearMap.trace R ↥↑(weightSpace M χ) ∘ₗ ↑(toEndomorphism R L ↥↑(weightSpace M χ))) x =
    (finrank R ↥↑(weightSpace M χ) • χ) x

Next tactic:
let n := toEndomorphism R L (weightSpace M χ) x - χ x • LinearMap.id
lemma trace_comp_toEndomorphism_weight_space_eq (χ : L → R) :
    LinearMap.trace R _ ∘ₗ (toEndomorphism R L (weightSpace M χ)).toLinearMap =
    finrank R (weightSpace M χ) • χ := by
  ext x
  let n := toEndomorphism R L (weightSpace M χ) x - χ x • LinearMap.id
  

Proof state:
case h
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝⁴ : IsDomain R
inst✝³ : IsPrincipalIdealRing R
inst✝² : Module.Free R M
inst✝¹ : Module.Finite R M
inst✝ : LieAlgebra.IsNilpotent R L
χ : L → R
x : L
n : Module.End R ↥↑(weightSpace M χ) := (toEndomorphism R L ↥↑(weightSpace M χ)) x - χ x • LinearMap.id
⊢ (LinearMap.trace R ↥↑(weightSpace M χ) ∘ₗ ↑(toEndomorphism R L ↥↑(weightSpace M χ))) x =
    (finrank R ↥↑(weightSpace M χ) • χ) x

Next tactic:
have h₁ : toEndomorphism R L (weightSpace M χ) x = n + χ x • LinearMap.id := eq_add_of_sub_eq rfl
lemma trace_comp_toEndomorphism_weight_space_eq (χ : L → R) :
    LinearMap.trace R _ ∘ₗ (toEndomorphism R L (weightSpace M χ)).toLinearMap =
    finrank R (weightSpace M χ) • χ := by
  ext x
  let n := toEndomorphism R L (weightSpace M χ) x - χ x • LinearMap.id
  have h₁ : toEndomorphism R L (weightSpace M χ) x = n + χ x • LinearMap.id := eq_add_of_sub_eq rfl
  

Proof state:
case h
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝⁴ : IsDomain R
inst✝³ : IsPrincipalIdealRing R
inst✝² : Module.Free R M
inst✝¹ : Module.Finite R M
inst✝ : LieAlgebra.IsNilpotent R L
χ : L → R
x : L
n : Module.End R ↥↑(weightSpace M χ) := (toEndomorphism R L ↥↑(weightSpace M χ)) x - χ x • LinearMap.id
h₁ : (toEndomorphism R L ↥↑(weightSpace M χ)) x = n + χ x • LinearMap.id
⊢ (LinearMap.trace R ↥↑(weightSpace M χ) ∘ₗ ↑(toEndomorphism R L ↥↑(weightSpace M χ))) x =
    (finrank R ↥↑(weightSpace M χ) • χ) x

Next tactic:
have h₂ : LinearMap.trace R _ n = 0 := IsReduced.eq_zero _ <|
    LinearMap.isNilpotent_trace_of_isNilpotent <| isNilpotent_toEndomorphism_sub_algebraMap M χ x
lemma trace_comp_toEndomorphism_weight_space_eq (χ : L → R) :
    LinearMap.trace R _ ∘ₗ (toEndomorphism R L (weightSpace M χ)).toLinearMap =
    finrank R (weightSpace M χ) • χ := by
  ext x
  let n := toEndomorphism R L (weightSpace M χ) x - χ x • LinearMap.id
  have h₁ : toEndomorphism R L (weightSpace M χ) x = n + χ x • LinearMap.id := eq_add_of_sub_eq rfl
  have h₂ : LinearMap.trace R _ n = 0 := IsReduced.eq_zero _ <|
    LinearMap.isNilpotent_trace_of_isNilpotent <| isNilpotent_toEndomorphism_sub_algebraMap M χ x
  

Proof state:
case h
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝⁴ : IsDomain R
inst✝³ : IsPrincipalIdealRing R
inst✝² : Module.Free R M
inst✝¹ : Module.Finite R M
inst✝ : LieAlgebra.IsNilpotent R L
χ : L → R
x : L
n : Module.End R ↥↑(weightSpace M χ) := (toEndomorphism R L ↥↑(weightSpace M χ)) x - χ x • LinearMap.id
h₁ : (toEndomorphism R L ↥↑(weightSpace M χ)) x = n + χ x • LinearMap.id
h₂ : (LinearMap.trace R ↥↑(weightSpace M χ)) n = 0
⊢ (LinearMap.trace R ↥↑(weightSpace M χ) ∘ₗ ↑(toEndomorphism R L ↥↑(weightSpace M χ))) x =
    (finrank R ↥↑(weightSpace M χ) • χ) x

Next tactic:
rw [LinearMap.comp_apply, LieHom.coe_toLinearMap, h₁, map_add, h₂]
lemma trace_comp_toEndomorphism_weight_space_eq (χ : L → R) :
    LinearMap.trace R _ ∘ₗ (toEndomorphism R L (weightSpace M χ)).toLinearMap =
    finrank R (weightSpace M χ) • χ := by
  ext x
  let n := toEndomorphism R L (weightSpace M χ) x - χ x • LinearMap.id
  have h₁ : toEndomorphism R L (weightSpace M χ) x = n + χ x • LinearMap.id := eq_add_of_sub_eq rfl
  have h₂ : LinearMap.trace R _ n = 0 := IsReduced.eq_zero _ <|
    LinearMap.isNilpotent_trace_of_isNilpotent <| isNilpotent_toEndomorphism_sub_algebraMap M χ x
  rw [LinearMap.comp_apply, LieHom.coe_toLinearMap, h₁, map_add, h₂]
  

Proof state:
case h
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝⁴ : IsDomain R
inst✝³ : IsPrincipalIdealRing R
inst✝² : Module.Free R M
inst✝¹ : Module.Finite R M
inst✝ : LieAlgebra.IsNilpotent R L
χ : L → R
x : L
n : Module.End R ↥↑(weightSpace M χ) := (toEndomorphism R L ↥↑(weightSpace M χ)) x - χ x • LinearMap.id
h₁ : (toEndomorphism R L ↥↑(weightSpace M χ)) x = n + χ x • LinearMap.id
h₂ : (LinearMap.trace R ↥↑(weightSpace M χ)) n = 0
⊢ 0 + (LinearMap.trace R ↥↑(weightSpace M χ)) (χ x • LinearMap.id) = (finrank R ↥↑(weightSpace M χ) • χ) x

Next tactic:
simp [mul_comm (χ x)]
variable {R L M} in
lemma zero_lt_finrank_weightSpace {χ : L → R} (hχ : weightSpace M χ ≠ ⊥) :
    0 < finrank R (weightSpace M χ) := by
  

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝⁴ : IsDomain R
inst✝³ : IsPrincipalIdealRing R
inst✝² : Module.Free R M
inst✝¹ : Module.Finite R M
inst✝ : LieAlgebra.IsNilpotent R L
χ : L → R
hχ : weightSpace M χ ≠ ⊥
⊢ 0 < finrank R ↥↑(weightSpace M χ)

Next tactic:
rwa [← LieSubmodule.nontrivial_iff_ne_bot, ← rank_pos_iff_nontrivial (R := R), ← finrank_eq_rank,
    Nat.cast_pos] at hχ
/-- In characteristic zero, the weights of any finite-dimensional Lie module are linear and vanish
on the derived ideal. -/
instance instLinearWeightsOfCharZero [CharZero R] :
    LinearWeights R L M where
  map_add χ hχ x y := by
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝⁵ : IsDomain R
inst✝⁴ : IsPrincipalIdealRing R
inst✝³ : Module.Free R M
inst✝² : Module.Finite R M
inst✝¹ : LieAlgebra.IsNilpotent R L
inst✝ : CharZero R
χ : L → R
hχ : weightSpace M χ ≠ ⊥
x y : L
⊢ χ (x + y) = χ x + χ y

Next tactic:
rw [← smul_right_inj (zero_lt_finrank_weightSpace hχ).ne', smul_add, ← Pi.smul_apply,
      ← Pi.smul_apply, ← Pi.smul_apply, ← trace_comp_toEndomorphism_weight_space_eq, map_add]
/-- In characteristic zero, the weights of any finite-dimensional Lie module are linear and vanish
on the derived ideal. -/
instance instLinearWeightsOfCharZero [CharZero R] :
    LinearWeights R L M where
  map_add χ hχ x y := by
    rw [← smul_right_inj (zero_lt_finrank_weightSpace hχ).ne', smul_add, ← Pi.smul_apply,
      ← Pi.smul_apply, ← Pi.smul_apply, ← trace_comp_toEndomorphism_weight_space_eq, map_add]
  map_smul χ hχ t x := by
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝⁵ : IsDomain R
inst✝⁴ : IsPrincipalIdealRing R
inst✝³ : Module.Free R M
inst✝² : Module.Finite R M
inst✝¹ : LieAlgebra.IsNilpotent R L
inst✝ : CharZero R
χ : L → R
hχ : weightSpace M χ ≠ ⊥
t : R
x : L
⊢ χ (t • x) = t • χ x

Next tactic:
rw [← smul_right_inj (zero_lt_finrank_weightSpace hχ).ne', smul_comm, ← Pi.smul_apply,
      ← Pi.smul_apply (finrank R _), ← trace_comp_toEndomorphism_weight_space_eq, map_smul]
/-- In characteristic zero, the weights of any finite-dimensional Lie module are linear and vanish
on the derived ideal. -/
instance instLinearWeightsOfCharZero [CharZero R] :
    LinearWeights R L M where
  map_add χ hχ x y := by
    rw [← smul_right_inj (zero_lt_finrank_weightSpace hχ).ne', smul_add, ← Pi.smul_apply,
      ← Pi.smul_apply, ← Pi.smul_apply, ← trace_comp_toEndomorphism_weight_space_eq, map_add]
  map_smul χ hχ t x := by
    rw [← smul_right_inj (zero_lt_finrank_weightSpace hχ).ne', smul_comm, ← Pi.smul_apply,
      ← Pi.smul_apply (finrank R _), ← trace_comp_toEndomorphism_weight_space_eq, map_smul]
  map_lie χ hχ x y := by
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝⁵ : IsDomain R
inst✝⁴ : IsPrincipalIdealRing R
inst✝³ : Module.Free R M
inst✝² : Module.Finite R M
inst✝¹ : LieAlgebra.IsNilpotent R L
inst✝ : CharZero R
χ : L → R
hχ : weightSpace M χ ≠ ⊥
x y : L
⊢ χ ⁅x, y⁆ = 0

Next tactic:
rw [← smul_right_inj (zero_lt_finrank_weightSpace hχ).ne', nsmul_zero, ← Pi.smul_apply,
      ← trace_comp_toEndomorphism_weight_space_eq, LinearMap.comp_apply, LieHom.coe_toLinearMap,
      LieHom.map_lie, Ring.lie_def, map_sub, LinearMap.trace_mul_comm, sub_self]
instance : LieRingModule L (shiftedWeightSpace R L M χ) where
  bracket x m := ⁅x, m⁆ - χ x • m
  add_lie x y m := by
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : LieAlgebra.IsNilpotent R L
inst✝ : LinearWeights R L M
χ : L → R
x y : L
m : ↥↑(shiftedWeightSpace R L M χ)
⊢ ⁅x + y, m⁆ = ⁅x, m⁆ + ⁅y, m⁆

Next tactic:
nontriviality shiftedWeightSpace R L M χ
instance : LieRingModule L (shiftedWeightSpace R L M χ) where
  bracket x m := ⁅x, m⁆ - χ x • m
  add_lie x y m := by
    nontriviality shiftedWeightSpace R L M χ
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : LieAlgebra.IsNilpotent R L
inst✝ : LinearWeights R L M
χ : L → R
x y : L
m : ↥↑(shiftedWeightSpace R L M χ)
✝ : Nontrivial ↥(shiftedWeightSpace R L M χ)
⊢ ⁅x + y, m⁆ = ⁅x, m⁆ + ⁅y, m⁆

Next tactic:
simp only [add_lie, LinearWeights.map_add χ (aux R L M χ), add_smul]
instance : LieRingModule L (shiftedWeightSpace R L M χ) where
  bracket x m := ⁅x, m⁆ - χ x • m
  add_lie x y m := by
    nontriviality shiftedWeightSpace R L M χ
    simp only [add_lie, LinearWeights.map_add χ (aux R L M χ), add_smul]
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : LieAlgebra.IsNilpotent R L
inst✝ : LinearWeights R L M
χ : L → R
x y : L
m : ↥↑(shiftedWeightSpace R L M χ)
✝ : Nontrivial ↥(shiftedWeightSpace R L M χ)
⊢ ⁅x, m⁆ + ⁅y, m⁆ - (χ x • m + χ y • m) = ⁅x, m⁆ - χ x • m + (⁅y, m⁆ - χ y • m)

Next tactic:
abel
instance : LieRingModule L (shiftedWeightSpace R L M χ) where
  bracket x m := ⁅x, m⁆ - χ x • m
  add_lie x y m := by
    nontriviality shiftedWeightSpace R L M χ
    simp only [add_lie, LinearWeights.map_add χ (aux R L M χ), add_smul]
    abel
  lie_add x m n := by
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : LieAlgebra.IsNilpotent R L
inst✝ : LinearWeights R L M
χ : L → R
x : L
m n : ↥↑(shiftedWeightSpace R L M χ)
⊢ ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆

Next tactic:
nontriviality shiftedWeightSpace R L M χ
instance : LieRingModule L (shiftedWeightSpace R L M χ) where
  bracket x m := ⁅x, m⁆ - χ x • m
  add_lie x y m := by
    nontriviality shiftedWeightSpace R L M χ
    simp only [add_lie, LinearWeights.map_add χ (aux R L M χ), add_smul]
    abel
  lie_add x m n := by
    nontriviality shiftedWeightSpace R L M χ
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : LieAlgebra.IsNilpotent R L
inst✝ : LinearWeights R L M
χ : L → R
x : L
m n : ↥↑(shiftedWeightSpace R L M χ)
✝ : Nontrivial ↥(shiftedWeightSpace R L M χ)
⊢ ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆

Next tactic:
simp only [lie_add, LinearWeights.map_add χ (aux R L M χ), smul_add]
instance : LieRingModule L (shiftedWeightSpace R L M χ) where
  bracket x m := ⁅x, m⁆ - χ x • m
  add_lie x y m := by
    nontriviality shiftedWeightSpace R L M χ
    simp only [add_lie, LinearWeights.map_add χ (aux R L M χ), add_smul]
    abel
  lie_add x m n := by
    nontriviality shiftedWeightSpace R L M χ
    simp only [lie_add, LinearWeights.map_add χ (aux R L M χ), smul_add]
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : LieAlgebra.IsNilpotent R L
inst✝ : LinearWeights R L M
χ : L → R
x : L
m n : ↥↑(shiftedWeightSpace R L M χ)
✝ : Nontrivial ↥(shiftedWeightSpace R L M χ)
⊢ ⁅x, m⁆ + ⁅x, n⁆ - (χ x • m + χ x • n) = ⁅x, m⁆ - χ x • m + (⁅x, n⁆ - χ x • n)

Next tactic:
abel
instance : LieRingModule L (shiftedWeightSpace R L M χ) where
  bracket x m := ⁅x, m⁆ - χ x • m
  add_lie x y m := by
    nontriviality shiftedWeightSpace R L M χ
    simp only [add_lie, LinearWeights.map_add χ (aux R L M χ), add_smul]
    abel
  lie_add x m n := by
    nontriviality shiftedWeightSpace R L M χ
    simp only [lie_add, LinearWeights.map_add χ (aux R L M χ), smul_add]
    abel
  leibniz_lie x y m := by
    

Proof state:
R : Type u_1
L : Type u_2
M : Type u_3
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
inst✝¹ : LieAlgebra.IsNilpotent R L
inst✝ : LinearWeights R L M
χ : L → R
x y : L
m : ↥↑(shiftedWeightSpace R L M χ)
⊢ ⁅x, ⁅y, m⁆⁆ = ⁅⁅x, y⁆, m⁆ + ⁅y, ⁅x, m⁆⁆

Next tactic:
nontriviality shiftedWeightSpace R L M χ