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 basisBasis.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 = { default := { repr := default }, uniq := ⋯ }
b i
is the i
th basis vector.
Equations
- Basis.instFunLike = { coe := fun (b : Basis ι R M) (i : ι) => b.repr.symm (Finsupp.single i 1), coe_injective' := ⋯ }
Alias of Basis.repr_linearCombination
.
Alias of Basis.linearCombination_repr
.
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
- b.coord i = Finsupp.lapply i ∘ₗ ↑b.repr
Instances For
The sum of the coordinates of an element m : M
with respect to a basis.
Equations
- b.sumCoords = ((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
- b.map f = { repr := f.symm ≪≫ₗ b.repr }
Instances For
The action on a Basis
by acting on each element.
See also Basis.unitsSMul
and Basis.groupSMul
, for the cases when a different action is applied
to each basis element.
Equations
- Basis.instSMul = { smul := fun (g : G) (b : Basis ι R M) => b.map (DistribMulAction.toLinearEquiv R M g) }
Equations
- Basis.instMulAction = Function.Injective.mulAction (fun (f : Basis ι R M) => ⇑f) ⋯ ⋯
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
- b.mapCoeffs f h = { repr := LinearEquiv.restrictScalars R' b.repr ≪≫ₗ Finsupp.mapRange.linearEquiv (Module.compHom.toLinearEquiv f.symm).symm }
Instances For
b.reindex (e : ι ≃ ι')
is a basis indexed by ι'
Equations
- b.reindex e = { repr := 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
- b.reindexRange = if h : Nontrivial R then b.reindex (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
- b.reindexFinsetRange = b.reindexRange.reindex ((Equiv.refl M).subtypeEquiv ⋯)
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
- b.equiv b' e = b.repr ≪≫ₗ (b'.reindex e.symm).repr.symm
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 = { default := Basis.empty M, uniq := ⋯ }
A module over R
with a finite basis is linearly equivalent to functions from its basis to R
.
Equations
- b.equivFun = b.repr ≪≫ₗ let __src := Finsupp.equivFunOnFinite; { toFun := DFunLike.coe, map_add' := ⋯, map_smul' := ⋯, invFun := __src.invFun, left_inv := ⋯, right_inv := ⋯ }
Instances For
A module over a finite ring that admits a finite basis is finite.
Equations
- Module.fintypeOfFintype b = Fintype.ofEquiv (ι → R) b.equivFun.toEquiv.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 := e ≪≫ₗ (Finsupp.linearEquivFunOnFinite R R ι).symm }
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)
.