Linear independence #
This file defines linear independence in a module or vector space.
It is inspired by Isabelle/HOL's linear algebra, and hence indirectly by HOL Light.
We define LinearIndependent R v
as Function.Injective (Finsupp.linearCombination R v)
. Here
Finsupp.linearCombination
is the linear map sending a function f : ι →₀ R
with finite support to
the linear combination of vectors from v
with these coefficients. Then we prove that several other
statements are equivalent to this one, including ker (Finsupp.linearCombination R v) = ⊥
and
some versions with explicitly written linear combinations.
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.
LinearIndependent R v
states that the elements of the familyv
are linearly independent.LinearIndependent.repr hv x
returns the linear combination representingx : span R (range v)
on the linearly independent vectorsv
, givenhv : LinearIndependent R v
(using classical choice).LinearIndependent.repr hv
is provided as a linear map.
Main statements #
We prove several specialized tests for linear independence of families of vectors and of sets of vectors.
Fintype.linearIndependent_iff
: ifι
is a finite type, then any functionf : ι → R
has finite support, so we can reformulate the statement using∑ i : ι, f i • v i
instead of a sum over an auxiliarys : Finset ι
;linearIndependent_empty_type
: a family indexed by an empty type is linearly independent;linearIndependent_unique_iff
: ifι
is a singleton, thenLinearIndependent K v
is equivalent tov default ≠ 0
;linearIndependent_option
,linearIndependent_sum
,linearIndependent_fin_cons
,linearIndependent_fin_succ
: type-specific tests for linear independence of families of vector fields;linearIndependent_insert
,linearIndependent_union
,linearIndependent_pair
,linearIndependent_singleton
: linear independence tests for set operations.
In many cases we additionally provide dot-style operations (e.g., LinearIndependent.union
) to
make the linear independence tests usable as hv.insert ha
etc.
We also prove that, when working over a division ring, any family of vectors includes a linear independent subfamily spanning the same subspace.
Implementation notes #
We use families instead of sets because it allows us to say that two identical vectors are linearly dependent.
If you want to use sets, use the family (fun x ↦ x : s → M)
given a set s : Set M
. The lemmas
LinearIndependent.to_subtype_range
and LinearIndependent.of_subtype_range
connect those two
worlds.
TODO #
Rework proofs to hold in semirings, by avoiding the path through
ker (Finsupp.linearCombination R v) = ⊥
.
Tags #
linearly dependent, linear dependence, linearly independent, linear independence
LinearIndependent R v
states the family of vectors v
is linearly independent over R
.
Equations
Instances For
Delaborator for LinearIndependent
that suggests pretty printing with type hints
in case the family of vectors is over a Set
.
Type hints look like LinearIndependent fun (v : ↑s) => ↑v
or LinearIndependent (ι := ↑s) f
,
depending on whether the family is a lambda expression or not.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Alias of the forward direction of linearIndependent_iff_injective_linearCombination
.
A subfamily of a linearly independent family (i.e., a composition with an injective map) is a linearly independent family.
A set of linearly independent vectors in a module M
over a semiring K
is also linearly
independent over a subring R
of K
.
The implementation uses minimal assumptions about the relationship between R
, K
and M
.
The version where K
is an R
-algebra is LinearIndependent.restrict_scalars_algebras
.
A finite family of vectors v i
is linear independent iff the linear map that sends
c : ι → R
to ∑ i, c i • v i
has the trivial kernel.
Also see LinearIndependent.pair_iff'
for a simpler version over fields.
A family is linearly independent if and only if all of its finite subfamily is linearly independent.
If v
is a linearly independent family of vectors and the kernel of a linear map f
is
disjoint with the submodule spanned by the vectors of v
, then f ∘ v
is a linearly independent
family of vectors. See also LinearIndependent.map'
for a special case assuming ker f = ⊥
.
If v
is an injective family of vectors such that f ∘ v
is linearly independent, then v
spans a submodule disjoint from the kernel of f
An injective linear map sends linearly independent families of vectors to linearly independent
families of vectors. See also LinearIndependent.map
for a more general statement.
If M / R
and M' / R'
are modules, i : R' → R
is a map, j : M →+ M'
is a monoid map,
such that they send non-zero elements to non-zero elements, and compatible with the scalar
multiplications on M
and M'
, then j
sends linearly independent families of vectors to
linearly independent families of vectors. As a special case, taking R = R'
it is LinearIndependent.map'
.
If M / R
and M' / R'
are modules, i : R → R'
is a surjective map which maps zero to zero,
j : M →+ M'
is a monoid map which sends non-zero elements to non-zero elements, such that the
scalar multiplications on M
and M'
are compatible, then j
sends linearly independent families
of vectors to linearly independent families of vectors. As a special case, taking R = R'
it is LinearIndependent.map'
.
If the image of a family of vectors under a linear map is linearly independent, then so is the original family.
If f
is an injective linear map, then the family f ∘ v
is linearly independent
if and only if the family v
is linearly independent.
Alias of the forward direction of linearIndependent_subtype_range
.
See LinearIndependent.fin_cons
for a family of elements in a vector space.
Every finite subset of a linearly independent set is linearly independent.
The following lemmas use the subtype defined by a set in M
as the index set ι
.
A version of linearDependent_comp_subtype'
with Finsupp.linearCombination
unfolded.
Alias of the forward direction of linearIndependent_iff_injective_linearCombination
.
Alias of the forward direction of linearIndependent_iff_injective_linearCombination
.
If two vectors x
and y
are linearly independent, so are their linear combinations
a x + b y
and c x + d y
provided the determinant a * d - b * c
is nonzero.
A linearly independent family is maximal if there is no strictly larger linearly independent family.
Equations
Instances For
An alternative characterization of a maximal linearly independent family,
quantifying over types (in the same universe as M
) into which the indexing family injects.
Linear independent families are injective, even if you multiply either side.
The following lemmas use the subtype defined by a set in M
as the index set ι
.
Alias of LinearIndependent.linearCombination_ne_of_not_mem_support
.
Canonical isomorphism between linear combinations and the span of linearly independent vectors.
Equations
- hv.linearCombinationEquiv = LinearEquiv.ofBijective (LinearMap.codRestrict (Submodule.span R (Set.range v)) (Finsupp.linearCombination R v) ⋯) ⋯
Instances For
Alias of LinearIndependent.linearCombinationEquiv
.
Canonical isomorphism between linear combinations and the span of linearly independent vectors.
Instances For
Alias of LinearIndependent.linearCombinationEquiv_apply_coe
.
Linear combination representing a vector in the span of linearly independent vectors.
Given a family of linearly independent vectors, we can represent any vector in their span as
a linear combination of these vectors. These are provided by this linear map.
It is simply one direction of LinearIndependent.linearCombinationEquiv
.
Equations
- hv.repr = ↑hv.linearCombinationEquiv.symm
Instances For
Alias of LinearIndependent.linearCombination_repr
.
See also iSupIndep_iff_linearIndependent_of_ne_zero
.
Alias of LinearIndependent.iSupIndep_span_singleton
.
See also iSupIndep_iff_linearIndependent_of_ne_zero
.
Dedekind's linear independence of characters
Alias of the reverse direction of linearIndependent_unique_iff
.
Properties which require DivisionRing K
#
These can be considered generalizations of properties of linear independence in vector spaces.
Also see LinearIndependent.pair_iff
for the version over arbitrary rings.
See LinearIndependent.fin_cons'
for an uglier version that works if you
only have a module over a semiring.
Equivalence between k + 1
vectors of length n
and k
vectors of length n
along with a
vector in the complement of their span.
Equations
- One or more equations did not get rendered due to their size.
Instances For
LinearIndependent.extend
adds vectors to a linear independent set s ⊆ t
until it spans
all elements of t
.
Equations
- hs.extend hst = Classical.choose ⋯