Finite dimensional vector spaces #
Definition and basic properties of finite dimensional vector spaces, of their dimensions, and of linear maps on such spaces.
Main definitions #
Assume V
is a vector space over a division ring K
. There are (at least) three equivalent
definitions of finite-dimensionality of V
:
- it admits a finite basis.
- it is finitely generated.
- it is noetherian, i.e., every subspace is finitely generated.
We introduce a typeclass FiniteDimensional K V
capturing this property. For ease of transfer of
proof, it is defined using the second point of view, i.e., as Finite
. However, we prove
that all these points of view are equivalent, with the following lemmas
(in the namespace FiniteDimensional
):
fintypeBasisIndex
states that a finite-dimensional vector space has a finite basisFiniteDimensional.finBasis
andFiniteDimensional.finBasisOfFinrankEq
are bases for finite dimensional vector spaces, where the index type isFin
of_fintype_basis
states that the existence of a basis indexed by a finite type implies finite-dimensionalityof_finite_basis
states that the existence of a basis indexed by a finite set implies finite-dimensionalityIsNoetherian.iff_fg
states that the space is finite-dimensional if and only if it is noetherian
We make use of finrank
, the dimension of a finite dimensional space, returning a Nat
, as
opposed to Module.rank
, which returns a Cardinal
. When the space has infinite dimension, its
finrank
is by convention set to 0
. finrank
is not defined using FiniteDimensional
.
For basic results that do not need the FiniteDimensional
class, import
Mathlib.LinearAlgebra.Finrank
.
Preservation of finite-dimensionality and formulas for the dimension are given for
- submodules
- quotients (for the dimension of a quotient, see
finrank_quotient_add_finrank
) - linear equivs, in
LinearEquiv.finiteDimensional
- image under a linear map (the rank-nullity formula is in
finrank_range_add_finrank_ker
)
Basic properties of linear maps of a finite-dimensional vector space are given. Notably, the
equivalence of injectivity and surjectivity is proved in LinearMap.injective_iff_surjective
,
and the equivalence between left-inverse and right-inverse in LinearMap.mul_eq_one_comm
and LinearMap.comp_eq_id_comm
.
Implementation notes #
Most results are deduced from the corresponding results for the general dimension (as a cardinal),
in Mathlib.LinearAlgebra.Dimension
. Not all results have been ported yet.
You should not assume that there has been any effort to state lemmas as generally as possible.
One of the characterizations of finite-dimensionality is in terms of finite generation. This
property is currently defined only for submodules, so we express it through the fact that the
maximal submodule (which, as a set, coincides with the whole space) is finitely generated. This is
not very convenient to use, although there are some helper functions. However, this becomes very
convenient when speaking of submodules which are finite-dimensional, as this notion coincides with
the fact that the submodule is finitely generated (as a submodule of the whole space). This
equivalence is proved in Submodule.fg_iff_finiteDimensional
.
FiniteDimensional
vector spaces are defined to be finite modules.
Use FiniteDimensional.of_fintype_basis
to prove finite dimension from another definition.
Equations
- FiniteDimensional K V = Module.Finite K V
Instances For
If the codomain of an injective linear map is finite dimensional, the domain must be as well.
If the domain of a surjective linear map is finite dimensional, the codomain must be as well.
A finite dimensional vector space over a finite field is finite
Equations
Instances For
If a vector space has a finite basis, then it is finite-dimensional.
If a vector space is FiniteDimensional
, all bases are indexed by a finite type
Instances For
If a vector space is FiniteDimensional
, Basis.ofVectorSpace
is indexed by
a finite type.
Equations
- FiniteDimensional.instFintypeElemOfVectorSpaceIndex = inferInstance
If a vector space has a basis indexed by elements of a finite set, then it is finite-dimensional.
A subspace of a finite-dimensional space is also finite-dimensional.
A quotient of a finite-dimensional space is also finite-dimensional.
In a finite-dimensional space, its dimension (seen as a cardinal) coincides with its
finrank
. This is a copy of finrank_eq_rank _ _
which creates easier typeclass searches.
We can infer FiniteDimensional K V
in the presence of [Fact (finrank K V = n + 1)]
. Declare
this as a local instance where needed.
If a vector space is finite-dimensional, then the cardinality of any basis is equal to its
finrank
.
Given a basis of a division ring over itself indexed by a type ι
, then ι
is Unique
.
Equations
- Basis.unique b = let_fun A := (_ : Cardinal.mk ι = ↑(FiniteDimensional.finrank K K)); Nonempty.some (_ : Nonempty (Unique ι))
Instances For
A finite dimensional vector space has a basis indexed by Fin (finrank K V)
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
An n
-dimensional vector space has a basis indexed by Fin n
.
Equations
- FiniteDimensional.finBasisOfFinrankEq K V hn = Basis.reindex (FiniteDimensional.finBasis K V) (Fin.castIso hn).toEquiv
Instances For
A module with dimension 1 has a basis with one element.
Equations
Instances For
A finite dimensional space has positive finrank
iff it has a nonzero element.
A finite dimensional space has positive finrank
iff it is nontrivial.
A nontrivial finite dimensional space has positive finrank
.
A finite dimensional space has zero finrank
iff it is a subsingleton.
This is the finrank
version of rank_zero_iff
.
If a submodule has maximal dimension in a finite dimensional space, then it is equal to the whole space.
The submodule generated by a finite set is finite-dimensional.
The submodule generated by a single element is finite-dimensional.
The submodule generated by a finset is finite-dimensional.
Pushforwards of finite-dimensional submodules are finite-dimensional.
Equations
- One or more equations did not get rendered due to their size.
If p
is an independent family of subspaces of a finite-dimensional space V
, then the
number of nontrivial subspaces in the family p
is finite.
Equations
- CompleteLattice.Independent.fintypeNeBotOfFiniteDimensional hp = let_fun this := (_ : Cardinal.mk { i // p i ≠ ⊥ } < Cardinal.aleph0); Nonempty.some (_ : Nonempty (Fintype { i // p i ≠ ⊥ }))
Instances For
If p
is an independent family of subspaces of a finite-dimensional space V
, then the
number of nontrivial subspaces in the family p
is bounded above by the dimension of V
.
Note that the Fintype
hypothesis required here can be provided by
CompleteLattice.Independent.fintypeNeBotOfFiniteDimensional
.
If a finset has cardinality larger than the dimension of the space, then there is a nontrivial linear relation amongst its elements.
If a finset has cardinality larger than finrank + 1
,
then there is a nontrivial linear relation amongst its elements,
such that the coefficients of the relation sum to zero.
A slight strengthening of exists_nontrivial_relation_sum_zero_of_rank_succ_lt_card
available when working over an ordered field:
we can ensure a positive coefficient, not just a nonzero coefficient.
In a vector space with dimension 1, each set {v} is a basis for v ≠ 0
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A submodule is finitely generated if and only if it is finite-dimensional
A submodule contained in a finite-dimensional submodule is finite-dimensional.
The inf of two submodules, the first finite-dimensional, is finite-dimensional.
The inf of two submodules, the second finite-dimensional, is finite-dimensional.
The sup of two finite-dimensional submodules is finite-dimensional.
The submodule generated by a finite supremum of finite dimensional submodules is finite-dimensional.
Note that strictly this only needs ∀ i ∈ s, FiniteDimensional K (S i)
, but that doesn't
work well with typeclass search.
The submodule generated by a supremum of finite dimensional submodules, indexed by a finite sort is finite-dimensional.
In a finite-dimensional vector space, the dimensions of a submodule and of the corresponding quotient add up to the dimension of the space.
The dimension of a strict submodule is strictly bounded by the dimension of the ambient space.
The sum of the dimensions of s + t and s ∩ t is the sum of the dimensions of s and t
Finite dimensionality is preserved under linear equivalence.
If a submodule is less than or equal to a finite-dimensional submodule with the same dimension, they are equal.
Given isomorphic subspaces p q
of vector spaces V
and V₁
respectively,
p.quotient
is isomorphic to q.quotient
.
Equations
- FiniteDimensional.LinearEquiv.quotEquivOfEquiv f₁ f₂ = LinearEquiv.ofFinrankEq (V ⧸ p) (V₂ ⧸ q) (_ : FiniteDimensional.finrank K (V ⧸ p) = FiniteDimensional.finrank K (V₂ ⧸ q))
Instances For
Given the subspaces p q
, if p.quotient ≃ₗ[K] q
, then q.quotient ≃ₗ[K] p
Equations
- FiniteDimensional.LinearEquiv.quotEquivOfQuotEquiv f = LinearEquiv.ofFinrankEq (V ⧸ q) { x // x ∈ p } (_ : FiniteDimensional.finrank K (V ⧸ q) = FiniteDimensional.finrank K { x // x ∈ p })
Instances For
On a finite-dimensional space, an injective linear map is surjective.
The image under an onto linear map of a finite-dimensional space is also finite-dimensional.
The range of a linear map defined on a finite-dimensional space is also finite-dimensional.
On a finite-dimensional space, a linear map is injective if and only if it is surjective.
In a finite-dimensional space, if linear maps are inverse to each other on one side then they are also inverse to each other on the other side.
In a finite-dimensional space, linear maps are inverse to each other on one side if and only if they are inverse to each other on the other side.
In a finite-dimensional space, linear maps are inverse to each other on one side if and only if they are inverse to each other on the other side.
rank-nullity theorem : the dimensions of the kernel and the range of a linear map add up to the dimension of the source space.
The linear equivalence corresponding to an injective endomorphism.
Equations
- LinearEquiv.ofInjectiveEndo f h_inj = LinearEquiv.ofBijective f (_ : Function.Injective ↑f ∧ Function.Surjective ↑f)
Instances For
If ι
is an empty type and V
is zero-dimensional, there is a unique ι
-indexed basis.
Equations
Instances For
Given a linear map f
between two vector spaces with the same dimension, if
ker f = ⊥
then linearEquivOfInjective
is the induced isomorphism
between the two vector spaces.
Equations
- LinearMap.linearEquivOfInjective f hf hdim = LinearEquiv.ofBijective f (_ : Function.Injective ↑f ∧ Function.Surjective ↑f)
Instances For
A domain that is module-finite as an algebra over a field is a division ring.
Equations
- One or more equations did not get rendered due to their size.
Instances For
An integral domain that is module-finite as an algebra over a field is a field.
Equations
- fieldOfFiniteDimensional F K = let src := divisionRingOfFiniteDimensional F K; Field.mk DivisionRing.zpow (_ : ∀ (a : K), a ≠ 0 → a * a⁻¹ = 1) (_ : 0⁻¹ = 0) DivisionRing.qsmul
Instances For
In a one-dimensional space, any vector is a multiple of any nonzero vector
A linear independent family of finrank K V
vectors forms a basis.
Equations
- basisOfLinearIndependentOfCardEqFinrank lin_ind card_eq = Basis.mk lin_ind (_ : ⊤ ≤ Submodule.span K (Set.range b))
Instances For
A linear independent finset of finrank K V
vectors forms a basis.
Equations
- finsetBasisOfLinearIndependentOfCardEqFinrank hs lin_ind card_eq = basisOfLinearIndependentOfCardEqFinrank lin_ind (_ : Fintype.card { x // x ∈ s } = FiniteDimensional.finrank K V)
Instances For
A linear independent set of finrank K V
vectors forms a basis.
Equations
- setBasisOfLinearIndependentOfCardEqFinrank lin_ind card_eq = basisOfLinearIndependentOfCardEqFinrank lin_ind (_ : Fintype.card ↑s = FiniteDimensional.finrank K V)
Instances For
We now give characterisations of finrank K V = 1
and finrank K V ≤ 1
.
A vector space with a nonzero vector v
has dimension 1 iff v
spans.
A module with a nonzero vector v
has dimension 1 iff every vector is a multiple of v
.
A module has dimension 1 iff there is some v : V
so {v}
is a basis.
A module has dimension 1 iff there is some nonzero v : V
so every vector is a multiple of v
.
A finite dimensional module has dimension at most 1 iff
there is some v : V
so every vector is a multiple of v
.
Any K
-algebra module that is 1-dimensional over K
is simple.
A Subalgebra
is FiniteDimensional
iff it is FiniteDimensional
as a submodule.
Alias of the forward direction of Subalgebra.finiteDimensional_toSubmodule
.
A Subalgebra
is FiniteDimensional
iff it is FiniteDimensional
as a submodule.
Alias of the reverse direction of Subalgebra.finiteDimensional_toSubmodule
.
A Subalgebra
is FiniteDimensional
iff it is FiniteDimensional
as a submodule.
Alias of the reverse direction of Subalgebra.bot_eq_top_iff_rank_eq_one
.
Alias of the reverse direction of Subalgebra.bot_eq_top_iff_finrank_eq_one
.