-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(Topology/Compactness/CompactSystem): introduce compact Systems #25899
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
Changes from 53 commits
49a5f2f
2c67626
e8634b0
f158da3
1b6ed25
616962e
8ddacc3
0411b42
9334a88
df12474
bb09d6f
314af9a
251c45c
b9694a5
41d61da
f7520f3
39c0197
1aa691d
c35ddca
3066d29
e3902cd
5584e92
703ab83
06a7641
72d3634
624d6e9
6f92c37
4592862
29b478a
0ab0228
4e04673
db61c03
e92f6ea
61d7db8
909ef70
41a2742
a76333c
b9bc6cf
a87e2bc
22e8540
96e366c
1495772
d508ae4
0aaa3be
9548e28
a13d335
1165d68
0ec591e
208657c
937ad4f
5ab3aa4
e81b152
c2732d7
9df9c09
2f68dcb
2696ecd
edc3e07
55ce87f
8f87d7d
07bca97
ca8a739
2b51172
e88f2c4
0f40d0e
bcad265
5a9ad26
8c35f53
4ffca15
0851712
5ce9f29
e3dd0a7
35b13b9
1d3bd48
35c5bc0
d11e274
44ef2da
69448be
26483f2
b930ea3
43636d5
e5d0a54
0acd25d
4a253ca
08a6528
4e9b65c
cb8c784
04e784c
6b53226
1b5ce83
4c02bd9
c883da4
620bd0d
f8ef076
3cf8b7d
c243222
ac4513e
652204f
8bae6e5
dac4596
0253be6
0500c21
248b61b
e7f63db
1e47313
fdd2666
3bbb613
ff197ea
53c8c24
af5e422
875d476
e595c73
844c764
86a6efc
2c93c1f
52e32bd
31c4e1b
94b0683
4bf446b
29d2c35
17142f8
fd574d4
e145716
d1ddf71
5c74c48
ee2b885
7e38299
89c5f68
5e12ee2
b0d1ca1
c41639c
e37a256
71c8a99
06a26cc
169d14a
3bf11e2
8db55b8
ab079d1
10b3af5
132a848
2180340
e81ad61
1d89657
ac74dfd
eed49da
baa785a
0c06f2d
3c80e5f
5a6798e
dfe1ee8
cb6f41f
669c494
3e01411
4a2d7a7
6ead7e0
36aee82
bf799d3
9d56928
7996a51
4dac70e
1d630b4
17076a0
febfa25
8079afd
37f4365
5cb34be
a816023
b717d1a
5a5a939
c74583a
126382a
28f5b98
b644ff6
35032eb
f6b0499
423550f
efe5300
c3a3847
b12aaf5
4f6736d
4cdb45f
3231f5f
0ed046d
13c03f1
e087f5c
09c66ba
e71723e
c3c4c1b
6e8ee6a
b48a2f4
76409ba
4aff231
92c679f
4a0ca4a
781ee7a
7d4c2a8
d056957
365c805
150d47b
304d220
76a769f
c1fa8e9
93a9f4a
f596bd4
87ef5a9
d9f0298
fe772cb
a566c06
8e5efe5
7e2e8d2
ac1579d
479ad5d
0560700
fef78f2
9ee0f47
b0c86e5
d5d9c04
a84e121
28f4592
2bf8ab7
42096ea
bf85eee
f093daa
5a2c857
a7632b2
9661ec1
443d8a9
4dc7ba9
426b7be
695ffd9
392f67c
d56fc60
41043d9
c372e37
8b9c027
751eeeb
87a4616
8251916
d5a2b31
601c22f
b6e3de2
bbcc617
8703a3d
51c2029
32a14e1
564fe01
3566c35
aebf7c4
2a48ffd
9125043
9b337fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,158 @@ | ||||||
| /- | ||||||
| Copyright (c) 2025 Peter Pfaffelhuber. All rights reserved. | ||||||
| Released under Apache 2.0 license as described in the file LICENSE. | ||||||
| Authors: Peter Pfaffelhuber | ||||||
| -/ | ||||||
| import Mathlib.Data.Set.Lattice | ||||||
| import Mathlib.Order.Directed | ||||||
| import Mathlib.MeasureTheory.PiSystem | ||||||
|
|
||||||
| /-! | ||||||
| # Dissipate | ||||||
|
|
||||||
| The function `dissipate` takes `s : α → Set β` with `LE α` and returns `⋂ y ≤ x, s y`. | ||||||
|
|
||||||
| In large parts, this file is parallel to `Mathlib.Data.Set.Accumulate`, where | ||||||
| `Accumulate s := ⋃ y ≤ x, s y` is defined. | ||||||
|
|
||||||
| -/ | ||||||
|
|
||||||
| open Nat | ||||||
|
|
||||||
| variable {α β : Type*} {s : α → Set β} | ||||||
|
|
||||||
| namespace Set | ||||||
|
|
||||||
| /-- `dissipate s` is the intersection of `s y` for `y ≤ x`. -/ | ||||||
| def dissipate [LE α] (s : α → Set β) (x : α) : Set β := | ||||||
| ⋂ y ≤ x, s y | ||||||
|
|
||||||
| @[simp] | ||||||
| theorem dissipate_def [LE α] {x : α} : dissipate s x = ⋂ y ≤ x, s y := rfl | ||||||
|
|
||||||
| theorem dissipate_eq {s : ℕ → Set β} {n : ℕ} : dissipate s n = ⋂ k < n + 1, s k := by | ||||||
| simp_rw [Nat.lt_add_one_iff] | ||||||
| rfl | ||||||
|
|
||||||
| theorem mem_dissipate [LE α] {x : α} {z : β} : z ∈ dissipate s x ↔ ∀ y ≤ x, z ∈ s y := by | ||||||
| simp only [dissipate_def, mem_iInter] | ||||||
|
|
||||||
| theorem dissipate_subset [Preorder α] {x y : α} (hy : y ≤ x) : dissipate s x ⊆ s y := | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it does. Changed. |
||||||
| biInter_subset_of_mem hy | ||||||
|
|
||||||
| theorem iInter_subset_dissipate [Preorder α] (x : α) : ⋂ i, s i ⊆ dissipate s x := by | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto. |
||||||
| simp only [dissipate, subset_iInter_iff] | ||||||
| exact fun x h ↦ iInter_subset_of_subset x fun ⦃a⦄ a ↦ a | ||||||
|
|
||||||
| theorem antitone_dissipate [Preorder α] : Antitone (dissipate s) := | ||||||
| fun _ _ hab ↦ biInter_subset_biInter_left fun _ hz => le_trans hz hab | ||||||
|
|
||||||
| @[gcongr] | ||||||
| theorem dissipate_subset_dissipate [Preorder α] {x y} (h : y ≤ x) : | ||||||
| dissipate s x ⊆ dissipate s y := | ||||||
| antitone_dissipate h | ||||||
|
|
||||||
| @[simp] | ||||||
| theorem dissipate_dissipate [Preorder α] {s : α → Set β} {x : α} : | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if a lemma name contains
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, changed. (Since I had |
||||||
| ⋂ y, ⋂ (_ : y ≤ x), ⋂ y_1, ⋂ (_ : y_1 ≤ y), s y_1 = ⋂ y, ⋂ (_ : y ≤ x), s y := by | ||||||
| apply Subset.antisymm | ||||||
| · apply iInter_mono fun z y hy ↦ ?_ | ||||||
| simp only [mem_iInter] at * | ||||||
| exact fun h ↦ hy h z <| le_refl z | ||||||
| · simp only [subset_iInter_iff] | ||||||
| exact fun i hi z hz ↦ biInter_subset_of_mem <| le_trans hz hi | ||||||
|
|
||||||
| @[simp] | ||||||
| theorem iInter_dissipate [Preorder α] : ⋂ x, ⋂ y, ⋂ (_ : y ≤ x), s y = ⋂ x, s x := by | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||||||
| apply Subset.antisymm <;> simp_rw [subset_def, mem_iInter] | ||||||
| · exact fun z h x' ↦ h x' x' (le_refl x') | ||||||
| · exact fun z h x' y hy ↦ h y | ||||||
|
|
||||||
| lemma dissipate_bot [PartialOrder α] [OrderBot α] (s : α → Set β) : dissipate s ⊥ = s ⊥ := by | ||||||
| simp only [dissipate_def, le_bot_iff, iInter_iInter_eq_left] | ||||||
|
|
||||||
| open Nat | ||||||
|
|
||||||
| @[simp] | ||||||
| theorem dissipate_succ (s : ℕ → Set α) (n : ℕ) : | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you want to use dissipate in the lemma name, it should also appear in the statement.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you also use it on the left hand side?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will open a new PR with only the changes in Now it is also on the left hand side. |
||||||
| ⋂ i, ⋂ (_ : i ≤ n + 1), s i = (dissipate s n) ∩ s (n + 1) | ||||||
| := by | ||||||
| ext x | ||||||
| simp_all only [dissipate_def, mem_iInter, mem_inter_iff] | ||||||
| refine ⟨fun a ↦ ?_, fun a i c ↦ ?_⟩ | ||||||
| · simp_all only [le_refl, and_true] | ||||||
| intro i i_1 | ||||||
| apply a i <| le_trans i_1 (le_succ n) | ||||||
| · obtain ⟨left, right⟩ := a | ||||||
| · by_cases h : i ≤ n | ||||||
| · exact left i h | ||||||
| · have h : i = n + 1 := by | ||||||
| simp only [not_le] at h | ||||||
| exact le_antisymm c h | ||||||
| exact h.symm ▸ right | ||||||
|
|
||||||
| lemma dissipate_zero (s : ℕ → Set β) : dissipate s 0 = s 0 := by | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one should definitely be simp
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
| simp [dissipate_def] | ||||||
|
|
||||||
| lemma exists_subset_dissipate_of_directed {s : ℕ → Set α} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a docstring explaining the content of the lemma?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
| (hd : Directed (fun (x y : Set α) => y ⊆ x) s) (n : ℕ) : ∃ m, s m ⊆ dissipate s n := by | ||||||
| induction n with | ||||||
| | zero => use 0; simp | ||||||
| | succ n hn => | ||||||
| obtain ⟨m, hm⟩ := hn | ||||||
| simp_rw [dissipate_def, dissipate_succ] | ||||||
| obtain ⟨k, hk⟩ := hd m (n+1) | ||||||
| simp at hk | ||||||
| use k | ||||||
| simp only [subset_inter_iff] | ||||||
| exact ⟨le_trans hk.1 hm, hk.2⟩ | ||||||
|
|
||||||
| lemma exists_dissipate_eq_empty_iff {s : ℕ → Set α} | ||||||
| (hd : Directed (fun (x y : Set α) => y ⊆ x) s) : | ||||||
| (∃ n, dissipate s n = ∅) ↔ (∃ n, s n = ∅) := by | ||||||
| refine ⟨?_, fun ⟨n, hn⟩ ↦ ⟨n, ?_⟩⟩ | ||||||
| · rw [← not_imp_not] | ||||||
| push_neg | ||||||
| intro h n | ||||||
| obtain ⟨m, hm⟩ := exists_subset_dissipate_of_directed hd n | ||||||
| exact Set.Nonempty.mono hm (h m) | ||||||
| · by_cases hn' : n = 0 | ||||||
| · rw [hn'] | ||||||
| exact Eq.trans (dissipate_zero s) (hn' ▸ hn) | ||||||
| · obtain ⟨k, hk⟩ := exists_eq_add_one_of_ne_zero hn' | ||||||
| rw [hk, dissipate_def, dissipate_succ, ← hk, hn, Set.inter_empty] | ||||||
|
|
||||||
| lemma directed_dissipate {s : ℕ → Set α} : | ||||||
| Directed (fun (x y : Set α) => y ⊆ x) (dissipate s) := | ||||||
| antitone_dissipate.directed_ge | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
|
|
||||||
| lemma exists_dissipate_eq_empty_iff_of_directed (C : ℕ → Set α) | ||||||
| (hd : Directed (fun (x y : Set α) => y ⊆ x) C) : | ||||||
| (∃ n, C n = ∅) ↔ (∃ n, dissipate C n = ∅) := by | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you exchange the two sides of the iff, to match the lemma statement? In general, the more complicated term in an iff is put to its left, because rw or simp operate from left to right.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, done. |
||||||
| refine ⟨fun ⟨n, hn⟩ ↦ ⟨n, ?_⟩ , ?_⟩ | ||||||
| · by_cases hn' : n = 0 | ||||||
| · rw [hn', dissipate_zero] | ||||||
| exact hn' ▸ hn | ||||||
| · obtain ⟨k, hk⟩ := exists_eq_succ_of_ne_zero hn' | ||||||
| simp_rw [hk, succ_eq_add_one, dissipate_def, dissipate_succ, | ||||||
| ← succ_eq_add_one, ← hk, hn, Set.inter_empty] | ||||||
| · rw [← not_imp_not] | ||||||
| push_neg | ||||||
| intro h n | ||||||
| obtain ⟨m, hm⟩ := exists_subset_dissipate_of_directed hd n | ||||||
| exact Set.Nonempty.mono hm (h m) | ||||||
|
|
||||||
| /-- For a ∩-stable set of sets `p` on `α` and a sequence of sets `s` with this attribute, | ||||||
| `p (dissipate s n)` holds. -/ | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(The lemma is about a set of sets, not sets with some property)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
| lemma IsPiSystem.dissipate_mem {s : ℕ → Set α} {p : Set (Set α)} | ||||||
| (hp : IsPiSystem p) (h : ∀ n, s n ∈ p) (n : ℕ) (h' : (dissipate s n).Nonempty) : | ||||||
| (dissipate s n) ∈ p := by | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||||||
| induction n with | ||||||
| | zero => | ||||||
| simp only [dissipate_def, le_zero_eq, iInter_iInter_eq_left] | ||||||
| exact h 0 | ||||||
| | succ n hn => | ||||||
| rw [dissipate_def, dissipate_succ] at * | ||||||
| apply hp (dissipate s n) (hn (Nonempty.left h')) (s (n+1)) (h (n+1)) h' | ||||||
|
|
||||||
| end Set | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be
@[simp]. Otherwise, there's no point in introducing the definition if you want to remove it whenever it is used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this makes a lot of sense.