Skip to content

Commit 9aa771a

Browse files
committed
feat(Topology/Sets): define the Vietoris topology on (Nonempty)Compacts
This PR defines the Vietoris topology on `Compacts` and `NonemptyCompacts`, and proves that it is induced by the Hausdorff uniformity.
1 parent d4f568d commit 9aa771a

File tree

4 files changed

+143
-24
lines changed

4 files changed

+143
-24
lines changed

Mathlib/Data/Rel.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,9 @@ lemma prod_subset_comm [R.IsSymm] : s₁ ×ˢ s₂ ⊆ R ↔ s₂ ×ˢ s₁ ⊆
459459
rw [← R.inv_eq_self, SetRel.inv, ← Set.image_subset_iff, Set.image_swap_prod, ← SetRel.inv,
460460
R.inv_eq_self]
461461

462+
lemma preimage_eq_image [R.IsSymm] : R.preimage s = R.image s := by
463+
rw [← preimage_inv, inv_eq_self]
464+
462465
variable (R) in
463466
/-- The maximal symmetric relation contained in a given relation. -/
464467
def symmetrize : SetRel α α := R ∩ R.inv

Mathlib/Topology/MetricSpace/Closeds.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,9 @@ namespace NonemptyCompacts
269269
/-- In an emetric space, the type of non-empty compact subsets is an emetric space,
270270
where the edistance is the Hausdorff edistance -/
271271
instance emetricSpace : EMetricSpace (NonemptyCompacts α) where
272-
__ := PseudoEMetricSpace.hausdorff.induced SetLike.coe
272+
/- Since the topology on `NonemptyCompacts` is not defeq to the one induced by the metric, we
273+
replace the uniformity by `NonemptyCompacts.uniformSpace`, which has the right topology. -/
274+
__ := (PseudoEMetricSpace.hausdorff.induced SetLike.coe).replaceUniformity <| by rfl
273275
eq_of_edist_eq_zero {s t} h := NonemptyCompacts.ext <| by
274276
have : closure (s : Set α) = closure t := hausdorffEdist_zero_iff_closure_eq_closure.1 h
275277
rwa [s.isCompact.isClosed.closure_eq, t.isCompact.isClosed.closure_eq] at this

Mathlib/Topology/Sets/Compacts.lean

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ For a topological space `α`,
2222
-/
2323

2424

25-
open Set
25+
open Set Topology
2626

2727
variable {α β γ : Type*} [TopologicalSpace α] [TopologicalSpace β] [TopologicalSpace γ]
2828

@@ -209,6 +209,34 @@ theorem singleton_prod_singleton (x : α) (y : β) :
209209
Compacts.prod {x} {y} = {(x, y)} :=
210210
Compacts.ext Set.singleton_prod_singleton
211211

212+
/-- The Vietoris topology on the compact subsets of a topological space. -/
213+
instance topology : TopologicalSpace (Compacts α) :=
214+
.generateFrom <|
215+
(fun U => {K | (K : Set α) ⊆ U}) '' {U | IsOpen U} ∪
216+
(fun V => {K | ((K : Set α) ∩ V).Nonempty}) '' {V | IsOpen V}
217+
218+
theorem isOpen_subsets_of_isOpen {U : Set α} (h : IsOpen U) :
219+
IsOpen {K : Compacts α | (K : Set α) ⊆ U} :=
220+
isOpen_generateFrom_of_mem <| .inl ⟨U, h, rfl⟩
221+
222+
theorem isOpen_inter_nonempty_of_isOpen {U : Set α} (h : IsOpen U) :
223+
IsOpen {K : Compacts α | ((K : Set α) ∩ U).Nonempty} :=
224+
isOpen_generateFrom_of_mem <| .inr ⟨U, h, rfl⟩
225+
226+
theorem isClosed_subsets_of_isClosed {F : Set α} (h : IsClosed F) :
227+
IsClosed {K : Compacts α | (K : Set α) ⊆ F} := by
228+
simp_rw [← isOpen_compl_iff, Set.compl_setOf, ← Set.inter_compl_nonempty_iff]
229+
exact isOpen_inter_nonempty_of_isOpen h.isOpen_compl
230+
231+
theorem isClosed_inter_nonempty_of_isClosed {F : Set α} (h : IsClosed F) :
232+
IsClosed {K : Compacts α | ((K : Set α) ∩ F).Nonempty} := by
233+
simp_rw +singlePass [← compl_compl F, Set.inter_compl_nonempty_iff, ← Set.compl_setOf]
234+
exact (isOpen_subsets_of_isOpen h.isOpen_compl).isClosed_compl
235+
236+
theorem isClopen_singleton_bot : IsClopen {(⊥ : Compacts α)} := by
237+
simp_rw [← Set.setOf_eq_eq_singleton, ← SetLike.coe_set_eq, coe_bot, ← subset_empty_iff]
238+
exact ⟨isClosed_subsets_of_isClosed isClosed_empty, isOpen_subsets_of_isOpen isOpen_empty⟩
239+
212240
-- todo: add `pi`
213241

