algebra.lie.weightsMathlib.Algebra.Lie.Weights.Basic

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -247,22 +247,18 @@ theorem zero_weightSpace_eq_top_of_nilpotent [LieAlgebra.IsNilpotent R L] [IsNil
 #align lie_module.zero_weight_space_eq_top_of_nilpotent LieModule.zero_weightSpace_eq_top_of_nilpotent
 -/
 
-#print LieModule.IsWeight /-
 /-- Given a Lie module `M` of a Lie algebra `L`, a weight of `M` with respect to a nilpotent
 subalgebra `H ⊆ L` is a Lie character whose corresponding weight space is non-empty. -/
 def IsWeight (χ : LieCharacter R H) : Prop :=
   weightSpace M χ ≠ ⊥
 #align lie_module.is_weight LieModule.IsWeight
--/
 
-#print LieModule.isWeight_zero_of_nilpotent /-
 /-- For a non-trivial nilpotent Lie module over a nilpotent Lie algebra, the zero character is a
 weight with respect to the `⊤` Lie subalgebra. -/
-theorem isWeight_zero_of_nilpotent [Nontrivial M] [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
+theorem isWeightZeroOfNilpotent [Nontrivial M] [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
     IsWeight (⊤ : LieSubalgebra R L) M 0 := by
   rw [is_weight, LieHom.coe_zero, zero_weight_space_eq_top_of_nilpotent]; exact top_ne_bot
-#align lie_module.is_weight_zero_of_nilpotent LieModule.isWeight_zero_of_nilpotent
--/
+#align lie_module.is_weight_zero_of_nilpotent LieModule.isWeightZeroOfNilpotent
 
 #print LieModule.isNilpotent_toEndomorphism_weightSpace_zero /-
 /-- A (nilpotent) Lie algebra acts nilpotently on the zero weight space of a Noetherian Lie
@@ -312,13 +308,11 @@ theorem zero_rootSpace_eq_top_of_nilpotent [h : IsNilpotent R L] :
 #align lie_algebra.zero_root_space_eq_top_of_nilpotent LieAlgebra.zero_rootSpace_eq_top_of_nilpotent
 -/
 
-#print LieAlgebra.IsRoot /-
 /-- A root of a Lie algebra `L` with respect to a nilpotent subalgebra `H ⊆ L` is a weight of `L`,
 regarded as a module of `H` via the adjoint action. -/
 abbrev IsRoot :=
   IsWeight H L
 #align lie_algebra.is_root LieAlgebra.IsRoot
--/
 
 #print LieAlgebra.rootSpace_comap_eq_weightSpace /-
 @[simp]
Diff
@@ -9,7 +9,7 @@ import Algebra.Lie.Character
 import Algebra.Lie.Engel
 import Algebra.Lie.CartanSubalgebra
 import LinearAlgebra.Eigenspace.Basic
-import RingTheory.TensorProduct
+import LinearAlgebra.TensorProduct.Tower
 
 #align_import algebra.lie.weights from "leanprover-community/mathlib"@"8af7091a43227e179939ba132e54e54e9f3b089a"
 
Diff
@@ -144,7 +144,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
     rw [← LinearMap.comp_apply, LinearMap.commute_pow_left_of_commute h_comm_square,
       LinearMap.comp_apply, hk, LinearMap.map_zero]
   -- Unpack the information we have about `m₁`, `m₂`.
-  simp only [mem_pre_weight_space] at hm₁ hm₂ 
+  simp only [mem_pre_weight_space] at hm₁ hm₂
   obtain ⟨k₁, hk₁⟩ := hm₁ x
   obtain ⟨k₂, hk₂⟩ := hm₂ x
   have hf₁ : (f₁ ^ k₁) (m₁ ⊗ₜ m₂) = 0 := by
@@ -333,7 +333,7 @@ theorem rootSpace_comap_eq_weightSpace (χ : H → R) :
       ∀ y : H, ∃ k : ℕ, (H.incl : H →ₗ[R] L).comp (g y ^ k) x = 0
     by
     simp only [LieHom.coe_toLinearMap, LieSubalgebra.coe_incl, Function.comp_apply,
-      LinearMap.coe_comp, Submodule.coe_eq_zero] at this 
+      LinearMap.coe_comp, Submodule.coe_eq_zero] at this
     simp only [mem_weight_space, mem_pre_weight_space, LieSubalgebra.coe_incl',
       LieSubmodule.mem_comap, this]
   have hfg : ∀ y : H, (f y).comp (H.incl : H →ₗ[R] L) = (H.incl : H →ₗ[R] L).comp (g y) :=
@@ -452,7 +452,7 @@ def zeroRootSubalgebra : LieSubalgebra R L :=
       by
       let xy : root_space H 0 ⊗[R] root_space H 0 := ⟨x, hx⟩ ⊗ₜ ⟨y, hy⟩
       suffices (root_space_product R L H 0 0 0 (add_zero 0) xy : L) ∈ root_space H 0 by
-        rwa [root_space_product_tmul, Subtype.coe_mk, Subtype.coe_mk] at this 
+        rwa [root_space_product_tmul, Subtype.coe_mk, Subtype.coe_mk] at this
       exact (root_space_product R L H 0 0 0 (add_zero 0) xy).property }
 #align lie_algebra.zero_root_subalgebra LieAlgebra.zeroRootSubalgebra
 -/
@@ -477,7 +477,7 @@ theorem mem_zeroRootSubalgebra (x : L) :
 theorem toLieSubmodule_le_rootSpace_zero : H.toLieSubmodule ≤ rootSpace H 0 :=
   by
   intro x hx
-  simp only [LieSubalgebra.mem_toLieSubmodule] at hx 
+  simp only [LieSubalgebra.mem_toLieSubmodule] at hx
   simp only [mem_weight_space, mem_pre_weight_space, Pi.zero_apply, sub_zero, zero_smul]
   intro y
   obtain ⟨k, hk⟩ := (inferInstance : IsNilpotent R H)
@@ -491,7 +491,7 @@ theorem toLieSubmodule_le_rootSpace_zero : H.toLieSubmodule ≤ rootSpace H 0 :=
   change (g ^ k).comp (H : Submodule R L).Subtype ⟨x, hx⟩ = 0
   rw [LinearMap.commute_pow_left_of_commute hfg k]
   have h := iterate_to_endomorphism_mem_lower_central_series R H H y ⟨x, hx⟩ k
-  rw [hk, LieSubmodule.mem_bot] at h 
+  rw [hk, LieSubmodule.mem_bot] at h
   simp only [Submodule.subtype_apply, Function.comp_apply, LinearMap.pow_apply, LinearMap.coe_comp,
     Submodule.coe_eq_zero]
   exact h
@@ -514,13 +514,13 @@ theorem zeroRootSubalgebra_normalizer_eq_self :
   by
   refine' le_antisymm _ (LieSubalgebra.le_normalizer _)
   intro x hx
-  rw [LieSubalgebra.mem_normalizer_iff] at hx 
+  rw [LieSubalgebra.mem_normalizer_iff] at hx
   rw [mem_zero_root_subalgebra]
   rintro ⟨y, hy⟩
   specialize hx y (le_zero_root_subalgebra R L H hy)
-  rw [mem_zero_root_subalgebra] at hx 
+  rw [mem_zero_root_subalgebra] at hx
   obtain ⟨k, hk⟩ := hx ⟨y, hy⟩
-  rw [← lie_skew, LinearMap.map_neg, neg_eq_zero] at hk 
+  rw [← lie_skew, LinearMap.map_neg, neg_eq_zero] at hk
   use k + 1
   rw [LinearMap.iterate_succ, LinearMap.coe_comp, Function.comp_apply, to_endomorphism_apply_apply,
     LieSubalgebra.coe_bracket_of_module, Submodule.coe_mk, hk]
Diff
@@ -3,13 +3,13 @@ Copyright (c) 2021 Oliver Nash. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
 -/
-import Mathbin.Algebra.Lie.Nilpotent
-import Mathbin.Algebra.Lie.TensorProduct
-import Mathbin.Algebra.Lie.Character
-import Mathbin.Algebra.Lie.Engel
-import Mathbin.Algebra.Lie.CartanSubalgebra
-import Mathbin.LinearAlgebra.Eigenspace.Basic
-import Mathbin.RingTheory.TensorProduct
+import Algebra.Lie.Nilpotent
+import Algebra.Lie.TensorProduct
+import Algebra.Lie.Character
+import Algebra.Lie.Engel
+import Algebra.Lie.CartanSubalgebra
+import LinearAlgebra.Eigenspace.Basic
+import RingTheory.TensorProduct
 
 #align_import algebra.lie.weights from "leanprover-community/mathlib"@"8af7091a43227e179939ba132e54e54e9f3b089a"
 
Diff
@@ -72,7 +72,6 @@ open scoped BigOperators
 
 open scoped TensorProduct
 
-#print LieModule.preWeightSpace /-
 /-- Given a Lie module `M` over a Lie algebra `L`, the pre-weight space of `M` with respect to a
 map `χ : L → R` is the simultaneous generalized eigenspace of the action of all `x : L` on `M`,
 with eigenvalues `χ x`.
@@ -81,18 +80,14 @@ See also `lie_module.weight_space`. -/
 def preWeightSpace (χ : L → R) : Submodule R M :=
   ⨅ x : L, (toEndomorphism R L M x).maximalGeneralizedEigenspace (χ x)
 #align lie_module.pre_weight_space LieModule.preWeightSpace
--/
 
-#print LieModule.mem_preWeightSpace /-
 theorem mem_preWeightSpace (χ : L → R) (m : M) :
     m ∈ preWeightSpace M χ ↔ ∀ x, ∃ k : ℕ, ((toEndomorphism R L M x - χ x • 1) ^ k) m = 0 := by
   simp [pre_weight_space, -LinearMap.pow_apply]
 #align lie_module.mem_pre_weight_space LieModule.mem_preWeightSpace
--/
 
 variable (R)
 
-#print LieModule.exists_preWeightSpace_zero_le_ker_of_isNoetherian /-
 theorem exists_preWeightSpace_zero_le_ker_of_isNoetherian [IsNoetherian R M] (x : L) :
     ∃ k : ℕ, preWeightSpace M (0 : L → R) ≤ (toEndomorphism R L M x ^ k).ker :=
   by
@@ -100,7 +95,6 @@ theorem exists_preWeightSpace_zero_le_ker_of_isNoetherian [IsNoetherian R M] (x
   simp only [← Module.End.generalizedEigenspace_zero, pre_weight_space, Pi.zero_apply, iInf_le, ←
     (to_endomorphism R L M x).maximalGeneralizedEigenspace_eq]
 #align lie_module.exists_pre_weight_space_zero_le_ker_of_is_noetherian LieModule.exists_preWeightSpace_zero_le_ker_of_isNoetherian
--/
 
 variable {R} (L)
 
@@ -182,7 +176,6 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
 
 variable {L M}
 
-#print LieModule.lie_mem_preWeightSpace_of_mem_preWeightSpace /-
 theorem lie_mem_preWeightSpace_of_mem_preWeightSpace {χ₁ χ₂ : L → R} {x : L} {m : M}
     (hx : x ∈ preWeightSpace L χ₁) (hm : m ∈ preWeightSpace M χ₂) :
     ⁅x, m⁆ ∈ preWeightSpace M (χ₁ + χ₂) :=
@@ -194,7 +187,6 @@ theorem lie_mem_preWeightSpace_of_mem_preWeightSpace {χ₁ χ₂ : L → R} {x
   simp only [Submodule.subtype_apply, to_module_hom_apply, TensorProduct.map_tmul]
   rfl
 #align lie_module.lie_mem_pre_weight_space_of_mem_pre_weight_space LieModule.lie_mem_preWeightSpace_of_mem_preWeightSpace
--/
 
 variable (M)
 
@@ -575,7 +567,6 @@ open LieAlgebra
 
 variable {R L H}
 
-#print LieModule.weightSpace' /-
 /-- A priori, weight spaces are Lie submodules over the Lie subalgebra `H` used to define them.
 However they are naturally Lie submodules over the (in general larger) Lie subalgebra
 `zero_root_subalgebra R L H`. Even though it is often the case that
@@ -590,14 +581,11 @@ def weightSpace' (χ : H → R) : LieSubmodule R (zeroRootSubalgebra R L H) M :=
       rw [← zero_add χ]
       exact lie_mem_weight_space_of_mem_weight_space hx hm }
 #align lie_module.weight_space' LieModule.weightSpace'
--/
 
-#print LieModule.coe_weightSpace' /-
 @[simp]
 theorem coe_weightSpace' (χ : H → R) : (weightSpace' M χ : Submodule R M) = weightSpace M χ :=
   rfl
 #align lie_module.coe_weight_space' LieModule.coe_weightSpace'
--/
 
 end LieModule
 
Diff
@@ -96,7 +96,7 @@ variable (R)
 theorem exists_preWeightSpace_zero_le_ker_of_isNoetherian [IsNoetherian R M] (x : L) :
     ∃ k : ℕ, preWeightSpace M (0 : L → R) ≤ (toEndomorphism R L M x ^ k).ker :=
   by
-  use (to_endomorphism R L M x).maximalGeneralizedEigenspaceIndex 0
+  use(to_endomorphism R L M x).maximalGeneralizedEigenspaceIndex 0
   simp only [← Module.End.generalizedEigenspace_zero, pre_weight_space, Pi.zero_apply, iInf_le, ←
     (to_endomorphism R L M x).maximalGeneralizedEigenspace_eq]
 #align lie_module.exists_pre_weight_space_zero_le_ker_of_is_noetherian LieModule.exists_preWeightSpace_zero_le_ker_of_isNoetherian
@@ -190,7 +190,7 @@ theorem lie_mem_preWeightSpace_of_mem_preWeightSpace {χ₁ χ₂ : L → R} {x
   apply LieModule.weight_vector_multiplication L L M M (to_module_hom R L M) χ₁ χ₂
   simp only [LieModuleHom.coe_toLinearMap, Function.comp_apply, LinearMap.coe_comp,
     TensorProduct.mapIncl, LinearMap.mem_range]
-  use ⟨x, hx⟩ ⊗ₜ ⟨m, hm⟩
+  use⟨x, hx⟩ ⊗ₜ ⟨m, hm⟩
   simp only [Submodule.subtype_apply, to_module_hom_apply, TensorProduct.map_tmul]
   rfl
 #align lie_module.lie_mem_pre_weight_space_of_mem_pre_weight_space LieModule.lie_mem_preWeightSpace_of_mem_preWeightSpace
@@ -364,7 +364,7 @@ theorem lie_mem_weightSpace_of_mem_weightSpace {χ₁ χ₂ : H → R} {x : L} {
   apply LieModule.weight_vector_multiplication H L M M ((to_module_hom R L M).restrictLie H) χ₁ χ₂
   simp only [LieModuleHom.coe_toLinearMap, Function.comp_apply, LinearMap.coe_comp,
     TensorProduct.mapIncl, LinearMap.mem_range]
-  use ⟨x, hx⟩ ⊗ₜ ⟨m, hm⟩
+  use⟨x, hx⟩ ⊗ₜ ⟨m, hm⟩
   simp only [Submodule.subtype_apply, to_module_hom_apply, Submodule.coe_mk,
     LieModuleHom.coe_restrictLie, TensorProduct.map_tmul]
 #align lie_algebra.lie_mem_weight_space_of_mem_weight_space LieAlgebra.lie_mem_weightSpace_of_mem_weightSpace
Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Oliver Nash. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
-
-! This file was ported from Lean 3 source module algebra.lie.weights
-! leanprover-community/mathlib commit 8af7091a43227e179939ba132e54e54e9f3b089a
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Algebra.Lie.Nilpotent
 import Mathbin.Algebra.Lie.TensorProduct
@@ -16,6 +11,8 @@ import Mathbin.Algebra.Lie.CartanSubalgebra
 import Mathbin.LinearAlgebra.Eigenspace.Basic
 import Mathbin.RingTheory.TensorProduct
 
+#align_import algebra.lie.weights from "leanprover-community/mathlib"@"8af7091a43227e179939ba132e54e54e9f3b089a"
+
 /-!
 # Weights and roots of Lie modules and Lie algebras
 
Diff
@@ -140,7 +140,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
   let f₂ : Module.End R (M₁ ⊗[R] M₂) := (to_endomorphism R L M₂ x - χ₂ x • 1).lTensor M₁
   have h_comm_square : F ∘ₗ ↑g = (g : M₁ ⊗[R] M₂ →ₗ[R] M₃).comp (f₁ + f₂) :=
     by
-    ext (m₁ m₂);
+    ext m₁ m₂;
     simp only [← g.map_lie x (m₁ ⊗ₜ m₂), add_smul, sub_tmul, tmul_sub, smul_tmul, lie_tmul_right,
       tmul_smul, to_endomorphism_apply_apply, LieModuleHom.map_smul, LinearMap.one_apply,
       LieModuleHom.coe_toLinearMap, LinearMap.smul_apply, Function.comp_apply, LinearMap.coe_comp,
@@ -162,7 +162,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
     simp only [hk₂, tmul_zero, LinearMap.lTensor_tmul, LinearMap.lTensor_pow]
   -- It's now just an application of the binomial theorem.
   use k₁ + k₂ - 1
-  have hf_comm : Commute f₁ f₂ := by ext (m₁ m₂);
+  have hf_comm : Commute f₁ f₂ := by ext m₁ m₂;
     simp only [LinearMap.mul_apply, LinearMap.rTensor_tmul, LinearMap.lTensor_tmul,
       algebra_tensor_module.curry_apply, LinearMap.toFun_eq_coe, LinearMap.lTensor_tmul,
       curry_apply, LinearMap.coe_restrictScalars]
Diff
@@ -75,6 +75,7 @@ open scoped BigOperators
 
 open scoped TensorProduct
 
+#print LieModule.preWeightSpace /-
 /-- Given a Lie module `M` over a Lie algebra `L`, the pre-weight space of `M` with respect to a
 map `χ : L → R` is the simultaneous generalized eigenspace of the action of all `x : L` on `M`,
 with eigenvalues `χ x`.
@@ -83,14 +84,18 @@ See also `lie_module.weight_space`. -/
 def preWeightSpace (χ : L → R) : Submodule R M :=
   ⨅ x : L, (toEndomorphism R L M x).maximalGeneralizedEigenspace (χ x)
 #align lie_module.pre_weight_space LieModule.preWeightSpace
+-/
 
+#print LieModule.mem_preWeightSpace /-
 theorem mem_preWeightSpace (χ : L → R) (m : M) :
     m ∈ preWeightSpace M χ ↔ ∀ x, ∃ k : ℕ, ((toEndomorphism R L M x - χ x • 1) ^ k) m = 0 := by
   simp [pre_weight_space, -LinearMap.pow_apply]
 #align lie_module.mem_pre_weight_space LieModule.mem_preWeightSpace
+-/
 
 variable (R)
 
+#print LieModule.exists_preWeightSpace_zero_le_ker_of_isNoetherian /-
 theorem exists_preWeightSpace_zero_le_ker_of_isNoetherian [IsNoetherian R M] (x : L) :
     ∃ k : ℕ, preWeightSpace M (0 : L → R) ≤ (toEndomorphism R L M x ^ k).ker :=
   by
@@ -98,9 +103,11 @@ theorem exists_preWeightSpace_zero_le_ker_of_isNoetherian [IsNoetherian R M] (x
   simp only [← Module.End.generalizedEigenspace_zero, pre_weight_space, Pi.zero_apply, iInf_le, ←
     (to_endomorphism R L M x).maximalGeneralizedEigenspace_eq]
 #align lie_module.exists_pre_weight_space_zero_le_ker_of_is_noetherian LieModule.exists_preWeightSpace_zero_le_ker_of_isNoetherian
+-/
 
 variable {R} (L)
 
+#print LieModule.weight_vector_multiplication /-
 /-- See also `bourbaki1975b` Chapter VII §1.1, Proposition 2 (ii). -/
 protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w₂) (M₃ : Type w₃)
     [AddCommGroup M₁] [Module R M₁] [LieRingModule L M₁] [LieModule R L M₁] [AddCommGroup M₂]
@@ -174,9 +181,11 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
       LinearMap.map_zero]
   · rw [LinearMap.mul_apply, LinearMap.pow_map_zero_of_le hj hf₂, LinearMap.map_zero]
 #align lie_module.weight_vector_multiplication LieModule.weight_vector_multiplication
+-/
 
 variable {L M}
 
+#print LieModule.lie_mem_preWeightSpace_of_mem_preWeightSpace /-
 theorem lie_mem_preWeightSpace_of_mem_preWeightSpace {χ₁ χ₂ : L → R} {x : L} {m : M}
     (hx : x ∈ preWeightSpace L χ₁) (hm : m ∈ preWeightSpace M χ₂) :
     ⁅x, m⁆ ∈ preWeightSpace M (χ₁ + χ₂) :=
@@ -188,9 +197,11 @@ theorem lie_mem_preWeightSpace_of_mem_preWeightSpace {χ₁ χ₂ : L → R} {x
   simp only [Submodule.subtype_apply, to_module_hom_apply, TensorProduct.map_tmul]
   rfl
 #align lie_module.lie_mem_pre_weight_space_of_mem_pre_weight_space LieModule.lie_mem_preWeightSpace_of_mem_preWeightSpace
+-/
 
 variable (M)
 
+#print LieModule.weightSpace /-
 /-- If a Lie algebra is nilpotent, then pre-weight spaces are Lie submodules. -/
 def weightSpace [LieAlgebra.IsNilpotent R L] (χ : L → R) : LieSubmodule R L M :=
   { preWeightSpace M χ with
@@ -200,12 +211,16 @@ def weightSpace [LieAlgebra.IsNilpotent R L] (χ : L → R) : LieSubmodule R L M
       suffices pre_weight_space L (0 : L → R) = ⊤ by simp only [this, Submodule.mem_top]
       exact LieAlgebra.iInf_max_gen_zero_eigenspace_eq_top_of_nilpotent R L }
 #align lie_module.weight_space LieModule.weightSpace
+-/
 
+#print LieModule.mem_weightSpace /-
 theorem mem_weightSpace [LieAlgebra.IsNilpotent R L] (χ : L → R) (m : M) :
     m ∈ weightSpace M χ ↔ m ∈ preWeightSpace M χ :=
   Iff.rfl
 #align lie_module.mem_weight_space LieModule.mem_weightSpace
+-/
 
+#print LieModule.zero_weightSpace_eq_top_of_nilpotent' /-
 /-- See also the more useful form `lie_module.zero_weight_space_eq_top_of_nilpotent`. -/
 @[simp]
 theorem zero_weightSpace_eq_top_of_nilpotent' [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
@@ -214,7 +229,9 @@ theorem zero_weightSpace_eq_top_of_nilpotent' [LieAlgebra.IsNilpotent R L] [IsNi
   rw [← LieSubmodule.coe_toSubmodule_eq_iff, LieSubmodule.top_coeSubmodule]
   exact infi_max_gen_zero_eigenspace_eq_top_of_nilpotent R L M
 #align lie_module.zero_weight_space_eq_top_of_nilpotent' LieModule.zero_weightSpace_eq_top_of_nilpotent'
+-/
 
+#print LieModule.coe_weightSpace_of_top /-
 theorem coe_weightSpace_of_top [LieAlgebra.IsNilpotent R L] (χ : L → R) :
     (weightSpace M (χ ∘ (⊤ : LieSubalgebra R L).incl) : Submodule R M) = weightSpace M χ :=
   by
@@ -225,7 +242,9 @@ theorem coe_weightSpace_of_top [LieAlgebra.IsNilpotent R L] (χ : L → R) :
   · obtain ⟨k, hk⟩ := h ⟨x, Set.mem_univ x⟩; use k; exact hk
   · obtain ⟨k, hk⟩ := h x; use k; exact hk
 #align lie_module.coe_weight_space_of_top LieModule.coe_weightSpace_of_top
+-/
 
+#print LieModule.zero_weightSpace_eq_top_of_nilpotent /-
 @[simp]
 theorem zero_weightSpace_eq_top_of_nilpotent [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
     weightSpace M (0 : (⊤ : LieSubalgebra R L) → R) = ⊤ :=
@@ -237,20 +256,26 @@ theorem zero_weightSpace_eq_top_of_nilpotent [LieAlgebra.IsNilpotent R L] [IsNil
     coe_weight_space_of_top, ← infi_max_gen_zero_eigenspace_eq_top_of_nilpotent R L M]
   rfl
 #align lie_module.zero_weight_space_eq_top_of_nilpotent LieModule.zero_weightSpace_eq_top_of_nilpotent
+-/
 
+#print LieModule.IsWeight /-
 /-- Given a Lie module `M` of a Lie algebra `L`, a weight of `M` with respect to a nilpotent
 subalgebra `H ⊆ L` is a Lie character whose corresponding weight space is non-empty. -/
 def IsWeight (χ : LieCharacter R H) : Prop :=
   weightSpace M χ ≠ ⊥
 #align lie_module.is_weight LieModule.IsWeight
+-/
 
+#print LieModule.isWeight_zero_of_nilpotent /-
 /-- For a non-trivial nilpotent Lie module over a nilpotent Lie algebra, the zero character is a
 weight with respect to the `⊤` Lie subalgebra. -/
 theorem isWeight_zero_of_nilpotent [Nontrivial M] [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
     IsWeight (⊤ : LieSubalgebra R L) M 0 := by
   rw [is_weight, LieHom.coe_zero, zero_weight_space_eq_top_of_nilpotent]; exact top_ne_bot
 #align lie_module.is_weight_zero_of_nilpotent LieModule.isWeight_zero_of_nilpotent
+-/
 
+#print LieModule.isNilpotent_toEndomorphism_weightSpace_zero /-
 /-- A (nilpotent) Lie algebra acts nilpotently on the zero weight space of a Noetherian Lie
 module. -/
 theorem isNilpotent_toEndomorphism_weightSpace_zero [LieAlgebra.IsNilpotent R L] [IsNoetherian R M]
@@ -264,6 +289,7 @@ theorem isNilpotent_toEndomorphism_weightSpace_zero [LieAlgebra.IsNilpotent R L]
     SetLike.coe_eq_coe, LinearMap.restrict_apply, Submodule.coe_mk, Submodule.coe_zero]
   exact hk hm
 #align lie_module.is_nilpotent_to_endomorphism_weight_space_zero LieModule.isNilpotent_toEndomorphism_weightSpace_zero
+-/
 
 /-- By Engel's theorem, when the Lie algebra is Noetherian, the zero weight space of a Noetherian
 Lie module is nilpotent. -/
@@ -281,24 +307,31 @@ open TensorProduct.LieModule
 
 open LieModule
 
+#print LieAlgebra.rootSpace /-
 /-- Given a nilpotent Lie subalgebra `H ⊆ L`, the root space of a map `χ : H → R` is the weight
 space of `L` regarded as a module of `H` via the adjoint action. -/
 abbrev rootSpace (χ : H → R) : LieSubmodule R H L :=
   weightSpace L χ
 #align lie_algebra.root_space LieAlgebra.rootSpace
+-/
 
+#print LieAlgebra.zero_rootSpace_eq_top_of_nilpotent /-
 @[simp]
 theorem zero_rootSpace_eq_top_of_nilpotent [h : IsNilpotent R L] :
     rootSpace (⊤ : LieSubalgebra R L) 0 = ⊤ :=
   zero_weightSpace_eq_top_of_nilpotent L
 #align lie_algebra.zero_root_space_eq_top_of_nilpotent LieAlgebra.zero_rootSpace_eq_top_of_nilpotent
+-/
 
+#print LieAlgebra.IsRoot /-
 /-- A root of a Lie algebra `L` with respect to a nilpotent subalgebra `H ⊆ L` is a weight of `L`,
 regarded as a module of `H` via the adjoint action. -/
 abbrev IsRoot :=
   IsWeight H L
 #align lie_algebra.is_root LieAlgebra.IsRoot
+-/
 
+#print LieAlgebra.rootSpace_comap_eq_weightSpace /-
 @[simp]
 theorem rootSpace_comap_eq_weightSpace (χ : H → R) :
     (rootSpace H χ).comap H.incl' = weightSpace H χ :=
@@ -323,9 +356,11 @@ theorem rootSpace_comap_eq_weightSpace (χ : H → R) :
       Submodule.coe_smul_of_tower, LinearMap.coe_comp, LinearMap.sub_apply]
   simp_rw [LinearMap.commute_pow_left_of_commute (hfg _)]
 #align lie_algebra.root_space_comap_eq_weight_space LieAlgebra.rootSpace_comap_eq_weightSpace
+-/
 
 variable {H M}
 
+#print LieAlgebra.lie_mem_weightSpace_of_mem_weightSpace /-
 theorem lie_mem_weightSpace_of_mem_weightSpace {χ₁ χ₂ : H → R} {x : L} {m : M}
     (hx : x ∈ rootSpace H χ₁) (hm : m ∈ weightSpace M χ₂) : ⁅x, m⁆ ∈ weightSpace M (χ₁ + χ₂) :=
   by
@@ -336,9 +371,11 @@ theorem lie_mem_weightSpace_of_mem_weightSpace {χ₁ χ₂ : H → R} {x : L} {
   simp only [Submodule.subtype_apply, to_module_hom_apply, Submodule.coe_mk,
     LieModuleHom.coe_restrictLie, TensorProduct.map_tmul]
 #align lie_algebra.lie_mem_weight_space_of_mem_weight_space LieAlgebra.lie_mem_weightSpace_of_mem_weightSpace
+-/
 
 variable (R L H M)
 
+#print LieAlgebra.rootSpaceWeightSpaceProductAux /-
 /-- Auxiliary definition for `root_space_weight_space_product`,
 which is close to the deterministic timeout limit.
 -/
@@ -364,7 +401,9 @@ def rootSpaceWeightSpaceProductAux {χ₁ χ₂ χ₃ : H → R} (hχ : χ₁ +
     rw [LinearMap.smul_apply, LinearMap.coe_mk, LinearMap.coe_mk, Subtype.coe_mk,
       LieSubmodule.coe_smul, smul_lie, LieSubmodule.coe_smul, Subtype.coe_mk]
 #align lie_algebra.root_space_weight_space_product_aux LieAlgebra.rootSpaceWeightSpaceProductAux
+-/
 
+#print LieAlgebra.rootSpaceWeightSpaceProduct /-
 /-- Given a nilpotent Lie subalgebra `H ⊆ L` together with `χ₁ χ₂ : H → R`, there is a natural
 `R`-bilinear product of root vectors and weight vectors, compatible with the actions of `H`. -/
 def rootSpaceWeightSpaceProduct (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ₂ = χ₃) :
@@ -379,7 +418,9 @@ def rootSpaceWeightSpaceProduct (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ
             LieSubalgebra.coe_bracket_of_module, LieSubalgebra.coe_bracket_of_module,
             LieSubmodule.coe_bracket, LieSubalgebra.coe_bracket_of_module, lie_lie] }
 #align lie_algebra.root_space_weight_space_product LieAlgebra.rootSpaceWeightSpaceProduct
+-/
 
+#print LieAlgebra.coe_rootSpaceWeightSpaceProduct_tmul /-
 @[simp]
 theorem coe_rootSpaceWeightSpaceProduct_tmul (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ₂ = χ₃)
     (x : rootSpace H χ₁) (m : weightSpace M χ₂) :
@@ -388,24 +429,32 @@ theorem coe_rootSpaceWeightSpaceProduct_tmul (χ₁ χ₂ χ₃ : H → R) (hχ
     LieModuleHom.coe_toLinearMap, coe_lift_lie_eq_lift_coe, Submodule.coe_mk, LinearMap.coe_mk,
     LieModuleHom.coe_mk]
 #align lie_algebra.coe_root_space_weight_space_product_tmul LieAlgebra.coe_rootSpaceWeightSpaceProduct_tmul
+-/
 
+#print LieAlgebra.rootSpaceProduct /-
 /-- Given a nilpotent Lie subalgebra `H ⊆ L` together with `χ₁ χ₂ : H → R`, there is a natural
 `R`-bilinear product of root vectors, compatible with the actions of `H`. -/
 def rootSpaceProduct (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ₂ = χ₃) :
     rootSpace H χ₁ ⊗[R] rootSpace H χ₂ →ₗ⁅R,H⁆ rootSpace H χ₃ :=
   rootSpaceWeightSpaceProduct R L H L χ₁ χ₂ χ₃ hχ
 #align lie_algebra.root_space_product LieAlgebra.rootSpaceProduct
+-/
 
+#print LieAlgebra.rootSpaceProduct_def /-
 @[simp]
 theorem rootSpaceProduct_def : rootSpaceProduct R L H = rootSpaceWeightSpaceProduct R L H L :=
   rfl
 #align lie_algebra.root_space_product_def LieAlgebra.rootSpaceProduct_def
+-/
 
+#print LieAlgebra.rootSpaceProduct_tmul /-
 theorem rootSpaceProduct_tmul (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ₂ = χ₃) (x : rootSpace H χ₁)
     (y : rootSpace H χ₂) : (rootSpaceProduct R L H χ₁ χ₂ χ₃ hχ (x ⊗ₜ y) : L) = ⁅(x : L), (y : L)⁆ :=
   by simp only [root_space_product_def, coe_root_space_weight_space_product_tmul]
 #align lie_algebra.root_space_product_tmul LieAlgebra.rootSpaceProduct_tmul
+-/
 
+#print LieAlgebra.zeroRootSubalgebra /-
 /-- Given a nilpotent Lie subalgebra `H ⊆ L`, the root space of the zero map `0 : H → R` is a Lie
 subalgebra of `L`. -/
 def zeroRootSubalgebra : LieSubalgebra R L :=
@@ -417,19 +466,25 @@ def zeroRootSubalgebra : LieSubalgebra R L :=
         rwa [root_space_product_tmul, Subtype.coe_mk, Subtype.coe_mk] at this 
       exact (root_space_product R L H 0 0 0 (add_zero 0) xy).property }
 #align lie_algebra.zero_root_subalgebra LieAlgebra.zeroRootSubalgebra
+-/
 
+#print LieAlgebra.coe_zeroRootSubalgebra /-
 @[simp]
 theorem coe_zeroRootSubalgebra : (zeroRootSubalgebra R L H : Submodule R L) = rootSpace H 0 :=
   rfl
 #align lie_algebra.coe_zero_root_subalgebra LieAlgebra.coe_zeroRootSubalgebra
+-/
 
+#print LieAlgebra.mem_zeroRootSubalgebra /-
 theorem mem_zeroRootSubalgebra (x : L) :
     x ∈ zeroRootSubalgebra R L H ↔ ∀ y : H, ∃ k : ℕ, (toEndomorphism R H L y ^ k) x = 0 := by
   simp only [zero_root_subalgebra, mem_weight_space, mem_pre_weight_space, Pi.zero_apply, sub_zero,
     SetLike.mem_coe, zero_smul, LieSubmodule.mem_coeSubmodule, Submodule.mem_carrier,
     LieSubalgebra.mem_mk_iff]
 #align lie_algebra.mem_zero_root_subalgebra LieAlgebra.mem_zeroRootSubalgebra
+-/
 
+#print LieAlgebra.toLieSubmodule_le_rootSpace_zero /-
 theorem toLieSubmodule_le_rootSpace_zero : H.toLieSubmodule ≤ rootSpace H 0 :=
   by
   intro x hx
@@ -452,14 +507,18 @@ theorem toLieSubmodule_le_rootSpace_zero : H.toLieSubmodule ≤ rootSpace H 0 :=
     Submodule.coe_eq_zero]
   exact h
 #align lie_algebra.to_lie_submodule_le_root_space_zero LieAlgebra.toLieSubmodule_le_rootSpace_zero
+-/
 
+#print LieAlgebra.le_zeroRootSubalgebra /-
 theorem le_zeroRootSubalgebra : H ≤ zeroRootSubalgebra R L H :=
   by
   rw [← LieSubalgebra.coe_submodule_le_coe_submodule, ← H.coe_to_lie_submodule,
     coe_zero_root_subalgebra, LieSubmodule.coeSubmodule_le_coeSubmodule]
   exact to_lie_submodule_le_root_space_zero R L H
 #align lie_algebra.le_zero_root_subalgebra LieAlgebra.le_zeroRootSubalgebra
+-/
 
+#print LieAlgebra.zeroRootSubalgebra_normalizer_eq_self /-
 @[simp]
 theorem zeroRootSubalgebra_normalizer_eq_self :
     (zeroRootSubalgebra R L H).normalizer = zeroRootSubalgebra R L H :=
@@ -477,7 +536,9 @@ theorem zeroRootSubalgebra_normalizer_eq_self :
   rw [LinearMap.iterate_succ, LinearMap.coe_comp, Function.comp_apply, to_endomorphism_apply_apply,
     LieSubalgebra.coe_bracket_of_module, Submodule.coe_mk, hk]
 #align lie_algebra.zero_root_subalgebra_normalizer_eq_self LieAlgebra.zeroRootSubalgebra_normalizer_eq_self
+-/
 
+#print LieAlgebra.is_cartan_of_zeroRootSubalgebra_eq /-
 /-- If the zero root subalgebra of a nilpotent Lie subalgebra `H` is just `H` then `H` is a Cartan
 subalgebra.
 
@@ -488,7 +549,9 @@ theorem is_cartan_of_zeroRootSubalgebra_eq (h : zeroRootSubalgebra R L H = H) :
   { nilpotent := inferInstance
     self_normalizing := by rw [← h]; exact zero_root_subalgebra_normalizer_eq_self R L H }
 #align lie_algebra.is_cartan_of_zero_root_subalgebra_eq LieAlgebra.is_cartan_of_zeroRootSubalgebra_eq
+-/
 
+#print LieAlgebra.zeroRootSubalgebra_eq_of_is_cartan /-
 @[simp]
 theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSubalgebra]
     [IsNoetherian R L] : zeroRootSubalgebra R L H = H :=
@@ -498,11 +561,14 @@ theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSu
   obtain ⟨k, hk⟩ := (root_space H 0).isNilpotent_iff_exists_self_le_ucs.mp (by infer_instance)
   exact hk.trans (LieSubmodule.ucs_le_of_normalizer_eq_self (by simp) k)
 #align lie_algebra.zero_root_subalgebra_eq_of_is_cartan LieAlgebra.zeroRootSubalgebra_eq_of_is_cartan
+-/
 
+#print LieAlgebra.zeroRootSubalgebra_eq_iff_is_cartan /-
 theorem zeroRootSubalgebra_eq_iff_is_cartan [IsNoetherian R L] :
     zeroRootSubalgebra R L H = H ↔ H.IsCartanSubalgebra :=
   ⟨is_cartan_of_zeroRootSubalgebra_eq R L H, by intros; simp⟩
 #align lie_algebra.zero_root_subalgebra_eq_iff_is_cartan LieAlgebra.zeroRootSubalgebra_eq_iff_is_cartan
+-/
 
 end LieAlgebra
 
@@ -512,6 +578,7 @@ open LieAlgebra
 
 variable {R L H}
 
+#print LieModule.weightSpace' /-
 /-- A priori, weight spaces are Lie submodules over the Lie subalgebra `H` used to define them.
 However they are naturally Lie submodules over the (in general larger) Lie subalgebra
 `zero_root_subalgebra R L H`. Even though it is often the case that
@@ -526,11 +593,14 @@ def weightSpace' (χ : H → R) : LieSubmodule R (zeroRootSubalgebra R L H) M :=
       rw [← zero_add χ]
       exact lie_mem_weight_space_of_mem_weight_space hx hm }
 #align lie_module.weight_space' LieModule.weightSpace'
+-/
 
+#print LieModule.coe_weightSpace' /-
 @[simp]
 theorem coe_weightSpace' (χ : H → R) : (weightSpace' M χ : Submodule R M) = weightSpace M χ :=
   rfl
 #align lie_module.coe_weight_space' LieModule.coe_weightSpace'
