Skip to content

Commit 502d38e

Browse files
committed
feat(Geometry/Euclidean/Projection): characteristic property (#30698)
Add a lemma ```lean lemma orthogonalProjection_eq_iff_mem {s : AffineSubspace ℝ P} [Nonempty s] [s.direction.HasOrthogonalProjection] {p q : P} : orthogonalProjection s p = q ↔ q ∈ s ∧ p -ᵥ q ∈ s.directionᗮ := by ``` that gives the characteristic property of the orthogonal projection in a more convenient form to use than the existing `inter_eq_singleton_orthogonalProjection` (from which it is derived). Deduce a lemma `orthogonalProjection_eq_orthogonalProjection_iff_vsub_mem` about equality of two projections onto the same subspace.
1 parent f70c739 commit 502d38e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Mathlib/Geometry/Euclidean/Projection.lean

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,40 @@ theorem orthogonalProjection_vsub_orthogonalProjection (s : AffineSubspace ℝ P
276276
rw [← neg_vsub_eq_vsub_rev, inner_neg_right,
277277
orthogonalProjection_vsub_mem_direction_orthogonal s p c hc, neg_zero]
278278

279+
/-- The characteristic property of the orthogonal projection, for a point given in the underlying
280+
space. This form is typically more convenient to use than
281+
`inter_eq_singleton_orthogonalProjection`. -/
282+
lemma coe_orthogonalProjection_eq_iff_mem {s : AffineSubspace ℝ P} [Nonempty s]
283+
[s.direction.HasOrthogonalProjection] {p q : P} :
284+
orthogonalProjection s p = q ↔ q ∈ s ∧ p -ᵥ q ∈ s.directionᗮ := by
285+
constructor
286+
· rintro rfl
287+
exact ⟨orthogonalProjection_mem _, vsub_orthogonalProjection_mem_direction_orthogonal _ _⟩
288+
· rintro ⟨hqs, hpq⟩
289+
have hq : q ∈ mk' p s.directionᗮ := by
290+
rwa [mem_mk', ← neg_mem_iff, neg_vsub_eq_vsub_rev]
291+
suffices q ∈ ({(orthogonalProjection s p : P)} : Set P) by
292+
simpa [eq_comm] using this
293+
rw [← inter_eq_singleton_orthogonalProjection]
294+
simp only [Set.mem_inter_iff, SetLike.mem_coe]
295+
exact ⟨hqs, hq⟩
296+
297+
/-- The characteristic property of the orthogonal projection, for a point given in the relevant
298+
subspace. This form is typically more convenient to use than
299+
`inter_eq_singleton_orthogonalProjection`. -/
300+
lemma orthogonalProjection_eq_iff_mem {s : AffineSubspace ℝ P} [Nonempty s]
301+
[s.direction.HasOrthogonalProjection] {p : P} {q : s} :
302+
orthogonalProjection s p = q ↔ p -ᵥ q ∈ s.directionᗮ := by
303+
simpa using coe_orthogonalProjection_eq_iff_mem (s := s) (p := p) (q := (q : P))
304+
305+
/-- A condition for two points to have the same orthogonal projection onto a given subspace. -/
306+
lemma orthogonalProjection_eq_orthogonalProjection_iff_vsub_mem {s : AffineSubspace ℝ P}
307+
[Nonempty s] [s.direction.HasOrthogonalProjection] {p q : P} :
308+
orthogonalProjection s p = orthogonalProjection s q ↔ p -ᵥ q ∈ s.directionᗮ := by
309+
rw [orthogonalProjection_eq_iff_mem, ← s.directionᗮ.add_mem_iff_left (x := p -ᵥ q)
310+
(vsub_orthogonalProjection_mem_direction_orthogonal s q)]
311+
simp
312+
279313
/-- Adding a vector to a point in the given subspace, then taking the
280314
orthogonal projection, produces the original point if the vector was
281315
in the orthogonal direction. -/

0 commit comments

Comments
 (0)