l3lab/ntp-mathlib huggingface dataset:
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
    

Proof state:
case insert.intro.intro.intro.intro.intro.intro.intro.refine_2
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝⁸ : CommRing R
inst✝⁷ : LieRing L
inst✝⁶ : LieAlgebra R L
inst✝⁵ : LieAlgebra.IsNilpotent R L
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : NoZeroSMulDivisors R M
χ₁ χ₂ : L → R
s : Finset (L → R)
a✝ : χ₂ ∉ s
hχ₁₂✝ : χ₁ ∉ insert χ₂ s
hχ₁₂ : χ₁ ≠ χ₂
hχ₁ : χ₁ ∉ s
ih : Disjoint (weightSpace M χ₁) (Finset.sup s fun χ => weightSpace M χ)
y : M
hy : y ∈ weightSpace M χ₂
z : M
hz : z ∈ Finset.sup s fun χ => weightSpace M χ
hx : y + z ∈ weightSpace M χ₁
l : L
g : Module.End R M := (toEndomorphism R L M) l - (algebraMap R (Module.End R M)) (χ₂ l)
k : ℕ
hk : (g ^ k) y = 0
⊢ Submodule.map (g ^ k) (Finset.sup s fun χ => ↑(weightSpace M χ)) ≤ ↑(Finset.sup s fun χ => weightSpace M χ)

Next tactic:
simp_rw [Finset.sup_eq_iSup, Submodule.map_iSup (ι := L → R), Submodule.map_iSup (ι := _ ∈ s),
      LieSubmodule.iSup_coe_toSubmodule]
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]
    

Proof state:
case insert.intro.intro.intro.intro.intro.intro.intro.refine_2
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝⁸ : CommRing R
inst✝⁷ : LieRing L
inst✝⁶ : LieAlgebra R L
inst✝⁵ : LieAlgebra.IsNilpotent R L
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : NoZeroSMulDivisors R M
χ₁ χ₂ : L → R
s : Finset (L → R)
a✝ : χ₂ ∉ s
hχ₁₂✝ : χ₁ ∉ insert χ₂ s
hχ₁₂ : χ₁ ≠ χ₂
hχ₁ : χ₁ ∉ s
ih : Disjoint (weightSpace M χ₁) (Finset.sup s fun χ => weightSpace M χ)
y : M
hy : y ∈ weightSpace M χ₂
z : M
hz : z ∈ Finset.sup s fun χ => weightSpace M χ
hx : y + z ∈ weightSpace M χ₁
l : L
g : Module.End R M := (toEndomorphism R L M) l - (algebraMap R (Module.End R M)) (χ₂ l)
k : ℕ
hk : (g ^ k) y = 0
⊢ ⨆ i ∈ s, Submodule.map (((toEndomorphism R L M) l - (algebraMap R (Module.End R M)) (χ₂ l)) ^ k) ↑(weightSpace M i) ≤
    ⨆ i ∈ s, ↑(weightSpace M i)

Next tactic:
refine iSup₂_mono fun χ _ ↦ ?_
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 χ _ ↦ ?_
    

Proof state:
case insert.intro.intro.intro.intro.intro.intro.intro.refine_2
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝⁸ : CommRing R
inst✝⁷ : LieRing L
inst✝⁶ : LieAlgebra R L
inst✝⁵ : LieAlgebra.IsNilpotent R L
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : NoZeroSMulDivisors R M
χ₁ χ₂ : L → R
s : Finset (L → R)
a✝ : χ₂ ∉ s
hχ₁₂✝ : χ₁ ∉ insert χ₂ s
hχ₁₂ : χ₁ ≠ χ₂
hχ₁ : χ₁ ∉ s
ih : Disjoint (weightSpace M χ₁) (Finset.sup s fun χ => weightSpace M χ)
y : M
hy : y ∈ weightSpace M χ₂
z : M
hz : z ∈ Finset.sup s fun χ => weightSpace M χ
hx : y + z ∈ weightSpace M χ₁
l : L
g : Module.End R M := (toEndomorphism R L M) l - (algebraMap R (Module.End R M)) (χ₂ l)
k : ℕ
hk : (g ^ k) y = 0
χ : L → R
x✝ : χ ∈ s
⊢ Submodule.map (((toEndomorphism R L M) l - (algebraMap R (Module.End R M)) (χ₂ l)) ^ k) ↑(weightSpace M χ) ≤
    ↑(weightSpace M χ)

