Module docstring
{"# Linear maps and matrices
This file defines the maps to send matrices to a linear map, and to send linear maps between modules with a finite bases to matrices. This defines a linear equivalence between linear maps between finite-dimensional vector spaces and matrices indexed by the respective bases.
Main definitions
In the list below, and in all this file, R is a commutative ring (semiring
is sometimes enough), M and its variations are R-modules, ι, κ, n and m are finite
types used for indexing.
LinearMap.toMatrix: given basesv₁ : ι → M₁andv₂ : κ → M₂, theR-linear equivalence fromM₁ →ₗ[R] M₂toMatrix κ ι RMatrix.toLin: the inverse ofLinearMap.toMatrixLinearMap.toMatrix': theR-linear equivalence from(m → R) →ₗ[R] (n → R)toMatrix m n R(with the standard basis onm → Randn → R)Matrix.toLin': the inverse ofLinearMap.toMatrix'algEquivMatrix: given a basis indexed byn, theR-algebra equivalence betweenR-endomorphisms ofMandMatrix n n R
Issues
This file was originally written without attention to non-commutative rings, and so mostly only works in the commutative setting. This should be fixed.
In particular, Matrix.mulVec gives us a linear equivalence
Matrix m n R ≃ₗ[R] (n → R) →ₗ[Rᵐᵒᵖ] (m → R)
while Matrix.vecMul gives us a linear equivalence
Matrix m n R ≃ₗ[Rᵐᵒᵖ] (m → R) →ₗ[R] (n → R).
At present, the first equivalence is developed in detail but only for commutative rings
(and we omit the distinction between Rᵐᵒᵖ and R),
while the second equivalence is developed only in brief, but for not-necessarily-commutative rings.
Naming is slightly inconsistent between the two developments.
In the original (commutative) development linear is abbreviated to lin,
although this is not consistent with the rest of mathlib.
In the new (non-commutative) development linear is not abbreviated, and declarations use _right
to indicate they use the right action of matrices on vectors (via Matrix.vecMul).
When the two developments are made uniform, the names should be made uniform, too,
by choosing between linear and lin consistently,
and (presumably) adding _left where necessary.
Tags
linearmap, matrix, linearequiv, diagonal, det, trace
","From this point on, we only work with commutative rings,
and fail to distinguish between Rᵐᵒᵖ and R.
This should eventually be remedied.
"}