@@ -54,35 +54,14 @@ open_locale uniformity topology big_operators filter nnreal ennreal
54
54
universes u v w
55
55
variables {α : Type u} {β : Type v} {X ι : Type *}
56
56
57
- /-- Construct a uniform structure core from a distance function and metric space axioms.
58
- This is a technical construction that can be immediately used to construct a uniform structure
59
- from a distance function and metric space axioms but is also useful when discussing
60
- metrizable topologies, see `pseudo_metric_space.of_metrizable`. -/
61
- def uniform_space.core_of_dist {α : Type *} (dist : α → α → ℝ)
62
- (dist_self : ∀ x : α, dist x x = 0 )
63
- (dist_comm : ∀ x y : α, dist x y = dist y x)
64
- (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) : uniform_space.core α :=
65
- { uniformity := (⨅ ε>0 , 𝓟 {p:α×α | dist p.1 p.2 < ε}),
66
- refl := le_infi $ assume ε, le_infi $
67
- by simp [set.subset_def, id_rel, dist_self, (>)] {contextual := tt},
68
- comp := le_infi $ assume ε, le_infi $ assume h, lift'_le
69
- (mem_infi_of_mem (ε / 2 ) $ mem_infi_of_mem (div_pos h zero_lt_two) (subset.refl _)) $
70
- have ∀ (a b c : α), dist a c < ε / 2 → dist c b < ε / 2 → dist a b < ε,
71
- from assume a b c hac hcb,
72
- calc dist a b ≤ dist a c + dist c b : dist_triangle _ _ _
73
- ... < ε / 2 + ε / 2 : add_lt_add hac hcb
74
- ... = ε : by rw [div_add_div_same, add_self_div_two],
75
- by simpa [comp_rel],
76
- symm := tendsto_infi.2 $ assume ε, tendsto_infi.2 $ assume h,
77
- tendsto_infi' ε $ tendsto_infi' h $ tendsto_principal_principal.2 $ by simp [dist_comm] }
78
-
79
57
/-- Construct a uniform structure from a distance function and metric space axioms -/
80
58
def uniform_space_of_dist
81
59
(dist : α → α → ℝ)
82
60
(dist_self : ∀ x : α, dist x x = 0 )
83
61
(dist_comm : ∀ x y : α, dist x y = dist y x)
84
62
(dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) : uniform_space α :=
85
- uniform_space.of_core (uniform_space.core_of_dist dist dist_self dist_comm dist_triangle)
63
+ uniform_space.of_fun dist dist_self dist_comm dist_triangle $ λ ε ε0 ,
64
+ ⟨ε / 2 , half_pos ε0 , λ x hx y hy, add_halves ε ▸ add_lt_add hx hy⟩
86
65
87
66
/-- This is an internal lemma used to construct a bornology from a metric in `bornology.of_dist`. -/
88
67
private lemma bounded_iff_aux {α : Type *} (dist : α → α → ℝ)
@@ -202,7 +181,7 @@ instance pseudo_metric_space.to_has_edist : has_edist α := ⟨pseudo_metric_spa
202
181
/-- Construct a pseudo-metric space structure whose underlying topological space structure
203
182
(definitionally) agrees which a pre-existing topology which is compatible with a given distance
204
183
function. -/
205
- def pseudo_metric_space.of_metrizable {α : Type * } [topological_space α] (dist : α → α → ℝ)
184
+ def pseudo_metric_space.of_dist_topology {α : Type u } [topological_space α] (dist : α → α → ℝ)
206
185
(dist_self : ∀ x : α, dist x x = 0 )
207
186
(dist_comm : ∀ x y : α, dist x y = dist y x)
208
187
(dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z)
@@ -212,26 +191,11 @@ def pseudo_metric_space.of_metrizable {α : Type*} [topological_space α] (dist
212
191
dist_self := dist_self,
213
192
dist_comm := dist_comm,
214
193
dist_triangle := dist_triangle,
215
- to_uniform_space := { is_open_uniformity := begin
216
- dsimp only [uniform_space.core_of_dist],
217
- intros s,
218
- change is_open s ↔ _,
219
- rw H s,
220
- refine forall₂_congr (λ x x_in, _),
221
- erw (has_basis_binfi_principal _ nonempty_Ioi).mem_iff,
222
- { refine exists₂_congr (λ ε ε_pos, _),
223
- simp only [prod.forall, set_of_subset_set_of],
224
- split,
225
- { rintros h _ y H rfl,
226
- exact h y H },
227
- { intros h y hxy,
228
- exact h _ _ hxy rfl } },
229
- { exact λ r (hr : 0 < r) p (hp : 0 < p), ⟨min r p, lt_min hr hp,
230
- λ x (hx : dist _ _ < _), lt_of_lt_of_le hx (min_le_left r p),
231
- λ x (hx : dist _ _ < _), lt_of_lt_of_le hx (min_le_right r p)⟩ },
232
- { apply_instance }
233
- end ,
234
- ..uniform_space.core_of_dist dist dist_self dist_comm dist_triangle },
194
+ to_uniform_space :=
195
+ { is_open_uniformity := λ s, (H s).trans $ forall₂_congr $ λ x _,
196
+ ((uniform_space.has_basis_of_fun (exists_gt (0 : ℝ))
197
+ dist _ _ _ _).comap (prod.mk x)).mem_iff.symm.trans mem_comap_prod_mk,
198
+ to_core := (uniform_space_of_dist dist dist_self dist_comm dist_triangle).to_core },
235
199
uniformity_dist := rfl,
236
200
to_bornology := bornology.of_dist dist dist_self dist_comm dist_triangle,
237
201
cobounded_sets := rfl }
@@ -653,14 +617,15 @@ theorem is_bounded_iff_nndist {s : set α} :
653
617
by simp only [is_bounded_iff_exists_ge 0 , nnreal.exists, ← nnreal.coe_le_coe, ← dist_nndist,
654
618
nnreal.coe_mk, exists_prop]
655
619
620
+ theorem to_uniform_space_eq : ‹pseudo_metric_space α›.to_uniform_space =
621
+ uniform_space_of_dist dist dist_self dist_comm dist_triangle :=
622
+ uniform_space_eq pseudo_metric_space.uniformity_dist
623
+
656
624
theorem uniformity_basis_dist :
657
625
(𝓤 α).has_basis (λ ε : ℝ, 0 < ε) (λ ε, {p:α×α | dist p.1 p.2 < ε}) :=
658
626
begin
659
- rw ← pseudo_metric_space.uniformity_dist.symm,
660
- refine has_basis_binfi_principal _ nonempty_Ioi,
661
- exact λ r (hr : 0 < r) p (hp : 0 < p), ⟨min r p, lt_min hr hp,
662
- λ x (hx : dist _ _ < _), lt_of_lt_of_le hx (min_le_left r p),
663
- λ x (hx : dist _ _ < _), lt_of_lt_of_le hx (min_le_right r p)⟩
627
+ rw [to_uniform_space_eq],
628
+ exact uniform_space.has_basis_of_fun (exists_gt _) _ _ _ _ _
664
629
end
665
630
666
631
/-- Given `f : β → ℝ`, if `f` sends `{i | p i}` to a set of positive numbers
@@ -680,6 +645,11 @@ begin
680
645
{ exact λ ⟨i, hi, H⟩, ⟨f i, hf₀ i hi, H⟩ }
681
646
end
682
647
648
+ theorem uniformity_basis_dist_rat :
649
+ (𝓤 α).has_basis (λ r : ℚ, 0 < r) (λ r, {p : α × α | dist p.1 p.2 < r}) :=
650
+ metric.mk_uniformity_basis (λ _, rat.cast_pos.2 ) $ λ ε hε,
651
+ let ⟨r, hr0, hrε⟩ := exists_rat_btwn hε in ⟨r, rat.cast_pos.1 hr0, hrε.le⟩
652
+
683
653
theorem uniformity_basis_dist_inv_nat_succ :
684
654
(𝓤 α).has_basis (λ _, true) (λ n:ℕ, {p:α×α | dist p.1 p.2 < 1 / (↑n+1 ) }) :=
685
655
metric.mk_uniformity_basis (λ n _, div_pos zero_lt_one $ nat.cast_add_one_pos n)
@@ -1476,11 +1446,7 @@ def pseudo_metric_space.induced {α β} (f : α → β)
1476
1446
edist := λ x y, edist (f x) (f y),
1477
1447
edist_dist := λ x y, edist_dist _ _,
1478
1448
to_uniform_space := uniform_space.comap f m.to_uniform_space,
1479
- uniformity_dist := begin
1480
- apply @uniformity_dist_of_mem_uniformity _ _ _ _ _ (λ x y, dist (f x) (f y)),
1481
- refine compl_surjective.forall.2 (λ s, compl_mem_comap.trans $ mem_uniformity_dist.trans _),
1482
- simp only [mem_compl_iff, @imp_not_comm _ (_ ∈ _), ← prod.forall', prod.mk.eta, ball_image_iff]
1483
- end ,
1449
+ uniformity_dist := (uniformity_basis_dist.comap _).eq_binfi,
1484
1450
to_bornology := bornology.induced f,
1485
1451
cobounded_sets := set.ext $ compl_surjective.forall.2 $ λ s,
1486
1452
by simp only [compl_mem_comap, filter.mem_sets, ← is_bounded_def, mem_set_of_eq, compl_compl,
@@ -2643,14 +2609,14 @@ end
2643
2609
/-- Construct a metric space structure whose underlying topological space structure
2644
2610
(definitionally) agrees which a pre-existing topology which is compatible with a given distance
2645
2611
function. -/
2646
- def metric_space.of_metrizable {α : Type * } [topological_space α] (dist : α → α → ℝ)
2612
+ def metric_space.of_dist_topology {α : Type u } [topological_space α] (dist : α → α → ℝ)
2647
2613
(dist_self : ∀ x : α, dist x x = 0 )
2648
2614
(dist_comm : ∀ x y : α, dist x y = dist y x)
2649
2615
(dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z)
2650
2616
(H : ∀ s : set α, is_open s ↔ ∀ x ∈ s, ∃ ε > 0 , ∀ y, dist x y < ε → y ∈ s)
2651
2617
(eq_of_dist_eq_zero : ∀ x y : α, dist x y = 0 → x = y) : metric_space α :=
2652
2618
{ eq_of_dist_eq_zero := eq_of_dist_eq_zero,
2653
- ..pseudo_metric_space.of_metrizable dist dist_self dist_comm dist_triangle H }
2619
+ ..pseudo_metric_space.of_dist_topology dist dist_self dist_comm dist_triangle H }
2654
2620
2655
2621
variables {γ : Type w} [metric_space γ]
2656
2622
0 commit comments