Lean library · module TopologyByExample.Spaces.IrregularLattice

The irregular lattice topology

Source file

In this file we define TopologyByExample.IrregularLattice, a countable space of lattice points that is totally separated but neither regular nor semiregular. Its points are a corner corner, standing for the lattice point (0, 0), points base i (i : ℕ), standing for the points (i + 1, 0) of the horizontal axis, and isolated points iso i k, standing for the points (i + 1, k + 1).

  • A basic neighbourhood of base i is base i together with the points iso i k, M ≤ k: the points above base i in its column, from some height on.
  • A basic neighbourhood of corner is corner together with the points iso i k with N ≤ i and N ≤ k: a quadrant of the isolated points.

The quadrant cornerNhd N is open, but its closure contains every point base i with N ≤ i, together with a neighbourhood of it; so the closure of a neighbourhood of corner never lies in cornerNhd 0, and no regular open neighbourhood of corner does either. Every other point has a base of clopen neighbourhoods.

Main definitions

Main statements

Tags

irregular lattice topology, semiregular, totally separated, 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 IrregularLattice

TopologyByExample.IrregularLattice

The points of the irregular lattice topology: the corner (0, 0), the points base i of the horizontal axis (standing for (i + 1, 0)), and the isolated points iso i k (standing for (i + 1, k + 1)).

inductive IrregularLattice : Type
  /-- The corner `(0, 0)`. -/
  | corner
  /-- The point `(i + 1, 0)` of the horizontal axis. -/
  | base (i : ℕ)
  /-- The isolated point `(i + 1, k + 1)`. -/
  | iso (i k : ℕ)
  deriving DecidableEq

On this site: Space: Irregular lattice topology

definition encode

TopologyByExample.IrregularLattice.encode

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

def encode : IrregularLattice → Unit ⊕ ℕ ⊕ (ℕ × ℕ)
  | corner => .inl ()
  | base i => .inr (.inl i)
  | iso i k => .inr (.inr (i, k))

theorem encode_injective

TopologyByExample.IrregularLattice.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 IrregularLattice
Proof
:= encode_injective.countable

instance

A set is open if, whenever it contains corner, it contains iso i k for all i, k ≥ N for some N, and whenever it contains base i, it contains iso i k for all large k.

instance : TopologicalSpace IrregularLattice
Proof
where
  IsOpen U := (corner ∈ U → ∀ᶠ N in atTop, ∀ i k, N ≤ i → N ≤ k → iso i k ∈ U) ∧
    ∀ i, base i ∈ U → ∀ᶠ M in atTop, ∀ k, M ≤ k → iso i k ∈ U
  isOpen_univ := by simp
  isOpen_inter s t hs ht :=
    ⟨fun h ↦ ((hs.1 h.1).and (ht.1 h.2)).mono fun _ h i k hi hk ↦ ⟨h.1 i k hi hk, h.2 i k hi hk⟩,
      fun i h ↦ ((hs.2 i h.1).and (ht.2 i h.2)).mono fun _ h k hk ↦ ⟨h.1 k hk, h.2 k hk⟩⟩
  isOpen_sUnion S hS :=
    ⟨fun ⟨t, ht, h⟩ ↦ ((hS t ht).1 h).mono fun _ h i k hi hk ↦ ⟨t, ht, h i k hi hk⟩,
      fun i ⟨t, ht, h⟩ ↦ ((hS t ht).2 i h).mono fun _ h k hk ↦ ⟨t, ht, h k hk⟩⟩

theorem isOpen_iff

TopologyByExample.IrregularLattice.isOpen_iff

The open sets of the space, by definition.

theorem isOpen_iff {U : Set IrregularLattice} :
    IsOpen U ↔ (corner ∈ U → ∀ᶠ N in atTop, ∀ i k, N ≤ i → N ≤ k → iso i k ∈ U) ∧
      ∀ i, base i ∈ U → ∀ᶠ M in atTop, ∀ k, M ≤ k → iso i k ∈ U
