Euclidean spaces #
This file makes some definitions and proves very basic geometrical
results about real inner product spaces and Euclidean affine spaces.
Results about real inner product spaces that involve the norm and
inner product but not angles generally go in
analysis.normed_space.inner_product
. Results with longer
proofs or more geometrical content generally go in separate files.
Main definitions #
-
inner_product_geometry.angle
is the undirected angle between two vectors. -
euclidean_geometry.angle
, with notation∠
, is the undirected angle determined by three points. -
euclidean_geometry.orthogonal_projection
is the orthogonal projection of a point onto an affine subspace. -
euclidean_geometry.reflection
is the reflection of a point in an affine subspace.
Implementation notes #
To declare P
as the type of points in a Euclidean affine space with
V
as the type of vectors, use [inner_product_space ℝ V] [metric_space P] [normed_add_torsor V P]
. This works better with out_param
to make
V
implicit in most cases than having a separate type alias for
Euclidean affine spaces.
Rather than requiring Euclidean affine spaces to be finite-dimensional (as in the definition on Wikipedia), this is specified only for those theorems that need it.
References #
Geometrical results on real inner product spaces #
This section develops some geometrical definitions and results on real inner product spaces, where those definitions and results can most conveniently be developed in terms of vectors and then used to deduce corresponding results for Euclidean affine spaces.
The undirected angle between two vectors. If either vector is 0,
this is π/2. See orientation.oangle
for the corresponding oriented angle
definition.
Equations
- inner_product_geometry.angle x y = real.arccos (has_inner.inner x y / (∥x∥ * ∥y∥))
If a real differentiable map f
is conformal at a point x
,
then it preserves the angles at that point.
The cosine of the angle between two vectors.
The angle between two vectors does not depend on their order.
The angle between the negation of two vectors.
The angle between two vectors is nonnegative.
The angle between two vectors is at most π.
The angle between a vector and the negation of another vector.
The angle between the negation of a vector and another vector.
The angle between the zero vector and a vector.
The angle between a vector and the zero vector.
The angle between a nonzero vector and itself.
The angle between a nonzero vector and its negation.
The angle between the negation of a nonzero vector and that vector.
The angle between a vector and a positive multiple of a vector.
The angle between a positive multiple of a vector and a vector.
The angle between a vector and a negative multiple of a vector.
The angle between a negative multiple of a vector and a vector.
The cosine of the angle between two vectors, multiplied by the product of their norms.
The sine of the angle between two vectors, multiplied by the product of their norms.
The angle between two vectors is zero if and only if they are nonzero and one is a positive multiple of the other.
The angle between two vectors is π if and only if they are nonzero and one is a negative multiple of the other.
If the angle between two vectors is π, the angles between those vectors and a third vector add to π.
Two vectors have inner product 0 if and only if the angle between them is π/2.
If the angle between two vectors is π, the inner product equals the negative product of the norms.
If the angle between two vectors is 0, the inner product equals the product of the norms.
The inner product of two non-zero vectors equals the negative product of their norms if and only if the angle between the two vectors is π.
The inner product of two non-zero vectors equals the product of their norms if and only if the angle between the two vectors is 0.
If the angle between two vectors is 0, the norm of their sum equals the sum of their norms.
If the angle between two vectors is 0, the norm of their difference equals the absolute value of the difference of their norms.
The norm of the difference of two non-zero vectors equals the sum of their norms if and only the angle between the two vectors is π.
The norm of the sum of two non-zero vectors equals the sum of their norms if and only the angle between the two vectors is 0.
The norm of the difference of two non-zero vectors equals the absolute value of the difference of their norms if and only the angle between the two vectors is 0.
The norm of the sum of two vectors equals the norm of their difference if and only if the angle between them is π/2.
Geometrical results on Euclidean affine spaces #
This section develops some geometrical definitions and results on Euclidean affine spaces.
The undirected angle at p2
between the line segments to p1
and
p3
. If either of those points equals p2
, this is π/2. Use
open_locale euclidean_geometry
to access the ∠ p1 p2 p3
notation.
Equations
- euclidean_geometry.angle p1 p2 p3 = inner_product_geometry.angle (p1 -ᵥ p2) (p3 -ᵥ p2)
The angle at a point does not depend on the order of the other two points.
The angle at a point is nonnegative.
The angle at a point is at most π.
The angle ∠AAB at a point.
The angle ∠ABB at a point.
The angle ∠ABA at a point.
If the angle ∠ABC at a point is π, the angle ∠BAC is 0.
If the angle ∠ABC at a point is π, the angle ∠BCA is 0.
If ∠BCD = π, then ∠ABC = ∠ABD.
If ∠BCD = π, then ∠ACB + ∠ACD = π.
Vertical Angles Theorem: angles opposite each other, formed by two intersecting straight lines, are equal.
If ∠ABC = π then dist A B ≠ 0.
If ∠ABC = π then dist C B ≠ 0.
If ∠ABC = π, then (dist A C) = (dist A B) + (dist B C).
If A ≠ B and C ≠ B then ∠ABC = π if and only if (dist A C) = (dist A B) + (dist B C).
If ∠ABC = 0, then (dist A C) = abs ((dist A B) - (dist B C)).
If A ≠ B and C ≠ B then ∠ABC = 0 if and only if (dist A C) = abs ((dist A B) - (dist B C)).
The midpoint of the segment AB is the same distance from A as it is from B.
If M is the midpoint of the segment AB, then ∠AMB = π.
If M is the midpoint of the segment AB and C is the same distance from A as it is from B then ∠CMA = π / 2.
If M is the midpoint of the segment AB and C is the same distance from A as it is from B then ∠CMB = π / 2.
The inner product of two vectors given with weighted_vsub
, in
terms of the pairwise distances.
The distance between two points given with affine_combination
,
in terms of the pairwise distances between the points in that
combination.
Suppose that c₁
is equidistant from p₁
and p₂
, and the same
applies to c₂
. Then the vector between c₁
and c₂
is orthogonal
to that between p₁
and p₂
. (In two dimensions, this says that the
diagonals of a kite are orthogonal.)
The squared distance between points on a line (expressed as a multiple of a fixed vector added to a point) and another point, expressed as a quadratic.
The condition for two points on a line to be equidistant from another point.
Distances r₁
r₂
of p
from two different points c₁
c₂
determine at
most two points p₁
p₂
in a two-dimensional subspace containing those points
(two circles intersect in at most two points).
Distances r₁
r₂
of p
from two different points c₁
c₂
determine at
most two points p₁
p₂
in two-dimensional space (two circles intersect in at
most two points).
The orthogonal projection of a point onto a nonempty affine
subspace, whose direction is complete, as an unbundled function. This
definition is only intended for use in setting up the bundled version
orthogonal_projection
and should not be used once that is
defined.
Equations
The intersection of the subspace and the orthogonal subspace
through the given point is the orthogonal_projection_fn
of that
point onto the subspace. This lemma is only intended for use in
setting up the bundled version and should not be used once that is
defined.
The orthogonal_projection_fn
lies in the given subspace. This
lemma is only intended for use in setting up the bundled version and
should not be used once that is defined.
The orthogonal_projection_fn
lies in the orthogonal
subspace. This lemma is only intended for use in setting up the
bundled version and should not be used once that is defined.
Subtracting p
from its orthogonal_projection_fn
produces a
result in the orthogonal direction. This lemma is only intended for
use in setting up the bundled version and should not be used once that
is defined.
The orthogonal projection of a point onto a nonempty affine
subspace, whose direction is complete. The corresponding linear map
(mapping a vector to the difference between the projections of two
points whose difference is that vector) is the orthogonal_projection
for real inner product spaces, onto the direction of the affine
subspace being projected onto.
Equations
- euclidean_geometry.orthogonal_projection s = {to_fun := λ (p : P), ⟨euclidean_geometry.orthogonal_projection_fn s p, _⟩, linear := ↑(orthogonal_projection s.direction), map_vadd' := _}
The linear map corresponding to orthogonal_projection
.
The intersection of the subspace and the orthogonal subspace
through the given point is the orthogonal_projection
of that point
onto the subspace.
The orthogonal_projection
lies in the given subspace.
The orthogonal_projection
lies in the orthogonal subspace.
Subtracting a point in the given subspace from the
orthogonal_projection
produces a result in the direction of the
given subspace.
Subtracting the orthogonal_projection
from a point in the given
subspace produces a result in the direction of the given subspace.
A point equals its orthogonal projection if and only if it lies in the subspace.
Orthogonal projection is idempotent.
The distance to a point's orthogonal projection is 0 iff it lies in the subspace.
The distance between a point and its orthogonal projection is nonzero if it does not lie in the subspace.
Subtracting p
from its orthogonal_projection
produces a result
in the orthogonal direction.
Subtracting the orthogonal_projection
from p
produces a result
in the orthogonal direction.
Subtracting the orthogonal_projection
from p
produces a result in the kernel of the linear
part of the orthogonal projection.
Adding a vector to a point in the given subspace, then taking the orthogonal projection, produces the original point if the vector was in the orthogonal direction.
Adding a vector to a point in the given subspace, then taking the orthogonal projection, produces the original point if the vector is a multiple of the result of subtracting a point's orthogonal projection from that point.
The square of the distance from a point in s
to p2
equals the
sum of the squares of the distances of the two points to the
orthogonal_projection
.
The square of the distance between two points constructed by adding multiples of the same orthogonal vector to points in the same subspace.
Reflection in an affine subspace, which is expected to be nonempty and complete. The word "reflection" is sometimes understood to mean specifically reflection in a codimension-one subspace, and sometimes more generally to cover operations such as reflection in a point. The definition here, of reflection in an affine subspace, is a more general sense of the word that includes both those common cases.
Equations
- euclidean_geometry.reflection s = affine_isometry_equiv.mk' (λ (p : P), ↑(⇑(euclidean_geometry.orthogonal_projection s) p) -ᵥ p +ᵥ ↑(⇑(euclidean_geometry.orthogonal_projection s) p)) (reflection s.direction) ↑(classical.arbitrary ↥s) _
The result of reflecting.
Reflecting twice in the same subspace.
Reflection is its own inverse.
Reflection is involutive.
A point is its own reflection if and only if it is in the subspace.
Reflecting a point in two subspaces produces the same result if and only if the point has the same orthogonal projection in each of those subspaces.
The distance between p₁
and the reflection of p₂
equals that
between the reflection of p₁
and p₂
.
A point in the subspace is equidistant from another point and its reflection.
The reflection of a point in a subspace is contained in any larger subspace containing both the point and the subspace reflected in.
Reflecting an orthogonal vector plus a point in the subspace produces the negation of that vector plus the point.
Reflecting a vector plus a point in the subspace produces the negation of that vector plus the point if the vector is a multiple of the result of subtracting a point's orthogonal projection from that point.
A set of points is cospherical if they are equidistant from some point. In two dimensions, this is the same thing as being concyclic.
Equations
- euclidean_geometry.cospherical ps = ∃ (center : P) (radius : ℝ), ∀ (p : P), p ∈ ps → has_dist.dist p center = radius
The definition of cospherical
.
A subset of a cospherical set is cospherical.
The empty set is cospherical.
A single point is cospherical.
Two points are cospherical.
Any three points in a cospherical set are affinely independent.