Lean library · module TopologyByExample.Spaces.NonUrysohn

A countable Hausdorff space that is not Urysohn

Source file

In this file we define TopologyByExample.NonUrysohn, a countable space that is Hausdorff but not Urysohn (T₂½). Its points are two poles pole i (i : Bool), points mid n (n : ℕ), and points iso i n m (i : Bool, n m : ℕ), which are isolated.

  • A basic neighbourhood of pole i is pole i together with all iso i n m with N ≤ n.
  • A basic neighbourhood of mid n is mid n together with all iso i n m (i arbitrary) with M ≤ m.

So the points iso i n m, for fixed i and n, form a sequence converging to mid n, and the points mid n converge to neither pole but lie in the closure of every neighbourhood of each pole. Two distinct points have disjoint neighbourhoods (the poles have neighbourhoods on different sides i, and a neighbourhood of a pole can be chosen to avoid the column n of a given mid n), so the space is Hausdorff. But the closures of any neighbourhood of pole false and of any neighbourhood of pole true meet (both contain mid n for every large n), so the space is not Urysohn. In particular every continuous map from it to a Urysohn space, such as ℝ, takes the same value at the two poles.

The space is countable, and each point has a countable neighbourhood base, so it is second countable. The points mid n form a sequence with no cluster point, so the space is not countably compact.

Main definitions

Main statements

Connectedness

The space is totally disconnected (TopologyByExample.NonUrysohn.instTotallyDisconnectedSpace): its isolated points are clopen, and a set containing two points that are not isolated splits into two open pieces. Not being Urysohn, it is not totally separated.

Tags

Urysohn space, T₂½, completely Hausdorff, Hausdorff, counterexample

