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.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 := ⋯ }
Instances For
Matrix.diagonal as an AddMonoidHom.
Equations
- Matrix.diagonalAddMonoidHom n α = { toFun := Matrix.diagonal, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Matrix.diagonal as a LinearMap.
Equations
- Matrix.diagonalLinearMap n R α = { toFun := (↑(Matrix.diagonalAddMonoidHom n α)).toFun, map_add' := ⋯, map_smul' := ⋯ }
Instances For
Matrix.diag as an AddMonoidHom.
Equations
- Matrix.diagAddMonoidHom n α = { toFun := Matrix.diag, map_zero' := ⋯, map_add' := ⋯ }
Instances For
Matrix.diag as a LinearMap.
Equations
- Matrix.diagLinearMap n R α = { toFun := (↑(Matrix.diagAddMonoidHom n α)).toFun, map_add' := ⋯, map_smul' := ⋯ }
Instances For
Matrix.diagonal as a RingHom.
Equations
- Matrix.diagonalRingHom n α = { toFun := Matrix.diagonal, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
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 α)
Instances For
A version of Matrix.scalar_commute_iff for rectangular matrices.
A version of Matrix.scalar_commute for rectangular matrices.
Equations
- Matrix.instAlgebra = { toSMul := Matrix.smul, algebraMap := (Matrix.scalar n).comp (algebraMap R α), commutes' := ⋯, smul_def' := ⋯ }
Matrix.diagonal as an AlgHom.
Equations
- Matrix.diagonalAlgHom R = { toFun := Matrix.diagonal, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯, commutes' := ⋯ }
Instances For
Matrix.scalar as an AlgHom.
Equations
- Matrix.scalarAlgHom n R = { toRingHom := Matrix.scalar n, commutes' := ⋯ }
Instances For
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' := ⋯ }
Instances For
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' := ⋯ }
Instances For
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.
Equations
Instances For
The AddMonoidHom between spaces of matrices induced by an AddMonoidHom between their
coefficients. This is Matrix.map as an AddMonoidHom.
Equations
Instances For
The LinearMap between spaces of matrices induced by a LinearMap between their
coefficients. This is Matrix.map as a LinearMap.
Equations
Instances For
LinearMap.mapMatrix is itself linear in the map being applied.
Alternative, this is Matrix.map as a bilinear map.
Equations
- LinearMap.mapMatrixLinear A = { toFun := LinearMap.mapMatrix, map_add' := ⋯, map_smul' := ⋯ }
Instances For
The LinearEquiv between spaces of matrices induced by a LinearEquiv between their
coefficients. This is Matrix.map as a LinearEquiv.
Equations
Instances For
The RingHom between spaces of square matrices induced by a RingHom between their
coefficients. This is Matrix.map as a RingHom.
Equations
Instances For
The RingEquiv between spaces of square matrices induced by a RingEquiv between their
coefficients. This is Matrix.map as a RingEquiv.
Equations
Instances For
For any ring R, we have ring isomorphism Matₙₓₙ(Rᵒᵖ) ≅ (Matₙₓₙ(R))ᵒᵖ given by transpose.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The AlgHom between spaces of square matrices induced by an AlgHom between their
coefficients. This is Matrix.map as an AlgHom.
Equations
Instances For
The AlgEquiv between spaces of square matrices induced by an AlgEquiv between their
coefficients. This is Matrix.map as an AlgEquiv.
Equations
Instances For
For any algebra α over a ring R, we have an R-algebra isomorphism
Matₙₓₙ(αᵒᵖ) ≅ (Matₙₓₙ(R))ᵒᵖ given by transpose. If α is commutative,
we can get rid of the ᵒᵖ in the left-hand side, see Matrix.transposeAlgEquiv.
Equations
- AlgEquiv.mopMatrix = { toEquiv := RingEquiv.mopMatrix.toEquiv, map_mul' := ⋯, map_add' := ⋯, commutes' := ⋯ }
Instances For
A version of Set.matrix for AddSubmonoids.
Given an AddSubmonoid S, S.matrix is the AddSubmonoid of matrices m
all of whose entries m i j belong to S.
Instances For
A version of Set.matrix for AddSubgroups.
Given an AddSubgroup S, S.matrix is the AddSubgroup of matrices m
all of whose entries m i j belong to S.
Instances For
A version of Set.matrix for Subsemirings.
Given a Subsemiring S, S.matrix is the Subsemiring of square matrices m
all of whose entries m i j belong to S.
Equations
Instances For
A version of Set.matrix for Subrings.
Given a Subring S, S.matrix is the Subring of square matrices m
all of whose entries m i j belong to S.
Instances For
A version of Set.matrix for Submodules.
Given a Submodule S, S.matrix is the Submodule of matrices m
all of whose entries m i j belong to S.
Instances For
Matrix.transpose as an AddEquiv
Equations
- Matrix.transposeAddEquiv m n α = { toFun := Matrix.transpose, invFun := Matrix.transpose, left_inv := ⋯, right_inv := ⋯, map_add' := ⋯ }
Instances For
Matrix.transpose as a LinearMap
Equations
- One or more equations did not get rendered due to their size.
Instances For
Matrix.transpose as a RingEquiv to the opposite ring
Equations
- One or more equations did not get rendered due to their size.
Instances For
Matrix.transpose as an AlgEquiv to the opposite ring
Equations
- One or more equations did not get rendered due to their size.