Lean library · module TopologyByExample.Theorems.ClosedRayTopologies

Closed-ray topologies

Source file

The closed-ray topology of a linearly ordered set X is its upper set (Alexandrov) topology, Mathlib's Topology.WithUpperSet X: the open sets are exactly the upper sets. The smallest open set containing a point x is the closed ray Set.Ici x. It is finer than the right order topology Topology.WithUpper X (the topology generated by the open rays), and the two have the same specialisation order: the closure of a point x is Set.Iic x in both.

This file proves, first for any linear order with a topology satisfying Topology.IsUpperSet and then for Topology.WithUpperSet X, the properties that the family closed-ray-topologies records, under conditions on the order.

Main statements

For a linear order α with the upper set topology:

For any preorder α, TopologyByExample.ClosedRayTopologies.isLeast_upperSet: the upper set topology is the finest topology on α in which the closure of each point a is Set.Iic a.

The statements about Topology.WithUpperSet X that the content names are in the namespace TopologyByExample.ClosedRayTopologies, with the facts about the two examples, [0, 1] ∩ ℚ and ω₁.

Tags

closed-ray topology, upper set topology, Alexandrov topology, right closed-ray topology

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
variable {α : Type*}

instance instPartialOrder

Topology.WithUpperSet.instPartialOrder

WithUpperSet α carries the partial order of α.

instance instPartialOrder [PartialOrder α] : PartialOrder (WithUpperSet α)
Proof
:= ‹PartialOrder α›

instance instLinearOrder

Topology.WithUpperSet.instLinearOrder

WithUpperSet α carries the linear order of α.

instance instLinearOrder [LinearOrder α] : LinearOrder (WithUpperSet α)
Proof
:= ‹LinearOrder α›
variable {α : Type*} [Preorder α] [TopologicalSpace α] [Topology.IsUpperSet α]

theorem isTopologicalBasis_Ici

Topology.IsUpperSet.isTopologicalBasis_Ici

In the upper set topology the closed rays Set.Ici a form a base: Set.Ici a is the smallest open set containing a.

theorem isTopologicalBasis_Ici : IsTopologicalBasis (range (Ici : α → Set α))
Proof
:= by
  refine isTopologicalBasis_of_isOpen_of_nhds ?_ fun a u ha hu ↦
    ⟨Ici a, ⟨a, rfl⟩, mem_Ici.2 le_rfl, fun b hb ↦ (isOpen_iff_isUpperSet.1 hu) hb ha⟩
  rintro _ ⟨a, rfl⟩
  exact isOpen_iff_isUpperSet.2 (_root_.IsUpperSet.Ici a)

theorem secondCountableTopology

Topology.IsUpperSet.secondCountableTopology

The upper set topology of a countable preorder is second countable.

theorem secondCountableTopology [Countable α] : SecondCountableTopology α
Proof
:=
  isTopologicalBasis_Ici.secondCountableTopology (countable_range _)

theorem dense_iff

Topology.IsUpperSet.dense_iff

In the upper set topology a set is dense iff it is cofinal.

theorem dense_iff {s : Set α} : Dense s ↔ ∀ x, ∃ y ∈ s, x ≤ y
Proof
:= by
  rw [dense_iff_closure_eq, closure_eq_lowerClosure, eq_univ_iff_forall]
  simp

On this site: Closed-ray topologies: A set is dense if and only if it is cofinal

theorem separableSpace_iff

Topology.IsUpperSet.separableSpace_iff

The upper set topology is separable iff the order has a countable cofinal subset.

theorem separableSpace_iff :
    SeparableSpace α ↔ ∃ s : Set α, s.Countable ∧ ∀ x, ∃ y ∈ s, x ≤ y
Proof
:= by
  simp only [TopologicalSpace.separableSpace_iff, dense_iff]

theorem baireSpace

Topology.IsUpperSet.baireSpace

If every countable subset is bounded above, the upper set topology is a Baire space: a dense open set is a cofinal upper set, and a common upper bound of one point from each of countably many cofinal upper sets above a given point lies in all of them.

theorem baireSpace (h : ∀ s : Set α, s.Countable → BddAbove s) : BaireSpace α
Proof
:= by
  refine ⟨fun f ho hd ↦ dense_iff.2 fun x ↦ ?_⟩
  choose y hy hxy using fun n ↦ dense_iff.1 (hd n) x
  obtain ⟨b, hb⟩ := h (range y) (countable_range y)
  exact ⟨b, mem_iInter.2 fun n ↦ (isOpen_iff_isUpperSet.1 (ho n)) (hb (mem_range_self n)) (hy n),
    (hxy 0).trans (hb (mem_range_self 0))⟩
variable {α : Type*} [LinearOrder α] [TopologicalSpace α] [Topology.IsUpperSet α]

theorem isChain_isOpen

Topology.IsUpperSet.isChain_isOpen

In the upper set topology of a linear order the open sets form a chain.

theorem isChain_isOpen : IsChain (· ⊆ ·) {s : Set α | IsOpen s}
Proof
:= fun _ hs _ ht _ ↦
  (isOpen_iff_isUpperSet.1 hs).total (isOpen_iff_isUpperSet.1 ht)

