Skip to content

Commit 93e701c

Browse files
committed
feat: the atTop filter is countably generated in a second-countable topology (#6864)
1 parent 23550c1 commit 93e701c

File tree

5 files changed

+113
-0
lines changed

5 files changed

+113
-0
lines changed

Mathlib/Data/Set/Intervals/Basic.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,14 @@ theorem Ico_eq_Ico_iff (h : a₁ < b₁ ∨ a₂ < b₂) : Ico a₁ b₁ = Ico a
11721172
fun ⟨h₁, h₂⟩ => by rw [h₁, h₂]⟩
11731173
#align set.Ico_eq_Ico_iff Set.Ico_eq_Ico_iff
11741174

1175+
lemma Ici_eq_singleton_iff_isTop {x : α} : (Ici x = {x}) ↔ IsTop x := by
1176+
refine ⟨fun h y ↦ ?_, fun h ↦ by ext y; simp [(h y).ge_iff_eq]⟩
1177+
by_contra H
1178+
push_neg at H
1179+
have : y ∈ Ici x := H.le
1180+
rw [h, mem_singleton_iff] at this
1181+
exact lt_irrefl y (this.le.trans_lt H)
1182+
11751183
open Classical
11761184

11771185
@[simp]

Mathlib/Order/Filter/AtTopBot.lean

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ theorem atTop_basis [Nonempty α] [SemilatticeSup α] : (@atTop α _).HasBasis (
132132
hasBasis_iInf_principal (directed_of_sup fun _ _ => Ici_subset_Ici.2)
133133
#align filter.at_top_basis Filter.atTop_basis
134134

135+
theorem atTop_eq_generate_Ici [SemilatticeSup α] : atTop = generate (range (Ici (α := α))) := by
136+
rcases isEmpty_or_nonempty α with hα|hα
137+
· simp only [eq_iff_true_of_subsingleton]
138+
· simp [(atTop_basis (α := α)).eq_generate, range]
139+
135140
theorem atTop_basis' [SemilatticeSup α] (a : α) : (@atTop α _).HasBasis (fun x => a ≤ x) Ici :=
136141
fun _ =>
137142
(@atTop_basis α ⟨a⟩ _).mem_iff.trans
@@ -297,6 +302,18 @@ theorem OrderBot.atBot_eq (α) [PartialOrder α] [OrderBot α] : (atBot : Filter
297302
@OrderTop.atTop_eq αᵒᵈ _ _
298303
#align filter.order_bot.at_bot_eq Filter.OrderBot.atBot_eq
299304

305+
lemma atTop_eq_pure_of_isTop [LinearOrder α] {x : α} (hx : IsTop x) :
306+
(atTop : Filter α) = pure x := by
307+
have : Nonempty α := ⟨x⟩
308+
have : (atTop : Filter α).NeBot := atTop_basis.neBot_iff.2 (fun _ ↦ ⟨x, hx _⟩)
309+
apply eq_pure_iff_singleton_mem.2
310+
convert Ici_mem_atTop x using 1
311+
exact (Ici_eq_singleton_iff_isTop.2 hx).symm
312+
313+
lemma atBot_eq_pure_of_isBot [LinearOrder α] {x : α} (hx : IsBot x) :
314+
(atBot : Filter α) = pure x :=
315+
@atTop_eq_pure_of_isTop αᵒᵈ _ _ hx
316+
300317
@[nontriviality]
301318
theorem Subsingleton.atTop_eq (α) [Subsingleton α] [Preorder α] : (atTop : Filter α) = ⊤ := by
302319
refine' top_unique fun s hs x => _
@@ -411,6 +428,26 @@ theorem tendsto_atBot_mono [Preorder β] {l : Filter α} {f g : α → β} (h :
411428
@tendsto_atTop_mono _ βᵒᵈ _ _ _ _ h
412429
#align filter.tendsto_at_bot_mono Filter.tendsto_atBot_mono
413430

431+
lemma atTop_eq_generate_of_forall_exists_le [LinearOrder α] {s : Set α} (hs : ∀ x, ∃ y ∈ s, x ≤ y) :
432+
(atTop : Filter α) = generate (Ici '' s) := by
433+
rw [atTop_eq_generate_Ici]
434+
apply le_antisymm
435+
· rw [le_generate_iff]
436+
rintro - ⟨y, -, rfl⟩
437+
exact mem_generate_of_mem ⟨y, rfl⟩
438+
· rw [le_generate_iff]
439+
rintro - ⟨x, -, -, rfl⟩
440+
rcases hs x with ⟨y, ys, hy⟩
441+
have A : Ici y ∈ generate (Ici '' s) := mem_generate_of_mem (mem_image_of_mem _ ys)
442+
have B : Ici y ⊆ Ici x := Ici_subset_Ici.2 hy
443+
exact sets_of_superset (generate (Ici '' s)) A B
444+
445+
lemma atTop_eq_generate_of_not_bddAbove [LinearOrder α] {s : Set α} (hs : ¬ BddAbove s) :
446+
(atTop : Filter α) = generate (Ici '' s) := by
447+
refine' atTop_eq_generate_of_forall_exists_le fun x ↦ _
448+
obtain ⟨y, hy, hy'⟩ := not_bddAbove_iff.mp hs x
449+
exact ⟨y, hy, hy'.le⟩
450+
414451
end Filter
415452

416453
namespace OrderIso

Mathlib/Order/Filter/Bases.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,12 @@ theorem isCountablyGenerated_top : IsCountablyGenerated (⊤ : Filter α) :=
11921192
@principal_univ α ▸ isCountablyGenerated_principal _
11931193
#align filter.is_countably_generated_top Filter.isCountablyGenerated_top
11941194

1195+
lemma isCountablyGenerated_of_subsingleton_mem {l : Filter α} {s : Set α} (hs : s.Subsingleton)
1196+
(h's : s ∈ l) : IsCountablyGenerated l := by
1197+
rcases eq_bot_or_pure_of_subsingleton_mem hs h's with rfl|⟨x, rfl⟩
1198+
· exact isCountablyGenerated_bot
1199+
· exact isCountablyGenerated_pure x
1200+
11951201
-- porting note: without explicit `Sort u` and `Type v`, Lean 4 uses `ι : Prop`
11961202
universe u v
11971203

Mathlib/Order/Filter/Basic.lean

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ def generate (g : Set (Set α)) : Filter α where
351351
inter_sets := GenerateSets.inter
352352
#align filter.generate Filter.generate
353353

354+
lemma mem_generate_of_mem {s : Set <| Set α} {U : Set α} (h : U ∈ s) :
355+
U ∈ generate s := GenerateSets.basic h
356+
354357
theorem le_generate_iff {s : Set (Set α)} {f : Filter α} : f ≤ generate s ↔ s ⊆ f.sets :=
355358
Iff.intro (fun h _ hu => h <| GenerateSets.basic <| hu) fun h _ hu =>
356359
hu.recOn (fun h' => h h') univ_mem (fun _ hxy hx => mem_of_superset hx hxy) fun _ _ hx hy =>
@@ -2678,6 +2681,31 @@ theorem le_pure_iff {f : Filter α} {a : α} : f ≤ pure a ↔ {a} ∈ f := by
26782681
rw [← principal_singleton, le_principal_iff]
26792682
#align filter.le_pure_iff Filter.le_pure_iff
26802683

2684+
lemma le_pure_iff_eq_pure {l : Filter α} [hl : NeBot l] :
2685+
l ≤ pure x ↔ l = pure x := by
2686+
refine' ⟨fun h ↦ _, fun h ↦ h.le⟩
2687+
have hx := le_pure_iff.1 h
2688+
ext s
2689+
simp only [mem_pure]
2690+
refine ⟨fun h ↦ ?_, fun h ↦ mem_of_superset hx (singleton_subset_iff.2 h)⟩
2691+
by_contra H
2692+
have : s ∩ {x} ∈ l := inter_mem h hx
2693+
rw [inter_singleton_eq_empty.2 H, empty_mem_iff_bot] at this
2694+
exact NeBot.ne hl this
2695+
2696+
lemma eq_pure_iff_singleton_mem {l : Filter α} [hl : NeBot l] {x : α} :
2697+
l = pure x ↔ {x} ∈ l := by
2698+
rw [← le_pure_iff_eq_pure, le_pure_iff]
2699+
2700+
lemma eq_bot_or_pure_of_subsingleton_mem {l : Filter α} {s : Set α} (hs : s.Subsingleton)
2701+
(h's : s ∈ l) : l = ⊥ ∨ ∃ x, l = pure x := by
2702+
rcases l.eq_or_neBot with rfl|hl
2703+
· exact Or.inl rfl
2704+
· rcases hs.eq_empty_or_singleton with rfl|⟨x, rfl⟩
2705+
· rw [empty_mem_iff_bot.1 h's]
2706+
exact Or.inl rfl
2707+
· exact Or.inr ⟨x, eq_pure_iff_singleton_mem.2 h's⟩
2708+
26812709
theorem mem_seq_def {f : Filter (α → β)} {g : Filter α} {s : Set β} :
26822710
s ∈ f.seq g ↔ ∃ u ∈ f, ∃ t ∈ g, ∀ x ∈ u, ∀ y ∈ t, (x : α → β) y ∈ s :=
26832711
Iff.rfl

Mathlib/Topology/Order/Basic.lean

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,40 @@ theorem Set.PairwiseDisjoint.countable_of_Ioo [SecondCountableTopology α] {y :
14301430
this.of_diff countable_setOf_covby_right
14311431
#align set.pairwise_disjoint.countable_of_Ioo Set.PairwiseDisjoint.countable_of_Ioo
14321432

1433+
instance instIsCountablyGenerated_atTop [SecondCountableTopology α] :
1434+
IsCountablyGenerated (atTop : Filter α) := by
1435+
by_cases h : ∃ (x : α), IsTop x
1436+
· rcases h with ⟨x, hx⟩
1437+
rw [atTop_eq_pure_of_isTop hx]
1438+
exact isCountablyGenerated_pure x
1439+
· rcases exists_countable_basis α with ⟨b, b_count, b_ne, hb⟩
1440+
have : Countable b := by exact Iff.mpr countable_coe_iff b_count
1441+
have A : ∀ (s : b), ∃ (x : α), x ∈ (s : Set α) := by
1442+
intro s
1443+
have : (s : Set α) ≠ ∅ := by
1444+
intro H
1445+
apply b_ne
1446+
convert s.2
1447+
exact H.symm
1448+
exact Iff.mp nmem_singleton_empty this
1449+
choose a ha using A
1450+
have : (atTop : Filter α) = (generate (Ici '' (range a))) := by
1451+
apply atTop_eq_generate_of_not_bddAbove
1452+
intro ⟨x, hx⟩
1453+
simp only [IsTop, not_exists, not_forall, not_le] at h
1454+
rcases h x with ⟨y, hy⟩
1455+
obtain ⟨s, sb, -, hs⟩ : ∃ s, s ∈ b ∧ y ∈ s ∧ s ⊆ Ioi x :=
1456+
hb.exists_subset_of_mem_open hy isOpen_Ioi
1457+
have I : a ⟨s, sb⟩ ≤ x := hx (mem_range_self _)
1458+
have J : x < a ⟨s, sb⟩ := hs (ha ⟨s, sb⟩)
1459+
exact lt_irrefl _ (I.trans_lt J)
1460+
rw [this]
1461+
exact ⟨_, (countable_range _).image _, rfl⟩
1462+
1463+
instance instIsCountablyGenerated_atBot [SecondCountableTopology α] :
1464+
IsCountablyGenerated (atBot : Filter α) :=
1465+
@instIsCountablyGenerated_atTop αᵒᵈ _ _ _ _
1466+
14331467
section Pi
14341468

14351469
/-!

0 commit comments

Comments
 (0)