This file was written by Claude (Anthropic's AI model) working under the direction of David R. MacIver, who reviews it and is responsible for it.

Imports

inductive type NonUrysohn

TopologyByExample.NonUrysohn

The points of a countable Hausdorff space that is not Urysohn: two poles, a point mid n for each n : ℕ, and isolated points iso i n m. The point iso i n m lies on the side i (it is near pole i) and in the column n (it is near mid n).

inductive NonUrysohn : Type
  /-- The two poles. -/
  | pole (i : Bool)
  /-- The points in the closure of every neighbourhood of either pole. -/
  | mid (n : ℕ)
  /-- The isolated points. -/
  | iso (i : Bool) (n m : ℕ)
  deriving DecidableEq

On this site: Space: A countable Hausdorff space that is not Urysohn

definition encode

TopologyByExample.NonUrysohn.encode

An encoding of the points, used to show that there are countably many.

def encode : NonUrysohn → Bool ⊕ ℕ ⊕ (Bool × ℕ × ℕ)
  | pole i => .inl i
  | mid n => .inr (.inl n)
  | iso i n m => .inr (.inr (i, n, m))

theorem encode_injective

TopologyByExample.NonUrysohn.encode_injective

The encoding of the points is injective.

theorem encode_injective : Function.Injective encode
Proof
:= by
  rintro (_ | _ | _) (_ | _ | _) h <;> simp_all [encode]

instance

The space is countable.

instance : Countable NonUrysohn
Proof
:= encode_injective.countable

instance

A set is open if, whenever it contains pole i, it contains iso i n m for all large n and all m, and whenever it contains mid n, it contains iso i n m for both i and all large m.

instance : TopologicalSpace NonUrysohn
Proof
where
  IsOpen U := (∀ i, pole i ∈ U → ∀ᶠ n in atTop, ∀ m, iso i n m ∈ U) ∧
    ∀ n, mid n ∈ U → ∀ᶠ m in atTop, ∀ i, iso i n m ∈ U
  isOpen_univ := by simp
  isOpen_inter s t hs ht :=
    ⟨fun i hi ↦ ((hs.1 i hi.1).and (ht.1 i hi.2)).mono fun _ h m ↦ ⟨h.1 m, h.2 m⟩,
      fun n hn ↦ ((hs.2 n hn.1).and (ht.2 n hn.2)).mono fun _ h i ↦ ⟨h.1 i, h.2 i⟩⟩
  isOpen_sUnion S hS :=
    ⟨fun i ⟨t, ht, hi⟩ ↦ ((hS t ht).1 i hi).mono fun _ h m ↦ ⟨t, ht, h m⟩,
      fun n ⟨t, ht, hn⟩ ↦ ((hS t ht).2 n hn).mono fun _ h i ↦ ⟨t, ht, h i⟩⟩

theorem isOpen_iff

TopologyByExample.NonUrysohn.isOpen_iff

The open sets of the space, by definition.

theorem isOpen_iff {U : Set NonUrysohn} :
    IsOpen U ↔ (∀ i, pole i ∈ U → ∀ᶠ n in atTop, ∀ m, iso i n m ∈ U) ∧
      ∀ n, mid n ∈ U → ∀ᶠ m in atTop, ∀ i, iso i n m ∈ U
Proof
:=
  Iff.rfl

Basic neighbourhoods

definition poleNhd

TopologyByExample.NonUrysohn.poleNhd

The basic neighbourhood of pole i: the pole together with all iso i n m with N ≤ n.

def poleNhd (i : Bool) (N : ℕ) : Set NonUrysohn
Definition
:=
  {x | match x with
    | pole j => j = i
    | mid _ => False
    | iso j n _ => j = i ∧ N ≤ n}

definition midNhd

TopologyByExample.NonUrysohn.midNhd

The basic neighbourhood of mid n: the point together with all iso i n m with M ≤ m.

def midNhd (n M : ℕ) : Set NonUrysohn
Definition
:=
  {x | match x with
    | pole _ => False
    | mid k => k = n
    | iso _ k m => k = n ∧ M ≤ m}

theorem pole_mem_poleNhd

TopologyByExample.NonUrysohn.pole_mem_poleNhd

The only pole in poleNhd i N is pole i.

@[simp] theorem pole_mem_poleNhd {i j : Bool} {N : ℕ} : pole j ∈ poleNhd i N ↔ j = i
Proof
:= Iff.rfl

theorem mid_notMem_poleNhd

TopologyByExample.NonUrysohn.mid_notMem_poleNhd

poleNhd i N contains no point mid k.

@[simp] theorem mid_notMem_poleNhd {i : Bool} {N k : ℕ} : mid k ∉ poleNhd i N
Proof
:= id

theorem iso_mem_poleNhd

TopologyByExample.NonUrysohn.iso_mem_poleNhd

The isolated points of poleNhd i N are those on the side i in columns n ≥ N.

@[simp] theorem iso_mem_poleNhd {i j : Bool} {N n m : ℕ} :
    iso j n m ∈ poleNhd i N ↔ j = i ∧ N ≤ n
Proof
:= Iff.rfl

theorem pole_notMem_midNhd

TopologyByExample.NonUrysohn.pole_notMem_midNhd

midNhd n M contains no pole.

@[simp] theorem pole_notMem_midNhd {j : Bool} {n M : ℕ} : pole j ∉ midNhd n M
Proof
:= id

theorem mid_mem_midNhd

TopologyByExample.NonUrysohn.mid_mem_midNhd

The only point mid k in midNhd n M is mid n.

@[simp] theorem mid_mem_midNhd {n M k : ℕ} : mid k ∈ midNhd n M ↔ k = n
Proof
:= Iff.rfl

theorem iso_mem_midNhd

TopologyByExample.NonUrysohn.iso_mem_midNhd

The isolated points of midNhd n M are those in the column n with m ≥ M.

@[simp] theorem iso_mem_midNhd {j : Bool} {n M k m : ℕ} :
    iso j k m ∈ midNhd n M ↔ k = n ∧ M ≤ m
Proof
:= Iff.rfl

theorem isOpen_poleNhd

TopologyByExample.NonUrysohn.isOpen_poleNhd

The basic neighbourhoods of the poles are open.

theorem isOpen_poleNhd (i : Bool) (N : ℕ) : IsOpen (poleNhd i N)
Proof
:= by
  refine ⟨fun j hj ↦ ?_, fun k hk ↦ absurd hk mid_notMem_poleNhd⟩
  rw [pole_mem_poleNhd] at hj
  exact (eventually_ge_atTop N).mono fun n hn m ↦ iso_mem_poleNhd.2 ⟨hj, hn⟩

theorem isOpen_midNhd

TopologyByExample.NonUrysohn.isOpen_midNhd

The basic neighbourhoods of the points mid n are open.

theorem isOpen_midNhd (n M : ℕ) : IsOpen (midNhd n M)
Proof
:= by
  refine ⟨fun j hj ↦ absurd hj pole_notMem_midNhd, fun k hk ↦ ?_⟩
  rw [mid_mem_midNhd] at hk
  exact (eventually_ge_atTop M).mono fun m hm i ↦ iso_mem_midNhd.2 ⟨hk, hm⟩

theorem hasBasis_nhds_pole

TopologyByExample.NonUrysohn.hasBasis_nhds_pole

The sets poleNhd i N form a base of neighbourhoods of pole i.

theorem hasBasis_nhds_pole (i : Bool) : (𝓝 (pole i)).HasBasis (fun _ ↦ True) (poleNhd i)
Proof
:= by
  refine ⟨fun t ↦ ⟨fun ht ↦ ?_, fun ⟨N, _, hN⟩ ↦
    mem_of_superset ((isOpen_poleNhd i N).mem_nhds (by simp)) hN⟩⟩
  obtain ⟨V, hVt, hV, hiV⟩ := mem_nhds_iff.1 ht
  obtain ⟨N, hN⟩ := eventually_atTop.1 (hV.1 i hiV)
  refine ⟨N, trivial, fun x hx ↦ hVt ?_⟩
  rcases x with j | k | ⟨j, n, m⟩
  · rw [pole_mem_poleNhd] at hx
    exact hx ▸ hiV
  · exact absurd hx mid_notMem_poleNhd
  · obtain ⟨rfl, hn⟩ := iso_mem_poleNhd.1 hx
    exact hN n hn m

theorem hasBasis_nhds_mid

TopologyByExample.NonUrysohn.hasBasis_nhds_mid

The sets midNhd n M form a base of neighbourhoods of mid n.

theorem hasBasis_nhds_mid (n : ℕ) : (𝓝 (mid n)).HasBasis (fun _ ↦ True) (midNhd n)
Proof
:= by
  refine ⟨fun t ↦ ⟨fun ht ↦ ?_, fun ⟨M, _, hM⟩ ↦
    mem_of_superset ((isOpen_midNhd n M).mem_nhds (by simp)) hM⟩⟩
  obtain ⟨V, hVt, hV, hnV⟩ := mem_nhds_iff.1 ht
  obtain ⟨M, hM⟩ := eventually_atTop.1 (hV.2 n hnV)
  refine ⟨M, trivial, fun x hx ↦ hVt ?_⟩
  rcases x with j | k | ⟨j, k, m⟩
  · exact absurd hx pole_notMem_midNhd
  · rw [mid_mem_midNhd] at hx
    exact hx ▸ hnV
  · obtain ⟨rfl, hm⟩ := iso_mem_midNhd.1 hx
    exact hM m hm j

theorem isOpen_singleton_iso

TopologyByExample.NonUrysohn.isOpen_singleton_iso

The points iso i n m are isolated.

theorem isOpen_singleton_iso (i : Bool) (n m : ℕ) : IsOpen ({iso i n m} : Set NonUrysohn)
Proof
:=
  ⟨fun _ h ↦ by simp at h, fun _ h ↦ by simp at h⟩

theorem isClosed_singleton_iso

TopologyByExample.NonUrysohn.isClosed_singleton_iso

The points iso i n m are closed.

theorem isClosed_singleton_iso (i : Bool) (n m : ℕ) : IsClosed ({iso i n m} : Set NonUrysohn)
Proof
:= by
  refine ⟨fun j _ ↦ (eventually_gt_atTop n).mono fun k hk m' ↦ ?_,
    fun k _ ↦ (eventually_gt_atTop m).mono fun m' hm' j ↦ ?_⟩
  · simp only [mem_compl_iff, mem_singleton_iff, iso.injEq, not_and]
    omega
  · simp only [mem_compl_iff, mem_singleton_iff, iso.injEq, not_and]
    omega

theorem nhds_iso

TopologyByExample.NonUrysohn.nhds_iso

The neighbourhood filter of an isolated point.

theorem nhds_iso (i : Bool) (n m : ℕ) : 𝓝 (iso i n m) = pure (iso i n m)
Proof
:=
  (isOpen_singleton_iff_nhds_eq_pure _).1 (isOpen_singleton_iso i n m)

Countability

instance

The space is first countable: each point has a neighbourhood base indexed by ℕ.

instance : FirstCountableTopology NonUrysohn
Proof
where
  nhds_generated_countable
    | pole i => (hasBasis_nhds_pole i).isCountablyGenerated
    | mid n => (hasBasis_nhds_mid n).isCountablyGenerated
    | iso i n m => by rw [nhds_iso]; infer_instance

instance

The space is second countable: it is countable and first countable.

instance : SecondCountableTopology NonUrysohn
Proof
:= inferInstance

Separation

theorem exists_open_iso

TopologyByExample.NonUrysohn.exists_open_iso

An isolated point and any other point have disjoint open neighbourhoods.

theorem exists_open_iso {i : Bool} {n m : ℕ} {y : NonUrysohn} (h : iso i n m ≠ y) :
    ∃ u v : Set NonUrysohn, IsOpen u ∧ IsOpen v ∧ iso i n m ∈ u ∧ y ∈ v ∧ Disjoint u v
Proof
:=
  ⟨{iso i n m}, {iso i n m}ᶜ, isOpen_singleton_iso i n m,
    (isClosed_singleton_iso i n m).isOpen_compl, rfl, h.symm, disjoint_compl_right⟩

instance

The space is Hausdorff. Two poles are separated by poleNhd false 0 and poleNhd true 0; pole i and mid k by poleNhd i (k + 1) and midNhd k 0; mid n and mid k by midNhd n 0 and midNhd k 0; an isolated point by its singleton and the complement.

instance : T2Space NonUrysohn
Proof
where
  t2 x y hxy := by
    rcases x with i | n | ⟨i, n, m⟩
    · rcases y with j | k | ⟨j, k, m⟩
      · refine ⟨poleNhd i 0, poleNhd j 0, isOpen_poleNhd i 0, isOpen_poleNhd j 0, by simp, by simp,
          disjoint_left.2 fun z hz hz' ↦ ?_⟩
        rcases z with _ | _ | _ <;> simp_all
      · refine ⟨poleNhd i (k + 1), midNhd k 0, isOpen_poleNhd _ _, isOpen_midNhd _ _, by simp,
          by simp, disjoint_left.2 fun z hz hz' ↦ ?_⟩
        rcases z with _ | _ | _ <;> simp_all
      · obtain ⟨u, v, hu, hv, hxu, hyv, huv⟩ := exists_open_iso (Ne.symm hxy)
        exact ⟨v, u, hv, hu, hyv, hxu, huv.symm⟩
    · rcases y with j | k | ⟨j, k, m⟩
      · refine ⟨midNhd n 0, poleNhd j (n + 1), isOpen_midNhd _ _, isOpen_poleNhd _ _, by simp,
          by simp, disjoint_left.2 fun z hz hz' ↦ ?_⟩
        rcases z with _ | _ | _ <;> simp_all
      · refine ⟨midNhd n 0, midNhd k 0, isOpen_midNhd _ _, isOpen_midNhd _ _, by simp, by simp,
          disjoint_left.2 fun z hz hz' ↦ ?_⟩
        rcases z with _ | _ | _ <;> simp_all
      · obtain ⟨u, v, hu, hv, hxu, hyv, huv⟩ := exists_open_iso (Ne.symm hxy)
        exact ⟨v, u, hv, hu, hyv, hxu, huv.symm⟩
    · exact exists_open_iso hxy

theorem mid_mem_closure_poleNhd

TopologyByExample.NonUrysohn.mid_mem_closure_poleNhd

For N ≤ n, the point mid n lies in the closure of the basic neighbourhood poleNhd i N of either pole.

theorem mid_mem_closure_poleNhd {i : Bool} {N n : ℕ} (h : N ≤ n) :
    mid n ∈ closure (poleNhd i N)
Proof
:=
  (mem_closure_iff_nhds_basis' (hasBasis_nhds_mid n)).2 fun M _ ↦ ⟨iso i n M, by simp [h]⟩

theorem closure_inter_closure_nonempty

TopologyByExample.NonUrysohn.closure_inter_closure_nonempty

The closures of a neighbourhood of pole false and of a neighbourhood of pole true always meet.

theorem closure_inter_closure_nonempty {s t : Set NonUrysohn} (hs : s ∈ 𝓝 (pole false))
    (ht : t ∈ 𝓝 (pole true)) : (closure s ∩ closure t).Nonempty
Proof
:= by
  obtain ⟨N, -, hN⟩ := (hasBasis_nhds_pole false).mem_iff.1 hs
  obtain ⟨N', -, hN'⟩ := (hasBasis_nhds_pole true).mem_iff.1 ht
  exact ⟨mid (max N N'), closure_mono hN (mid_mem_closure_poleNhd (le_max_left N N')),
    closure_mono hN' (mid_mem_closure_poleNhd (le_max_right N N'))⟩

