l3lab/ntp-mathlib huggingface dataset:
theorem independent_generalizedEigenspace [NoZeroSMulDivisors R M] (f : End R M) :
    CompleteLattice.Independent (fun μ ↦ ⨆ k, f.generalizedEigenspace μ k) := by
  classical
  suffices ∀ μ (s : Finset R) (_ : μ ∉ s), Disjoint (⨆ k, f.generalizedEigenspace μ k)
      (s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k) by
    simp_rw [CompleteLattice.independent_iff_supIndep_of_injOn f.injOn_generalizedEigenspace,
      Finset.supIndep_iff_disjoint_erase]
    exact 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, Submodule.eq_bot_iff]
  rintro x ⟨hx, hx'⟩
  simp only [SetLike.mem_coe] at hx hx'
  suffices x ∈ ⨆ k, generalizedEigenspace f μ₂ k by
    rw [← Submodule.mem_bot (R := R), ← (f.disjoint_iSup_generalizedEigenspace hμ₁₂).eq_bot]
    exact ⟨hx, this⟩
  obtain ⟨y, hy, z, hz, rfl⟩ := Submodule.mem_sup.mp hx'; clear hx'
  let g := f - algebraMap R (End R M) μ₂
  obtain ⟨k : ℕ, hk : (g ^ k) y = 0⟩ := by simpa using hy
  have hyz : (g ^ k) (y + z) ∈
      (⨆ k, generalizedEigenspace f μ₁ k) ⊓ s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k := by
    refine ⟨f.mapsTo_iSup_generalizedEigenspace_of_comm ?_ μ₁ hx, ?_⟩
    · exact Algebra.mul_sub_algebraMap_pow_commutes f μ₂ k
    · rw [SetLike.mem_coe, map_add, hk, zero_add]
      suffices (s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k).map (g ^ k) ≤
          s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k by exact this (Submodule.mem_map_of_mem hz)
      simp_rw [Finset.sup_eq_iSup, Submodule.map_iSup (ι := R), Submodule.map_iSup (ι := _ ∈ s)]
      refine iSup₂_mono fun μ _ ↦ ?_
      rintro - ⟨u, hu, rfl⟩
      refine f.mapsTo_iSup_generalizedEigenspace_of_comm ?_ μ hu
      

Proof state:
case refine_2.intro.intro
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
s : Finset R
a✝ : μ₂ ∉ s
hμ₁₂✝ : μ₁ ∉ insert μ₂ s
hμ₁₂ : μ₁ ≠ μ₂
hμ₁ : μ₁ ∉ s
ih : Disjoint (⨆ k, (generalizedEigenspace f μ₁) k) (Finset.sup s fun μ => ⨆ k, (generalizedEigenspace f μ) k)
y : M
hy : y ∈ ⨆ k, (generalizedEigenspace f μ₂) k
z : M
hz : z ∈ Finset.sup s fun μ => ⨆ k, (generalizedEigenspace f μ) k
hx : y + z ∈ ⨆ k, (generalizedEigenspace f μ₁) k
g : End R M := f - (algebraMap R (End R M)) μ₂
k : ℕ
hk : (g ^ k) y = 0
μ : R
x✝ : μ ∈ s
u : M
hu : u ∈ ↑(⨆ k, (generalizedEigenspace f μ) k)
⊢ Commute f ((f - (algebraMap R (End R M)) μ₂) ^ k)

