# Documentation

Mathlib.LinearAlgebra.Dimension

# 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.

• The rank of a linear map is defined as the rank of its range.

## 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.
• basis_finite_of_finite_spans: the existence of a finite spanning set implies that any basis is finite.
• infinite_basis_le_maximal_linearIndependent: if b is an infinite basis for a module M, and s is a maximal linearly independent set, then the cardinality of b is bounded by the cardinality of s.

For modules over rings satisfying the rank condition

• Basis.le_span: the cardinality of a basis is bounded by the cardinality of any spanning set

For modules over rings satisfying the strong rank condition

• linearIndependent_le_span: For any linearly independent family v : ι → M and any finite spanning set w : Set M, the cardinality of ι is bounded by the cardinality of w.
• linearIndependent_le_basis: If b is a basis for a module M, and s is a linearly independent set, then the cardinality of s is bounded by the cardinality of b.

For modules over rings with invariant basis number (including all commutative rings and all noetherian rings)

• mk_eq_mk_of_basis: the dimension theorem, any two bases of the same vector space have the same cardinality.

For vector spaces (i.e. modules over a field), we have

• rank_quotient_add_rank: if V₁ is a submodule of V, then Module.rank (V/V₁) + Module.rank V₁ = Module.rank V.
• rank_range_add_rank_ker: the rank-nullity theorem.

## 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 V, V', ... all live in different universes, and V₁, V₂, ... all live in the same universe.

@[irreducible]
def Module.rank (K : Type u_2) (V : Type u_3) [] [] [Module K V] :

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.

The definition is marked as protected to avoid conflicts with _root_.rank, the rank of a linear map.

