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.total_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 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 = ↑(Exists.choose (_ : ∃ (S : Set M), Nonempty (Basis (↑S) R M)))
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 = Nonempty.some (_ : Nonempty (Basis (↑(Exists.choose (_ : ∃ (S : Set M), Nonempty (Basis (↑S) R M)))) R M))
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 = Basis.constr (Module.Free.chooseBasis R M) S
Instances For
Equations
- (_ : NoZeroSMulDivisors R M) = (_ : NoZeroSMulDivisors R M)
Equations
- (_ : Nonempty (Module.Free.ChooseBasisIndex R M)) = (_ : Nonempty (Module.Free.ChooseBasisIndex R M))
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.
Equations
- (_ : Module.Free R R) = (_ : Module.Free R R)
Equations
- (_ : Module.Free R (M × N)) = (_ : Module.Free R (M × N))
The product of finitely many free modules is free.
Equations
- (_ : Module.Free R ((i : ι) → M i)) = (_ : Module.Free R ((i : ι) → M i))
The module of finite matrices is free.
Equations
- (_ : Module.Free R (Matrix m n M)) = (_ : Module.Free R (m → n → M))
Equations
- (_ : Module.Free R (ULift.{u_2, v} M)) = (_ : Module.Free R (ULift.{u_2, v} M))
The product of finitely many free modules is free (non-dependent version to help with typeclass search).
Equations
- (_ : Module.Free R (ι → M)) = (_ : Module.Free R (ι → M))
Equations
- (_ : Module.Free R (ι →₀ M)) = (_ : Module.Free R (ι →₀ M))
Equations
- (_ : Module.Free R N) = (_ : Module.Free R N)
Equations
- (_ : Module.Free R N) = (_ : Module.Free R N)
Equations
- (_ : Module.Free R (Π₀ (i : ι), M i)) = (_ : Module.Free R (Π₀ (i : ι), M i))
Equations
- (_ : Module.Free R (DirectSum ι fun (i : ι) => M i)) = (_ : Module.Free R (Π₀ (i : ι), M i))
Equations
- (_ : Module.Free R (TensorProduct R M N)) = (_ : Module.Free R (TensorProduct R M N))