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 Mis the type ofι-indexedR-bases for a moduleM, represented by a linear equivM ≃ₗ[R] ι →₀ R.the basis vectors of a basis
b : Basis ι R Mare available asb i, wherei : ιBasis.repris the isomorphism sendingx : Mto its coordinatesBasis.repr x : ι →₀ R. The converse, turning this isomorphism into a basis, is calledBasis.ofRepr.If
ιis finite, there is a variant ofreprcalledBasis.equivFun b : M ≃ₗ[R] ι → R(saving you from having to work withFinsupp). The converse, turning this isomorphism into a basis, is calledBasis.ofEquivFun.Basis.reindexuses an equiv to map a basis to a different indexing set.Basis.mapuses a linear equiv to map a basis to a different module.Basis.constr: givenb : Basis ι R Mandf : ι → M, construct a linear mapgso thatg (b i) = f i.Basis.coord:b.coord i xis thei-th coordinate of a vectorxwith respect to the basisb.
Main results #
Basis.extstates 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.reprand⇑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 :: (
repris the linear equivalence sending a vectorxto its coordinates: thecs such thatx = ∑ i, c i.- )
Instances For
b i is the ith basis vector.
Equations
- Module.Basis.instFunLike = { coe := fun (b : Module.Basis ι R M) (i : ι) => b.repr.symm (Finsupp.single i 1), coe_injective' := ⋯ }
Apply the linear equivalence f to the basis vectors.
Instances For
simp can prove this as Basis.coe_reindex + EquivLike.range_comp
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
- Module.Basis.ofEquivFun e = { repr := e ≪≫ₗ (Finsupp.linearEquivFunOnFinite R R ι).symm }
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 Module.Basis.ext_elem_iff.
Two elements are equal iff their coordinates are equal.
An unbundled version of repr_eq_iff
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.reindexRange 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
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).
Instances For
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
Instances For
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