Free modules #
We introduce a class Module.Free R M
, for R
a Semiring
and M
an R
-module and we provide
several basic instances for this class.
Use Finsupp.linearCombination_id_surjective
to prove that any module is the quotient of a free
module.
Main definition #
Module.Free R M
: the class of freeR
-modules.
If M
fits in universe w
, then freeness is equivalent to existence of a basis in that
universe.
Note that if M
does not fit in w
, the reverse direction of this implication is still true as
Module.Free.of_basis
.
If Module.Free R M
then ChooseBasisIndex R M
is the ι
which indexes the basis
ι → M
. Note that this is defined such that this type is finite if R
is trivial.
Equations
- Module.Free.ChooseBasisIndex R M = ↑⋯.choose
Instances For
There is no hope of computing this, but we add the instance anyway to avoid fumbling with
open scoped Classical
.
Equations
If Module.Free R M
then chooseBasis : ι → M
is the basis.
Here ι = ChooseBasisIndex R M
.
Equations
- Module.Free.chooseBasis R M = ⋯.some
Instances For
The isomorphism M ≃ₗ[R] (ChooseBasisIndex R M →₀ R)
.
Equations
- Module.Free.repr R M = (Module.Free.chooseBasis R M).repr
Instances For
The universal property of free modules: giving a function (ChooseBasisIndex R M) → N
, for N
an R
-module, is the same as giving an R
-linear map M →ₗ[R] N
.
This definition is parameterized over an extra Semiring S
,
such that SMulCommClass R S M'
holds.
If R
is commutative, you can set S := R
; if R
is not commutative,
you can recover an AddEquiv
by setting S := ℕ
.
See library note [bundled maps over different rings].
Equations
- Module.Free.constr R M N = (Module.Free.chooseBasis R M).constr S
Instances For
A variation of of_equiv
: the assumption Module.Free R P
here is explicit rather than an
instance.
The module structure provided by Semiring.toModule
is free.
The product of finitely many free modules is free.
The module of finite matrices is free.
The product of finitely many free modules is free (non-dependent version to help with typeclass search).