On this site: Closed-ray topologies: The open sets form a chain

theorem hereditarilyConnectedSpace

Topology.IsUpperSet.hereditarilyConnectedSpace

The upper set topology of a linear order is hereditarily connected.

theorem hereditarilyConnectedSpace : TopologyByExample.HereditarilyConnectedSpace α
Proof
:=
  TopologyByExample.hereditarilyConnectedSpace_iff_isChain_isOpen.2 isChain_isOpen

theorem compactSpace_of_isBot

Topology.IsUpperSet.compactSpace_of_isBot

The upper set topology of an order with a least element is compact: the only open set containing the least element is the whole space.

theorem compactSpace_of_isBot {x : α} (hx : IsBot x) : CompactSpace α
Proof
:= by
  refine ⟨isCompact_of_finite_subcover fun U hU hcov ↦ ?_⟩
  obtain ⟨i, hi⟩ := mem_iUnion.1 (hcov (mem_univ x))
  exact ⟨{i}, fun y _ ↦ mem_iUnion₂.2
    ⟨i, Finset.mem_singleton_self i, (isOpen_iff_isUpperSet.1 (hU i)) (hx y) hi⟩⟩

theorem compactSpace_iff

Topology.IsUpperSet.compactSpace_iff

The upper set topology of a linear order is compact iff the order is empty or has a least element.

