Documentation

Mathlib.Geometry.Euclidean.Projection

Orthogonal projection in Euclidean affine spaces #

This file defines orthogonal projection onto an affine subspace in a Euclidean affine space, and reflection of a point in an affine subspace.

Main definitions #

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 orthogonalProjection and should not be used once that is defined.

Equations
Instances For

    The intersection of the subspace and the orthogonal subspace through the given point is the orthogonalProjectionFn 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 orthogonalProjectionFn 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 orthogonalProjectionFn 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 orthogonalProjectionFn 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.

    Auxiliary definition for setting up the orthogonal projection. This one is a bundled affine map; the final orthogonalProjection is a continuous affine map.

    Equations
    Instances For

      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 orthogonalProjection for real inner product spaces, onto the direction of the affine subspace being projected onto.

      Equations
      Instances For

        The intersection of the subspace and the orthogonal subspace through the given point is the orthogonalProjection of that point onto the subspace.

        theorem EuclideanGeometry.orthogonalProjection_vsub_mem_direction {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {s : AffineSubspace P} [Nonempty s] [s.direction.HasOrthogonalProjection] {p₁ : P} (p₂ : P) (hp₁ : p₁ s) :
        ↑((orthogonalProjection s) p₂ -ᵥ p₁, hp₁) s.direction

        Subtracting a point in the given subspace from the orthogonalProjection produces a result in the direction of the given subspace.

        theorem EuclideanGeometry.vsub_orthogonalProjection_mem_direction {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {s : AffineSubspace P} [Nonempty s] [s.direction.HasOrthogonalProjection] {p₁ : P} (p₂ : P) (hp₁ : p₁ s) :
        ↑(p₁, hp₁ -ᵥ (orthogonalProjection s) p₂) s.direction

        Subtracting the orthogonalProjection 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.

        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 orthogonalProjection produces a result in the orthogonal direction.

        Subtracting the orthogonalProjection from p produces a result in the orthogonal direction.

        Subtracting the orthogonalProjection 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.

        theorem EuclideanGeometry.orthogonalProjection_vadd_smul_vsub_orthogonalProjection {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {s : AffineSubspace P} [Nonempty s] [s.direction.HasOrthogonalProjection] {p₁ : P} (p₂ : P) (r : ) (hp : p₁ s) :
        (orthogonalProjection s) (r (p₂ -ᵥ ((orthogonalProjection s) p₂)) +ᵥ p₁) = p₁, hp

        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.

        theorem EuclideanGeometry.dist_sq_eq_dist_orthogonalProjection_sq_add_dist_orthogonalProjection_sq {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {s : AffineSubspace P} [Nonempty s] [s.direction.HasOrthogonalProjection] {p₁ : P} (p₂ : P) (hp₁ : p₁ s) :
        dist p₁ p₂ * dist p₁ p₂ = dist p₁ ((orthogonalProjection s) p₂) * dist p₁ ((orthogonalProjection s) p₂) + dist p₂ ((orthogonalProjection s) p₂) * dist p₂ ((orthogonalProjection s) p₂)

        The square of the distance from a point in s to p₂ equals the sum of the squares of the distances of the two points to the orthogonalProjection.

        The distance between a point and its orthogonal projection to a subspace equals the distance to that subspace as given by Metric.infDist. This is not a simp lemma since the simplest form depends on the context (if any calculations are to be done with the distance, the version with the orthogonal projection gives access to more lemmas about orthogonal projections that may be useful).

        The nonnegative distance between a point and its orthogonal projection to a subspace equals the distance to that subspace as given by Metric.infNndist. This is not a simp lemma since the simplest form depends on the context (if any calculations are to be done with the distance, the version with the orthogonal projection gives access to more lemmas about orthogonal projections that may be useful).

        theorem EuclideanGeometry.dist_sq_smul_orthogonal_vadd_smul_orthogonal_vadd {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {s : AffineSubspace P} {p₁ p₂ : P} (hp₁ : p₁ s) (hp₂ : p₂ s) (r₁ r₂ : ) {v : V} (hv : v s.direction) :
        dist (r₁ v +ᵥ p₁) (r₂ v +ᵥ p₂) * dist (r₁ v +ᵥ p₁) (r₂ v +ᵥ p₂) = dist p₁ p₂ * dist p₁ p₂ + (r₁ - r₂) * (r₁ - r₂) * (v * v)

        The square of the distance between two points constructed by adding multiples of the same orthogonal vector to points in the same subspace.

        theorem EuclideanGeometry.dist_eq_iff_dist_orthogonalProjection_eq {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {s : AffineSubspace P} [Nonempty s] [s.direction.HasOrthogonalProjection] {p₁ p₂ : P} (p₃ : P) (hp₁ : p₁ s) (hp₂ : p₂ s) :
        dist p₁ p₃ = dist p₂ p₃ dist p₁ ((orthogonalProjection s) p₃) = dist p₂ ((orthogonalProjection s) p₃)

        p is equidistant from two points in s if and only if its orthogonalProjection is.

        theorem EuclideanGeometry.dist_set_eq_iff_dist_orthogonalProjection_eq {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {s : AffineSubspace P} [Nonempty s] [s.direction.HasOrthogonalProjection] {ps : Set P} (hps : ps s) (p : P) :
        (ps.Pairwise fun (p₁ p₂ : P) => dist p₁ p = dist p₂ p) ps.Pairwise fun (p₁ p₂ : P) => dist p₁ ((orthogonalProjection s) p) = dist p₂ ((orthogonalProjection s) p)

        p is equidistant from a set of points in s if and only if its orthogonalProjection is.

        theorem EuclideanGeometry.exists_dist_eq_iff_exists_dist_orthogonalProjection_eq {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {s : AffineSubspace P} [Nonempty s] [s.direction.HasOrthogonalProjection] {ps : Set P} (hps : ps s) (p : P) :
        (∃ (r : ), p₁ps, dist p₁ p = r) ∃ (r : ), p₁ps, dist p₁ ((orthogonalProjection s) p) = r

        There exists r such that p has distance r from all the points of a set of points in s if and only if there exists (possibly different) r such that its orthogonalProjection has that distance from all the points in that set.

        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
        • One or more equations did not get rendered due to their size.
        Instances For
          @[simp]

          Reflecting twice in the same subspace.

          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.

          theorem EuclideanGeometry.dist_reflection {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (s : AffineSubspace P) [Nonempty s] [s.direction.HasOrthogonalProjection] (p₁ p₂ : P) :
          dist p₁ ((reflection s) p₂) = dist ((reflection s) p₁) p₂

          The distance between p₁ and the reflection of p₂ equals that between the reflection of p₁ and p₂.

          theorem EuclideanGeometry.dist_reflection_eq_of_mem {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (s : AffineSubspace P) [Nonempty s] [s.direction.HasOrthogonalProjection] {p₁ : P} (hp₁ : p₁ s) (p₂ : P) :
          dist p₁ ((reflection s) p₂) = dist p₁ p₂

          A point in the subspace is equidistant from another point and its reflection.

          theorem EuclideanGeometry.reflection_mem_of_le_of_mem {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {s₁ s₂ : AffineSubspace P} [Nonempty s₁] [s₁.direction.HasOrthogonalProjection] (hle : s₁ s₂) {p : P} (hp : p s₂) :
          (reflection s₁) p s₂

          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.

          theorem EuclideanGeometry.reflection_vadd_smul_vsub_orthogonalProjection {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {s : AffineSubspace P} [Nonempty s] [s.direction.HasOrthogonalProjection] {p₁ : P} (p₂ : P) (r : ) (hp₁ : p₁ s) :
          (reflection s) (r (p₂ -ᵥ ((orthogonalProjection s) p₂)) +ᵥ p₁) = -(r (p₂ -ᵥ ((orthogonalProjection s) p₂))) +ᵥ p₁

          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.

          The orthogonal projection of a point p onto the hyperplane spanned by the simplex's points.

          Equations
          Instances For
            theorem Affine.Simplex.orthogonalProjection_vadd_smul_vsub_orthogonalProjection {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {n : } (s : Simplex P n) {p₁ : P} (p₂ : P) (r : ) (hp : p₁ affineSpan (Set.range s.points)) :
            s.orthogonalProjectionSpan (r (p₂ -ᵥ (s.orthogonalProjectionSpan p₂)) +ᵥ p₁) = p₁, hp

            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.