214242
end Compacts
@@ -242,6 +270,14 @@ protected theorem nonempty (s : NonemptyCompacts α) : (s : Set α).Nonempty :=
242270
theorem toCompacts_injective : Function.Injective (toCompacts (α := α)) :=
243271
.of_comp (f := SetLike.coe) SetLike.coe_injective
244272

273+
theorem range_toCompacts : Set.range (toCompacts (α := α)) = {⊥}ᶜ := by
274+
ext K
275+
simp_rw [Set.mem_compl_singleton_iff, ← SetLike.coe_set_eq.ne, Compacts.coe_bot,
276+
← Set.nonempty_iff_ne_empty]
277+
refine ⟨?_, fun h => ⟨⟨K, h⟩, rfl⟩⟩
278+
rintro ⟨K, _, rfl⟩
279+
exact K.nonempty
280+
245281
/-- Reinterpret a nonempty compact as a closed set. -/
246282
def toCloseds [T2Space α] (s : NonemptyCompacts α) : Closeds α :=
247283
⟨s, s.isCompact.isClosed⟩
@@ -332,6 +368,53 @@ theorem singleton_prod_singleton (x : α) (y : β) :
332368
NonemptyCompacts.prod {x} {y} = {(x, y)} :=
333369
NonemptyCompacts.ext Set.singleton_prod_singleton
334370

371+
/-- The Vietoris topology on the nonempty compact subsets of a topological space. -/
372+
instance topology : TopologicalSpace (NonemptyCompacts α) :=
373+
TopologicalSpace.generateFrom
374+
((fun U => {K : NonemptyCompacts α | (K : Set α) ⊆ U}) '' {U | IsOpen U} ∪
375+
(fun V => {K : NonemptyCompacts α | ((K : Set α) ∩ V).Nonempty}) '' {V | IsOpen V})
376+
377+
@[fun_prop]
378+
theorem isEmbedding_toCompacts : IsEmbedding (toCompacts (α := α)) where
379+
injective := toCompacts_injective
380+
eq_induced := by
381+
simp_rw [topology, Compacts.topology, induced_generateFrom_eq, image_union, image_image,
382+
preimage_setOf_eq, coe_toCompacts]
383+
384+
@[fun_prop]
385+
theorem continuous_toCompacts : Continuous (toCompacts (α := α)) :=
386+
isEmbedding_toCompacts.continuous
387+
388+
@[fun_prop]
389+
theorem isClosedEmbedding_toCompacts : IsClosedEmbedding (toCompacts (α := α)) where
390+
__ := isEmbedding_toCompacts
391+
isClosed_range := by
392+
rw [range_toCompacts]
393+
exact Compacts.isClopen_singleton_bot.compl.isClosed
394+
395+
@[fun_prop]
396+
theorem isOpenEmbedding_toCompacts : IsOpenEmbedding (toCompacts (α := α)) where
397+
__ := isEmbedding_toCompacts
398+
isOpen_range := by
399+
rw [range_toCompacts]
400+
exact Compacts.isClopen_singleton_bot.compl.isOpen
401+
402+
theorem isOpen_subsets_of_isOpen {U : Set α} (h : IsOpen U) :
403+
IsOpen {K : NonemptyCompacts α | (K : Set α) ⊆ U} :=
404+
(Compacts.isOpen_subsets_of_isOpen h).preimage continuous_toCompacts
405+
406+
theorem isOpen_inter_nonempty_of_isOpen {U : Set α} (h : IsOpen U) :
407+
IsOpen {K : NonemptyCompacts α | ((K : Set α) ∩ U).Nonempty} :=
408+
(Compacts.isOpen_inter_nonempty_of_isOpen h).preimage continuous_toCompacts
409+
410+
theorem isClosed_subsets_of_isClosed {F : Set α} (h : IsClosed F) :
411+
IsClosed {K : NonemptyCompacts α | (K : Set α) ⊆ F} :=
412+
(Compacts.isClosed_subsets_of_isClosed h).preimage continuous_toCompacts
413+
414+
theorem isClosed_inter_nonempty_of_isClosed {F : Set α} (h : IsClosed F) :
415+
IsClosed {K : NonemptyCompacts α | ((K : Set α) ∩ F).Nonempty} :=
416+
(Compacts.isClosed_inter_nonempty_of_isClosed h).preimage continuous_toCompacts
417+
335418
end NonemptyCompacts
336419