theorem compactSpace_iff : CompactSpace α ↔ IsEmpty α ∨ ∃ x : α, IsBot x
Proof
:= by
  refine ⟨fun _ ↦ ?_, ?_⟩
  · rcases isEmpty_or_nonempty α with hα | ⟨⟨x₀⟩⟩
    · exact .inl hα
    obtain ⟨t, ht⟩ := isCompact_univ.elim_finite_subcover (fun x : α ↦ Ici x)
      (fun x ↦ isOpen_iff_isUpperSet.2 (_root_.IsUpperSet.Ici x))
      (fun x _ ↦ mem_iUnion.2 ⟨x, le_rfl⟩)
    have hne : t.Nonempty := by
      obtain ⟨i, hi, -⟩ := mem_iUnion₂.1 (ht (mem_univ x₀))
      exact ⟨i, hi⟩
    refine .inr ⟨t.min' hne, fun y ↦ ?_⟩
    obtain ⟨i, hi, hyi⟩ := mem_iUnion₂.1 (ht (mem_univ y))
    exact (t.min'_le i hi).trans hyi
  · rintro (h | ⟨x, hx⟩)
    · infer_instance
    · exact compactSpace_of_isBot hx

On this site: Closed-ray topologies: Compact if and only if empty or with a least element

theorem scatteredSpace_iff

Topology.IsUpperSet.scatteredSpace_iff

The upper set topology of a linear order is scattered iff every nonempty subset has a greatest element: a point is isolated in a set exactly when it is the greatest element of the set.

theorem scatteredSpace_iff : TopologyByExample.ScatteredSpace α ↔ WellFoundedGT α
Proof
:= by
  refine ⟨fun hs ↦ WellFounded.wellFounded_iff_has_min.2 fun s hne ↦ ?_, fun _ ↦
    Topology.IsUpperSet.scatteredSpace⟩
  obtain ⟨x, hx, U, hU, hUs⟩ := TopologyByExample.scatteredSpace_iff_exists_isolated.1 hs s hne
  refine ⟨x, hx, fun y hy hxy ↦ ?_⟩
  rw [nhds_eq_principal_Ici, mem_principal] at hU
  exact hxy.ne' (hUs ⟨hU hxy.le, hy⟩)

On this site: Closed-ray topologies: Scattered if and only if conversely well-ordered

theorem isLeast_upperSet

TopologyByExample.ClosedRayTopologies.isLeast_upperSet

The upper set topology of a preorder is the finest topology on it in which the closure of each point a is the closed ray Set.Iic a, that is, in which a ⤳ b exactly when b ≤ a. (For topologies t ≤ t' means that t is finer.)

theorem isLeast_upperSet {α : Type*} [Preorder α] :
    IsLeast {t : TopologicalSpace α | ∀ a b : α, @Specializes α t a b ↔ b ≤ a} (upperSet α)
Proof
:= by
  refine ⟨fun a b ↦ ?_, fun t ht ↦ ?_⟩
  · let _ := upperSet α
    exact Topology.IsUpperSet.specializes_iff_le
  · refine TopologicalSpace.le_def.2 fun s hs ↦ ?_
    change IsUpperSet s
    intro a b hab ha
    let _ := t
    exact ((ht b a).2 hab).mem_open hs ha

On this site: Closed-ray topologies: The finest topology in which the closure of each point is the ray below it

variable {X : Type*} [LinearOrder X]

The values of the family

theorem hereditarilyConnectedSpace

TopologyByExample.ClosedRayTopologies.hereditarilyConnectedSpace

A closed-ray topology is hereditarily connected: its open sets form a chain.

theorem hereditarilyConnectedSpace : HereditarilyConnectedSpace (WithUpperSet X)
Proof
:=
  IsUpperSet.hereditarilyConnectedSpace

On this site: Closed-ray topologies: the space is hereditarily connected

theorem compactSpace

TopologyByExample.ClosedRayTopologies.compactSpace

The closed-ray topology of an order with a least element is compact.

theorem compactSpace (h : ∃ x : X, IsBot x) : CompactSpace (WithUpperSet X)
Proof
:=
  IsUpperSet.compactSpace_of_isBot (α := WithUpperSet X) h.choose_spec

On this site: Closed-ray topologies: the space is compact when \(X\) has a least element

theorem secondCountableTopology

TopologyByExample.ClosedRayTopologies.secondCountableTopology

The closed-ray topology of a countable order is second countable.

theorem secondCountableTopology [Countable X] : SecondCountableTopology (WithUpperSet X)
Proof
:=
  haveI : Countable (WithUpperSet X) := ‹Countable X›
  IsUpperSet.secondCountableTopology

On this site: Closed-ray topologies: the space is second countable when \(X\) is countable

theorem not_separableSpace

TopologyByExample.ClosedRayTopologies.not_separableSpace

The closed-ray topology of an order with no greatest element in which every countable subset is bounded above is not separable.

theorem not_separableSpace [NoMaxOrder X] (h : ∀ s : Set X, s.Countable → BddAbove s) :
    ¬SeparableSpace (WithUpperSet X)
Proof
:= by
  rw [IsUpperSet.separableSpace_iff]
  rintro ⟨s, hs, hcof⟩
  obtain ⟨b, hb⟩ := h s hs
  obtain ⟨c, hc⟩ := exists_gt b
  obtain ⟨y, hy, hcy⟩ := hcof c
  exact (hc.trans_le hcy).not_ge (hb hy)

On this site: Closed-ray topologies: the space is not separable when \(X\) has no greatest element and every countable subset of \(X\) has an upper bound in \(X\)

theorem baireSpace

TopologyByExample.ClosedRayTopologies.baireSpace

The closed-ray topology of an order in which every countable subset is bounded above is a Baire space.

theorem baireSpace (h : ∀ s : Set X, s.Countable → BddAbove s) : BaireSpace (WithUpperSet X)
Proof
:=
  IsUpperSet.baireSpace h

On this site: Closed-ray topologies: the space is a Baire space when every countable subset of \(X\) has an upper bound in \(X\)

theorem not_scatteredSpace

TopologyByExample.ClosedRayTopologies.not_scatteredSpace

The closed-ray topology of an order with a nonempty subset that has no greatest element is not scattered.

theorem not_scatteredSpace (h : ¬WellFoundedGT X) : ¬ScatteredSpace (WithUpperSet X)
Proof
:=
  fun hs ↦ h (IsUpperSet.scatteredSpace_iff (α := WithUpperSet X) |>.1 hs)

On this site: Closed-ray topologies: the space is not scattered when some nonempty subset of \(X\) has no greatest element

The examples

theorem rationalsIcc_exists_isBot

TopologyByExample.ClosedRayTopologies.rationalsIcc_exists_isBot

[0, 1] ∩ ℚ has a least element, 0.

theorem rationalsIcc_exists_isBot : ∃ x : Set.Icc (0 : ℚ) 1, IsBot x
Proof
:=
  ⟨⟨0, le_rfl, zero_le_one⟩, fun x ↦ x.property.1⟩

theorem rationalsIcc_exists_isTop

TopologyByExample.ClosedRayTopologies.rationalsIcc_exists_isTop

[0, 1] ∩ ℚ has a greatest element, 1.

theorem rationalsIcc_exists_isTop : ∃ x : Set.Icc (0 : ℚ) 1, IsTop x
Proof
:=
  ⟨⟨1, zero_le_one, le_rfl⟩, fun x ↦ x.property.2⟩

theorem rationalsIcc_not_wellFoundedGT

TopologyByExample.ClosedRayTopologies.rationalsIcc_not_wellFoundedGT

[0, 1] ∩ ℚ is not conversely well-ordered: its points below 1 have no greatest one.

theorem rationalsIcc_not_wellFoundedGT : ¬WellFoundedGT (Set.Icc (0 : ℚ) 1)
Proof
:= fun h ↦ by
  obtain ⟨x, hx, hmax⟩ := h.has_min {x : Set.Icc (0 : ℚ) 1 | (x : ℚ) < 1}
    ⟨⟨0, le_rfl, zero_le_one⟩, by norm_num⟩
  have hx1 : (x : ℚ) < 1 := hx
  have hx0 : (0 : ℚ) ≤ x := x.property.1
  refine hmax ⟨((x : ℚ) + 1) / 2, by linarith, by linarith⟩
    (show ((x : ℚ) + 1) / 2 < 1 by linarith) ?_
  change (x : ℚ) < ((x : ℚ) + 1) / 2
  linarith

On this site: Space: Closed-ray topology on a countable set with a least and a greatest element, not conversely well-ordered; Space: Closed-ray topology on a set with a least element in which every countable subset is bounded; Family: Closed-ray topologies