@@ -54,14 +54,15 @@ open_locale uniformity topological_space big_operators filter nnreal ennreal
54
54
universes u v w
55
55
variables {α : Type u} {β : Type v}
56
56
57
- /-- Construct a uniform structure from a distance function and metric space axioms -/
58
- def uniform_space_of_dist
59
- (dist : α → α → ℝ)
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 : α → α → ℝ)
60
62
(dist_self : ∀ x : α, dist x x = 0 )
61
63
(dist_comm : ∀ x y : α, dist x y = dist y x)
62
- (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z) : uniform_space α :=
63
- uniform_space.of_core {
64
- uniformity := (⨅ ε>0 , 𝓟 {p:α×α | dist p.1 p.2 < ε}),
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 < ε}),
65
66
refl := le_infi $ assume ε, le_infi $
66
67
by simp [set.subset_def, id_rel, dist_self, (>)] {contextual := tt},
67
68
comp := le_infi $ assume ε, le_infi $ assume h, lift'_le
@@ -75,6 +76,14 @@ uniform_space.of_core {
75
76
symm := tendsto_infi.2 $ assume ε, tendsto_infi.2 $ assume h,
76
77
tendsto_infi' ε $ tendsto_infi' h $ tendsto_principal_principal.2 $ by simp [dist_comm] }
77
78
79
+ /-- Construct a uniform structure from a distance function and metric space axioms -/
80
+ def uniform_space_of_dist
81
+ (dist : α → α → ℝ)
82
+ (dist_self : ∀ x : α, dist x x = 0 )
83
+ (dist_comm : ∀ x y : α, dist x y = dist y x)
84
+ (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)
86
+
78
87
/-- The distance function (given an ambient metric space on `α`), which returns
79
88
a nonnegative real number `dist x y` given `x y : α`. -/
80
89
class has_dist (α : Type *) := (dist : α → α → ℝ)
@@ -110,6 +119,43 @@ pseudo_metric_space.to_uniform_space
110
119
@[priority 200 ] -- see Note [lower instance priority]
111
120
instance pseudo_metric_space.to_has_edist : has_edist α := ⟨pseudo_metric_space.edist⟩
112
121
122
+ /-- Construct a pseudo-metric space structure whose underlying topological space structure
123
+ (definitionally) agrees which a pre-existing topology which is compatible with a given distance
124
+ function. -/
125
+ def pseudo_metric_space.of_metrizable {α : Type *} [topological_space α] (dist : α → α → ℝ)
126
+ (dist_self : ∀ x : α, dist x x = 0 )
127
+ (dist_comm : ∀ x y : α, dist x y = dist y x)
128
+ (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z)
129
+ (H : ∀ s : set α, is_open s ↔ ∀ x ∈ s, ∃ ε > 0 , ∀ y, dist x y < ε → y ∈ s) :
130
+ pseudo_metric_space α :=
131
+ { dist := dist,
132
+ dist_self := dist_self,
133
+ dist_comm := dist_comm,
134
+ dist_triangle := dist_triangle,
135
+ to_uniform_space := { is_open_uniformity := begin
136
+ dsimp only [uniform_space.core_of_dist],
137
+ intros s,
138
+ change is_open s ↔ _,
139
+ rw H s,
140
+ apply forall_congr, intro x,
141
+ apply forall_congr, intro x_in,
142
+ erw (has_basis_binfi_principal _ nonempty_Ioi).mem_iff,
143
+ { apply exists_congr, intros ε,
144
+ apply exists_congr, intros ε_pos,
145
+ simp only [prod.forall, set_of_subset_set_of],
146
+ split,
147
+ { rintros h _ y H rfl,
148
+ exact h y H },
149
+ { intros h y hxy,
150
+ exact h _ _ hxy rfl } },
151
+ { exact λ r (hr : 0 < r) p (hp : 0 < p), ⟨min r p, lt_min hr hp,
152
+ λ x (hx : dist _ _ < _), lt_of_lt_of_le hx (min_le_left r p),
153
+ λ x (hx : dist _ _ < _), lt_of_lt_of_le hx (min_le_right r p)⟩ },
154
+ { apply_instance }
155
+ end ,
156
+ ..uniform_space.core_of_dist dist dist_self dist_comm dist_triangle },
157
+ uniformity_dist := rfl }
158
+
113
159
@[simp] theorem dist_self (x : α) : dist x x = 0 := pseudo_metric_space.dist_self x
114
160
115
161
theorem dist_comm (x y : α) : dist x y = dist y x := pseudo_metric_space.dist_comm x y
@@ -704,8 +750,8 @@ theorem tendsto_at_top' [nonempty β] [semilattice_sup β] [no_top_order β] {u
704
750
(at_top_basis_Ioi.tendsto_iff nhds_basis_ball).trans $
705
751
by { simp only [exists_prop, true_and], refl }
706
752
707
- lemma is_open_singleton_iff {X : Type *} [pseudo_metric_space X ] {x : X } :
708
- is_open ({x} : set X ) ↔ ∃ ε > 0 , ∀ y, dist y x < ε → y = x :=
753
+ lemma is_open_singleton_iff {α : Type *} [pseudo_metric_space α ] {x : α } :
754
+ is_open ({x} : set α ) ↔ ∃ ε > 0 , ∀ y, dist y x < ε → y = x :=
709
755
by simp [is_open_iff, subset_singleton_iff, mem_ball]
710
756
711
757
/-- Given a point `x` in a discrete subset `s` of a pseudometric space, there is an open ball
@@ -1793,6 +1839,18 @@ end int
1793
1839
class metric_space (α : Type u) extends pseudo_metric_space α : Type u :=
1794
1840
(eq_of_dist_eq_zero : ∀ {x y : α}, dist x y = 0 → x = y)
1795
1841
1842
+ /-- Construct a metric space structure whose underlying topological space structure
1843
+ (definitionally) agrees which a pre-existing topology which is compatible with a given distance
1844
+ function. -/
1845
+ def metric_space.of_metrizable {α : Type *} [topological_space α] (dist : α → α → ℝ)
1846
+ (dist_self : ∀ x : α, dist x x = 0 )
1847
+ (dist_comm : ∀ x y : α, dist x y = dist y x)
1848
+ (dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z)
1849
+ (H : ∀ s : set α, is_open s ↔ ∀ x ∈ s, ∃ ε > 0 , ∀ y, dist x y < ε → y ∈ s)
1850
+ (eq_of_dist_eq_zero : ∀ x y : α, dist x y = 0 → x = y) : metric_space α :=
1851
+ { eq_of_dist_eq_zero := eq_of_dist_eq_zero,
1852
+ ..pseudo_metric_space.of_metrizable dist dist_self dist_comm dist_triangle H }
1853
+
1796
1854
variables {γ : Type w} [metric_space γ]
1797
1855
1798
1856
theorem eq_of_dist_eq_zero {x y : γ} : dist x y = 0 → x = y :=
0 commit comments