+-/
 
 end LieModule
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
 
 ! This file was ported from Lean 3 source module algebra.lie.weights
-! leanprover-community/mathlib commit 6b0169218d01f2837d79ea2784882009a0da1aa1
+! leanprover-community/mathlib commit 8af7091a43227e179939ba132e54e54e9f3b089a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -19,6 +19,9 @@ import Mathbin.RingTheory.TensorProduct
 /-!
 # Weights and roots of Lie modules and Lie algebras
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 Just as a key tool when studying the behaviour of a linear operator is to decompose the space on
 which it acts into a sum of (generalised) eigenspaces, a key tool when studying a representation `M`
 of Lie algebra `L` is to decompose `M` into a sum of simultaneous eigenspaces of `x` as `x` ranges
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
 
 ! This file was ported from Lean 3 source module algebra.lie.weights
-! leanprover-community/mathlib commit 938fead7abdc0cbbca8eba7a1052865a169dc102
+! leanprover-community/mathlib commit 6b0169218d01f2837d79ea2784882009a0da1aa1
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,7 +13,7 @@ import Mathbin.Algebra.Lie.TensorProduct
 import Mathbin.Algebra.Lie.Character
 import Mathbin.Algebra.Lie.Engel
 import Mathbin.Algebra.Lie.CartanSubalgebra
-import Mathbin.LinearAlgebra.Eigenspace
+import Mathbin.LinearAlgebra.Eigenspace.Basic
 import Mathbin.RingTheory.TensorProduct
 
 /-!
Diff
@@ -108,7 +108,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
   by
   -- Unpack the statement of the goal.
   intro m₃