Instances For
theorem Module.rank_def (K : Type u_2) (V : Type u_3) [] [] [Module K V] :
= ⨆ (ι : { s // LinearIndependent K Subtype.val }), Cardinal.mk ι
theorem LinearMap.lift_rank_le_of_injective {R : Type u} [Ring R] {M : Type v} [] [Module R M] {M' : Type v'} [] [Module R M'] (f : M →ₗ[R] M') (i : ) :
theorem LinearMap.rank_le_of_injective {R : Type u} [Ring R] {M : Type v} [] [Module R M] {M₁ : Type v} [] [Module R M₁] (f : M →ₗ[R] M₁) (i : ) :
theorem rank_le {R : Type u} [Ring R] {M : Type v} [] [Module R M] {n : } (H : ∀ (s : ), (LinearIndependent R fun i => i) → n) :
n
theorem lift_rank_range_le {R : Type u} [Ring R] {M : Type v} [] [Module R M] {M' : Type v'} [] [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} [Ring R] {M : Type v} [] [Module R M] {M₁ : Type v} [] [Module R M₁] (f : M →ₗ[R] M₁) :
Module.rank R { x // }
theorem lift_rank_map_le {R : Type u} [Ring R] {M : Type v} [] [Module R M] {M' : Type v'} [] [Module R M'] (f : M →ₗ[R] M') (p : ) :
theorem rank_map_le {R : Type u} [Ring R] {M : Type v} [] [Module R M] {M₁ : Type v} [] [Module R M₁] (f : M →ₗ[R] M₁) (p : ) :
Module.rank R { x // x } Module.rank R { x // x p }
theorem rank_le_of_submodule {R : Type u} [Ring R] {M : Type v} [] [Module R M] (s : ) (t : ) (h : s t) :
Module.rank R { x // x s } Module.rank R { x // x t }
theorem LinearEquiv.lift_rank_eq {R : Type u} [Ring R] {M : Type v} [] [Module R M] {M' : Type v'} [] [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} [Ring R] {M : Type v} [] [Module R M] {M₁ : Type v} [] [Module R M₁] (f : M ≃ₗ[R] M₁) :
= Module.rank R M₁

Two linearly equivalent vector spaces have the same dimension.

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

Pushforwards of submodules along a LinearEquiv have the same dimension.

@[simp]
theorem rank_top (R : Type u) [Ring R] (M : Type v) [] [Module R M] :
Module.rank R { x // x } =
theorem rank_range_of_surjective {R : Type u} [Ring R] {M : Type v} [] [Module R M] {M' : Type v'} [] [Module R M'] (f : M →ₗ[R] M') (h : ) :
Module.rank R { x // } = Module.rank R M'
theorem rank_submodule_le {R : Type u} [Ring R] {M : Type v} [] [Module R M] (s : ) :
Module.rank R { x // x s }
theorem LinearMap.rank_le_of_surjective {R : Type u} [Ring R] {M : Type v} [] [Module R M] {M₁ : Type v} [] [Module R M₁] (f : M →ₗ[R] M₁) (h : ) :
theorem rank_quotient_le {R : Type u} [Ring R] {M : Type v} [] [Module R M] (p : ) :
theorem cardinal_lift_le_rank_of_linearIndependent {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] {ι : Type w} {v : ιM} (hv : ) :
theorem cardinal_lift_le_rank_of_linearIndependent' {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] {ι : Type w} {v : ιM} (hv : ) :
theorem cardinal_le_rank_of_linearIndependent {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] {ι : Type v} {v : ιM} (hv : ) :
theorem cardinal_le_rank_of_linearIndependent' {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] {s : Set M} (hs : LinearIndependent R fun x => x) :
@[simp]
theorem rank_punit (R : Type u) [Ring R] [] :
@[simp]
theorem rank_bot (R : Type u) [Ring R] (M : Type v) [] [Module R M] [] :
Module.rank R { x // x } = 0
theorem exists_mem_ne_zero_of_rank_pos {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] {s : } (h : 0 < Module.rank R { x // x s }) :
b, b s b 0
theorem LinearIndependent.finite_of_isNoetherian {ι : Type w} {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] [] {v : ιM} (hv : ) :

A linearly-independent family of vectors in a module over a non-trivial ring must be finite if the module is Noetherian.

theorem LinearIndependent.set_finite_of_isNoetherian {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] [] {s : Set M} (hi : LinearIndependent R Subtype.val) :
theorem basis_finite_of_finite_spans {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] (w : Set M) (hw : ) (s : = ) {ι : Type w} (b : Basis ι R M) :

Over any nontrivial ring, the existence of a finite spanning set implies that any basis is finite.

theorem union_support_maximal_linearIndependent_eq_range_basis {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] {ι : Type w} (b : Basis ι R M) {κ : Type w'} (v : κM) (i : ) (m : ) :
⋃ (k : κ), (b.repr (v k)).support = Set.univ

Over any ring R, if b is a basis for a module M, and s is a maximal linearly independent set, then the union of the supports of x ∈ s (when written out in the basis b) is all of b.

theorem infinite_basis_le_maximal_linearIndependent' {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] {ι : Type w} (b : Basis ι R M) [] {κ : Type w'} (v : κM) (i : ) (m : ) :

Over any ring R, if b is an infinite basis for a module M, and s is a maximal linearly independent set, then the cardinality of b is bounded by the cardinality of s.

theorem infinite_basis_le_maximal_linearIndependent {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] {ι : Type w} (b : Basis ι R M) [] {κ : Type w} (v : κM) (i : ) (m : ) :

Over any ring R, if b is an infinite basis for a module M, and s is a maximal linearly independent set, then the cardinality of b is bounded by the cardinality of s.

theorem CompleteLattice.Independent.subtype_ne_bot_le_rank {ι : Type w} {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] [] {V : ι} (hV : ) :
@[simp]
theorem rank_subsingleton {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] :
= 1
theorem rank_pos {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] [] :
0 <
theorem rank_zero_iff_forall_zero {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] [] :
= 0 ∀ (x : M), x = 0
theorem rank_zero_iff {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] [] :
= 0

See rank_subsingleton for the reason that Nontrivial R is needed.

theorem rank_pos_iff_exists_ne_zero {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] [] :
0 < x, x 0
theorem rank_pos_iff_nontrivial {R : Type u} {M : Type v} [Ring R] [] [Module R M] [] [] :
0 <
theorem mk_eq_mk_of_basis {ι : Type w} {ι' : Type w'} {R : Type u} [Ring R] {M : Type v} [] [Module R M] (v : Basis ι R M) (v' : Basis ι' R M) :
=

The dimension theorem: if v and v' are two bases, their index types have the same cardinalities.

def Basis.indexEquiv {ι : Type w} {ι' : Type w'} {R : Type u} [Ring R] {M : Type v} [] [Module R M] (v : Basis ι R M) (v' : Basis ι' R M) :
ι ι'

Given two bases indexed by ι and ι' of an R-module, where R satisfies the invariant basis number property, an equiv ι ≃ ι' .

Instances For
theorem mk_eq_mk_of_basis' {ι : Type w} {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι' : Type w} (v : Basis ι R M) (v' : Basis ι' R M) :
theorem Basis.le_span'' {R : Type u} [Ring R] [] {M : Type v} [] [Module R M] {ι : Type u_2} [] (b : Basis ι R M) {w : Set M} [Fintype w] (s : = ) :

An auxiliary lemma for Basis.le_span.

If R satisfies the rank condition, then for any finite basis b : Basis ι R M, and any finite spanning set w : Set M, the cardinality of ι is bounded by the cardinality of w.

theorem basis_le_span' {R : Type u} [Ring R] [] {M : Type v} [] [Module R M] {ι : Type u_2} (b : Basis ι R M) {w : Set M} [Fintype w] (s : = ) :
↑()

Another auxiliary lemma for Basis.le_span, which does not require assuming the basis is finite, but still assumes we have a finite spanning set.

theorem Basis.le_span {ι : Type w} {R : Type u} [Ring R] [] {M : Type v} [] [Module R M] {J : Set M} (v : Basis ι R M) (hJ : = ) :

If R satisfies the rank condition, then the cardinality of any basis is bounded by the cardinality of any spanning set.

theorem linearIndependent_le_span_aux' {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} [] (v : ιM) (i : ) (w : Set M) [Fintype w] (s : ↑()) :
def linearIndependentFintypeOfLeSpanFintype {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} (v : ιM) (i : ) (w : Set M) [Fintype w] (s : ↑()) :

If R satisfies the strong rank condition, then any linearly independent family v : ι → M contained in the span of some finite w : Set M, is itself finite.

Instances For
theorem linearIndependent_le_span' {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} (v : ιM) (i : ) (w : Set M) [Fintype w] (s : ↑()) :
↑()

If R satisfies the strong rank condition, then for any linearly independent family v : ι → M contained in the span of some finite w : Set M, the cardinality of ι is bounded by the cardinality of w.

theorem linearIndependent_le_span {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} (v : ιM) (i : ) (w : Set M) [Fintype w] (s : = ) :
↑()

If R satisfies the strong rank condition, then for any linearly independent family v : ι → M and any finite spanning set w : Set M, the cardinality of ι is bounded by the cardinality of w.

theorem linearIndependent_le_span_finset {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} (v : ιM) (i : ) (w : ) (s : = ) :
↑()

A version of linearIndependent_le_span for Finset.

theorem linearIndependent_le_infinite_basis {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} (b : Basis ι R M) [] {κ : Type u_2} (v : κM) (i : ) :

An auxiliary lemma for linearIndependent_le_basis: we handle the case where the basis b is infinite.

theorem linearIndependent_le_basis {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} (b : Basis ι R M) {κ : Type u_2} (v : κM) (i : ) :

Over any ring R satisfying the strong rank condition, if b is a basis for a module M, and s is a linearly independent set, then the cardinality of s is bounded by the cardinality of b.

theorem Basis.card_le_card_of_linearIndependent_aux {R : Type u_2} [Ring R] (n : ) {m : } (v : Fin mFin nR) :
m n

Let R satisfy the strong rank condition. If m elements of a free rank n R-module are linearly independent, then m ≤ n.

theorem maximal_linearIndependent_eq_infinite_basis {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} (b : Basis ι R M) [] {κ : Type u_2} (v : κM) (i : ) (m : ) :

Over any ring R satisfying the strong rank condition, if b is an infinite basis for a module M, then every maximal linearly independent set has the same cardinality as b.

This proof (along with some of the lemmas above) comes from [Les familles libres maximales d'un module ont-elles le meme cardinal?][lazarus1973]

theorem Basis.mk_eq_rank'' {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type v} (v : Basis ι R M) :
=
theorem Basis.mk_range_eq_rank {ι : Type w} {R : Type u} [Ring R] {M : Type v} [] [Module R M] (v : Basis ι R M) :
Cardinal.mk ↑() =
theorem rank_eq_card_basis {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type w} [] (h : Basis ι R M) :
= ↑()

If a vector space has a finite basis, then its dimension (seen as a cardinal) is equal to the cardinality of the basis.

theorem Basis.card_le_card_of_linearIndependent {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} [] (b : Basis ι R M) {ι' : Type u_3} [Fintype ι'] {v : ι'M} (hv : ) :
theorem Basis.card_le_card_of_submodule {ι : Type w} {ι' : Type w'} {R : Type u} [Ring R] {M : Type v} [] [Module R M] (N : ) [] (b : Basis ι R M) [Fintype ι'] (b' : Basis ι' R { x // x N }) :
theorem Basis.card_le_card_of_le {ι : Type w} {ι' : Type w'} {R : Type u} [Ring R] {M : Type v} [] [Module R M] {N : } {O : } (hNO : N O) [] (b : Basis ι R { x // x O }) [Fintype ι'] (b' : Basis ι' R { x // x N }) :
theorem Basis.mk_eq_rank {ι : Type w} {R : Type u} [Ring R] {M : Type v} [] [Module R M] (v : Basis ι R M) :
=
theorem Basis.mk_eq_rank' {ι : Type w} {R : Type u} [Ring R] {M : Type v} [] [Module R M] (v : Basis ι R M) :
=
theorem Basis.nonempty_fintype_index_of_rank_lt_aleph0 {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} (b : Basis ι R M) (h : ) :

If a module has a finite dimension, all bases are indexed by a finite type.

noncomputable def Basis.fintypeIndexOfRankLtAleph0 {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} (b : Basis ι R M) (h : ) :

If a module has a finite dimension, all bases are indexed by a finite type.

Instances For
theorem Basis.finite_index_of_rank_lt_aleph0 {R : Type u} [Ring R] {M : Type v} [] [Module R M] {ι : Type u_2} {s : Set ι} (b : Basis (s) R M) (h : ) :

If a module has a finite dimension, all bases are indexed by a finite set.

theorem rank_span {ι : Type w} {R : Type u} [Ring R] {M : Type v} [] [Module R M] {v : ιM} (hv : ) :
Module.rank R { x // x } = Cardinal.mk ↑()
theorem rank_span_set {R : Type u} [Ring R] {M : Type v} [] [Module R M] {s : Set M} (hs : LinearIndependent R fun x => x) :
Module.rank R { x // x } =
def Submodule.inductionOnRank {ι : Type w} {R : Type u} [Ring R] {M : Type v} [] [Module R M] [] [] (b : Basis ι R M) (P : Sort u_2) (ih : (N : ) → ((N' : ) → N' N(x : M) → x N(∀ (c : R) (y : M), y N'c x + y = 0c = 0) → P N') → P N) (N : ) :
P N

An induction (and recursion) principle for proving results about all submodules of a fixed finite free module M. A property is true for all submodules of M if it satisfies the following "inductive step": the property is true for a submodule N if it's true for all submodules N' of N with the property that there exists 0 ≠ x ∈ N such that the sum N' + Rx is direct.

Instances For
theorem Ideal.rank_eq {R : Type u_2} {S : Type u_3} [] [Ring S] [] [Algebra R S] {n : Type u_4} {m : Type u_5} [] [] (b : Basis n R S) {I : } (hI : I ) (c : Basis m R { x // x I }) :

If S a module-finite free R-algebra, then the R-rank of a nonzero R-free ideal I of S is the same as the rank of S.

@[simp]
theorem rank_self (R : Type u) [Ring R] :
= 1
theorem Module.Free.rank_eq_card_chooseBasisIndex (K : Type u) (V : Type v) [Ring K] [] [Module K V] [] :

The rank of a free module M over R is the cardinality of ChooseBasisIndex R M.

theorem Module.Free.rank_eq_mk_of_infinite_lt (K : Type u) (V : Type v) [Ring K] [] [Module K V] [] [] (h_lt : < ) :
=

The rank of a free module V over an infinite scalar ring K is the cardinality of V whenever #R < #V.

theorem nonempty_linearEquiv_of_lift_rank_eq {K : Type u} {V : Type v} {V' : Type v'} [Ring K] [] [Module K V] [] [] [Module K V'] [Module.Free K V'] (cnd : = ) :

Two vector spaces are isomorphic if they have the same dimension.

theorem nonempty_linearEquiv_of_rank_eq {K : Type u} {V : Type v} {V₁ : Type v} [Ring K] [] [Module K V] [] [] [Module K V₁] [Module.Free K V₁] (cond : = Module.rank K V₁) :
Nonempty (V ≃ₗ[K] V₁)

Two vector spaces are isomorphic if they have the same dimension.

def LinearEquiv.ofLiftRankEq {K : Type u} (V : Type v) (V' : Type v') [Ring K] [] [Module K V] [] [] [Module K V'] [Module.Free K V'] (cond : = ) :
V ≃ₗ[K] V'

Two vector spaces are isomorphic if they have the same dimension.

Instances For
def LinearEquiv.ofRankEq {K : Type u} (V : Type v) (V₁ : Type v) [Ring K] [] [Module K V] [] [] [Module K V₁] [Module.Free K V₁] (cond : = Module.rank K V₁) :
V ≃ₗ[K] V₁

Two vector spaces are isomorphic if they have the same dimension.

Instances For
theorem LinearEquiv.nonempty_equiv_iff_lift_rank_eq {K : Type u} {V : Type v} {V' : Type v'} [Ring K] [] [Module K V] [] [] [Module K V'] [Module.Free K V'] :

Two vector spaces are isomorphic if and only if they have the same dimension.

theorem LinearEquiv.nonempty_equiv_iff_rank_eq {K : Type u} {V : Type v} {V₁ : Type v} [Ring K] [] [Module K V] [] [] [Module K V₁] [Module.Free K V₁] :
Nonempty (V ≃ₗ[K] V₁) = Module.rank K V₁

Two vector spaces are isomorphic if and only if they have the same dimension.

@[simp]
theorem rank_prod {K : Type u} {V : Type v} {V' : Type v'} [Ring K] [] [Module K V] [] [] [Module K V'] [Module.Free K V'] :
Module.rank K (V × V') = +

If M and N are free, then the rank of M × N is (Module.rank R M).lift + (Module.rank R N).lift.

theorem rank_prod' {K : Type u} {V : Type v} {V₁ : Type v} [Ring K] [] [Module K V] [] [] [Module K V₁] [Module.Free K V₁] :
Module.rank K (V × V₁) = + Module.rank K V₁

If M and N are free (and lie in the same universe), the rank of M × N is (Module.rank R M) + (Module.rank R N).

@[simp]
theorem rank_ulift {K : Type u} {V : Type v} [Ring K] [] [Module K V] :
@[simp]
theorem rank_pi {K : Type u} {η : Type u₁'} {φ : ηType u_1} [Ring K] [(i : η) → AddCommGroup (φ i)] [(i : η) → Module K (φ i)] [∀ (i : η), Module.Free K (φ i)] [] :
Module.rank K ((i : η) → φ i) = Cardinal.sum fun i => Module.rank K (φ i)

The rank of a finite product of free modules is the sum of the ranks.

theorem rank_fun {K : Type u} [Ring K] {V : Type u} {η : Type u} [] [] [Module K V] [] :
Module.rank K (ηV) = ↑() *
theorem rank_fun_eq_lift_mul {K : Type u} {V : Type v} {η : Type u₁'} [Ring K] [] [Module K V] [] [] :
Module.rank K (ηV) = ↑() *
theorem rank_fun' {K : Type u} {η : Type u₁'} [Ring K] [] :
Module.rank K (ηK) = ↑()
theorem rank_fin_fun {K : Type u} [Ring K] (n : ) :
Module.rank K (Fin nK) = n
def finDimVectorspaceEquiv {K : Type u} {V : Type v} [Ring K] [] [Module K V] [] (n : ) (hn : = n) :
V ≃ₗ[K] Fin nK

An n-dimensional K-vector space is equivalent to Fin n → K.

Instances For
theorem Basis.finite_ofVectorSpaceIndex_of_rank_lt_aleph0 {K : Type u} {V : Type v} [] [] [Module K V] (h : ) :

If a vector space has a finite dimension, the index set of Basis.ofVectorSpace is finite.

theorem rank_span_le {K : Type u} {V : Type v} [] [] [Module K V] (s : Set V) :
Module.rank K { x // x }
theorem rank_span_of_finset {K : Type u} {V : Type v} [] [] [Module K V] (s : ) :
theorem rank_quotient_add_rank {K : Type u} {V : Type v} [] [] [Module K V] (p : ) :
Module.rank K (V p) + Module.rank K { x // x p } =
theorem rank_range_add_rank_ker {K : Type u} {V : Type v} {V₁ : Type v} [] [] [Module K V] [] [Module K V₁] (f : V →ₗ[K] V₁) :
Module.rank K { x // } + Module.rank K { x // } =

rank-nullity theorem

theorem rank_eq_of_surjective {K : Type u} {V : Type v} {V₁ : Type v} [] [] [Module K V] [] [Module K V₁] (f : V →ₗ[K] V₁) (h : ) :
= Module.rank K V₁ + Module.rank K { x // }
theorem exists_linearIndependent_cons_of_lt_rank {K : Type u} {V : Type v} [] [] [Module K V] {n : } {v : Fin nV} (hv : ) (h : n < ) :

Given a family of n linearly independent vectors in a space of dimension > n, one may extend the family by another vector while retaining linear independence.

theorem exists_linearIndependent_snoc_of_lt_rank {K : Type u} {V : Type v} [] [] [Module K V] {n : } {v : Fin nV} (hv : ) (h : n < ) :

Given a family of n linearly independent vectors in a space of dimension > n, one may extend the family by another vector while retaining linear independence.

theorem exists_linearIndependent_pair_of_one_lt_rank {K : Type u} {V : Type v} [] [] [Module K V] (h : 1 < ) {x : V} (hx : x 0) :
y, LinearIndependent K ![x, y]

Given a nonzero vector in a space of dimension > 1, one may find another vector linearly independent of the first one.

theorem rank_add_rank_split {K : Type u} {V : Type v} {V₁ : Type v} {V₂ : Type v} {V₃ : Type v} [] [] [Module K V] [] [Module K V₁] [] [Module K V₂] [] [Module K V₃] (db : V₂ →ₗ[K] V) (eb : V₃ →ₗ[K] V) (cd : V₁ →ₗ[K] V₂) (ce : V₁ →ₗ[K] V₃) (hde : ) (hgd : ) (eq : LinearMap.comp db cd = LinearMap.comp eb ce) (eq₂ : ∀ (d : V₂) (e : V₃), db d = eb ec, cd c = d ce c = e) :
+ Module.rank K V₁ = Module.rank K V₂ + Module.rank K V₃

This is mostly an auxiliary lemma for Submodule.rank_sup_add_rank_inf_eq.

theorem Submodule.rank_sup_add_rank_inf_eq {K : Type u} {V : Type v} [] [] [Module K V] (s : ) (t : ) :
Module.rank K { x // x s t } + Module.rank K { x // x s t } = Module.rank K { x // x s } + Module.rank K { x // x t }
theorem Submodule.rank_add_le_rank_add_rank {K : Type u} {V : Type v} [] [] [Module K V] (s : ) (t : ) :
Module.rank K { x // x s t } Module.rank K { x // x s } + Module.rank K { x // x t }
def Basis.ofRankEqZero {K : Type u} {V : Type v} [] [] [Module K V] {ι : Type u_2} [] (hV : = 0) :
Basis ι K V

The ι indexed basis on V, where ι is an empty type and V is zero-dimensional.

See also FiniteDimensional.finBasis.

Instances For
@[simp]
theorem Basis.ofRankEqZero_apply {K : Type u} {V : Type v} [] [] [Module K V] {ι : Type u_2} [] (hV : = 0) (i : ι) :
↑() i = 0
theorem le_rank_iff_exists_linearIndependent {K : Type u} {V : Type v} [] [] [Module K V] {c : Cardinal.{v}} :
c s, = c LinearIndependent K Subtype.val
theorem le_rank_iff_exists_linearIndependent_finset {K : Type u} {V : Type v} [] [] [Module K V] {n : } :
n s, = n LinearIndependent K Subtype.val
theorem rank_le_one_iff {K : Type u} {V : Type v} [] [] [Module K V] :
1 v₀, ∀ (v : V), r, r v₀ = v

A vector space has dimension at most 1 if and only if there is a single vector of which all vectors are multiples.

theorem rank_submodule_le_one_iff {K : Type u} {V : Type v} [] [] [Module K V] (s : ) :
Module.rank K { x // x s } 1 v₀, v₀ s s Submodule.span K {v₀}

A submodule has dimension at most 1 if and only if there is a single vector in the submodule such that the submodule is contained in its span.

theorem rank_submodule_le_one_iff' {K : Type u} {V : Type v} [] [] [Module K V] (s : ) :
Module.rank K { x // x s } 1 v₀, s Submodule.span K {v₀}

A submodule has dimension at most 1 if and only if there is a single vector, not necessarily in the submodule, such that the submodule is contained in its span.

theorem Submodule.rank_le_one_iff_isPrincipal {K : Type u} {V : Type v} [] [] [Module K V] (W : ) :
Module.rank K { x // x W } 1
theorem Module.rank_le_one_iff_top_isPrincipal {K : Type u} {V : Type v} [] [] [Module K V] :

### The rank of a linear map #

@[inline, reducible]
abbrev LinearMap.rank {K : Type u} {V : Type v} {V' : Type v'} [Ring K] [] [Module K V] [] [Module K V'] (f : V →ₗ[K] V') :

rank f is the rank of a LinearMap f, defined as the dimension of f.range.

Instances For
theorem LinearMap.rank_le_range {K : Type u} {V : Type v} {V' : Type v'} [Ring K] [] [Module K V] [] [Module K V'] (f : V →ₗ[K] V') :
theorem LinearMap.rank_le_domain {K : Type u} {V : Type v} {V₁ : Type v} [Ring K] [] [Module K V] [] [Module K V₁] (f : V →ₗ[K] V₁) :
@[simp]
theorem LinearMap.rank_zero {K : Type u} {V : Type v} {V' : Type v'} [Ring K] [] [Module K V] [] [Module K V'] [] :
theorem LinearMap.rank_comp_le_left {K : Type u} {V : Type v} {V' : Type v'} {V'' : Type v''} [Ring K] [] [Module K V] [] [Module K V'] [AddCommGroup V''] [Module K V''] (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') :
theorem LinearMap.lift_rank_comp_le_right {K : Type u} {V : Type v} {V' : Type v'} {V'' : Type v''} [Ring K] [] [Module K V] [] [Module K V'] [AddCommGroup V''] [Module K V''] (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') :
theorem LinearMap.lift_rank_comp_le {K : Type u} {V : Type v} {V' : Type v'} {V'' : Type v''} [Ring K] [] [Module K V] [] [Module K V'] [AddCommGroup V''] [Module K V''] (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') :
min () ()

The rank of the composition of two maps is less than the minimum of their ranks.

theorem LinearMap.rank_comp_le_right {K : Type u} {V : Type v} {V' : Type v'} {V'₁ : Type v'} [Ring K] [] [Module K V] [] [Module K V'] [AddCommGroup V'₁] [Module K V'₁] (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) :
theorem LinearMap.rank_comp_le {K : Type u} {V : Type v} {V' : Type v'} {V'₁ : Type v'} [Ring K] [] [Module K V] [] [Module K V'] [AddCommGroup V'₁] [Module K V'₁] (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) :
min () ()

The rank of the composition of two maps is less than the minimum of their ranks.

See lift_rank_comp_le for the universe-polymorphic version.

theorem LinearMap.rank_add_le {K : Type u} {V : Type v} {V' : Type v'} [] [] [Module K V] [] [Module K V'] (f : V →ₗ[K] V') (g : V →ₗ[K] V') :
theorem LinearMap.rank_finset_sum_le {K : Type u} {V : Type v} {V' : Type v'} [] [] [Module K V] [] [Module K V'] {η : Type u_2} (s : ) (f : ηV →ₗ[K] V') :
LinearMap.rank (Finset.sum s fun d => f d) Finset.sum s fun d => LinearMap.rank (f d)
theorem LinearMap.le_rank_iff_exists_linearIndependent {K : Type u} {V : Type v} {V' : Type v'} [] [] [Module K V] [] [Module K V'] {c : Cardinal.{v'}} {f : V →ₗ[K] V'} :
s, = LinearIndependent K fun x => f x
theorem LinearMap.le_rank_iff_exists_linearIndependent_finset {K : Type u} {V : Type v} {V' : Type v'} [] [] [Module K V] [] [Module K V'] {n : } {f : V →ₗ[K] V'} :
n s, = n LinearIndependent K fun x => f x