Skip to content

Commit ad6b660

Browse files
feat(Geometry/Euclidean/Sphere): add lemmas about points on a sphere (#41143)
Adds three lemmas to `Mathlib/Geometry/Euclidean/Sphere/Basic.lean`. - `Sphere.ne_center_of_mem_of_mem_of_ne`: a point of a sphere that differs from another point of the sphere is not its center. Extracted at a reviewer's suggestion; this fact was reproved inline four times across #41121 and #41123. - `norm_vsub_center_eq_radius`: for a point `p` on a sphere `s`, `‖p -ᵥ s.center‖ = s.radius`. This pattern occurs ten times in #34164 and four more times in the present file (twice in `inner_vsub_center_vsub_pos` and twice in `Sphere.dist_center_lt_radius_of_sbtw`); those four in-file occurrences are golfed to use it here. - `Sphere.center_mem_affineSpan_pair_iff_isDiameter`: for two distinct points of a sphere, the center lies on the line through them if and only if those points are the endpoints of a diameter. No mathematical content changes; the existing proofs are only shortened. Co-authored-by: Scarlett-le <735979178@qq.com> Co-authored-by: Jireh Loreaux <loreaujy@gmail.com>
1 parent 28c4f6c commit ad6b660

1 file changed

Lines changed: 26 additions & 4 deletions

File tree

Mathlib/Geometry/Euclidean/Sphere/Basic.lean

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ lemma Sphere.radius_nonneg_of_mem {s : Sphere P} {p : P} (h : p ∈ s) : 0 ≤ s
138138
@[simp] lemma Sphere.center_mem_iff {s : Sphere P} : s.center ∈ s ↔ s.radius = 0 := by
139139
simp [mem_sphere, eq_comm]
140140

141+
/-- A point of a sphere that differs from another point of the sphere is not its center. -/
142+
lemma Sphere.ne_center_of_mem_of_mem_of_ne {s : Sphere P} {p q : P}
143+
(hp : p ∈ s) (hq : q ∈ s) (hpq : p ≠ q) : p ≠ s.center := by
144+
grind [dist_eq_zero, mem_sphere']
145+
141146
/-- A set of points is cospherical if they are equidistant from some
142147
point. In two dimensions, this is the same thing as being
143148
concyclic. -/
@@ -206,6 +211,12 @@ theorem Cospherical.subtype_val {S : AffineSubspace ℝ P} [Nonempty S] {ps : Se
206211
(hps : Cospherical ps) : Cospherical (Subtype.val '' ps) :=
207212
Isometry.cospherical S.subtypeₐᵢ.isometry hps
208213

214+
omit [NormedSpace ℝ V] in
215+
/-- For a point on a sphere, the norm of its displacement from the center equals the radius. -/
216+
theorem norm_vsub_center_eq_radius {s : Sphere P} {p : P} (hp : p ∈ s) :
217+
‖p -ᵥ s.center‖ = s.radius := by
218+
rw [← dist_eq_norm_vsub']; exact mem_sphere'.mp hp
219+
209220
lemma Sphere.nonempty_iff [Nontrivial V] {s : Sphere P} : (s : Set P).Nonempty ↔ 0 ≤ s.radius := by
210221
refine ⟨fun ⟨p, hp⟩ ↦ radius_nonneg_of_mem hp, fun h ↦ ?_⟩
211222
obtain ⟨v, hv⟩ := (NormedSpace.sphere_nonempty (x := (0 : V)) (r := s.radius)).2 h
@@ -456,8 +467,8 @@ theorem Sphere.dist_center_lt_radius_of_sbtw {p₁ p₂ p : P} {s : Sphere P}
456467
have ht₁' : t < 1 := lt_of_le_of_ne ht₁ fun h => hne₂ <| by
457468
rw [← hpt, h, AffineMap.lineMap_apply_one]
458469
set u := p₁ -ᵥ o; set v := p₂ -ᵥ o
459-
have hu : ‖u‖ = s.radius := by rw [← dist_eq_norm_vsub]; exact mem_sphere.mp hp₁
460-
have hv : ‖v‖ = s.radius := by rw [← dist_eq_norm_vsub]; exact mem_sphere.mp hp₂
470+
have hu : ‖u‖ = s.radius := norm_vsub_center_eq_radius hp₁
471+
have hv : ‖v‖ = s.radius := norm_vsub_center_eq_radius hp₂
461472
have huv : u ≠ v := fun h => hne₁ <| by
462473
rw [← hpt, vsub_left_cancel h, AffineMap.lineMap_same, AffineMap.const_apply]
463474
have hpo : p -ᵥ o = (1 - t) • u + t • v := by
@@ -551,8 +562,8 @@ the radius vector at one endpoint is negative. -/
551562
theorem inner_vsub_center_vsub_pos {p₁ p₂ : P} {s : Sphere P}
552563
(hp₁ : p₁ ∈ s) (hp₂ : p₂ ∈ s) (hp₁p₂ : p₁ ≠ p₂) :
553564
0 < ⟪p₂ -ᵥ p₁, s.center -ᵥ p₁⟫ := by
554-
have hp₁' : ‖p₁ -ᵥ s.center‖ = s.radius := by rw [← dist_eq_norm_vsub']; exact mem_sphere'.mp hp₁
555-
have hp₂' : ‖p₂ -ᵥ s.center‖ = s.radius := by rw [← dist_eq_norm_vsub']; exact mem_sphere'.mp hp₂
565+
have hp₁' : ‖p₁ -ᵥ s.center‖ = s.radius := norm_vsub_center_eq_radius hp₁
566+
have hp₂' : ‖p₂ -ᵥ s.center‖ = s.radius := norm_vsub_center_eq_radius hp₂
556567
have hd : ‖p₂ -ᵥ s.center‖ ^ 2 =
557568
‖p₂ -ᵥ p₁‖ ^ 2 + 2 * ⟪p₂ -ᵥ p₁, p₁ -ᵥ s.center⟫ + ‖p₁ -ᵥ s.center‖ ^ 2 := by
558569
rw [← vsub_add_vsub_cancel p₂ p₁ s.center, norm_add_sq_real]
@@ -593,6 +604,17 @@ lemma isDiameter_iff_mem_and_mem_and_wbtw :
593604
rw [mem_sphere.1 h₁, mem_sphere'.1 h₂, ← two_mul, eq_comm] at hd
594605
exact isDiameter_iff_mem_and_mem_and_dist.2 ⟨h₁, h₂, hd⟩
595606

607+
/-- The center lies on the line through two distinct points of a sphere if and only if those
608+
points are the endpoints of a diameter. -/
609+
theorem center_mem_affineSpan_pair_iff_isDiameter
610+
(hp₁ : p₁ ∈ s) (hp₂ : p₂ ∈ s) (hp₁p₂ : p₁ ≠ p₂) :
611+
s.center ∈ line[ℝ, p₁, p₂] ↔ s.IsDiameter p₁ p₂ := by
612+
rw [isDiameter_iff_mem_and_mem_and_wbtw]
613+
refine ⟨fun h => ⟨hp₁, hp₂, ?_⟩, fun h => h.2.2.mem_affineSpan⟩
614+
refine wbtw_of_collinear_of_dist_center_le_radius ?_ hp₁ ?_ hp₂ hp₁p₂
615+
· rw [Set.insert_comm]; exact collinear_insert_of_mem_affineSpan_pair h
616+
· simpa using radius_nonneg_of_mem hp₁
617+
596618
end Sphere
597619

598620
end EuclideanSpace

0 commit comments

Comments
 (0)