Zulip Chat Archive

Stream: Is there code for X?

Topic: Set is open iff each point has a open neighbourhood containe


Michael Rothgang (Nov 19 2023 at 11:57):

This is a standard lemma from point-set topology: a subset $s\subseteq X$ of a topological space X is open iff each point x \in x is contained in an open subset of s. I can't find this in mathlib (neither eyeballing, nor apply?/exact?/hint return anything). Did I overlook something?

lemma aux {X : Type*} [TopologicalSpace X] {s : Set X} :
    IsOpen s ↔ ∀ x, x ∈ s → ∃ t : Set X, x ∈ t ∧ t ⊆ s ∧ IsOpen t := by
  constructor
  · intro h x hx
    rcases mem_nhds_iff.mp (h.mem_nhds hx) with ⟨t, hts, htopen, hxt⟩
    use t
  · sorry -- this seems to be missing?

Michael Rothgang (Nov 19 2023 at 11:57):

I'd be interested both in the backwards direction and the full iff; as you can see, mathlib basically contains the direction \to already.

Rémy Degenne (Nov 19 2023 at 11:59):

docs#isOpen_iff_forall_mem_open

Rémy Degenne (Nov 19 2023 at 12:00):

I opened the doc and searched for "isopen iff mem"

Michael Rothgang (Nov 19 2023 at 12:04):

I wasn't sure what I could search for... thank you for the quick response!

Patrick Massot (Nov 19 2023 at 15:20):

Probably you don't need this result actually. Open neighborhoods are overrated.

Kevin Buzzard (Nov 19 2023 at 15:23):

I used this result on Thursday to prove that the sum of two continuous cocycles GAG\to A was continuous (the target has the discrete topology). I'm wondering what I did wrong now :-) I had to prove (ϕ1+ϕ2)1{m}(\phi_1+\phi_2)^{-1}\{m\} was open knowing that t,ϕ11{t}\forall t, \phi_1^{-1}\{t\} and ϕ21{t}\phi_2^{-1}\{t\} were open. My proof was to use the above lemma, which gives me some xx, and then apply the hypotheses to ϕ1(x)\phi_1(x) and ϕ2(x)\phi_2(x) and take the intersection.

Patrick Massot (Nov 19 2023 at 15:25):

#mwe?

Kevin Buzzard (Nov 19 2023 at 15:50):

import Mathlib.Tactic

variables
  (G : Type) [Group G] [TopologicalSpace G] [TopologicalGroup G]
  (M : Type) [AddCommGroup M]

open TopologicalSpace

def continuous_cocycles : AddSubgroup (G  M) where
  carrier := {φ : G  M |  m : M, IsOpen (φ ⁻¹' {m})}
  add_mem' := by
    intros φ₁ φ₂ h₁ h₂ m
    rw [isOpen_iff_forall_mem_open] -- here
    intro g (hg : φ₁ g + φ₂ g = m)
    specialize h₁ (φ₁ g)
    specialize h₂ (φ₂ g)
    refine ⟨(φ₁ ⁻¹' {φ₁ g})  (φ₂ ⁻¹' {φ₂ g}), ?_, ?_, ?_
    · intro x
      intro h1
      simp at h1
      simp [h1.1, h1.2, hg]
    · apply IsOpen.inter h₁ h₂
    · aesop
  zero_mem' := sorry
  neg_mem' := sorry

Michael Rothgang (Nov 19 2023 at 19:03):

Patrick Massot said:

Probably you don't need this result actually. Open neighborhoods are overrated.

I'm using it for this lemma: the interior of a smooth manifold is open.
It allows reducing this to charts nicely. Golfing ideas welcome.

Anatole Dedecker (Nov 19 2023 at 21:01):

Kevin, I think Patrick was suggesting something along these lines:

import Mathlib.Tactic

variables
  (G : Type) [Group G] [TopologicalSpace G] [TopologicalGroup G]
  (M : Type) [AddCommGroup M]

open TopologicalSpace

def continuous_cocycles : AddSubgroup (G  M) where
  carrier := {φ : G  M |  m : M, IsOpen (φ ⁻¹' {m})}
  add_mem' := by
    intros φ₁ φ₂ h₁ h₂ m
    rw [isOpen_iff_eventually]
    intro g (hg : φ₁ g + φ₂ g = m)
    filter_upwards [(h₁ (φ₁ g)).mem_nhds rfl, (h₂ (φ₂ g)).mem_nhds rfl]
      with x (h1 : _ = _) (h2 : _ = _)
    rwa [ h1,  h2] at hg
  zero_mem' := sorry
  neg_mem' := sorry

Neighborhoods are not overrated, open ones are. But I get in this case you don't gain a lot.

Kevin Buzzard (Nov 19 2023 at 21:32):

Oh it's nice to see this technique though! Thanks!

Patrick Massot (Nov 20 2023 at 00:45):

Anatole is right that I had something like this in mind of course. But why stopping at rw [isOpen_iff_eventually] instead of going all the way to simp only [isOpen_iff_eventually] at *?

import Mathlib.Tactic

variable
  (G : Type) [Group G] [TopologicalSpace G] [TopologicalGroup G]
  (M : Type) [AddCommGroup M]

open TopologicalSpace Topology

def continuous_cocycles : AddSubgroup (G  M) where
  carrier := {φ : G  M |  m : M, IsOpen (φ ⁻¹' {m})}
  add_mem' := by
    intros φ₁ φ₂ h₁ h₂ m
    simp only [isOpen_iff_eventually] at *
    rintro g rfl
    apply (h₁ (φ₁ g) g rfl |>.and <| h₂ (φ₂ g) g rfl).mono
    aesop
  zero_mem' := sorry
  neg_mem' := sorry

Last updated: Dec 20 2023 at 11:08 UTC