On this site: A countable Hausdorff space that is not Urysohn: The closures of neighbourhoods of the two poles meet

theorem not_t25Space

TopologyByExample.NonUrysohn.not_t25Space

The space is not Urysohn: the two poles have no neighbourhoods with disjoint closures.

theorem not_t25Space : ¬T25Space NonUrysohn
Proof
:= fun _ ↦ by
  obtain ⟨s, hs, t, ht, hst⟩ :=
    exists_nhds_disjoint_closure (x := pole false) (y := pole true) (by simp)
  exact (closure_inter_closure_nonempty hs ht).ne_empty hst.inter_eq

On this site: The countable Hausdorff space that is not Urysohn is not Urysohn

theorem eq_of_continuous

TopologyByExample.NonUrysohn.eq_of_continuous

A continuous map from the space to a Urysohn space (such as ℝ) takes the same value at the two poles.

theorem eq_of_continuous {Y : Type*} [TopologicalSpace Y] [T25Space Y] {f : NonUrysohn → Y}
    (hf : Continuous f) : f (pole false) = f (pole true)
Proof
:= by
  by_contra hne
  obtain ⟨s, hs, t, ht, hst⟩ := exists_nhds_disjoint_closure hne
  obtain ⟨z, hzs, hzt⟩ := closure_inter_closure_nonempty (hf.continuousAt.preimage_mem_nhds hs)
    (hf.continuousAt.preimage_mem_nhds ht)
  exact hst.le_bot ⟨hf.closure_preimage_subset s hzs, hf.closure_preimage_subset t hzt⟩

