@@ -29,18 +29,21 @@ open_locale real_inner_product_space
29
29
30
30
namespace euclidean_geometry
31
31
32
- variables {V : Type *} (P : Type *) [inner_product_space ℝ V] [metric_space P] [normed_add_torsor V P]
32
+ variables {V : Type *} (P : Type *)
33
33
34
34
open finite_dimensional
35
35
36
36
/-- A `sphere P` bundles a `center` and `radius`. This definition does not require the radius to
37
37
be positive; that should be given as a hypothesis to lemmas that require it. -/
38
- @[ext] structure sphere :=
38
+ @[ext] structure sphere [metric_space P] :=
39
39
(center : P)
40
40
(radius : ℝ)
41
41
42
42
variables {P}
43
43
44
+ section metric_space
45
+ variables [metric_space P]
46
+
44
47
instance [nonempty P] : nonempty (sphere P) := ⟨⟨classical.arbitrary P, 0 ⟩⟩
45
48
46
49
instance : has_coe (sphere P) (set P) := ⟨λ s, metric.sphere s.center s.radius⟩
@@ -132,16 +135,9 @@ begin
132
135
exact ⟨c, r, λ p hp, hcr p (hs hp)⟩
133
136
end
134
137
135
- include V
136
-
137
138
/-- The empty set is cospherical. -/
138
- lemma cospherical_empty : cospherical (∅ : set P) :=
139
- begin
140
- use add_torsor.nonempty.some,
141
- simp,
142
- end
143
-
144
- omit V
139
+ lemma cospherical_empty [nonempty P] : cospherical (∅ : set P) :=
140
+ let ⟨p⟩ := ‹nonempty P› in ⟨p, 0 , λ p, false.elim⟩
145
141
146
142
/-- A single point is cospherical. -/
147
143
lemma cospherical_singleton (p : P) : cospherical ({p} : set P) :=
@@ -150,23 +146,47 @@ begin
150
146
simp
151
147
end
152
148
149
+ end metric_space
150
+
151
+ section normed_space
152
+ variables [normed_add_comm_group V] [normed_space ℝ V] [metric_space P] [normed_add_torsor V P]
153
153
include V
154
154
155
155
/-- Two points are cospherical. -/
156
156
lemma cospherical_pair (p₁ p₂ : P) : cospherical ({p₁, p₂} : set P) :=
157
- begin
158
- use [(2 ⁻¹ : ℝ) • (p₂ -ᵥ p₁) +ᵥ p₁, (2 ⁻¹ : ℝ) * (dist p₂ p₁)],
159
- intro p,
160
- rw [set.mem_insert_iff, set.mem_singleton_iff],
161
- rintro ⟨_|_⟩,
162
- { rw [dist_eq_norm_vsub V p₁, vsub_vadd_eq_vsub_sub, vsub_self, zero_sub, norm_neg, norm_smul,
163
- dist_eq_norm_vsub V p₂],
164
- simp },
165
- { rw [H, dist_eq_norm_vsub V p₂, vsub_vadd_eq_vsub_sub, dist_eq_norm_vsub V p₂],
166
- conv_lhs { congr, congr, rw ←one_smul ℝ (p₂ -ᵥ p₁ : V) },
167
- rw [←sub_smul, norm_smul],
168
- norm_num }
169
- end
157
+ ⟨midpoint ℝ p₁ p₂, ‖(2 : ℝ)‖⁻¹ * dist p₁ p₂, begin
158
+ rintros p (rfl | rfl | _),
159
+ { rw [dist_comm, dist_midpoint_left] },
160
+ { rw [dist_comm, dist_midpoint_right] }
161
+ end ⟩
162
+
163
+ /-- A set of points is concyclic if it is cospherical and coplanar. (Most results are stated
164
+ directly in terms of `cospherical` instead of using `concyclic`.) -/
165
+ structure concyclic (ps : set P) : Prop :=
166
+ (cospherical : cospherical ps)
167
+ (coplanar : coplanar ℝ ps)
168
+
169
+ /-- A subset of a concyclic set is concyclic. -/
170
+ lemma concyclic.subset {ps₁ ps₂ : set P} (hs : ps₁ ⊆ ps₂) (h : concyclic ps₂) : concyclic ps₁ :=
171
+ ⟨h.1 .subset hs, h.2 .subset hs⟩
172
+
173
+ /-- The empty set is concyclic. -/
174
+ lemma concyclic_empty : concyclic (∅ : set P) :=
175
+ ⟨cospherical_empty, coplanar_empty ℝ P⟩
176
+
177
+ /-- A single point is concyclic. -/
178
+ lemma concyclic_singleton (p : P) : concyclic ({p} : set P) :=
179
+ ⟨cospherical_singleton p, coplanar_singleton ℝ p⟩
180
+
181
+ /-- Two points are concyclic. -/
182
+ lemma concyclic_pair (p₁ p₂ : P) : concyclic ({p₁, p₂} : set P) :=
183
+ ⟨cospherical_pair p₁ p₂, coplanar_pair ℝ p₁ p₂⟩
184
+
185
+ end normed_space
186
+
187
+ section euclidean_space
188
+ variables [inner_product_space ℝ V] [metric_space P] [normed_add_torsor V P]
189
+ include V
170
190
171
191
/-- Any three points in a cospherical set are affinely independent. -/
172
192
lemma cospherical.affine_independent {s : set P} (hs : cospherical s) {p : fin 3 → P}
@@ -324,26 +344,6 @@ lemma sbtw_of_collinear_of_dist_center_lt_radius {s : sphere P} {p₁ p₂ p₃
324
344
(hp₃ : p₃ ∈ s) (hp₁p₃ : p₁ ≠ p₃) : sbtw ℝ p₁ p₂ p₃ :=
325
345
h.sbtw_of_dist_eq_of_dist_lt hp₁ hp₂ hp₃ hp₁p₃
326
346
327
- /-- A set of points is concyclic if it is cospherical and coplanar. (Most results are stated
328
- directly in terms of `cospherical` instead of using `concyclic`.) -/
329
- structure concyclic (ps : set P) : Prop :=
330
- (cospherical : cospherical ps)
331
- (coplanar : coplanar ℝ ps)
332
-
333
- /-- A subset of a concyclic set is concyclic. -/
334
- lemma concyclic.subset {ps₁ ps₂ : set P} (hs : ps₁ ⊆ ps₂) (h : concyclic ps₂) : concyclic ps₁ :=
335
- ⟨h.1 .subset hs, h.2 .subset hs⟩
336
-
337
- /-- The empty set is concyclic. -/
338
- lemma concyclic_empty : concyclic (∅ : set P) :=
339
- ⟨cospherical_empty, coplanar_empty ℝ P⟩
340
-
341
- /-- A single point is concyclic. -/
342
- lemma concyclic_singleton (p : P) : concyclic ({p} : set P) :=
343
- ⟨cospherical_singleton p, coplanar_singleton ℝ p⟩
344
-
345
- /-- Two points are concyclic. -/
346
- lemma concyclic_pair (p₁ p₂ : P) : concyclic ({p₁, p₂} : set P) :=
347
- ⟨cospherical_pair p₁ p₂, coplanar_pair ℝ p₁ p₂⟩
347
+ end euclidean_space
348
348
349
349
end euclidean_geometry
0 commit comments