Matrices #
This file contains basic results on matrices including bundled versions of matrix operators.
Implementation notes #
For convenience, Matrix m n α is defined as m → n → α, as this allows elements of the matrix
to be accessed with A i j. However, it is not advisable to construct matrices using terms of the
form fun i j ↦ _ or even (fun i j ↦ _ : Matrix m n α), as these are not recognized by Lean
as having the right type. Instead, Matrix.of should be used.
TODO #
Under various conditions, multiplication of infinite matrices makes sense. These have not yet been implemented.
Equations
- Matrix.decidableEq = Fintype.decidablePiFintype
Equations
- Matrix.instFintypeOfDecidableEq α = inferInstanceAs (Fintype (m → n → α))
This is Matrix.of bundled as a linear equivalence.
Equations
- Matrix.ofLinearEquiv R = { toFun := Matrix.ofAddEquiv.toFun, map_add' := ⋯, map_smul' := ⋯, invFun := Matrix.ofAddEquiv.invFun, left_inv := ⋯, right_inv := ⋯ }
Matrix.diagonal as an AddMonoidHom.
Equations
- Matrix.diagonalAddMonoidHom n α = { toFun := Matrix.diagonal, map_zero' := ⋯, map_add' := ⋯ }
Matrix.diagonal as a LinearMap.
Equations
- Matrix.diagonalLinearMap n R α = { toFun := (↑(Matrix.diagonalAddMonoidHom n α)).toFun, map_add' := ⋯, map_smul' := ⋯ }
Matrix.diag as an AddMonoidHom.
Equations
- Matrix.diagAddMonoidHom n α = { toFun := Matrix.diag, map_zero' := ⋯, map_add' := ⋯ }
Matrix.diag as a LinearMap.
Equations
- Matrix.diagLinearMap n R α = { toFun := (↑(Matrix.diagAddMonoidHom n α)).toFun, map_add' := ⋯, map_smul' := ⋯ }
Matrix.diagonal as a RingHom.
Equations
- Matrix.diagonalRingHom n α = { toFun := Matrix.diagonal, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
The ring homomorphism α →+* Matrix n n α
sending a to the diagonal matrix with a on the diagonal.
Equations
- Matrix.scalar n = (Matrix.diagonalRingHom n α).comp (Pi.constRingHom n α)
Equations
- Matrix.instAlgebra = Algebra.mk ((Matrix.scalar n).comp (algebraMap R α)) ⋯ ⋯
Matrix.diagonal as an AlgHom.
Equations
- Matrix.diagonalAlgHom R = { toFun := Matrix.diagonal, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯, commutes' := ⋯ }
Extracting entries from a matrix as an additive monoid homomorphism. Note this cannot be upgraded to a ring homomorphism, as it does not respect multiplication.
Equations
- Matrix.entryAddMonoidHom α i j = { toFun := fun (M : Matrix m n α) => M i j, map_zero' := ⋯, map_add' := ⋯ }
Extracting entries from a matrix as a linear map. Note this cannot be upgraded to an algebra homomorphism, as it does not respect multiplication.
Equations
- Matrix.entryLinearMap R α i j = { toFun := fun (M : Matrix m n α) => M i j, map_add' := ⋯, map_smul' := ⋯ }
Bundled versions of Matrix.map #
The Equiv between spaces of matrices induced by an Equiv between their
coefficients. This is Matrix.map as an Equiv.
The AddMonoidHom between spaces of matrices induced by an AddMonoidHom between their
coefficients. This is Matrix.map as an AddMonoidHom.
The LinearMap between spaces of matrices induced by a LinearMap between their
coefficients. This is Matrix.map as a LinearMap.
The LinearEquiv between spaces of matrices induced by a LinearEquiv between their
coefficients. This is Matrix.map as a LinearEquiv.
The RingHom between spaces of square matrices induced by a RingHom between their
coefficients. This is Matrix.map as a RingHom.
The RingEquiv between spaces of square matrices induced by a RingEquiv between their
coefficients. This is Matrix.map as a RingEquiv.
The AlgHom between spaces of square matrices induced by an AlgHom between their
coefficients. This is Matrix.map as an AlgHom.
The AlgEquiv between spaces of square matrices induced by an AlgEquiv between their
coefficients. This is Matrix.map as an AlgEquiv.
Matrix.transpose as an AddEquiv
Equations
- Matrix.transposeAddEquiv m n α = { toFun := Matrix.transpose, invFun := Matrix.transpose, left_inv := ⋯, right_inv := ⋯, map_add' := ⋯ }
Matrix.transpose as a LinearMap
Equations
- One or more equations did not get rendered due to their size.
Matrix.transpose as a RingEquiv to the opposite ring
Equations
- One or more equations did not get rendered due to their size.
Matrix.transpose as an AlgEquiv to the opposite ring
Equations
- One or more equations did not get rendered due to their size.