Proof
:=
  Iff.rfl

Basic neighbourhoods

definition cornerNhd

TopologyByExample.IrregularLattice.cornerNhd

The basic neighbourhood of corner: the corner together with the points iso i k with N ≤ i and N ≤ k.

def cornerNhd (N : ℕ) : Set IrregularLattice
Definition
:=
  {x | match x with
    | corner => True
    | base _ => False
    | iso i k => N ≤ i ∧ N ≤ k}

definition baseNhd

TopologyByExample.IrregularLattice.baseNhd

The basic neighbourhood of base i: the point together with the points iso i k with M ≤ k.

def baseNhd (i M : ℕ) : Set IrregularLattice
Definition
:=
  {x | match x with
    | corner => False
    | base j => j = i
    | iso j k => j = i ∧ M ≤ k}

theorem corner_mem_cornerNhd

TopologyByExample.IrregularLattice.corner_mem_cornerNhd

corner lies in each of its basic neighbourhoods.

@[simp] theorem corner_mem_cornerNhd {N : ℕ} : corner ∈ cornerNhd N
Proof
:= trivial

theorem base_notMem_cornerNhd

TopologyByExample.IrregularLattice.base_notMem_cornerNhd

cornerNhd N contains no point base j.

@[simp] theorem base_notMem_cornerNhd {N j : ℕ} : base j ∉ cornerNhd N
Proof
:= id

theorem iso_mem_cornerNhd

TopologyByExample.IrregularLattice.iso_mem_cornerNhd

The isolated points of cornerNhd N.

@[simp] theorem iso_mem_cornerNhd {N i k : ℕ} : iso i k ∈ cornerNhd N ↔ N ≤ i ∧ N ≤ k
Proof
:= Iff.rfl

theorem corner_notMem_baseNhd

TopologyByExample.IrregularLattice.corner_notMem_baseNhd

baseNhd i M does not contain corner.

@[simp] theorem corner_notMem_baseNhd {i M : ℕ} : corner ∉ baseNhd i M
Proof
:= id

theorem base_mem_baseNhd

TopologyByExample.IrregularLattice.base_mem_baseNhd

The only point base j in baseNhd i M is base i.

@[simp] theorem base_mem_baseNhd {i M j : ℕ} : base j ∈ baseNhd i M ↔ j = i
Proof
:= Iff.rfl

theorem iso_mem_baseNhd

TopologyByExample.IrregularLattice.iso_mem_baseNhd

The isolated points of baseNhd i M.

@[simp] theorem iso_mem_baseNhd {i M j k : ℕ} : iso j k ∈ baseNhd i M ↔ j = i ∧ M ≤ k
Proof
:= Iff.rfl

theorem isOpen_cornerNhd

TopologyByExample.IrregularLattice.isOpen_cornerNhd

The basic neighbourhoods of corner are open.

theorem isOpen_cornerNhd (N : ℕ) : IsOpen (cornerNhd N)
Proof
:=
  ⟨fun _ ↦ (eventually_ge_atTop N).mono fun _ h _ _ hi hk ↦ ⟨h.trans hi, h.trans hk⟩,
    fun _ h ↦ absurd h base_notMem_cornerNhd⟩

theorem isOpen_baseNhd

TopologyByExample.IrregularLattice.isOpen_baseNhd

The basic neighbourhoods of the points base i are open.

theorem isOpen_baseNhd (i M : ℕ) : IsOpen (baseNhd i M)
Proof
:= by
  refine ⟨fun h ↦ absurd h corner_notMem_baseNhd, fun j hj ↦ ?_⟩
  rw [base_mem_baseNhd] at hj
  exact (eventually_ge_atTop M).mono fun _ h k hk ↦ ⟨hj, h.trans hk⟩

theorem hasBasis_nhds_corner

TopologyByExample.IrregularLattice.hasBasis_nhds_corner

