File: Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean

full_name: PiToModule.fromMatrix
code: /-- 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 
goal: Matrix ι ι R →ₗ[R] (ι → R) →ₗ[R] M

full_name: PiToModule.fromMatrix_apply
code: theorem PiToModule.fromMatrix_apply [DecidableEq ι] (A : Matrix ι ι R) (w : ι → R) :
    PiToModule.fromMatrix R b A w = Fintype.total R R b (A *ᵥ w) 
goal: ((PiToModule.fromMatrix R b) A) w = ((Fintype.total R R) b) (A *ᵥ w)

full_name: PiToModule.fromMatrix_apply_single_one
code: 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 
goal: ((PiToModule.fromMatrix R b) A) (Pi.single j 1) = ∑ i : ι, A i j • b i

full_name: PiToModule.fromEnd
code: /-- 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 
goal: Module.End R M →ₗ[R] (ι → R) →ₗ[R] M

full_name: PiToModule.fromEnd_apply
code: theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ι → R) :
    PiToModule.fromEnd R b f w = f (Fintype.total R R b w) 
goal: ((PiToModule.fromEnd R b) f) w = f (((Fintype.total R R) b) w)

full_name: PiToModule.fromEnd_apply_single_one
code: 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) 
goal: ((PiToModule.fromEnd R b) f) (Pi.single i 1) = f (b i)

full_name: PiToModule.fromEnd_injective
code: theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊤) :
    Function.Injective (PiToModule.fromEnd R b) 
goal: Function.Injective ⇑(PiToModule.fromEnd R b)

full_name: Matrix.Represents
code: /-- 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 
goal: Prop

full_name: Matrix.Represents.congr_fun
code: theorem Matrix.Represents.congr_fun {A : Matrix ι ι R} {f : Module.End R M} (h : A.Represents b f)
    (x) : Fintype.total R R b (A *ᵥ x) = f (Fintype.total R R b x) 
goal: ((Fintype.total R R) b) (A *ᵥ x) = f (((Fintype.total R R) b) x)

full_name: Matrix.represents_iff
code: theorem Matrix.represents_iff {A : Matrix ι ι R} {f : Module.End R M} :
    A.Represents b f ↔ ∀ x, Fintype.total R R b (A *ᵥ x) = f (Fintype.total R R b x) 
goal: Matrix.Represents b A f ↔ ∀ (x : ι → R), ((Fintype.total R R) b) (A *ᵥ x) = f (((Fintype.total R R) b) x)

full_name: Matrix.represents_iff'
code: 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) 
goal: Matrix.Represents b A f ↔ ∀ (j : ι), ∑ i : ι, A i j • b i = f (b j)

full_name: Matrix.Represents.mul
code: 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') 
goal: Matrix.Represents b (A * A') (f * f')

full_name: Matrix.Represents.one
code: theorem Matrix.Represents.one : (1 : Matrix ι ι R).Represents b 1 
goal: Matrix.Represents b 1 1

full_name: Matrix.Represents.add
code: 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') 
goal: Matrix.Represents b (A + A') (f + f')

full_name: Matrix.Represents.zero
code: theorem Matrix.Represents.zero : (0 : Matrix ι ι R).Represents b 0 
goal: Matrix.Represents b 0 0

full_name: Matrix.Represents.smul
code: 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) 
goal: Matrix.Represents b (r • A) (r • f)

full_name: Matrix.Represents.algebraMap
code: theorem Matrix.Represents.algebraMap (r : R) :
    (algebraMap _ (Matrix ι ι R) r).Represents b (algebraMap _ (Module.End R M) r) 
goal: Matrix.Represents b ((algebraMap R (Matrix ι ι R)) r) ((algebraMap R (Module.End R M)) r)

full_name: Matrix.Represents.eq
code: theorem Matrix.Represents.eq {A : Matrix ι ι R} {f f' : Module.End R M} (h : A.Represents b f)
    (h' : A.Represents b f') : f = f' 
goal: f = f'

full_name: Matrix.isRepresentation
code: /-- The subalgebra of `Matrix ι ι R` that consists of matrices that actually represent
endomorphisms on `M`. -/
def Matrix.isRepresentation : Subalgebra R (Matrix ι ι R) 
goal: Subalgebra R (Matrix ι ι R)

full_name: Matrix.isRepresentation.toEnd
code: /-- 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 
goal: ↥(Matrix.isRepresentation R b) →ₐ[R] Module.End R M

full_name: Matrix.isRepresentation.toEnd_represents
code: theorem Matrix.isRepresentation.toEnd_represents (A : Matrix.isRepresentation R b) :
    (A : Matrix ι ι R).Represents b (Matrix.isRepresentation.toEnd R b hb A) 
goal: Matrix.Represents b (↑A) ((Matrix.isRepresentation.toEnd R b hb) A)

full_name: Matrix.isRepresentation.eq_toEnd_of_represents
code: 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 
goal: (Matrix.isRepresentation.toEnd R b hb) A = f

full_name: Matrix.isRepresentation.toEnd_exists_mem_ideal
code: 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 
goal: ∃ M_1, (Matrix.isRepresentation.toEnd R b hb) M_1 = f ∧ ∀ (i j : ι), ↑M_1 i j ∈ I

full_name: Matrix.isRepresentation.toEnd_surjective
code: theorem Matrix.isRepresentation.toEnd_surjective :
    Function.Surjective (Matrix.isRepresentation.toEnd R b hb) 
goal: Function.Surjective ⇑(Matrix.isRepresentation.toEnd R b hb)

full_name: LinearMap.exists_monic_and_coeff_mem_pow_and_aeval_eq_zero_of_range_le_smul
code: /-- The **Cayley-Hamilton Theorem** for f.g. modules over arbitrary rings states that for each
`R`-endomorphism `φ` of an `R`-module `M` such that `φ(M) ≤ I • M` for some ideal `I`, there
exists some `n` and some `aᵢ ∈ Iⁱ` such that `φⁿ + a₁ φⁿ⁻¹ + ⋯ + aₙ = 0`.

This is the version found in Eisenbud 4.3, which is slightly weaker than Matsumura 2.1
(this lacks the constraint on `n`), and is slightly stronger than Atiyah-Macdonald 2.4.
-/
theorem LinearMap.exists_monic_and_coeff_mem_pow_and_aeval_eq_zero_of_range_le_smul
    [Module.Finite R M] (f : Module.End R M) (I : Ideal R) (hI : LinearMap.range f ≤ I • ⊤) :
    ∃ p : R[X], p.Monic ∧ (∀ k, p.coeff k ∈ I ^ (p.natDegree - k)) ∧ Polynomial.aeval f p = 0 
goal: ∃ p, p.Monic ∧ (∀ (k : ℕ), p.coeff k ∈ I ^ (p.natDegree - k)) ∧ (Polynomial.aeval f) p = 0

full_name: LinearMap.exists_monic_and_aeval_eq_zero
code: 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 
goal: ∃ p, p.Monic ∧ (Polynomial.aeval f) p = 0