Quelle LinearMap.lean
Sprache: Lean
|
|
/-
Copyright (c) 2022 Andrew Yang. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Andrew Yang
-/
module
public import Mathlib.Algebra.Module.SpanRank
public import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff
/-!
# Cayley-Hamilton theorem for f.g. modules.
Given a fixed finite spanning set `b : ι → M` of an `R`-module `M`, we say that a matrix `M`
represents an endomorphism `f : M →ₗ[R] M` if the matrix as an endomorphism of `ι → R` commutes
with `f` via the projection `(ι → R) →ₗ[R] M` given by `b`.
We show that every endomorphism has a matrix representation, and if `f.range ≤ I • ⊤` for some
ideal `I`, we may furthermore obtain a matrix representation whose entries fall in `I`.
This is used to conclude the Cayley-Hamilton theorem for f.g. modules over arbitrary rings.
-/
@[expose] public section
variable {ι : Type*} [Fintype ι]
variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R)
variable (b : ι → M)
open Polynomial Matrix
/-- The composition of a matrix (as an endomorphism of `ι → R`) with the projection
`(ι → R) →ₗ[R] M`. -/
def PiToModule.fromMatrix [DecidableEq ι] : Matrix ι ι R →ₗ[R] (ι → R) →ₗ[R] M :=
(LinearMap.llcomp R _ _ _ (Fintype.linearCombination R b)).comp algEquivMatrix'.symm.toLinearMap
theorem PiToModule.fromMatrix_apply [DecidableEq ι] (A : Matrix ι ι R) (w : ι → R) :
PiToModule.fromMatrix R b A w = Fintype.linearCombination R b (A *ᵥ w) :=
rfl
theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ι] (A : Matrix ι ι R) (j : ι) :
PiToModule.fromMatrix R b A (Pi.single j 1) = ∑ i : ι, A i j • b i := by
rw [PiToModule.fromMatrix_apply, Fintype.linearCombination_apply, Matrix.mulVec_single]
simp_rw [MulOpposite.op_one, one_smul, col_apply]
/-- The endomorphisms of `M` acts on `(ι → R) →ₗ[R] M`, and takes the projection
to a `(ι → R) →ₗ[R] M`. -/
def PiToModule.fromEnd : Module.End R M →ₗ[R] (ι → R) →ₗ[R] M :=
LinearMap.lcomp _ _ (Fintype.linearCombination R b)
theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ι → R) :
PiToModule.fromEnd R b f w = f (Fintype.linearCombination R b w) :=
rfl
theorem PiToModule.fromEnd_apply_single_one [DecidableEq ι] (f : Module.End R M) (i : ι) :
PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by
rw [PiToModule.fromEnd_apply, Fintype.linearCombination_apply_single, one_smul]
theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊤) :
Function.Injective (PiToModule.fromEnd R b) := by
intro x y e
ext m
obtain ⟨m, rfl⟩ : m ∈ LinearMap.range (Fintype.linearCombination R b) := by
rw [(Fintype.range_linearCombination R b).trans hb]
exact Submodule.mem_top
congrm $e m
section
variable {R} [DecidableEq ι]
/-- We say that a matrix represents an endomorphism of `M` if the matrix acting on `ι → R` is
equal to `f` via the projection `(ι → R) →ₗ[R] M` given by a fixed (spanning) set. -/
def Matrix.Represents (A : Matrix ι ι R) (f : Module.End R M) : Prop :=
PiToModule.fromMatrix R b A = PiToModule.fromEnd R b f
variable {b}
theorem Matrix.Represents.congr_fun {A : Matrix ι ι R} {f : Module.End R M} (h : A.Represents b f)
(x) : Fintype.linearCombination R b (A *ᵥ x) = f (Fintype.linearCombination R b x) :=
congr($h x)
theorem Matrix.represents_iff {A : Matrix ι ι R} {f : Module.End R M} :
A.Represents b f ↔
∀ x, Fintype.linearCombination R b (A *ᵥ x) = f (Fintype.linearCombination R b x) :=
⟨fun e x => e.congr_fun x, fun H => LinearMap.ext fun x => H x⟩
theorem Matrix.represents_iff' {A : Matrix ι ι R} {f : Module.End R M} :
A.Represents b f ↔ ∀ j, ∑ i : ι, A i j • b i = f (b j) := by
constructor
· intro h i
have := congr($h (Pi.single i 1))
rwa [PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] at this
· intro h
ext
simp_rw [LinearMap.comp_apply, LinearMap.coe_single, PiToModule.fromEnd_apply_single_one,
PiToModule.fromMatrix_apply_single_one]
apply h
theorem Matrix.Represents.mul {A A' : Matrix ι ι R} {f f' : Module.End R M} (h : A.Represents b f)
(h' : Matrix.Represents b A' f') : (A * A').Represents b (f * f') := by
delta Matrix.Represents PiToModule.fromMatrix
rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, map_mul]
ext
dsimp [PiToModule.fromEnd]
rw [mul_apply_eq_comp, mul_apply_eq_comp, ← h'.congr_fun, ← h.congr_fun]
rfl
theorem Matrix.Represents.one : (1 : Matrix ι ι R).Represents b 1 := by
delta Matrix.Represents PiToModule.fromMatrix
rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, map_one]
ext
rfl
theorem Matrix.Represents.add {A A' : Matrix ι ι R} {f f' : Module.End R M} (h : A.Represents b f)
(h' : Matrix.Represents b A' f') : (A + A').Represents b (f + f') := by
delta Matrix.Represents at h h' ⊢; rw [map_add, map_add, h, h']
theorem Matrix.Represents.zero : (0 : Matrix ι ι R).Represents b 0 := by
delta Matrix.Represents
rw [map_zero, map_zero]
theorem Matrix.Represents.smul {A : Matrix ι ι R} {f : Module.End R M} (h : A.Represents b f)
(r : R) : (r • A).Represents b (r • f) := by
delta Matrix.Represents at h ⊢
rw [map_smul, map_smul, h]
theorem Matrix.Represents.algebraMap (r : R) :
(algebraMap _ (Matrix ι ι R) r).Represents b (algebraMap _ (Module.End R M) r) := by
simpa only [Algebra.algebraMap_eq_smul_one] using Matrix.Represents.one.smul r
theorem Matrix.Represents.eq (hb : Submodule.span R (Set.range b) = ⊤)
{A : Matrix ι ι R} {f f' : Module.End R M} (h : A.Represents b f)
(h' : A.Represents b f') : f = f' :=
PiToModule.fromEnd_injective R b hb (h.symm.trans h')
variable (b R)
/-- The subalgebra of `Matrix ι ι R` that consists of matrices that actually represent
endomorphisms on `M`. -/
def Matrix.isRepresentation : Subalgebra R (Matrix ι ι R) where
carrier := { A | ∃ f : Module.End R M, A.Represents b f }
mul_mem' := fun ⟨f₁, e₁⟩ ⟨f₂, e₂⟩ => ⟨f₁ * f₂, e₁.mul e₂⟩
one_mem' := ⟨1, Matrix.Represents.one⟩
add_mem' := fun ⟨f₁, e₁⟩ ⟨f₂, e₂⟩ => ⟨f₁ + f₂, e₁.add e₂⟩
zero_mem' := ⟨0, Matrix.Represents.zero⟩
algebraMap_mem' r := ⟨algebraMap _ _ r, .algebraMap _⟩
variable (hb : Submodule.span R (Set.range b) = ⊤)
include hb
/-- The map sending a matrix to the endomorphism it represents. This is an `R`-algebra morphism. -/
noncomputable def Matrix.isRepresentation.toEnd :
Matrix.isRepresentation R b →ₐ[R] Module.End R M where
toFun A := A.2.choose
map_one' := (1 : Matrix.isRepresentation R b).2.choose_spec.eq hb Matrix.Represents.one
map_mul' A₁ A₂ := (A₁ * A₂).2.choose_spec.eq hb (A₁.2.choose_spec.mul A₂.2.choose_spec)
map_zero' := (0 : Matrix.isRepresentation R b).2.choose_spec.eq hb Matrix.Represents.zero
map_add' A₁ A₂ := (A₁ + A₂).2.choose_spec.eq hb (A₁.2.choose_spec.add A₂.2.choose_spec)
commutes' r :=
(algebraMap _ (Matrix.isRepresentation R b) r).2.choose_spec.eq hb (.algebraMap r)
theorem Matrix.isRepresentation.toEnd_represents (A : Matrix.isRepresentation R b) :
(A : Matrix ι ι R).Represents b (Matrix.isRepresentation.toEnd R b hb A) :=
A.2.choose_spec
theorem Matrix.isRepresentation.eq_toEnd_of_represents (A : Matrix.isRepresentation R b)
{f : Module.End R M} (h : (A : Matrix ι ι R).Represents b f) :
Matrix.isRepresentation.toEnd R b hb A = f :=
A.2.choose_spec.eq hb h
theorem Matrix.isRepresentation.toEnd_exists_mem_ideal (f : Module.End R M) (I : Ideal R)
(hI : LinearMap.range f ≤ I • ⊤) :
∃ M, Matrix.isRepresentation.toEnd R b hb M = f ∧ ∀ i j, M.1 i j ∈ I := by
have : ∀ x, f x ∈ LinearMap.range (Ideal.finsuppTotal ι M I b) := by
rw [Ideal.range_finsuppTotal, hb]
exact fun x => hI (LinearMap.mem_range_self f x)
choose bM' hbM' using this
let A : Matrix ι ι R := fun i j => bM' (b j) i
have : A.Represents b f := by
rw [Matrix.represents_iff']
dsimp [A]
intro j
specialize hbM' (b j)
rwa [Ideal.finsuppTotal_apply_eq_of_fintype] at hbM'
exact
⟨⟨A, f, this⟩, Matrix.isRepresentation.eq_toEnd_of_represents R b hb ⟨A, f, this⟩ this,
fun i j => (bM' (b j) i).prop⟩
theorem Matrix.isRepresentation.toEnd_surjective :
Function.Surjective (Matrix.isRepresentation.toEnd R b hb) := by
intro f
obtain ⟨M, e, -⟩ := Matrix.isRepresentation.toEnd_exists_mem_ideal R b hb f ⊤ (by simp)
exact ⟨M, e⟩
end
/-- The **Cayley-Hamilton Theorem** for f.g. modules over arbitrary rings states that for each
`R`-endomorphism `φ` of an `R`-module `M` generated by `n` elements such that `φ(M) ≤ I • M`
for some ideal `I`, there exist some `aᵢ ∈ Iⁱ` such that `φⁿ + a₁ φⁿ⁻¹ + ⋯ + aₙ = 0`.
This is the version in [Matsumura 2.1][matsumura1987], which is stronger than those in
[Eisenbud 4.3][Eisenbud1995] and [Atiyah-Macdonald 2.4][atiyah-macdonald].
-/
theorem LinearMap.exists_monic_and_natDegree_eq_and_coeff_mem_pow_and_aeval_eq_zero
[Module.Finite R M] (f : Module.End R M) (I : Ideal R) (hI : LinearMap.range f ≤ I • ⊤) :
∃ p : R[X], p.Monic ∧ p.natDegree = (⊤ : Submodule R M).spanFinrank ∧
(∀ k, p.coeff k ∈ I ^ (p.natDegree - k)) ∧ Polynomial.aeval f p = 0 := by
classical
cases subsingleton_or_nontrivial R
· exact ⟨0, by simp [nontriviality]⟩
obtain ⟨s, hs_card, hs_span⟩ :=
Submodule.FG.exists_span_finset_card_eq_spanFinrank (R := R) (M := M) Module.Finite.fg_top
have : Submodule.span R (Set.range ((↑) : s → M)) = ⊤ := by simp [hs_span]
obtain ⟨A, rfl, h⟩ := Matrix.isRepresentation.toEnd_exists_mem_ideal R ((↑) : s → M) this f I hI
refine ⟨A.1.charpoly, A.1.charpoly_monic, by simp [hs_card],
by simpa using coeff_charpoly_mem_ideal_pow h, ?_⟩
rw [Polynomial.aeval_algHom_apply,
← map_zero (Matrix.isRepresentation.toEnd R ((↑) : s → M) this)]
congr 1
ext1
rw [Polynomial.aeval_subalgebra_coe, Matrix.aeval_self_charpoly, Subalgebra.coe_zero]
theorem LinearMap.exists_monic_and_natDegree_eq_and_aeval_eq_zero
[Module.Finite R M] (f : Module.End R M) :
∃ p : R[X], p.Monic ∧ p.natDegree = (⊤ : Submodule R M).spanFinrank ∧
Polynomial.aeval f p = 0 :=
(LinearMap.exists_monic_and_natDegree_eq_and_coeff_mem_pow_and_aeval_eq_zero R f ⊤ (by simp)).imp
fun _ h ↦ h.imp_right (And.imp_right And.right)
theorem LinearMap.exists_monic_and_aeval_eq_zero [Module.Finite R M] (f : Module.End R M) :
∃ p : R[X], p.Monic ∧ Polynomial.aeval f p = 0 :=
(LinearMap.exists_monic_and_natDegree_eq_and_aeval_eq_zero R f).imp
fun _ h => h.imp_right And.right
¤ Dauer der Verarbeitung: 0.8 Sekunden
¤
*© Formatika GbR, Deutschland
|
|
2026-11-24
|