Next tactic:
exact Algebra.mul_sub_algebraMap_pow_commutes f μ₂ k
theorem independent_generalizedEigenspace [NoZeroSMulDivisors R M] (f : End R M) :
    CompleteLattice.Independent (fun μ ↦ ⨆ k, f.generalizedEigenspace μ k) := by
  classical
  suffices ∀ μ (s : Finset R) (_ : μ ∉ s), Disjoint (⨆ k, f.generalizedEigenspace μ k)
      (s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k) by
    simp_rw [CompleteLattice.independent_iff_supIndep_of_injOn f.injOn_generalizedEigenspace,
      Finset.supIndep_iff_disjoint_erase]
    exact 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, Submodule.eq_bot_iff]
  rintro x ⟨hx, hx'⟩
  simp only [SetLike.mem_coe] at hx hx'
  suffices x ∈ ⨆ k, generalizedEigenspace f μ₂ k by
    rw [← Submodule.mem_bot (R := R), ← (f.disjoint_iSup_generalizedEigenspace hμ₁₂).eq_bot]
    exact ⟨hx, this⟩
  obtain ⟨y, hy, z, hz, rfl⟩ := Submodule.mem_sup.mp hx'; clear hx'
  let g := f - algebraMap R (End R M) μ₂
  obtain ⟨k : ℕ, hk : (g ^ k) y = 0⟩ := by simpa using hy
  have hyz : (g ^ k) (y + z) ∈
      (⨆ k, generalizedEigenspace f μ₁ k) ⊓ s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k := by
    refine ⟨f.mapsTo_iSup_generalizedEigenspace_of_comm ?_ μ₁ hx, ?_⟩
    · exact Algebra.mul_sub_algebraMap_pow_commutes f μ₂ k
    · rw [SetLike.mem_coe, map_add, hk, zero_add]
      suffices (s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k).map (g ^ k) ≤
          s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k by exact this (Submodule.mem_map_of_mem hz)
      simp_rw [Finset.sup_eq_iSup, Submodule.map_iSup (ι := R), Submodule.map_iSup (ι := _ ∈ s)]
      refine iSup₂_mono fun μ _ ↦ ?_
      rintro - ⟨u, hu, rfl⟩
      refine f.mapsTo_iSup_generalizedEigenspace_of_comm ?_ μ hu
      exact Algebra.mul_sub_algebraMap_pow_commutes f μ₂ k
  

Proof state:
case insert.intro.intro.intro.intro.intro.intro.intro
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
s : Finset R
a✝ : μ₂ ∉ s
hμ₁₂✝ : μ₁ ∉ insert μ₂ s
hμ₁₂ : μ₁ ≠ μ₂
hμ₁ : μ₁ ∉ s
ih : Disjoint (⨆ k, (generalizedEigenspace f μ₁) k) (Finset.sup s fun μ => ⨆ k, (generalizedEigenspace f μ) k)
y : M
hy : y ∈ ⨆ k, (generalizedEigenspace f μ₂) k
z : M
hz : z ∈ Finset.sup s fun μ => ⨆ k, (generalizedEigenspace f μ) k
hx : y + z ∈ ⨆ k, (generalizedEigenspace f μ₁) k
g : End R M := f - (algebraMap R (End R M)) μ₂
k : ℕ
hk : (g ^ k) y = 0
hyz : (g ^ k) (y + z) ∈ (⨆ k, (generalizedEigenspace f μ₁) k) ⊓ Finset.sup s fun μ => ⨆ k, (generalizedEigenspace f μ) k
⊢ y + z ∈ ⨆ k, (generalizedEigenspace f μ₂) k

Next tactic:
rw [ih.eq_bot, Submodule.mem_bot] at hyz
theorem independent_generalizedEigenspace [NoZeroSMulDivisors R M] (f : End R M) :
    CompleteLattice.Independent (fun μ ↦ ⨆ k, f.generalizedEigenspace μ k) := by
  classical
  suffices ∀ μ (s : Finset R) (_ : μ ∉ s), Disjoint (⨆ k, f.generalizedEigenspace μ k)
      (s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k) by
    simp_rw [CompleteLattice.independent_iff_supIndep_of_injOn f.injOn_generalizedEigenspace,
      Finset.supIndep_iff_disjoint_erase]
    exact 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, Submodule.eq_bot_iff]
  rintro x ⟨hx, hx'⟩
  simp only [SetLike.mem_coe] at hx hx'
  suffices x ∈ ⨆ k, generalizedEigenspace f μ₂ k by
    rw [← Submodule.mem_bot (R := R), ← (f.disjoint_iSup_generalizedEigenspace hμ₁₂).eq_bot]
    exact ⟨hx, this⟩
  obtain ⟨y, hy, z, hz, rfl⟩ := Submodule.mem_sup.mp hx'; clear hx'
  let g := f - algebraMap R (End R M) μ₂
  obtain ⟨k : ℕ, hk : (g ^ k) y = 0⟩ := by simpa using hy
  have hyz : (g ^ k) (y + z) ∈
      (⨆ k, generalizedEigenspace f μ₁ k) ⊓ s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k := by
    refine ⟨f.mapsTo_iSup_generalizedEigenspace_of_comm ?_ μ₁ hx, ?_⟩
    · exact Algebra.mul_sub_algebraMap_pow_commutes f μ₂ k
    · rw [SetLike.mem_coe, map_add, hk, zero_add]
      suffices (s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k).map (g ^ k) ≤
          s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k by exact this (Submodule.mem_map_of_mem hz)
      simp_rw [Finset.sup_eq_iSup, Submodule.map_iSup (ι := R), Submodule.map_iSup (ι := _ ∈ s)]
      refine iSup₂_mono fun μ _ ↦ ?_
      rintro - ⟨u, hu, rfl⟩
      refine f.mapsTo_iSup_generalizedEigenspace_of_comm ?_ μ hu
      exact Algebra.mul_sub_algebraMap_pow_commutes f μ₂ k
  rw [ih.eq_bot, Submodule.mem_bot] at hyz
  