The sets cornerNhd N form a base of neighbourhoods of corner.

theorem hasBasis_nhds_corner : (𝓝 corner).HasBasis (fun _ ↦ True) cornerNhd
Proof
:= by
  refine ⟨fun t ↦ ⟨fun ht ↦ ?_, fun ⟨N, _, hN⟩ ↦
    mem_of_superset ((isOpen_cornerNhd N).mem_nhds (by simp)) hN⟩⟩
  obtain ⟨V, hVt, hV, hcV⟩ := mem_nhds_iff.1 ht
  obtain ⟨N, hN⟩ := eventually_atTop.1 (hV.1 hcV)
  refine ⟨N, trivial, fun x hx ↦ hVt ?_⟩
  rcases x with _ | j | ⟨i, k⟩
  · exact hcV
  · exact absurd hx base_notMem_cornerNhd
  · exact hN N le_rfl i k hx.1 hx.2

theorem hasBasis_nhds_base

TopologyByExample.IrregularLattice.hasBasis_nhds_base

The sets baseNhd i M form a base of neighbourhoods of base i.

theorem hasBasis_nhds_base (i : ℕ) : (𝓝 (base i)).HasBasis (fun _ ↦ True) (baseNhd i)
Proof
:= by
  refine ⟨fun t ↦ ⟨fun ht ↦ ?_, fun ⟨M, _, hM⟩ ↦
    mem_of_superset ((isOpen_baseNhd i M).mem_nhds (by simp)) hM⟩⟩
  obtain ⟨V, hVt, hV, hiV⟩ := mem_nhds_iff.1 ht
  obtain ⟨M, hM⟩ := eventually_atTop.1 (hV.2 i hiV)
  refine ⟨M, trivial, fun x hx ↦ hVt ?_⟩
  rcases x with _ | j | ⟨j, k⟩
  · exact absurd hx corner_notMem_baseNhd
  · rw [base_mem_baseNhd] at hx
    exact hx ▸ hiV
  · obtain ⟨rfl, hk⟩ := iso_mem_baseNhd.1 hx
    exact hM M le_rfl k hk

theorem isOpen_singleton_iso

TopologyByExample.IrregularLattice.isOpen_singleton_iso

The points iso i k are isolated.

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

theorem nhds_iso

TopologyByExample.IrregularLattice.nhds_iso

The neighbourhood filter of an isolated point.

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

theorem iso_mem_of_mem_closure

TopologyByExample.IrregularLattice.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 IrregularLattice} {i k : ℕ}
    (h : iso i k ∈ closure s) : iso i k ∈ s
Proof
:= by
  obtain ⟨_, rfl, hx⟩ := mem_closure_iff.1 h _ (isOpen_singleton_iso i k) rfl
  exact hx

Countability

instance

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

instance : FirstCountableTopology IrregularLattice
Proof
where
  nhds_generated_countable
    | corner => hasBasis_nhds_corner.isCountablyGenerated
    | base i => (hasBasis_nhds_base i).isCountablyGenerated
    | iso i k => by rw [nhds_iso]; infer_instance

instance

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

instance : SecondCountableTopology IrregularLattice
Proof
:= inferInstance

Clopen sets and total separatedness

theorem isClosed_singleton_iso

TopologyByExample.IrregularLattice.isClosed_singleton_iso

The singletons of isolated points are closed.

theorem isClosed_singleton_iso (i k : ℕ) : IsClosed ({iso i k} : Set IrregularLattice)
Proof
:= by
  refine ⟨fun _ ↦ (eventually_gt_atTop i).mono fun N hN i' k' hi' _ ↦ ?_,
    fun j _ ↦ (eventually_gt_atTop k).mono fun M hM k' hk' ↦ ?_⟩
  · 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 isClosed_baseNhd

TopologyByExample.IrregularLattice.isClosed_baseNhd

The basic neighbourhoods of the points base i are closed.

