-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[Merged by Bors] - feat(Topology/Compactness/CompactSystem): introduce compact Systems #36013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
pfaffelh
wants to merge
22
commits into
leanprover-community:master
from
pfaffelh:pfaffelh_compactSystem10
Closed
Changes from 12 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
adf4050
run mk_all
pfaffelh c5c0f32
Merge remote-tracking branch 'upstream/master'
pfaffelh 3fffde0
like pfaffelh_compactSystem but in the module system
pfaffelh aea7a85
update one lemma
pfaffelh 00181ac
update one lemma2
pfaffelh b95c809
Merge branch 'master' into pfaffelh_compactSystem10
RemyDegenne 47ab101
golf; revert an import
RemyDegenne 4ee793d
golf
RemyDegenne e778b5e
move and golf
RemyDegenne c4c2236
golf
RemyDegenne a2feb8f
follow in-person review: switch to sets of sets
RemyDegenne 41caa5a
extract lemmas
RemyDegenne 1111522
Apply suggestions from code review
RemyDegenne c109d6c
fix
RemyDegenne 37cd152
review
RemyDegenne 9286ee2
names
RemyDegenne 7eee760
review
RemyDegenne 0161fd7
add accumulate versions
RemyDegenne 8269323
flip iff
RemyDegenne a1c9178
Merge branch 'master' into pfaffelh_compactSystem10
RemyDegenne a17c917
add accumulate lemma
RemyDegenne e7ba393
Update Mathlib/Topology/Compactness/CompactSystem.lean
RemyDegenne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,199 @@ | ||
| /- | ||
| Copyright (c) 2025 Peter Pfaffelhuber. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Rémy Degenne, Peter Pfaffelhuber | ||
| -/ | ||
| module | ||
|
|
||
| public import Mathlib.MeasureTheory.PiSystem | ||
| public import Mathlib.Topology.Separation.Hausdorff | ||
|
|
||
| /-! | ||
| # Compact systems | ||
|
|
||
| This file defines compact systems of sets. | ||
|
|
||
| ## Main definitions | ||
|
|
||
| * `IsCompactSystem`: A set of sets is a compact system if, whenever a countable subfamily has empty | ||
| intersection, then finitely many of them already have empty intersection. | ||
|
|
||
| ## Main results | ||
|
|
||
| * `isCompactSystem_insert_univ_iff`: A set system is a compact system iff inserting `univ` | ||
| gives a compact system. | ||
| * `isCompactSystem_isCompact_isClosed`: The set of closed and compact sets is a compact system. | ||
| * `isCompactSystem_isCompact`: In a `T2Space`, the set of compact sets is a compact system. | ||
| -/ | ||
|
|
||
| @[expose] public section | ||
|
|
||
| open Set Finset Nat | ||
|
|
||
| variable {α : Type*} {S : Set (Set α)} {C : ℕ → Set α} | ||
|
|
||
| section definition | ||
|
|
||
| /-- A set of sets is a compact system if, whenever a countable subfamily has empty intersection, | ||
| then finitely many of them already have empty intersection. -/ | ||
| def IsCompactSystem (S : Set (Set α)) : Prop := | ||
| ∀ C : ℕ → Set α, (∀ i, C i ∈ S) → ⋂ i, C i = ∅ → ∃ (n : ℕ), dissipate C n = ∅ | ||
|
|
||
| end definition | ||
|
|
||
| namespace IsCompactSystem | ||
|
|
||
| lemma of_nonempty_iInter | ||
| (h : ∀ C : ℕ → Set α, (∀ i, C i ∈ S) → (∀ n, (dissipate C n).Nonempty) → (⋂ i, C i).Nonempty) : | ||
| IsCompactSystem S := by | ||
| intro C hC | ||
| contrapose! | ||
| exact h C hC | ||
|
|
||
| lemma nonempty_iInter (hp : IsCompactSystem S) {C : ℕ → Set α} (hC : ∀ i, C i ∈ S) | ||
| (h_nonempty : ∀ n, (dissipate C n).Nonempty) : | ||
| (⋂ i, C i).Nonempty := by | ||
| revert h_nonempty | ||
| contrapose! | ||
| exact hp C hC | ||
|
|
||
| theorem iff_nonempty_iInter (S : Set (Set α)) : | ||
| IsCompactSystem S ↔ | ||
| ∀ C : ℕ → Set α, (∀ i, C i ∈ S) → (∀ n, (dissipate C n).Nonempty) → (⋂ i, C i).Nonempty := | ||
| ⟨nonempty_iInter, of_nonempty_iInter⟩ | ||
|
|
||
| @[simp] | ||
| lemma of_IsEmpty [IsEmpty α] (S : Set (Set α)) : IsCompactSystem S := | ||
| fun s _ _ ↦ ⟨0, Set.eq_empty_of_isEmpty (dissipate s 0)⟩ | ||
|
|
||
| /-- Any subset of a compact system is a compact system. -/ | ||
| theorem mono {C D : Set (Set α)} (hD : IsCompactSystem D) (hCD : ∀ s, s ∈ C → s ∈ D) : | ||
| IsCompactSystem C := fun s hC hs ↦ hD s (fun i ↦ hCD (s i) (hC i)) hs | ||
|
EtienneC30 marked this conversation as resolved.
Outdated
|
||
|
|
||
| /-- Inserting `∅` into a compact system gives a compact system. -/ | ||
| lemma insert_empty (h : IsCompactSystem S) : IsCompactSystem (insert ∅ S) := by | ||
| intro s h' hd | ||
| by_cases g : ∃ n, s n = ∅ | ||
| · use g.choose | ||
| rw [← subset_empty_iff] at hd ⊢ | ||
| exact (dissipate_subset le_rfl).trans g.choose_spec.le | ||
| · push_neg at g | ||
| refine h s (fun i ↦ ?_) hd | ||
| specialize g i | ||
| specialize h' i | ||
| rw [Set.nonempty_iff_ne_empty] at g | ||
| simpa [g] using h' | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
|
||
|
|
||
| /-- Inserting `univ` into a compact system gives a compact system. -/ | ||
| lemma insert_univ (h : IsCompactSystem S) : IsCompactSystem (insert univ S) := by | ||
| rcases isEmpty_or_nonempty α with hα | _ | ||
| · simp | ||
| rw [IsCompactSystem.iff_nonempty_iInter] at h ⊢ | ||
| intro s h' hd | ||
| by_cases h₀ : ∀ n, s n ∉ S | ||
| · simp only [mem_insert_iff, h₀, or_false] at h' | ||
| simp [h'] | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
|
||
| push_neg at h₀ | ||
| classical | ||
| let n := Nat.find h₀ | ||
| let s' := fun i ↦ if s i ∈ S then s i else s n | ||
| have h₁ : ∀ i, s' i ∈ S := by simp [s']; grind | ||
| have h₂ : ⋂ i, s i = ⋂ i, s' i := by ext; simp; grind | ||
| apply h₂ ▸ h s' h₁ | ||
| by_contra! h_exists_empty | ||
| obtain ⟨j, hj⟩ := h_exists_empty | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
|
||
| have h₃ (v : ℕ) (hv : n ≤ v) : dissipate s v = dissipate s' v:= by ext; simp; grind | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
|
||
| have h₇ : dissipate s' (max j n) = ∅ := by | ||
| rw [← subset_empty_iff] at hj ⊢ | ||
| exact (antitone_dissipate (Nat.le_max_left j n)).trans hj | ||
| specialize h₃ (max j n) (Nat.le_max_right j n) | ||
| specialize hd (max j n) | ||
| simp [h₃, h₇] at hd | ||
|
|
||
| end IsCompactSystem | ||
|
|
||
| /-- In this equivalent formulation for a compact system, | ||
| note that we use `⋂ k < n, C k` rather than `⋂ k ≤ n, C k`. -/ | ||
| lemma isCompactSystem_iff_nonempty_iInter_of_lt (S : Set (Set α)) : | ||
| IsCompactSystem S ↔ | ||
| ∀ C : ℕ → Set α, (∀ i, C i ∈ S) → (∀ n, (⋂ k < n, C k).Nonempty) → (⋂ i, C i).Nonempty := by | ||
| simp_rw [IsCompactSystem.iff_nonempty_iInter] | ||
| refine ⟨fun h C hi h'↦ h C hi (fun n ↦ dissipate_eq_iInter_lt ▸ (h' (n + 1))), | ||
| fun h C hi h' ↦ h C hi ?_⟩ | ||
| simp_rw [Set.nonempty_iff_ne_empty] at h' ⊢ | ||
| refine fun n g ↦ h' n ?_ | ||
| simp_rw [← subset_empty_iff, dissipate] at g ⊢ | ||
| exact le_trans (fun x ↦ by simp; grind) g | ||
|
|
||
| /-- A set system is a compact system iff adding `∅` gives a compact system. -/ | ||
| lemma isCompactSystem_insert_empty_iff : | ||
|
RemyDegenne marked this conversation as resolved.
|
||
| IsCompactSystem (insert ∅ S) ↔ IsCompactSystem S := | ||
| ⟨fun h ↦ h.mono (fun _ hs ↦ Set.mem_insert_of_mem ∅ hs), fun h ↦ h.insert_empty⟩ | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
RemyDegenne marked this conversation as resolved.
Outdated
|
||
|
|
||
| /-- A set system is a compact system iff adding `univ` gives a compact system. -/ | ||
| lemma isCompactSystem_insert_univ_iff : IsCompactSystem (insert univ S) ↔ IsCompactSystem S := | ||
| ⟨fun h ↦ h.mono (fun _ hs ↦ Set.mem_insert_of_mem univ hs), fun h ↦ h.insert_univ⟩ | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
|
||
|
|
||
| theorem isCompactSystem_iff_directed (hpi : IsPiSystem S) : | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
|
||
| IsCompactSystem S ↔ | ||
| ∀ (C : ℕ → Set α), (Directed (fun x1 x2 ↦ x1 ⊇ x2) C) → (∀ i, C i ∈ S) → ⋂ i, C i = ∅ → | ||
| ∃ n, C n = ∅ := by | ||
| rw [← isCompactSystem_insert_empty_iff] | ||
| refine ⟨fun h ↦ fun C hdi hi ↦ ?_, fun h C h1 h2 ↦ ?_⟩ | ||
| · rw [exists_dissipate_eq_empty_iff_of_directed C hdi] | ||
| exact h C (by simp [hi]) | ||
| · have hpi' : IsPiSystem (insert ∅ S) := hpi.insert_empty | ||
| rw [← biInter_le_eq_iInter] at h2 | ||
| obtain h' := h (dissipate C) directed_dissipate | ||
| have h₀ (h₀ : ∀ n, dissipate C n ∈ S ∨ dissipate C n = ∅) (h₁ : ⋂ n, dissipate C n = ∅) : | ||
| ∃ n, dissipate C n = ∅ := by | ||
| by_cases! f : ∀ n, dissipate C n ∈ S | ||
| · apply h' f h₁ | ||
| · obtain ⟨n, hn⟩ := f | ||
| exact ⟨n, by simpa [hn] using h₀ n⟩ | ||
| obtain h'' := IsPiSystem.dissipate_mem hpi' h1 | ||
| have h₁ : ∀ n, dissipate C n ∈ S ∨ dissipate C n = ∅ := by | ||
| intro n | ||
| by_cases g : (dissipate C n).Nonempty | ||
| · simpa [or_comm] using h'' n g | ||
| · exact .inr (Set.not_nonempty_iff_eq_empty.mp g) | ||
| apply h₀ h₁ h2 | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
|
||
|
|
||
| theorem isCompactSystem_iff_directed' (hpi : IsPiSystem S) : | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
|
||
| IsCompactSystem S ↔ | ||
| ∀ (C : ℕ → Set α), (Directed (fun x1 x2 ↦ x1 ⊇ x2) C) → (∀ i, C i ∈ S) → (∀ n, (C n).Nonempty) → | ||
| (⋂ i, C i).Nonempty := by | ||
| rw [isCompactSystem_iff_directed hpi] | ||
| refine ⟨fun h1 C h3 h4 ↦ ?_, fun h1 C h3 s ↦ ?_⟩ <;> rw [← not_imp_not] <;> push_neg | ||
| · exact h1 C h3 h4 | ||
| · exact h1 C h3 s | ||
|
|
||
| section IsCompactIsClosed | ||
|
|
||
| /-- The set of compact and closed sets is a compact system. -/ | ||
| theorem isCompactSystem_isCompact_isClosed (α : Type*) [TopologicalSpace α] : | ||
| IsCompactSystem {s : Set α | IsCompact s ∧ IsClosed s} := by | ||
| refine IsCompactSystem.of_nonempty_iInter fun C hC_cc h_nonempty ↦ ?_ | ||
| rw [← Set.iInter_dissipate] | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
|
||
| refine IsCompact.nonempty_iInter_of_sequence_nonempty_isCompact_isClosed (Set.dissipate C) | ||
| (fun n ↦ ?_) h_nonempty ?_ (fun n ↦ ?_) | ||
| · exact Set.antitone_dissipate (by lia) | ||
| · simpa using (hC_cc 0).1 | ||
| · induction n with | ||
| | zero => simp only [Set.dissipate_zero_nat]; exact (hC_cc 0).2 | ||
| | succ n hn => | ||
| rw [Set.dissipate_succ] | ||
| exact hn.inter (hC_cc (n + 1)).2 | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
|
||
|
|
||
| /-- In a `T2Space` the set of compact sets is a compact system. -/ | ||
| theorem isCompactSystem_isCompact (α : Type*) [TopologicalSpace α] [T2Space α] : | ||
| IsCompactSystem {s : Set α | IsCompact s} := by | ||
| convert isCompactSystem_isCompact_isClosed α with s | ||
| exact ⟨fun hs ↦ ⟨hs, hs.isClosed⟩, fun hs ↦ hs.1⟩ | ||
|
RemyDegenne marked this conversation as resolved.
Outdated
|
||
|
|
||
| /-- The set of sets which are either compact and closed, or `univ`, is a compact system. -/ | ||
| theorem isCompactSystem_insert_univ_isCompact_isClosed (α : Type*) [TopologicalSpace α] : | ||
| IsCompactSystem (insert univ {s : Set α | IsCompact s ∧ IsClosed s}) := | ||
| (isCompactSystem_isCompact_isClosed α).insert_univ | ||
|
|
||
| end IsCompactIsClosed | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.