# Dimension of modules and vector spaces #

## Main definitions #

• The rank of a module is defined as Module.rank : Cardinal. This is defined as the supremum of the cardinalities of linearly independent subsets.

## Main statements #

• LinearMap.rank_le_of_injective: the source of an injective linear map has dimension at most that of the target.
• LinearMap.rank_le_of_surjective: the target of a surjective linear map has dimension at most that of that source.

## Implementation notes #

Many theorems in this file are not universe-generic when they relate dimensions in different universes. They should be as general as they can be without inserting lifts. The types M, M', ... all live in different universes, and M₁, M₂, ... all live in the same universe.

theorem Module.rank_def (R : Type u_1) (M : Type u_2) [] [] [Module R M] :
= ⨆ (ι : { s : Set M // LinearIndependent (ι := { x : M // x s }) R Subtype.val }), Cardinal.mk ι
@[irreducible]
def Module.rank (R : Type u_1) (M : Type u_2) [] [] [Module R M] :

The rank of a module, defined as a term of type Cardinal.

We define this as the supremum of the cardinalities of linearly independent subsets.

For a free module over any ring satisfying the strong rank condition (e.g. left-noetherian rings, commutative rings, and in particular division rings and fields), this is the same as the dimension of the space (i.e. the cardinality of any basis).

In particular this agrees with the usual notion of the dimension of a vector space.

Equations
Instances For
theorem rank_le_card (R : Type u) (M : Type v) [] [] [Module R M] :
theorem nonempty_linearIndependent_set (R : Type u) (M : Type v) [] [] [Module R M] :
Nonempty { s : Set M // LinearIndependent (ι := { x : M // x s }) R Subtype.val }
theorem LinearIndependent.cardinal_lift_le_rank {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] {ι : Type w} {v : ιM} (hv : ) :
theorem LinearIndependent.aleph0_le_rank {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] {ι : Type w} [] {v : ιM} (hv : ) :
theorem LinearIndependent.cardinal_le_rank {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] {ι : Type v} {v : ιM} (hv : ) :
theorem LinearIndependent.cardinal_le_rank' {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] {s : Set M} (hs : LinearIndependent R fun (x : s) => x) :
@[deprecated LinearIndependent.cardinal_lift_le_rank]
theorem cardinal_lift_le_rank_of_linearIndependent {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] {ι : Type w} {v : ιM} (hv : ) :

Alias of LinearIndependent.cardinal_lift_le_rank.

@[deprecated LinearIndependent.cardinal_lift_le_rank]
theorem cardinal_lift_le_rank_of_linearIndependent' {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] {ι : Type w} {v : ιM} (hv : ) :

Alias of LinearIndependent.cardinal_lift_le_rank.

@[deprecated LinearIndependent.cardinal_le_rank]
theorem cardinal_le_rank_of_linearIndependent {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] {ι : Type v} {v : ιM} (hv : ) :

Alias of LinearIndependent.cardinal_le_rank.

@[deprecated LinearIndependent.cardinal_le_rank']
theorem cardinal_le_rank_of_linearIndependent' {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] {s : Set M} (hs : LinearIndependent R fun (x : s) => x) :

Alias of LinearIndependent.cardinal_le_rank'.

theorem lift_rank_le_of_injective_injective {R : Type u} {R' : Type u'} {M : Type v} {M' : Type v'} [Ring R] [] [Module R M] [Ring R'] [] [Module R' M'] (i : R'R) (j : M →+ M') (hi : ∀ (r : R'), i r = 0r = 0) (hj : ) (hc : ∀ (r : R') (m : M), j (i r m) = r j m) :

If M / R and M' / R' are modules, i : R' → R is a map which sends non-zero elements to non-zero elements, j : M →+ M' is an injective group homomorphism, such that the scalar multiplications on M and M' are compatible, then the rank of M / R is smaller than or equal to the rank of M' / R'. As a special case, taking R = R' it is LinearMap.lift_rank_le_of_injective.

theorem lift_rank_le_of_surjective_injective {R : Type u} {R' : Type u'} {M : Type v} {M' : Type v'} [Ring R] [] [Module R M] [Ring R'] [] [Module R' M'] (i : ZeroHom R R') (j : M →+ M') (hi : ) (hj : ) (hc : ∀ (r : R) (m : M), j (r m) = i r j m) :

If M / R and M' / R' are modules, i : R → R' is a surjective map which maps zero to zero, j : M →+ M' is an injective group homomorphism, such that the scalar multiplications on M and M' are compatible, then the rank of M / R is smaller than or equal to the rank of M' / R'. As a special case, taking R = R' it is LinearMap.lift_rank_le_of_injective.

theorem lift_rank_eq_of_equiv_equiv {R : Type u} {R' : Type u'} {M : Type v} {M' : Type v'} [Ring R] [] [Module R M] [Ring R'] [] [Module R' M'] (i : ZeroHom R R') (j : M ≃+ M') (hi : ) (hc : ∀ (r : R) (m : M), j (r m) = i r j m) :

If M / R and M' / R' are modules, i : R → R' is a bijective map which maps zero to zero, j : M ≃+ M' is a group isomorphism, such that the scalar multiplications on M and M' are compatible, then the rank of M / R is equal to the rank of M' / R'. As a special case, taking R = R' it is LinearEquiv.lift_rank_eq.

theorem rank_le_of_injective_injective {R : Type u} {R' : Type u'} {M : Type v} {M₁ : Type v} [Ring R] [] [Module R M] [Ring R'] [] [Module R' M₁] (i : R'R) (j : M →+ M₁) (hi : ∀ (r : R'), i r = 0r = 0) (hj : ) (hc : ∀ (r : R') (m : M), j (i r m) = r j m) :
Module.rank R' M₁

The same-universe version of lift_rank_le_of_injective_injective.

theorem rank_le_of_surjective_injective {R : Type u} {R' : Type u'} {M : Type v} {M₁ : Type v} [Ring R] [] [Module R M] [Ring R'] [] [Module R' M₁] (i : ZeroHom R R') (j : M →+ M₁) (hi : ) (hj : ) (hc : ∀ (r : R) (m : M), j (r m) = i r j m) :
Module.rank R' M₁

The same-universe version of lift_rank_le_of_surjective_injective.

theorem rank_eq_of_equiv_equiv {R : Type u} {R' : Type u'} {M : Type v} {M₁ : Type v} [Ring R] [] [Module R M] [Ring R'] [] [Module R' M₁] (i : ZeroHom R R') (j : M ≃+ M₁) (hi : ) (hc : ∀ (r : R) (m : M), j (r m) = i r j m) :
= Module.rank R' M₁

The same-universe version of lift_rank_eq_of_equiv_equiv.

theorem Algebra.lift_rank_le_of_injective_injective {R : Type w} {S : Type v} [] [Ring S] [Algebra R S] {R' : Type w'} {S' : Type v'} [CommRing R'] [Ring S'] [Algebra R' S'] (i : R' →+* R) (j : S →+* S') (hi : ) (hj : ) (hc : (j.comp (algebraMap R S)).comp i = algebraMap R' S') :

If S / R and S' / R' are algebras, i : R' →+* R and j : S →+* S' are injective ring homomorphisms, such that R' → R → S → S' and R' → S' commute, then the rank of S / R is smaller than or equal to the rank of S' / R'.

theorem Algebra.lift_rank_le_of_surjective_injective {R : Type w} {S : Type v} [] [Ring S] [Algebra R S] {R' : Type w'} {S' : Type v'} [CommRing R'] [Ring S'] [Algebra R' S'] (i : R →+* R') (j : S →+* S') (hi : ) (hj : ) (hc : (algebraMap R' S').comp i = j.comp (algebraMap R S)) :

If S / R and S' / R' are algebras, i : R →+* R' is a surjective ring homomorphism, j : S →+* S' is an injective ring homomorphism, such that R → R' → S' and R → S → S' commute, then the rank of S / R is smaller than or equal to the rank of S' / R'.

theorem Algebra.lift_rank_eq_of_equiv_equiv {R : Type w} {S : Type v} [] [Ring S] [Algebra R S] {R' : Type w'} {S' : Type v'} [CommRing R'] [Ring S'] [Algebra R' S'] (i : R ≃+* R') (j : S ≃+* S') (hc : (algebraMap R' S').comp i.toRingHom = j.toRingHom.comp (algebraMap R S)) :

If S / R and S' / R' are algebras, i : R ≃+* R' and j : S ≃+* S' are ring isomorphisms, such that R → R' → S' and R → S → S' commute, then the rank of S / R is equal to the rank of S' / R'.

theorem Algebra.rank_le_of_injective_injective {R : Type w} {S : Type v} [] [Ring S] [Algebra R S] {R' : Type w'} [CommRing R'] {S' : Type v} [Ring S'] [Algebra R' S'] (i : R' →+* R) (j : S →+* S') (hi : ) (hj : ) (hc : (j.comp (algebraMap R S)).comp i = algebraMap R' S') :

The same-universe version of Algebra.lift_rank_le_of_injective_injective.

theorem Algebra.rank_le_of_surjective_injective {R : Type w} {S : Type v} [] [Ring S] [Algebra R S] {R' : Type w'} [CommRing R'] {S' : Type v} [Ring S'] [Algebra R' S'] (i : R →+* R') (j : S →+* S') (hi : ) (hj : ) (hc : (algebraMap R' S').comp i = j.comp (algebraMap R S)) :

The same-universe version of Algebra.lift_rank_le_of_surjective_injective.

theorem Algebra.rank_eq_of_equiv_equiv {R : Type w} {S : Type v} [] [Ring S] [Algebra R S] {R' : Type w'} [CommRing R'] {S' : Type v} [Ring S'] [Algebra R' S'] (i : R ≃+* R') (j : S ≃+* S') (hc : (algebraMap R' S').comp i.toRingHom = j.toRingHom.comp (algebraMap R S)) :
= Module.rank R' S'

The same-universe version of Algebra.lift_rank_eq_of_equiv_equiv.

theorem LinearMap.lift_rank_le_of_injective {R : Type u} {M : Type v} {M' : Type v'} [Ring R] [] [Module R M] [] [Module R M'] (f : M →ₗ[R] M') (i : ) :
theorem LinearMap.rank_le_of_injective {R : Type u} {M : Type v} {M₁ : Type v} [Ring R] [] [Module R M] [] [Module R M₁] (f : M →ₗ[R] M₁) (i : ) :
theorem lift_rank_range_le {R : Type u} {M : Type v} {M' : Type v'} [Ring R] [] [Module R M] [] [Module R M'] (f : M →ₗ[R] M') :

The rank of the range of a linear map is at most the rank of the source.

theorem rank_range_le {R : Type u} {M : Type v} {M₁ : Type v} [Ring R] [] [Module R M] [] [Module R M₁] (f : M →ₗ[R] M₁) :
theorem lift_rank_map_le {R : Type u} {M : Type v} {M' : Type v'} [Ring R] [] [Module R M] [] [Module R M'] (f : M →ₗ[R] M') (p : ) :
theorem rank_map_le {R : Type u} {M : Type v} {M₁ : Type v} [Ring R] [] [Module R M] [] [Module R M₁] (f : M →ₗ[R] M₁) (p : ) :
theorem rank_le_of_submodule {R : Type u} {M : Type v} [Ring R] [] [Module R M] (s : ) (t : ) (h : s t) :
theorem LinearEquiv.lift_rank_eq {R : Type u} {M : Type v} {M' : Type v'} [Ring R] [] [Module R M] [] [Module R M'] (f : M ≃ₗ[R] M') :
=

Two linearly equivalent vector spaces have the same dimension, a version with different universes.

theorem LinearEquiv.rank_eq {R : Type u} {M : Type v} {M₁ : Type v} [Ring R] [] [Module R M] [] [Module R M₁] (f : M ≃ₗ[R] M₁) :
= Module.rank R M₁

Two linearly equivalent vector spaces have the same dimension.

theorem lift_rank_range_of_injective {R : Type u} {M : Type v} {M' : Type v'} [Ring R] [] [Module R M] [] [Module R M'] (f : M →ₗ[R] M') (h : ) :
=
theorem rank_range_of_injective {R : Type u} {M : Type v} {M₁ : Type v} [Ring R] [] [Module R M] [] [Module R M₁] (f : M →ₗ[R] M₁) (h : ) :
=
theorem LinearEquiv.lift_rank_map_eq {R : Type u} {M : Type v} {M' : Type v'} [Ring R] [] [Module R M] [] [Module R M'] (f : M ≃ₗ[R] M') (p : ) :
theorem LinearEquiv.rank_map_eq {R : Type u} {M : Type v} {M₁ : Type v} [Ring R] [] [Module R M] [] [Module R M₁] (f : M ≃ₗ[R] M₁) (p : ) :
Module.rank R (Submodule.map (↑f) p) = Module.rank R p

Pushforwards of submodules along a LinearEquiv have the same dimension.

@[simp]
theorem rank_top (R : Type u) (M : Type v) [Ring R] [] [Module R M] :
=
theorem rank_range_of_surjective {R : Type u} {M : Type v} {M' : Type v'} [Ring R] [] [Module R M] [] [Module R M'] (f : M →ₗ[R] M') (h : ) :
theorem rank_submodule_le {R : Type u} {M : Type v} [Ring R] [] [Module R M] (s : ) :
theorem LinearMap.lift_rank_le_of_surjective {R : Type u} {M : Type v} {M' : Type v'} [Ring R] [] [Module R M] [] [Module R M'] (f : M →ₗ[R] M') (h : ) :
theorem LinearMap.rank_le_of_surjective {R : Type u} {M : Type v} {M₁ : Type v} [Ring R] [] [Module R M] [] [Module R M₁] (f : M →ₗ[R] M₁) (h : ) :
@[simp]
theorem rank_subsingleton {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] :
= 1