The areas / V22. Affine, Euclidean and convex geometry
Mathlib.Geometry.Euclidean.Basic
5 declarations. Mathlib docs · Source
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.NormedSpace.InnerProduct. Results with longer
proofs or more geometrical content generally go in separate files.
Implementation notes
To declare P as the type of points in a Euclidean affine space with
V as the type of vectors, use
[NormedAddCommGroup V] [InnerProductSpace ℝ V] [MetricSpace P] [NormedAddTorsor V P].
This works better with outParam 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
- https://en.wikipedia.org/wiki/Euclidean_space
Geometrical results on Euclidean affine spaces
This section develops some geometrical definitions and results on Euclidean affine spaces.
theorem EuclideanGeometry.inner_weightedVSub E1 #
∀ {V : Type u_1} {P : Type u_2} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] [inst_2 : MetricSpace P]
[inst_3 : NormedAddTorsor V P] {ι₁ : Type u_3} {s₁ : Finset ι₁} {w₁ : ι₁ → ℝ} (p₁ : ι₁ → P),
∑ i ∈ s₁, w₁ i = 0 →
∀ {ι₂ : Type u_4} {s₂ : Finset ι₂} {w₂ : ι₂ → ℝ} (p₂ : ι₂ → P),
∑ i ∈ s₂, w₂ i = 0 →
inner ℝ ((s₁.weightedVSub p₁) w₁) ((s₂.weightedVSub p₂) w₂) =
(-∑ i₁ ∈ s₁, ∑ i₂ ∈ s₂, w₁ i₁ * w₂ i₂ * (dist (p₁ i₁) (p₂ i₂) * dist (p₁ i₁) (p₂ i₂))) / 2
The inner product of two vectors given with weightedVSub, in
terms of the pairwise distances.
theorem EuclideanGeometry.dist_affineCombination E1 #
∀ {V : Type u_1} {P : Type u_2} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] [inst_2 : MetricSpace P]
[inst_3 : NormedAddTorsor V P] {ι : Type u_3} {s : Finset ι} {w₁ w₂ : ι → ℝ} (p : ι → P),
∑ i ∈ s, w₁ i = 1 →
∑ i ∈ s, w₂ i = 1 →
have a₁ := (Finset.affineCombination ℝ s p) w₁;
have a₂ := (Finset.affineCombination ℝ s p) w₂;
dist a₁ a₂ * dist a₁ a₂ =
(-∑ i₁ ∈ s, ∑ i₂ ∈ s, (w₁ - w₂) i₁ * (w₁ - w₂) i₂ * (dist (p i₁) (p i₂) * dist (p i₁) (p i₂))) / 2
The distance between two points given with affineCombination,
in terms of the pairwise distances between the points in that
combination.
theorem EuclideanGeometry.dist_affineCombination_const_sq E1 #
∀ {V : Type u_1} {P : Type u_2} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] [inst_2 : MetricSpace P]
[inst_3 : NormedAddTorsor V P] {ι : Type u_3} {s : Finset ι} {w : ι → ℝ} (p : ι → P) (q : P),
∑ i ∈ s, w i = 1 →
dist ((Finset.affineCombination ℝ s p) w) q ^ 2 =
∑ i ∈ s, w i * dist (p i) q ^ 2 - (∑ i ∈ s, ∑ j ∈ s, w i * w j * dist (p i) (p j) ^ 2) / 2
The squared distance from an affineCombination to a constant point.
theorem EuclideanGeometry.dist_smul_vadd_sq E1 #
∀ {V : Type u_1} {P : Type u_2} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] [inst_2 : MetricSpace P]
[inst_3 : NormedAddTorsor V P] (r : ℝ) (v : V) (p₁ p₂ : P),
dist (r • v +ᵥ p₁) p₂ * dist (r • v +ᵥ p₁) p₂ =
inner ℝ v v * r * r + 2 * inner ℝ v (p₁ -ᵥ p₂) * r + inner ℝ (p₁ -ᵥ p₂) (p₁ -ᵥ p₂)
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.
theorem EuclideanGeometry.dist_smul_vadd_eq_dist E1 #
∀ {V : Type u_1} {P : Type u_2} [inst : NormedAddCommGroup V] [inst_1 : InnerProductSpace ℝ V] [inst_2 : MetricSpace P]
[inst_3 : NormedAddTorsor V P] {v : V} (p₁ p₂ : P),
v ≠ 0 → ∀ (r : ℝ), dist (r • v +ᵥ p₁) p₂ = dist p₁ p₂ ↔ r = 0 ∨ r = -2 * inner ℝ v (p₁ -ᵥ p₂) / inner ℝ v v
The condition for two points on a line to be equidistant from another point.