Proof state:
case insert.intro.intro.intro.intro.intro.intro.intro
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
s : Finset R
a✝ : μ₂ ∉ s
hμ₁₂✝ : μ₁ ∉ insert μ₂ s
hμ₁₂ : μ₁ ≠ μ₂
hμ₁ : μ₁ ∉ s
ih : Disjoint (⨆ k, (generalizedEigenspace f μ₁) k) (Finset.sup s fun μ => ⨆ k, (generalizedEigenspace f μ) k)
y : M
hy : y ∈ ⨆ k, (generalizedEigenspace f μ₂) k
z : M
hz : z ∈ Finset.sup s fun μ => ⨆ k, (generalizedEigenspace f μ) k
hx : y + z ∈ ⨆ k, (generalizedEigenspace f μ₁) k
g : End R M := f - (algebraMap R (End R M)) μ₂
k : ℕ
hk : (g ^ k) y = 0
hyz : (g ^ k) (y + z) = 0
⊢ y + z ∈ ⨆ k, (generalizedEigenspace f μ₂) k

Next tactic:
simp_rw [Submodule.mem_iSup_of_chain, mem_generalizedEigenspace]
theorem independent_generalizedEigenspace [NoZeroSMulDivisors R M] (f : End R M) :
    CompleteLattice.Independent (fun μ ↦ ⨆ k, f.generalizedEigenspace μ k) := by
  classical
  suffices ∀ μ (s : Finset R) (_ : μ ∉ s), Disjoint (⨆ k, f.generalizedEigenspace μ k)
      (s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k) by
    simp_rw [CompleteLattice.independent_iff_supIndep_of_injOn f.injOn_generalizedEigenspace,
      Finset.supIndep_iff_disjoint_erase]
    exact 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, Submodule.eq_bot_iff]
  rintro x ⟨hx, hx'⟩
  simp only [SetLike.mem_coe] at hx hx'
  suffices x ∈ ⨆ k, generalizedEigenspace f μ₂ k by
    rw [← Submodule.mem_bot (R := R), ← (f.disjoint_iSup_generalizedEigenspace hμ₁₂).eq_bot]
    exact ⟨hx, this⟩
  obtain ⟨y, hy, z, hz, rfl⟩ := Submodule.mem_sup.mp hx'; clear hx'
  let g := f - algebraMap R (End R M) μ₂
  obtain ⟨k : ℕ, hk : (g ^ k) y = 0⟩ := by simpa using hy
  have hyz : (g ^ k) (y + z) ∈
      (⨆ k, generalizedEigenspace f μ₁ k) ⊓ s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k := by
    refine ⟨f.mapsTo_iSup_generalizedEigenspace_of_comm ?_ μ₁ hx, ?_⟩
    · exact Algebra.mul_sub_algebraMap_pow_commutes f μ₂ k
    · rw [SetLike.mem_coe, map_add, hk, zero_add]
      suffices (s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k).map (g ^ k) ≤
          s.sup fun μ ↦ ⨆ k, f.generalizedEigenspace μ k by exact this (Submodule.mem_map_of_mem hz)
      simp_rw [Finset.sup_eq_iSup, Submodule.map_iSup (ι := R), Submodule.map_iSup (ι := _ ∈ s)]
      refine iSup₂_mono fun μ _ ↦ ?_
      rintro - ⟨u, hu, rfl⟩
      refine f.mapsTo_iSup_generalizedEigenspace_of_comm ?_ μ hu
      exact Algebra.mul_sub_algebraMap_pow_commutes f μ₂ k
  rw [ih.eq_bot, Submodule.mem_bot] at hyz
  simp_rw [Submodule.mem_iSup_of_chain, mem_generalizedEigenspace]
  

