lemma disjoint_generalizedEigenspace [NoZeroSMulDivisors R M]
    (f : End R M) {μ₁ μ₂ : R} (hμ : μ₁ ≠ μ₂) (k l : ℕ) :
    Disjoint (f.generalizedEigenspace μ₁ k) (f.generalizedEigenspace μ₂ l) := by
  nontriviality M
  have := NoZeroSMulDivisors.isReduced R M
  rw [disjoint_iff]
  set p := f.generalizedEigenspace μ₁ k ⊓ f.generalizedEigenspace μ₂ l
  by_contra hp
  replace hp : Nontrivial p := Submodule.nontrivial_iff_ne_bot.mpr hp
  let f₁ : End R p := (f - algebraMap R (End R M) μ₁).restrict <| MapsTo.inter_inter
    (mapsTo_generalizedEigenspace_of_comm (Algebra.mul_sub_algebraMap_commutes f μ₁) μ₁ k)
    (mapsTo_generalizedEigenspace_of_comm (Algebra.mul_sub_algebraMap_commutes f μ₁) μ₂ l)
  let f₂ : End R p := (f - algebraMap R (End R M) μ₂).restrict <| MapsTo.inter_inter
    (mapsTo_generalizedEigenspace_of_comm (Algebra.mul_sub_algebraMap_commutes f μ₂) μ₁ k)
    (mapsTo_generalizedEigenspace_of_comm (Algebra.mul_sub_algebraMap_commutes f μ₂) μ₂ l)
  have : IsNilpotent (f₂ - f₁) := by
    apply Commute.isNilpotent_sub (x := f₂) (y := f₁) _ ⟨l, ?_⟩ ⟨k, ?_⟩
    · ext; simp [smul_sub, sub_sub, smul_comm μ₁, add_sub_left_comm]
    

Proof state:
K R : Type v
V M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : Field K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
inst✝ : NoZeroSMulDivisors R M
f : End R M
μ₁ μ₂ : R
hμ : μ₁ ≠ μ₂
k l : ℕ
✝ : Nontrivial M
this : IsReduced R
p : Submodule R M := (generalizedEigenspace f μ₁) k ⊓ (generalizedEigenspace f μ₂) l
hp : Nontrivial ↥p
f₁ : End R ↥p :=
  LinearMap.restrict (f - (algebraMap R (End R M)) μ₁)
    (_ :
      MapsTo (fun x => (f - (algebraMap R (End R M)) μ₁) x)
        (↑((generalizedEigenspace f μ₁) k) ∩ ↑((generalizedEigenspace f μ₂) l))
        (↑((generalizedEigenspace f μ₁) k) ∩ ↑((generalizedEigenspace f μ₂) l)))
f₂ : End R ↥p :=
  LinearMap.restrict (f - (algebraMap R (End R M)) μ₂)
    (_ :
      MapsTo (fun x => (f - (algebraMap R (End R M)) μ₂) x)
        (↑((generalizedEigenspace f μ₁) k) ∩ ↑((generalizedEigenspace f μ₂) l))
        (↑((generalizedEigenspace f μ₁) k) ∩ ↑((generalizedEigenspace f μ₂) l)))
⊢ f₂ ^ l = 0
K R : Type v
V M : Type w
inst✝⁶ : CommRing R
inst✝⁵ : AddCommGroup M
inst✝⁴ : Module R M
inst✝³ : Field K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
inst✝ : NoZeroSMulDivisors R M
f : End R M
μ₁ μ₂ : R
hμ : μ₁ ≠ μ₂
k l : ℕ
✝ : Nontrivial M
this : IsReduced R
p : Submodule R M := (generalizedEigenspace f μ₁) k ⊓ (generalizedEigenspace f μ₂) l
hp : Nontrivial ↥p
f₁ : End R ↥p :=
  LinearMap.restrict (f - (algebraMap R (End R M)) μ₁)
    (_ :
      MapsTo (fun x => (f - (algebraMap R (End R M)) μ₁) x)
        (↑((generalizedEigenspace f μ₁) k) ∩ ↑((generalizedEigenspace f μ₂) l))
        (↑((generalizedEigenspace f μ₁) k) ∩ ↑((generalizedEigenspace f μ₂) l)))
f₂ : End R ↥p :=
  LinearMap.restrict (f - (algebraMap R (End R M)) μ₂)
    (_ :
      MapsTo (fun x => (f - (algebraMap R (End R M)) μ₂) x)
        (↑((generalizedEigenspace f μ₁) k) ∩ ↑((generalizedEigenspace f μ₂) l))
        (↑((generalizedEigenspace f μ₁) k) ∩ ↑((generalizedEigenspace f μ₂) l)))
⊢ f₁ ^ k = 0

Next tactic:
all_goals ext ⟨x, _, _⟩; simpa [LinearMap.restrict_apply, LinearMap.pow_restrict _] using ‹_›