The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V09. Commutative algebra I: ideals, polynomials, factorization

Mathlib.RingTheory.MatrixPolynomialAlgebra

21 declarations. Mathlib docs · Source

Algebra isomorphism between matrices of polynomials and polynomials of matrices

We obtain the algebra isomorphism

def matPolyEquiv : Matrix n n R[X] ≃ₐ[R] (Matrix n n R)[X]

which is characterized by

(matPolyEquiv m).coeff k i j = (m i j).coeff k

We will use this algebra isomorphism to prove the Cayley-Hamilton theorem.

theorem Polynomial.eval₂AlgHom.congr_simp E1 #

∀ {R : Type u} {A : Type z} {B : Type u_2} [inst : CommSemiring R] [inst_1 : Semiring A] [inst_2 : Semiring B]
  [inst_3 : Algebra R A] [inst_4 : Algebra R B] (f f_1 : A →ₐ[R] B) (e_f : f = f_1) (b b_1 : B) (e_b : b = b_1)
  (hf : ∀ (a : A), Commute (f a) b), Polynomial.eval₂AlgHom f b hf = Polynomial.eval₂AlgHom f_1 b_1 ⋯

def matPolyEquiv E1 #

{R : Type u_1} →
  [inst : CommSemiring R] →
    {n : Type w} →
      [inst_1 : DecidableEq n] → [inst_2 : Fintype n] → Matrix n n (Polynomial R) ≃ₐ[R] Polynomial (Matrix n n R)

The algebra isomorphism stating "matrices of polynomials are the same as polynomials of matrices".

(You probably shouldn't attempt to use this underlying definition --- it's an algebra equivalence, and characterised extensionally by the lemma matPolyEquiv_coeff_apply below.)

theorem matPolyEquiv_symm_C E0 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n] (M : Matrix n n R),
  matPolyEquiv.symm (Polynomial.C M) = M.map ⇑Polynomial.C

theorem matPolyEquiv_map_C E0 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n] (M : Matrix n n R),
  matPolyEquiv (M.map ⇑Polynomial.C) = Polynomial.C M

theorem matPolyEquiv_symm_X E0 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n],
  matPolyEquiv.symm Polynomial.X = Matrix.diagonal fun x ↦ Polynomial.X

theorem matPolyEquiv_diagonal_X E0 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n],
  matPolyEquiv (Matrix.diagonal fun x ↦ Polynomial.X) = Polynomial.X

theorem matPolyEquiv_coeff_apply_aux_1 E1 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n] (i j : n) (k : ℕ)
  (x : R), matPolyEquiv (Matrix.single i j ((Polynomial.monomial k) x)) = (Polynomial.monomial k) (Matrix.single i j x)

theorem matPolyEquiv_coeff_apply_aux_2 E1 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n] (i j : n)
  (p : Polynomial R) (k : ℕ), (matPolyEquiv (Matrix.single i j p)).coeff k = Matrix.single i j (p.coeff k)

theorem matPolyEquiv_coeff_apply E0 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n]
  (m : Matrix n n (Polynomial R)) (k : ℕ) (i j : n), (matPolyEquiv m).coeff k i j = (m i j).coeff k

theorem matPolyEquiv_symm_apply_coeff E0 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n]
  (p : Polynomial (Matrix n n R)) (i j : n) (k : ℕ), (matPolyEquiv.symm p i j).coeff k = p.coeff k i j

theorem matPolyEquiv_smul_one E1 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n] (p : Polynomial R),
  matPolyEquiv (p • 1) = Polynomial.map (algebraMap R (Matrix n n R)) p

theorem matPolyEquiv_map_smul E0 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n] (p : Polynomial R)
  (M : Matrix n n (Polynomial R)),
  matPolyEquiv (p • M) = Polynomial.map (algebraMap R (Matrix n n R)) p * matPolyEquiv M

theorem matPolyEquiv_symm_map_eval E1 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n]
  (M : Polynomial (Matrix n n R)) (r : R),
  (matPolyEquiv.symm M).map (Polynomial.eval r) = Polynomial.eval ((Matrix.scalar n) r) M

theorem matPolyEquiv_eval_eq_map E1 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n]
  (M : Matrix n n (Polynomial R)) (r : R),
  Polynomial.eval ((Matrix.scalar n) r) (matPolyEquiv M) = M.map (Polynomial.eval r)

theorem matPolyEquiv_eval E1 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n]
  (M : Matrix n n (Polynomial R)) (r : R) (i j : n),
  Polynomial.eval ((Matrix.scalar n) r) (matPolyEquiv M) i j = Polynomial.eval r (M i j)

theorem support_subset_support_matPolyEquiv E1 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n]
  (m : Matrix n n (Polynomial R)) (i j : n), (m i j).support ⊆ (matPolyEquiv m).support

theorem eval_det E1 #

∀ {n : Type w} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_3} [inst_2 : CommRing R]
  (M : Matrix n n (Polynomial R)) (r : R),
  Polynomial.eval r M.det = (Polynomial.eval ((Matrix.scalar n) r) (matPolyEquiv M)).det

theorem eval_det_add_X_smul E1 #

∀ {n : Type w} [inst : DecidableEq n] [inst_1 : Fintype n] {R : Type u_3} [inst_2 : CommRing R]
  (A : Matrix n n (Polynomial R)) (M : Matrix n n R),
  Polynomial.eval 0 (A + Polynomial.X • M.map ⇑Polynomial.C).det = Polynomial.eval 0 A.det

def RingHom.polyToMatrix E1 #

{R : Type u_1} →
  {A : Type u_2} →
    [inst : CommSemiring R] →
      [inst_1 : Semiring A] →
        {n : Type w} →
          [inst_2 : DecidableEq n] →
            [inst_3 : Fintype n] → (A →+* Matrix n n R) → Polynomial A →+* Matrix n n (Polynomial R)

Extend a ring hom A → Mₙ(R) to a ring hom A[X] → Mₙ(R[X]).

theorem evalRingHom_mapMatrix_comp_polyToMatrix E1 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n] {S : Type u_3}
  [inst_3 : CommSemiring S] (f : S →+* Matrix n n R),
  (Polynomial.evalRingHom 0).mapMatrix.comp f.polyToMatrix = f.comp (Polynomial.evalRingHom 0)

theorem evalRingHom_mapMatrix_comp_compRingEquiv E1 #

∀ {R : Type u_1} [inst : CommSemiring R] {n : Type w} [inst_1 : DecidableEq n] [inst_2 : Fintype n] {m : Type u_4}
  [inst_3 : Fintype m] [inst_4 : DecidableEq m],
  (Polynomial.evalRingHom 0).mapMatrix.comp ↑(Matrix.compRingEquiv m n (Polynomial R)) =
    (Matrix.compRingEquiv m n R).toRingHom.comp (Polynomial.evalRingHom 0).mapMatrix.mapMatrix