Skip to content

Commit

Permalink
feat: lemmas about NhdsSet (#9674)
Browse files Browse the repository at this point in the history
From sphere-eversion; I'm just submitting these.
Thanks to @urkud for some review suggestions.
  • Loading branch information
grunweg committed Jan 16, 2024
1 parent f635563 commit b52b6c4
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Mathlib/Data/Set/Lattice.lean
Expand Up @@ -2381,6 +2381,9 @@ theorem iInf_iUnion (s : ι → Set α) (f : α → β) : ⨅ a ∈ ⋃ i, s i,
iSup_iUnion (β := βᵒᵈ) s f
#align infi_Union iInf_iUnion

theorem sSup_iUnion (t : ι → Set β) : sSup (⋃ i, t i) = ⨆ i, sSup (t i) := by
simp_rw [sSup_eq_iSup, iSup_iUnion]

theorem sSup_sUnion (s : Set (Set β)) : sSup (⋃₀ s) = ⨆ t ∈ s, sSup t := by
simp only [sUnion_eq_biUnion, sSup_eq_iSup, iSup_iUnion]
#align Sup_sUnion sSup_sUnion
Expand Down
4 changes: 4 additions & 0 deletions Mathlib/Order/Filter/Basic.lean
Expand Up @@ -1252,6 +1252,10 @@ theorem eventually_principal {a : Set α} {p : α → Prop} : (∀ᶠ x in 𝓟
Iff.rfl
#align filter.eventually_principal Filter.eventually_principal

theorem Eventually.forall_mem {α : Type*} {f : Filter α} {s : Set α} {P : α → Prop}
(hP : ∀ᶠ x in f, P x) (hf : 𝓟 s ≤ f) : ∀ x ∈ s, P x :=
Filter.eventually_principal.mp (hP.filter_mono hf)

theorem eventually_inf {f g : Filter α} {p : α → Prop} :
(∀ᶠ x in f ⊓ g, p x) ↔ ∃ s ∈ f, ∃ t ∈ g, ∀ x ∈ s ∩ t, p x :=
mem_inf_iff_superset
Expand Down
6 changes: 0 additions & 6 deletions Mathlib/Topology/Compactness/Compact.lean
Expand Up @@ -675,12 +675,6 @@ theorem IsCompact.nhdsSet_prod_eq {t : Set Y} (hs : IsCompact s) (ht : IsCompact
simp_rw [hs.nhdsSet_prod_eq_biSup, ht.prod_nhdsSet_eq_biSup, nhdsSet, sSup_image, biSup_prod,
nhds_prod_eq]

/-- The product of a neighborhood of `s` and a neighborhood of `t` is a neighborhood of `s ×ˢ t`,
formulated in terms of a filter inequality. -/
theorem nhdsSet_prod_le (s : Set X) (t : Set Y) : 𝓝ˢ (s ×ˢ t) ≤ 𝓝ˢ s ×ˢ 𝓝ˢ t :=
((hasBasis_nhdsSet _).prod (hasBasis_nhdsSet _)).ge_iff.2 fun (_u, _v) ⟨⟨huo, hsu⟩, hvo, htv⟩ ↦
(huo.prod hvo).mem_nhdsSet.2 <| prod_mono hsu htv

/-- If `s` and `t` are compact sets and `n` is an open neighborhood of `s × t`, then there exist
open neighborhoods `u ⊇ s` and `v ⊇ t` such that `u × v ⊆ n`.
Expand Down
24 changes: 24 additions & 0 deletions Mathlib/Topology/Constructions.lean
Expand Up @@ -1705,3 +1705,27 @@ theorem IsClosed.trans (hγ : IsClosed γ) (hβ : IsClosed β) : IsClosed (γ :
convert IsClosed.inter hδ hβ

end Monad

section NhdsSet
variable {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] {f : Filter X}
{s : Set X} {t : Set Y} {x : X}

/-- The product of a neighborhood of `s` and a neighborhood of `t` is a neighborhood of `s ×ˢ t`,
formulated in terms of a filter inequality. -/
theorem nhdsSet_prod_le (s : Set X) (t : Set Y) : 𝓝ˢ (s ×ˢ t) ≤ 𝓝ˢ s ×ˢ 𝓝ˢ t :=
((hasBasis_nhdsSet _).prod (hasBasis_nhdsSet _)).ge_iff.2 fun (_u, _v) ⟨⟨huo, hsu⟩, hvo, htv⟩ ↦
(huo.prod hvo).mem_nhdsSet.2 <| prod_mono hsu htv

theorem Filter.eventually_nhdsSet_prod_iff {p : X × Y → Prop} :
(∀ᶠ q in 𝓝ˢ (s ×ˢ t), p q) ↔
∀ x ∈ s, ∀ y ∈ t,
∃ pa : X → Prop, (∀ᶠ x' in 𝓝 x, pa x') ∧ ∃ pb : Y → Prop, (∀ᶠ y' in 𝓝 y, pb y') ∧
∀ {x : X}, pa x → ∀ {y : Y}, pb y → p (x, y) :=
by simp_rw [eventually_nhdsSet_iff_forall, Set.forall_prod_set, nhds_prod_eq, eventually_prod_iff]

theorem Filter.Eventually.prod_nhdsSet {p : X × Y → Prop} {pa : X → Prop} {pb : Y → Prop}
(hp : ∀ {x : X}, pa x → ∀ {y : Y}, pb y → p (x, y)) (hs : ∀ᶠ x in 𝓝ˢ s, pa x)
(ht : ∀ᶠ y in 𝓝ˢ t, pb y) : ∀ᶠ q in 𝓝ˢ (s ×ˢ t), p q :=
nhdsSet_prod_le _ _ (mem_of_superset (prod_mem_prod hs ht) fun _ ⟨hx, hy⟩ ↦ hp hx hy)

end NhdsSet
42 changes: 42 additions & 0 deletions Mathlib/Topology/NhdsSet.lean
Expand Up @@ -177,3 +177,45 @@ lemma Continuous.tendsto_nhdsSet_nhds
Tendsto f (𝓝ˢ s) (𝓝 y) := by
rw [← nhdsSet_singleton]
exact h.tendsto_nhdsSet h'

/- This inequality cannot be improved to an equality. For instance,
if `X` has two elements and the coarse topology and `s` and `t` are distinct singletons then
`𝓝ˢ (s ∩ t) = ⊥` while `𝓝ˢ s ⊓ 𝓝ˢ t = ⊤` and those are different. -/
theorem nhdsSet_inter_le (s t : Set X) : 𝓝ˢ (s ∩ t) ≤ 𝓝ˢ s ⊓ 𝓝ˢ t :=
(monotone_nhdsSet (X := X)).map_inf_le s t

variable (s) in
theorem IsClosed.nhdsSet_le_sup (h : IsClosed t) : 𝓝ˢ s ≤ 𝓝ˢ (s ∩ t) ⊔ 𝓟 (tᶜ) :=
calc
𝓝ˢ s = 𝓝ˢ (s ∩ t ∪ s ∩ tᶜ) := by rw [Set.inter_union_compl s t]
_ = 𝓝ˢ (s ∩ t) ⊔ 𝓝ˢ (s ∩ tᶜ) := by rw [nhdsSet_union]
_ ≤ 𝓝ˢ (s ∩ t) ⊔ 𝓝ˢ (tᶜ) := (sup_le_sup_left (monotone_nhdsSet (s.inter_subset_right (tᶜ))) _)
_ = 𝓝ˢ (s ∩ t) ⊔ 𝓟 (tᶜ) := by rw [h.isOpen_compl.nhdsSet_eq]

variable (s) in
theorem IsClosed.nhdsSet_le_sup' (h : IsClosed t) :
𝓝ˢ s ≤ 𝓝ˢ (t ∩ s) ⊔ 𝓟 (tᶜ) := by rw [Set.inter_comm]; exact h.nhdsSet_le_sup s

theorem Filter.Eventually.eventually_nhdsSet {p : X → Prop} (h : ∀ᶠ y in 𝓝ˢ s, p y) :
∀ᶠ y in 𝓝ˢ s, ∀ᶠ x in 𝓝 y, p x :=
eventually_nhdsSet_iff_forall.mpr fun x x_in ↦
(eventually_nhdsSet_iff_forall.mp h x x_in).eventually_nhds

theorem Filter.Eventually.union_nhdsSet {p : X → Prop} :
(∀ᶠ x in 𝓝ˢ (s ∪ t), p x) ↔ (∀ᶠ x in 𝓝ˢ s, p x) ∧ ∀ᶠ x in 𝓝ˢ t, p x := by
rw [nhdsSet_union, eventually_sup]

theorem Filter.Eventually.union {p : X → Prop} (hs : ∀ᶠ x in 𝓝ˢ s, p x) (ht : ∀ᶠ x in 𝓝ˢ t, p x) :
∀ᶠ x in 𝓝ˢ (s ∪ t), p x :=
Filter.Eventually.union_nhdsSet.mpr ⟨hs, ht⟩

theorem nhdsSet_iUnion {ι : Sort*} (s : ι → Set X) : 𝓝ˢ (⋃ i, s i) = ⨆ i, 𝓝ˢ (s i) := by
simp only [nhdsSet, image_iUnion, sSup_iUnion (β := Filter X)]

theorem eventually_nhdsSet_iUnion₂ {ι : Sort*} {p : ι → Prop} {s : ι → Set X} {P : X → Prop} :
(∀ᶠ x in 𝓝ˢ (⋃ (i) (_ : p i), s i), P x) ↔ ∀ i, p i → ∀ᶠ x in 𝓝ˢ (s i), P x := by
simp only [nhdsSet_iUnion, eventually_iSup]

theorem eventually_nhdsSet_iUnion {ι : Sort*} {s : ι → Set X} {P : X → Prop} :
(∀ᶠ x in 𝓝ˢ (⋃ i, s i), P x) ↔ ∀ i, ∀ᶠ x in 𝓝ˢ (s i), P x := by
simp only [nhdsSet_iUnion, eventually_iSup]

0 comments on commit b52b6c4

Please sign in to comment.