Next tactic:
rintro - ⟨u, hu, rfl⟩
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⟩
    

Proof state:
case insert.intro.intro.intro.intro.intro.intro.intro.refine_2.intro.intro
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝⁸ : CommRing R
inst✝⁷ : LieRing L
inst✝⁶ : LieAlgebra R L
inst✝⁵ : LieAlgebra.IsNilpotent R L
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : NoZeroSMulDivisors R M
χ₁ χ₂ : L → R
s : Finset (L → R)
a✝ : χ₂ ∉ s
hχ₁₂✝ : χ₁ ∉ insert χ₂ s
hχ₁₂ : χ₁ ≠ χ₂
hχ₁ : χ₁ ∉ s
ih : Disjoint (weightSpace M χ₁) (Finset.sup s fun χ => weightSpace M χ)
y : M
hy : y ∈ weightSpace M χ₂
z : M
hz : z ∈ Finset.sup s fun χ => weightSpace M χ
hx : y + z ∈ weightSpace M χ₁
l : L
g : Module.End R M := (toEndomorphism R L M) l - (algebraMap R (Module.End R M)) (χ₂ l)
k : ℕ
hk : (g ^ k) y = 0
χ : L → R
x✝ : χ ∈ s
u : M
hu : u ∈ ↑↑(weightSpace M χ)
⊢ (((toEndomorphism R L M) l - (algebraMap R (Module.End R M)) (χ₂ l)) ^ k) u ∈ ↑(weightSpace M χ)

Next tactic:
exact LieSubmodule.mapsTo_pow_toEndomorphism_sub_algebraMap _ hu
lemma independent_weightSpaceOf [NoZeroSMulDivisors R M] (x : L) :
    CompleteLattice.Independent fun (χ : R) ↦ weightSpaceOf M χ x := by
  

Proof state:
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝⁸ : CommRing R
inst✝⁷ : LieRing L
inst✝⁶ : LieAlgebra R L
inst✝⁵ : LieAlgebra.IsNilpotent R L
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : NoZeroSMulDivisors R M
x : L
⊢ CompleteLattice.Independent fun χ => weightSpaceOf M χ x

Next tactic:
rw [LieSubmodule.independent_iff_coe_toSubmodule]
lemma independent_weightSpaceOf [NoZeroSMulDivisors R M] (x : L) :
    CompleteLattice.Independent fun (χ : R) ↦ weightSpaceOf M χ x := by
  rw [LieSubmodule.independent_iff_coe_toSubmodule]
  

Proof state:
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝⁸ : CommRing R
inst✝⁷ : LieRing L
inst✝⁶ : LieAlgebra R L
inst✝⁵ : LieAlgebra.IsNilpotent R L
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : NoZeroSMulDivisors R M
x : L
⊢ CompleteLattice.Independent fun i => ↑(weightSpaceOf M i x)

Next tactic:
exact (toEndomorphism R L M x).independent_generalizedEigenspace
@[simp]
lemma iSup_weightSpaceOf_eq_top [IsTriangularizable R L M] (x : L) :
    ⨆ (φ : R), weightSpaceOf M φ x = ⊤ := by
  

Proof state:
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝⁸ : CommRing R
inst✝⁷ : LieRing L
inst✝⁶ : LieAlgebra R L
inst✝⁵ : LieAlgebra.IsNilpotent R L
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : IsTriangularizable R L M
x : L
⊢ ⨆ φ, weightSpaceOf M φ x = ⊤

