Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 005df45

Browse files
committed
feat(topology/metric_space): use weaker TC assumptions (#14316)
Assume `t0_space` instead of `separated_space` in `metric.of_t0_pseudo_metric_space` and `emetric.of_t0_pseudo_emetric_space` (both definition used to have `t2` in their names).
1 parent 9e9a2c9 commit 005df45

File tree

3 files changed

+24
-32
lines changed

3 files changed

+24
-32
lines changed

src/analysis/normed/group/basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,18 +1028,18 @@ lemma semi_normed_group.mem_closure_iff {s : set E} {x : E} :
10281028
x ∈ closure s ↔ ∀ ε > 0, ∃ y ∈ s, ∥x - y∥ < ε :=
10291029
by simp [metric.mem_closure_iff, dist_eq_norm]
10301030

1031-
lemma norm_le_zero_iff' [separated_space E] {g : E} :
1031+
lemma norm_le_zero_iff' [t0_space E] {g : E} :
10321032
∥g∥ ≤ 0 ↔ g = 0 :=
10331033
begin
1034-
letI : normed_group E := { to_metric_space := of_t2_pseudo_metric_space ‹_›,
1034+
letI : normed_group E := { to_metric_space := metric.of_t0_pseudo_metric_space E,
10351035
.. ‹semi_normed_group E› },
10361036
rw [← dist_zero_right], exact dist_le_zero
10371037
end
10381038

1039-
lemma norm_eq_zero_iff' [separated_space E] {g : E} : ∥g∥ = 0 ↔ g = 0 :=
1039+
lemma norm_eq_zero_iff' [t0_space E] {g : E} : ∥g∥ = 0 ↔ g = 0 :=
10401040
(norm_nonneg g).le_iff_eq.symm.trans norm_le_zero_iff'
10411041

1042-
lemma norm_pos_iff' [separated_space E] {g : E} : 0 < ∥g∥ ↔ g ≠ 0 :=
1042+
lemma norm_pos_iff' [t0_space E] {g : E} : 0 < ∥g∥ ↔ g ≠ 0 :=
10431043
by rw [← not_le, norm_le_zero_iff']
10441044

10451045
lemma cauchy_seq_sum_of_eventually_eq {u v : ℕ → E} {N : ℕ} (huv : ∀ n ≥ N, u n = v n)

src/topology/metric_space/basic.lean

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def pseudo_metric_space.of_metrizable {α : Type*} [topological_space α] (dist
207207
(dist_comm : ∀ x y : α, dist x y = dist y x)
208208
(dist_triangle : ∀ x y z : α, dist x z ≤ dist x y + dist y z)
209209
(H : ∀ s : set α, is_open s ↔ ∀ x ∈ s, ∃ ε > 0, ∀ y, dist x y < ε → y ∈ s) :
210-
pseudo_metric_space α :=
210+
pseudo_metric_space α :=
211211
{ dist := dist,
212212
dist_self := dist_self,
213213
dist_comm := dist_comm,
@@ -1022,6 +1022,10 @@ by { convert metric.emetric_closed_ball ε.2, simp }
10221022
@[simp] lemma metric.emetric_ball_top (x : α) : emetric.ball x ⊤ = univ :=
10231023
eq_univ_of_forall $ λ y, edist_lt_top _ _
10241024

1025+
lemma metric.indistinguishable_iff {x y : α} : indistinguishable x y ↔ dist x y = 0 :=
1026+
by rw [emetric.indistinguishable_iff, edist_nndist, dist_nndist, ennreal.coe_eq_zero,
1027+
nnreal.coe_eq_zero]
1028+
10251029
/-- Build a new pseudometric space from an old one where the bundled uniform structure is provably
10261030
(but typically non-definitionaly) equal to some given uniform structure.
10271031
See Note [forgetful inheritance].
@@ -2475,26 +2479,20 @@ begin
24752479
end
24762480

24772481
@[priority 100] -- see Note [lower instance priority]
2478-
instance metric_space.to_separated : separated_space γ :=
2482+
instance _root_.metric_space.to_separated : separated_space γ :=
24792483
separated_def.2 $ λ x y h, eq_of_forall_dist_le $
24802484
λ ε ε0, le_of_lt (h _ (dist_mem_uniformity ε0))
24812485

2482-
/-- If a `pseudo_metric_space` is separated, then it is a `metric_space`. -/
2483-
def of_t2_pseudo_metric_space {α : Type*} [pseudo_metric_space α]
2484-
(h : separated_space α) : metric_space α :=
2485-
{ eq_of_dist_eq_zero := λ x y hdist,
2486-
begin
2487-
refine separated_def.1 h x y (λ s hs, _),
2488-
obtain ⟨ε, hε, H⟩ := mem_uniformity_dist.1 hs,
2489-
exact H (show dist x y < ε, by rwa [hdist])
2490-
end
2486+
/-- If a `pseudo_metric_space` is a T₀ space, then it is a `metric_space`. -/
2487+
def of_t0_pseudo_metric_space (α : Type*) [pseudo_metric_space α] [t0_space α] :
2488+
metric_space α :=
2489+
{ eq_of_dist_eq_zero := λ x y hdist, indistinguishable.eq $ metric.indistinguishable_iff.2 hdist,
24912490
..‹pseudo_metric_space α› }
24922491

24932492
/-- A metric space induces an emetric space -/
24942493
@[priority 100] -- see Note [lower instance priority]
24952494
instance metric_space.to_emetric_space : emetric_space γ :=
2496-
{ eq_of_edist_eq_zero := assume x y h, by simpa [edist_dist] using h,
2497-
..pseudo_metric_space.to_pseudo_emetric_space, }
2495+
emetric.of_t0_pseudo_emetric_space γ
24982496

24992497
lemma is_closed_of_pairwise_le_dist {s : set γ} {ε : ℝ} (hε : 0 < ε)
25002498
(hs : s.pairwise (λ x y, ε ≤ dist x y)) : is_closed s :=

src/topology/metric_space/emetric_space.lean

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,9 @@ theorem tendsto_at_top [nonempty β] [semilattice_sup β] {u : β → α} {a :
613613
(at_top_basis.tendsto_iff nhds_basis_eball).trans $
614614
by simp only [exists_prop, true_and, mem_Ici, mem_ball]
615615

616+
theorem indistinguishable_iff : indistinguishable x y ↔ edist x y = 0 :=
617+
by simp [indistinguishable_iff_closure, mem_closure_iff, edist_comm, forall_lt_iff_le']
618+
616619
/-- In a pseudoemetric space, Cauchy sequences are characterized by the fact that, eventually,
617620
the pseudoedistance between its elements is arbitrarily small -/
618621
@[nolint ge_or_gt] -- see Note [nolint_ge]
@@ -698,6 +701,7 @@ to avoid a loop with `sigma_compact_space_of_locally_compact_second_countable`.
698701
lemma second_countable_of_sigma_compact [sigma_compact_space α] :
699702
second_countable_topology α :=
700703
begin
704+
701705
suffices : separable_space α, by exactI uniform_space.second_countable_of_separable α,
702706
choose T hTsub hTc hsubT
703707
using λ n, subset_countable_closure_of_compact (is_compact_compact_covering α n),
@@ -883,15 +887,10 @@ instance to_separated : separated_space γ :=
883887
separated_def.2 $ λ x y h, eq_of_forall_edist_le $
884888
λ ε ε0, le_of_lt (h _ (edist_mem_uniformity ε0))
885889

886-
/-- If a `pseudo_emetric_space` is separated, then it is an `emetric_space`. -/
887-
def emetric_of_t2_pseudo_emetric_space {α : Type*} [pseudo_emetric_space α]
888-
(h : separated_space α) : emetric_space α :=
889-
{ eq_of_edist_eq_zero := λ x y hdist,
890-
begin
891-
refine separated_def.1 h x y (λ s hs, _),
892-
obtain ⟨ε, hε, H⟩ := mem_uniformity_edist.1 hs,
893-
exact H (show edist x y < ε, by rwa [hdist])
894-
end
890+
/-- If a `pseudo_emetric_space` is a T₀ space, then it is an `emetric_space`. -/
891+
def emetric.of_t0_pseudo_emetric_space (α : Type*) [pseudo_emetric_space α] [t0_space α] :
892+
emetric_space α :=
893+
{ eq_of_edist_eq_zero := λ x y hdist, indistinguishable.eq $ emetric.indistinguishable_iff.2 hdist,
895894
..‹pseudo_emetric_space α› }
896895

897896
/-- Auxiliary function to replace the uniformity on an emetric space with
@@ -998,12 +997,7 @@ lemma diam_eq_zero_iff : diam s = 0 ↔ s.subsingleton :=
998997
⟨λ h x hx y hy, edist_le_zero.1 $ h ▸ edist_le_diam_of_mem hx hy, diam_subsingleton⟩
999998

1000999
lemma diam_pos_iff : 0 < diam s ↔ ∃ (x ∈ s) (y ∈ s), x ≠ y :=
1001-
begin
1002-
have := not_congr (@diam_eq_zero_iff _ _ s),
1003-
dunfold set.subsingleton at this,
1004-
push_neg at this,
1005-
simpa only [pos_iff_ne_zero, exists_prop] using this
1006-
end
1000+
by simp only [pos_iff_ne_zero, ne.def, diam_eq_zero_iff, set.subsingleton, not_forall]
10071001

10081002
end diam
10091003

0 commit comments

Comments
 (0)