Bases #
This file defines bases in a module or vector space.
It is inspired by Isabelle/HOL's linear algebra, and hence indirectly by HOL Light.
Main definitions #
All definitions are given for families of vectors, i.e. v : ι → M
where M
is the module or
vector space and ι : Type*
is an arbitrary indexing type.
-
Basis ι R M
is the type ofι
-indexedR
-bases for a moduleM
, represented by a linear equivM ≃ₗ[R] ι →₀ R
. -
the basis vectors of a basis
b : Basis ι R M
are available asb i
, wherei : ι
-
Basis.repr
is the isomorphism sendingx : M
to its coordinatesBasis.repr x : ι →₀ R
. The converse, turning this isomorphism into a basis, is calledBasis.ofRepr
. -
If
ι
is finite, there is a variant ofrepr
calledBasis.equivFun b : M ≃ₗ[R] ι → R
(saving you from having to work withFinsupp
). The converse, turning this isomorphism into a basis, is calledBasis.ofEquivFun
. -
Basis.constr b R f
constructs a linear mapM₁ →ₗ[R] M₂
given the valuesf : ι → M₂
at the basis elements⇑b : ι → M₁
. -
Basis.reindex
uses an equiv to map a basis to a different indexing set. -
Basis.map
uses a linear equiv to map a basis to a different module.
Main statements #
-
Basis.mk
: a linear independent set of vectors spanning the whole module determines a basis -
Basis.ext
states that two linear maps are equal if they coincide on a basis. Similar results are available for linear equivs (if they coincide on the basis vectors), elements (if their coordinates coincide) and the functionsb.repr
and⇑b
.
Implementation notes #
We use families instead of sets because it allows us to say that two identical vectors are linearly
dependent. For bases, this is useful as well because we can easily derive ordered bases by using an
ordered index type ι
.
Tags #
basis, bases
A Basis ι R M
for a module M
is the type of ι
-indexed R
-bases of M
.
The basis vectors are available as DFunLike.coe (b : Basis ι R M) : ι → M
.
To turn a linear independent family of vectors spanning M
into a basis, use Basis.mk
.
They are internally represented as linear equivs M ≃ₗ[R] (ι →₀ R)
,
available as Basis.repr
.
- ofRepr :: (
repr
is the linear equivalence sending a vectorx
to its coordinates: thec
s such thatx = ∑ i, c i
.- )
Instances For
Equations
- uniqueBasis = { toInhabited := { default := { repr := default } }, uniq := ⋯ }
Equations
- One or more equations did not get rendered due to their size.
b i
is the i
th basis vector.
Equations
- Basis.instFunLike = { coe := fun (b : Basis ι R M) (i : ι) => (LinearEquiv.symm b.repr) (Finsupp.single i 1), coe_injective' := ⋯ }
b.coord i
is the linear function giving the i
'th coordinate of a vector
with respect to the basis b
.
b.coord i
is an element of the dual space. In particular, for
finite-dimensional spaces it is the ι
th basis vector of the dual space.
Equations
- Basis.coord b i = LinearMap.comp (Finsupp.lapply i) ↑b.repr
Instances For
The sum of the coordinates of an element m : M
with respect to a basis.
Equations
- Basis.sumCoords b = LinearMap.comp ((Finsupp.lsum ℕ) fun (x : ι) => LinearMap.id) ↑b.repr
Instances For
Two linear maps are equal if they are equal on basis vectors.
Two linear equivs are equal if they are equal on basis vectors.
Alias of the reverse direction of Basis.ext_elem_iff
.
Two elements are equal iff their coordinates are equal.
An unbundled version of repr_eq_iff
Apply the linear equivalence f
to the basis vectors.
Equations
- Basis.map b f = { repr := LinearEquiv.trans (LinearEquiv.symm f) b.repr }
Instances For
If R
and R'
are isomorphic rings that act identically on a module M
,
then a basis for M
as R
-module is also a basis for M
as R'
-module.
See also Basis.algebraMapCoeffs
for the case where f
is equal to algebraMap
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
b.reindex (e : ι ≃ ι')
is a basis indexed by ι'
Equations
- Basis.reindex b e = { repr := LinearEquiv.trans b.repr (Finsupp.domLCongr e) }
Instances For
simp
can prove this as Basis.coe_reindex
+ EquivLike.range_comp
b.reindex_range
is a basis indexed by range b
, the basis vectors themselves.
Equations
- Basis.reindexRange b = if h : Nontrivial R then Basis.reindex b (Equiv.ofInjective ⇑b ⋯) else { repr := Module.subsingletonEquiv R M ↑(Set.range ⇑b) }
Instances For
b.reindexFinsetRange
is a basis indexed by Finset.univ.image b
,
the finite set of basis vectors themselves.
Equations
Instances For
If the submodule P
has a basis, x ∈ P
iff it is a linear combination of basis vectors.
Construct a linear map given the value at the basis, called Basis.constr b S f
where b
is
a basis, f
is the value of the linear map over the elements of the basis, and S
is an
extra semiring (typically S = R
or S = ℕ
).
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
- One or more equations did not get rendered due to their size.
Instances For
If b
is a basis for M
and b'
a basis for M'
, and the index types are equivalent,
b.equiv b' e
is a linear equivalence M ≃ₗ[R] M'
, mapping b i
to b' (e i)
.
Equations
- Basis.equiv b b' e = LinearEquiv.trans b.repr (LinearEquiv.symm (Basis.reindex b' e.symm).repr)
Instances For
Basis.prod
maps an ι
-indexed basis for M
and an ι'
-indexed basis for M'
to an ι ⊕ ι'
-index basis for M × M'
.
For the specific case of R × R
, see also Basis.finTwoProd
.
Equations
- Basis.prod b b' = { repr := LinearEquiv.trans (LinearEquiv.prod b.repr b'.repr) (LinearEquiv.symm (Finsupp.sumFinsuppLEquivProdFinsupp R)) }
Instances For
Basis.singleton ι R
is the basis sending the unique element of ι
to 1 : R
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
If M
is a subsingleton and ι
is empty, this is the unique ι
-indexed basis for M
.
Equations
- Basis.empty M = { repr := 0 }
Instances For
Equations
- Basis.emptyUnique M = { toInhabited := { default := Basis.empty M }, uniq := ⋯ }
A module over R
with a finite basis is linearly equivalent to functions from its basis to R
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A module over a finite ring that admits a finite basis is finite.
Equations
- Module.fintypeOfFintype b = Fintype.ofEquiv (ι → R) (LinearEquiv.toEquiv (Basis.equivFun b)).symm
Instances For
Given a basis v
indexed by ι
, the canonical linear equivalence between ι → R
and M
maps
a function x : ι → R
to the linear combination ∑_i x i • v i
.
Define a basis by mapping each vector x : M
to its coordinates e x : ι → R
,
as long as ι
is finite.
Equations
- Basis.ofEquivFun e = { repr := LinearEquiv.trans e (LinearEquiv.symm (Finsupp.linearEquivFunOnFinite R R ι)) }
Instances For
If the submodule P
has a finite basis,
x ∈ P
iff it is a linear combination of basis vectors.
If b
is a basis for M
and b'
a basis for M'
,
and f
, g
form a bijection between the basis vectors,
b.equiv' b' f g hf hg hgf hfg
is a linear equivalence M ≃ₗ[R] M'
, mapping b i
to f (b i)
.
Equations
- Basis.equiv' b b' f g hf hg hgf hfg = let __src := (Basis.constr b R) (f ∘ ⇑b); { toLinearMap := __src, invFun := ⇑((Basis.constr b' R) (g ∘ ⇑b')), left_inv := ⋯, right_inv := ⋯ }
Instances For
Any basis is a maximal linear independent set.
A linear independent family of vectors spanning the whole module is a basis.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Given a basis, the i
th element of the dual basis evaluates to 1 on the i
th element of the
basis.
Given a basis, the i
th element of the dual basis evaluates to 0 on the j
th element of the
basis if j ≠ i
.
Given a basis, the i
th element of the dual basis evaluates to the Kronecker delta on the
j
th element of the basis.
A linear independent family of vectors is a basis for their span.
Equations
- Basis.span hli = Basis.mk ⋯ ⋯
Instances For
Given a basis v
and a map w
such that for all i
, w i
are elements of a group,
groupSMul
provides the basis corresponding to w • v
.
Equations
- Basis.groupSMul v w = Basis.mk ⋯ ⋯
Instances For
Given a basis v
and a map w
such that for all i
, w i
is a unit, unitsSMul
provides the basis corresponding to w • v
.
Equations
- Basis.unitsSMul v w = Basis.mk ⋯ ⋯
Instances For
A version of unitsSMul
that uses IsUnit
.
Equations
- Basis.isUnitSMul v hw = Basis.unitsSMul v fun (i : ι) => IsUnit.unit ⋯
Instances For
Let b
be a basis for a submodule N
of M
. If y : M
is linear independent of N
and y
and N
together span the whole of M
, then there is a basis for M
whose basis vectors are given by Fin.cons y b
.
Equations
- Basis.mkFinCons y b hli hsp = let_fun span_b := ⋯; Basis.mk ⋯ ⋯
Instances For
Let b
be a basis for a submodule N ≤ O
. If y ∈ O
is linear independent of N
and y
and N
together span the whole of O
, then there is a basis for O
whose basis vectors are given by Fin.cons y b
.
Equations
- Basis.mkFinConsOfLE y yO b hNO hli hsp = Basis.mkFinCons { val := y, property := yO } (Basis.map b (LinearEquiv.symm (Submodule.comapSubtypeEquivOfLe hNO))) ⋯ ⋯
Instances For
The basis of R × R
given by the two vectors (1, 0)
and (0, 1)
.
Equations
Instances For
If N
is a submodule with finite rank, do induction on adjoining a linear independent
element to a submodule.
Equations
- One or more equations did not get rendered due to their size.
Instances For
An element of a non-unital-non-associative algebra is in the center exactly when it commutes with the basis elements.
Let b
be an S
-basis of M
. Let R
be a CommRing such that Algebra R S
has no zero smul
divisors, then the submodule of M
spanned by b
over R
admits b
as an R
-basis.
Equations
- Basis.restrictScalars R b = Basis.span ⋯
Instances For
Let b
be an S
-basis of M
. Then m : M
lies in the R
-module spanned by b
iff all the
coordinates of m
on the basis b
are in R
(see Basis.mem_span
for the case R = S
).
Over any nontrivial ring, the existence of a finite spanning set implies that any basis is finite.
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
.
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
.
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
.