Skip to content

Commit 40e4ca7

Browse files
committed
chore(Topology/(E)MetricSpace): move import of Topology.Bases downstream (#21657)
For both `EMetricSpace` and `PseudoMetricSpace`, we have lemmas on `SeparableSpace` in `Defs.lean` that can move to `Basic.lean` without affecting downstream imports, but saving us an unnecessary import in `Defs.lean`.
1 parent 9a88a77 commit 40e4ca7

File tree

4 files changed

+38
-31
lines changed

4 files changed

+38
-31
lines changed

Mathlib/Topology/EMetricSpace/Basic.lean

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,3 +296,35 @@ instance [PseudoEMetricSpace X] : EMetricSpace (SeparationQuotient X) :=
296296
toUniformSpace := inferInstance,
297297
uniformity_edist := comap_injective (surjective_mk.prodMap surjective_mk) <| by
298298
simp [comap_mk_uniformity, PseudoEMetricSpace.uniformity_edist] } _
299+
300+
namespace TopologicalSpace
301+
302+
section Compact
303+
304+
open Topology
305+
306+
/-- If a set `s` is separable in a (pseudo extended) metric space, then it admits a countable dense
307+
subset. This is not obvious, as the countable set whose closure covers `s` given by the definition
308+
of separability does not need in general to be contained in `s`. -/
309+
theorem IsSeparable.exists_countable_dense_subset
310+
{s : Set α} (hs : IsSeparable s) : ∃ t, t ⊆ s ∧ t.Countable ∧ s ⊆ closure t := by
311+
have : ∀ ε > 0, ∃ t : Set α, t.Countable ∧ s ⊆ ⋃ x ∈ t, closedBall x ε := fun ε ε0 => by
312+
rcases hs with ⟨t, htc, hst⟩
313+
refine ⟨t, htc, hst.trans fun x hx => ?_⟩
314+
rcases mem_closure_iff.1 hx ε ε0 with ⟨y, hyt, hxy⟩
315+
exact mem_iUnion₂.2 ⟨y, hyt, mem_closedBall.2 hxy.le⟩
316+
exact subset_countable_closure_of_almost_dense_set _ this
317+
318+
/-- If a set `s` is separable, then the corresponding subtype is separable in a (pseudo extended)
319+
metric space. This is not obvious, as the countable set whose closure covers `s` does not need in
320+
general to be contained in `s`. -/
321+
theorem IsSeparable.separableSpace {s : Set α} (hs : IsSeparable s) :
322+
SeparableSpace s := by
323+
rcases hs.exists_countable_dense_subset with ⟨t, hts, htc, hst⟩
324+
lift t to Set s using hts
325+
refine ⟨⟨t, countable_of_injective_of_countable_image Subtype.coe_injective.injOn htc, ?_⟩⟩
326+
rwa [IsInducing.subtypeVal.dense_iff, Subtype.forall]
327+
328+
end Compact
329+
330+
end TopologicalSpace

Mathlib/Topology/EMetricSpace/Defs.lean

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Jeremy Avigad, Robert Y. Lewis, Johannes Hölzl, Mario Carneiro, Sébastien Gouëzel
55
-/
66
import Mathlib.Data.ENNReal.Inv
7-
import Mathlib.Topology.Bases
87
import Mathlib.Topology.UniformSpace.Basic
98
import Mathlib.Topology.UniformSpace.OfFun
109

@@ -535,30 +534,6 @@ theorem subset_countable_closure_of_almost_dense_set (s : Set α)
535534
edist x (f n⁻¹ y) ≤ (n : ℝ≥0∞)⁻¹ * 2 := hf _ _ ⟨hyx, hx⟩
536535
_ < ε := ENNReal.mul_lt_of_lt_div hn
537536

538-
open TopologicalSpace in
539-
/-- If a set `s` is separable in a (pseudo extended) metric space, then it admits a countable dense
540-
subset. This is not obvious, as the countable set whose closure covers `s` given by the definition
541-
of separability does not need in general to be contained in `s`. -/
542-
theorem _root_.TopologicalSpace.IsSeparable.exists_countable_dense_subset
543-
{s : Set α} (hs : IsSeparable s) : ∃ t, t ⊆ s ∧ t.Countable ∧ s ⊆ closure t := by
544-
have : ∀ ε > 0, ∃ t : Set α, t.Countable ∧ s ⊆ ⋃ x ∈ t, closedBall x ε := fun ε ε0 => by
545-
rcases hs with ⟨t, htc, hst⟩
546-
refine ⟨t, htc, hst.trans fun x hx => ?_⟩
547-
rcases mem_closure_iff.1 hx ε ε0 with ⟨y, hyt, hxy⟩
548-
exact mem_iUnion₂.2 ⟨y, hyt, mem_closedBall.2 hxy.le⟩
549-
exact subset_countable_closure_of_almost_dense_set _ this
550-
551-
open TopologicalSpace in
552-
/-- If a set `s` is separable, then the corresponding subtype is separable in a (pseudo extended)
553-
metric space. This is not obvious, as the countable set whose closure covers `s` does not need in
554-
general to be contained in `s`. -/
555-
theorem _root_.TopologicalSpace.IsSeparable.separableSpace {s : Set α} (hs : IsSeparable s) :
556-
SeparableSpace s := by
557-
rcases hs.exists_countable_dense_subset with ⟨t, hts, htc, hst⟩
558-
lift t to Set s using hts
559-
refine ⟨⟨t, countable_of_injective_of_countable_image Subtype.coe_injective.injOn htc, ?_⟩⟩
560-
rwa [IsInducing.subtypeVal.dense_iff, Subtype.forall]
561-
562537
end Compact
563538

564539
end EMetric

Mathlib/Topology/MetricSpace/Pseudo/Basic.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,9 @@ theorem finite_cover_balls_of_compact {α : Type u} [PseudoMetricSpace α] {s :
270270
alias IsCompact.finite_cover_balls := finite_cover_balls_of_compact
271271

272272
end Compact
273+
274+
/-- If a map is continuous on a separable set `s`, then the image of `s` is also separable. -/
275+
theorem ContinuousOn.isSeparable_image [TopologicalSpace β] {f : α → β} {s : Set α}
276+
(hf : ContinuousOn f s) (hs : IsSeparable s) : IsSeparable (f '' s) := by
277+
rw [image_eq_range, ← image_univ]
278+
exact (isSeparable_univ_iff.2 hs.separableSpace).image hf.restrict

Mathlib/Topology/MetricSpace/Pseudo/Defs.lean

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,12 +1141,6 @@ theorem dense_iff_iUnion_ball (s : Set α) : Dense s ↔ ∀ r > 0, ⋃ c ∈ s,
11411141
theorem denseRange_iff {f : β → α} : DenseRange f ↔ ∀ x, ∀ r > 0, ∃ y, dist x (f y) < r :=
11421142
forall_congr' fun x => by simp only [mem_closure_iff, exists_range_iff]
11431143

1144-
/-- If a map is continuous on a separable set `s`, then the image of `s` is also separable. -/
1145-
theorem _root_.ContinuousOn.isSeparable_image [TopologicalSpace β] {f : α → β} {s : Set α}
1146-
(hf : ContinuousOn f s) (hs : IsSeparable s) : IsSeparable (f '' s) := by
1147-
rw [image_eq_range, ← image_univ]
1148-
exact (isSeparable_univ_iff.2 hs.separableSpace).image hf.restrict
1149-
11501144
end Metric
11511145

11521146
instance : PseudoMetricSpace (Additive α) := ‹_›

0 commit comments

Comments
 (0)