Skip to content

Commit 1da1e9e

Browse files
committed
feat: minor topological improvements (#9908)
* Prove that a set is a Gdelta if and only if it is an intersection of open sets indexed by `ℕ`. * Cleanup porting todos in the Gdelta file * Rename `cluster_point_of_compact` to `exists_clusterPt_of_compactSpace ` * Generalize the class `T2Space` to `T2OrLocallyCompactRegularSpace` in the file `Support.lean`
1 parent 4e0ccc0 commit 1da1e9e

File tree

5 files changed

+48
-16
lines changed

5 files changed

+48
-16
lines changed

Mathlib/Data/ENNReal/Operations.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,10 @@ theorem mul_sub (h : 0 < c → c < b → a ≠ ∞) : a * (b - c) = a * b - a *
472472
exact sub_mul h
473473
#align ennreal.mul_sub ENNReal.mul_sub
474474

475+
theorem sub_le_sub_iff_left (h : c ≤ a) (h' : a ≠ ∞) :
476+
(a - b ≤ a - c) ↔ c ≤ b :=
477+
(cancel_of_ne h').tsub_le_tsub_iff_left (cancel_of_ne (ne_top_of_le_ne_top h' h)) h
478+
475479
end Sub
476480

477481
section Sum

Mathlib/Topology/Compactness/Compact.lean

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ def IsCompact (s : Set X) :=
4343
∀ ⦃f⦄ [NeBot f], f ≤ 𝓟 s → ∃ x ∈ s, ClusterPt x f
4444
#align is_compact IsCompact
4545

46+
lemma IsCompact.exists_clusterPt (hs : IsCompact s) {f : Filter X} [NeBot f] (hf : f ≤ 𝓟 s) :
47+
∃ x ∈ s, ClusterPt x f := hs hf
48+
49+
lemma IsCompact.exists_mapClusterPt {ι : Type*} (hs : IsCompact s) {f : Filter ι} [NeBot f]
50+
{u : ι → X} (hf : Filter.map u f ≤ 𝓟 s) :
51+
∃ x ∈ s, MapClusterPt x f u := hs hf
52+
4653
/-- The complement to a compact set belongs to a filter `f` if it belongs to each filter
4754
`𝓝 x ⊓ f`, `x ∈ s`. -/
4855
theorem IsCompact.compl_mem_sets (hs : IsCompact s) {f : Filter X} (hf : ∀ x ∈ s, sᶜ ∈ 𝓝 x ⊓ f) :
@@ -708,9 +715,13 @@ theorem isCompact_univ [h : CompactSpace X] : IsCompact (univ : Set X) :=
708715
h.isCompact_univ
709716
#align is_compact_univ isCompact_univ
710717

711-
theorem cluster_point_of_compact [CompactSpace X] (f : Filter X) [NeBot f] : ∃ x, ClusterPt x f :=
718+
theorem exists_clusterPt_of_compactSpace [CompactSpace X] (f : Filter X) [NeBot f] :
719+
∃ x, ClusterPt x f :=
712720
by simpa using isCompact_univ (show f ≤ 𝓟 univ by simp)
713-
#align cluster_point_of_compact cluster_point_of_compact
721+
#align cluster_point_of_compact exists_clusterPt_of_compactSpace
722+
723+
@[deprecated] -- Since 28 January 2024
724+
alias cluster_point_of_compact := exists_clusterPt_of_compactSpace
714725

715726
nonrec theorem Ultrafilter.le_nhds_lim [CompactSpace X] (F : Ultrafilter X) : ↑F ≤ 𝓝 F.lim := by
716727
rcases isCompact_univ.ultrafilter_le_nhds F (by simp) with ⟨x, -, h⟩

Mathlib/Topology/GDelta.lean

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ Gδ set, residual set, nowhere dense set, meagre set
4545
noncomputable section
4646

4747
open Topology TopologicalSpace Filter Encodable Set
48+
open scoped Uniformity
4849

49-
variable {X Y ι : Type*}
50+
variable {X Y ι : Type*} {ι' : Sort*}
5051

5152
set_option linter.uppercaseLean3 false
5253

@@ -79,19 +80,28 @@ theorem isGδ_biInter_of_isOpen {I : Set ι} (hI : I.Countable) {f : ι → Set
7980
⟨f '' I, by rwa [ball_image_iff], hI.image _, by rw [sInter_image]⟩
8081
#align is_Gδ_bInter_of_open isGδ_biInter_of_isOpen
8182

82-
-- porting note: TODO: generalize to `Sort*` + `Countable _`
83-
theorem isGδ_iInter_of_isOpen [Encodable ι] {f : ι → Set X} (hf : ∀ i, IsOpen (f i)) :
83+
theorem isGδ_iInter_of_isOpen [Countable ι'] {f : ι' → Set X} (hf : ∀ i, IsOpen (f i)) :
8484
IsGδ (⋂ i, f i) :=
8585
⟨range f, by rwa [forall_range_iff], countable_range _, by rw [sInter_range]⟩
8686
#align is_Gδ_Inter_of_open isGδ_iInter_of_isOpen
8787

88-
-- porting note: TODO: generalize to `Sort*` + `Countable _`
88+
lemma isGδ_iff_eq_iInter_nat {s : Set X} :
89+
IsGδ s ↔ ∃ (f : ℕ → Set X), (∀ n, IsOpen (f n)) ∧ s = ⋂ n, f n := by
90+
refine ⟨?_, ?_⟩
91+
· rintro ⟨T, hT, T_count, rfl⟩
92+
rcases Set.eq_empty_or_nonempty T with rfl|hT
93+
· exact ⟨fun _n ↦ univ, fun _n ↦ isOpen_univ, by simp⟩
94+
· obtain ⟨f, hf⟩ : ∃ (f : ℕ → Set X), T = range f := Countable.exists_eq_range T_count hT
95+
exact ⟨f, by aesop, by simp [hf]⟩
96+
· rintro ⟨f, hf, rfl⟩
97+
apply isGδ_iInter_of_isOpen hf
98+
8999
/-- The intersection of an encodable family of Gδ sets is a Gδ set. -/
90-
theorem isGδ_iInter [Encodable ι] {s : ι → Set X} (hs : ∀ i, IsGδ (s i)) : IsGδ (⋂ i, s i) := by
100+
theorem isGδ_iInter [Countable ι'] {s : ι' → Set X} (hs : ∀ i, IsGδ (s i)) : IsGδ (⋂ i, s i) := by
91101
choose T hTo hTc hTs using hs
92102
obtain rfl : s = fun i => ⋂₀ T i := funext hTs
93103
refine' ⟨⋃ i, T i, _, countable_iUnion hTc, (sInter_iUnion _).symm⟩
94-
simpa [@forall_swap ι] using hTo
104+
simpa [@forall_swap ι'] using hTo
95105
#align is_Gδ_Inter isGδ_iInter
96106

97107
theorem isGδ_biInter {s : Set ι} (hs : s.Countable) {t : ∀ i ∈ s, Set X}
@@ -130,8 +140,7 @@ theorem isGδ_biUnion {s : Set ι} (hs : s.Finite) {f : ι → Set X} (h : ∀ i
130140
exact fun _ _ ihs H => H.1.union (ihs H.2)
131141
#align is_Gδ_bUnion isGδ_biUnion
132142

133-
-- Porting note: Did not recognize notation 𝓤 X, needed to replace with uniformity X
134-
theorem IsClosed.isGδ {X} [UniformSpace X] [IsCountablyGenerated (uniformity X)] {s : Set X}
143+
theorem IsClosed.isGδ {X} [UniformSpace X] [IsCountablyGenerated (𝓤 X)] {s : Set X}
135144
(hs : IsClosed s) : IsGδ s := by
136145
rcases (@uniformity_hasBasis_open X _).exists_antitone_subbasis with ⟨U, hUo, hU, -⟩
137146
rw [← hs.closure_eq, ← hU.biInter_biUnion_ball]
@@ -185,7 +194,7 @@ section ContinuousAt
185194
variable [TopologicalSpace X]
186195

187196
/-- The set of points where a function is continuous is a Gδ set. -/
188-
theorem isGδ_setOf_continuousAt [UniformSpace Y] [IsCountablyGenerated (uniformity Y)] (f : X → Y) :
197+
theorem isGδ_setOf_continuousAt [UniformSpace Y] [IsCountablyGenerated (𝓤 Y)] (f : X → Y) :
189198
IsGδ { x | ContinuousAt f x } := by
190199
obtain ⟨U, _, hU⟩ := (@uniformity_hasBasis_open_symmetric Y _).exists_antitone_subbasis
191200
simp only [Uniform.continuousAt_iff_prod, nhds_prod_eq]

Mathlib/Topology/Support.lean

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ theorem hasCompactMulSupport_def : HasCompactMulSupport f ↔ IsCompact (closure
165165
#align has_compact_support_def hasCompactSupport_def
166166

167167
@[to_additive]
168-
theorem exists_compact_iff_hasCompactMulSupport [T2Space α] :
168+
theorem exists_compact_iff_hasCompactMulSupport [T2OrLocallyCompactRegularSpace α] :
169169
(∃ K : Set α, IsCompact K ∧ ∀ x, x ∉ K → f x = 1) ↔ HasCompactMulSupport f := by
170170
simp_rw [← nmem_mulSupport, ← mem_compl_iff, ← subset_def, compl_subset_compl,
171171
hasCompactMulSupport_def, exists_compact_superset_iff]
@@ -174,7 +174,7 @@ theorem exists_compact_iff_hasCompactMulSupport [T2Space α] :
174174

175175
namespace HasCompactMulSupport
176176
@[to_additive]
177-
theorem intro [T2Space α] {K : Set α} (hK : IsCompact K)
177+
theorem intro [T2OrLocallyCompactRegularSpace α] {K : Set α} (hK : IsCompact K)
178178
(hfK : ∀ x, x ∉ K → f x = 1) : HasCompactMulSupport f :=
179179
exists_compact_iff_hasCompactMulSupport.mp ⟨K, hK, hfK⟩
180180
#align has_compact_mul_support.intro HasCompactMulSupport.intro
@@ -189,8 +189,8 @@ theorem intro' {K : Set α} (hK : IsCompact K) (h'K : IsClosed K)
189189
exact IsCompact.of_isClosed_subset hK ( isClosed_mulTSupport f) this
190190

191191
@[to_additive]
192-
theorem of_mulSupport_subset_isCompact [T2Space α] {K : Set α}
193-
(hK : IsCompact K) (h : mulSupport f ⊆ K) : HasCompactMulSupport f :=
192+
theorem of_mulSupport_subset_isCompact [T2OrLocallyCompactRegularSpace α]
193+
{K : Set α} (hK : IsCompact K) (h : mulSupport f ⊆ K) : HasCompactMulSupport f :=
194194
isCompact_closure_of_subset_compact hK h
195195

196196
@[to_additive]
@@ -272,6 +272,14 @@ theorem comp₂_left (hf : HasCompactMulSupport f)
272272
#align has_compact_mul_support.comp₂_left HasCompactMulSupport.comp₂_left
273273
#align has_compact_support.comp₂_left HasCompactSupport.comp₂_left
274274

275+
@[to_additive]
276+
lemma isCompact_preimage [TopologicalSpace β]
277+
(h'f : HasCompactMulSupport f) (hf : Continuous f) {k : Set β} (hk : IsClosed k)
278+
(h'k : 1 ∉ k) : IsCompact (f ⁻¹' k) := by
279+
apply IsCompact.of_isClosed_subset h'f (hk.preimage hf) (fun x hx ↦ ?_)
280+
apply subset_mulTSupport
281+
aesop
282+
275283
variable [T2Space α'] (hf : HasCompactMulSupport f) {g : α → α'} (cont : Continuous g)
276284

277285
@[to_additive]

Mathlib/Topology/UniformSpace/Compact.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def uniformSpaceOfCompactT2 [TopologicalSpace γ] [CompactSpace γ] [T2Space γ]
9494
by_contra H
9595
haveI : NeBot (F ⊓ 𝓟 Vᶜ) := ⟨H⟩
9696
-- Hence compactness would give us a cluster point (x, y) for F ⊓ 𝓟 Vᶜ
97-
obtain ⟨⟨x, y⟩, hxy⟩ : ∃ p : γ × γ, ClusterPt p (F ⊓ 𝓟 Vᶜ) := cluster_point_of_compact _
97+
obtain ⟨⟨x, y⟩, hxy⟩ : ∃ p : γ × γ, ClusterPt p (F ⊓ 𝓟 Vᶜ) := exists_clusterPt_of_compactSpace _
9898
-- In particular (x, y) is a cluster point of 𝓟 Vᶜ, hence is not in the interior of V,
9999
-- and a fortiori not in Δ, so x ≠ y
100100
have clV : ClusterPt (x, y) (𝓟 <| Vᶜ) := hxy.of_inf_right

0 commit comments

Comments
 (0)