Next tactic:
rw [← LieSubmodule.coe_toSubmodule_eq_iff, LieSubmodule.iSup_coe_toSubmodule,
    LieSubmodule.top_coeSubmodule]
@[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]
  

Proof state:
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝⁸ : CommRing R
inst✝⁷ : LieRing L
inst✝⁶ : LieAlgebra R L
inst✝⁵ : LieAlgebra.IsNilpotent R L
inst✝⁴ : AddCommGroup M
inst✝³ : Module R M
inst✝² : LieRingModule L M
inst✝¹ : LieModule R L M
inst✝ : IsTriangularizable R L M
x : L
⊢ ⨆ i, ↑(weightSpaceOf M i x) = ⊤

Next tactic:
exact IsTriangularizable.iSup_eq_top x
instance (N : LieSubmodule K L M) [IsTriangularizable K L M] : IsTriangularizable K L N := by
  

Proof state:
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝¹⁴ : CommRing R
inst✝¹³ : LieRing L
inst✝¹² : LieAlgebra R L
inst✝¹¹ : LieAlgebra.IsNilpotent R L
inst✝¹⁰ : AddCommGroup M
inst✝⁹ : Module R M
inst✝⁸ : LieRingModule L M
inst✝⁷ : LieModule R L M
inst✝⁶ : Field K
inst✝⁵ : LieAlgebra K L
inst✝⁴ : Module K M
inst✝³ : LieModule K L M
inst✝² : LieAlgebra.IsNilpotent K L
inst✝¹ : FiniteDimensional K M
N : LieSubmodule K L M
inst✝ : IsTriangularizable K L M
⊢ IsTriangularizable K L ↥↑N

Next tactic:
refine ⟨fun y ↦ ?_⟩
instance (N : LieSubmodule K L M) [IsTriangularizable K L M] : IsTriangularizable K L N := by
  refine ⟨fun y ↦ ?_⟩
  

Proof state:
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝¹⁴ : CommRing R
inst✝¹³ : LieRing L
inst✝¹² : LieAlgebra R L
inst✝¹¹ : LieAlgebra.IsNilpotent R L
inst✝¹⁰ : AddCommGroup M
inst✝⁹ : Module R M
inst✝⁸ : LieRingModule L M
inst✝⁷ : LieModule R L M
inst✝⁶ : Field K
inst✝⁵ : LieAlgebra K L
inst✝⁴ : Module K M
inst✝³ : LieModule K L M
inst✝² : LieAlgebra.IsNilpotent K L
inst✝¹ : FiniteDimensional K M
N : LieSubmodule K L M
inst✝ : IsTriangularizable K L M
y : L
⊢ ⨆ φ, ⨆ k, (Module.End.generalizedEigenspace ((toEndomorphism K L ↥↑N) y) φ) k = ⊤

Next tactic:
rw [← N.toEndomorphism_restrict_eq_toEndomorphism y]
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]
  

Proof state:
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝¹⁴ : CommRing R
inst✝¹³ : LieRing L
inst✝¹² : LieAlgebra R L
inst✝¹¹ : LieAlgebra.IsNilpotent R L
inst✝¹⁰ : AddCommGroup M
inst✝⁹ : Module R M
inst✝⁸ : LieRingModule L M
inst✝⁷ : LieModule R L M
inst✝⁶ : Field K
inst✝⁵ : LieAlgebra K L
inst✝⁴ : Module K M
inst✝³ : LieModule K L M
inst✝² : LieAlgebra.IsNilpotent K L
inst✝¹ : FiniteDimensional K M
N : LieSubmodule K L M
inst✝ : IsTriangularizable K L M
y : L
⊢ ⨆ φ,
      ⨆ k,
        (Module.End.generalizedEigenspace
            (LinearMap.restrict ((toEndomorphism K L M) y)
              (_ :
                ∀ (m : M) (hm : m ∈ ↑N),
                  ((toEndomorphism K L M) y ∘ₗ Submodule.subtype ↑N) { val := m, property := hm } ∈ ↑N))
            φ)
          k =
    ⊤

Next tactic:
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
  