337420
/-! ### Positive compact sets -/

Mathlib/Topology/UniformSpace/Closeds.lean

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Attila Gáspár
55
-/
66
import Mathlib.Topology.Sets.Compacts
7+
import Mathlib.Topology.UniformSpace.Compact
78
import Mathlib.Topology.UniformSpace.UniformEmbedding
89

910
/-!
@@ -74,6 +75,18 @@ instance isTrans_hausdorffEntourage (U : SetRel α α) [hU : U.IsTrans] :
7475
(hausdorffEntourage U).IsTrans := by
7576
grw [isTrans_iff_comp_subset_self, ← hausdorffEntourage_comp, comp_subset_self]
7677

78+
theorem TotallyBounded.exists_prodMk_finset_mem_hausdorffEntourage [UniformSpace α]
79+
{s : Set α} (hs : TotallyBounded s) {U : SetRel α α} (hU : U ∈ 𝓤 α) :
80+
∃ t : Finset α, (↑t, s) ∈ hausdorffEntourage U := by
81+
obtain ⟨t, ht₁, ht₂⟩ := hs _ (symm_le_uniformity hU)
82+
lift t to Finset α using ht₁
83+
classical
84+
refine ⟨{x ∈ t | ∃ y ∈ s, (x, y) ∈ U}, ?_⟩
85+
rw [Finset.coe_filter]
86+
refine ⟨fun _ h => h.2, fun x hx => ?_⟩
87+
obtain ⟨y, hy, hxy⟩ := Set.mem_iUnion₂.mp (ht₂ hx)
88+
exact ⟨y, ⟨hy, x, hx, hxy⟩, hxy⟩
89+
7790
end hausdorffEntourage
7891

7992
variable [UniformSpace α]
@@ -154,8 +167,41 @@ end TopologicalSpace.Closeds
154167

155168
namespace TopologicalSpace.Compacts
156169

