Skip to content

Commit de6d0d0

Browse files
committed
feat(Geometry/Euclidean/Altitude): add inner_vsub_altitudeFoot_vsub_altitudeFoot_eq_zero (leanprover-community#34157)
1 parent 859cead commit de6d0d0

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

Mathlib/Geometry/Euclidean/Altitude.lean

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,20 +269,27 @@ open scoped RealInnerProductSpace
269269

270270
variable {n : ℕ} (s : Simplex ℝ P n)
271271

272+
/-- Altitudes are perpendicular to the faces containing their foot. -/
273+
lemma inner_vsub_altitudeFoot_vsub_altitudeFoot_eq_zero {i j : Fin (n + 1)} (h : i ≠ j) :
274+
have : NeZero n := by grind [neZero_iff]
275+
⟪s.points j -ᵥ s.altitudeFoot i, s.points i -ᵥ s.altitudeFoot i⟫ = 0 := by
276+
haveI : NeZero n := by grind [neZero_iff]
277+
refine Submodule.inner_right_of_mem_orthogonal
278+
(K := vectorSpan ℝ (s.points '' {i}ᶜ))
279+
(vsub_mem_vectorSpan_of_mem_affineSpan_of_mem_affineSpan
280+
(s.mem_affineSpan_image_iff.2 h.symm)
281+
(Affine.Simplex.altitudeFoot_mem_affineSpan_image_compl _ _))
282+
?_
283+
rw [← direction_affineSpan, ← Affine.Simplex.range_faceOpposite_points]
284+
exact vsub_orthogonalProjection_mem_direction_orthogonal _ _
285+
272286
/-- The inner product of an edge from `j` to `i` and the vector from the foot of `i` to `i`
273287
is the square of the height. -/
274288
lemma inner_vsub_vsub_altitudeFoot_eq_height_sq [NeZero n] {i j : Fin (n + 1)} (h : i ≠ j) :
275289
⟪s.points i -ᵥ s.points j, s.points i -ᵥ s.altitudeFoot i⟫ = s.height i ^ 2 := by
276290
suffices ⟪s.points j -ᵥ s.altitudeFoot i, s.points i -ᵥ s.altitudeFoot i⟫ = 0 by
277291
rwa [height, inner_vsub_vsub_left_eq_dist_sq_right_iff, inner_vsub_left_eq_zero_symm]
278-
refine Submodule.inner_right_of_mem_orthogonal
279-
(K := vectorSpan ℝ (s.points '' {i}ᶜ))
280-
(vsub_mem_vectorSpan_of_mem_affineSpan_of_mem_affineSpan
281-
(s.mem_affineSpan_image_iff.2 h.symm)
282-
(altitudeFoot_mem_affineSpan_image_compl _ _))
283-
?_
284-
rw [← direction_affineSpan, ← range_faceOpposite_points]
285-
exact vsub_orthogonalProjection_mem_direction_orthogonal _ _
292+
exact s.inner_vsub_altitudeFoot_vsub_altitudeFoot_eq_zero h
286293

287294
variable [Nat.AtLeastTwo n]
288295

0 commit comments

Comments
 (0)