Documentation

Mathlib.Geometry.Euclidean.SignedDist

Signed distance to an affine subspace in a Euclidean space. #

This file defines the signed distance between two points, in the direction of a given a vector, and the signed distance between an affine subspace and a point, in the direction of a given reference point.

Main definitions #

References #

noncomputable def signedDist {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) :

The signed distance between two points p and q, in the direction of a reference vector v. It is the size of q - p in the direction of v. In the degenerate case v = 0, it returns 0.

TODO: once we have a topology on P →ᴬ[ℝ] ℝ, the type should be P →ᴬ[ℝ] P →ᴬ[ℝ] ℝ.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem signedDist_apply_apply {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) (p q : P) :
    ((signedDist v) p) q = inner (v⁻¹ v) (q -ᵥ p)
    theorem signedDist_apply_linear {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) (p : P) :
    (↑((signedDist v) p)).linear = (innerₗ V) (v⁻¹ v)
    theorem signedDist_apply_linear_apply {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v w : V) (p : P) :
    (↑((signedDist v) p)).linear w = inner (v⁻¹ v) w
    theorem signedDist_linear_apply_apply {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v w : V) (p : P) :
    theorem signedDist_smul {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) (p q : P) (r : ) :
    ((signedDist (r v)) p) q = (SignType.sign r) * ((signedDist v) p) q
    @[simp]
    theorem signedDist_zero {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (p q : P) :
    ((signedDist 0) p) q = 0
    @[simp]
    theorem signedDist_neg {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) (p q : P) :
    ((signedDist (-v)) p) q = -((signedDist v) p) q
    theorem signedDist_congr {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v w : V) (h : r > 0, r v = w) :
    @[simp]
    theorem signedDist_self {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) (p : P) :
    ((signedDist v) p) p = 0
    @[simp]
    theorem signedDist_anticomm {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) (p q : P) :
    -((signedDist v) p) q = ((signedDist v) q) p
    @[simp]
    theorem signedDist_triangle {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) (p q r : P) :
    ((signedDist v) p) q + ((signedDist v) q) r = ((signedDist v) p) r
    @[simp]
    theorem signedDist_triangle_left {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) (p q r : P) :
    ((signedDist v) p) q - ((signedDist v) p) r = ((signedDist v) r) q
    @[simp]
    theorem signedDist_triangle_right {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) (p q r : P) :
    ((signedDist v) p) r - ((signedDist v) q) r = ((signedDist v) p) q
    theorem signedDist_vadd_left {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v w : V) (p q : P) :
    ((signedDist v) (w +ᵥ p)) q = -inner (v⁻¹ v) w + ((signedDist v) p) q
    theorem signedDist_vadd_right {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v w : V) (p q : P) :
    ((signedDist v) p) (w +ᵥ q) = inner (v⁻¹ v) w + ((signedDist v) p) q
    theorem signedDist_vadd_left_swap {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v w : V) (p q : P) :
    ((signedDist v) (w +ᵥ p)) q = ((signedDist v) p) (-w +ᵥ q)
    theorem signedDist_vadd_right_swap {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v w : V) (p q : P) :
    ((signedDist v) p) (w +ᵥ q) = ((signedDist v) (-w +ᵥ p)) q
    theorem signedDist_vadd_vadd {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v w : V) (p q : P) :
    ((signedDist v) (w +ᵥ p)) (w +ᵥ q) = ((signedDist v) p) q
    theorem signedDist_left_congr {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {v : V} {p q : P} (h : inner v (p -ᵥ q) = 0) :
    (signedDist v) p = (signedDist v) q
    theorem signedDist_right_congr {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {v : V} (p : P) {q r : P} (h : inner v (q -ᵥ r) = 0) :
    ((signedDist v) p) q = ((signedDist v) p) r
    theorem signedDist_eq_zero_of_orthogonal {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {v : V} {p q : P} (h : inner v (q -ᵥ p) = 0) :
    ((signedDist v) p) q = 0
    theorem abs_signedDist_le_dist {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) (p q : P) :
    |((signedDist v) p) q| dist p q
    theorem signedDist_le_dist {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (v : V) (p q : P) :
    ((signedDist v) p) q dist p q
    @[simp]
    theorem signedDist_vsub_self {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (p q : P) :
    ((signedDist (q -ᵥ p)) p) q = dist p q
    @[simp]
    theorem signedDist_vsub_self_rev {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] (p q : P) :
    ((signedDist (p -ᵥ q)) p) q = -dist p q

    The signed distance between s and a point, in the direction of the reference point p. This is expected to be used when p does not lie in s (in the degenerate case where p lies in s, this yields 0) and when the point at which the distance is evaluated lies in the affine span of s and p (any component of the distance orthogonal to that span is disregarded).

    Equations
    Instances For
      noncomputable def Affine.Simplex.signedInfDist {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {n : } [NeZero n] (s : Simplex P n) (i : Fin (n + 1)) :

      The signed distance between the face of s excluding point i of that simplex and a point, in the direction of the reference point i. This is expected to be used when the point at which the distance is evaluated lies in the affine span of the simplex (any component of the distance orthogonal to that span is disregarded). In the case of a triangle, these distances are trilinear coordinates; in a tetrahedron, they are quadriplanar coordinates.

      Equations
      Instances For
        theorem Affine.Simplex.signedInfDist_apply_of_ne {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {n : } [NeZero n] (s : Simplex P n) {i j : Fin (n + 1)} (h : j i) :
        (s.signedInfDist i) (s.points j) = 0
        theorem Affine.Simplex.signedInfDist_affineCombination {V : Type u_1} {P : Type u_2} [NormedAddCommGroup V] [InnerProductSpace V] [MetricSpace P] [NormedAddTorsor V P] {n : } [NeZero n] (s : Simplex P n) (i : Fin (n + 1)) {w : Fin (n + 1)} (h : i : Fin (n + 1), w i = 1) :