170+
open UniformSpace in
157171
instance uniformSpace : UniformSpace (Compacts α) :=
158-
.comap SetLike.coe .hausdorff
172+
.replaceTopology (.comap SetLike.coe .hausdorff) <| by
173+
-- We need to show that the Hausdorff uniformity induces the Vietoris topology
174+
refine le_antisymm (le_of_nhds_le_nhds fun K => ?_) ?_
175+
· simp_rw [nhds_eq_comap_uniformity]
176+
change _ ≤ Filter.comap _ (Filter.comap _ (Filter.lift' _ _))
177+
rw [Filter.comap_comap,
178+
uniformity_hasBasis_open.lift' monotone_hausdorffEntourage |>.comap _ |>.ge_iff]
179+
intro U ⟨hU₁, hU₂⟩
180+
simp_rw [Function.comp_id, hausdorffEntourage, Set.preimage_setOf_eq, Function.comp,
181+
Set.setOf_and]
182+
have : U.IsRefl := ⟨fun _ => refl_mem_uniformity hU₁⟩
183+
refine Filter.inter_mem ?_ <| (isOpen_subsets_of_isOpen hU₂.relImage).mem_nhds <|
184+
SetRel.self_subset_image _
185+
obtain ⟨V : SetRel α α, hV₁, hV₂, _, hVU⟩ := comp_open_symm_mem_uniformity_sets hU₁
186+
obtain ⟨s, hs₁, hs₂⟩ :=
187+
K.isCompact.totallyBounded.exists_prodMk_finset_mem_hausdorffEntourage hV₁
188+
dsimp only at hs₁ hs₂
189+
filter_upwards [(Filter.eventually_all_finset s).mpr fun x hx =>
190+
isOpen_inter_nonempty_of_isOpen (isOpen_ball x hV₂) |>.eventually_mem (hs₁ hx)] with L hL
191+
grw [hs₂, ← SetRel.preimage_eq_image, ← hVU, SetRel.preimage_comp]
192+
gcongr
193+
exact hL
194+
· apply le_generateFrom
195+
rintro _ (⟨U, hU, rfl⟩ | ⟨U, hU, rfl⟩)
196+
· simp_rw [isOpen_iff_mem_nhds, UniformSpace.mem_nhds_iff]
197+
intro K hK
198+
obtain ⟨V, hV₁, hV₂⟩ :=
199+
K.isCompact.nhdsSet_basis_uniformity (𝓤 _).basis_sets
200+
|>.mem_iff.mp (hU.mem_nhdsSet.mpr hK)
201+
rw [Set.iUnion₂_subset_iff] at hV₂
202+
exact ⟨_, Filter.preimage_mem_comap (Filter.mem_lift' hV₁),
203+
fun L ⟨_, hL⟩ x hx => (hL hx).elim fun y ⟨hy, hyx⟩ => hV₂ y hy hyx⟩
204+
· exact isOpen_induced (hausdorff.isOpen_inter_nonempty_of_isOpen hU)
159205

160206
theorem uniformity_def :
161207
𝓤 (Compacts α) = .comap (Prod.map (↑) (↑)) ((𝓤 α).lift' hausdorffEntourage) :=
@@ -173,20 +219,17 @@ theorem isUniformEmbedding_coe : IsUniformEmbedding ((↑) : Compacts α → Set
173219
theorem uniformContinuous_coe : UniformContinuous ((↑) : Compacts α → Set α) :=
174220
isUniformEmbedding_coe.uniformContinuous
175221

176-
theorem isOpen_inter_nonempty_of_isOpen {s : Set α} (hs : IsOpen s) :
177-
IsOpen {t : Compacts α | ((t : Set α) ∩ s).Nonempty} :=
178-
isOpen_induced (UniformSpace.hausdorff.isOpen_inter_nonempty_of_isOpen hs)
179-
180-
theorem isClosed_subsets_of_isClosed {s : Set α} (hs : IsClosed s) :
181-
IsClosed {t : Compacts α | (t : Set α) ⊆ s} :=
182-
isClosed_induced (UniformSpace.hausdorff.isClosed_subsets_of_isClosed hs)
183-
184222
end TopologicalSpace.Compacts
185223

186224
namespace TopologicalSpace.NonemptyCompacts
187225

188226
instance uniformSpace : UniformSpace (NonemptyCompacts α) :=
189-
.comap SetLike.coe .hausdorff
227+
.replaceTopology (.comap SetLike.coe .hausdorff) <| by
228+
rw [isEmbedding_toCompacts.eq_induced]
229+
change (Compacts.uniformSpace.comap toCompacts).toTopologicalSpace = _
230+
congr 1
231+
ext1
232+
exact Filter.comap_comap
190233

191234
theorem uniformity_def :
192235
𝓤 (NonemptyCompacts α) = .comap (Prod.map (↑) (↑)) ((𝓤 α).lift' hausdorffEntourage) :=
@@ -227,16 +270,4 @@ theorem isUniformEmbedding_toCompacts : IsUniformEmbedding (toCompacts (α := α
227270
theorem uniformContinuous_toCompacts : UniformContinuous (toCompacts (α := α)) :=
228271
isUniformEmbedding_toCompacts.uniformContinuous
229272

230-
@[fun_prop]
231-
theorem continuous_toCompacts : Continuous (toCompacts (α := α)) :=
232-
uniformContinuous_toCompacts.continuous
233-
234-
theorem isOpen_inter_nonempty_of_isOpen {s : Set α} (hs : IsOpen s) :
235-
IsOpen {t : NonemptyCompacts α | ((t : Set α) ∩ s).Nonempty} :=
236-
isOpen_induced (UniformSpace.hausdorff.isOpen_inter_nonempty_of_isOpen hs)
237-
238-
theorem isClosed_subsets_of_isClosed {s : Set α} (hs : IsClosed s) :
239-
IsClosed {t : NonemptyCompacts α | (t : Set α) ⊆ s} :=
240-
isClosed_induced (UniformSpace.hausdorff.isClosed_subsets_of_isClosed hs)
241-
242273
end TopologicalSpace.NonemptyCompacts

0 commit comments

Comments
 (0)