On this site: A countable Hausdorff space that is not Urysohn: Continuous maps to Urysohn spaces identify the poles

Compactness

theorem exists_mem_nhds_eventually_mid_notMem

TopologyByExample.NonUrysohn.exists_mem_nhds_eventually_mid_notMem

Every point has a neighbourhood containing mid n for at most one n.

theorem exists_mem_nhds_eventually_mid_notMem (x : NonUrysohn) :
    ∃ U ∈ 𝓝 x, ∀ᶠ n in atTop, mid n ∉ U
Proof
:= by
  rcases x with i | k | ⟨i, k, m⟩
  · exact ⟨poleNhd i 0, (hasBasis_nhds_pole i).mem_of_mem trivial,
      Eventually.of_forall fun _ ↦ mid_notMem_poleNhd⟩
  · exact ⟨midNhd k 0, (hasBasis_nhds_mid k).mem_of_mem trivial,
      (eventually_gt_atTop k).mono fun n hn h ↦ hn.ne' (mid_mem_midNhd.1 h)⟩
  · exact ⟨{iso i k m}, (isOpen_singleton_iso i k m).mem_nhds rfl,
      Eventually.of_forall fun _ h ↦ by simp at h⟩

On this site: A countable Hausdorff space that is not Urysohn: Every point has a neighbourhood containing only finitely many points \(c_n\)