Proof state:
case insert.intro.intro.intro.intro.intro.intro.intro
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
s : Finset R
a✝ : μ₂ ∉ s
hμ₁₂✝ : μ₁ ∉ insert μ₂ s
hμ₁₂ : μ₁ ≠ μ₂
hμ₁ : μ₁ ∉ s
ih : Disjoint (⨆ k, (generalizedEigenspace f μ₁) k) (Finset.sup s fun μ => ⨆ k, (generalizedEigenspace f μ) k)
y : M
hy : y ∈ ⨆ k, (generalizedEigenspace f μ₂) k
z : M
hz : z ∈ Finset.sup s fun μ => ⨆ k, (generalizedEigenspace f μ) k
hx : y + z ∈ ⨆ k, (generalizedEigenspace f μ₁) k
g : End R M := f - (algebraMap R (End R M)) μ₂
k : ℕ
hk : (g ^ k) y = 0
hyz : (g ^ k) (y + z) = 0
⊢ ∃ k, ((f - μ₂ • 1) ^ k) (y + z) = 0

Next tactic:
exact ⟨k, hyz⟩
/-- If `f` maps a subspace `p` into itself, then the generalized eigenspace of the restriction
    of `f` to `p` is the part of the generalized eigenspace of `f` that lies in `p`. -/
theorem generalizedEigenspace_restrict (f : End R M) (p : Submodule R M) (k : ℕ) (μ : R)
    (hfp : ∀ x : M, x ∈ p → f x ∈ p) :
    generalizedEigenspace (LinearMap.restrict f hfp) μ k =
      Submodule.comap p.subtype (f.generalizedEigenspace μ k) := by
  

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
f : End R M
p : Submodule R M
k : ℕ
μ : R
hfp : ∀ x ∈ p, f x ∈ p
⊢ (generalizedEigenspace (LinearMap.restrict f hfp) μ) k =
    Submodule.comap (Submodule.subtype p) ((generalizedEigenspace f μ) k)

Next tactic:
simp only [generalizedEigenspace, OrderHom.coe_mk, ← LinearMap.ker_comp]
/-- If `f` maps a subspace `p` into itself, then the generalized eigenspace of the restriction
    of `f` to `p` is the part of the generalized eigenspace of `f` that lies in `p`. -/
theorem generalizedEigenspace_restrict (f : End R M) (p : Submodule R M) (k : ℕ) (μ : R)
    (hfp : ∀ x : M, x ∈ p → f x ∈ p) :
    generalizedEigenspace (LinearMap.restrict f hfp) μ k =
      Submodule.comap p.subtype (f.generalizedEigenspace μ k) := by
  simp only [generalizedEigenspace, OrderHom.coe_mk, ← LinearMap.ker_comp]
  

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
f : End R M
p : Submodule R M
k : ℕ
μ : R
hfp : ∀ x ∈ p, f x ∈ p
⊢ LinearMap.ker ((LinearMap.restrict f hfp - (algebraMap R (End R ↥p)) μ) ^ k) =
    LinearMap.ker (((f - (algebraMap R (End R M)) μ) ^ k) ∘ₗ Submodule.subtype p)

Next tactic:
induction' k with k ih
/-- If `f` maps a subspace `p` into itself, then the generalized eigenspace of the restriction
    of `f` to `p` is the part of the generalized eigenspace of `f` that lies in `p`. -/