Proof state:
K : Type u_1
R : Type u_2
L : Type u_3
M : Type u_4
inst✝¹⁴ : CommRing R
inst✝¹³ : LieRing L
inst✝¹² : LieAlgebra R L
inst✝¹¹ : LieAlgebra.IsNilpotent R L
inst✝¹⁰ : AddCommGroup M
inst✝⁹ : Module R M
inst✝⁸ : LieRingModule L M
inst✝⁷ : LieModule R L M
inst✝⁶ : Field K
inst✝⁵ : LieAlgebra K L
inst✝⁴ : Module K M
inst✝³ : LieModule K L M
inst✝² : LieAlgebra.IsNilpotent K L
inst✝¹ : FiniteDimensional K M
inst✝ : IsTriangularizable K L M
⊢ ⨆ χ, weightSpace M χ = ⊤

Next tactic:
clear! R
lemma iSup_weightSpace_eq_top [IsTriangularizable K L M] :
    ⨆ χ : L → K, weightSpace M χ = ⊤ := by
  clear! R -- cf https://github.com/leanprover/lean4/issues/2452
  

Proof state:
K : Type u_1
L : Type u_3
M : Type u_4
inst✝⁹ : LieRing L
inst✝⁸ : AddCommGroup M
inst✝⁷ : LieRingModule L M
inst✝⁶ : Field K
inst✝⁵ : LieAlgebra K L
inst✝⁴ : Module K M
inst✝³ : LieModule K L M
inst✝² : LieAlgebra.IsNilpotent K L
inst✝¹ : FiniteDimensional K M
inst✝ : IsTriangularizable K L M
⊢ ⨆ χ, weightSpace M χ = ⊤

Next tactic:
induction' h_dim : finrank K M using Nat.strong_induction_on with n ih generalizing M
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
  

Proof state:
case h
K : Type u_1
L : Type u_3
inst✝⁹ : LieRing L
inst✝⁸ : Field K
inst✝⁷ : LieAlgebra K L
inst✝⁶ : LieAlgebra.IsNilpotent K L
n : ℕ
ih :
  ∀ m < n,
    ∀ (M : Type u_4) [inst : AddCommGroup M] [inst_1 : LieRingModule L M] [inst_2 : Module K M]
      [inst_3 : LieModule K L M] [inst_4 : FiniteDimensional K M] [inst_5 : IsTriangularizable K L M],
      finrank K M = m → ⨆ χ, weightSpace M χ = ⊤
M : Type u_4
inst✝⁵ : AddCommGroup M
inst✝⁴ : LieRingModule L M
inst✝³ : Module K M
inst✝² : LieModule K L M
inst✝¹ : FiniteDimensional K M
inst✝ : IsTriangularizable K L M
h_dim : finrank K M = n
⊢ ⨆ χ, weightSpace M χ = ⊤

Next tactic:
obtain h' | ⟨y : L, hy : ¬ ∃ φ, weightSpaceOf M φ y = ⊤⟩ :=
    forall_or_exists_not (fun (x : L) ↦ ∃ (φ : K), weightSpaceOf M φ x = ⊤)
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 = ⊤)
  · 

Proof state:
case h.inl
K : Type u_1
L : Type u_3
inst✝⁹ : LieRing L
inst✝⁸ : Field K
inst✝⁷ : LieAlgebra K L
inst✝⁶ : LieAlgebra.IsNilpotent K L
n : ℕ
ih :
  ∀ m < n,
    ∀ (M : Type u_4) [inst : AddCommGroup M] [inst_1 : LieRingModule L M] [inst_2 : Module K M]
      [inst_3 : LieModule K L M] [inst_4 : FiniteDimensional K M] [inst_5 : IsTriangularizable K L M],
      finrank K M = m → ⨆ χ, weightSpace M χ = ⊤