theorem not_countablyCompactSpace

TopologyByExample.NonUrysohn.not_countablyCompactSpace

The space is not countably compact: the sequence mid n has no cluster point.

theorem not_countablyCompactSpace : ¬CountablyCompactSpace NonUrysohn
Proof
:= fun h ↦ by
  obtain ⟨x, -, hx⟩ := h.isCountablyCompact_univ.seq_clusterPt mid (by simp)
  obtain ⟨U, hU, hmid⟩ := exists_mem_nhds_eventually_mid_notMem x
  obtain ⟨n, hn, hn'⟩ := ((hx.frequently hU).and_eventually hmid).exists
  exact hn' hn

On this site: The countable Hausdorff space that is not Urysohn is not countably compact

Total disconnectedness

theorem isOpen_of_forall_iso_mem

TopologyByExample.NonUrysohn.isOpen_of_forall_iso_mem

A set containing every isolated point is open.

theorem isOpen_of_forall_iso_mem {U : Set NonUrysohn} (h : ∀ i n m, iso i n m ∈ U) : IsOpen U
Proof
:=
  isOpen_iff.2 ⟨fun i _ ↦ .of_forall fun _ m ↦ h i _ m, fun _ _ ↦ .of_forall fun _ i ↦ h i _ _⟩

instance instTotallyDisconnectedSpace