theorem generalizedEigenspace_restrict (f : End R M) (p : Submodule R M) (k : ℕ) (μ : R)
    (hfp : ∀ x : M, x ∈ p → f x ∈ p) :
    generalizedEigenspace (LinearMap.restrict f hfp) μ k =
      Submodule.comap p.subtype (f.generalizedEigenspace μ k) := by
  simp only [generalizedEigenspace, OrderHom.coe_mk, ← LinearMap.ker_comp]
  induction' k with k ih
  · 

Proof state:
case zero
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
f : End R M
p : Submodule R M
μ : R
hfp : ∀ x ∈ p, f x ∈ p
⊢ LinearMap.ker ((LinearMap.restrict f hfp - (algebraMap R (End R ↥p)) μ) ^ Nat.zero) =
    LinearMap.ker (((f - (algebraMap R (End R M)) μ) ^ Nat.zero) ∘ₗ Submodule.subtype p)

Next tactic:
rw [pow_zero, pow_zero, LinearMap.one_eq_id]
/-- If `f` maps a subspace `p` into itself, then the generalized eigenspace of the restriction
    of `f` to `p` is the part of the generalized eigenspace of `f` that lies in `p`. -/
theorem generalizedEigenspace_restrict (f : End R M) (p : Submodule R M) (k : ℕ) (μ : R)
    (hfp : ∀ x : M, x ∈ p → f x ∈ p) :
    generalizedEigenspace (LinearMap.restrict f hfp) μ k =
      Submodule.comap p.subtype (f.generalizedEigenspace μ k) := by
  simp only [generalizedEigenspace, OrderHom.coe_mk, ← LinearMap.ker_comp]
  induction' k with k ih
  · rw [pow_zero, pow_zero, LinearMap.one_eq_id]
    

Proof state:
case zero
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
f : End R M
p : Submodule R M
μ : R
hfp : ∀ x ∈ p, f x ∈ p
⊢ LinearMap.ker LinearMap.id = LinearMap.ker (1 ∘ₗ Submodule.subtype p)

Next tactic:
apply (Submodule.ker_subtype _).symm
/-- If `f` maps a subspace `p` into itself, then the generalized eigenspace of the restriction
    of `f` to `p` is the part of the generalized eigenspace of `f` that lies in `p`. -/
theorem generalizedEigenspace_restrict (f : End R M) (p : Submodule R M) (k : ℕ) (μ : R)
    (hfp : ∀ x : M, x ∈ p → f x ∈ p) :
    generalizedEigenspace (LinearMap.restrict f hfp) μ k =
      Submodule.comap p.subtype (f.generalizedEigenspace μ k) := by
  simp only [generalizedEigenspace, OrderHom.coe_mk, ← LinearMap.ker_comp]
  induction' k with k ih
  · rw [pow_zero, pow_zero, LinearMap.one_eq_id]
    apply (Submodule.ker_subtype _).symm
  · 

Proof state:
case succ
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
f : End R M
p : Submodule R M
μ : R
hfp : ∀ x ∈ p, f x ∈ p
k : ℕ
ih :
  LinearMap.ker ((LinearMap.restrict f hfp - (algebraMap R (End R ↥p)) μ) ^ k) =
    LinearMap.ker (((f - (algebraMap R (End R M)) μ) ^ k) ∘ₗ Submodule.subtype p)
⊢ LinearMap.ker ((LinearMap.restrict f hfp - (algebraMap R (End R ↥p)) μ) ^ Nat.succ k) =
    LinearMap.ker (((f - (algebraMap R (End R M)) μ) ^ Nat.succ k) ∘ₗ Submodule.subtype p)

Next tactic:
erw [pow_succ', pow_succ', LinearMap.ker_comp, LinearMap.ker_comp, ih, ← LinearMap.ker_comp,
      LinearMap.comp_assoc]
lemma _root_.Submodule.inf_generalizedEigenspace (f : End R M) (p : Submodule R M) {k : ℕ} {μ : R}
    (hfp : ∀ x : M, x ∈ p → f x ∈ p) :
    p ⊓ f.generalizedEigenspace μ k =
      (generalizedEigenspace (LinearMap.restrict f hfp) μ k).map p.subtype := by
  

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
f : End R M
p : Submodule R M
k : ℕ
μ : R
hfp : ∀ x ∈ p, f x ∈ p
⊢ p ⊓ (generalizedEigenspace f μ) k =
    Submodule.map (Submodule.subtype p) ((generalizedEigenspace (LinearMap.restrict f hfp) μ) k)

