Free modules over PID #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
A free R
-module M
is a module with a basis over R
,
equivalently it is an R
-module linearly equivalent to ι →₀ R
for some ι
.
This file proves a submodule of a free R
-module of finite rank is also
a free R
-module of finite rank, if R
is a principal ideal domain (PID),
i.e. we have instances [is_domain R] [is_principal_ideal_ring R]
.
We express "free R
-module of finite rank" as a module M
which has a basis
b : ι → R
, where ι
is a fintype
.
We call the cardinality of ι
the rank of M
in this file;
it would be equal to finrank R M
if R
is a field and M
is a vector space.
Main results #
In this section, M
is a free and finitely generated R
-module, and
N
is a submodule of M
.
-
submodule.induction_on_rank
: ifP
holds for⊥ : submodule R M
and ifP N
follows fromP N'
for allN'
that are of lower rank, thenP
holds on all submodules -
submodule.exists_basis_of_pid
: ifR
is a PID, thenN : submodule R M
is free and finitely generated. This is the first part of the structure theorem for modules. -
submodule.smith_normal_form
: ifR
is a PID, thenM
has a basisbM
andN
has a basisbN
such thatbN i = a i • bM i
. Equivalently, a linear mapf : M →ₗ M
withrange f = N
can be written as a matrix in Smith normal form, a diagonal matrix with the coefficientsa i
along the diagonal.
Tags #
free module, finitely generated module, rank, structure theorem
The induction hypothesis of submodule.basis_of_pid
and submodule.smith_normal_form
.
Basically, it says: let N ≤ M
be a pair of submodules, then we can find a pair of
submodules N' ≤ M'
of strictly smaller rank, whose basis we can extend to get a basis
of N
and M
. Moreover, if the basis for M'
is up to scalars a basis for N'
,
then the basis we find for M
is up to scalars a basis for N
.
For basis_of_pid
we only need the first half and can fix M = ⊤
,
for smith_normal_form
we need the full statement,
but must also feed in a basis for M
using basis_of_pid
to keep the induction going.
A submodule of a free R
-module of finite rank is also a free R
-module of finite rank,
if R
is a principal ideal domain.
This is a lemma
to make the induction a bit easier. To actually access the basis,
see submodule.basis_of_pid
.
See also the stronger version submodule.smith_normal_form
.
A submodule of a free R
-module of finite rank is also a free R
-module of finite rank,
if R
is a principal ideal domain.
See also the stronger version submodule.smith_normal_form
.
Equations
- submodule.basis_of_pid b N = ⟨_.some, nonempty.some _⟩
A submodule inside a free R
-submodule of finite rank is also a free R
-module of finite rank,
if R
is a principal ideal domain.
See also the stronger version submodule.smith_normal_form_of_le
.
Equations
- submodule.basis_of_pid_of_le hNO b = submodule.basis_of_pid_of_le._match_1 hNO (submodule.basis_of_pid b (submodule.comap O.subtype N))
- submodule.basis_of_pid_of_le._match_1 hNO ⟨n, bN'⟩ = ⟨n, bN'.map (submodule.comap_subtype_equiv_of_le hNO)⟩
A submodule inside the span of a linear independent family is a free R
-module of finite rank,
if R
is a principal ideal domain.
Equations
A finite type torsion free module over a PID admits a basis.
Equations
- module.basis_of_finite_type_torsion_free hs = let I : set ι := module.basis_of_finite_type_torsion_free._proof_1.some in and.dcases_on module.basis_of_finite_type_torsion_free._proof_3 (λ (indepI : linear_independent R (λ (x : ↥(module.basis_of_finite_type_torsion_free._proof_2.some)), s ↑x)) (hI : ∀ (i : ι), i ∉ module.basis_of_finite_type_torsion_free._proof_2.some → (∃ (a : R), a ≠ 0 ∧ a • s i ∈ submodule.span R (s '' module.basis_of_finite_type_torsion_free._proof_2.some))), id (λ (indepI : linear_independent R (s ∘ coe)), id (λ (hI : ∀ (i : ι), i ∉ I → (∃ (a : R), a ≠ 0 ∧ a • s i ∈ submodule.span R (s '' I))), let N : submodule R M := submodule.span R (set.range (s ∘ coe)), sI : ↥I → ↥N := λ (i : ↥I), ⟨s i.val, _⟩, sI_basis : basis ↥I R ↥N := basis.span indepI in (λ (_x : ∀ (i : ι), (λ (i : ι), classical.some _) i ≠ 0 ∧ (λ (i : ι), classical.some _) i • s i ∈ N), let A : R := finset.univ.prod (λ (i : ι), (λ (i : ι), classical.some _) i), φ : M →ₗ[R] M := ⇑(linear_map.lsmul R M) A, ψ : M ≃ₗ[R] ↥(linear_map.range φ) := linear_equiv.of_injective φ _ in (submodule.basis_of_pid_of_le _ sI_basis).cases_on (λ (n : ℕ) (b : basis (fin n) R ↥(linear_map.range φ)), ⟨n, b.map ψ.symm⟩)) _) hI) indepI)
A finite type torsion free module over a PID admits a basis.
Equations
- module.basis_of_finite_type_torsion_free' = module.basis_of_finite_type_torsion_free module.basis_of_finite_type_torsion_free'._proof_3
- bM : basis ι R M
- bN : basis (fin n) R ↥N
- f : fin n ↪ ι
- a : fin n → R
- snf : ∀ (i : fin n), ↑(⇑(self.bN) i) = self.a i • ⇑(self.bM) (⇑(self.f) i)
A Smith normal form basis for a submodule N
of a module M
consists of
bases for M
and N
such that the inclusion map N → M
can be written as a
(rectangular) matrix with a
along the diagonal: in Smith normal form.
Instances for basis.smith_normal_form
- basis.smith_normal_form.has_sizeof_inst
If M
is finite free over a PID R
, then any submodule N
is free
and we can find a basis for M
and N
such that the inclusion map is a diagonal matrix
in Smith normal form.
See submodule.smith_normal_form_of_le
for a version of this theorem that returns
a basis.smith_normal_form
.
This is a strengthening of submodule.basis_of_pid_of_le
.
If M
is finite free over a PID R
, then any submodule N
is free
and we can find a basis for M
and N
such that the inclusion map is a diagonal matrix
in Smith normal form.
See submodule.exists_smith_normal_form_of_le
for a version of this theorem that doesn't
need to map N
into a submodule of O
.
This is a strengthening of submodule.basis_of_pid_of_le
.
Equations
- submodule.smith_normal_form_of_le b N O N_le_O = (λ (_x : ∃ (o : ℕ) (hno : classical.some _ ≤ o) (bO : basis (fin o) R ↥O) (bN : basis (fin (classical.some _)) R ↥N) (a : fin (classical.some _) → R), ∀ (i : fin (classical.some _)), ↑(⇑bN i) = a i • ↑(⇑bO (⇑(fin.cast_le hno) i))), (λ (_x_1 : ∃ (hno : classical.some _ ≤ classical.some _x) (bO : basis (fin (classical.some _x)) R ↥O) (bN : basis (fin (classical.some _)) R ↥N) (a : fin (classical.some _) → R), ∀ (i : fin (classical.some _)), ↑(⇑bN i) = a i • ↑(⇑bO (⇑(fin.cast_le hno) i))), (λ (_x_2 : ∃ (bO : basis (fin (classical.some _x)) R ↥O) (bN : basis (fin (classical.some _)) R ↥N) (a : fin (classical.some _) → R), ∀ (i : fin (classical.some _)), ↑(⇑bN i) = a i • ↑(⇑bO (⇑(fin.cast_le _) i))), (λ (_x_1_1 : ∃ (bN : basis (fin (classical.some _)) R ↥N) (a : fin (classical.some _) → R), ∀ (i : fin (classical.some _)), ↑(⇑bN i) = a i • ↑(⇑(classical.some _x_2) (⇑(fin.cast_le _) i))), (λ (_x_3 : ∃ (a : fin (classical.some _) → R), ∀ (i : fin (classical.some _)), ↑(⇑(classical.some _x_1_1) i) = a i • ↑(⇑(classical.some _x_2) (⇑(fin.cast_le _) i))), (λ (_x_1_2 : ∀ (i : fin (classical.some _)), ↑(⇑(classical.some _x_1_1) i) = classical.some _x_3 i • ↑(⇑(classical.some _x_2) (⇑(fin.cast_le _) i))), ⟨classical.some _x, ⟨classical.some _, {bM := classical.some _x_2, bN := (classical.some _x_1_1).map (submodule.comap_subtype_equiv_of_le N_le_O).symm, f := (fin.cast_le _).to_embedding, a := classical.some _x_3, snf := _}⟩⟩) _) _) _) _) _) _
If M
is finite free over a PID R
, then any submodule N
is free
and we can find a basis for M
and N
such that the inclusion map is a diagonal matrix
in Smith normal form.
This is a strengthening of submodule.basis_of_pid
.
See also ideal.smith_normal_form
, which moreover proves that the dimension of
an ideal is the same as the dimension of the whole ring.
Equations
- submodule.smith_normal_form b N = submodule.smith_normal_form._match_1 b N (submodule.smith_normal_form_of_le b N ⊤ _)
- submodule.smith_normal_form._match_1 b N ⟨m, ⟨n, {bM := bM, bN := bN, f := f, a := a, snf := snf}⟩⟩ = let bM' : basis (fin m) R M := bM.map (linear_equiv.of_top ⊤ submodule.smith_normal_form._match_1._proof_1), e : fin m ≃ ι := bM'.index_equiv b in ⟨n, {bM := bM'.reindex e, bN := bN.map (submodule.comap_subtype_equiv_of_le _), f := f.trans e.to_embedding, a := a, snf := _}⟩
If S
a finite-dimensional ring extension of a PID R
which is free as an R
-module,
then any nonzero S
-ideal I
is free as an R
-submodule of S
, and we can
find a basis for S
and I
such that the inclusion map is a square diagonal
matrix.
See ideal.exists_smith_normal_form
for a version of this theorem that doesn't
need to map I
into a submodule of R
.
This is a strengthening of submodule.basis_of_pid
.
Equations
- ideal.smith_normal_form b I hI = ideal.smith_normal_form._match_1 I hI (submodule.smith_normal_form b (submodule.restrict_scalars R I))
- ideal.smith_normal_form._match_1 I hI ⟨n, {bM := bS, bN := bI, f := f, a := a, snf := snf}⟩ = have eq : fintype.card (fin n) = fintype.card ι, from _, let e : fin n ≃ fin (fintype.card ι) := fintype.equiv_of_card_eq _ in {bM := bS, bN := bI.reindex e, f := e.symm.to_embedding.trans f, a := a ∘ ⇑(e.symm), snf := _}
If S
a finite-dimensional ring extension of a PID R
which is free as an R
-module,
then any nonzero S
-ideal I
is free as an R
-submodule of S
, and we can
find a basis for S
and I
such that the inclusion map is a square diagonal
matrix.
See also ideal.smith_normal_form
for a version of this theorem that returns
a basis.smith_normal_form
.
The definitions ideal.ring_basis
, ideal.self_basis
, ideal.smith_coeffs
are (noncomputable)
choices of values for this existential quantifier.
If S
a finite-dimensional ring extension of a PID R
which is free as an R
-module,
then any nonzero S
-ideal I
is free as an R
-submodule of S
, and we can
find a basis for S
and I
such that the inclusion map is a square diagonal
matrix; this is the basis for S
.
See ideal.self_basis
for the basis on I
,
see ideal.smith_coeffs
for the entries of the diagonal matrix
and ideal.self_basis_def
for the proof that the inclusion map forms a square diagonal matrix.
Equations
- ideal.ring_basis b I hI = _.some
If S
a finite-dimensional ring extension of a PID R
which is free as an R
-module,
then any nonzero S
-ideal I
is free as an R
-submodule of S
, and we can
find a basis for S
and I
such that the inclusion map is a square diagonal
matrix; this is the basis for I
.
See ideal.ring_basis
for the basis on S
,
see ideal.smith_coeffs
for the entries of the diagonal matrix
and ideal.self_basis_def
for the proof that the inclusion map forms a square diagonal matrix.
Equations
- ideal.self_basis b I hI = Exists.some _
If S
a finite-dimensional ring extension of a PID R
which is free as an R
-module,
then any nonzero S
-ideal I
is free as an R
-submodule of S
, and we can
find a basis for S
and I
such that the inclusion map is a square diagonal
matrix; these are the entries of the diagonal matrix.
See ideal.ring_basis
for the basis on S
,
see ideal.self_basis
for the basis on I
,
and ideal.self_basis_def
for the proof that the inclusion map forms a square diagonal matrix.
Equations
- ideal.smith_coeffs b I hI = Exists.some _
If S
a finite-dimensional ring extension of a PID R
which is free as an R
-module,
then any nonzero S
-ideal I
is free as an R
-submodule of S
, and we can
find a basis for S
and I
such that the inclusion map is a square diagonal
matrix.
Equations
- has_quotient.quotient.module F b hI i = submodule.quotient.module' (ideal.span {ideal.smith_coeffs b I hI i})
A set of linearly independent vectors in a module M
over a semiring S
is also linearly
independent over a subring R
of K
.