TopologyByExample.NonUrysohn.instTotallyDisconnectedSpace

The countable non-Urysohn space is totally disconnected. A preconnected set containing an isolated point is that point, since the point is clopen. A preconnected set with no isolated points and containing a point x lies in the union of the open sets {x} ∪ I and {x}ᶜ, where I is the set of isolated points; it meets both only in points of I, so it is {x}.

instance instTotallyDisconnectedSpace : TotallyDisconnectedSpace NonUrysohn
Proof
:= by
  refine (totallyDisconnectedSpace_iff _).2 fun t _ ht x hx y hy ↦ ?_
  by_cases hiso : ∃ i n m, iso i n m ∈ t
  · obtain ⟨i, n, m, h⟩ := hiso
    have hsub := ht.subset_isClopen ⟨isClosed_singleton_iso i n m, isOpen_singleton_iso i n m⟩
      ⟨_, h, rfl⟩
    exact (hsub hx).trans (hsub hy).symm
  · simp only [not_exists] at hiso
    by_contra hxy
    obtain ⟨z, hzt, hz₁, hz₂⟩ := ht (insert x (range fun p : Bool × ℕ × ℕ ↦ iso p.1 p.2.1 p.2.2))
      {x}ᶜ (isOpen_of_forall_iso_mem fun i n m ↦ .inr ⟨(i, n, m), rfl⟩)
      (isOpen_of_forall_iso_mem fun i n m h ↦ hiso i n m (h ▸ hx)) (fun z _ ↦ by
        by_cases h : z = x
        · exact .inl (.inl h)
        · exact .inr h) ⟨x, hx, mem_insert _ _⟩ ⟨y, hy, Ne.symm hxy⟩
    rcases hz₁ with rfl | ⟨p, rfl⟩
    · exact hz₂ rfl
    · exact hiso _ _ _ hzt

The countable non-Urysohn space

theorem iso_mem_of_mem_closure

TopologyByExample.NonUrysohn.iso_mem_of_mem_closure

A point of the closure of a set that is isolated lies in the set.

theorem iso_mem_of_mem_closure {s : Set NonUrysohn} {i : Bool} {n m : ℕ}
    (h : iso i n m ∈ closure s) : iso i n m ∈ s
Proof
:= by
  obtain ⟨_, rfl, hx⟩ := mem_closure_iff.1 h _ (isOpen_singleton_iso i n m) rfl
  exact hx

theorem isClosed_midNhd

TopologyByExample.NonUrysohn.isClosed_midNhd

The basic neighbourhood midNhd n M is closed.

theorem isClosed_midNhd (n M : ℕ) : IsClosed (midNhd n M)
Proof
:= by
  refine closure_subset_iff_isClosed.1 fun x hx ↦ ?_
  rcases x with j | k | ⟨j, k, m⟩
  · obtain ⟨y, hy, hy'⟩ := mem_closure_iff.1 hx _ (isOpen_poleNhd j (n + 1)) (by simp)
    rcases y with _ | _ | _ <;> simp_all
  · obtain ⟨y, hy, hy'⟩ := mem_closure_iff.1 hx _ (isOpen_midNhd k 0) (by simp)
    rcases y with _ | _ | _ <;> simp_all
  · exact iso_mem_of_mem_closure hx

theorem isRegularOpen_poleNhd

TopologyByExample.NonUrysohn.isRegularOpen_poleNhd