Next tactic:
rw [f.generalizedEigenspace_restrict _ _ _ hfp, Submodule.map_comap_eq, Submodule.range_subtype]
/-- If `p` is an invariant submodule of an endomorphism `f`, then the `μ`-eigenspace of the
restriction of `f` to `p` is a submodule of the `μ`-eigenspace of `f`. -/
theorem eigenspace_restrict_le_eigenspace (f : End R M) {p : Submodule R M} (hfp : ∀ x ∈ p, f x ∈ p)
    (μ : R) : (eigenspace (f.restrict hfp) μ).map p.subtype ≤ f.eigenspace μ := by
  

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
f : End R M
p : Submodule R M
hfp : ∀ x ∈ p, f x ∈ p
μ : R
⊢ Submodule.map (Submodule.subtype p) (eigenspace (LinearMap.restrict f hfp) μ) ≤ eigenspace f μ

Next tactic:
rintro a ⟨x, hx, rfl⟩
/-- If `p` is an invariant submodule of an endomorphism `f`, then the `μ`-eigenspace of the
restriction of `f` to `p` is a submodule of the `μ`-eigenspace of `f`. -/
theorem eigenspace_restrict_le_eigenspace (f : End R M) {p : Submodule R M} (hfp : ∀ x ∈ p, f x ∈ p)
    (μ : R) : (eigenspace (f.restrict hfp) μ).map p.subtype ≤ f.eigenspace μ := by
  rintro a ⟨x, hx, rfl⟩
  

Proof state:
case intro.intro
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
f : End R M
p : Submodule R M
hfp : ∀ x ∈ p, f x ∈ p
μ : R
x : ↥p
hx : x ∈ ↑(eigenspace (LinearMap.restrict f hfp) μ)
⊢ (Submodule.subtype p) x ∈ eigenspace f μ

Next tactic:
simp only [SetLike.mem_coe, mem_eigenspace_iff, LinearMap.restrict_apply] at hx ⊢
/-- If `p` is an invariant submodule of an endomorphism `f`, then the `μ`-eigenspace of the
restriction of `f` to `p` is a submodule of the `μ`-eigenspace of `f`. -/
theorem eigenspace_restrict_le_eigenspace (f : End R M) {p : Submodule R M} (hfp : ∀ x ∈ p, f x ∈ p)
    (μ : R) : (eigenspace (f.restrict hfp) μ).map p.subtype ≤ f.eigenspace μ := by
  rintro a ⟨x, hx, rfl⟩
  simp only [SetLike.mem_coe, mem_eigenspace_iff, LinearMap.restrict_apply] at hx ⊢
  

Proof state:
case intro.intro
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
f : End R M
p : Submodule R M
hfp : ∀ x ∈ p, f x ∈ p
μ : R
x : ↥p
hx : { val := f ↑x, property := (_ : f ↑x ∈ p) } = μ • x
⊢ f ((Submodule.subtype p) x) = μ • (Submodule.subtype p) x

Next tactic:
exact congr_arg Subtype.val hx
/-- Generalized eigenrange and generalized eigenspace for exponent `finrank K V` are disjoint. -/
theorem generalized_eigenvec_disjoint_range_ker [FiniteDimensional K V] (f : End K V) (μ : K) :
    Disjoint (f.generalizedEigenrange μ (finrank K V))
      (f.generalizedEigenspace μ (finrank K V)) := by
  

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✝ : FiniteDimensional K V
f : End K V
μ : K
⊢ Disjoint (generalizedEigenrange f μ (finrank K V)) ((generalizedEigenspace f μ) (finrank K V))