-  simp only [LieModuleHom.coe_to_linearMap, Pi.add_apply, Function.comp_apply, mem_pre_weight_space,
+  simp only [LieModuleHom.coe_toLinearMap, Pi.add_apply, Function.comp_apply, mem_pre_weight_space,
     LinearMap.coe_comp, TensorProduct.mapIncl, exists_imp, LinearMap.mem_range]
   rintro t rfl x
   -- Set up some notation.
@@ -133,7 +133,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
     ext (m₁ m₂);
     simp only [← g.map_lie x (m₁ ⊗ₜ m₂), add_smul, sub_tmul, tmul_sub, smul_tmul, lie_tmul_right,
       tmul_smul, to_endomorphism_apply_apply, LieModuleHom.map_smul, LinearMap.one_apply,
-      LieModuleHom.coe_to_linearMap, LinearMap.smul_apply, Function.comp_apply, LinearMap.coe_comp,
+      LieModuleHom.coe_toLinearMap, LinearMap.smul_apply, Function.comp_apply, LinearMap.coe_comp,
       LinearMap.rTensor_tmul, LieModuleHom.map_add, LinearMap.add_apply, LieModuleHom.map_sub,
       LinearMap.sub_apply, LinearMap.lTensor_tmul, algebra_tensor_module.curry_apply, curry_apply,
       LinearMap.toFun_eq_coe, LinearMap.coe_restrictScalars]
@@ -179,7 +179,7 @@ theorem lie_mem_preWeightSpace_of_mem_preWeightSpace {χ₁ χ₂ : L → R} {x
     ⁅x, m⁆ ∈ preWeightSpace M (χ₁ + χ₂) :=
   by
   apply LieModule.weight_vector_multiplication L L M M (to_module_hom R L M) χ₁ χ₂
-  simp only [LieModuleHom.coe_to_linearMap, Function.comp_apply, LinearMap.coe_comp,
+  simp only [LieModuleHom.coe_toLinearMap, Function.comp_apply, LinearMap.coe_comp,
     TensorProduct.mapIncl, LinearMap.mem_range]
   use ⟨x, hx⟩ ⊗ₜ ⟨m, hm⟩
   simp only [Submodule.subtype_apply, to_module_hom_apply, TensorProduct.map_tmul]
@@ -208,7 +208,7 @@ theorem mem_weightSpace [LieAlgebra.IsNilpotent R L] (χ : L → R) (m : M) :
 theorem zero_weightSpace_eq_top_of_nilpotent' [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
     weightSpace M (0 : L → R) = ⊤ :=
   by
-  rw [← LieSubmodule.coe_to_submodule_eq_iff, LieSubmodule.top_coeSubmodule]
+  rw [← LieSubmodule.coe_toSubmodule_eq_iff, LieSubmodule.top_coeSubmodule]
   exact infi_max_gen_zero_eigenspace_eq_top_of_nilpotent R L M
 #align lie_module.zero_weight_space_eq_top_of_nilpotent' LieModule.zero_weightSpace_eq_top_of_nilpotent'
 
@@ -216,7 +216,7 @@ theorem coe_weightSpace_of_top [LieAlgebra.IsNilpotent R L] (χ : L → R) :
     (weightSpace M (χ ∘ (⊤ : LieSubalgebra R L).incl) : Submodule R M) = weightSpace M χ :=
   by
   ext m
-  simp only [weight_space, LieSubmodule.coe_to_submodule_mk, LieSubalgebra.coe_bracket_of_module,
+  simp only [weight_space, LieSubmodule.coe_toSubmodule_mk, LieSubalgebra.coe_bracket_of_module,
     Function.comp_apply, mem_pre_weight_space]
   constructor <;> intro h x
   · obtain ⟨k, hk⟩ := h ⟨x, Set.mem_univ x⟩; use k; exact hk
@@ -230,7 +230,7 @@ theorem zero_weightSpace_eq_top_of_nilpotent [LieAlgebra.IsNilpotent R L] [IsNil
   /- We use `coe_weight_space_of_top` as a trick to circumvent the fact that we don't (yet) know
       `is_nilpotent R (⊤ : lie_subalgebra R L) M` is equivalent to `is_nilpotent R L M`. -/
   have h₀ : (0 : L → R) ∘ (⊤ : LieSubalgebra R L).incl = 0 := by ext; rfl
-  rw [← LieSubmodule.coe_to_submodule_eq_iff, LieSubmodule.top_coeSubmodule, ← h₀,
+  rw [← LieSubmodule.coe_toSubmodule_eq_iff, LieSubmodule.top_coeSubmodule, ← h₀,
     coe_weight_space_of_top, ← infi_max_gen_zero_eigenspace_eq_top_of_nilpotent R L M]
   rfl
 #align lie_module.zero_weight_space_eq_top_of_nilpotent LieModule.zero_weightSpace_eq_top_of_nilpotent
@@ -327,7 +327,7 @@ theorem lie_mem_weightSpace_of_mem_weightSpace {χ₁ χ₂ : H → R} {x : L} {
     (hx : x ∈ rootSpace H χ₁) (hm : m ∈ weightSpace M χ₂) : ⁅x, m⁆ ∈ weightSpace M (χ₁ + χ₂) :=
   by
   apply LieModule.weight_vector_multiplication H L M M ((to_module_hom R L M).restrictLie H) χ₁ χ₂
-  simp only [LieModuleHom.coe_to_linearMap, Function.comp_apply, LinearMap.coe_comp,
+  simp only [LieModuleHom.coe_toLinearMap, Function.comp_apply, LinearMap.coe_comp,
     TensorProduct.mapIncl, LinearMap.mem_range]
   use ⟨x, hx⟩ ⊗ₜ ⟨m, hm⟩
   simp only [Submodule.subtype_apply, to_module_hom_apply, Submodule.coe_mk,
@@ -382,7 +382,7 @@ theorem coe_rootSpaceWeightSpaceProduct_tmul (χ₁ χ₂ χ₃ : H → R) (hχ
     (x : rootSpace H χ₁) (m : weightSpace M χ₂) :
     (rootSpaceWeightSpaceProduct R L H M χ₁ χ₂ χ₃ hχ (x ⊗ₜ m) : M) = ⁅(x : L), (m : M)⁆ := by
   simp only [root_space_weight_space_product, root_space_weight_space_product_aux, lift_apply,
-    LieModuleHom.coe_to_linearMap, coe_lift_lie_eq_lift_coe, Submodule.coe_mk, LinearMap.coe_mk,
+    LieModuleHom.coe_toLinearMap, coe_lift_lie_eq_lift_coe, Submodule.coe_mk, LinearMap.coe_mk,
     LieModuleHom.coe_mk]
 #align lie_algebra.coe_root_space_weight_space_product_tmul LieAlgebra.coe_rootSpaceWeightSpaceProduct_tmul
 
Diff
@@ -143,7 +143,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
     rw [← LinearMap.comp_apply, LinearMap.commute_pow_left_of_commute h_comm_square,
       LinearMap.comp_apply, hk, LinearMap.map_zero]
   -- Unpack the information we have about `m₁`, `m₂`.
-  simp only [mem_pre_weight_space] at hm₁ hm₂
+  simp only [mem_pre_weight_space] at hm₁ hm₂ 
   obtain ⟨k₁, hk₁⟩ := hm₁ x
   obtain ⟨k₂, hk₂⟩ := hm₂ x
   have hf₁ : (f₁ ^ k₁) (m₁ ⊗ₜ m₂) = 0 := by
@@ -308,7 +308,7 @@ theorem rootSpace_comap_eq_weightSpace (χ : H → R) :
       ∀ y : H, ∃ k : ℕ, (H.incl : H →ₗ[R] L).comp (g y ^ k) x = 0
     by
     simp only [LieHom.coe_toLinearMap, LieSubalgebra.coe_incl, Function.comp_apply,
-      LinearMap.coe_comp, Submodule.coe_eq_zero] at this
+      LinearMap.coe_comp, Submodule.coe_eq_zero] at this 
     simp only [mem_weight_space, mem_pre_weight_space, LieSubalgebra.coe_incl',
       LieSubmodule.mem_comap, this]
   have hfg : ∀ y : H, (f y).comp (H.incl : H →ₗ[R] L) = (H.incl : H →ₗ[R] L).comp (g y) :=
@@ -411,7 +411,7 @@ def zeroRootSubalgebra : LieSubalgebra R L :=
       by
       let xy : root_space H 0 ⊗[R] root_space H 0 := ⟨x, hx⟩ ⊗ₜ ⟨y, hy⟩
       suffices (root_space_product R L H 0 0 0 (add_zero 0) xy : L) ∈ root_space H 0 by
-        rwa [root_space_product_tmul, Subtype.coe_mk, Subtype.coe_mk] at this
+        rwa [root_space_product_tmul, Subtype.coe_mk, Subtype.coe_mk] at this 
       exact (root_space_product R L H 0 0 0 (add_zero 0) xy).property }
 #align lie_algebra.zero_root_subalgebra LieAlgebra.zeroRootSubalgebra
 
@@ -430,7 +430,7 @@ theorem mem_zeroRootSubalgebra (x : L) :
 theorem toLieSubmodule_le_rootSpace_zero : H.toLieSubmodule ≤ rootSpace H 0 :=
   by
   intro x hx
-  simp only [LieSubalgebra.mem_toLieSubmodule] at hx
+  simp only [LieSubalgebra.mem_toLieSubmodule] at hx 
   simp only [mem_weight_space, mem_pre_weight_space, Pi.zero_apply, sub_zero, zero_smul]
   intro y
   obtain ⟨k, hk⟩ := (inferInstance : IsNilpotent R H)
@@ -444,7 +444,7 @@ theorem toLieSubmodule_le_rootSpace_zero : H.toLieSubmodule ≤ rootSpace H 0 :=
   change (g ^ k).comp (H : Submodule R L).Subtype ⟨x, hx⟩ = 0
   rw [LinearMap.commute_pow_left_of_commute hfg k]
   have h := iterate_to_endomorphism_mem_lower_central_series R H H y ⟨x, hx⟩ k
-  rw [hk, LieSubmodule.mem_bot] at h
+  rw [hk, LieSubmodule.mem_bot] at h 
   simp only [Submodule.subtype_apply, Function.comp_apply, LinearMap.pow_apply, LinearMap.coe_comp,
     Submodule.coe_eq_zero]
   exact h
@@ -463,13 +463,13 @@ theorem zeroRootSubalgebra_normalizer_eq_self :
   by
   refine' le_antisymm _ (LieSubalgebra.le_normalizer _)
   intro x hx
-  rw [LieSubalgebra.mem_normalizer_iff] at hx
+  rw [LieSubalgebra.mem_normalizer_iff] at hx 
   rw [mem_zero_root_subalgebra]
   rintro ⟨y, hy⟩
   specialize hx y (le_zero_root_subalgebra R L H hy)
-  rw [mem_zero_root_subalgebra] at hx
+  rw [mem_zero_root_subalgebra] at hx 
   obtain ⟨k, hk⟩ := hx ⟨y, hy⟩
-  rw [← lie_skew, LinearMap.map_neg, neg_eq_zero] at hk
+  rw [← lie_skew, LinearMap.map_neg, neg_eq_zero] at hk 
   use k + 1
   rw [LinearMap.iterate_succ, LinearMap.coe_comp, Function.comp_apply, to_endomorphism_apply_apply,
     LieSubalgebra.coe_bracket_of_module, Submodule.coe_mk, hk]
@@ -498,7 +498,7 @@ theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSu
 
 theorem zeroRootSubalgebra_eq_iff_is_cartan [IsNoetherian R L] :
     zeroRootSubalgebra R L H = H ↔ H.IsCartanSubalgebra :=
-  ⟨is_cartan_of_zeroRootSubalgebra_eq R L H, by intros ; simp⟩
+  ⟨is_cartan_of_zeroRootSubalgebra_eq R L H, by intros; simp⟩
 #align lie_algebra.zero_root_subalgebra_eq_iff_is_cartan LieAlgebra.zeroRootSubalgebra_eq_iff_is_cartan
 
 end LieAlgebra
Diff
@@ -68,9 +68,9 @@ open TensorProduct
 
 open TensorProduct.LieModule
 
-open BigOperators
+open scoped BigOperators
 
-open TensorProduct
+open scoped TensorProduct
 
 /-- Given a Lie module `M` over a Lie algebra `L`, the pre-weight space of `M` with respect to a
 map `χ : L → R` is the simultaneous generalized eigenspace of the action of all `x : L` on `M`,
@@ -272,7 +272,7 @@ end LieModule
 
 namespace LieAlgebra
 
-open TensorProduct
+open scoped TensorProduct
 
 open TensorProduct.LieModule
 
Diff
@@ -116,11 +116,9 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
   change ∃ k, (F ^ k) (g _) = 0
   -- The goal is linear in `t` so use induction to reduce to the case that `t` is a pure tensor.
   apply t.induction_on
-  · use 0
-    simp only [LinearMap.map_zero, LieModuleHom.map_zero]
+  · use 0; simp only [LinearMap.map_zero, LieModuleHom.map_zero]
   swap
-  · rintro t₁ t₂ ⟨k₁, hk₁⟩ ⟨k₂, hk₂⟩
-    use max k₁ k₂
+  · rintro t₁ t₂ ⟨k₁, hk₁⟩ ⟨k₂, hk₂⟩; use max k₁ k₂
     simp only [LieModuleHom.map_add, LinearMap.map_add,
       LinearMap.pow_map_zero_of_le (le_max_left k₁ k₂) hk₁,
       LinearMap.pow_map_zero_of_le (le_max_right k₁ k₂) hk₂, add_zero]
@@ -132,7 +130,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
   let f₂ : Module.End R (M₁ ⊗[R] M₂) := (to_endomorphism R L M₂ x - χ₂ x • 1).lTensor M₁
   have h_comm_square : F ∘ₗ ↑g = (g : M₁ ⊗[R] M₂ →ₗ[R] M₃).comp (f₁ + f₂) :=
     by
-    ext (m₁ m₂)
+    ext (m₁ m₂);
     simp only [← g.map_lie x (m₁ ⊗ₜ m₂), add_smul, sub_tmul, tmul_sub, smul_tmul, lie_tmul_right,
       tmul_smul, to_endomorphism_apply_apply, LieModuleHom.map_smul, LinearMap.one_apply,
       LieModuleHom.coe_to_linearMap, LinearMap.smul_apply, Function.comp_apply, LinearMap.coe_comp,
@@ -154,8 +152,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
     simp only [hk₂, tmul_zero, LinearMap.lTensor_tmul, LinearMap.lTensor_pow]
   -- It's now just an application of the binomial theorem.
   use k₁ + k₂ - 1
-  have hf_comm : Commute f₁ f₂ := by
-    ext (m₁ m₂)
+  have hf_comm : Commute f₁ f₂ := by ext (m₁ m₂);
     simp only [LinearMap.mul_apply, LinearMap.rTensor_tmul, LinearMap.lTensor_tmul,
       algebra_tensor_module.curry_apply, LinearMap.toFun_eq_coe, LinearMap.lTensor_tmul,
       curry_apply, LinearMap.coe_restrictScalars]
@@ -166,9 +163,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
   apply Finset.sum_eq_zero
   rintro ⟨i, j⟩ hij
   -- Eliminate the binomial coefficients from the picture.
-  suffices (f₁ ^ i * f₂ ^ j) (m₁ ⊗ₜ m₂) = 0 by
-    rw [this]
-    apply smul_zero
+  suffices (f₁ ^ i * f₂ ^ j) (m₁ ⊗ₜ m₂) = 0 by rw [this]; apply smul_zero
   -- Finish off with appropriate case analysis.
   cases' Nat.le_or_le_of_add_eq_add_pred (finset.nat.mem_antidiagonal.mp hij) with hi hj
   ·
@@ -224,12 +219,8 @@ theorem coe_weightSpace_of_top [LieAlgebra.IsNilpotent R L] (χ : L → R) :
   simp only [weight_space, LieSubmodule.coe_to_submodule_mk, LieSubalgebra.coe_bracket_of_module,
     Function.comp_apply, mem_pre_weight_space]
   constructor <;> intro h x
-  · obtain ⟨k, hk⟩ := h ⟨x, Set.mem_univ x⟩
-    use k
-    exact hk
-  · obtain ⟨k, hk⟩ := h x
-    use k
-    exact hk
+  · obtain ⟨k, hk⟩ := h ⟨x, Set.mem_univ x⟩; use k; exact hk
+  · obtain ⟨k, hk⟩ := h x; use k; exact hk
 #align lie_module.coe_weight_space_of_top LieModule.coe_weightSpace_of_top
 
 @[simp]
@@ -238,10 +229,7 @@ theorem zero_weightSpace_eq_top_of_nilpotent [LieAlgebra.IsNilpotent R L] [IsNil
   by
   /- We use `coe_weight_space_of_top` as a trick to circumvent the fact that we don't (yet) know
       `is_nilpotent R (⊤ : lie_subalgebra R L) M` is equivalent to `is_nilpotent R L M`. -/
-  have h₀ : (0 : L → R) ∘ (⊤ : LieSubalgebra R L).incl = 0 :=
-    by
-    ext
-    rfl
+  have h₀ : (0 : L → R) ∘ (⊤ : LieSubalgebra R L).incl = 0 := by ext; rfl
   rw [← LieSubmodule.coe_to_submodule_eq_iff, LieSubmodule.top_coeSubmodule, ← h₀,
     coe_weight_space_of_top, ← infi_max_gen_zero_eigenspace_eq_top_of_nilpotent R L M]
   rfl
@@ -256,10 +244,8 @@ def IsWeight (χ : LieCharacter R H) : Prop :=
 /-- For a non-trivial nilpotent Lie module over a nilpotent Lie algebra, the zero character is a
 weight with respect to the `⊤` Lie subalgebra. -/
 theorem isWeight_zero_of_nilpotent [Nontrivial M] [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
-    IsWeight (⊤ : LieSubalgebra R L) M 0 :=
-  by
-  rw [is_weight, LieHom.coe_zero, zero_weight_space_eq_top_of_nilpotent]
-  exact top_ne_bot
+    IsWeight (⊤ : LieSubalgebra R L) M 0 := by
+  rw [is_weight, LieHom.coe_zero, zero_weight_space_eq_top_of_nilpotent]; exact top_ne_bot
 #align lie_module.is_weight_zero_of_nilpotent LieModule.isWeight_zero_of_nilpotent
 
 /-- A (nilpotent) Lie algebra acts nilpotently on the zero weight space of a Noetherian Lie
@@ -327,8 +313,7 @@ theorem rootSpace_comap_eq_weightSpace (χ : H → R) :
       LieSubmodule.mem_comap, this]
   have hfg : ∀ y : H, (f y).comp (H.incl : H →ₗ[R] L) = (H.incl : H →ₗ[R] L).comp (g y) :=
     by
-    rintro ⟨y, hy⟩
-    ext ⟨z, hz⟩
+    rintro ⟨y, hy⟩; ext ⟨z, hz⟩
     simp only [Submodule.coe_sub, to_endomorphism_apply_apply, LieHom.coe_toLinearMap,
       LinearMap.one_apply, LieSubalgebra.coe_incl, LieSubalgebra.coe_bracket_of_module,
       LieSubalgebra.coe_bracket, LinearMap.smul_apply, Function.comp_apply,
@@ -360,14 +345,11 @@ def rootSpaceWeightSpaceProductAux {χ₁ χ₂ χ₃ : H → R} (hχ : χ₁ +
   toFun x :=
     { toFun := fun m =>
         ⟨⁅(x : L), (m : M)⁆, hχ ▸ lie_mem_weightSpace_of_mem_weightSpace x.property m.property⟩
-      map_add' := fun m n => by
-        simp only [LieSubmodule.coe_add, lie_add]
-        rfl
-      map_smul' := fun t m =>
-        by
+      map_add' := fun m n => by simp only [LieSubmodule.coe_add, lie_add]; rfl
+      map_smul' := fun t m => by
         conv_lhs =>
           congr
-          rw [LieSubmodule.coe_smul, lie_smul]
+          rw [LieSubmodule.coe_smul, lie_smul];
         rfl }
   map_add' x y := by
     ext m <;>
@@ -455,9 +437,7 @@ theorem toLieSubmodule_le_rootSpace_zero : H.toLieSubmodule ≤ rootSpace H 0 :=
   use k
   let f : Module.End R H := to_endomorphism R H H y
   let g : Module.End R L := to_endomorphism R H L y
-  have hfg : g.comp (H : Submodule R L).Subtype = (H : Submodule R L).Subtype.comp f :=
-    by
-    ext z
+  have hfg : g.comp (H : Submodule R L).Subtype = (H : Submodule R L).Subtype.comp f := by ext z;
     simp only [to_endomorphism_apply_apply, Submodule.subtype_apply,
       LieSubalgebra.coe_bracket_of_module, LieSubalgebra.coe_bracket, Function.comp_apply,
       LinearMap.coe_comp]
@@ -503,9 +483,7 @@ When `L` is Noetherian, it follows from Engel's theorem that the converse holds.
 theorem is_cartan_of_zeroRootSubalgebra_eq (h : zeroRootSubalgebra R L H = H) :
     H.IsCartanSubalgebra :=
   { nilpotent := inferInstance
-    self_normalizing := by
-      rw [← h]
-      exact zero_root_subalgebra_normalizer_eq_self R L H }
+    self_normalizing := by rw [← h]; exact zero_root_subalgebra_normalizer_eq_self R L H }
 #align lie_algebra.is_cartan_of_zero_root_subalgebra_eq LieAlgebra.is_cartan_of_zeroRootSubalgebra_eq
 
 @[simp]
@@ -520,9 +498,7 @@ theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSu
 
 theorem zeroRootSubalgebra_eq_iff_is_cartan [IsNoetherian R L] :
     zeroRootSubalgebra R L H = H ↔ H.IsCartanSubalgebra :=
-  ⟨is_cartan_of_zeroRootSubalgebra_eq R L H, by
-    intros
-    simp⟩
+  ⟨is_cartan_of_zeroRootSubalgebra_eq R L H, by intros ; simp⟩
 #align lie_algebra.zero_root_subalgebra_eq_iff_is_cartan LieAlgebra.zeroRootSubalgebra_eq_iff_is_cartan
 
 end LieAlgebra
@@ -542,10 +518,8 @@ def weightSpace' (χ : H → R) : LieSubmodule R (zeroRootSubalgebra R L H) M :=
   { (weightSpace M χ : Submodule R M) with
     lie_mem := fun x m hm =>
       by
-      have hx : (x : L) ∈ root_space H 0 :=
-        by
-        rw [← LieSubmodule.mem_coeSubmodule, ← coe_zero_root_subalgebra]
-        exact x.property
+      have hx : (x : L) ∈ root_space H 0 := by
+        rw [← LieSubmodule.mem_coeSubmodule, ← coe_zero_root_subalgebra]; exact x.property
       rw [← zero_add χ]
       exact lie_mem_weight_space_of_mem_weight_space hx hm }
 #align lie_module.weight_space' LieModule.weightSpace'
Diff
@@ -128,16 +128,16 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
   rintro ⟨m₁, hm₁⟩ ⟨m₂, hm₂⟩
   change ∃ k, (F ^ k) ((g : M₁ ⊗[R] M₂ →ₗ[R] M₃) (m₁ ⊗ₜ m₂)) = 0
   -- Eliminate `g` from the picture.
-  let f₁ : Module.End R (M₁ ⊗[R] M₂) := (to_endomorphism R L M₁ x - χ₁ x • 1).rtensor M₂
-  let f₂ : Module.End R (M₁ ⊗[R] M₂) := (to_endomorphism R L M₂ x - χ₂ x • 1).ltensor M₁
+  let f₁ : Module.End R (M₁ ⊗[R] M₂) := (to_endomorphism R L M₁ x - χ₁ x • 1).rTensor M₂
+  let f₂ : Module.End R (M₁ ⊗[R] M₂) := (to_endomorphism R L M₂ x - χ₂ x • 1).lTensor M₁
   have h_comm_square : F ∘ₗ ↑g = (g : M₁ ⊗[R] M₂ →ₗ[R] M₃).comp (f₁ + f₂) :=
     by
     ext (m₁ m₂)
     simp only [← g.map_lie x (m₁ ⊗ₜ m₂), add_smul, sub_tmul, tmul_sub, smul_tmul, lie_tmul_right,
       tmul_smul, to_endomorphism_apply_apply, LieModuleHom.map_smul, LinearMap.one_apply,
       LieModuleHom.coe_to_linearMap, LinearMap.smul_apply, Function.comp_apply, LinearMap.coe_comp,
-      LinearMap.rtensor_tmul, LieModuleHom.map_add, LinearMap.add_apply, LieModuleHom.map_sub,
-      LinearMap.sub_apply, LinearMap.ltensor_tmul, algebra_tensor_module.curry_apply, curry_apply,
+      LinearMap.rTensor_tmul, LieModuleHom.map_add, LinearMap.add_apply, LieModuleHom.map_sub,
+      LinearMap.sub_apply, LinearMap.lTensor_tmul, algebra_tensor_module.curry_apply, curry_apply,
       LinearMap.toFun_eq_coe, LinearMap.coe_restrictScalars]
     abel
   rsuffices ⟨k, hk⟩ : ∃ k, ((f₁ + f₂) ^ k) (m₁ ⊗ₜ m₂) = 0
@@ -149,15 +149,15 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
   obtain ⟨k₁, hk₁⟩ := hm₁ x
   obtain ⟨k₂, hk₂⟩ := hm₂ x
   have hf₁ : (f₁ ^ k₁) (m₁ ⊗ₜ m₂) = 0 := by
-    simp only [hk₁, zero_tmul, LinearMap.rtensor_tmul, LinearMap.rtensor_pow]
+    simp only [hk₁, zero_tmul, LinearMap.rTensor_tmul, LinearMap.rTensor_pow]
   have hf₂ : (f₂ ^ k₂) (m₁ ⊗ₜ m₂) = 0 := by
-    simp only [hk₂, tmul_zero, LinearMap.ltensor_tmul, LinearMap.ltensor_pow]
+    simp only [hk₂, tmul_zero, LinearMap.lTensor_tmul, LinearMap.lTensor_pow]
   -- It's now just an application of the binomial theorem.
   use k₁ + k₂ - 1
   have hf_comm : Commute f₁ f₂ := by
     ext (m₁ m₂)
-    simp only [LinearMap.mul_apply, LinearMap.rtensor_tmul, LinearMap.ltensor_tmul,
-      algebra_tensor_module.curry_apply, LinearMap.toFun_eq_coe, LinearMap.ltensor_tmul,
+    simp only [LinearMap.mul_apply, LinearMap.rTensor_tmul, LinearMap.lTensor_tmul,
+      algebra_tensor_module.curry_apply, LinearMap.toFun_eq_coe, LinearMap.lTensor_tmul,
       curry_apply, LinearMap.coe_restrictScalars]
   rw [hf_comm.add_pow']
   simp only [TensorProduct.mapIncl, Submodule.subtype_apply, Finset.sum_apply, Submodule.coe_mk,
Diff
@@ -92,7 +92,7 @@ theorem exists_preWeightSpace_zero_le_ker_of_isNoetherian [IsNoetherian R M] (x
     ∃ k : ℕ, preWeightSpace M (0 : L → R) ≤ (toEndomorphism R L M x ^ k).ker :=
   by
   use (to_endomorphism R L M x).maximalGeneralizedEigenspaceIndex 0
-  simp only [← Module.End.generalizedEigenspace_zero, pre_weight_space, Pi.zero_apply, infᵢ_le, ←
+  simp only [← Module.End.generalizedEigenspace_zero, pre_weight_space, Pi.zero_apply, iInf_le, ←
     (to_endomorphism R L M x).maximalGeneralizedEigenspace_eq]
 #align lie_module.exists_pre_weight_space_zero_le_ker_of_is_noetherian LieModule.exists_preWeightSpace_zero_le_ker_of_isNoetherian
 
@@ -200,7 +200,7 @@ def weightSpace [LieAlgebra.IsNilpotent R L] (χ : L → R) : LieSubmodule R L M
       rw [← zero_add χ]
       refine' lie_mem_pre_weight_space_of_mem_pre_weight_space _ hm
       suffices pre_weight_space L (0 : L → R) = ⊤ by simp only [this, Submodule.mem_top]
-      exact LieAlgebra.infᵢ_max_gen_zero_eigenspace_eq_top_of_nilpotent R L }
+      exact LieAlgebra.iInf_max_gen_zero_eigenspace_eq_top_of_nilpotent R L }
 #align lie_module.weight_space LieModule.weightSpace
 
 theorem mem_weightSpace [LieAlgebra.IsNilpotent R L] (χ : L → R) (m : M) :
Diff
@@ -255,12 +255,12 @@ def IsWeight (χ : LieCharacter R H) : Prop :=
 
 /-- For a non-trivial nilpotent Lie module over a nilpotent Lie algebra, the zero character is a
 weight with respect to the `⊤` Lie subalgebra. -/
-theorem isWeightZeroOfNilpotent [Nontrivial M] [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
+theorem isWeight_zero_of_nilpotent [Nontrivial M] [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
     IsWeight (⊤ : LieSubalgebra R L) M 0 :=
   by
   rw [is_weight, LieHom.coe_zero, zero_weight_space_eq_top_of_nilpotent]
   exact top_ne_bot
-#align lie_module.is_weight_zero_of_nilpotent LieModule.isWeightZeroOfNilpotent
+#align lie_module.is_weight_zero_of_nilpotent LieModule.isWeight_zero_of_nilpotent
 
 /-- A (nilpotent) Lie algebra acts nilpotently on the zero weight space of a Noetherian Lie
 module. -/
@@ -321,7 +321,7 @@ theorem rootSpace_comap_eq_weightSpace (χ : H → R) :
     (∀ y : H, ∃ k : ℕ, (f y ^ k).comp (H.incl : H →ₗ[R] L) x = 0) ↔
       ∀ y : H, ∃ k : ℕ, (H.incl : H →ₗ[R] L).comp (g y ^ k) x = 0
     by
-    simp only [LieHom.coe_to_linearMap, LieSubalgebra.coe_incl, Function.comp_apply,
+    simp only [LieHom.coe_toLinearMap, LieSubalgebra.coe_incl, Function.comp_apply,
       LinearMap.coe_comp, Submodule.coe_eq_zero] at this
     simp only [mem_weight_space, mem_pre_weight_space, LieSubalgebra.coe_incl',
       LieSubmodule.mem_comap, this]
@@ -329,7 +329,7 @@ theorem rootSpace_comap_eq_weightSpace (χ : H → R) :
     by
     rintro ⟨y, hy⟩
     ext ⟨z, hz⟩
-    simp only [Submodule.coe_sub, to_endomorphism_apply_apply, LieHom.coe_to_linearMap,
+    simp only [Submodule.coe_sub, to_endomorphism_apply_apply, LieHom.coe_toLinearMap,
       LinearMap.one_apply, LieSubalgebra.coe_incl, LieSubalgebra.coe_bracket_of_module,
       LieSubalgebra.coe_bracket, LinearMap.smul_apply, Function.comp_apply,
       Submodule.coe_smul_of_tower, LinearMap.coe_comp, LinearMap.sub_apply]

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 2 (#12361)

A PR analogous to #12338: reformatting proofs following the multiple goals linter of #12339.

Diff
@@ -363,7 +363,8 @@ lemma mem_posFittingCompOf (x : L) (m : M) :
     obtain ⟨n, rfl⟩ := (mem_posFittingCompOf R x m).mp hm k
     exact this n k
   intro m l
-  induction' l with l ih; simp
+  induction' l with l ih
+  · simp
   simp only [lowerCentralSeries_succ, pow_succ', LinearMap.mul_apply]
   exact LieSubmodule.lie_mem_lie _ ⊤ (LieSubmodule.mem_top x) ih
 
@@ -602,7 +603,8 @@ lemma independent_weightSpace [NoZeroSMulDivisors R M] :
     simpa only [CompleteLattice.independent_iff_supIndep_of_injOn (injOn_weightSpace R L M),
       Finset.supIndep_iff_disjoint_erase] using fun s χ _ ↦ this _ _ (s.not_mem_erase χ)
   intro χ₁ s
-  induction' s using Finset.induction_on with χ₂ s _ ih; simp
+  induction' s using Finset.induction_on with χ₂ s _ ih
+  · simp
   intro hχ₁₂
   obtain ⟨hχ₁₂ : χ₁ ≠ χ₂, hχ₁ : χ₁ ∉ s⟩ := by rwa [Finset.mem_insert, not_or] at hχ₁₂
   specialize ih hχ₁
feat: define the coroots of a semisimple Lie algebra (#10893)

We define the coroots of a finite-dimensional semisimple Lie algebra with coefficients in a field characteristic zero and establish the key property that a coroot is complementary to the kernel of the root.

In addition we carry out some related, light refactoring. The most important points are:

  • Promote LieModule.weight from a subtype to a structure LieModule.Weight + expand its API (we need this expanded API for the headline results).
  • Replace the definition LieAlgebra.rootSpaceProductNegSelf with its range which we call LieAlgebra.corootSpace (in all places where we used this definition, it was the range that we actually used).
  • Drop the very old (unused) definitions LieAlgebra.IsRoot and LieModule.IsWeight.
Diff
@@ -29,6 +29,7 @@ Basic definitions and properties of the above ideas are provided in this file.
 
   * `LieModule.weightSpaceOf`
   * `LieModule.weightSpace`
+  * `LieModule.Weight`
   * `LieModule.posFittingCompOf`
   * `LieModule.posFittingComp`
   * `LieModule.iSup_ucs_eq_weightSpace_zero`
@@ -184,6 +185,49 @@ lemma weightSpace_le_weightSpaceOf (x : L) (χ : L → R) :
     weightSpace M χ ≤ weightSpaceOf M (χ x) x :=
   iInf_le _ x
 
+variable (R L) in
+/-- A weight of a Lie module is a map `L → R` such that the corresponding weight space is
+non-trivial. -/
+structure Weight where
+  /-- The family of eigenvalues corresponding to a weight. -/
+  toFun : L → R
+  weightSpace_ne_bot : weightSpace M toFun ≠ ⊥
+
+namespace Weight
+
+instance instFunLike : FunLike (Weight R L M) L R where
+  coe χ := χ.1
+  coe_injective' χ₁ χ₂ h := by cases χ₁; cases χ₂; simp_all
+
+@[simp] lemma coe_weight_mk (χ : L → R) (h) :
+    (↑(⟨χ, h⟩ : Weight R L M) : L → R) = χ :=
+  rfl
+
+variable {M}
+
+/-- The proposition that a weight of a Lie module is zero.
+
+We make this definition because we cannot define a `Zero (Weight R L M)` instance since the weight
+space of the zero function can be trivial. -/
+def IsZero (χ : Weight R L M) := (χ : L → R) = 0
+
+@[simp] lemma IsZero.eq {χ : Weight R L M} (hχ : χ.IsZero) : (χ : L → R) = 0 := hχ
+
+@[simp] lemma coe_eq_zero_iff (χ : Weight R L M) : (χ : L → R) = 0 ↔ χ.IsZero := Iff.rfl
+
+/-- The proposition that a weight of a Lie module is non-zero. -/
+abbrev IsNonZero (χ : Weight R L M) := ¬ IsZero (χ : Weight R L M)
+
+variable (R L M) in
+/-- The set of weights is equivalent to a subtype. -/
+def equivSetOf : Weight R L M ≃ {χ : L → R | weightSpace M χ ≠ ⊥} where
+  toFun w := ⟨w.1, w.2⟩
+  invFun w := ⟨w.1, w.2⟩
+  left_inv w := by simp
+  right_inv w := by simp
+
+end Weight
+
 /-- See also the more useful form `LieModule.zero_weightSpace_eq_top_of_nilpotent`. -/
 @[simp]
 theorem zero_weightSpace_eq_top_of_nilpotent' [IsNilpotent R L M] :
@@ -547,6 +591,9 @@ lemma injOn_weightSpace [NoZeroSMulDivisors R M] :
   contrapose! hχ₂
   simpa [hχ₁₂] using disjoint_weightSpace R L M hχ₂
 
+/-- Lie module weight spaces are independent.
+
+See also `LieModule.independent_weightSpace'`. -/
 lemma independent_weightSpace [NoZeroSMulDivisors R M] :
     CompleteLattice.Independent fun (χ : L → R) ↦ weightSpace M χ := by
   classical
@@ -588,6 +635,11 @@ lemma independent_weightSpace [NoZeroSMulDivisors R M] :
     rintro - ⟨u, hu, rfl⟩
     exact LieSubmodule.mapsTo_pow_toEndomorphism_sub_algebraMap _ hu
 
+lemma independent_weightSpace' [NoZeroSMulDivisors R M] :
+    CompleteLattice.Independent fun χ : Weight R L M ↦ weightSpace M χ :=
+  (independent_weightSpace R L M).comp <|
+    Subtype.val_injective.comp (Weight.equivSetOf R L M).injective
+
 lemma independent_weightSpaceOf [NoZeroSMulDivisors R M] (x : L) :
     CompleteLattice.Independent fun (χ : R) ↦ weightSpaceOf M χ x := by
   rw [LieSubmodule.independent_iff_coe_toSubmodule]
@@ -603,9 +655,14 @@ lemma finite_weightSpace_ne_bot [NoZeroSMulDivisors R M] [IsNoetherian R M] :
   CompleteLattice.WellFounded.finite_ne_bot_of_independent
     (LieSubmodule.wellFounded_of_noetherian R L M) (independent_weightSpace R L M)
 
-/-- The collection of weights of a Noetherian Lie module, bundled as a `Finset`. -/
-noncomputable abbrev weight [NoZeroSMulDivisors R M] [IsNoetherian R M] :=
-  (finite_weightSpace_ne_bot R L M).toFinset
+instance Weight.instFinite [NoZeroSMulDivisors R M] [IsNoetherian R M] :
+    Finite (Weight R L M) := by
+  have : Finite {χ : L → R | weightSpace M χ ≠ ⊥} := finite_weightSpace_ne_bot R L M
+  exact Finite.of_injective (equivSetOf R L M) (equivSetOf R L M).injective
+
+noncomputable instance Weight.instFintype [NoZeroSMulDivisors R M] [IsNoetherian R M] :
+    Fintype (Weight R L M) :=
+  Fintype.ofFinite _
 
 /-- A Lie module `M` of a Lie algebra `L` is triangularizable if the endomorhpism of `M` defined by
 any `x : L` is triangularizable. -/
@@ -647,6 +704,9 @@ instance (N : LieSubmodule K L M) [IsTriangularizable K L M] : IsTriangularizabl
   rw [← N.toEndomorphism_restrict_eq_toEndomorphism y]
   exact Module.End.iSup_generalizedEigenspace_restrict_eq_top _ (IsTriangularizable.iSup_eq_top y)
 
+/-- For a triangularizable Lie module in finite dimensions, the weight spaces span the entire space.
+
+See also `LieModule.iSup_weightSpace_eq_top'`. -/
 lemma iSup_weightSpace_eq_top [IsTriangularizable K L M] :
     ⨆ χ : L → K, weightSpace M χ = ⊤ := by
   clear! R -- cf https://github.com/leanprover/lean4/issues/2452
@@ -679,6 +739,12 @@ lemma iSup_weightSpace_eq_top [IsTriangularizable K L M] :
     simpa only [← ih, iSup_comm (ι := K), iSup_iSup_eq_right] using
       iSup_weightSpaceOf_eq_top K L M y
 
+lemma iSup_weightSpace_eq_top' [IsTriangularizable K L M] :
+    ⨆ χ : Weight K L M, weightSpace M χ = ⊤ := by
+  have := iSup_weightSpace_eq_top K L M
+  erw [← iSup_ne_bot_subtype, ← (Weight.equivSetOf K L M).iSup_comp] at this
+  exact this
+
 end field
 
 end LieModule
chore: remove some mathlib3 names in doc comments (#11931)
Diff
@@ -54,7 +54,7 @@ namespace LieModule
 open Set Function LieAlgebra TensorProduct TensorProduct.LieModule
 open scoped BigOperators TensorProduct
 
-section notation_weight_space_of
+section notation_weightSpaceOf
 
 /-- Until we define `LieModule.weightSpaceOf`, it is useful to have some notation as follows: -/
 local notation3 "𝕎("M", " χ", " x")" => (toEndomorphism R L M x).maximalGeneralizedEigenspace χ
@@ -156,7 +156,7 @@ def weightSpaceOf (χ : R) (x : L) : LieSubmodule R L M :=
       rw [← zero_add χ]
       exact lie_mem_maxGenEigenspace_toEndomorphism (by simp) hm }
 
-end notation_weight_space_of
+end notation_weightSpaceOf
 
 variable (M)
 
change the order of operation in zsmulRec and nsmulRec (#11451)

We change the following field in the definition of an additive commutative monoid:

 nsmul_succ : ∀ (n : ℕ) (x : G),
-  AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+  AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x

where the latter is more natural

We adjust the definitions of ^ in monoids, groups, etc. Originally there was a warning comment about why this natural order was preferred

use x * npowRec n x and not npowRec n x * x in the definition to make sure that definitional unfolding of npowRec is blocked, to avoid deep recursion issues.

but it seems to no longer apply.

Remarks on the PR :

  • pow_succ and pow_succ' have switched their meanings.
  • Most of the time, the proofs were adjusted by priming/unpriming one lemma, or exchanging left and right; a few proofs were more complicated to adjust.
  • In particular, [Mathlib/NumberTheory/RamificationInertia.lean] used Ideal.IsPrime.mul_mem_pow which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul.
  • the docstring for Cauchy condensation test in [Mathlib/Analysis/PSeries.lean] was mathematically incorrect, I added the mention that the function is antitone.
Diff
@@ -261,7 +261,7 @@ lemma weightSpace_zero_normalizer_eq_self :
   intro y
   obtain ⟨k, hk⟩ := hm y y
   use k + 1
-  simpa [pow_succ', LinearMap.mul_eq_comp]
+  simpa [pow_succ, LinearMap.mul_eq_comp]
 
 lemma iSup_ucs_le_weightSpace_zero :
     ⨆ k, (⊥ : LieSubmodule R L M).ucs k ≤ weightSpace M (0 : L → R) := by
@@ -320,7 +320,7 @@ lemma mem_posFittingCompOf (x : L) (m : M) :
     exact this n k
   intro m l
   induction' l with l ih; simp
-  simp only [lowerCentralSeries_succ, pow_succ, LinearMap.mul_apply]
+  simp only [lowerCentralSeries_succ, pow_succ', LinearMap.mul_apply]
   exact LieSubmodule.lie_mem_lie _ ⊤ (LieSubmodule.mem_top x) ih
 
 @[simp] lemma posFittingCompOf_eq_bot_of_isNilpotent
chore: prepare Lean version bump with explicit simp (#10999)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -90,12 +90,13 @@ protected theorem weight_vector_multiplication (M₁ M₂ M₃ : Type*)
   let f₂ : Module.End R (M₁ ⊗[R] M₂) := (toEndomorphism R L M₂ x - χ₂ • ↑1).lTensor M₁
   have h_comm_square : F ∘ₗ ↑g = (g : M₁ ⊗[R] M₂ →ₗ[R] M₃).comp (f₁ + f₂) := by
     ext m₁ m₂;
-    simp only [← g.map_lie x (m₁ ⊗ₜ m₂), add_smul, sub_tmul, tmul_sub, smul_tmul, lie_tmul_right,
-      tmul_smul, toEndomorphism_apply_apply, LieModuleHom.map_smul, LinearMap.one_apply,
-      LieModuleHom.coe_toLinearMap, LinearMap.smul_apply, Function.comp_apply, LinearMap.coe_comp,
-      LinearMap.rTensor_tmul, LieModuleHom.map_add, LinearMap.add_apply, LieModuleHom.map_sub,
-      LinearMap.sub_apply, LinearMap.lTensor_tmul, AlgebraTensorModule.curry_apply,
-      TensorProduct.curry_apply, LinearMap.toFun_eq_coe, LinearMap.coe_restrictScalars]
+    simp only [f₁, f₂, F, ← g.map_lie x (m₁ ⊗ₜ m₂), add_smul, sub_tmul, tmul_sub, smul_tmul,
+      lie_tmul_right, tmul_smul, toEndomorphism_apply_apply, LieModuleHom.map_smul,
+      LinearMap.one_apply, LieModuleHom.coe_toLinearMap, LinearMap.smul_apply, Function.comp_apply,
+      LinearMap.coe_comp, LinearMap.rTensor_tmul, LieModuleHom.map_add, LinearMap.add_apply,
+      LieModuleHom.map_sub, LinearMap.sub_apply, LinearMap.lTensor_tmul,
+      AlgebraTensorModule.curry_apply, TensorProduct.curry_apply, LinearMap.toFun_eq_coe,
+      LinearMap.coe_restrictScalars]
     abel
   rsuffices ⟨k, hk⟩ : ∃ k : ℕ, ((f₁ + f₂) ^ k) (m₁ ⊗ₜ m₂) = 0
   · use k
@@ -107,14 +108,14 @@ protected theorem weight_vector_multiplication (M₁ M₂ M₃ : Type*)
   obtain ⟨k₁, hk₁⟩ := hm₁
   obtain ⟨k₂, hk₂⟩ := hm₂
   have hf₁ : (f₁ ^ k₁) (m₁ ⊗ₜ m₂) = 0 := by
-    simp only [hk₁, zero_tmul, LinearMap.rTensor_tmul, LinearMap.rTensor_pow]
+    simp only [f₁, hk₁, zero_tmul, LinearMap.rTensor_tmul, LinearMap.rTensor_pow]
   have hf₂ : (f₂ ^ k₂) (m₁ ⊗ₜ m₂) = 0 := by
-    simp only [hk₂, tmul_zero, LinearMap.lTensor_tmul, LinearMap.lTensor_pow]
+    simp only [f₂, hk₂, tmul_zero, LinearMap.lTensor_tmul, LinearMap.lTensor_pow]
   -- It's now just an application of the binomial theorem.
   use k₁ + k₂ - 1
   have hf_comm : Commute f₁ f₂ := by
     ext m₁ m₂
-    simp only [LinearMap.mul_apply, LinearMap.rTensor_tmul, LinearMap.lTensor_tmul,
+    simp only [f₁, f₂, LinearMap.mul_apply, LinearMap.rTensor_tmul, LinearMap.lTensor_tmul,
       AlgebraTensorModule.curry_apply, LinearMap.toFun_eq_coe, LinearMap.lTensor_tmul,
       TensorProduct.curry_apply, LinearMap.coe_restrictScalars]
   rw [hf_comm.add_pow']
@@ -296,14 +297,15 @@ def posFittingCompOf (x : L) : LieSubmodule R L M :=
       obtain ⟨m, rfl⟩ := hm (N + k)
       let f₁ : Module.End R (L ⊗[R] M) := (LieAlgebra.ad R L x).rTensor M
       let f₂ : Module.End R (L ⊗[R] M) := φ.lTensor L
-      replace hN : f₁ ^ N = 0 := by ext; simp [hN]
-      have h₁ : Commute f₁ f₂ := by ext; simp
-      have h₂ : φ ∘ₗ toModuleHom R L M = toModuleHom R L M ∘ₗ (f₁ + f₂) := by ext; simp
+      replace hN : f₁ ^ N = 0 := by ext; simp [f₁, hN]
+      have h₁ : Commute f₁ f₂ := by ext; simp [f₁, f₂]
+      have h₂ : φ ∘ₗ toModuleHom R L M = toModuleHom R L M ∘ₗ (f₁ + f₂) := by ext; simp [φ, f₁, f₂]
       obtain ⟨q, hq⟩ := h₁.add_pow_dvd_pow_of_pow_eq_zero_right (N + k).le_succ hN
       use toModuleHom R L M (q (y ⊗ₜ m))
       change (φ ^ k).comp ((toModuleHom R L M : L ⊗[R] M →ₗ[R] M)) _ = _
-      simp [LinearMap.commute_pow_left_of_commute h₂, LinearMap.comp_apply (g := (f₁ + f₂) ^ k),
-        ← LinearMap.comp_apply (g := q), ← LinearMap.mul_eq_comp, ← hq] }
+      simp [φ,  f₁, f₂, LinearMap.commute_pow_left_of_commute h₂,
+        LinearMap.comp_apply (g := (f₁ + f₂) ^ k), ← LinearMap.comp_apply (g := q),
+        ← LinearMap.mul_eq_comp, ← hq] }
 
 variable {M} in
 lemma mem_posFittingCompOf (x : L) (m : M) :
@@ -486,8 +488,8 @@ private lemma isCompl_weightSpace_zero_posFittingComp_aux
   set M₁ := posFittingComp R L M
   rcases forall_or_exists_not (fun (x : L) ↦ weightSpaceOf M (0 : R) x = ⊤)
     with h | ⟨x, hx : weightSpaceOf M (0 : R) x ≠ ⊤⟩
-  · suffices IsNilpotent R L M by simp [isCompl_top_bot]
-    replace h : M₀ = ⊤ := by simpa [weightSpace]
+  · suffices IsNilpotent R L M by simp [M₀, M₁, isCompl_top_bot]
+    replace h : M₀ = ⊤ := by simpa [M₀, weightSpace]
     rw [← LieModule.isNilpotent_of_top_iff', ← h]
     infer_instance
   · set M₀ₓ := weightSpaceOf M (0 : R) x
feat: add lemma LieAlgebra.IsKilling.eq_zero_of_apply_eq_zero_of_mem_rootSpaceProductNegSelf (#10803)
Diff
@@ -5,10 +5,8 @@ Authors: Oliver Nash
 -/
 import Mathlib.Algebra.Ring.Divisibility.Lemmas
 import Mathlib.Algebra.Lie.Nilpotent
-import Mathlib.Algebra.Lie.TensorProduct
 import Mathlib.Algebra.Lie.Engel
 import Mathlib.LinearAlgebra.Eigenspace.Triangularizable
-import Mathlib.LinearAlgebra.TensorProduct.Tower
 import Mathlib.RingTheory.Artinian
 import Mathlib.LinearAlgebra.Trace
 import Mathlib.LinearAlgebra.FreeModule.PID
feat: add lemma LieModule.exists_pos_smul_add_smul_rootSpaceProductNegSelf_eq_zero (#10748)
Diff
@@ -10,6 +10,8 @@ import Mathlib.Algebra.Lie.Engel
 import Mathlib.LinearAlgebra.Eigenspace.Triangularizable
 import Mathlib.LinearAlgebra.TensorProduct.Tower
 import Mathlib.RingTheory.Artinian
+import Mathlib.LinearAlgebra.Trace
+import Mathlib.LinearAlgebra.FreeModule.PID
 
 #align_import algebra.lie.weights from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
 
@@ -617,6 +619,18 @@ lemma iSup_weightSpaceOf_eq_top [IsTriangularizable R L M] (x : L) :
     LieSubmodule.top_coeSubmodule]
   exact IsTriangularizable.iSup_eq_top x
 
+open LinearMap FiniteDimensional in
+@[simp]
+lemma trace_toEndomorphism_weightSpace [IsDomain R] [IsPrincipalIdealRing R]
+    [Module.Free R M] [Module.Finite R M] (χ : L → R) (x : L) :
+    trace R _ (toEndomorphism R L (weightSpace M χ) x) = finrank R (weightSpace M χ) • χ x := by
+  suffices _root_.IsNilpotent ((toEndomorphism R L (weightSpace M χ) x) - χ x • LinearMap.id) by
+    replace this := (isNilpotent_trace_of_isNilpotent this).eq_zero
+    rwa [map_sub, map_smul, trace_id, sub_eq_zero, smul_eq_mul, mul_comm,
+      ← nsmul_eq_mul] at this
+  rw [← Module.algebraMap_end_eq_smul_id]
+  exact isNilpotent_toEndomorphism_sub_algebraMap M χ x
+
 section field
 
 open FiniteDimensional
chore: remove stream-of-consciousness uses of have, replace and suffices (#10640)

No changes to tactic file, it's just boring fixes throughout the library.

This follows on from #6964.

Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -312,8 +312,8 @@ lemma mem_posFittingCompOf (x : L) (m : M) :
 
 @[simp] lemma posFittingCompOf_le_lowerCentralSeries (x : L) (k : ℕ) :
     posFittingCompOf R M x ≤ lowerCentralSeries R L M k := by
-  suffices : ∀ m l, (toEndomorphism R L M x ^ l) m ∈ lowerCentralSeries R L M l
-  · intro m hm
+  suffices ∀ m l, (toEndomorphism R L M x ^ l) m ∈ lowerCentralSeries R L M l by
+    intro m hm
     obtain ⟨n, rfl⟩ := (mem_posFittingCompOf R x m).mp hm k
     exact this n k
   intro m l
@@ -417,8 +417,8 @@ lemma comap_weightSpace_eq_of_injective (hf : Injective f) :
              f ∘ₗ (toEndomorphism R L M x - χ x • ↑1) := by ext; simp
     obtain ⟨k, hk⟩ := hm x
     use k
-    suffices : f (((toEndomorphism R L M x - χ x • ↑1) ^ k) m) = 0
-    · rw [← f.map_zero] at this; exact hf this
+    suffices f (((toEndomorphism R L M x - χ x • ↑1) ^ k) m) = 0 by
+      rw [← f.map_zero] at this; exact hf this
     simpa [hk] using (LinearMap.congr_fun (LinearMap.commute_pow_left_of_commute h k) m).symm
   · rw [← LieSubmodule.map_le_iff_le_comap]
     exact map_weightSpace_le f
@@ -514,14 +514,14 @@ private lemma isCompl_weightSpace_zero_posFittingComp_aux
 lemma isCompl_weightSpace_zero_posFittingComp :
     IsCompl (weightSpace M 0) (posFittingComp R L M) := by
   let P : LieSubmodule R L M → Prop := fun N ↦ IsCompl (weightSpace N 0) (posFittingComp R L N)
-  suffices : P ⊤
-  · let e := LieModuleEquiv.ofTop R L M
+  suffices P ⊤ by
+    let e := LieModuleEquiv.ofTop R L M
     rw [← map_weightSpace_eq e, ← map_posFittingComp_eq e]
     exact (LieSubmodule.orderIsoMapComap e).isCompl_iff.mp this
   refine (LieSubmodule.wellFounded_of_isArtinian R L M).induction (C := P) _ fun N hN ↦ ?_
   refine isCompl_weightSpace_zero_posFittingComp_aux R L N fun N' hN' ↦ ?_
-  suffices : IsCompl (weightSpace (N'.map N.incl) 0) (posFittingComp R L (N'.map N.incl))
-  · let e := LieSubmodule.equivMapOfInjective N' N.injective_incl
+  suffices IsCompl (weightSpace (N'.map N.incl) 0) (posFittingComp R L (N'.map N.incl)) by
+    let e := LieSubmodule.equivMapOfInjective N' N.injective_incl
     rw [← map_weightSpace_eq e, ← map_posFittingComp_eq e] at this
     exact (LieSubmodule.orderIsoMapComap e).isCompl_iff.mpr this
   exact hN _ (LieSubmodule.map_incl_lt_iff_lt_top.mpr hN')
chore: space after (#8178)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -455,7 +455,8 @@ lemma posFittingComp_map_incl_sup_of_codisjoint [IsNoetherian R M] [IsArtinian R
     (eventually_iInf_lowerCentralSeries_eq R L M)
   obtain ⟨hl₁, hl₂, hl₃⟩ := hl l (le_refl _)
   simp_rw [← iInf_lowerCentralSeries_eq_posFittingComp, hl₁, hl₂, hl₃,
-    LieSubmodule.lowerCentralSeries_map_eq_lcs, ←LieSubmodule.lcs_sup, lowerCentralSeries, h.eq_top]
+    LieSubmodule.lowerCentralSeries_map_eq_lcs, ← LieSubmodule.lcs_sup, lowerCentralSeries,
+    h.eq_top]
 
 lemma weightSpace_weightSpaceOf_map_incl (x : L) (χ : L → R) :
     (weightSpace (weightSpaceOf M (χ x) x) χ).map (weightSpaceOf M (χ x) x).incl =
@@ -661,7 +662,8 @@ lemma iSup_weightSpace_eq_top [IsTriangularizable K L M] :
         rw [← hχ, weightSpace_weightSpaceOf_map_incl]
       simp_rw [biSup_congr this, ← LieSubmodule.map_iSup, ih, LieModuleHom.map_top,
         LieSubmodule.range_incl]
-    simpa only [←ih, iSup_comm (ι := K), iSup_iSup_eq_right] using iSup_weightSpaceOf_eq_top K L M y
+    simpa only [← ih, iSup_comm (ι := K), iSup_iSup_eq_right] using
+      iSup_weightSpaceOf_eq_top K L M y
 
 end field
 
feat: the roots of a Lie algebra with non-singular Killing form span the dual of the Cartan subalgebra (#8688)

In combination with existing work the changes here mean that the following now works (and furthermore, makes no assumptions about characteristic):

example {K L : Type*} [Field K] [IsAlgClosed K] [LieRing L] [LieAlgebra K L]
    [FiniteDimensional K L] [LieAlgebra.IsKilling K L]
    (H : LieSubalgebra K L) [H.IsCartanSubalgebra] :
    Submodule.span K (range (LieModule.weight.toLinear K H L)) = ⊤ := by
  simp
Diff
@@ -600,6 +600,10 @@ lemma finite_weightSpace_ne_bot [NoZeroSMulDivisors R M] [IsNoetherian R M] :
   CompleteLattice.WellFounded.finite_ne_bot_of_independent
     (LieSubmodule.wellFounded_of_noetherian R L M) (independent_weightSpace R L M)
 
+/-- The collection of weights of a Noetherian Lie module, bundled as a `Finset`. -/
+noncomputable abbrev weight [NoZeroSMulDivisors R M] [IsNoetherian R M] :=
+  (finite_weightSpace_ne_bot R L M).toFinset
+
 /-- A Lie module `M` of a Lie algebra `L` is triangularizable if the endomorhpism of `M` defined by
 any `x : L` is triangularizable. -/
 class IsTriangularizable : Prop :=
feat: weights of Lie modules are linear functions (#8677)

Since we have already proved Cartan subalgebras of Lie algebras with non-singular Killing forms are Abelian, the changes here mean that the following now works without any assumptions on characteristic:

example {K L : Type*} [Field K] [LieRing L] [LieAlgebra K L]
    [FiniteDimensional K L] [LieAlgebra.IsKilling K L]
    (H : LieSubalgebra K L) [H.IsCartanSubalgebra] :
    LieModule.LinearWeights K H L := inferInstance
Diff
@@ -210,26 +210,37 @@ theorem zero_weightSpace_eq_top_of_nilpotent [IsNilpotent R L M] :
   exact ⟨k, by simp [hk x]⟩
 #align lie_module.zero_weight_space_eq_top_of_nilpotent LieModule.zero_weightSpace_eq_top_of_nilpotent
 
+theorem exists_weightSpace_le_ker_of_isNoetherian [IsNoetherian R M] (χ : L → R) (x : L) :
+    ∃ k : ℕ,
+      weightSpace M χ ≤ LinearMap.ker ((toEndomorphism R L M x - algebraMap R _ (χ x)) ^ k) := by
+  use (toEndomorphism R L M x).maximalGeneralizedEigenspaceIndex (χ x)
+  intro m hm
+  replace hm : m ∈ (toEndomorphism R L M x).maximalGeneralizedEigenspace (χ x) :=
+    weightSpace_le_weightSpaceOf M x χ hm
+  rwa [Module.End.maximalGeneralizedEigenspace_eq] at hm
+
 variable (R) in
 theorem exists_weightSpace_zero_le_ker_of_isNoetherian
     [IsNoetherian R M] (x : L) :
     ∃ k : ℕ, weightSpace M (0 : L → R) ≤ LinearMap.ker (toEndomorphism R L M x ^ k) := by
-  use (toEndomorphism R L M x).maximalGeneralizedEigenspaceIndex 0
-  simp only [weightSpace, weightSpaceOf, LieSubmodule.iInf_coe_toSubmodule, Pi.zero_apply, iInf_le,
-    ← Module.End.generalizedEigenspace_zero,
-    ← (toEndomorphism R L M x).maximalGeneralizedEigenspace_eq]
+  simpa using exists_weightSpace_le_ker_of_isNoetherian M (0 : L → R) x
+
+lemma isNilpotent_toEndomorphism_sub_algebraMap [IsNoetherian R M] (χ : L → R) (x : L) :
+    _root_.IsNilpotent <| toEndomorphism R L (weightSpace M χ) x - algebraMap R _ (χ x) := by
+  have : toEndomorphism R L (weightSpace M χ) x - algebraMap R _ (χ x) =
+      (toEndomorphism R L M x - algebraMap R _ (χ x)).restrict
+        (fun m hm ↦ sub_mem (LieSubmodule.lie_mem _ hm) (Submodule.smul_mem _ _ hm)) := by
+    rfl
+  obtain ⟨k, hk⟩ := exists_weightSpace_le_ker_of_isNoetherian M χ x
+  use k
+  ext ⟨m, hm⟩
+  simpa [this, LinearMap.pow_restrict _, LinearMap.restrict_apply] using hk hm
 
 /-- A (nilpotent) Lie algebra acts nilpotently on the zero weight space of a Noetherian Lie
 module. -/
-theorem isNilpotent_toEndomorphism_weightSpace_zero [IsNoetherian R M]
-    (x : L) : _root_.IsNilpotent <| toEndomorphism R L (weightSpace M (0 : L → R)) x := by
-  obtain ⟨k, hk⟩ := exists_weightSpace_zero_le_ker_of_isNoetherian R M x
-  use k
-  ext ⟨m, hm⟩
-  rw [LinearMap.zero_apply, LieSubmodule.coe_zero, Submodule.coe_eq_zero, ←
-    LieSubmodule.toEndomorphism_restrict_eq_toEndomorphism, LinearMap.pow_restrict, ←
-    SetLike.coe_eq_coe, LinearMap.restrict_apply, Submodule.coe_mk, Submodule.coe_zero]
-  exact hk hm
+theorem isNilpotent_toEndomorphism_weightSpace_zero [IsNoetherian R M] (x : L) :
+    _root_.IsNilpotent <| toEndomorphism R L (weightSpace M (0 : L → R)) x := by
+  simpa using isNilpotent_toEndomorphism_sub_algebraMap M (0 : L → R) x
 #align lie_module.is_nilpotent_to_endomorphism_weight_space_zero LieModule.isNilpotent_toEndomorphism_weightSpace_zero
 
 /-- By Engel's theorem, the zero weight space of a Noetherian Lie module is nilpotent. -/
feat: if a Lie algebra has non-degenerate Killing form then its Cartan subalgebras are Abelian (#8430)

Note: the proof (due to Zassenhaus) makes no assumption about the characteristic of the coefficients.

Diff
@@ -574,6 +574,21 @@ lemma independent_weightSpace [NoZeroSMulDivisors R M] :
     rintro - ⟨u, hu, rfl⟩
     exact LieSubmodule.mapsTo_pow_toEndomorphism_sub_algebraMap _ hu
 
+lemma independent_weightSpaceOf [NoZeroSMulDivisors R M] (x : L) :
+    CompleteLattice.Independent fun (χ : R) ↦ weightSpaceOf M χ x := by
+  rw [LieSubmodule.independent_iff_coe_toSubmodule]
+  exact (toEndomorphism R L M x).independent_generalizedEigenspace
+
+lemma finite_weightSpaceOf_ne_bot [NoZeroSMulDivisors R M] [IsNoetherian R M] (x : L) :
+    {χ : R | weightSpaceOf M χ x ≠ ⊥}.Finite :=
+  CompleteLattice.WellFounded.finite_ne_bot_of_independent
+    (LieSubmodule.wellFounded_of_noetherian R L M) (independent_weightSpaceOf R L M x)
+
+lemma finite_weightSpace_ne_bot [NoZeroSMulDivisors R M] [IsNoetherian R M] :
+    {χ : L → R | weightSpace M χ ≠ ⊥}.Finite :=
+  CompleteLattice.WellFounded.finite_ne_bot_of_independent
+    (LieSubmodule.wellFounded_of_noetherian R L M) (independent_weightSpace R L M)
+
 /-- A Lie module `M` of a Lie algebra `L` is triangularizable if the endomorhpism of `M` defined by
 any `x : L` is triangularizable. -/
 class IsTriangularizable : Prop :=
feat: weight space decomposition of Lie modules (#7963)
Diff
@@ -7,7 +7,7 @@ import Mathlib.Algebra.Ring.Divisibility.Lemmas
 import Mathlib.Algebra.Lie.Nilpotent
 import Mathlib.Algebra.Lie.TensorProduct
 import Mathlib.Algebra.Lie.Engel
-import Mathlib.LinearAlgebra.Eigenspace.Basic
+import Mathlib.LinearAlgebra.Eigenspace.Triangularizable
 import Mathlib.LinearAlgebra.TensorProduct.Tower
 import Mathlib.RingTheory.Artinian
 
@@ -34,6 +34,8 @@ Basic definitions and properties of the above ideas are provided in this file.
   * `LieModule.iSup_ucs_eq_weightSpace_zero`
   * `LieModule.iInf_lowerCentralSeries_eq_posFittingComp`
   * `LieModule.isCompl_weightSpace_zero_posFittingComp`
+  * `LieModule.independent_weightSpace`
+  * `LieModule.iSup_weightSpace_eq_top`
 
 ## References
 
@@ -44,12 +46,12 @@ Basic definitions and properties of the above ideas are provided in this file.
 lie character, eigenvalue, eigenspace, weight, weight vector, root, root vector
 -/
 
-variable {R L M : Type*} [CommRing R] [LieRing L] [LieAlgebra R L] [LieAlgebra.IsNilpotent R L]
+variable {K R L M : Type*} [CommRing R] [LieRing L] [LieAlgebra R L] [LieAlgebra.IsNilpotent R L]
   [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
 
 namespace LieModule
 
-open LieAlgebra TensorProduct TensorProduct.LieModule
+open Set Function LieAlgebra TensorProduct TensorProduct.LieModule
 open scoped BigOperators TensorProduct
 
 section notation_weight_space_of
@@ -93,7 +95,7 @@ protected theorem weight_vector_multiplication (M₁ M₂ M₃ : Type*)
       LieModuleHom.coe_toLinearMap, LinearMap.smul_apply, Function.comp_apply, LinearMap.coe_comp,
       LinearMap.rTensor_tmul, LieModuleHom.map_add, LinearMap.add_apply, LieModuleHom.map_sub,
       LinearMap.sub_apply, LinearMap.lTensor_tmul, AlgebraTensorModule.curry_apply,
-      curry_apply, LinearMap.toFun_eq_coe, LinearMap.coe_restrictScalars]
+      TensorProduct.curry_apply, LinearMap.toFun_eq_coe, LinearMap.coe_restrictScalars]
     abel
   rsuffices ⟨k, hk⟩ : ∃ k : ℕ, ((f₁ + f₂) ^ k) (m₁ ⊗ₜ m₂) = 0
   · use k
@@ -114,7 +116,7 @@ protected theorem weight_vector_multiplication (M₁ M₂ M₃ : Type*)
     ext m₁ m₂
     simp only [LinearMap.mul_apply, LinearMap.rTensor_tmul, LinearMap.lTensor_tmul,
       AlgebraTensorModule.curry_apply, LinearMap.toFun_eq_coe, LinearMap.lTensor_tmul,
-      curry_apply, LinearMap.coe_restrictScalars]
+      TensorProduct.curry_apply, LinearMap.coe_restrictScalars]
   rw [hf_comm.add_pow']
   simp only [TensorProduct.mapIncl, Submodule.subtype_apply, Finset.sum_apply, Submodule.coe_mk,
     LinearMap.coeFn_sum, TensorProduct.map_tmul, LinearMap.smul_apply]
@@ -177,6 +179,10 @@ theorem mem_weightSpace (χ : L → R) (m : M) :
     m ∈ weightSpace M χ ↔ ∀ x, ∃ k : ℕ, ((toEndomorphism R L M x - χ x • ↑1) ^ k) m = 0 := by
   simp [weightSpace, mem_weightSpaceOf]
 
+lemma weightSpace_le_weightSpaceOf (x : L) (χ : L → R) :
+    weightSpace M χ ≤ weightSpaceOf M (χ x) x :=
+  iInf_le _ x
+
 /-- See also the more useful form `LieModule.zero_weightSpace_eq_top_of_nilpotent`. -/
 @[simp]
 theorem zero_weightSpace_eq_top_of_nilpotent' [IsNilpotent R L M] :
@@ -390,7 +396,7 @@ lemma map_weightSpace_le :
 
 variable {f}
 
-lemma comap_weightSpace_eq_of_injective (hf : Function.Injective f) :
+lemma comap_weightSpace_eq_of_injective (hf : Injective f) :
     (weightSpace M₂ χ).comap f = weightSpace M χ := by
   refine le_antisymm (fun m hm ↦ ?_) ?_
   · simp only [LieSubmodule.mem_comap, mem_weightSpace] at hm
@@ -406,7 +412,7 @@ lemma comap_weightSpace_eq_of_injective (hf : Function.Injective f) :
   · rw [← LieSubmodule.map_le_iff_le_comap]
     exact map_weightSpace_le f
 
-lemma map_weightSpace_eq_of_injective (hf : Function.Injective f) :
+lemma map_weightSpace_eq_of_injective (hf : Injective f) :
     (weightSpace M χ).map f = weightSpace M₂ χ ⊓ f.range := by
   refine le_antisymm (le_inf_iff.mpr ⟨map_weightSpace_le f, LieSubmodule.map_le_range f⟩) ?_
   rintro - ⟨hm, ⟨m, rfl⟩⟩
@@ -440,6 +446,12 @@ lemma posFittingComp_map_incl_sup_of_codisjoint [IsNoetherian R M] [IsArtinian R
   simp_rw [← iInf_lowerCentralSeries_eq_posFittingComp, hl₁, hl₂, hl₃,
     LieSubmodule.lowerCentralSeries_map_eq_lcs, ←LieSubmodule.lcs_sup, lowerCentralSeries, h.eq_top]
 
+lemma weightSpace_weightSpaceOf_map_incl (x : L) (χ : L → R) :
+    (weightSpace (weightSpaceOf M (χ x) x) χ).map (weightSpaceOf M (χ x) x).incl =
+    weightSpace M χ := by
+  simpa [map_weightSpace_eq_of_injective (weightSpaceOf M (χ x) x).injective_incl]
+    using weightSpace_le_weightSpaceOf M x χ
+
 end map_comap
 
 section fitting_decomposition
@@ -470,11 +482,10 @@ private lemma isCompl_weightSpace_zero_posFittingComp_aux
     set M₁ₓ := posFittingCompOf R M x
     set M₀ₓ₀ := weightSpace M₀ₓ (0 : L → R)
     set M₀ₓ₁ := posFittingComp R L M₀ₓ
-    have h₀ : Function.Injective (LieSubmodule.incl M₀ₓ) := Subtype.coe_injective
     have h₁ : IsCompl M₀ₓ M₁ₓ := isCompl_weightSpaceOf_zero_posFittingCompOf R L M x
     have h₂ : IsCompl M₀ₓ₀ M₀ₓ₁ := h M₀ₓ hx.lt_top
     have h₃ : M₀ₓ₀.map M₀ₓ.incl = M₀ := by
-      rw [map_weightSpace_eq_of_injective h₀, inf_eq_left, LieSubmodule.range_incl]
+      rw [map_weightSpace_eq_of_injective M₀ₓ.injective_incl, inf_eq_left, LieSubmodule.range_incl]
       exact iInf_le _ x
     have h₄ : M₀ₓ₁.map M₀ₓ.incl ⊔ M₁ₓ = M₁ := by
       apply le_antisymm <| sup_le_iff.mpr
@@ -483,7 +494,8 @@ private lemma isCompl_weightSpace_zero_posFittingComp_aux
       exact sup_le_sup_left LieSubmodule.map_incl_le _
     rw [← h₃, ← h₄]
     apply Disjoint.isCompl_sup_right_of_isCompl_sup_left
-    · rw [disjoint_iff, ← LieSubmodule.map_inf h₀, h₂.inf_eq_bot, LieSubmodule.map_bot]
+    · rw [disjoint_iff, ← LieSubmodule.map_inf M₀ₓ.injective_incl, h₂.inf_eq_bot,
+        LieSubmodule.map_bot]
     · rwa [← LieSubmodule.map_sup, h₂.sup_eq_top, LieModuleHom.map_top, LieSubmodule.range_incl]
 
 /-- This is the Fitting decomposition of the Lie module `M`. -/
@@ -497,12 +509,130 @@ lemma isCompl_weightSpace_zero_posFittingComp :
   refine (LieSubmodule.wellFounded_of_isArtinian R L M).induction (C := P) _ fun N hN ↦ ?_
   refine isCompl_weightSpace_zero_posFittingComp_aux R L N fun N' hN' ↦ ?_
   suffices : IsCompl (weightSpace (N'.map N.incl) 0) (posFittingComp R L (N'.map N.incl))
-  · have h_inj : Function.Injective N.incl := Subtype.coe_injective
-    let e := LieSubmodule.equivMapOfInjective N' h_inj
+  · let e := LieSubmodule.equivMapOfInjective N' N.injective_incl
     rw [← map_weightSpace_eq e, ← map_posFittingComp_eq e] at this
     exact (LieSubmodule.orderIsoMapComap e).isCompl_iff.mpr this
   exact hN _ (LieSubmodule.map_incl_lt_iff_lt_top.mpr hN')
 
 end fitting_decomposition
 
+lemma disjoint_weightSpaceOf [NoZeroSMulDivisors R M] {x : L} {φ₁ φ₂ : R} (h : φ₁ ≠ φ₂) :
+    Disjoint (weightSpaceOf M φ₁ x) (weightSpaceOf M φ₂ x) := by
+  rw [LieSubmodule.disjoint_iff_coe_toSubmodule]
+  exact Module.End.disjoint_iSup_generalizedEigenspace _ h
+
+lemma disjoint_weightSpace [NoZeroSMulDivisors R M] {χ₁ χ₂ : L → R} (h : χ₁ ≠ χ₂) :
+    Disjoint (weightSpace M χ₁) (weightSpace M χ₂) := by
+  obtain ⟨x, hx⟩ : ∃ x, χ₁ x ≠ χ₂ x := Function.ne_iff.mp h
+  exact (disjoint_weightSpaceOf R L M hx).mono
+    (weightSpace_le_weightSpaceOf M x χ₁) (weightSpace_le_weightSpaceOf M x χ₂)
+
+lemma injOn_weightSpace [NoZeroSMulDivisors R M] :
+    InjOn (fun (χ : L → R) ↦ weightSpace M χ) {χ | weightSpace M χ ≠ ⊥} := by
+  rintro χ₁ _ χ₂ hχ₂ (hχ₁₂ : weightSpace M χ₁ = weightSpace M χ₂)
+  contrapose! hχ₂
+  simpa [hχ₁₂] using disjoint_weightSpace R L M hχ₂
+
+lemma independent_weightSpace [NoZeroSMulDivisors R M] :
+    CompleteLattice.Independent fun (χ : L → R) ↦ weightSpace M χ := by
+  classical
+  suffices ∀ χ (s : Finset (L → R)) (_ : χ ∉ s),
+      Disjoint (weightSpace M χ) (s.sup fun (χ : L → R) ↦ weightSpace M χ) by
+    simpa only [CompleteLattice.independent_iff_supIndep_of_injOn (injOn_weightSpace R L M),
+      Finset.supIndep_iff_disjoint_erase] using fun s χ _ ↦ this _ _ (s.not_mem_erase χ)
+  intro χ₁ s
+  induction' s using Finset.induction_on with χ₂ s _ ih; simp
+  intro hχ₁₂
+  obtain ⟨hχ₁₂ : χ₁ ≠ χ₂, hχ₁ : χ₁ ∉ s⟩ := by rwa [Finset.mem_insert, not_or] at hχ₁₂
+  specialize ih hχ₁
+  rw [Finset.sup_insert, disjoint_iff, LieSubmodule.eq_bot_iff]
+  rintro x ⟨hx, hx'⟩
+  simp only [SetLike.mem_coe, LieSubmodule.mem_coeSubmodule] at hx hx'
+  suffices x ∈ weightSpace M χ₂ by
+    rw [← LieSubmodule.mem_bot (R := R) (L := L), ← (disjoint_weightSpace R L M hχ₁₂).eq_bot]
+    exact ⟨hx, this⟩
+  obtain ⟨y, hy, z, hz, rfl⟩ := (LieSubmodule.mem_sup _ _ _).mp hx'; clear hx'
+  suffices ∀ l, ∃ (k : ℕ),
+      ((toEndomorphism R L M l - algebraMap R (Module.End R M) (χ₂ l)) ^ k) (y + z) ∈
+      weightSpace M χ₁ ⊓ Finset.sup s fun χ ↦ weightSpace M χ by
+    simpa only [ih.eq_bot, LieSubmodule.mem_bot, mem_weightSpace] using this
+  intro l
+  let g : Module.End R M := toEndomorphism R L M l - algebraMap R (Module.End R M) (χ₂ l)
+  obtain ⟨k, hk : (g ^ k) y = 0⟩ := (mem_weightSpace _ _ _).mp hy l
+  refine ⟨k, (LieSubmodule.mem_inf _ _ _).mp ⟨?_, ?_⟩⟩
+  · exact LieSubmodule.mapsTo_pow_toEndomorphism_sub_algebraMap _ hx
+  · rw [map_add, hk, zero_add]
+    suffices (s.sup fun χ ↦ weightSpace M χ : Submodule R M).map (g ^ k) ≤
+        s.sup fun χ ↦ weightSpace M χ by
+      refine this (Submodule.mem_map_of_mem ?_)
+      simp_rw [← LieSubmodule.mem_coeSubmodule, Finset.sup_eq_iSup,
+        LieSubmodule.iSup_coe_toSubmodule, ← Finset.sup_eq_iSup] at hz
+      exact hz
+    simp_rw [Finset.sup_eq_iSup, Submodule.map_iSup (ι := L → R), Submodule.map_iSup (ι := _ ∈ s),
+      LieSubmodule.iSup_coe_toSubmodule]
+    refine iSup₂_mono fun χ _ ↦ ?_
+    rintro - ⟨u, hu, rfl⟩
+    exact LieSubmodule.mapsTo_pow_toEndomorphism_sub_algebraMap _ hu
+
+/-- A Lie module `M` of a Lie algebra `L` is triangularizable if the endomorhpism of `M` defined by
+any `x : L` is triangularizable. -/
+class IsTriangularizable : Prop :=
+  iSup_eq_top : ∀ x, ⨆ φ, ⨆ k, (toEndomorphism R L M x).generalizedEigenspace φ k = ⊤
+
+@[simp]
+lemma iSup_weightSpaceOf_eq_top [IsTriangularizable R L M] (x : L) :
+    ⨆ (φ : R), weightSpaceOf M φ x = ⊤ := by
+  rw [← LieSubmodule.coe_toSubmodule_eq_iff, LieSubmodule.iSup_coe_toSubmodule,
+    LieSubmodule.top_coeSubmodule]
+  exact IsTriangularizable.iSup_eq_top x
+
+section field
+
+open FiniteDimensional
+
+variable (K)
+variable [Field K] [LieAlgebra K L] [Module K M] [LieModule K L M] [LieAlgebra.IsNilpotent K L]
+  [FiniteDimensional K M]
+
+instance instIsTriangularizableOfIsAlgClosed [IsAlgClosed K] : IsTriangularizable K L M :=
+  ⟨fun _ ↦ Module.End.iSup_generalizedEigenspace_eq_top _⟩
+
+instance (N : LieSubmodule K L M) [IsTriangularizable K L M] : IsTriangularizable K L N := by
+  refine ⟨fun y ↦ ?_⟩
+  rw [← N.toEndomorphism_restrict_eq_toEndomorphism y]
+  exact Module.End.iSup_generalizedEigenspace_restrict_eq_top _ (IsTriangularizable.iSup_eq_top y)
+
+lemma iSup_weightSpace_eq_top [IsTriangularizable K L M] :
+    ⨆ χ : L → K, weightSpace M χ = ⊤ := by
+  clear! R -- cf https://github.com/leanprover/lean4/issues/2452
+  induction' h_dim : finrank K M using Nat.strong_induction_on with n ih generalizing M
+  obtain h' | ⟨y : L, hy : ¬ ∃ φ, weightSpaceOf M φ y = ⊤⟩ :=
+    forall_or_exists_not (fun (x : L) ↦ ∃ (φ : K), weightSpaceOf M φ x = ⊤)
+  · choose χ hχ using h'
+    replace hχ : weightSpace M χ = ⊤ := by simpa only [weightSpace, hχ] using iInf_top
+    exact eq_top_iff.mpr <| hχ ▸ le_iSup (weightSpace M) χ
+  · replace hy : ∀ φ, finrank K (weightSpaceOf M φ y) < n := fun φ ↦ by
+      simp_rw [not_exists, ← lt_top_iff_ne_top] at hy; exact h_dim ▸ Submodule.finrank_lt (hy φ)
+    replace ih : ∀ φ, ⨆ χ : L → K, weightSpace (weightSpaceOf M φ y) χ = ⊤ :=
+      fun φ ↦ ih _ (hy φ) (weightSpaceOf M φ y) rfl
+    replace ih : ∀ φ, ⨆ (χ : L → K) (_ : χ y = φ), weightSpace (weightSpaceOf M φ y) χ = ⊤ := by
+      intro φ
+      suffices ∀ χ : L → K, χ y ≠ φ → weightSpace (weightSpaceOf M φ y) χ = ⊥ by
+        specialize ih φ; rw [iSup_split, biSup_congr this] at ih; simpa using ih
+      intro χ hχ
+      rw [eq_bot_iff, ← (weightSpaceOf M φ y).ker_incl, LieModuleHom.ker,
+        ← LieSubmodule.map_le_iff_le_comap, map_weightSpace_eq_of_injective
+        (weightSpaceOf M φ y).injective_incl, LieSubmodule.range_incl, ← disjoint_iff_inf_le]
+      exact (disjoint_weightSpaceOf K L M hχ).mono_left (weightSpace_le_weightSpaceOf M y χ)
+    replace ih : ∀ φ, ⨆ (χ : L → K) (_ : χ y = φ), weightSpace M χ = weightSpaceOf M φ y := by
+      intro φ
+      have : ∀ (χ : L → K) (_ : χ y = φ), weightSpace M χ =
+          (weightSpace (weightSpaceOf M φ y) χ).map (weightSpaceOf M φ y).incl := fun χ hχ ↦ by
+        rw [← hχ, weightSpace_weightSpaceOf_map_incl]
+      simp_rw [biSup_congr this, ← LieSubmodule.map_iSup, ih, LieModuleHom.map_top,
+        LieSubmodule.range_incl]
+    simpa only [←ih, iSup_comm (ι := K), iSup_iSup_eq_right] using iSup_weightSpaceOf_eq_top K L M y
+
+end field
+
 end LieModule
feat(Data.Finset.Antidiagonal): generalize Finset.Nat.antidiagonal (#7486)

We define a type class Finset.HasAntidiagonal A which contains a function antidiagonal : A → Finset (A × A) such that antidiagonal n is the Finset of all pairs adding to n, as witnessed by mem_antidiagonal.

When A is a canonically ordered add monoid with locally finite order this typeclass can be instantiated with Finset.antidiagonalOfLocallyFinite. This applies in particular when A is , more generally or σ →₀ ℕ, or even ι →₀ A under the additional assumption OrderedSub A that make it a canonically ordered add monoid. (In fact, we would just need an AddMonoid with a compatible order, finite Iic, such that if a + b = n, then a, b ≤ n, and any finiteness condition would be OK.)

For computational reasons it is better to manually provide instances for and σ →₀ ℕ, to avoid quadratic runtime performance. These instances are provided as Finset.Nat.instHasAntidiagonal and Finsupp.instHasAntidiagonal. This is why Finset.antidiagonalOfLocallyFinite is an abbrev and not an instance.

This definition does not exactly match with that of Multiset.antidiagonal defined in Mathlib.Data.Multiset.Antidiagonal, because of the multiplicities. Indeed, by counting multiplicities, Multiset α is equivalent to α →₀ ℕ, but Finset.antidiagonal and Multiset.antidiagonal will return different objects. For example, for s : Multiset ℕ := {0,0,0}, Multiset.antidiagonal s has 8 elements but Finset.antidiagonal s has only 4.

def s : Multiset ℕ := {0, 0, 0}
#eval (Finset.antidiagonal s).card -- 4
#eval Multiset.card (Multiset.antidiagonal s) -- 8

TODO

  • Define HasMulAntidiagonal (for monoids). For PNat, we will recover the set of divisors of a strictly positive integer.

This closes #7917

Co-authored by: María Inés de Frutos-Fernández <mariaines.dff@gmail.com> and Eric Wieser <efw27@cam.ac.uk>

Co-authored-by: Antoine Chambert-Loir <antoine.chambert-loir@math.univ-paris-diderot.fr> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -124,7 +124,7 @@ protected theorem weight_vector_multiplication (M₁ M₂ M₃ : Type*)
   -- Eliminate the binomial coefficients from the picture.
   suffices (f₁ ^ i * f₂ ^ j) (m₁ ⊗ₜ m₂) = 0 by rw [this]; apply smul_zero
   -- Finish off with appropriate case analysis.
-  cases' Nat.le_or_le_of_add_eq_add_pred (Finset.Nat.mem_antidiagonal.mp hij) with hi hj
+  cases' Nat.le_or_le_of_add_eq_add_pred (Finset.mem_antidiagonal.mp hij) with hi hj
   · rw [(hf_comm.pow_pow i j).eq, LinearMap.mul_apply, LinearMap.pow_map_zero_of_le hi hf₁,
       LinearMap.map_zero]
   · rw [LinearMap.mul_apply, LinearMap.pow_map_zero_of_le hj hf₂, LinearMap.map_zero]
feat: have notation3 use elaborator when generating matchers, add support for pi/lambda (#6833)

notation3 was generating matchers directly from syntax, which included a half-baked implementation of a term elaborator. This switches to elaborating the term and then generating matchers from the elaborated term. This

  1. is more robust and consistent, since it uses the main elaborator and one can make use of other notations
  2. has the nice side effect of adding term info to expansions in the notation3 command
  3. can unfortunately generate matchers that are more restrictive than before since they also match against elaborated features such as implicit arguments.

We now also generate matchers for expansions that have pi types and lambda expressions.

Diff
@@ -55,8 +55,7 @@ open scoped BigOperators TensorProduct
 section notation_weight_space_of
 
 /-- Until we define `LieModule.weightSpaceOf`, it is useful to have some notation as follows: -/
-local notation3 (prettyPrint := false) "𝕎("M"," χ"," x")" =>
-  (toEndomorphism R L M x).maximalGeneralizedEigenspace χ
+local notation3 "𝕎("M", " χ", " x")" => (toEndomorphism R L M x).maximalGeneralizedEigenspace χ
 
 /-- See also `bourbaki1975b` Chapter VII §1.1, Proposition 2 (ii). -/
 protected theorem weight_vector_multiplication (M₁ M₂ M₃ : Type*)
feat: Fitting decomposition of a representation of a nilpotent Lie algebra (#7556)
Diff
@@ -6,9 +6,7 @@ Authors: Oliver Nash
 import Mathlib.Algebra.Ring.Divisibility.Lemmas
 import Mathlib.Algebra.Lie.Nilpotent
 import Mathlib.Algebra.Lie.TensorProduct
-import Mathlib.Algebra.Lie.Character
 import Mathlib.Algebra.Lie.Engel
-import Mathlib.Algebra.Lie.CartanSubalgebra
 import Mathlib.LinearAlgebra.Eigenspace.Basic
 import Mathlib.LinearAlgebra.TensorProduct.Tower
 import Mathlib.RingTheory.Artinian
@@ -16,7 +14,7 @@ import Mathlib.RingTheory.Artinian
 #align_import algebra.lie.weights from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
 
 /-!
-# Weights and roots of Lie modules and Lie algebras
+# Weight spaces of Lie modules of nilpotent Lie algebras
 
 Just as a key tool when studying the behaviour of a linear operator is to decompose the space on
 which it acts into a sum of (generalised) eigenspaces, a key tool when studying a representation `M`
@@ -24,10 +22,6 @@ of Lie algebra `L` is to decompose `M` into a sum of simultaneous eigenspaces of
 over `L`. These simultaneous generalised eigenspaces are known as the weight spaces of `M`.
 
 When `L` is nilpotent, it follows from the binomial theorem that weight spaces are Lie submodules.
-Even when `L` is not nilpotent, it may be useful to study its representations by restricting them
-to a nilpotent subalgebra (e.g., a Cartan subalgebra). In the particular case when we view `L` as a
-module over itself via the adjoint action, the weight spaces of `L` restricted to a nilpotent
-subalgebra are known as root spaces.
 
 Basic definitions and properties of the above ideas are provided in this file.
 
@@ -35,12 +29,11 @@ Basic definitions and properties of the above ideas are provided in this file.
 
   * `LieModule.weightSpaceOf`
   * `LieModule.weightSpace`
-  * `LieModule.IsWeight`
-  * `LieAlgebra.rootSpace`
-  * `LieAlgebra.IsRoot`
-  * `LieAlgebra.rootSpaceWeightSpaceProduct`
-  * `LieAlgebra.rootSpaceProduct`
-  * `LieAlgebra.zeroRootSubalgebra_eq_iff_is_cartan`
+  * `LieModule.posFittingCompOf`
+  * `LieModule.posFittingComp`
+  * `LieModule.iSup_ucs_eq_weightSpace_zero`
+  * `LieModule.iInf_lowerCentralSeries_eq_posFittingComp`
+  * `LieModule.isCompl_weightSpace_zero_posFittingComp`
 
 ## References
 
@@ -51,11 +44,8 @@ Basic definitions and properties of the above ideas are provided in this file.
 lie character, eigenvalue, eigenspace, weight, weight vector, root, root vector
 -/
 
-universe u v w w₁ w₂ w₃
-
-variable {R : Type u} {L : Type v} [CommRing R] [LieRing L] [LieAlgebra R L]
-  (H : LieSubalgebra R L) [LieAlgebra.IsNilpotent R H]
-  {M : Type w} [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
+variable {R L M : Type*} [CommRing R] [LieRing L] [LieAlgebra R L] [LieAlgebra.IsNilpotent R L]
+  [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
 
 namespace LieModule
 
@@ -69,7 +59,7 @@ local notation3 (prettyPrint := false) "𝕎("M"," χ"," x")" =>
   (toEndomorphism R L M x).maximalGeneralizedEigenspace χ
 
 /-- See also `bourbaki1975b` Chapter VII §1.1, Proposition 2 (ii). -/
-protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w₂) (M₃ : Type w₃)
+protected theorem weight_vector_multiplication (M₁ M₂ M₃ : Type*)
     [AddCommGroup M₁] [Module R M₁] [LieRingModule L M₁] [LieModule R L M₁] [AddCommGroup M₂]
     [Module R M₂] [LieRingModule L M₂] [LieModule R L M₂] [AddCommGroup M₃] [Module R M₃]
     [LieRingModule L M₃] [LieModule R L M₃] (g : M₁ ⊗[R] M₂ →ₗ⁅R,L⁆ M₃) (χ₁ χ₂ : R) (x : L) :
@@ -155,7 +145,7 @@ variable (M)
 `weightSpaceOf M χ x` is the maximal generalized `χ`-eigenspace of the action of `x` on `M`.
 
 It is a Lie submodule because `L` is nilpotent. -/
-def weightSpaceOf [LieAlgebra.IsNilpotent R L] (χ : R) (x : L) : LieSubmodule R L M :=
+def weightSpaceOf (χ : R) (x : L) : LieSubmodule R L M :=
   { 𝕎(M, χ, x) with
     lie_mem := by
       intro y m hm
@@ -164,35 +154,39 @@ def weightSpaceOf [LieAlgebra.IsNilpotent R L] (χ : R) (x : L) : LieSubmodule R
       rw [← zero_add χ]
       exact lie_mem_maxGenEigenspace_toEndomorphism (by simp) hm }
 
-theorem mem_weightSpaceOf [LieAlgebra.IsNilpotent R L] (χ : R) (x : L) (m : M) :
-    m ∈ weightSpaceOf M χ x ↔ ∃ k : ℕ, ((toEndomorphism R L M x - χ • ↑1) ^ k) m = 0 := by
-  simp [weightSpaceOf]
-
 end notation_weight_space_of
 
 variable (M)
 
+theorem mem_weightSpaceOf (χ : R) (x : L) (m : M) :
+    m ∈ weightSpaceOf M χ x ↔ ∃ k : ℕ, ((toEndomorphism R L M x - χ • ↑1) ^ k) m = 0 := by
+  simp [weightSpaceOf]
+
+theorem coe_weightSpaceOf_zero (x : L) :
+    ↑(weightSpaceOf M (0 : R) x) = ⨆ k, LinearMap.ker (toEndomorphism R L M x ^ k) := by
+  simp [weightSpaceOf, Module.End.maximalGeneralizedEigenspace]
+
 /-- If `M` is a representation of a nilpotent Lie algebra `L` and `χ : L → R` is a family of
 scalars, then `weightSpace M χ` is the intersection of the maximal generalized `χ x`-eigenspaces of
 the action of `x` on `M` as `x` ranges over `L`.
 
 It is a Lie submodule because `L` is nilpotent. -/
-def weightSpace [LieAlgebra.IsNilpotent R L] (χ : L → R) : LieSubmodule R L M :=
+def weightSpace (χ : L → R) : LieSubmodule R L M :=
   ⨅ x, weightSpaceOf M (χ x) x
 
-theorem mem_weightSpace [LieAlgebra.IsNilpotent R L] (χ : L → R) (m : M) :
+theorem mem_weightSpace (χ : L → R) (m : M) :
     m ∈ weightSpace M χ ↔ ∀ x, ∃ k : ℕ, ((toEndomorphism R L M x - χ x • ↑1) ^ k) m = 0 := by
   simp [weightSpace, mem_weightSpaceOf]
 
 /-- See also the more useful form `LieModule.zero_weightSpace_eq_top_of_nilpotent`. -/
 @[simp]
-theorem zero_weightSpace_eq_top_of_nilpotent' [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
+theorem zero_weightSpace_eq_top_of_nilpotent' [IsNilpotent R L M] :
     weightSpace M (0 : L → R) = ⊤ := by
   ext
   simp [weightSpace, weightSpaceOf]
 #align lie_module.zero_weight_space_eq_top_of_nilpotent' LieModule.zero_weightSpace_eq_top_of_nilpotent'
 
-theorem coe_weightSpace_of_top [LieAlgebra.IsNilpotent R L] (χ : L → R) :
+theorem coe_weightSpace_of_top (χ : L → R) :
     (weightSpace M (χ ∘ (⊤ : LieSubalgebra R L).incl) : Submodule R M) = weightSpace M χ := by
   ext m
   simp only [mem_weightSpace, LieSubmodule.mem_coeSubmodule, Subtype.forall]
@@ -201,7 +195,7 @@ theorem coe_weightSpace_of_top [LieAlgebra.IsNilpotent R L] (χ : L → R) :
 #align lie_module.coe_weight_space_of_top LieModule.coe_weightSpace_of_top
 
 @[simp]
-theorem zero_weightSpace_eq_top_of_nilpotent [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
+theorem zero_weightSpace_eq_top_of_nilpotent [IsNilpotent R L M] :
     weightSpace M (0 : (⊤ : LieSubalgebra R L) → R) = ⊤ := by
   ext m
   simp only [mem_weightSpace, Pi.zero_apply, zero_smul, sub_zero, Subtype.forall, forall_true_left,
@@ -211,22 +205,9 @@ theorem zero_weightSpace_eq_top_of_nilpotent [LieAlgebra.IsNilpotent R L] [IsNil
   exact ⟨k, by simp [hk x]⟩
 #align lie_module.zero_weight_space_eq_top_of_nilpotent LieModule.zero_weightSpace_eq_top_of_nilpotent
 
-/-- Given a Lie module `M` of a Lie algebra `L`, a weight of `M` with respect to a nilpotent
-subalgebra `H ⊆ L` is a Lie character whose corresponding weight space is non-empty. -/
-def IsWeight (χ : LieCharacter R H) : Prop :=
-  weightSpace M χ ≠ ⊥
-#align lie_module.is_weight LieModule.IsWeight
-
-/-- For a non-trivial nilpotent Lie module over a nilpotent Lie algebra, the zero character is a
-weight with respect to the `⊤` Lie subalgebra. -/
-theorem isWeight_zero_of_nilpotent [Nontrivial M] [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
-    IsWeight (⊤ : LieSubalgebra R L) M 0 := by
-  rw [IsWeight, LieHom.coe_zero, zero_weightSpace_eq_top_of_nilpotent]; exact top_ne_bot
-#align lie_module.is_weight_zero_of_nilpotent LieModule.isWeight_zero_of_nilpotent
-
 variable (R) in
 theorem exists_weightSpace_zero_le_ker_of_isNoetherian
-    [LieAlgebra.IsNilpotent R L] [IsNoetherian R M] (x : L) :
+    [IsNoetherian R M] (x : L) :
     ∃ k : ℕ, weightSpace M (0 : L → R) ≤ LinearMap.ker (toEndomorphism R L M x ^ k) := by
   use (toEndomorphism R L M x).maximalGeneralizedEigenspaceIndex 0
   simp only [weightSpace, weightSpaceOf, LieSubmodule.iInf_coe_toSubmodule, Pi.zero_apply, iInf_le,
@@ -235,7 +216,7 @@ theorem exists_weightSpace_zero_le_ker_of_isNoetherian
 
 /-- A (nilpotent) Lie algebra acts nilpotently on the zero weight space of a Noetherian Lie
 module. -/
-theorem isNilpotent_toEndomorphism_weightSpace_zero [LieAlgebra.IsNilpotent R L] [IsNoetherian R M]
+theorem isNilpotent_toEndomorphism_weightSpace_zero [IsNoetherian R M]
     (x : L) : _root_.IsNilpotent <| toEndomorphism R L (weightSpace M (0 : L → R)) x := by
   obtain ⟨k, hk⟩ := exists_weightSpace_zero_le_ker_of_isNoetherian R M x
   use k
@@ -247,14 +228,14 @@ theorem isNilpotent_toEndomorphism_weightSpace_zero [LieAlgebra.IsNilpotent R L]
 #align lie_module.is_nilpotent_to_endomorphism_weight_space_zero LieModule.isNilpotent_toEndomorphism_weightSpace_zero
 
 /-- By Engel's theorem, the zero weight space of a Noetherian Lie module is nilpotent. -/
-instance [LieAlgebra.IsNilpotent R L] [IsNoetherian R M] :
+instance [IsNoetherian R M] :
     IsNilpotent R L (weightSpace M (0 : L → R)) :=
   isNilpotent_iff_forall'.mpr <| isNilpotent_toEndomorphism_weightSpace_zero M
 
 variable (R L)
 
 @[simp]
-lemma weightSpace_zero_normalizer_eq_self [LieAlgebra.IsNilpotent R L] :
+lemma weightSpace_zero_normalizer_eq_self :
     (weightSpace M (0 : L → R)).normalizer = weightSpace M 0 := by
   refine' le_antisymm _ (LieSubmodule.le_normalizer _)
   intro m hm
@@ -265,12 +246,12 @@ lemma weightSpace_zero_normalizer_eq_self [LieAlgebra.IsNilpotent R L] :
   use k + 1
   simpa [pow_succ', LinearMap.mul_eq_comp]
 
-lemma iSup_ucs_le_weightSpace_zero [LieAlgebra.IsNilpotent R L] :
+lemma iSup_ucs_le_weightSpace_zero :
     ⨆ k, (⊥ : LieSubmodule R L M).ucs k ≤ weightSpace M (0 : L → R) := by
   simpa using LieSubmodule.ucs_le_of_normalizer_eq_self (weightSpace_zero_normalizer_eq_self R L M)
 
 /-- See also `LieModule.iInf_lowerCentralSeries_eq_posFittingComp`. -/
-lemma iSup_ucs_eq_weightSpace_zero [LieAlgebra.IsNilpotent R L] [IsNoetherian R M] :
+lemma iSup_ucs_eq_weightSpace_zero [IsNoetherian R M] :
     ⨆ k, (⊥ : LieSubmodule R L M).ucs k = weightSpace M (0 : L → R) := by
   obtain ⟨k, hk⟩ := (LieSubmodule.isNilpotent_iff_exists_self_le_ucs
     <| weightSpace M (0 : L → R)).mp inferInstance
@@ -287,7 +268,7 @@ the "positive Fitting component" because with appropriate assumptions (e.g., `R`
 `M₀ = weightSpaceOf M 0 x` and `M₁ = posFittingCompOf R M x`.
 
 It is a Lie submodule because `L` is nilpotent. -/
-def posFittingCompOf [LieAlgebra.IsNilpotent R L] (x : L) : LieSubmodule R L M :=
+def posFittingCompOf (x : L) : LieSubmodule R L M :=
   { toSubmodule := ⨅ k, LinearMap.range (toEndomorphism R L M x ^ k)
     lie_mem := by
       set φ := toEndomorphism R L M x
@@ -309,11 +290,11 @@ def posFittingCompOf [LieAlgebra.IsNilpotent R L] (x : L) : LieSubmodule R L M :
         ← LinearMap.comp_apply (g := q), ← LinearMap.mul_eq_comp, ← hq] }
 
 variable {M} in
-lemma mem_posFittingCompOf [LieAlgebra.IsNilpotent R L] (x : L) (m : M) :
+lemma mem_posFittingCompOf (x : L) (m : M) :
     m ∈ posFittingCompOf R M x ↔ ∀ (k : ℕ), ∃ n, (toEndomorphism R L M x ^ k) n = m := by
   simp [posFittingCompOf]
 
-@[simp] lemma posFittingCompOf_le_lowerCentralSeries [LieAlgebra.IsNilpotent R L] (x : L) (k : ℕ) :
+@[simp] lemma posFittingCompOf_le_lowerCentralSeries (x : L) (k : ℕ) :
     posFittingCompOf R M x ≤ lowerCentralSeries R L M k := by
   suffices : ∀ m l, (toEndomorphism R L M x ^ l) m ∈ lowerCentralSeries R L M l
   · intro m hm
@@ -325,7 +306,7 @@ lemma mem_posFittingCompOf [LieAlgebra.IsNilpotent R L] (x : L) (m : M) :
   exact LieSubmodule.lie_mem_lie _ ⊤ (LieSubmodule.mem_top x) ih
 
 @[simp] lemma posFittingCompOf_eq_bot_of_isNilpotent
-    [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] (x : L) :
+    [IsNilpotent R L M] (x : L) :
     posFittingCompOf R M x = ⊥ := by
   simp_rw [eq_bot_iff, ← iInf_lowerCentralSeries_eq_bot_of_isNilpotent, le_iInf_iff,
     posFittingCompOf_le_lowerCentralSeries, forall_const]
@@ -337,24 +318,24 @@ variable (L)
 as `x` ranges over `L`.
 
 It is a Lie submodule because `L` is nilpotent. -/
-def posFittingComp [LieAlgebra.IsNilpotent R L] : LieSubmodule R L M :=
+def posFittingComp : LieSubmodule R L M :=
   ⨆ x, posFittingCompOf R M x
 
-lemma mem_posFittingComp [LieAlgebra.IsNilpotent R L] (m : M) :
+lemma mem_posFittingComp (m : M) :
     m ∈ posFittingComp R L M ↔ m ∈ ⨆ (x : L), posFittingCompOf R M x := by
   rfl
 
-lemma posFittingCompOf_le_posFittingComp [LieAlgebra.IsNilpotent R L] (x : L) :
+lemma posFittingCompOf_le_posFittingComp (x : L) :
     posFittingCompOf R M x ≤ posFittingComp R L M := by
   rw [posFittingComp]; exact le_iSup (posFittingCompOf R M) x
 
-lemma posFittingComp_le_iInf_lowerCentralSeries [LieAlgebra.IsNilpotent R L] :
+lemma posFittingComp_le_iInf_lowerCentralSeries :
     posFittingComp R L M ≤ ⨅ k, lowerCentralSeries R L M k := by
   simp [posFittingComp]
 
 /-- See also `LieModule.iSup_ucs_eq_weightSpace_zero`. -/
 @[simp] lemma iInf_lowerCentralSeries_eq_posFittingComp
-    [LieAlgebra.IsNilpotent R L] [IsNoetherian R M] [IsArtinian R M] :
+    [IsNoetherian R M] [IsArtinian R M] :
     ⨅ k, lowerCentralSeries R L M k = posFittingComp R L M := by
   refine le_antisymm ?_ (posFittingComp_le_iInf_lowerCentralSeries R L M)
   apply iInf_lcs_le_of_isNilpotent_quot
@@ -375,228 +356,154 @@ lemma posFittingComp_le_iInf_lowerCentralSeries [LieAlgebra.IsNilpotent R L] :
   simpa using this
 
 @[simp] lemma posFittingComp_eq_bot_of_isNilpotent
-    [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
+    [IsNilpotent R L M] :
     posFittingComp R L M = ⊥ := by
   simp [posFittingComp]
 
-end LieModule
-
-namespace LieAlgebra
-
-open scoped TensorProduct
-open TensorProduct.LieModule LieModule
-
-/-- Given a nilpotent Lie subalgebra `H ⊆ L`, the root space of a map `χ : H → R` is the weight
-space of `L` regarded as a module of `H` via the adjoint action. -/
-abbrev rootSpace (χ : H → R) : LieSubmodule R H L :=
-  weightSpace L χ
-#align lie_algebra.root_space LieAlgebra.rootSpace
-
-theorem zero_rootSpace_eq_top_of_nilpotent [IsNilpotent R L] :
-    rootSpace (⊤ : LieSubalgebra R L) 0 = ⊤ :=
-  zero_weightSpace_eq_top_of_nilpotent L
-#align lie_algebra.zero_root_space_eq_top_of_nilpotent LieAlgebra.zero_rootSpace_eq_top_of_nilpotent
-
-/-- A root of a Lie algebra `L` with respect to a nilpotent subalgebra `H ⊆ L` is a weight of `L`,
-regarded as a module of `H` via the adjoint action. -/
-abbrev IsRoot (χ : LieCharacter R H) :=
-  χ ≠ 0 ∧ IsWeight H L χ
-#align lie_algebra.is_root LieAlgebra.IsRoot
-
-@[simp]
-theorem rootSpace_comap_eq_weightSpace (χ : H → R) :
-    (rootSpace H χ).comap H.incl' = weightSpace H χ := by
-  ext x
-  let f : H → Module.End R L := fun y => toEndomorphism R H L y - χ y • ↑1
-  let g : H → Module.End R H := fun y => toEndomorphism R H H y - χ y • ↑1
-  suffices
-    (∀ y : H, ∃ k : ℕ, (f y ^ k).comp (H.incl : H →ₗ[R] L) x = 0) ↔
-      ∀ y : H, ∃ k : ℕ, (H.incl : H →ₗ[R] L).comp (g y ^ k) x = 0 by
-    simp only [LieHom.coe_toLinearMap, LieSubalgebra.coe_incl, Function.comp_apply,
-      LinearMap.coe_comp, Submodule.coe_eq_zero] at this
-    simp only [mem_weightSpace, LieSubalgebra.coe_incl', LieSubmodule.mem_comap, this]
-  have hfg : ∀ y : H, (f y).comp (H.incl : H →ₗ[R] L) = (H.incl : H →ₗ[R] L).comp (g y) := by
-    rintro ⟨y, hy⟩; ext ⟨z, _⟩
-    simp only [Submodule.coe_sub, toEndomorphism_apply_apply, LieHom.coe_toLinearMap,
-      LinearMap.one_apply, LieSubalgebra.coe_incl, LieSubalgebra.coe_bracket_of_module,
-      LieSubalgebra.coe_bracket, LinearMap.smul_apply, Function.comp_apply,
-      Submodule.coe_smul_of_tower, LinearMap.coe_comp, LinearMap.sub_apply]
-  simp_rw [LinearMap.commute_pow_left_of_commute (hfg _)]
-#align lie_algebra.root_space_comap_eq_weight_space LieAlgebra.rootSpace_comap_eq_weightSpace
-
-variable {H}
-
-theorem lie_mem_weightSpace_of_mem_weightSpace {χ₁ χ₂ : H → R} {x : L} {m : M}
-    (hx : x ∈ rootSpace H χ₁) (hm : m ∈ weightSpace M χ₂) : ⁅x, m⁆ ∈ weightSpace M (χ₁ + χ₂) := by
-  rw [weightSpace, LieSubmodule.mem_iInf]
-  intro y
-  replace hx : x ∈ weightSpaceOf L (χ₁ y) y := by
-    rw [rootSpace, weightSpace, LieSubmodule.mem_iInf] at hx; exact hx y
-  replace hm : m ∈ weightSpaceOf M (χ₂ y) y := by
-    rw [weightSpace, LieSubmodule.mem_iInf] at hm; exact hm y
-  exact lie_mem_maxGenEigenspace_toEndomorphism hx hm
-#align lie_algebra.lie_mem_weight_space_of_mem_weight_space LieAlgebra.lie_mem_weightSpace_of_mem_weightSpace
-
-variable (R L H M)
-
-/-- Auxiliary definition for `rootSpaceWeightSpaceProduct`,
-which is close to the deterministic timeout limit.
--/
-def rootSpaceWeightSpaceProductAux {χ₁ χ₂ χ₃ : H → R} (hχ : χ₁ + χ₂ = χ₃) :
-    rootSpace H χ₁ →ₗ[R] weightSpace M χ₂ →ₗ[R] weightSpace M χ₃ where
-  toFun x :=
-    { toFun := fun m =>
-        ⟨⁅(x : L), (m : M)⁆, hχ ▸ lie_mem_weightSpace_of_mem_weightSpace x.property m.property⟩
-      map_add' := fun m n => by simp only [LieSubmodule.coe_add, lie_add]; rfl
-      map_smul' := fun t m => by
-        dsimp only
-        conv_lhs =>
-          congr
-          rw [LieSubmodule.coe_smul, lie_smul] }
-  map_add' x y := by
-    ext m
-    simp only [AddSubmonoid.coe_add, Submodule.coe_toAddSubmonoid, add_lie, LinearMap.coe_mk,
-      AddHom.coe_mk, LinearMap.add_apply, AddSubmonoid.mk_add_mk]
-  map_smul' t x := by
-    simp only [RingHom.id_apply]
-    ext m
-    simp only [SetLike.val_smul, smul_lie, LinearMap.coe_mk, AddHom.coe_mk, LinearMap.smul_apply,
-      SetLike.mk_smul_mk]
-#align lie_algebra.root_space_weight_space_product_aux LieAlgebra.rootSpaceWeightSpaceProductAux
-
-suppress_compilation
-
--- Porting note: this def is _really_ slow
--- See https://github.com/leanprover-community/mathlib4/issues/5028
-/-- Given a nilpotent Lie subalgebra `H ⊆ L` together with `χ₁ χ₂ : H → R`, there is a natural
-`R`-bilinear product of root vectors and weight vectors, compatible with the actions of `H`. -/
-def rootSpaceWeightSpaceProduct (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ₂ = χ₃) :
-    rootSpace H χ₁ ⊗[R] weightSpace M χ₂ →ₗ⁅R,H⁆ weightSpace M χ₃ :=
-  liftLie R H (rootSpace H χ₁) (weightSpace M χ₂) (weightSpace M χ₃)
-    { toLinearMap := rootSpaceWeightSpaceProductAux R L H M hχ
-      map_lie' := fun {x y} => by
-        ext m
-        simp only [rootSpaceWeightSpaceProductAux, LieSubmodule.coe_bracket,
-          LieSubalgebra.coe_bracket_of_module, lie_lie, LinearMap.coe_mk, AddHom.coe_mk,
-          Subtype.coe_mk, LieHom.lie_apply, LieSubmodule.coe_sub] }
-#align lie_algebra.root_space_weight_space_product LieAlgebra.rootSpaceWeightSpaceProduct
-
-@[simp]
-theorem coe_rootSpaceWeightSpaceProduct_tmul (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ₂ = χ₃)
-    (x : rootSpace H χ₁) (m : weightSpace M χ₂) :
-    (rootSpaceWeightSpaceProduct R L H M χ₁ χ₂ χ₃ hχ (x ⊗ₜ m) : M) = ⁅(x : L), (m : M)⁆ := by
-  simp only [rootSpaceWeightSpaceProduct, rootSpaceWeightSpaceProductAux, coe_liftLie_eq_lift_coe,
-    AddHom.toFun_eq_coe, LinearMap.coe_toAddHom, lift_apply, LinearMap.coe_mk, AddHom.coe_mk,
-    Submodule.coe_mk]
-#align lie_algebra.coe_root_space_weight_space_product_tmul LieAlgebra.coe_rootSpaceWeightSpaceProduct_tmul
-
-/-- Given a nilpotent Lie subalgebra `H ⊆ L` together with `χ₁ χ₂ : H → R`, there is a natural
-`R`-bilinear product of root vectors, compatible with the actions of `H`. -/
-def rootSpaceProduct (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ₂ = χ₃) :
-    rootSpace H χ₁ ⊗[R] rootSpace H χ₂ →ₗ⁅R,H⁆ rootSpace H χ₃ :=
-  rootSpaceWeightSpaceProduct R L H L χ₁ χ₂ χ₃ hχ
-#align lie_algebra.root_space_product LieAlgebra.rootSpaceProduct
-
-@[simp]
-theorem rootSpaceProduct_def : rootSpaceProduct R L H = rootSpaceWeightSpaceProduct R L H L := rfl
-#align lie_algebra.root_space_product_def LieAlgebra.rootSpaceProduct_def
-
-theorem rootSpaceProduct_tmul (χ₁ χ₂ χ₃ : H → R) (hχ : χ₁ + χ₂ = χ₃) (x : rootSpace H χ₁)
-    (y : rootSpace H χ₂) : (rootSpaceProduct R L H χ₁ χ₂ χ₃ hχ (x ⊗ₜ y) : L) = ⁅(x : L), (y : L)⁆ :=
-  by simp only [rootSpaceProduct_def, coe_rootSpaceWeightSpaceProduct_tmul]
-#align lie_algebra.root_space_product_tmul LieAlgebra.rootSpaceProduct_tmul
-
-/-- Given a nilpotent Lie subalgebra `H ⊆ L`, the root space of the zero map `0 : H → R` is a Lie
-subalgebra of `L`. -/
-def zeroRootSubalgebra : LieSubalgebra R L :=
-  { (rootSpace H 0 : Submodule R L) with
-    lie_mem' := fun {x y hx hy} => by
-      let xy : rootSpace H 0 ⊗[R] rootSpace H 0 := ⟨x, hx⟩ ⊗ₜ ⟨y, hy⟩
-      suffices (rootSpaceProduct R L H 0 0 0 (add_zero 0) xy : L) ∈ rootSpace H 0 by
-        rwa [rootSpaceProduct_tmul, Subtype.coe_mk, Subtype.coe_mk] at this
-      exact (rootSpaceProduct R L H 0 0 0 (add_zero 0) xy).property }
-#align lie_algebra.zero_root_subalgebra LieAlgebra.zeroRootSubalgebra
-
-@[simp]
-theorem coe_zeroRootSubalgebra : (zeroRootSubalgebra R L H : Submodule R L) = rootSpace H 0 := rfl
-#align lie_algebra.coe_zero_root_subalgebra LieAlgebra.coe_zeroRootSubalgebra
-
-theorem mem_zeroRootSubalgebra (x : L) :
-    x ∈ zeroRootSubalgebra R L H ↔ ∀ y : H, ∃ k : ℕ, (toEndomorphism R H L y ^ k) x = 0 := by
-  change x ∈ rootSpace H 0 ↔ _
-  simp only [mem_weightSpace, Pi.zero_apply, zero_smul, sub_zero]
-#align lie_algebra.mem_zero_root_subalgebra LieAlgebra.mem_zeroRootSubalgebra
-
-theorem toLieSubmodule_le_rootSpace_zero : H.toLieSubmodule ≤ rootSpace H 0 := by
-  intro x hx
-  simp only [LieSubalgebra.mem_toLieSubmodule] at hx
-  simp only [mem_weightSpace, Pi.zero_apply, sub_zero, zero_smul]
-  intro y
-  obtain ⟨k, hk⟩ := (inferInstance : IsNilpotent R H)
-  use k
-  let f : Module.End R H := toEndomorphism R H H y
-  let g : Module.End R L := toEndomorphism R H L y
-  have hfg : g.comp (H : Submodule R L).subtype = (H : Submodule R L).subtype.comp f := by
-    ext z
-    simp only [toEndomorphism_apply_apply, Submodule.subtype_apply,
-      LieSubalgebra.coe_bracket_of_module, LieSubalgebra.coe_bracket, Function.comp_apply,
-      LinearMap.coe_comp]
-    rfl
-  change (g ^ k).comp (H : Submodule R L).subtype ⟨x, hx⟩ = 0
-  rw [LinearMap.commute_pow_left_of_commute hfg k]
-  have h := iterate_toEndomorphism_mem_lowerCentralSeries R H H y ⟨x, hx⟩ k
-  rw [hk, LieSubmodule.mem_bot] at h
-  simp only [Submodule.subtype_apply, Function.comp_apply, LinearMap.pow_apply, LinearMap.coe_comp,
-    Submodule.coe_eq_zero]
-  exact h
-#align lie_algebra.to_lie_submodule_le_root_space_zero LieAlgebra.toLieSubmodule_le_rootSpace_zero
-
-theorem le_zeroRootSubalgebra : H ≤ zeroRootSubalgebra R L H := by
-  rw [← LieSubalgebra.coe_submodule_le_coe_submodule, ← H.coe_toLieSubmodule,
-    coe_zeroRootSubalgebra, LieSubmodule.coeSubmodule_le_coeSubmodule]
-  exact toLieSubmodule_le_rootSpace_zero R L H
-#align lie_algebra.le_zero_root_subalgebra LieAlgebra.le_zeroRootSubalgebra
-
-@[simp]
-theorem zeroRootSubalgebra_normalizer_eq_self :
-    (zeroRootSubalgebra R L H).normalizer = zeroRootSubalgebra R L H := by
-  refine' le_antisymm _ (LieSubalgebra.le_normalizer _)
-  intro x hx
-  rw [LieSubalgebra.mem_normalizer_iff] at hx
-  rw [mem_zeroRootSubalgebra]
-  rintro ⟨y, hy⟩
-  specialize hx y (le_zeroRootSubalgebra R L H hy)
-  rw [mem_zeroRootSubalgebra] at hx
-  obtain ⟨k, hk⟩ := hx ⟨y, hy⟩
-  rw [← lie_skew, LinearMap.map_neg, neg_eq_zero] at hk
-  use k + 1
-  rw [LinearMap.iterate_succ, LinearMap.coe_comp, Function.comp_apply, toEndomorphism_apply_apply,
-    LieSubalgebra.coe_bracket_of_module, Submodule.coe_mk, hk]
-#align lie_algebra.zero_root_subalgebra_normalizer_eq_self LieAlgebra.zeroRootSubalgebra_normalizer_eq_self
-
-/-- If the zero root subalgebra of a nilpotent Lie subalgebra `H` is just `H` then `H` is a Cartan
-subalgebra.
+section map_comap
+
+variable {R L M}
+variable
+  {M₂ : Type*} [AddCommGroup M₂] [Module R M₂] [LieRingModule L M₂] [LieModule R L M₂]
+  {χ : L → R} (f : M →ₗ⁅R,L⁆ M₂)
+
+lemma map_posFittingComp_le :
+    (posFittingComp R L M).map f ≤ posFittingComp R L M₂ := by
+  rw [posFittingComp, posFittingComp, LieSubmodule.map_iSup]
+  refine iSup_mono fun y ↦ LieSubmodule.map_le_iff_le_comap.mpr fun m hm ↦ ?_
+  simp only [mem_posFittingCompOf] at hm
+  simp only [LieSubmodule.mem_comap, mem_posFittingCompOf]
+  intro k
+  obtain ⟨n, hn⟩ := hm k
+  use f n
+  rw [LieModule.toEndomorphism_pow_apply_map, hn]
+
+lemma map_weightSpace_le :
+    (weightSpace M χ).map f ≤ weightSpace M₂ χ := by
+  rw [LieSubmodule.map_le_iff_le_comap]
+  intro m hm
+  simp only [LieSubmodule.mem_comap, mem_weightSpace]
+  intro x
+  have : (toEndomorphism R L M₂ x - χ x • ↑1) ∘ₗ f = f ∘ₗ (toEndomorphism R L M x - χ x • ↑1) := by
+    ext; simp
+  obtain ⟨k, h⟩ := (mem_weightSpace _ _ _).mp hm x
+  exact ⟨k, by simpa [h] using LinearMap.congr_fun (LinearMap.commute_pow_left_of_commute this k) m⟩
+
+variable {f}
+
+lemma comap_weightSpace_eq_of_injective (hf : Function.Injective f) :
+    (weightSpace M₂ χ).comap f = weightSpace M χ := by
+  refine le_antisymm (fun m hm ↦ ?_) ?_
+  · simp only [LieSubmodule.mem_comap, mem_weightSpace] at hm
+    simp only [mem_weightSpace]
+    intro x
+    have h : (toEndomorphism R L M₂ x - χ x • ↑1) ∘ₗ f =
+             f ∘ₗ (toEndomorphism R L M x - χ x • ↑1) := by ext; simp
+    obtain ⟨k, hk⟩ := hm x
+    use k
+    suffices : f (((toEndomorphism R L M x - χ x • ↑1) ^ k) m) = 0
+    · rw [← f.map_zero] at this; exact hf this
+    simpa [hk] using (LinearMap.congr_fun (LinearMap.commute_pow_left_of_commute h k) m).symm
+  · rw [← LieSubmodule.map_le_iff_le_comap]
+    exact map_weightSpace_le f
+
+lemma map_weightSpace_eq_of_injective (hf : Function.Injective f) :
+    (weightSpace M χ).map f = weightSpace M₂ χ ⊓ f.range := by
+  refine le_antisymm (le_inf_iff.mpr ⟨map_weightSpace_le f, LieSubmodule.map_le_range f⟩) ?_
+  rintro - ⟨hm, ⟨m, rfl⟩⟩
+  simp only [← comap_weightSpace_eq_of_injective hf, LieSubmodule.mem_map, LieSubmodule.mem_comap]
+  exact ⟨m, hm, rfl⟩
+
+lemma map_weightSpace_eq (e : M ≃ₗ⁅R,L⁆ M₂) :
+    (weightSpace M χ).map e = weightSpace M₂ χ := by
+  simp [map_weightSpace_eq_of_injective e.injective]
+
+lemma map_posFittingComp_eq (e : M ≃ₗ⁅R,L⁆ M₂) :
+    (posFittingComp R L M).map e = posFittingComp R L M₂ := by
+  refine le_antisymm (map_posFittingComp_le _) ?_
+  suffices posFittingComp R L M₂ = ((posFittingComp R L M₂).map (e.symm : M₂ →ₗ⁅R,L⁆ M)).map e by
+    rw [this]
+    exact LieSubmodule.map_mono (map_posFittingComp_le _)
+  rw [← LieSubmodule.map_comp]
+  convert LieSubmodule.map_id
+  ext
+  simp
 
-When `L` is Noetherian, it follows from Engel's theorem that the converse holds. See
-`LieAlgebra.zeroRootSubalgebra_eq_iff_is_cartan` -/
-theorem is_cartan_of_zeroRootSubalgebra_eq (h : zeroRootSubalgebra R L H = H) :
-    H.IsCartanSubalgebra :=
-  { nilpotent := inferInstance
-    self_normalizing := by rw [← h]; exact zeroRootSubalgebra_normalizer_eq_self R L H }
-#align lie_algebra.is_cartan_of_zero_root_subalgebra_eq LieAlgebra.is_cartan_of_zeroRootSubalgebra_eq
+lemma posFittingComp_map_incl_sup_of_codisjoint [IsNoetherian R M] [IsArtinian R M]
+    {N₁ N₂ : LieSubmodule R L M} (h : Codisjoint N₁ N₂) :
+    (posFittingComp R L N₁).map N₁.incl ⊔ (posFittingComp R L N₂).map N₂.incl =
+    posFittingComp R L M := by
+  obtain ⟨l, hl⟩ := Filter.eventually_atTop.mp <|
+    (eventually_iInf_lowerCentralSeries_eq R L N₁).and <|
+    (eventually_iInf_lowerCentralSeries_eq R L N₂).and
+    (eventually_iInf_lowerCentralSeries_eq R L M)
+  obtain ⟨hl₁, hl₂, hl₃⟩ := hl l (le_refl _)
+  simp_rw [← iInf_lowerCentralSeries_eq_posFittingComp, hl₁, hl₂, hl₃,
+    LieSubmodule.lowerCentralSeries_map_eq_lcs, ←LieSubmodule.lcs_sup, lowerCentralSeries, h.eq_top]
+
+end map_comap
+
+section fitting_decomposition
+
+variable [IsNoetherian R M] [IsArtinian R M]
+
+lemma isCompl_weightSpaceOf_zero_posFittingCompOf (x : L) :
+    IsCompl (weightSpaceOf M 0 x) (posFittingCompOf R M x) := by
+  simpa only [isCompl_iff, codisjoint_iff, disjoint_iff, ← LieSubmodule.coe_toSubmodule_eq_iff,
+    LieSubmodule.sup_coe_toSubmodule, LieSubmodule.inf_coe_toSubmodule,
+    LieSubmodule.top_coeSubmodule, LieSubmodule.bot_coeSubmodule, coe_weightSpaceOf_zero] using
+    (toEndomorphism R L M x).isCompl_iSup_ker_pow_iInf_range_pow
+
+/-- This lemma exists only to simplify the proof of
+`LieModule.isCompl_weightSpace_zero_posFittingComp`. -/
+private lemma isCompl_weightSpace_zero_posFittingComp_aux
+    (h : ∀ N < (⊤ : LieSubmodule R L M), IsCompl (weightSpace N 0) (posFittingComp R L N)) :
+    IsCompl (weightSpace M 0) (posFittingComp R L M) := by
+  set M₀ := weightSpace M (0 : L → R)
+  set M₁ := posFittingComp R L M
+  rcases forall_or_exists_not (fun (x : L) ↦ weightSpaceOf M (0 : R) x = ⊤)
+    with h | ⟨x, hx : weightSpaceOf M (0 : R) x ≠ ⊤⟩
+  · suffices IsNilpotent R L M by simp [isCompl_top_bot]
+    replace h : M₀ = ⊤ := by simpa [weightSpace]
+    rw [← LieModule.isNilpotent_of_top_iff', ← h]
+    infer_instance
+  · set M₀ₓ := weightSpaceOf M (0 : R) x
+    set M₁ₓ := posFittingCompOf R M x
+    set M₀ₓ₀ := weightSpace M₀ₓ (0 : L → R)
+    set M₀ₓ₁ := posFittingComp R L M₀ₓ
+    have h₀ : Function.Injective (LieSubmodule.incl M₀ₓ) := Subtype.coe_injective
+    have h₁ : IsCompl M₀ₓ M₁ₓ := isCompl_weightSpaceOf_zero_posFittingCompOf R L M x
+    have h₂ : IsCompl M₀ₓ₀ M₀ₓ₁ := h M₀ₓ hx.lt_top
+    have h₃ : M₀ₓ₀.map M₀ₓ.incl = M₀ := by
+      rw [map_weightSpace_eq_of_injective h₀, inf_eq_left, LieSubmodule.range_incl]
+      exact iInf_le _ x
+    have h₄ : M₀ₓ₁.map M₀ₓ.incl ⊔ M₁ₓ = M₁ := by
+      apply le_antisymm <| sup_le_iff.mpr
+        ⟨map_posFittingComp_le _, posFittingCompOf_le_posFittingComp R L M x⟩
+      rw [← posFittingComp_map_incl_sup_of_codisjoint h₁.codisjoint]
+      exact sup_le_sup_left LieSubmodule.map_incl_le _
+    rw [← h₃, ← h₄]
+    apply Disjoint.isCompl_sup_right_of_isCompl_sup_left
+    · rw [disjoint_iff, ← LieSubmodule.map_inf h₀, h₂.inf_eq_bot, LieSubmodule.map_bot]
+    · rwa [← LieSubmodule.map_sup, h₂.sup_eq_top, LieModuleHom.map_top, LieSubmodule.range_incl]
+
+/-- This is the Fitting decomposition of the Lie module `M`. -/
+lemma isCompl_weightSpace_zero_posFittingComp :
+    IsCompl (weightSpace M 0) (posFittingComp R L M) := by
+  let P : LieSubmodule R L M → Prop := fun N ↦ IsCompl (weightSpace N 0) (posFittingComp R L N)
+  suffices : P ⊤
+  · let e := LieModuleEquiv.ofTop R L M
+    rw [← map_weightSpace_eq e, ← map_posFittingComp_eq e]
+    exact (LieSubmodule.orderIsoMapComap e).isCompl_iff.mp this
+  refine (LieSubmodule.wellFounded_of_isArtinian R L M).induction (C := P) _ fun N hN ↦ ?_
+  refine isCompl_weightSpace_zero_posFittingComp_aux R L N fun N' hN' ↦ ?_
+  suffices : IsCompl (weightSpace (N'.map N.incl) 0) (posFittingComp R L (N'.map N.incl))
+  · have h_inj : Function.Injective N.incl := Subtype.coe_injective
+    let e := LieSubmodule.equivMapOfInjective N' h_inj
+    rw [← map_weightSpace_eq e, ← map_posFittingComp_eq e] at this
+    exact (LieSubmodule.orderIsoMapComap e).isCompl_iff.mpr this
+  exact hN _ (LieSubmodule.map_incl_lt_iff_lt_top.mpr hN')
+
+end fitting_decomposition
 
-@[simp]
-theorem zeroRootSubalgebra_eq_of_is_cartan (H : LieSubalgebra R L) [H.IsCartanSubalgebra]
-    [IsNoetherian R L] : zeroRootSubalgebra R L H = H := by
-  refine' le_antisymm _ (le_zeroRootSubalgebra R L H)
-  suffices rootSpace H 0 ≤ H.toLieSubmodule by exact fun x hx => this hx
-  obtain ⟨k, hk⟩ := (rootSpace H 0).isNilpotent_iff_exists_self_le_ucs.mp (by infer_instance)
-  exact hk.trans (LieSubmodule.ucs_le_of_normalizer_eq_self (by simp) k)
-#align lie_algebra.zero_root_subalgebra_eq_of_is_cartan LieAlgebra.zeroRootSubalgebra_eq_of_is_cartan
-
-theorem zeroRootSubalgebra_eq_iff_is_cartan [IsNoetherian R L] :
-    zeroRootSubalgebra R L H = H ↔ H.IsCartanSubalgebra :=
-  ⟨is_cartan_of_zeroRootSubalgebra_eq R L H, by intros; simp⟩
-#align lie_algebra.zero_root_subalgebra_eq_iff_is_cartan LieAlgebra.zeroRootSubalgebra_eq_iff_is_cartan
-
-end LieAlgebra
+end LieModule
feat: use suppress_compilation in tensor products (#7504)

More principled version of #7281.

Diff
@@ -464,6 +464,8 @@ def rootSpaceWeightSpaceProductAux {χ₁ χ₂ χ₃ : H → R} (hχ : χ₁ +
       SetLike.mk_smul_mk]
 #align lie_algebra.root_space_weight_space_product_aux LieAlgebra.rootSpaceWeightSpaceProductAux
 
+suppress_compilation
+
 -- Porting note: this def is _really_ slow
 -- See https://github.com/leanprover-community/mathlib4/issues/5028
 /-- Given a nilpotent Lie subalgebra `H ⊆ L` together with `χ₁ χ₂ : H → R`, there is a natural
feat: improve API for Fitting decomposition of a linear endomorphism (#7487)

Especially the new lemma LinearMap.eventually_isCompl_ker_pow_range_pow

Diff
@@ -330,11 +330,6 @@ lemma mem_posFittingCompOf [LieAlgebra.IsNilpotent R L] (x : L) (m : M) :
   simp_rw [eq_bot_iff, ← iInf_lowerCentralSeries_eq_bot_of_isNilpotent, le_iInf_iff,
     posFittingCompOf_le_lowerCentralSeries, forall_const]
 
-lemma exists_coe_posFittingCompOf_eq_of_isArtinian
-    [LieAlgebra.IsNilpotent R L] [IsArtinian R M] (x : L) :
-    ∃ (k : ℕ), posFittingCompOf R M x = LinearMap.range (toEndomorphism R L M x ^ k) :=
-  (toEndomorphism R L M x).exists_range_pow_eq_iInf
-
 variable (L)
 
 /-- If `M` is a representation of a nilpotent Lie algebra `L` with coefficients in `R`, then
@@ -365,13 +360,13 @@ lemma posFittingComp_le_iInf_lowerCentralSeries [LieAlgebra.IsNilpotent R L] :
   apply iInf_lcs_le_of_isNilpotent_quot
   rw [LieModule.isNilpotent_iff_forall']
   intro x
-  obtain ⟨k, hk⟩ := exists_coe_posFittingCompOf_eq_of_isArtinian R M x
+  obtain ⟨k, hk⟩ := Filter.eventually_atTop.mp (toEndomorphism R L M x).eventually_iInf_range_pow_eq
   use k
   ext ⟨m⟩
   set F := posFittingComp R L M
   replace hk : (toEndomorphism R L M x ^ k) m ∈ F := by
     apply posFittingCompOf_le_posFittingComp R L M x
-    rw [← LieSubmodule.mem_coeSubmodule, hk]
+    simp_rw [← LieSubmodule.mem_coeSubmodule, posFittingCompOf, hk k (le_refl k)]
     apply LinearMap.mem_range_self
   suffices (toEndomorphism R L (M ⧸ F) x ^ k) (LieSubmodule.Quotient.mk (N := F) m) =
     LieSubmodule.Quotient.mk (N := F) ((toEndomorphism R L M x ^ k) m) by simpa [this]
feat: define the positive Fitting component of the representation of a nilpotent Lie algebra (#7360)
Diff
@@ -3,6 +3,7 @@ Copyright (c) 2021 Oliver Nash. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
 -/
+import Mathlib.Algebra.Ring.Divisibility.Lemmas
 import Mathlib.Algebra.Lie.Nilpotent
 import Mathlib.Algebra.Lie.TensorProduct
 import Mathlib.Algebra.Lie.Character
@@ -10,6 +11,7 @@ import Mathlib.Algebra.Lie.Engel
 import Mathlib.Algebra.Lie.CartanSubalgebra
 import Mathlib.LinearAlgebra.Eigenspace.Basic
 import Mathlib.LinearAlgebra.TensorProduct.Tower
+import Mathlib.RingTheory.Artinian
 
 #align_import algebra.lie.weights from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
 
@@ -249,6 +251,139 @@ instance [LieAlgebra.IsNilpotent R L] [IsNoetherian R M] :
     IsNilpotent R L (weightSpace M (0 : L → R)) :=
   isNilpotent_iff_forall'.mpr <| isNilpotent_toEndomorphism_weightSpace_zero M
 
+variable (R L)
+
+@[simp]
+lemma weightSpace_zero_normalizer_eq_self [LieAlgebra.IsNilpotent R L] :
+    (weightSpace M (0 : L → R)).normalizer = weightSpace M 0 := by
+  refine' le_antisymm _ (LieSubmodule.le_normalizer _)
+  intro m hm
+  rw [LieSubmodule.mem_normalizer] at hm
+  simp only [mem_weightSpace, Pi.zero_apply, zero_smul, sub_zero] at hm ⊢
+  intro y
+  obtain ⟨k, hk⟩ := hm y y
+  use k + 1
+  simpa [pow_succ', LinearMap.mul_eq_comp]
+
+lemma iSup_ucs_le_weightSpace_zero [LieAlgebra.IsNilpotent R L] :
+    ⨆ k, (⊥ : LieSubmodule R L M).ucs k ≤ weightSpace M (0 : L → R) := by
+  simpa using LieSubmodule.ucs_le_of_normalizer_eq_self (weightSpace_zero_normalizer_eq_self R L M)
+
+/-- See also `LieModule.iInf_lowerCentralSeries_eq_posFittingComp`. -/
+lemma iSup_ucs_eq_weightSpace_zero [LieAlgebra.IsNilpotent R L] [IsNoetherian R M] :
+    ⨆ k, (⊥ : LieSubmodule R L M).ucs k = weightSpace M (0 : L → R) := by
+  obtain ⟨k, hk⟩ := (LieSubmodule.isNilpotent_iff_exists_self_le_ucs
+    <| weightSpace M (0 : L → R)).mp inferInstance
+  refine le_antisymm (iSup_ucs_le_weightSpace_zero R L M) (le_trans hk ?_)
+  exact le_iSup (fun k ↦ (⊥ : LieSubmodule R L M).ucs k) k
+
+variable {L}
+
+/-- If `M` is a representation of a nilpotent Lie algebra `L`, and `x : L`, then
+`posFittingCompOf R M x` is the infimum of the decreasing system
+`range φₓ ⊇ range φₓ² ⊇ range φₓ³ ⊇ ⋯` where `φₓ : End R M := toEndomorphism R L M x`. We call this
+the "positive Fitting component" because with appropriate assumptions (e.g., `R` is a field and
+`M` is finite-dimensional) `φₓ` induces the so-called Fitting decomposition: `M = M₀ ⊕ M₁` where
+`M₀ = weightSpaceOf M 0 x` and `M₁ = posFittingCompOf R M x`.
+
+It is a Lie submodule because `L` is nilpotent. -/
+def posFittingCompOf [LieAlgebra.IsNilpotent R L] (x : L) : LieSubmodule R L M :=
+  { toSubmodule := ⨅ k, LinearMap.range (toEndomorphism R L M x ^ k)
+    lie_mem := by
+      set φ := toEndomorphism R L M x
+      intros y m hm
+      simp only [AddSubsemigroup.mem_carrier, AddSubmonoid.mem_toSubsemigroup,
+        Submodule.mem_toAddSubmonoid, Submodule.mem_iInf, LinearMap.mem_range] at hm ⊢
+      intro k
+      obtain ⟨N, hN⟩ := LieAlgebra.nilpotent_ad_of_nilpotent_algebra R L
+      obtain ⟨m, rfl⟩ := hm (N + k)
+      let f₁ : Module.End R (L ⊗[R] M) := (LieAlgebra.ad R L x).rTensor M
+      let f₂ : Module.End R (L ⊗[R] M) := φ.lTensor L
+      replace hN : f₁ ^ N = 0 := by ext; simp [hN]
+      have h₁ : Commute f₁ f₂ := by ext; simp
+      have h₂ : φ ∘ₗ toModuleHom R L M = toModuleHom R L M ∘ₗ (f₁ + f₂) := by ext; simp
+      obtain ⟨q, hq⟩ := h₁.add_pow_dvd_pow_of_pow_eq_zero_right (N + k).le_succ hN
+      use toModuleHom R L M (q (y ⊗ₜ m))
+      change (φ ^ k).comp ((toModuleHom R L M : L ⊗[R] M →ₗ[R] M)) _ = _
+      simp [LinearMap.commute_pow_left_of_commute h₂, LinearMap.comp_apply (g := (f₁ + f₂) ^ k),
+        ← LinearMap.comp_apply (g := q), ← LinearMap.mul_eq_comp, ← hq] }
+
+variable {M} in
+lemma mem_posFittingCompOf [LieAlgebra.IsNilpotent R L] (x : L) (m : M) :
+    m ∈ posFittingCompOf R M x ↔ ∀ (k : ℕ), ∃ n, (toEndomorphism R L M x ^ k) n = m := by
+  simp [posFittingCompOf]
+
+@[simp] lemma posFittingCompOf_le_lowerCentralSeries [LieAlgebra.IsNilpotent R L] (x : L) (k : ℕ) :
+    posFittingCompOf R M x ≤ lowerCentralSeries R L M k := by
+  suffices : ∀ m l, (toEndomorphism R L M x ^ l) m ∈ lowerCentralSeries R L M l
+  · intro m hm
+    obtain ⟨n, rfl⟩ := (mem_posFittingCompOf R x m).mp hm k
+    exact this n k
+  intro m l
+  induction' l with l ih; simp
+  simp only [lowerCentralSeries_succ, pow_succ, LinearMap.mul_apply]
+  exact LieSubmodule.lie_mem_lie _ ⊤ (LieSubmodule.mem_top x) ih
+
+@[simp] lemma posFittingCompOf_eq_bot_of_isNilpotent
+    [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] (x : L) :
+    posFittingCompOf R M x = ⊥ := by
+  simp_rw [eq_bot_iff, ← iInf_lowerCentralSeries_eq_bot_of_isNilpotent, le_iInf_iff,
+    posFittingCompOf_le_lowerCentralSeries, forall_const]
+
+lemma exists_coe_posFittingCompOf_eq_of_isArtinian
+    [LieAlgebra.IsNilpotent R L] [IsArtinian R M] (x : L) :
+    ∃ (k : ℕ), posFittingCompOf R M x = LinearMap.range (toEndomorphism R L M x ^ k) :=
+  (toEndomorphism R L M x).exists_range_pow_eq_iInf
+
+variable (L)
+
+/-- If `M` is a representation of a nilpotent Lie algebra `L` with coefficients in `R`, then
+`posFittingComp R L M` is the span of the positive Fitting components of the action of `x` on `M`,
+as `x` ranges over `L`.
+
+It is a Lie submodule because `L` is nilpotent. -/
+def posFittingComp [LieAlgebra.IsNilpotent R L] : LieSubmodule R L M :=
+  ⨆ x, posFittingCompOf R M x
+
+lemma mem_posFittingComp [LieAlgebra.IsNilpotent R L] (m : M) :
+    m ∈ posFittingComp R L M ↔ m ∈ ⨆ (x : L), posFittingCompOf R M x := by
+  rfl
+
+lemma posFittingCompOf_le_posFittingComp [LieAlgebra.IsNilpotent R L] (x : L) :
+    posFittingCompOf R M x ≤ posFittingComp R L M := by
+  rw [posFittingComp]; exact le_iSup (posFittingCompOf R M) x
+
+lemma posFittingComp_le_iInf_lowerCentralSeries [LieAlgebra.IsNilpotent R L] :
+    posFittingComp R L M ≤ ⨅ k, lowerCentralSeries R L M k := by
+  simp [posFittingComp]
+
+/-- See also `LieModule.iSup_ucs_eq_weightSpace_zero`. -/
+@[simp] lemma iInf_lowerCentralSeries_eq_posFittingComp
+    [LieAlgebra.IsNilpotent R L] [IsNoetherian R M] [IsArtinian R M] :
+    ⨅ k, lowerCentralSeries R L M k = posFittingComp R L M := by
+  refine le_antisymm ?_ (posFittingComp_le_iInf_lowerCentralSeries R L M)
+  apply iInf_lcs_le_of_isNilpotent_quot
+  rw [LieModule.isNilpotent_iff_forall']
+  intro x
+  obtain ⟨k, hk⟩ := exists_coe_posFittingCompOf_eq_of_isArtinian R M x
+  use k
+  ext ⟨m⟩
+  set F := posFittingComp R L M
+  replace hk : (toEndomorphism R L M x ^ k) m ∈ F := by
+    apply posFittingCompOf_le_posFittingComp R L M x
+    rw [← LieSubmodule.mem_coeSubmodule, hk]
+    apply LinearMap.mem_range_self
+  suffices (toEndomorphism R L (M ⧸ F) x ^ k) (LieSubmodule.Quotient.mk (N := F) m) =
+    LieSubmodule.Quotient.mk (N := F) ((toEndomorphism R L M x ^ k) m) by simpa [this]
+  have := LinearMap.congr_fun (LinearMap.commute_pow_left_of_commute
+    (LieSubmodule.Quotient.toEndomorphism_comp_mk' F x) k) m
+  simpa using this
+
+@[simp] lemma posFittingComp_eq_bot_of_isNilpotent
+    [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
+    posFittingComp R L M = ⊥ := by
+  simp [posFittingComp]
+
 end LieModule
 
 namespace LieAlgebra
feat: remove IsNoetherian R L hypothesis from proof that zero-weight space of a Lie module is nilpotent (#7295)

This is possible thanks to the commit: 63ca289d

Diff
@@ -244,11 +244,10 @@ theorem isNilpotent_toEndomorphism_weightSpace_zero [LieAlgebra.IsNilpotent R L]
   exact hk hm
 #align lie_module.is_nilpotent_to_endomorphism_weight_space_zero LieModule.isNilpotent_toEndomorphism_weightSpace_zero
 
-/-- By Engel's theorem, when the Lie algebra is Noetherian, the zero weight space of a Noetherian
-Lie module is nilpotent. -/
-instance [LieAlgebra.IsNilpotent R L] [IsNoetherian R L] [IsNoetherian R M] :
+/-- By Engel's theorem, the zero weight space of a Noetherian Lie module is nilpotent. -/
+instance [LieAlgebra.IsNilpotent R L] [IsNoetherian R M] :
     IsNilpotent R L (weightSpace M (0 : L → R)) :=
-  isNilpotent_iff_forall.mpr <| isNilpotent_toEndomorphism_weightSpace_zero M
+  isNilpotent_iff_forall'.mpr <| isNilpotent_toEndomorphism_weightSpace_zero M
 
 end LieModule
 
chore: refactor Lie algebra weight spaces (#7210)

The key change is the new definition LieModule.weightSpaceOf which shows that the eigenspaces of the action of a single element of a Lie algebra on a representation are Lie submodules. I need to use this fact to develop the theory further.

Diff
@@ -31,6 +31,7 @@ Basic definitions and properties of the above ideas are provided in this file.
 
 ## Main definitions
 
+  * `LieModule.weightSpaceOf`
   * `LieModule.weightSpace`
   * `LieModule.IsWeight`
   * `LieAlgebra.rootSpace`
@@ -48,68 +49,38 @@ Basic definitions and properties of the above ideas are provided in this file.
 lie character, eigenvalue, eigenspace, weight, weight vector, root, root vector
 -/
 
-
 universe u v w w₁ w₂ w₃
 
 variable {R : Type u} {L : Type v} [CommRing R] [LieRing L] [LieAlgebra R L]
-
-variable (H : LieSubalgebra R L) [LieAlgebra.IsNilpotent R H]
-
-variable (M : Type w) [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
+  (H : LieSubalgebra R L) [LieAlgebra.IsNilpotent R H]
+  {M : Type w} [AddCommGroup M] [Module R M] [LieRingModule L M] [LieModule R L M]
 
 namespace LieModule
 
-open LieAlgebra
-
-open TensorProduct
-
-open TensorProduct.LieModule
-
-open scoped BigOperators
+open LieAlgebra TensorProduct TensorProduct.LieModule
+open scoped BigOperators TensorProduct
 
-open scoped TensorProduct
-
-/-- Given a Lie module `M` over a Lie algebra `L`, the pre-weight space of `M` with respect to a
-map `χ : L → R` is the simultaneous generalized eigenspace of the action of all `x : L` on `M`,
-with eigenvalues `χ x`.
-
-See also `LieModule.weightSpace`. -/
-def preWeightSpace (χ : L → R) : Submodule R M :=
-  ⨅ x : L, (toEndomorphism R L M x).maximalGeneralizedEigenspace (χ x)
-#align lie_module.pre_weight_space LieModule.preWeightSpace
+section notation_weight_space_of
 
-theorem mem_preWeightSpace (χ : L → R) (m : M) :
-    m ∈ preWeightSpace M χ ↔
-    ∀ x, ∃ k : ℕ, ((toEndomorphism R L M x - χ x • ↑1) ^ k) m = 0 := by
-  simp [preWeightSpace]
-#align lie_module.mem_pre_weight_space LieModule.mem_preWeightSpace
-
-variable (R)
-
-theorem exists_preWeightSpace_zero_le_ker_of_isNoetherian [IsNoetherian R M] (x : L) :
-    ∃ k : ℕ, preWeightSpace M (0 : L → R) ≤ LinearMap.ker (toEndomorphism R L M x ^ k) := by
-  use (toEndomorphism R L M x).maximalGeneralizedEigenspaceIndex 0
-  simp only [← Module.End.generalizedEigenspace_zero, preWeightSpace, Pi.zero_apply, iInf_le,
-    ← (toEndomorphism R L M x).maximalGeneralizedEigenspace_eq]
-#align lie_module.exists_pre_weight_space_zero_le_ker_of_is_noetherian LieModule.exists_preWeightSpace_zero_le_ker_of_isNoetherian
-
-variable {R} (L)
+/-- Until we define `LieModule.weightSpaceOf`, it is useful to have some notation as follows: -/
+local notation3 (prettyPrint := false) "𝕎("M"," χ"," x")" =>
+  (toEndomorphism R L M x).maximalGeneralizedEigenspace χ
 
 /-- See also `bourbaki1975b` Chapter VII §1.1, Proposition 2 (ii). -/
 protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w₂) (M₃ : Type w₃)
     [AddCommGroup M₁] [Module R M₁] [LieRingModule L M₁] [LieModule R L M₁] [AddCommGroup M₂]
     [Module R M₂] [LieRingModule L M₂] [LieModule R L M₂] [AddCommGroup M₃] [Module R M₃]
-    [LieRingModule L M₃] [LieModule R L M₃] (g : M₁ ⊗[R] M₂ →ₗ⁅R,L⁆ M₃) (χ₁ χ₂ : L → R) :
-    LinearMap.range ((g : M₁ ⊗[R] M₂ →ₗ[R] M₃).comp
-    (mapIncl (preWeightSpace M₁ χ₁) (preWeightSpace M₂ χ₂))) ≤
-      preWeightSpace M₃ (χ₁ + χ₂) := by
+    [LieRingModule L M₃] [LieModule R L M₃] (g : M₁ ⊗[R] M₂ →ₗ⁅R,L⁆ M₃) (χ₁ χ₂ : R) (x : L) :
+    LinearMap.range ((g : M₁ ⊗[R] M₂ →ₗ[R] M₃).comp (mapIncl 𝕎(M₁, χ₁, x) 𝕎(M₂, χ₂, x))) ≤
+      𝕎(M₃, χ₁ + χ₂, x) := by
   -- Unpack the statement of the goal.
   intro m₃
-  simp only [LieModuleHom.coe_toLinearMap, Pi.add_apply, Function.comp_apply, mem_preWeightSpace,
-    LinearMap.coe_comp, TensorProduct.mapIncl, exists_imp, LinearMap.mem_range]
-  rintro t rfl x
+  simp only [TensorProduct.mapIncl, LinearMap.mem_range, LinearMap.coe_comp,
+    LieModuleHom.coe_toLinearMap, Function.comp_apply, Pi.add_apply, exists_imp,
+    Module.End.mem_maximalGeneralizedEigenspace]
+  rintro t rfl
   -- Set up some notation.
-  let F : Module.End R M₃ := toEndomorphism R L M₃ x - (χ₁ x + χ₂ x) • ↑1
+  let F : Module.End R M₃ := toEndomorphism R L M₃ x - (χ₁ + χ₂) • ↑1
   -- The goal is linear in `t` so use induction to reduce to the case that `t` is a pure tensor.
   refine t.induction_on ?_ ?_ ?_
   · use 0; simp only [LinearMap.map_zero, LieModuleHom.map_zero]
@@ -120,10 +91,10 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
       LinearMap.pow_map_zero_of_le (le_max_right k₁ k₂) hk₂, add_zero]
   -- Now the main argument: pure tensors.
   rintro ⟨m₁, hm₁⟩ ⟨m₂, hm₂⟩
---  change ∃ k, (F ^ k) ((g : M₁ ⊗[R] M₂ →ₗ[R] M₃) (m₁ ⊗ₜ m₂)) = 0
+  change ∃ k, (F ^ k) ((g : M₁ ⊗[R] M₂ →ₗ[R] M₃) (m₁ ⊗ₜ m₂)) = (0 : M₃)
   -- Eliminate `g` from the picture.
-  let f₁ : Module.End R (M₁ ⊗[R] M₂) := (toEndomorphism R L M₁ x - χ₁ x • ↑1).rTensor M₂
-  let f₂ : Module.End R (M₁ ⊗[R] M₂) := (toEndomorphism R L M₂ x - χ₂ x • ↑1).lTensor M₁
+  let f₁ : Module.End R (M₁ ⊗[R] M₂) := (toEndomorphism R L M₁ x - χ₁ • ↑1).rTensor M₂
+  let f₂ : Module.End R (M₁ ⊗[R] M₂) := (toEndomorphism R L M₂ x - χ₂ • ↑1).lTensor M₁
   have h_comm_square : F ∘ₗ ↑g = (g : M₁ ⊗[R] M₂ →ₗ[R] M₃).comp (f₁ + f₂) := by
     ext m₁ m₂;
     simp only [← g.map_lie x (m₁ ⊗ₜ m₂), add_smul, sub_tmul, tmul_sub, smul_tmul, lie_tmul_right,
@@ -139,9 +110,9 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
     rw [← LinearMap.comp_apply, LinearMap.commute_pow_left_of_commute h_comm_square,
       LinearMap.comp_apply, hk, LinearMap.map_zero]
   -- Unpack the information we have about `m₁`, `m₂`.
-  simp only [mem_preWeightSpace] at hm₁ hm₂
-  obtain ⟨k₁, hk₁⟩ := hm₁ x
-  obtain ⟨k₂, hk₂⟩ := hm₂ x
+  simp only [Module.End.mem_maximalGeneralizedEigenspace] at hm₁ hm₂
+  obtain ⟨k₁, hk₁⟩ := hm₁
+  obtain ⟨k₂, hk₂⟩ := hm₂
   have hf₁ : (f₁ ^ k₁) (m₁ ⊗ₜ m₂) = 0 := by
     simp only [hk₁, zero_tmul, LinearMap.rTensor_tmul, LinearMap.rTensor_pow]
   have hf₂ : (f₂ ^ k₂) (m₁ ⊗ₜ m₂) = 0 := by
@@ -166,64 +137,76 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
   · rw [(hf_comm.pow_pow i j).eq, LinearMap.mul_apply, LinearMap.pow_map_zero_of_le hi hf₁,
       LinearMap.map_zero]
   · rw [LinearMap.mul_apply, LinearMap.pow_map_zero_of_le hj hf₂, LinearMap.map_zero]
-#align lie_module.weight_vector_multiplication LieModule.weight_vector_multiplication
-
-variable {L M}
 
-theorem lie_mem_preWeightSpace_of_mem_preWeightSpace {χ₁ χ₂ : L → R} {x : L} {m : M}
-    (hx : x ∈ preWeightSpace L χ₁) (hm : m ∈ preWeightSpace M χ₂) :
-    ⁅x, m⁆ ∈ preWeightSpace M (χ₁ + χ₂) := by
-  apply LieModule.weight_vector_multiplication L L M M (toModuleHom R L M) χ₁ χ₂
+lemma lie_mem_maxGenEigenspace_toEndomorphism
+    {χ₁ χ₂ : R} {x y : L} {m : M} (hy : y ∈ 𝕎(L, χ₁, x)) (hm : m ∈ 𝕎(M, χ₂, x)) :
+    ⁅y, m⁆ ∈ 𝕎(M, χ₁ + χ₂, x) := by
+  apply LieModule.weight_vector_multiplication L M M (toModuleHom R L M) χ₁ χ₂
   simp only [LieModuleHom.coe_toLinearMap, Function.comp_apply, LinearMap.coe_comp,
     TensorProduct.mapIncl, LinearMap.mem_range]
-  use ⟨x, hx⟩ ⊗ₜ ⟨m, hm⟩
+  use ⟨y, hy⟩ ⊗ₜ ⟨m, hm⟩
   simp only [Submodule.subtype_apply, toModuleHom_apply, TensorProduct.map_tmul]
-#align lie_module.lie_mem_pre_weight_space_of_mem_pre_weight_space LieModule.lie_mem_preWeightSpace_of_mem_preWeightSpace
 
 variable (M)
 
-/-- If a Lie algebra is nilpotent, then pre-weight spaces are Lie submodules. -/
-def weightSpace [LieAlgebra.IsNilpotent R L] (χ : L → R) : LieSubmodule R L M :=
-  { preWeightSpace M χ with
-    lie_mem := fun hm => by
-      dsimp only
+/-- If `M` is a representation of a nilpotent Lie algebra `L`, `χ` is a scalar, and `x : L`, then
+`weightSpaceOf M χ x` is the maximal generalized `χ`-eigenspace of the action of `x` on `M`.
+
+It is a Lie submodule because `L` is nilpotent. -/
+def weightSpaceOf [LieAlgebra.IsNilpotent R L] (χ : R) (x : L) : LieSubmodule R L M :=
+  { 𝕎(M, χ, x) with
+    lie_mem := by
+      intro y m hm
+      simp only [AddSubsemigroup.mem_carrier, AddSubmonoid.mem_toSubsemigroup,
+        Submodule.mem_toAddSubmonoid] at hm ⊢
       rw [← zero_add χ]
-      refine lie_mem_preWeightSpace_of_mem_preWeightSpace ?_ hm
-      suffices preWeightSpace L (0 : L → R) = ⊤ by simp only [this, Submodule.mem_top]
-      exact LieAlgebra.iInf_max_gen_zero_eigenspace_eq_top_of_nilpotent R L }
-#align lie_module.weight_space LieModule.weightSpace
+      exact lie_mem_maxGenEigenspace_toEndomorphism (by simp) hm }
+
+theorem mem_weightSpaceOf [LieAlgebra.IsNilpotent R L] (χ : R) (x : L) (m : M) :
+    m ∈ weightSpaceOf M χ x ↔ ∃ k : ℕ, ((toEndomorphism R L M x - χ • ↑1) ^ k) m = 0 := by
+  simp [weightSpaceOf]
+
+end notation_weight_space_of
+
+variable (M)
+
+/-- If `M` is a representation of a nilpotent Lie algebra `L` and `χ : L → R` is a family of
+scalars, then `weightSpace M χ` is the intersection of the maximal generalized `χ x`-eigenspaces of
+the action of `x` on `M` as `x` ranges over `L`.
+
+It is a Lie submodule because `L` is nilpotent. -/
+def weightSpace [LieAlgebra.IsNilpotent R L] (χ : L → R) : LieSubmodule R L M :=
+  ⨅ x, weightSpaceOf M (χ x) x
 
 theorem mem_weightSpace [LieAlgebra.IsNilpotent R L] (χ : L → R) (m : M) :
-    m ∈ weightSpace M χ ↔ m ∈ preWeightSpace M χ := Iff.rfl
-#align lie_module.mem_weight_space LieModule.mem_weightSpace
+    m ∈ weightSpace M χ ↔ ∀ x, ∃ k : ℕ, ((toEndomorphism R L M x - χ x • ↑1) ^ k) m = 0 := by
+  simp [weightSpace, mem_weightSpaceOf]
 
 /-- See also the more useful form `LieModule.zero_weightSpace_eq_top_of_nilpotent`. -/
 @[simp]
 theorem zero_weightSpace_eq_top_of_nilpotent' [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
     weightSpace M (0 : L → R) = ⊤ := by
-  rw [← LieSubmodule.coe_toSubmodule_eq_iff, LieSubmodule.top_coeSubmodule]
-  exact iInf_max_gen_zero_eigenspace_eq_top_of_nilpotent R L M
+  ext
+  simp [weightSpace, weightSpaceOf]
 #align lie_module.zero_weight_space_eq_top_of_nilpotent' LieModule.zero_weightSpace_eq_top_of_nilpotent'
 
 theorem coe_weightSpace_of_top [LieAlgebra.IsNilpotent R L] (χ : L → R) :
     (weightSpace M (χ ∘ (⊤ : LieSubalgebra R L).incl) : Submodule R M) = weightSpace M χ := by
   ext m
-  simp only [weightSpace, LieSubmodule.coe_toSubmodule_mk, LieSubalgebra.coe_bracket_of_module,
-    Function.comp_apply, mem_preWeightSpace]
-  constructor <;> intro h x
-  · obtain ⟨k, hk⟩ := h ⟨x, Set.mem_univ x⟩; use k; exact hk
-  · obtain ⟨k, hk⟩ := h x; use k; exact hk
+  simp only [mem_weightSpace, LieSubmodule.mem_coeSubmodule, Subtype.forall]
+  apply forall_congr'
+  simp
 #align lie_module.coe_weight_space_of_top LieModule.coe_weightSpace_of_top
 
 @[simp]
 theorem zero_weightSpace_eq_top_of_nilpotent [LieAlgebra.IsNilpotent R L] [IsNilpotent R L M] :
     weightSpace M (0 : (⊤ : LieSubalgebra R L) → R) = ⊤ := by
-  /- We use `coe_weightSpace_of_top` as a trick to circumvent the fact that we don't (yet) know
-      `IsNilpotent R (⊤ : LieSubalgebra R L) M` is equivalent to `IsNilpotent R L M`. -/
-  have h₀ : (0 : L → R) ∘ (⊤ : LieSubalgebra R L).incl = 0 := by ext; rfl
-  rw [← LieSubmodule.coe_toSubmodule_eq_iff, LieSubmodule.top_coeSubmodule, ← h₀,
-    coe_weightSpace_of_top, ← iInf_max_gen_zero_eigenspace_eq_top_of_nilpotent R L M]
-  rfl
+  ext m
+  simp only [mem_weightSpace, Pi.zero_apply, zero_smul, sub_zero, Subtype.forall, forall_true_left,
+    LieSubalgebra.toEndomorphism_mk, LieSubalgebra.mem_top, LieSubmodule.mem_top, iff_true]
+  intro x
+  obtain ⟨k, hk⟩ := exists_forall_pow_toEndomorphism_eq_zero R L M
+  exact ⟨k, by simp [hk x]⟩
 #align lie_module.zero_weight_space_eq_top_of_nilpotent LieModule.zero_weightSpace_eq_top_of_nilpotent
 
 /-- Given a Lie module `M` of a Lie algebra `L`, a weight of `M` with respect to a nilpotent
@@ -239,11 +222,20 @@ theorem isWeight_zero_of_nilpotent [Nontrivial M] [LieAlgebra.IsNilpotent R L] [
   rw [IsWeight, LieHom.coe_zero, zero_weightSpace_eq_top_of_nilpotent]; exact top_ne_bot
 #align lie_module.is_weight_zero_of_nilpotent LieModule.isWeight_zero_of_nilpotent
 
+variable (R) in
+theorem exists_weightSpace_zero_le_ker_of_isNoetherian
+    [LieAlgebra.IsNilpotent R L] [IsNoetherian R M] (x : L) :
+    ∃ k : ℕ, weightSpace M (0 : L → R) ≤ LinearMap.ker (toEndomorphism R L M x ^ k) := by
+  use (toEndomorphism R L M x).maximalGeneralizedEigenspaceIndex 0
+  simp only [weightSpace, weightSpaceOf, LieSubmodule.iInf_coe_toSubmodule, Pi.zero_apply, iInf_le,
+    ← Module.End.generalizedEigenspace_zero,
+    ← (toEndomorphism R L M x).maximalGeneralizedEigenspace_eq]
+
 /-- A (nilpotent) Lie algebra acts nilpotently on the zero weight space of a Noetherian Lie
 module. -/
 theorem isNilpotent_toEndomorphism_weightSpace_zero [LieAlgebra.IsNilpotent R L] [IsNoetherian R M]
     (x : L) : _root_.IsNilpotent <| toEndomorphism R L (weightSpace M (0 : L → R)) x := by
-  obtain ⟨k, hk⟩ := exists_preWeightSpace_zero_le_ker_of_isNoetherian R M x
+  obtain ⟨k, hk⟩ := exists_weightSpace_zero_le_ker_of_isNoetherian R M x
   use k
   ext ⟨m, hm⟩
   rw [LinearMap.zero_apply, LieSubmodule.coe_zero, Submodule.coe_eq_zero, ←
@@ -263,10 +255,7 @@ end LieModule
 namespace LieAlgebra
 
 open scoped TensorProduct
-
-open TensorProduct.LieModule
-
-open LieModule
+open TensorProduct.LieModule LieModule
 
 /-- Given a nilpotent Lie subalgebra `H ⊆ L`, the root space of a map `χ : H → R` is the weight
 space of `L` regarded as a module of `H` via the adjoint action. -/
@@ -274,7 +263,6 @@ abbrev rootSpace (χ : H → R) : LieSubmodule R H L :=
   weightSpace L χ
 #align lie_algebra.root_space LieAlgebra.rootSpace
 
--- @[simp] -- Porting note: simp can prove this
 theorem zero_rootSpace_eq_top_of_nilpotent [IsNilpotent R L] :
     rootSpace (⊤ : LieSubalgebra R L) 0 = ⊤ :=
   zero_weightSpace_eq_top_of_nilpotent L
@@ -282,8 +270,8 @@ theorem zero_rootSpace_eq_top_of_nilpotent [IsNilpotent R L] :
 
 /-- A root of a Lie algebra `L` with respect to a nilpotent subalgebra `H ⊆ L` is a weight of `L`,
 regarded as a module of `H` via the adjoint action. -/
-abbrev IsRoot :=
-  IsWeight H L
+abbrev IsRoot (χ : LieCharacter R H) :=
+  χ ≠ 0 ∧ IsWeight H L χ
 #align lie_algebra.is_root LieAlgebra.IsRoot
 
 @[simp]
@@ -297,8 +285,7 @@ theorem rootSpace_comap_eq_weightSpace (χ : H → R) :
       ∀ y : H, ∃ k : ℕ, (H.incl : H →ₗ[R] L).comp (g y ^ k) x = 0 by
     simp only [LieHom.coe_toLinearMap, LieSubalgebra.coe_incl, Function.comp_apply,
       LinearMap.coe_comp, Submodule.coe_eq_zero] at this
-    simp only [mem_weightSpace, mem_preWeightSpace, LieSubalgebra.coe_incl',
-      LieSubmodule.mem_comap, this]
+    simp only [mem_weightSpace, LieSubalgebra.coe_incl', LieSubmodule.mem_comap, this]
   have hfg : ∀ y : H, (f y).comp (H.incl : H →ₗ[R] L) = (H.incl : H →ₗ[R] L).comp (g y) := by
     rintro ⟨y, hy⟩; ext ⟨z, _⟩
     simp only [Submodule.coe_sub, toEndomorphism_apply_apply, LieHom.coe_toLinearMap,
@@ -308,16 +295,17 @@ theorem rootSpace_comap_eq_weightSpace (χ : H → R) :
   simp_rw [LinearMap.commute_pow_left_of_commute (hfg _)]
 #align lie_algebra.root_space_comap_eq_weight_space LieAlgebra.rootSpace_comap_eq_weightSpace
 
-variable {H M}
+variable {H}
 
 theorem lie_mem_weightSpace_of_mem_weightSpace {χ₁ χ₂ : H → R} {x : L} {m : M}
     (hx : x ∈ rootSpace H χ₁) (hm : m ∈ weightSpace M χ₂) : ⁅x, m⁆ ∈ weightSpace M (χ₁ + χ₂) := by
-  apply LieModule.weight_vector_multiplication H L M M ((toModuleHom R L M).restrictLie H) χ₁ χ₂
-  simp only [LieModuleHom.coe_toLinearMap, Function.comp_apply, LinearMap.coe_comp,
-    TensorProduct.mapIncl, LinearMap.mem_range]
-  use ⟨x, hx⟩ ⊗ₜ ⟨m, hm⟩
-  simp only [Submodule.subtype_apply, toModuleHom_apply, Submodule.coe_mk,
-    LieModuleHom.coe_restrictLie, TensorProduct.map_tmul]
+  rw [weightSpace, LieSubmodule.mem_iInf]
+  intro y
+  replace hx : x ∈ weightSpaceOf L (χ₁ y) y := by
+    rw [rootSpace, weightSpace, LieSubmodule.mem_iInf] at hx; exact hx y
+  replace hm : m ∈ weightSpaceOf M (χ₂ y) y := by
+    rw [weightSpace, LieSubmodule.mem_iInf] at hm; exact hm y
+  exact lie_mem_maxGenEigenspace_toEndomorphism hx hm
 #align lie_algebra.lie_mem_weight_space_of_mem_weight_space LieAlgebra.lie_mem_weightSpace_of_mem_weightSpace
 
 variable (R L H M)
@@ -404,17 +392,14 @@ theorem coe_zeroRootSubalgebra : (zeroRootSubalgebra R L H : Submodule R L) = ro
 
 theorem mem_zeroRootSubalgebra (x : L) :
     x ∈ zeroRootSubalgebra R L H ↔ ∀ y : H, ∃ k : ℕ, (toEndomorphism R H L y ^ k) x = 0 := by
-  rw [zeroRootSubalgebra]
-  -- Porting note: added the following `change` otherwise the `simp` fails
-  -- See https://github.com/leanprover-community/mathlib4/issues/5026
   change x ∈ rootSpace H 0 ↔ _
-  simp only [mem_weightSpace, mem_preWeightSpace, Pi.zero_apply, zero_smul, sub_zero]
+  simp only [mem_weightSpace, Pi.zero_apply, zero_smul, sub_zero]
 #align lie_algebra.mem_zero_root_subalgebra LieAlgebra.mem_zeroRootSubalgebra
 
 theorem toLieSubmodule_le_rootSpace_zero : H.toLieSubmodule ≤ rootSpace H 0 := by
   intro x hx
   simp only [LieSubalgebra.mem_toLieSubmodule] at hx
-  simp only [mem_weightSpace, mem_preWeightSpace, Pi.zero_apply, sub_zero, zero_smul]
+  simp only [mem_weightSpace, Pi.zero_apply, sub_zero, zero_smul]
   intro y
   obtain ⟨k, hk⟩ := (inferInstance : IsNilpotent R H)
   use k
@@ -484,30 +469,3 @@ theorem zeroRootSubalgebra_eq_iff_is_cartan [IsNoetherian R L] :
 #align lie_algebra.zero_root_subalgebra_eq_iff_is_cartan LieAlgebra.zeroRootSubalgebra_eq_iff_is_cartan
 
 end LieAlgebra
-
-namespace LieModule
-
-open LieAlgebra
-
-variable {H}
-
-/-- A priori, weight spaces are Lie submodules over the Lie subalgebra `H` used to define them.
-However they are naturally Lie submodules over the (in general larger) Lie subalgebra
-`zeroRootSubalgebra R L H`. Even though it is often the case that
-`zeroRootSubalgebra R L H = H`, it is likely to be useful to have the flexibility not to have
-to invoke this equality (as well as to work more generally). -/
-def weightSpace' (χ : H → R) : LieSubmodule R (zeroRootSubalgebra R L H) M :=
-  { (weightSpace M χ : Submodule R M) with
-    lie_mem := fun {x m hm} => by
-      have hx : (x : L) ∈ rootSpace H 0 := by
-        rw [← LieSubmodule.mem_coeSubmodule, ← coe_zeroRootSubalgebra]; exact x.prop
-      dsimp only
-      rw [← zero_add χ]
-      exact lie_mem_weightSpace_of_mem_weightSpace hx hm }
-#align lie_module.weight_space' LieModule.weightSpace'
-
-@[simp]
-theorem coe_weightSpace' (χ : H → R) : (weightSpace' M χ : Submodule R M) = weightSpace M χ := rfl
-#align lie_module.coe_weight_space' LieModule.coe_weightSpace'
-
-end LieModule
chore: split RingTheory/TensorProduct (#6187)

There is a reasonably-sized section on modules over two rings before we actual reach tensor products of rings.

The motivation for splitting here is to make room for the results in #6035.

The declarations are copied without modification, the module docstring has been adapted.

Diff
@@ -9,7 +9,7 @@ import Mathlib.Algebra.Lie.Character
 import Mathlib.Algebra.Lie.Engel
 import Mathlib.Algebra.Lie.CartanSubalgebra
 import Mathlib.LinearAlgebra.Eigenspace.Basic
-import Mathlib.RingTheory.TensorProduct
+import Mathlib.LinearAlgebra.TensorProduct.Tower
 
 #align_import algebra.lie.weights from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
 
feat: add 2 coe_pow lemmas (#6063)

Also drop @[simp] on LinearMap.pow_apply.

Diff
@@ -81,7 +81,7 @@ def preWeightSpace (χ : L → R) : Submodule R M :=
 theorem mem_preWeightSpace (χ : L → R) (m : M) :
     m ∈ preWeightSpace M χ ↔
     ∀ x, ∃ k : ℕ, ((toEndomorphism R L M x - χ x • ↑1) ^ k) m = 0 := by
-  simp [preWeightSpace, -LinearMap.pow_apply]
+  simp [preWeightSpace]
 #align lie_module.mem_pre_weight_space LieModule.mem_preWeightSpace
 
 variable (R)
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,11 +2,6 @@
 Copyright (c) 2021 Oliver Nash. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Oliver Nash
-
-! This file was ported from Lean 3 source module algebra.lie.weights
-! leanprover-community/mathlib commit 6b0169218d01f2837d79ea2784882009a0da1aa1
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Algebra.Lie.Nilpotent
 import Mathlib.Algebra.Lie.TensorProduct
@@ -16,6 +11,8 @@ import Mathlib.Algebra.Lie.CartanSubalgebra
 import Mathlib.LinearAlgebra.Eigenspace.Basic
 import Mathlib.RingTheory.TensorProduct
 
+#align_import algebra.lie.weights from "leanprover-community/mathlib"@"6b0169218d01f2837d79ea2784882009a0da1aa1"
+
 /-!
 # Weights and roots of Lie modules and Lie algebras
 
chore: bump to nightly-2023-07-01 (#5409)

Open in Gitpod

Co-authored-by: Komyyy <pol_tta@outlook.jp> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -136,7 +136,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
       LinearMap.sub_apply, LinearMap.lTensor_tmul, AlgebraTensorModule.curry_apply,
       curry_apply, LinearMap.toFun_eq_coe, LinearMap.coe_restrictScalars]
     abel
-  rsuffices ⟨k, hk⟩ : ∃ k, ((f₁ + f₂) ^ k) (m₁ ⊗ₜ m₂) = 0
+  rsuffices ⟨k, hk⟩ : ∃ k : ℕ, ((f₁ + f₂) ^ k) (m₁ ⊗ₜ m₂) = 0
   · use k
     change (F ^ k) (g.toLinearMap (m₁ ⊗ₜ[R] m₂)) = 0
     rw [← LinearMap.comp_apply, LinearMap.commute_pow_left_of_commute h_comm_square,
chore: remove superfluous parentheses in calls to ext (#5258)

Co-authored-by: Xavier Roblot <46200072+xroblot@users.noreply.github.com> Co-authored-by: Joël Riou <joel.riou@universite-paris-saclay.fr> Co-authored-by: Riccardo Brasca <riccardo.brasca@gmail.com> Co-authored-by: Yury G. Kudryashov <urkud@urkud.name> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Pol'tta / Miyahara Kō <pol_tta@outlook.jp> Co-authored-by: Jason Yuen <jason_yuen2007@hotmail.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com> Co-authored-by: Jireh Loreaux <loreaujy@gmail.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com> Co-authored-by: Jujian Zhang <jujian.zhang1998@outlook.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Diff
@@ -128,7 +128,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
   let f₁ : Module.End R (M₁ ⊗[R] M₂) := (toEndomorphism R L M₁ x - χ₁ x • ↑1).rTensor M₂
   let f₂ : Module.End R (M₁ ⊗[R] M₂) := (toEndomorphism R L M₂ x - χ₂ x • ↑1).lTensor M₁
   have h_comm_square : F ∘ₗ ↑g = (g : M₁ ⊗[R] M₂ →ₗ[R] M₃).comp (f₁ + f₂) := by
-    ext (m₁ m₂);
+    ext m₁ m₂;
     simp only [← g.map_lie x (m₁ ⊗ₜ m₂), add_smul, sub_tmul, tmul_sub, smul_tmul, lie_tmul_right,
       tmul_smul, toEndomorphism_apply_apply, LieModuleHom.map_smul, LinearMap.one_apply,
       LieModuleHom.coe_toLinearMap, LinearMap.smul_apply, Function.comp_apply, LinearMap.coe_comp,
@@ -152,7 +152,7 @@ protected theorem weight_vector_multiplication (M₁ : Type w₁) (M₂ : Type w
   -- It's now just an application of the binomial theorem.
   use k₁ + k₂ - 1
   have hf_comm : Commute f₁ f₂ := by
-    ext (m₁ m₂)
+    ext m₁ m₂
     simp only [LinearMap.mul_apply, LinearMap.rTensor_tmul, LinearMap.lTensor_tmul,
       AlgebraTensorModule.curry_apply, LinearMap.toFun_eq_coe, LinearMap.lTensor_tmul,
       curry_apply, LinearMap.coe_restrictScalars]
feat: port Algebra.Lie.Weights (#4988)

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Dependencies 10 + 540

541 files ported (98.2%)
226160 lines ported (98.5%)
Show graph

The unported dependencies are