theorem isClosed_baseNhd (i M : ℕ) : IsClosed (baseNhd i M)
Proof
:= by
  refine ⟨fun _ ↦ (eventually_gt_atTop i).mono fun N hN i' k hi' _ h ↦ ?_,
    fun j hj ↦ .of_forall fun _ k _ h ↦ hj ?_⟩
  · exact (hN.trans_le hi').ne' (iso_mem_baseNhd.1 h).1
  · rw [base_mem_baseNhd]
    exact (iso_mem_baseNhd.1 h).1

instance

The irregular lattice is totally separated. Of two distinct points, one is not corner, and it has a clopen neighbourhood not containing the other: its own singleton if it is isolated, and a basic neighbourhood baseNhd i M if it is base i.

instance : TotallySeparatedSpace IrregularLattice
Proof
:= by
  have key : ∀ x y : IrregularLattice, x ≠ y → x ≠ corner →
      ∃ U : Set IrregularLattice, IsClopen U ∧ x ∈ U ∧ y ∈ Uᶜ := by
    intro x y hxy hx
    rcases x with _ | i | ⟨i, k⟩
    · exact absurd rfl hx
    · refine ⟨baseNhd i (match y with | iso _ k => k + 1 | _ => 0),
        ⟨isClosed_baseNhd _ _, isOpen_baseNhd _ _⟩, by simp, ?_⟩
      rcases y with _ | j | ⟨j, k⟩
      · simp
      · simpa [eq_comm] using hxy
      · simp
    · exact ⟨{iso i k}, ⟨isClosed_singleton_iso i k, isOpen_singleton_iso i k⟩, rfl,
        fun h ↦ hxy (mem_singleton_iff.1 h).symm⟩
  refine totallySeparatedSpace_iff_exists_isClopen.2 fun x y hxy ↦ ?_
  by_cases hx : x = corner
  · obtain ⟨U, hU, hyU, hxU⟩ := key y x (Ne.symm hxy) fun h ↦ hxy (hx.trans h.symm)
    exact ⟨Uᶜ, hU.compl, hxU, by simpa using hyU⟩
  · exact key x y hxy hx

Scatteredness

instance instScatteredSpace

TopologyByExample.IrregularLattice.instScatteredSpace

The irregular lattice is scattered: a nonempty set contains an isolated point, or a point base i, isolated in it by baseNhd i 0, or else it is {corner}.

instance instScatteredSpace : ScatteredSpace IrregularLattice
Proof
:= by
  refine scatteredSpace_iff_exists_isolated.2 fun s hs ↦ ?_
  by_cases hiso : ∃ i k, iso i k ∈ s
  · obtain ⟨i, k, h⟩ := hiso
    exact ⟨_, h, _, (isOpen_singleton_iso i k).mem_nhds rfl, inter_subset_left⟩
  push Not at hiso
  by_cases hbase : ∃ i, base i ∈ s
  · obtain ⟨i, h⟩ := hbase
    refine ⟨_, h, _, (hasBasis_nhds_base i).mem_of_mem (i := 0) trivial, ?_⟩
    rintro (_ | j | ⟨j, k⟩) ⟨hy, hy'⟩
    · exact absurd hy corner_notMem_baseNhd
    · simp_all
    · exact absurd hy' (hiso j k)
  push Not at hbase
  obtain ⟨x, hx⟩ := hs
  rcases x with _ | i | ⟨i, k⟩
  · refine ⟨_, hx, _, hasBasis_nhds_corner.mem_of_mem (i := 0) trivial, ?_⟩
    rintro (_ | j | ⟨j, k⟩) ⟨hy, hy'⟩
    · rfl
    · exact absurd hy' (hbase j)
    · exact absurd hy' (hiso j k)
  · exact absurd hx (hbase i)
  · exact absurd hx (hiso i k)

On this site: Irregular lattice topology is scattered

Failure of semiregularity

theorem base_mem_interior_closure

TopologyByExample.IrregularLattice.base_mem_interior_closure

If a set contains the basic neighbourhood cornerNhd N, the interior of its closure contains base i for every i ≥ N: its closure contains baseNhd i N.

theorem base_mem_interior_closure {s : Set IrregularLattice} {N i : ℕ} (hs : cornerNhd N ⊆ s)
    (hi : N ≤ i) : base i ∈ interior (closure s)
Proof
:= by
  refine interior_maximal (t := baseNhd i N) (fun x hx ↦ ?_) (isOpen_baseNhd i N)
    (base_mem_baseNhd.2 rfl)
  rcases x with _ | j | ⟨j, k⟩
  · exact absurd hx corner_notMem_baseNhd
  · rw [base_mem_baseNhd] at hx
    subst hx
    refine (mem_closure_iff_nhds_basis' (hasBasis_nhds_base j)).2 fun M _ ↦
      ⟨iso j (max M N), iso_mem_baseNhd.2 ⟨rfl, le_max_left _ _⟩,
        hs (iso_mem_cornerNhd.2 ⟨hi, le_max_right _ _⟩)⟩
  · obtain ⟨rfl, hk⟩ := iso_mem_baseNhd.1 hx
    exact subset_closure (hs (iso_mem_cornerNhd.2 ⟨hi, hk⟩))

theorem not_semiregularSpace

TopologyByExample.IrregularLattice.not_semiregularSpace

The irregular lattice is not semiregular: a regular open neighbourhood of corner inside cornerNhd 0 would contain cornerNhd N for some N, and so the point base N of the interior of its closure.

theorem not_semiregularSpace : ¬SemiregularSpace IrregularLattice
Proof
:= fun h ↦ by
  obtain ⟨V, hV, hcV, hV0⟩ := h.isTopologicalBasis.exists_subset_of_mem_open
    (corner_mem_cornerNhd (N := 0)) (isOpen_cornerNhd 0)
  have hVo : IsOpen V := by
    rw [← show interior (closure V) = V from hV]
    exact isOpen_interior
  obtain ⟨N, -, hN⟩ := hasBasis_nhds_corner.mem_iff.1 (hVo.mem_nhds hcV)
  have := base_mem_interior_closure hN le_rfl
  rw [show interior (closure V) = V from hV] at this
  exact base_notMem_cornerNhd (hV0 this)

On this site: Irregular lattice topology is not semiregular

Failure of pseudocompactness

theorem isClosed_range_iso_zero

TopologyByExample.IrregularLattice.isClosed_range_iso_zero

The isolated points iso i 0 of the lowest row form a closed set: a point base i has the neighbourhood baseNhd i 1 and corner the neighbourhood cornerNhd 1, both missing the row.

theorem isClosed_range_iso_zero : IsClosed (range fun i ↦ iso i 0)
Proof
:= by
  refine ⟨fun _ ↦ (eventually_ge_atTop 1).mono fun N hN i k _ hk ⟨j, h⟩ ↦ ?_,
    fun i _ ↦ (eventually_ge_atTop 1).mono fun M hM k hk ⟨j, h⟩ ↦ ?_⟩
  · simp only [iso.injEq] at h
    omega
  · simp only [iso.injEq] at h
    omega

theorem not_pseudocompactSpace

TopologyByExample.IrregularLattice.not_pseudocompactSpace

The irregular lattice is not pseudocompact: the points iso i 0 form an infinite closed set of isolated points.

theorem not_pseudocompactSpace : ¬PseudocompactSpace IrregularLattice
Proof
:=
  not_pseudocompactSpace_of_isClosed_of_isOpen_singleton
    (infinite_range_of_injective fun _ _ h ↦ (iso.inj h).1) isClosed_range_iso_zero
    (by rintro _ ⟨i, rfl⟩; exact isOpen_singleton_iso i 0)

On this site: Irregular lattice topology is not pseudocompact