@@ -54,35 +54,14 @@ open_locale uniformity topology big_operators filter nnreal ennreal
5454universes u v w
5555variables {α : Type u} {β : Type v} {X ι : Type *}
5656
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-
7957/-- Construct a uniform structure from a distance function and metric space axioms -/
8058def uniform_space_of_dist
8159 (dist : α → α → ℝ)
8260 (dist_self : ∀ x : α, dist x x = 0 )
8361 (dist_comm : ∀ x y : α, dist x y = dist y x)
8462 (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⟩
8665
8766/-- This is an internal lemma used to construct a bornology from a metric in `bornology.of_dist`. -/
8867private lemma bounded_iff_aux {α : Type *} (dist : α → α → ℝ)
@@ -202,7 +181,7 @@ instance pseudo_metric_space.to_has_edist : has_edist α := ⟨pseudo_metric_spa
202181/-- Construct a pseudo-metric space structure whose underlying topological space structure
203182(definitionally) agrees which a pre-existing topology which is compatible with a given distance
204183function. -/
205- def pseudo_metric_space.of_metrizable {α : Type * } [topological_space α] (dist : α → α → ℝ)
184+ def pseudo_metric_space.of_dist_topology {α : Type u } [topological_space α] (dist : α → α → ℝ)
206185 (dist_self : ∀ x : α, dist x x = 0 )
207186 (dist_comm : ∀ x y : α, dist x y = dist y x)
208187 (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
212191 dist_self := dist_self,
213192 dist_comm := dist_comm,
214193 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 },
235199 uniformity_dist := rfl,
236200 to_bornology := bornology.of_dist dist dist_self dist_comm dist_triangle,
237201 cobounded_sets := rfl }
@@ -653,14 +617,15 @@ theorem is_bounded_iff_nndist {s : set α} :
653617by simp only [is_bounded_iff_exists_ge 0 , nnreal.exists, ← nnreal.coe_le_coe, ← dist_nndist,
654618 nnreal.coe_mk, exists_prop]
655619
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+
656624theorem uniformity_basis_dist :
657625 (𝓤 α).has_basis (λ ε : ℝ, 0 < ε) (λ ε, {p:α×α | dist p.1 p.2 < ε}) :=
658626begin
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 _) _ _ _ _ _
664629end
665630
666631/-- Given `f : β → ℝ`, if `f` sends `{i | p i}` to a set of positive numbers
@@ -680,6 +645,11 @@ begin
680645 { exact λ ⟨i, hi, H⟩, ⟨f i, hf₀ i hi, H⟩ }
681646end
682647
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+
683653theorem uniformity_basis_dist_inv_nat_succ :
684654 (𝓤 α).has_basis (λ _, true) (λ n:ℕ, {p:α×α | dist p.1 p.2 < 1 / (↑n+1 ) }) :=
685655metric.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 : α → β)
14761446 edist := λ x y, edist (f x) (f y),
14771447 edist_dist := λ x y, edist_dist _ _,
14781448 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,
14841450 to_bornology := bornology.induced f,
14851451 cobounded_sets := set.ext $ compl_surjective.forall.2 $ λ s,
14861452 by simp only [compl_mem_comap, filter.mem_sets, ← is_bounded_def, mem_set_of_eq, compl_compl,
@@ -2643,14 +2609,14 @@ end
26432609/-- Construct a metric space structure whose underlying topological space structure
26442610(definitionally) agrees which a pre-existing topology which is compatible with a given distance
26452611function. -/
2646- def metric_space.of_metrizable {α : Type * } [topological_space α] (dist : α → α → ℝ)
2612+ def metric_space.of_dist_topology {α : Type u } [topological_space α] (dist : α → α → ℝ)
26472613 (dist_self : ∀ x : α, dist x x = 0 )
26482614 (dist_comm : ∀ x y : α, dist x y = dist y x)
26492615 (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z)
26502616 (H : ∀ s : set α, is_open s ↔ ∀ x ∈ s, ∃ ε > 0 , ∀ y, dist x y < ε → y ∈ s)
26512617 (eq_of_dist_eq_zero : ∀ x y : α, dist x y = 0 → x = y) : metric_space α :=
26522618{ 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 }
26542620
26552621variables {γ : Type w} [metric_space γ]
26562622
0 commit comments