Skip to content

Commit 4b7053e

Browse files
pfaffelhRemyDegenne
andcommitted
feat(Topology/Compactness/CompactSystem): introduce compact Systems (#36013)
A compact system is a set systems with the property that, whenever a countable intersections of sets in the set system is empty, there is a finite subset of sets with empty intersection. These are needed e.g. in measure theory if one wants to show sigma-additivity of a set function on a ring. Main result: The set of sets which are either compact and closed, or univ, is a compact system. Co-authored-by: Rémy Degenne [remydegenne@gmail.com](mailto:remydegenne@gmail.com) Co-authored-by: pfaffelh <p.p@stochastik.uni-freiburg.de> Co-authored-by: Remy Degenne <remydegenne@gmail.com> Co-authored-by: Rémy Degenne <remydegenne@gmail.com>
1 parent 795d98b commit 4b7053e

5 files changed

Lines changed: 250 additions & 0 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7348,6 +7348,7 @@ public import Mathlib.Topology.Compactification.OnePoint.Sphere
73487348
public import Mathlib.Topology.Compactification.StoneCech
73497349
public import Mathlib.Topology.Compactness.Bases
73507350
public import Mathlib.Topology.Compactness.Compact
7351+
public import Mathlib.Topology.Compactness.CompactSystem
73517352
public import Mathlib.Topology.Compactness.CompactlyCoherentSpace
73527353
public import Mathlib.Topology.Compactness.CompactlyGeneratedSpace
73537354
public import Mathlib.Topology.Compactness.DeltaGeneratedSpace

Mathlib/Data/Set/Accumulate.lean

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def accumulate [LE α] (s : α → Set β) (x : α) : Set β :=
3535
theorem accumulate_def [LE α] {x : α} : accumulate s x = ⋃ y ≤ x, s y :=
3636
rfl
3737

38+
theorem accumulate_eq_biInter_lt {s : ℕ → Set β} {n : ℕ} : accumulate s n = ⋃ k < n + 1, s k := by
39+
simp_rw [Nat.lt_add_one_iff, accumulate]
40+
3841
@[simp]
3942
theorem mem_accumulate [LE α] {x : α} {z : β} : z ∈ accumulate s x ↔ ∃ y ≤ x, z ∈ s y := by
4043
simp_rw [accumulate_def, mem_iUnion₂, exists_prop]
@@ -82,6 +85,7 @@ theorem disjoint_accumulate [Preorder α] (hs : Pairwise (Disjoint on s)) {i j :
8285
rcases hx with ⟨k, hk, hx⟩
8386
exact disjoint_left.1 (hs (hk.trans_lt hij).ne) hx
8487

88+
@[simp]
8589
theorem accumulate_succ (u : ℕ → Set α) (n : ℕ) :
8690
accumulate u (n + 1) = accumulate u n ∪ u (n + 1) := biUnion_le_succ u n
8791

@@ -90,4 +94,28 @@ lemma partialSups_eq_accumulate (f : ℕ → Set α) :
9094
ext n
9195
simp [partialSups_eq_sup_range, accumulate, Nat.lt_succ_iff]
9296

97+
/-- For a directed set of sets `s : ℕ → Set α` and `n : ℕ`, there exists `m : ℕ` (maybe
98+
larger than `n`) such that `accumulate s n ⊆ s m`. -/
99+
lemma exists_subset_accumulate_of_directed {s : ℕ → Set α}
100+
(hd : Directed (· ⊆ ·) s) (n : ℕ) : ∃ m, accumulate s n ⊆ s m := by
101+
induction n with
102+
| zero => use 0; simp [accumulate_def]
103+
| succ n hn =>
104+
obtain ⟨m, hm⟩ := hn
105+
obtain ⟨k, hk⟩ := hd m (n + 1)
106+
simp at hk
107+
exact ⟨k, by simp; grind⟩
108+
109+
lemma directed_accumulate {s : ℕ → Set α} : Directed (· ⊆ ·) (accumulate s) :=
110+
monotone_accumulate.directed_le
111+
112+
lemma exists_accumulate_eq_univ_iff_of_directed {s : ℕ → Set α} (hd : Directed (· ⊆ ·) s) :
113+
(∃ n, accumulate s n = univ) ↔ ∃ n, s n = univ := by
114+
refine ⟨?_, fun ⟨n, hn⟩ ↦ ⟨n,
115+
subset_antisymm (subset_univ _) (hn.symm.le.trans subset_accumulate)⟩⟩
116+
contrapose!
117+
intro h n
118+
obtain ⟨m, hm⟩ := exists_subset_accumulate_of_directed hd n
119+
grind
120+
93121
end Set

Mathlib/Data/Set/Dissipate.lean

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ def dissipate [LE α] (s : α → Set β) (x : α) : Set β :=
2828

2929
theorem dissipate_def [LE α] {x : α} : dissipate s x = ⋂ y ≤ x, s y := rfl
3030

31+
theorem dissipate_eq_biInter_lt {s : ℕ → Set β} {n : ℕ} : dissipate s n = ⋂ k < n + 1, s k := by
32+
simp_rw [Nat.lt_add_one_iff, dissipate]
33+
3134
@[simp]
3235
theorem mem_dissipate [LE α] {x : α} {z : β} : z ∈ dissipate s x ↔ ∀ y ≤ x, z ∈ s y := by
3336
simp [dissipate_def]
@@ -80,4 +83,26 @@ theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) :
8083
simp_all only [dissipate_def, mem_iInter, mem_inter_iff]
8184
grind
8285

86+
/-- For a directed set of sets `s : ℕ → Set α` and `n : ℕ`, there exists `m : ℕ` (maybe
87+
larger than `n`) such that `s m ⊆ dissipate s n`. -/
88+
lemma exists_subset_dissipate_of_directed {s : ℕ → Set α}
89+
(hd : Directed (· ⊇ ·) s) (n : ℕ) : ∃ m, s m ⊆ dissipate s n := by
90+
induction n with
91+
| zero => use 0; simp [dissipate_def]
92+
| succ n hn =>
93+
obtain ⟨m, hm⟩ := hn
94+
obtain ⟨k, hk⟩ := hd m (n + 1)
95+
exact ⟨k, by simp; grind⟩
96+
97+
lemma directed_dissipate {s : ℕ → Set α} : Directed (· ⊇ ·) (dissipate s) :=
98+
antitone_dissipate.directed_ge
99+
100+
lemma exists_dissipate_eq_empty_iff_of_directed {s : ℕ → Set α} (hd : Directed (· ⊇ ·) s) :
101+
(∃ n, dissipate s n = ∅) ↔ ∃ n, s n = ∅ := by
102+
refine ⟨?_, fun ⟨n, hn⟩ ↦ ⟨n, subset_eq_empty (dissipate_subset le_rfl) hn⟩⟩
103+
contrapose!
104+
intro h n
105+
obtain ⟨m, hm⟩ := exists_subset_dissipate_of_directed hd n
106+
exact (h m).mono hm
107+
83108
end Set

Mathlib/MeasureTheory/PiSystem.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Johannes Hölzl, Martin Zinkevich, Rémy Degenne
55
-/
66
module
77

8+
public import Mathlib.Data.Set.Dissipate
89
public import Mathlib.Logic.Encodable.Lattice
910
public import Mathlib.MeasureTheory.MeasurableSpace.Defs
1011
public import Mathlib.Order.Disjointed
@@ -107,6 +108,17 @@ theorem IsPiSystem.comap {α β} {S : Set (Set β)} (h_pi : IsPiSystem S) (f :
107108
rw [← Set.preimage_inter] at hst ⊢
108109
exact ⟨s ∩ t, h_pi s hs_mem t ht_mem (nonempty_of_nonempty_preimage hst), rfl⟩
109110

111+
/-- For a `π`-system `C` over `α` and a sequence of sets `s` belonging to `C`,
112+
`dissipate s n` belongs to `C`. -/
113+
lemma IsPiSystem.dissipate_mem {s : ℕ → Set α} {C : Set (Set α)}
114+
(hC : IsPiSystem C) (h : ∀ n, s n ∈ C) (n : ℕ) (h' : (dissipate s n).Nonempty) :
115+
dissipate s n ∈ C := by
116+
induction n with
117+
| zero => simpa using h 0
118+
| succ n hn =>
119+
rw [dissipate_succ] at h' ⊢
120+
exact hC (dissipate s n) (hn h'.left) (s (n + 1)) (h (n + 1)) h'
121+
110122
theorem isPiSystem_iUnion_of_directed_le {α ι} (p : ι → Set (Set α))
111123
(hp_pi : ∀ n, IsPiSystem (p n)) (hp_directed : Directed (· ≤ ·) p) :
112124
IsPiSystem (⋃ n, p n) := by
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
/-
2+
Copyright (c) 2025 Peter Pfaffelhuber. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Rémy Degenne, Peter Pfaffelhuber
5+
-/
6+
module
7+
8+
public import Mathlib.MeasureTheory.PiSystem
9+
public import Mathlib.Topology.Separation.Hausdorff
10+
11+
/-!
12+
# Compact systems
13+
14+
This file defines compact systems of sets.
15+
16+
## Main definitions
17+
18+
* `IsCompactSystem`: A set of sets is a compact system if, whenever a countable subfamily has empty
19+
intersection, then finitely many of them already have empty intersection.
20+
21+
## Main results
22+
23+
* `isCompactSystem_insert_univ_iff`: A set system is a compact system iff inserting `univ`
24+
gives a compact system.
25+
* `isCompactSystem_isCompact_isClosed`: The set of closed and compact sets is a compact system.
26+
* `isCompactSystem_isCompact`: In a `T2Space`, the set of compact sets is a compact system.
27+
-/
28+
29+
@[expose] public section
30+
31+
open Set Finset Nat
32+
33+
variable {α : Type*} {S : Set (Set α)} {C : ℕ → Set α}
34+
35+
section definition
36+
37+
/-- A set of sets is a compact system if, whenever a countable subfamily has empty intersection,
38+
then finitely many of them already have empty intersection. -/
39+
def IsCompactSystem (S : Set (Set α)) : Prop :=
40+
∀ C : ℕ → Set α, (∀ i, C i ∈ S) → ⋂ i, C i = ∅ → ∃ (n : ℕ), dissipate C n = ∅
41+
42+
end definition
43+
44+
namespace IsCompactSystem
45+
46+
lemma of_nonempty_iInter
47+
(h : ∀ C : ℕ → Set α, (∀ i, C i ∈ S) → (∀ n, (dissipate C n).Nonempty) → (⋂ i, C i).Nonempty) :
48+
IsCompactSystem S := by
49+
intro C hC
50+
contrapose!
51+
exact h C hC
52+
53+
lemma nonempty_iInter (hp : IsCompactSystem S) {C : ℕ → Set α} (hC : ∀ i, C i ∈ S)
54+
(h_nonempty : ∀ n, (dissipate C n).Nonempty) :
55+
(⋂ i, C i).Nonempty := by
56+
revert h_nonempty
57+
contrapose!
58+
exact hp C hC
59+
60+
theorem iff_nonempty_iInter (S : Set (Set α)) :
61+
IsCompactSystem S ↔
62+
∀ C : ℕ → Set α, (∀ i, C i ∈ S) → (∀ n, (dissipate C n).Nonempty) → (⋂ i, C i).Nonempty :=
63+
⟨nonempty_iInter, of_nonempty_iInter⟩
64+
65+
@[simp]
66+
lemma of_IsEmpty [IsEmpty α] (S : Set (Set α)) : IsCompactSystem S :=
67+
fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (dissipate s 0)⟩
68+
69+
/-- Any subset of a compact system is a compact system. -/
70+
theorem mono {T : Set (Set α)} (hT : IsCompactSystem T) (hST : S ⊆ T) :
71+
IsCompactSystem S := fun C hC1 hC2 ↦ hT C (fun i ↦ hST (hC1 i)) hC2
72+
73+
/-- Inserting `∅` into a compact system gives a compact system. -/
74+
lemma insert_empty (h : IsCompactSystem S) : IsCompactSystem (insert ∅ S) := by
75+
intro s h' hd
76+
by_cases g : ∃ n, s n = ∅
77+
· use g.choose
78+
rw [← subset_empty_iff] at hd ⊢
79+
exact (dissipate_subset le_rfl).trans g.choose_spec.le
80+
· push_neg at g
81+
exact h s (fun i ↦ (mem_of_mem_insert_of_ne (h' i) (g i).ne_empty)) hd
82+
83+
/-- Inserting `univ` into a compact system gives a compact system. -/
84+
lemma insert_univ (h : IsCompactSystem S) : IsCompactSystem (insert univ S) := by
85+
rcases isEmpty_or_nonempty α with hα | _
86+
· simp
87+
rw [IsCompactSystem.iff_nonempty_iInter] at h ⊢
88+
intro s h' hd
89+
by_cases! h₀ : ∀ n, s n ∉ S
90+
· simp_all
91+
classical
92+
let n := Nat.find h₀
93+
let s' := fun i ↦ if s i ∈ S then s i else s n
94+
have h₁ : ∀ i, s' i ∈ S := by simp [s']; grind
95+
have h₂ : ⋂ i, s i = ⋂ i, s' i := by ext; simp; grind
96+
apply h₂ ▸ h s' h₁
97+
by_contra! ⟨j, hj⟩
98+
have h₃ (v : ℕ) (hv : n ≤ v) : dissipate s v = dissipate s' v := by ext; simp; grind
99+
have h₇ : dissipate s' (max j n) = ∅ := by
100+
rw [← subset_empty_iff] at hj ⊢
101+
exact (antitone_dissipate (Nat.le_max_left j n)).trans hj
102+
specialize h₃ (max j n) (Nat.le_max_right j n)
103+
specialize hd (max j n)
104+
simp [h₃, h₇] at hd
105+
106+
end IsCompactSystem
107+
108+
/-- In this equivalent formulation for a compact system,
109+
note that we use `⋂ k < n, C k` rather than `⋂ k ≤ n, C k`. -/
110+
lemma isCompactSystem_iff_nonempty_iInter_of_lt (S : Set (Set α)) :
111+
IsCompactSystem S ↔
112+
∀ C : ℕ → Set α, (∀ i, C i ∈ S) → (∀ n, (⋂ k < n, C k).Nonempty) → (⋂ i, C i).Nonempty := by
113+
simp_rw [IsCompactSystem.iff_nonempty_iInter]
114+
refine ⟨fun h C hi h'↦ h C hi (fun n ↦ dissipate_eq_biInter_lt ▸ (h' (n + 1))),
115+
fun h C hi h' ↦ h C hi ?_⟩
116+
simp_rw [Set.nonempty_iff_ne_empty] at h' ⊢
117+
refine fun n g ↦ h' n ?_
118+
simp_rw [← subset_empty_iff, dissipate] at g ⊢
119+
exact le_trans (fun x ↦ by simp; grind) g
120+
121+
/-- A set system is a compact system iff adding `∅` gives a compact system. -/
122+
lemma isCompactSystem_insert_empty_iff :
123+
IsCompactSystem (insert ∅ S) ↔ IsCompactSystem S :=
124+
fun h ↦ h.mono (subset_insert _ _), .insert_empty⟩
125+
126+
/-- A set system is a compact system iff adding `univ` gives a compact system. -/
127+
lemma isCompactSystem_insert_univ_iff : IsCompactSystem (insert univ S) ↔ IsCompactSystem S :=
128+
fun h ↦ h.mono (subset_insert _ _), .insert_univ⟩
129+
130+
/-- To prove that a set of sets is a compact system, it suffices to consider directed families of
131+
sets. -/
132+
theorem isCompactSystem_iff_of_directed (hpi : IsPiSystem S) :
133+
IsCompactSystem S ↔
134+
∀ (C : ℕ → Set α), Directed (· ⊇ ·) C → (∀ i, C i ∈ S) → ⋂ i, C i = ∅ → ∃ n, C n = ∅ := by
135+
rw [← isCompactSystem_insert_empty_iff]
136+
refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩
137+
· rw [← exists_dissipate_eq_empty_iff_of_directed hdi]
138+
exact h C (by simp [hi])
139+
rw [← biInter_le_eq_iInter] at h2
140+
suffices (∀ n, dissipate C n ∈ S ∨ dissipate C n = ∅) ∧ (⋂ n, dissipate C n = ∅) by
141+
by_cases! f : ∀ n, dissipate C n ∈ S
142+
· exact h (dissipate C) directed_dissipate f this.2
143+
· obtain ⟨n, hn⟩ := f
144+
exact ⟨n, by simpa [hn] using this.1 n⟩
145+
refine ⟨fun n ↦ ?_, h2⟩
146+
by_cases g : (dissipate C n).Nonempty
147+
· simpa [or_comm] using hpi.insert_empty.dissipate_mem h1 n g
148+
· exact .inr (Set.not_nonempty_iff_eq_empty.mp g)
149+
150+
/-- To prove that a set of sets is a compact system, it suffices to consider directed families of
151+
sets. -/
152+
theorem isCompactSystem_iff_nonempty_iInter_of_directed (hpi : IsPiSystem S) :
153+
IsCompactSystem S ↔
154+
∀ (C : ℕ → Set α), (Directed (· ⊇ ·) C) → (∀ i, C i ∈ S) → (∀ n, (C n).Nonempty) →
155+
(⋂ i, C i).Nonempty := by
156+
rw [isCompactSystem_iff_of_directed hpi]
157+
refine ⟨fun h1 C h3 h4 ↦ ?_, fun h1 C h3 s ↦ ?_⟩ <;> rw [← not_imp_not] <;> push_neg
158+
· exact h1 C h3 h4
159+
· exact h1 C h3 s
160+
161+
section IsCompactIsClosed
162+
163+
/-- The set of compact and closed sets is a compact system. -/
164+
theorem isCompactSystem_isCompact_isClosed (α : Type*) [TopologicalSpace α] :
165+
IsCompactSystem {s : Set α | IsCompact s ∧ IsClosed s} := by
166+
refine IsCompactSystem.of_nonempty_iInter fun C hC_cc h_nonempty ↦ ?_
167+
rw [← iInter_dissipate]
168+
refine IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed (Set.dissipate C)
169+
(fun n ↦ ?_) h_nonempty ?_ (fun n ↦ isClosed_biInter (fun i _ ↦ (hC_cc i).2))
170+
· exact Set.antitone_dissipate (by lia)
171+
· simpa using (hC_cc 0).1
172+
173+
/-- In a `T2Space` the set of compact sets is a compact system. -/
174+
theorem isCompactSystem_isCompact (α : Type*) [TopologicalSpace α] [T2Space α] :
175+
IsCompactSystem {s : Set α | IsCompact s} := by
176+
convert isCompactSystem_isCompact_isClosed α with s
177+
simpa using IsCompact.isClosed
178+
179+
/-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/
180+
theorem isCompactSystem_insert_univ_isCompact_isClosed (α : Type*) [TopologicalSpace α] :
181+
IsCompactSystem (insert univ {s : Set α | IsCompact s ∧ IsClosed s}) :=
182+
(isCompactSystem_isCompact_isClosed α).insert_univ
183+
184+
end IsCompactIsClosed

0 commit comments

Comments
 (0)