The basic neighbourhood poleNhd i N is regular open: the closure adds only points mid n, and every neighbourhood of mid n contains points on the other side.

theorem isRegularOpen_poleNhd (i : Bool) (N : ℕ) : IsRegularOpen (poleNhd i N)
Proof
:= by
  refine subset_antisymm (fun x hx ↦ ?_)
    (interior_maximal subset_closure (isOpen_poleNhd i N))
  have hxc := interior_subset hx
  rcases x with j | k | ⟨j, k, m⟩
  · obtain ⟨y, hy, hy'⟩ := mem_closure_iff.1 hxc _ (isOpen_poleNhd j 0) (by simp)
    rcases y with _ | _ | _ <;> simp_all
  · obtain ⟨M, -, hM⟩ := (hasBasis_nhds_mid k).mem_iff.1 (mem_interior_iff_mem_nhds.1 hx)
    have := iso_mem_of_mem_closure (hM (a := iso (!i) k M) (by simp))
    simp at this
  · exact iso_mem_of_mem_closure hxc

instance instSemiregularSpace

TopologyByExample.NonUrysohn.instSemiregularSpace

The countable non-Urysohn space is semiregular: its basic neighbourhoods are regular open.

instance instSemiregularSpace : SemiregularSpace NonUrysohn
Proof
:= by
  rw [semiregularSpace_iff_isRegularOpen]
  refine isTopologicalBasis_of_isOpen_of_nhds (fun _ hs ↦ IsRegularOpen.isOpen hs)
    fun x U hx hU ↦ ?_
  rcases x with i | n | ⟨i, n, m⟩
  · obtain ⟨N, -, hN⟩ := (hasBasis_nhds_pole i).mem_iff.1 (hU.mem_nhds hx)
    exact ⟨poleNhd i N, isRegularOpen_poleNhd i N, by simp, hN⟩
  · obtain ⟨M, -, hM⟩ := (hasBasis_nhds_mid n).mem_iff.1 (hU.mem_nhds hx)
    exact ⟨midNhd n M, IsClopen.isRegularOpen ⟨isClosed_midNhd n M, isOpen_midNhd n M⟩,
      by simp, hM⟩
  · exact ⟨{iso i n m},
      IsClopen.isRegularOpen ⟨isClosed_singleton_iso i n m, isOpen_singleton_iso i n m⟩, rfl,
      singleton_subset_iff.2 hx⟩

On this site: The countable Hausdorff space that is not Urysohn is semiregular

instance instScatteredSpace

TopologyByExample.NonUrysohn.instScatteredSpace

The countable non-Urysohn space is scattered: a nonempty set contains an isolated point, or a point mid n, isolated in it by midNhd n 0, or else a pole, isolated in it by poleNhd i 0.

instance instScatteredSpace : ScatteredSpace NonUrysohn
Proof
:= by
  refine scatteredSpace_iff_exists_isolated.2 fun s hs ↦ ?_
  by_cases hiso : ∃ i n m, iso i n m ∈ s
  · obtain ⟨i, n, m, h⟩ := hiso
    exact ⟨_, h, _, (isOpen_singleton_iso i n m).mem_nhds rfl, inter_subset_left⟩
  push Not at hiso
  by_cases hmid : ∃ n, mid n ∈ s
  · obtain ⟨n, h⟩ := hmid
    refine ⟨_, h, _, (hasBasis_nhds_mid n).mem_of_mem (i := 0) trivial, ?_⟩
    rintro (j | k | ⟨j, k, m⟩) ⟨hy, hy'⟩
    · simp at hy
    · simp_all
    · exact absurd hy' (hiso j k m)
  push Not at hmid
  obtain ⟨x, hx⟩ := hs
  rcases x with i | n | ⟨i, n, m⟩
  · refine ⟨_, hx, _, (hasBasis_nhds_pole i).mem_of_mem (i := 0) trivial, ?_⟩
    rintro (j | k | ⟨j, k, m⟩) ⟨hy, hy'⟩
    · simp_all
    · exact absurd hy' (hmid k)
    · exact absurd hy' (hiso j k m)
  · exact absurd hx (hmid n)
  · exact absurd hx (hiso i n m)

On this site: The countable Hausdorff space that is not Urysohn is scattered

