Affine spaces #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines affine subspaces (over modules) and the affine span of a set of points.
Main definitions #
affine_subspace k P
is the type of affine subspaces. Unlike affine spaces, affine subspaces are allowed to be empty, and lemmas that do not apply to empty affine subspaces havenonempty
hypotheses. There is acomplete_lattice
structure on affine subspaces.affine_subspace.direction
gives thesubmodule
spanned by the pairwise differences of points in anaffine_subspace
. There are various lemmas relating to the set of vectors in thedirection
, and relating the lattice structure on affine subspaces to that on their directions.affine_subspace.parallel
, notation∥
, gives the property of two affine subspaces being parallel (one being a translate of the other).affine_span
gives the affine subspace spanned by a set of points, withvector_span
giving its direction.affine_span
is defined in terms ofspan_points
, which gives an explicit description of the points contained in the affine span;span_points
itself should generally only be used when that description is required, withaffine_span
being the main definition for other purposes. Two other descriptions of the affine span are proved equivalent: it is theInf
of affine subspaces containing the points, and (if[nontrivial k]
) it contains exactly those points that are affine combinations of points in the given set.
Implementation notes #
out_param
is used in the definiton of add_torsor V P
to make V
an implicit argument (deduced
from P
) in most cases; include V
is needed in many cases for V
, and type classes using it, to
be added as implicit arguments to individual lemmas. As for modules, k
is an explicit argument
rather than implied by P
or V
.
This file only provides purely algebraic definitions and results.
Those depending on analysis or topology are defined elsewhere; see
analysis.normed_space.add_torsor
and topology.algebra.affine
.
References #
The submodule spanning the differences of a (possibly empty) set of points.
Equations
- vector_span k s = submodule.span k (s -ᵥ s)
The definition of vector_span
, for rewriting.
vector_span
is monotone.
The vector_span
of the empty set is ⊥
.
The vector_span
of a single point is ⊥
.
The s -ᵥ s
lies within the vector_span k s
.
Each pairwise difference is in the vector_span
.
The points in the affine span of a (possibly empty) set of
points. Use affine_span
instead to get an affine_subspace k P
.
Equations
- span_points k s = {p : P | ∃ (p1 : P) (H : p1 ∈ s) (v : V) (H : v ∈ vector_span k s), p = v +ᵥ p1}
A point in a set is in its affine span.
A set is contained in its span_points
.
The span_points
of a set is nonempty if and only if that set
is.
Adding a point in the affine span and a vector in the spanning submodule produces a point in the affine span.
Subtracting two points in the affine span produces a vector in the spanning submodule.
- carrier : set P
- smul_vsub_vadd_mem : ∀ (c : k) {p1 p2 p3 : P}, p1 ∈ self.carrier → p2 ∈ self.carrier → p3 ∈ self.carrier → c • (p1 -ᵥ p2) +ᵥ p3 ∈ self.carrier
An affine_subspace k P
is a subset of an affine_space V P
that, if not empty, has an affine space structure induced by a
corresponding subspace of the module k V
.
Instances for affine_subspace
- affine_subspace.has_sizeof_inst
- affine_subspace.set_like
- affine_subspace.complete_lattice
- affine_subspace.inhabited
- affine_subspace.nontrivial
Reinterpret p : submodule k V
as an affine_subspace k V
.
Equations
- p.to_affine_subspace = {carrier := ↑p, smul_vsub_vadd_mem := _}
Equations
- affine_subspace.set_like k P = {coe := affine_subspace.carrier _inst_4, coe_injective' := _}
A point is in an affine subspace coerced to a set if and only if it is in that affine subspace.
The direction of an affine subspace is the submodule spanned by the pairwise differences of points. (Except in the case of an empty affine subspace, where the direction is the zero submodule, every vector in the direction is the difference of two points in the affine subspace.)
Equations
- s.direction = vector_span k ↑s
The direction equals the vector_span
.
Alternative definition of the direction when the affine subspace
is nonempty. This is defined so that the order on submodules (as used
in the definition of submodule.span
) can be used in the proof of
coe_direction_eq_vsub_set
, and is not intended to be used beyond
that proof.
direction_of_nonempty
gives the same submodule as
direction
.
The set of vectors in the direction of a nonempty affine subspace
is given by vsub_set
.
A vector is in the direction of a nonempty affine subspace if and only if it is the subtraction of two vectors in the subspace.
Adding a vector in the direction to a point in the subspace produces a point in the subspace.
Subtracting two points in the subspace produces a vector in the direction.
Adding a vector to a point in a subspace produces a point in the subspace if and only if the vector is in the direction.
Adding a vector in the direction to a point produces a point in the subspace if and only if the original point is in the subspace.
Given a point in an affine subspace, the set of vectors in its direction equals the set of vectors subtracting that point on the right.
Given a point in an affine subspace, the set of vectors in its direction equals the set of vectors subtracting that point on the left.
Given a point in an affine subspace, a vector is in its direction if and only if it results from subtracting that point on the right.
Given a point in an affine subspace, a vector is in its direction if and only if it results from subtracting that point on the left.
Given a point in an affine subspace, a result of subtracting that point on the right is in the direction if and only if the other point is in the subspace.
Given a point in an affine subspace, a result of subtracting that point on the left is in the direction if and only if the other point is in the subspace.
Two affine subspaces are equal if they have the same points.
Two affine subspaces with the same direction and nonempty intersection are equal.
This is not an instance because it loops with add_torsor.nonempty
.
Equations
- s.to_add_torsor = {to_add_action := {to_has_vadd := {vadd := λ (a : ↥(s.direction)) (b : ↥s), ⟨↑a +ᵥ ↑b, _⟩}, zero_vadd := _, add_vadd := _}, to_has_vsub := {vsub := λ (a b : ↥s), ⟨↑a -ᵥ ↑b, _⟩}, nonempty := _inst_5, vsub_vadd' := _, vadd_vsub' := _}
Embedding of an affine subspace to the ambient space, as an affine map.
Two affine subspaces with nonempty intersection are equal if and only if their directions are equal.
Construct an affine subspace from a point and a direction.
Equations
- affine_subspace.mk' p direction = {carrier := {q : P | ∃ (v : V) (H : v ∈ direction), q = v +ᵥ p}, smul_vsub_vadd_mem := _}
An affine subspace constructed from a point and a direction contains that point.
An affine subspace constructed from a point and a direction contains the result of adding a vector in that direction to that point.
An affine subspace constructed from a point and a direction is nonempty.
The direction of an affine subspace constructed from a point and a direction.
A point lies in an affine subspace constructed from another point and a direction if and only if their difference is in that direction.
Constructing an affine subspace from a point in a subspace and that subspace's direction yields the original subspace.
If an affine subspace contains a set of points, it contains the
span_points
of that set.
The affine span of a set of points is the smallest affine subspace containing those points. (Actually defined here in terms of spans in modules.)
Equations
- affine_span k s = {carrier := span_points k s, smul_vsub_vadd_mem := _}
Instances for ↥affine_span
The affine span, converted to a set, is span_points
.
A set is contained in its affine span.
The direction of the affine span is the vector_span
.
A point in a set is in its affine span.
Equations
- affine_subspace.complete_lattice = {sup := λ (s1 s2 : affine_subspace k P), affine_span k (↑s1 ∪ ↑s2), le := partial_order.le (partial_order.lift coe affine_subspace.coe_injective), lt := partial_order.lt (partial_order.lift coe affine_subspace.coe_injective), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, le_sup_left := _, le_sup_right := _, sup_le := _, inf := λ (s1 s2 : affine_subspace k P), {carrier := ↑s1 ∩ ↑s2, smul_vsub_vadd_mem := _}, inf_le_left := _, inf_le_right := _, le_inf := _, Sup := λ (s : set (affine_subspace k P)), affine_span k (⋃ (s' : affine_subspace k P) (H : s' ∈ s), ↑s'), le_Sup := _, Sup_le := _, Inf := λ (s : set (affine_subspace k P)), {carrier := ⋂ (s' : affine_subspace k P) (H : s' ∈ s), ↑s', smul_vsub_vadd_mem := _}, Inf_le := _, le_Inf := _, top := {carrier := set.univ P, smul_vsub_vadd_mem := _}, bot := {carrier := ∅, smul_vsub_vadd_mem := _}, le_top := _, bot_le := _}
Equations
The ≤
order on subspaces is the same as that on the corresponding
sets.
One subspace is less than or equal to another if and only if all its points are in the second subspace.
The <
order on subspaces is the same as that on the corresponding
sets.
One subspace is not less than or equal to another if and only if it has a point not in the second subspace.
If a subspace is less than another, there is a point only in the second.
A subspace is less than another if and only if it is less than or equal to the second subspace and there is a point only in the second.
If an affine subspace is nonempty and contained in another with the same direction, they are equal.
The affine span is the Inf
of subspaces containing the given
points.
The Galois insertion formed by affine_span
and coercion back to
a set.
Equations
- affine_subspace.gi k V P = {choice := λ (s : set P) (_x : ↑(affine_span k s) ≤ s), affine_span k s, gc := _, le_l_u := _, choice_eq := _}
The span of the empty set is ⊥
.
The span of univ
is ⊤
.
The affine span of a single point, coerced to a set, contains just that point.
A point is in the affine span of a single point if and only if they are equal.
The span of a union of sets is the sup of their spans.
The span of a union of an indexed family of sets is the sup of their spans.
⊤
, coerced to a set, is the whole set of points.
All points are in ⊤
.
The direction of ⊤
is the whole module as a submodule.
⊥
, coerced to a set, is the empty set.
If the affine span of a set is ⊤
, then the vector span of the same set is the ⊤
.
For a nonempty set, the affine span is ⊤
iff its vector span is ⊤
.
For a non-trivial space, the affine span of a set is ⊤
iff its vector span is ⊤
.
No points are in ⊥
.
The direction of ⊥
is the submodule ⊥
.
A nonempty affine subspace is ⊤
if and only if its direction is
⊤
.
The inf of two affine subspaces, coerced to a set, is the intersection of the two sets of points.
A point is in the inf of two affine subspaces if and only if it is in both of them.
The direction of the inf of two affine subspaces is less than or equal to the inf of their directions.
If two affine subspaces have a point in common, the direction of their inf equals the inf of their directions.
If two affine subspaces have a point in their inf, the direction of their inf equals the inf of their directions.
If one affine subspace is less than or equal to another, the same applies to their directions.
If one nonempty affine subspace is less than another, the same applies to their directions
The sup of the directions of two affine subspaces is less than or equal to the direction of their sup.
The sup of the directions of two nonempty affine subspaces with empty intersection is less than the direction of their sup.
If the directions of two nonempty affine subspaces span the whole module, they have nonempty intersection.
If the directions of two nonempty affine subspaces are complements of each other, they intersect in exactly one point.
Coercing a subspace to a set then taking the affine span produces the original subspace.
The vector_span
is the span of the pairwise subtractions with a
given point on the left.
The vector_span
is the span of the pairwise subtractions with a
given point on the right.
The vector_span
is the span of the pairwise subtractions with a
given point on the left, excluding the subtraction of that point from
itself.
The vector_span
is the span of the pairwise subtractions with a
given point on the right, excluding the subtraction of that point from
itself.
The vector_span
is the span of the pairwise subtractions with a
given point on the right, excluding the subtraction of that point from
itself.
The vector_span
of the image of a function is the span of the
pairwise subtractions with a given point on the left, excluding the
subtraction of that point from itself.
The vector_span
of the image of a function is the span of the
pairwise subtractions with a given point on the right, excluding the
subtraction of that point from itself.
The vector_span
of an indexed family is the span of the pairwise
subtractions with a given point on the left.
The vector_span
of an indexed family is the span of the pairwise
subtractions with a given point on the right.
The vector_span
of an indexed family is the span of the pairwise
subtractions with a given point on the left, excluding the subtraction
of that point from itself.
The vector_span
of an indexed family is the span of the pairwise
subtractions with a given point on the right, excluding the subtraction
of that point from itself.
The affine span of a set is nonempty if and only if that set is.
Alias of the reverse direction of affine_span_nonempty
.
The affine span of a nonempty set is nonempty.
The affine span of a set is ⊥
if and only if that set is empty.
An induction principle for span membership. If p
holds for all elements of s
and is
preserved under certain affine combinations, then p
holds for all elements of the span of s
.
A dependent version of affine_span_induction
.
A set, considered as a subset of its spanned affine subspace, spans the whole subspace.
Suppose a set of vectors spans V
. Then a point p
, together
with those vectors added to p
, spans P
.
The vector_span
of two points is the span of their difference.
The vector_span
of two points is the span of their difference (reversed).
The difference between two points lies in their vector_span
.
The difference between two points (reversed) lies in their vector_span
.
A multiple of the difference between two points lies in their vector_span
.
A multiple of the difference between two points (reversed) lies in their vector_span
.
A vector lies in the vector_span
of two points if and only if it is a multiple of their
difference.
A vector lies in the vector_span
of two points if and only if it is a multiple of their
difference (reversed).
The first of two points lies in their affine span.
The second of two points lies in their affine span.
A combination of two points expressed with line_map
lies in their affine span.
A combination of two points expressed with line_map
(with the two points reversed) lies in
their affine span.
A multiple of the difference of two points added to the first point lies in their affine span.
A multiple of the difference of two points added to the second point lies in their affine span.
A vector added to the first point lies in the affine span of two points if and only if it is a multiple of their difference.
A vector added to the second point lies in the affine span of two points if and only if it is a multiple of their difference.
The span of two points that lie in an affine subspace is contained in that subspace.
One line is contained in another differing in the first point if the first point of the first line is contained in the second line.
One line is contained in another differing in the second point if the second point of the first line is contained in the second line.
affine_span
is monotone.
Taking the affine span of a set, adding a point and taking the span again produces the same results as adding the point to the set and taking the span.
If a point is in the affine span of a set, adding it to that set does not change the affine span.
If a point is in the affine span of a set, adding it to that set does not change the vector span.
The direction of the sup of two nonempty affine subspaces is the sup of the two directions and of any one difference between points in the two subspaces.
The direction of the span of the result of adding a point to a nonempty affine subspace is the sup of the direction of that subspace and of any one difference between that point and a point in the subspace.
Given a point p1
in an affine subspace s
, and a point p2
, a
point p
is in the span of s
with p2
added if and only if it is a
multiple of p2 -ᵥ p1
added to a point in s
.
The image of an affine subspace under an affine map as an affine subspace.
Equations
- affine_subspace.map f s = {carrier := ⇑f '' ↑s, smul_vsub_vadd_mem := _}
The preimage of an affine subspace under an affine map as an affine subspace.
Equations
- affine_subspace.comap f s = {carrier := ⇑f ⁻¹' ↑s, smul_vsub_vadd_mem := _}
Two affine subspaces are parallel if one is related to the other by adding the same vector to all points.
Equations
- s₁.parallel s₂ = ∃ (v : V), s₂ = affine_subspace.map ↑(affine_equiv.const_vadd k P v) s₁