M : Type u_4
inst✝⁵ : AddCommGroup M
inst✝⁴ : LieRingModule L M
inst✝³ : Module K M
inst✝² : LieModule K L M
inst✝¹ : FiniteDimensional K M
inst✝ : IsTriangularizable K L M
h_dim : finrank K M = n
h' : ∀ (a : L), ∃ φ, weightSpaceOf M φ a = ⊤
⊢ ⨆ χ, weightSpace M χ = ⊤

Next tactic:
choose χ hχ using h'
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'
    

Proof state:
case h.inl
K : Type u_1
L : Type u_3
inst✝⁹ : LieRing L
inst✝⁸ : Field K
inst✝⁷ : LieAlgebra K L
inst✝⁶ : LieAlgebra.IsNilpotent K L
n : ℕ
ih :
  ∀ m < n,
    ∀ (M : Type u_4) [inst : AddCommGroup M] [inst_1 : LieRingModule L M] [inst_2 : Module K M]
      [inst_3 : LieModule K L M] [inst_4 : FiniteDimensional K M] [inst_5 : IsTriangularizable K L M],
      finrank K M = m → ⨆ χ, weightSpace M χ = ⊤
M : Type u_4
inst✝⁵ : AddCommGroup M
inst✝⁴ : LieRingModule L M
inst✝³ : Module K M
inst✝² : LieModule K L M
inst✝¹ : FiniteDimensional K M
inst✝ : IsTriangularizable K L M
h_dim : finrank K M = n
χ : L → K
hχ : ∀ (a : L), weightSpaceOf M (χ a) a = ⊤
⊢ ⨆ χ, weightSpace M χ = ⊤

Next tactic:
replace hχ : weightSpace M χ = ⊤ := by simpa only [weightSpace, hχ] using iInf_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
  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 

Proof state:
K : Type u_1
L : Type u_3
inst✝⁹ : LieRing L
inst✝⁸ : Field K
inst✝⁷ : LieAlgebra K L
inst✝⁶ : LieAlgebra.IsNilpotent K L
n : ℕ
ih :
  ∀ m < n,
    ∀ (M : Type u_4) [inst : AddCommGroup M] [inst_1 : LieRingModule L M] [inst_2 : Module K M]
      [inst_3 : LieModule K L M] [inst_4 : FiniteDimensional K M] [inst_5 : IsTriangularizable K L M],
      finrank K M = m → ⨆ χ, weightSpace M χ = ⊤
M : Type u_4
inst✝⁵ : AddCommGroup M
inst✝⁴ : LieRingModule L M
inst✝³ : Module K M
inst✝² : LieModule K L M
inst✝¹ : FiniteDimensional K M
inst✝ : IsTriangularizable K L M
h_dim : finrank K M = n
χ : L → K
hχ : ∀ (a : L), weightSpaceOf M (χ a) a = ⊤
⊢ weightSpace M χ = ⊤

Next tactic:
simpa only [weightSpace, hχ] using iInf_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
  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
    

Proof state:
case h.inl
K : Type u_1
L : Type u_3
inst✝⁹ : LieRing L
inst✝⁸ : Field K
inst✝⁷ : LieAlgebra K L
inst✝⁶ : LieAlgebra.IsNilpotent K L
n : ℕ
ih :
  ∀ m < n,
    ∀ (M : Type u_4) [inst : AddCommGroup M] [inst_1 : LieRingModule L M] [inst_2 : Module K M]
      [inst_3 : LieModule K L M] [inst_4 : FiniteDimensional K M] [inst_5 : IsTriangularizable K L M],
      finrank K M = m → ⨆ χ, weightSpace M χ = ⊤
M : Type u_4
inst✝⁵ : AddCommGroup M
inst✝⁴ : LieRingModule L M
inst✝³ : Module K M
inst✝² : LieModule K L M
inst✝¹ : FiniteDimensional K M
inst✝ : IsTriangularizable K L M
h_dim : finrank K M = n
χ : L → K
hχ : weightSpace M χ = ⊤
⊢ ⨆ χ, weightSpace M χ = ⊤

Next tactic:
exact eq_top_iff.mpr <| hχ ▸ le_iSup (weightSpace M) χ