Next tactic:
have h :=
    calc
      Submodule.comap ((f - algebraMap _ _ μ) ^ finrank K V)
        (f.generalizedEigenspace μ (finrank K V)) =
          LinearMap.ker ((f - algebraMap _ _ μ) ^ finrank K V *
            (f - algebraMap K (End K V) μ) ^ finrank K V) := by
              rw [generalizedEigenspace, OrderHom.coe_mk, ← LinearMap.ker_comp]; rfl
      _ = f.generalizedEigenspace μ (finrank K V + finrank K V) := by rw [← pow_add]; rfl
      _ = f.generalizedEigenspace μ (finrank K V) := by
        rw [generalizedEigenspace_eq_generalizedEigenspace_finrank_of_le]; linarith
/-- Generalized eigenrange and generalized eigenspace for exponent `finrank K V` are disjoint. -/
theorem generalized_eigenvec_disjoint_range_ker [FiniteDimensional K V] (f : End K V) (μ : K) :
    Disjoint (f.generalizedEigenrange μ (finrank K V))
      (f.generalizedEigenspace μ (finrank K V)) := by
  have h :=
    calc
      Submodule.comap ((f - algebraMap _ _ μ) ^ finrank K V)
        (f.generalizedEigenspace μ (finrank K V)) =
          LinearMap.ker ((f - algebraMap _ _ μ) ^ finrank K V *
            (f - algebraMap K (End K V) μ) ^ finrank K V) := by
              

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✝ : FiniteDimensional K V
f : End K V
μ : K
⊢ Submodule.comap ((f - (algebraMap K (End K V)) μ) ^ finrank K V) ((generalizedEigenspace f μ) (finrank K V)) =
    LinearMap.ker ((f - (algebraMap K (End K V)) μ) ^ finrank K V * (f - (algebraMap K (End K V)) μ) ^ finrank K V)

Next tactic:
rw [generalizedEigenspace, OrderHom.coe_mk, ← LinearMap.ker_comp]
/-- Generalized eigenrange and generalized eigenspace for exponent `finrank K V` are disjoint. -/
theorem generalized_eigenvec_disjoint_range_ker [FiniteDimensional K V] (f : End K V) (μ : K) :
    Disjoint (f.generalizedEigenrange μ (finrank K V))
      (f.generalizedEigenspace μ (finrank K V)) := by
  have h :=
    calc
      Submodule.comap ((f - algebraMap _ _ μ) ^ finrank K V)
        (f.generalizedEigenspace μ (finrank K V)) =
          LinearMap.ker ((f - algebraMap _ _ μ) ^ finrank K V *
            (f - algebraMap K (End K V) μ) ^ finrank K V) := by
              rw [generalizedEigenspace, OrderHom.coe_mk, ← LinearMap.ker_comp]; 

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✝ : FiniteDimensional K V
f : End K V
μ : K
⊢ LinearMap.ker (((f - (algebraMap K (End K V)) μ) ^ finrank K V) ∘ₗ (f - (algebraMap K (End K V)) μ) ^ finrank K V) =
    LinearMap.ker ((f - (algebraMap K (End K V)) μ) ^ finrank K V * (f - (algebraMap K (End K V)) μ) ^ finrank K V)

Next tactic:
rfl
/-- Generalized eigenrange and generalized eigenspace for exponent `finrank K V` are disjoint. -/
theorem generalized_eigenvec_disjoint_range_ker [FiniteDimensional K V] (f : End K V) (μ : K) :
    Disjoint (f.generalizedEigenrange μ (finrank K V))
      (f.generalizedEigenspace μ (finrank K V)) := by
  have h :=
    calc
      Submodule.comap ((f - algebraMap _ _ μ) ^ finrank K V)
        (f.generalizedEigenspace μ (finrank K V)) =
          LinearMap.ker ((f - algebraMap _ _ μ) ^ finrank K V *
            (f - algebraMap K (End K V) μ) ^ finrank K V) := by
              rw [generalizedEigenspace, OrderHom.coe_mk, ← LinearMap.ker_comp]; rfl
      _ = f.generalizedEigenspace μ (finrank K V + finrank K V) := by 

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✝ : FiniteDimensional K V
f : End K V
μ : K
⊢ LinearMap.ker ((f - (algebraMap K (End K V)) μ) ^ finrank K V * (f - (algebraMap K (End K V)) μ) ^ finrank K V) =
    (generalizedEigenspace f μ) (finrank K V + finrank K V)

Next tactic:
rw [← pow_add]