Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit b62dd28

Browse files
committed
feat(linear_algebra/eigenspace): beginning to relate minimal polynomials to eigenvalues (#4165)
rephrases some lemmas in `linear_algebra` to use `aeval` instead of `eval2` and `algebra_map` shows that an eigenvalue of a linear transformation is a root of its minimal polynomial, and vice versa
1 parent 265c587 commit b62dd28

File tree

4 files changed

+117
-25
lines changed

4 files changed

+117
-25
lines changed

src/data/polynomial/algebra_map.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,4 +217,10 @@ theorem not_is_unit_X_sub_C [nontrivial R] {r : R} : ¬ is_unit (X - C r) :=
217217

218218
end ring
219219

220+
lemma aeval_endomorphism {M : Type*}
221+
[comm_ring R] [add_comm_group M] [module R M]
222+
(f : M →ₗ[R] M) (v : M) (p : polynomial R) :
223+
aeval f p v = p.sum (λ n b, b • (f ^ n) v) :=
224+
eval₂_endomorphism_algebra_map f v p
225+
220226
end polynomial

src/linear_algebra/eigenspace.lean

Lines changed: 78 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Author: Alexander Bentkamp.
66

77
import field_theory.algebraic_closure
88
import linear_algebra.finsupp
9+
import linear_algebra.matrix
910

1011
/-!
1112
# Eigenvectors and eigenvalues
@@ -82,27 +83,82 @@ calc
8283
... = (b • (f - b⁻¹ • am a)).ker : by rw linear_map.ker_smul _ b hb
8384
... = (b • f - am a).ker : by rw [smul_sub, smul_inv_smul' hb]
8485

85-
lemma eigenspace_eval₂_polynomial_degree_1 [field K] [vector_space K V]
86+
lemma eigenspace_aeval_polynomial_degree_1 [field K] [vector_space K V]
8687
(f : End K V) (q : polynomial K) (hq : degree q = 1) :
87-
eigenspace f (- q.coeff 0 / q.leading_coeff) = (eval₂ am f q).ker :=
88+
eigenspace f (- q.coeff 0 / q.leading_coeff) = (aeval f q).ker :=
8889
calc
8990
eigenspace f (- q.coeff 0 / q.leading_coeff) = (q.leading_coeff • f - am (- q.coeff 0)).ker
9091
: by { rw eigenspace_div, intro h, rw leading_coeff_eq_zero_iff_deg_eq_bot.1 h at hq, cases hq }
91-
... = (eval₂ am f (C q.leading_coeff * X + C (q.coeff 0))).ker
92-
: by { rw C_mul', simpa [algebra_map, algebra.to_ring_hom] }
93-
... = (eval₂ am f q).ker
92+
... = (aeval f (C q.leading_coeff * X + C (q.coeff 0))).ker
93+
: by { rw [C_mul', aeval_def], simpa [algebra_map, algebra.to_ring_hom], }
94+
... = (aeval f q).ker
9495
: by { congr, apply (eq_X_add_C_of_degree_eq_one hq).symm }
9596

96-
lemma ker_eval₂_ring_hom'_unit_polynomial [field K] [vector_space K V]
97+
lemma ker_aeval_ring_hom'_unit_polynomial [field K] [vector_space K V]
9798
(f : End K V) (c : units (polynomial K)) :
98-
((eval₂_ring_hom' am algebra.commutes f) ↑c).ker = ⊥ :=
99+
(aeval f (c : polynomial K)).ker = ⊥ :=
99100
begin
100101
rw polynomial.eq_C_of_degree_eq_zero (degree_coe_units c),
101-
simp only [eval₂_ring_hom', ring_hom.of, ring_hom.coe_mk, eval₂_C],
102+
simp only [aeval_def, eval₂_C],
102103
apply ker_algebra_map_End,
103104
apply coeff_coe_units_zero_ne_zero c
104105
end
105106

107+
theorem aeval_apply_of_has_eigenvector [field K] [vector_space K V] {f : End K V}
108+
{p : polynomial K} {μ : K} {x : V} (h : f.has_eigenvector μ x) :
109+
aeval f p x = (p.eval μ) • x :=
110+
begin
111+
apply p.induction_on,
112+
{ intro a, simp [module.algebra_map_End_apply] },
113+
{ intros p q hp hq, simp [hp, hq, add_smul] },
114+
{ intros n a hna,
115+
rw [mul_comm, pow_succ, mul_assoc, alg_hom.map_mul, linear_map.mul_app, mul_comm, hna],
116+
simp [algebra_map_End_apply, mem_eigenspace_iff.1 h.2, smul_smul, mul_comm] }
117+
end
118+
119+
section minimal_polynomial
120+
121+
variables [field K] [vector_space K V] [finite_dimensional K V] (f : End K V)
122+
123+
protected theorem is_integral : is_integral K f :=
124+
is_integral_of_noetherian (by apply_instance) f
125+
126+
variables {f} {μ : K}
127+
128+
theorem is_root_of_has_eigenvalue (h : f.has_eigenvalue μ) :
129+
(minimal_polynomial f.is_integral).is_root μ :=
130+
begin
131+
rcases (submodule.ne_bot_iff _).1 h with ⟨w, ⟨H, ne0⟩⟩,
132+
refine or.resolve_right (smul_eq_zero.1 _) ne0,
133+
simp [← aeval_apply_of_has_eigenvector ⟨ne0, H⟩, minimal_polynomial.aeval f.is_integral],
134+
end
135+
136+
theorem has_eigenvalue_of_is_root (h : (minimal_polynomial f.is_integral).is_root μ) :
137+
f.has_eigenvalue μ :=
138+
begin
139+
cases dvd_iff_is_root.2 h with p hp,
140+
rw [has_eigenvalue, eigenspace],
141+
intro con,
142+
cases (linear_map.is_unit_iff _).2 con with u hu,
143+
have p_ne_0 : p ≠ 0,
144+
{ intro con,
145+
apply minimal_polynomial.ne_zero f.is_integral,
146+
rw [hp, con, mul_zero] },
147+
have h_deg := minimal_polynomial.degree_le_of_ne_zero f.is_integral p_ne_0 _,
148+
{ rw [hp, degree_mul, degree_X_sub_C, polynomial.degree_eq_nat_degree p_ne_0] at h_deg,
149+
norm_cast at h_deg,
150+
linarith, },
151+
{ have h_aeval := minimal_polynomial.aeval f.is_integral,
152+
revert h_aeval,
153+
simp [hp, ← hu] },
154+
end
155+
156+
theorem has_eigenvalue_iff_is_root :
157+
f.has_eigenvalue μ ↔ (minimal_polynomial f.is_integral).is_root μ :=
158+
⟨is_root_of_has_eigenvalue, has_eigenvalue_of_is_root⟩
159+
160+
end minimal_polynomial
161+
106162
/-- Every linear operator on a vector space over an algebraically closed field has
107163
an eigenvalue. (Axler's Theorem 2.1.) -/
108164
lemma exists_eigenvalue
@@ -118,35 +174,34 @@ begin
118174
have h_lin_dep : ¬ linear_independent K (λ n : ℕ, (f ^ n) v),
119175
{ apply not_linear_independent_of_infinite, },
120176
-- Therefore, there must be a nonzero polynomial `p` such that `p(f) v = 0`.
121-
obtain ⟨p, h_eval_p, h_p_ne_0⟩ : ∃ p, eval₂ am f p v = 0 ∧ p ≠ 0,
122-
{ simp only [not_imp.symm],
123-
exact not_forall.1 (λ h, h_lin_dep ((linear_independent_powers_iff_eval₂ f v).2 h)) },
124-
-- Then `p(f)` is not invertible.
125-
have h_eval_p_not_unit : eval₂_ring_hom' am _ f p ∉ is_unit.submonoid (End K V),
177+
obtain ⟨p, ⟨h_mon, h_eval_p⟩⟩ := f.is_integral,
178+
have h_eval_p_not_unit : aeval f p ∉ is_unit.submonoid (End K V),
126179
{ rw [is_unit.mem_submonoid_iff, linear_map.is_unit_iff, linear_map.ker_eq_bot'],
127180
intro h,
128-
exact hv (h v h_eval_p) },
181+
apply hv (h v _),
182+
rw [h_eval_p, linear_map.zero_apply] },
129183
-- Hence, there must be a factor `q` of `p` such that `q(f)` is not invertible.
130-
obtain ⟨q, hq_factor, hq_nonunit⟩ : ∃ q, q ∈ factors p ∧ ¬ is_unit (eval₂ am f q),
184+
obtain ⟨q, hq_factor, hq_nonunit⟩ : ∃ q, q ∈ factors p ∧ ¬ is_unit (aeval f q),
131185
{ simp only [←not_imp, (is_unit.mem_submonoid_iff _).symm],
132-
apply not_forall.1 (λ h, h_eval_p_not_unit (ring_hom_mem_submonoid_of_factors_subset_of_units_subset
186+
apply not_forall.1 (λ h, h_eval_p_not_unit
187+
(ring_hom_mem_submonoid_of_factors_subset_of_units_subset
133188
(eval₂_ring_hom' am algebra.commutes f)
134-
(is_unit.submonoid (End K V)) p h_p_ne_0 h _)),
189+
(is_unit.submonoid (End K V)) p h_mon.ne_zero h _)),
135190
simp only [is_unit.mem_submonoid_iff, linear_map.is_unit_iff],
136-
apply ker_eval₂_ring_hom'_unit_polynomial },
191+
apply ker_aeval_ring_hom'_unit_polynomial },
137192
-- Since the field is algebraically closed, `q` has degree 1.
138193
have h_deg_q : q.degree = 1 := is_alg_closed.degree_eq_one_of_irreducible _
139-
(ne_zero_of_mem_factors h_p_ne_0 hq_factor)
140-
((factors_spec p h_p_ne_0).1 q hq_factor),
194+
(ne_zero_of_mem_factors h_mon.ne_zero hq_factor)
195+
((factors_spec p h_mon.ne_zero).1 q hq_factor),
141196
-- Then the kernel of `q(f)` is an eigenspace.
142-
have h_eigenspace: eigenspace f (-q.coeff 0 / q.leading_coeff) = (eval₂ am f q).ker,
143-
from eigenspace_eval₂_polynomial_degree_1 f q h_deg_q,
197+
have h_eigenspace: eigenspace f (-q.coeff 0 / q.leading_coeff) = (aeval f q).ker,
198+
from eigenspace_aeval_polynomial_degree_1 f q h_deg_q,
144199
-- Since `q(f)` is not invertible, the kernel is not `⊥`, and thus there exists an eigenvalue.
145200
show ∃ (c : K), f.has_eigenvalue c,
146201
{ use -q.coeff 0 / q.leading_coeff,
147202
rw [has_eigenvalue, h_eigenspace],
148203
intro h_eval_ker,
149-
exact hq_nonunit ((linear_map.is_unit_iff (eval₂ am f q)).2 h_eval_ker) }
204+
exact hq_nonunit ((linear_map.is_unit_iff (aeval f q)).2 h_eval_ker) }
150205
end
151206

152207
/-- Eigenvectors corresponding to distinct eigenvalues of a linear operator are linearly

src/linear_algebra/matrix.lean

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,37 @@ if H : ∃ s : finset M, is_basis R (λ x, x : (↑s : set M) → M) then let
787787
by { simp_rw [trace_eq_matrix_trace R hb, matrix.linear_equiv_matrix_mul], apply matrix.trace_mul_comm }
788788
else by rw [trace, dif_neg H, linear_map.zero_apply, linear_map.zero_apply]
789789

790+
section finite_dimensional
791+
792+
variables {K : Type*} [field K]
793+
variables {V : Type*} [add_comm_group V] [vector_space K V] [finite_dimensional K V]
794+
variables {W : Type*} [add_comm_group W] [vector_space K W] [finite_dimensional K W]
795+
796+
instance : finite_dimensional K (V →ₗ[K] W) :=
797+
begin
798+
classical,
799+
cases finite_dimensional.exists_is_basis_finset K V with bV hbV,
800+
cases finite_dimensional.exists_is_basis_finset K W with bW hbW,
801+
apply linear_equiv.finite_dimensional (linear_equiv_matrix hbV hbW).symm,
802+
end
803+
804+
/--
805+
The dimension of the space of linear transformations is the product of the dimensions of the
806+
domain and codomain.
807+
-/
808+
@[simp] lemma findim_linear_map :
809+
finite_dimensional.findim K (V →ₗ[K] W) =
810+
(finite_dimensional.findim K V) * (finite_dimensional.findim K W) :=
811+
begin
812+
classical,
813+
cases finite_dimensional.exists_is_basis_finset K V with bV hbV,
814+
cases finite_dimensional.exists_is_basis_finset K W with bW hbW,
815+
rw [linear_equiv.findim_eq (linear_equiv_matrix hbV hbW), matrix.findim_matrix,
816+
finite_dimensional.findim_eq_card_basis hbV, finite_dimensional.findim_eq_card_basis hbW,
817+
mul_comm],
818+
end
819+
820+
end finite_dimensional
790821
end linear_map
791822

792823
/-- The natural equivalence between linear endomorphisms of finite free modules and square matrices

src/ring_theory/polynomial/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,10 +429,10 @@ exists_irreducible_of_nat_degree_pos $ nat.pos_of_ne_zero hf
429429
lemma linear_independent_powers_iff_eval₂
430430
(f : M →ₗ[R] M) (v : M) :
431431
linear_independent R (λ n : ℕ, (f ^ n) v)
432-
↔ ∀ (p : polynomial R), polynomial.eval₂ (algebra_map _ _) f p v = 0 → p = 0 :=
432+
↔ ∀ (p : polynomial R), polynomial.aeval f p v = 0 → p = 0 :=
433433
begin
434434
rw linear_independent_iff,
435-
simp only [finsupp.total_apply, eval₂_endomorphism_algebra_map],
435+
simp only [finsupp.total_apply, aeval_endomorphism],
436436
refl
437437
end
438438

0 commit comments

Comments
 (0)