theorem isCompact_column

TopologyByExample.NonUrysohn.isCompact_column

The column n with its limit mid n is compact.

theorem isCompact_column (n : ℕ) :
    IsCompact (insert (mid n) (range (iso false n)) ∪ insert (mid n) (range (iso true n)))
Proof
:= by
  have ht (i : Bool) : Tendsto (iso i n) atTop (𝓝 (mid n)) :=
    (hasBasis_nhds_mid n).tendsto_right_iff.2 fun M _ ↦
      (eventually_ge_atTop M).mono fun m hm ↦ iso_mem_midNhd.2 ⟨rfl, hm⟩
  exact (ht false).isCompact_insert_range.union (ht true).isCompact_insert_range

instance instPseudocompactSpace

TopologyByExample.NonUrysohn.instPseudocompactSpace

The countable non-Urysohn space is pseudocompact. Continuity at the poles bounds a continuous real function on the columns from some N on, together with their limits mid n, which lie in the closure of the basic neighbourhoods of the poles; the finitely many columns before N are compact.

instance instPseudocompactSpace : PseudocompactSpace NonUrysohn
Proof
:= by
  refine ⟨fun f ↦ ?_⟩
  suffices h : Bornology.IsBounded (range f) from ⟨h.bddAbove, h.bddBelow⟩
  have hN (i : Bool) : ∃ N, poleNhd i N ⊆ f ⁻¹' Metric.ball (f (pole i)) 1 := by
    obtain ⟨N, -, hN⟩ := (hasBasis_nhds_pole i).mem_iff.1
      (f.continuous.continuousAt.preimage_mem_nhds (Metric.ball_mem_nhds _ one_pos))
    exact ⟨N, hN⟩
  choose N hN using hN
  set M := max (N false) (N true)
  have hmono (i : Bool) (hi : N i ≤ M) : poleNhd i M ⊆ poleNhd i (N i) := by
    rintro (j | k | ⟨j, k, m⟩) h
    · exact h
    · exact h
    · exact ⟨h.1, hi.trans h.2⟩
  set U := poleNhd false M ∪ poleNhd true M
  have hU : Bornology.IsBounded (f '' U) := by
    refine ((Metric.isBounded_ball (x := f (pole false)) (r := 1)).union
      (Metric.isBounded_ball (x := f (pole true)) (r := 1))).subset ?_
    rintro _ ⟨p, hp | hp, rfl⟩
    · exact .inl (hN false (hmono false (le_max_left _ _) hp))
    · exact .inr (hN true (hmono true (le_max_right _ _) hp))
  have hcl : Bornology.IsBounded (f '' closure U) :=
    hU.closure.subset (image_closure_subset_closure_image f.continuous)
  set K := ⋃ n < M, (insert (mid n) (range (iso false n)) ∪ insert (mid n) (range (iso true n)))
  have hK : IsCompact K := (finite_lt_nat M).isCompact_biUnion fun n _ ↦ isCompact_column n
  refine (hcl.union (hK.image f.continuous).isBounded).subset ?_
  rintro _ ⟨p, rfl⟩
  rcases p with i | n | ⟨i, n, m⟩
  · refine .inl (mem_image_of_mem f (subset_closure ?_))
    cases i
    · exact .inl (by simp)
    · exact .inr (by simp)
  · by_cases h : n < M
    · exact .inr (mem_image_of_mem f (mem_iUnion₂.2 ⟨n, h, Or.inl (mem_insert _ _)⟩))
    · exact .inl (mem_image_of_mem f
        (closure_mono subset_union_left (mid_mem_closure_poleNhd (not_lt.1 h))))
  · by_cases h : n < M
    · refine .inr (mem_image_of_mem f (mem_iUnion₂.2 ⟨n, h, ?_⟩))
      cases i
      · exact Or.inl (Or.inr ⟨m, rfl⟩)
      · exact Or.inr (Or.inr ⟨m, rfl⟩)
    · refine .inl (mem_image_of_mem f (subset_closure ?_))
      cases i
      · exact .inl (by simp [not_lt.1 h])
      · exact .inr (by simp [not_lt.1 h])

On this site: The countable Hausdorff space that is not Urysohn is pseudocompact