Lean library · module TopologyByExample.Spaces.OverlappingInterval

The overlapping interval topology

Source file

The overlapping interval topology on [-1, 1] is generated by the intervals [-1, b) with b > 0 and (a, 1] with a < 0. Every subbasic set contains 0, so every nonempty open set contains 0; more precisely every open set is star-shaped about 0: with a point x it contains every t * x, 0 ≤ t ≤ 1.

Consequences: any two nonempty open sets meet (the space is hyperconnected), a set containing 0 is dense (the space is Baire), every open set is path connected along straight segments (the space is locally path connected), and 0 lies in the closure of every point, which gives a T₀ space that is not R₀. The topology is coarser than the Euclidean topology of [-1, 1], so the space is compact. The points -1 and 1 have disjoint closures (the space is not ultraconnected), and the rational subbasic sets generate the same topology (the space is second countable). The underlying set is uncountable.

Main definitions

Main statements

Tags

overlapping interval topology, hyperconnected, T₀, not R₀, 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

definition OverlappingInterval

TopologyByExample.OverlappingInterval

The interval [-1, 1] with the overlapping interval topology, generated by the intervals [-1, b) with b > 0 and (a, 1] with a < 0.

def OverlappingInterval : Type
:= Icc (-1 : ℝ) 1

On this site: Space: Overlapping interval topology

definition toIcc

TopologyByExample.OverlappingInterval.toIcc

The identity equivalence between the overlapping interval and Set.Icc (-1 : ℝ) 1.

def toIcc : OverlappingInterval ≃ Icc (-1 : ℝ) 1
:= Equiv.refl _

definition toReal

TopologyByExample.OverlappingInterval.toReal

The real number underlying a point of the overlapping interval.

def toReal (x : OverlappingInterval) : ℝ
:= (toIcc x : ℝ)

theorem toReal_mem

TopologyByExample.OverlappingInterval.toReal_mem

The real coordinate of a point lies in [-1, 1].

theorem toReal_mem (x : OverlappingInterval) : toReal x ∈ Icc (-1 : ℝ) 1
Proof
:= (toIcc x).property

theorem toReal_injective

TopologyByExample.OverlappingInterval.toReal_injective

A point is determined by its real coordinate.

theorem toReal_injective : Function.Injective toReal
Proof
:=
  Subtype.val_injective.comp toIcc.injective

definition subbasis

TopologyByExample.OverlappingInterval.subbasis

The subbasis of the overlapping interval topology: the sets [-1, b) with b > 0 and (a, 1] with a < 0.

def subbasis : Set (Set OverlappingInterval)
:=
  {s | ∃ b : ℝ, 0 < b ∧ s = {x | toReal x < b}} ∪ {s | ∃ a : ℝ, a < 0 ∧ s = {x | a < toReal x}}

instance

The overlapping interval topology.

instance : TopologicalSpace OverlappingInterval
Proof
:= generateFrom subbasis

theorem isOpen_lt

TopologyByExample.OverlappingInterval.isOpen_lt

The subbasic sets [-1, b), b > 0, are open.

theorem isOpen_lt {b : ℝ} (hb : 0 < b) : IsOpen {x : OverlappingInterval | toReal x < b}
Proof
:=
  isOpen_generateFrom_of_mem (.inl ⟨b, hb, rfl⟩)

theorem isOpen_gt

TopologyByExample.OverlappingInterval.isOpen_gt

The subbasic sets (a, 1], a < 0, are open.

theorem isOpen_gt {a : ℝ} (ha : a < 0) : IsOpen {x : OverlappingInterval | a < toReal x}
Proof
:=
  isOpen_generateFrom_of_mem (.inr ⟨a, ha, rfl⟩)

definition mk

TopologyByExample.OverlappingInterval.mk

The point with real coordinate r ∈ [-1, 1].

def mk (r : ℝ) (h : r ∈ Icc (-1 : ℝ) 1) : OverlappingInterval
:= toIcc.symm ⟨r, h⟩

theorem toReal_mk

TopologyByExample.OverlappingInterval.toReal_mk

The real coordinate of mk r h is r.

@[simp] theorem toReal_mk (r : ℝ) (h : r ∈ Icc (-1 : ℝ) 1) : toReal (mk r h) = r
Proof
:= rfl

definition zero

TopologyByExample.OverlappingInterval.zero

The point 0.

def zero : OverlappingInterval
:= mk 0 ⟨by norm_num, by norm_num⟩

instance

The overlapping interval is nonempty.

instance : Nonempty OverlappingInterval
Proof
:= ⟨zero⟩

definition scale

TopologyByExample.OverlappingInterval.scale

The point t * x, for t ∈ [0, 1].

def scale (t : I) (x : OverlappingInterval) : OverlappingInterval
Definition
:=
  mk (t * toReal x) <| by
    obtain ⟨h₁, h₂⟩ := toReal_mem x
    obtain ⟨ht₀, ht₁⟩ := t.property
    constructor <;> nlinarith

theorem toReal_scale

TopologyByExample.OverlappingInterval.toReal_scale

The real coordinate of t * x.

@[simp] theorem toReal_scale (t : I) (x : OverlappingInterval) :
    toReal (scale t x) = t * toReal x
Proof
:= rfl

theorem scale_zero

TopologyByExample.OverlappingInterval.scale_zero

Scaling by 0 gives the point 0.

theorem scale_zero (x : OverlappingInterval) : scale 0 x = zero
Proof
:=
  toReal_injective (by simp [zero])

theorem scale_one

TopologyByExample.OverlappingInterval.scale_one

Scaling by 1 is the identity.

theorem scale_one (x : OverlappingInterval) : scale 1 x = x
Proof
:=
  toReal_injective (by simp)

theorem scale_mem

TopologyByExample.OverlappingInterval.scale_mem

Every open set of the overlapping interval topology is star-shaped about 0: with a point x it contains t * x for every t ∈ [0, 1].

theorem scale_mem {U : Set OverlappingInterval} (hU : IsOpen U) {x : OverlappingInterval}
    (hx : x ∈ U) (t : I) : scale t x ∈ U
Proof
:= by
  have hU' : GenerateOpen subbasis U := hU
  clear hU
  induction hU' generalizing x with
  | basic s hs =>
    obtain ⟨ht₀, ht₁⟩ := t.property
    rcases hs with ⟨b, hb, rfl⟩ | ⟨a, ha, rfl⟩
    · change toReal x < b at hx
      change (t : ℝ) * toReal x < b
      rcases le_or_gt 0 (toReal x) with h | h <;> nlinarith
    · change a < toReal x at hx
      change a < (t : ℝ) * toReal x
      rcases le_or_gt 0 (toReal x) with h | h <;> nlinarith
  | univ => trivial
  | inter s u _ _ ihs ihu => exact ⟨ihs hx.1, ihu hx.2⟩
  | sUnion S _ ih =>
    obtain ⟨s, hs, hxs⟩ := hx
    exact ⟨s, hs, ih s hs hxs⟩

On this site: Overlapping interval topology: Open sets are star-shaped about \(0\)

theorem zero_mem_of_isOpen

TopologyByExample.OverlappingInterval.zero_mem_of_isOpen

Every nonempty open set of the overlapping interval topology contains 0.

theorem zero_mem_of_isOpen {U : Set OverlappingInterval} (hU : IsOpen U) (hne : U.Nonempty) :
    zero ∈ U
Proof
:= by
  obtain ⟨x, hx⟩ := hne
  simpa [scale_zero] using scale_mem hU hx 0

On this site: Overlapping interval topology: Every nonempty open set contains \(0\)

theorem continuous_ofIcc

TopologyByExample.OverlappingInterval.continuous_ofIcc

The overlapping interval topology is coarser than the Euclidean topology on [-1, 1]: the identity from the Euclidean interval is continuous.

theorem continuous_ofIcc : Continuous (toIcc.symm : Icc (-1 : ℝ) 1 → OverlappingInterval)
Proof
:= by
  refine continuous_generateFrom_iff.2 ?_
  rintro s (⟨b, -, rfl⟩ | ⟨a, -, rfl⟩)
  · exact _root_.isOpen_lt continuous_subtypeVal continuous_const
  · exact _root_.isOpen_lt continuous_const continuous_subtypeVal

On this site: Overlapping interval topology: The topology is coarser than the Euclidean topology

instance instT0Space

TopologyByExample.OverlappingInterval.instT0Space

The overlapping interval topology is T₀: of two distinct points, one lies in a subbasic set that misses the other.

instance instT0Space : T0Space OverlappingInterval
Proof
:= by
  refine (t0Space_iff_inseparable _).2 fun x y h ↦ toReal_injective ?_
  have key (s : Set OverlappingInterval) (hs : IsOpen s) : x ∈ s ↔ y ∈ s :=
    inseparable_iff_forall_isOpen.1 h s hs
  by_contra hne
  rcases lt_or_gt_of_ne hne with hlt | hlt
  · by_cases hx : toReal x < 0
    · exact lt_irrefl (toReal x) ((key _ (isOpen_gt hx)).2 hlt)
    · exact lt_irrefl (toReal y) ((key _ (isOpen_lt (b := toReal y) (by linarith))).1 hlt)
  · by_cases hy : toReal y < 0
    · exact lt_irrefl (toReal y) ((key _ (isOpen_gt hy)).1 hlt)
    · exact lt_irrefl (toReal x) ((key _ (isOpen_lt (b := toReal x) (by linarith))).2 hlt)

On this site: The overlapping interval topology is T₀

definition one

TopologyByExample.OverlappingInterval.one

The point 1.

def one : OverlappingInterval
:= mk 1 ⟨by norm_num, by norm_num⟩

definition negOne

TopologyByExample.OverlappingInterval.negOne

The point -1.

def negOne : OverlappingInterval
:= mk (-1) ⟨by norm_num, by norm_num⟩

theorem not_r0Space

TopologyByExample.OverlappingInterval.not_r0Space

The overlapping interval topology is not R₀: 1 lies in the closure of {0} (every open set containing 1 contains 0), but 0 does not lie in the closure of {1}.

theorem not_r0Space : ¬R0Space OverlappingInterval
Proof
:= by
  intro h
  have h₁ : zero ⤳ one :=
    specializes_iff_forall_open.2 fun s hs hone ↦ zero_mem_of_isOpen hs ⟨one, hone⟩
  have h₂ : one ⤳ zero := h₁.symm
  have := specializes_iff_forall_open.1 h₂ _ (isOpen_lt (b := 1 / 2) (by norm_num))
    (by simp [zero])
  simp [one] at this
  norm_num at this

On this site: The overlapping interval topology is not R₀

instance instCompactSpace

TopologyByExample.OverlappingInterval.instCompactSpace

The overlapping interval is compact, being a continuous image of the Euclidean [-1, 1].

instance instCompactSpace : CompactSpace OverlappingInterval
Proof
:=
  have : CompactSpace (Icc (-1 : ℝ) 1) := isCompact_iff_compactSpace.1 isCompact_Icc
  Function.Surjective.compactSpace continuous_ofIcc toIcc.symm.surjective

On this site: The overlapping interval topology is compact

instance instPreirreducibleSpace

TopologyByExample.OverlappingInterval.instPreirreducibleSpace

The overlapping interval topology is hyperconnected: any two nonempty open sets contain 0.

instance instPreirreducibleSpace : PreirreducibleSpace OverlappingInterval
Proof
:=
  ⟨fun _ _ hU hV ⟨x, _, hxU⟩ ⟨y, _, hyV⟩ ↦
    ⟨zero, trivial, zero_mem_of_isOpen hU ⟨x, hxU⟩, zero_mem_of_isOpen hV ⟨y, hyV⟩⟩⟩

On this site: The overlapping interval topology is hyperconnected

definition ratSubbasis

TopologyByExample.OverlappingInterval.ratSubbasis

The subbasic sets with rational endpoints.

def ratSubbasis : Set (Set OverlappingInterval)
:=
  {s | ∃ q : ℚ, 0 < q ∧ s = {x | toReal x < q}} ∪ {s | ∃ q : ℚ, q < 0 ∧ s = {x | q < toReal x}}

theorem countable_ratSubbasis

TopologyByExample.OverlappingInterval.countable_ratSubbasis

There are countably many rational subbasic sets.

theorem countable_ratSubbasis : ratSubbasis.Countable
Proof
:= by
  refine ((countable_range fun q : ℚ ↦ {x : OverlappingInterval | toReal x < q}).union
    (countable_range fun q : ℚ ↦ {x : OverlappingInterval | q < toReal x})).mono ?_
  rintro s (⟨q, -, rfl⟩ | ⟨q, -, rfl⟩)
  · exact Or.inl ⟨q, rfl⟩
  · exact Or.inr ⟨q, rfl⟩

theorem generateFrom_ratSubbasis

TopologyByExample.OverlappingInterval.generateFrom_ratSubbasis

The rational subbasic sets generate the overlapping interval topology.

theorem generateFrom_ratSubbasis :
    generateFrom ratSubbasis = (inferInstance : TopologicalSpace OverlappingInterval)
Proof
:= by
  refine le_antisymm ?_ ?_
  · refine le_generateFrom_iff_subset_isOpen.2 ?_
    rintro s (⟨b, hb, rfl⟩ | ⟨a, ha, rfl⟩)
    · have : {x : OverlappingInterval | toReal x < b} =
          ⋃ q ∈ {q : ℚ | 0 < q ∧ (q : ℝ) < b}, {x | toReal x < q} := by
        ext x
        simp only [mem_ofPred_eq, mem_iUnion, exists_prop]
        refine ⟨fun hx ↦ ?_, fun ⟨q, ⟨_, hqb⟩, hxq⟩ ↦ hxq.trans hqb⟩
        obtain ⟨q, hq₁, hq₂⟩ := exists_rat_btwn (max_lt hx hb)
        exact ⟨q, ⟨by exact_mod_cast (le_max_right _ _).trans_lt hq₁, hq₂⟩,
          (le_max_left _ _).trans_lt hq₁⟩
      rw [this]
      let : TopologicalSpace OverlappingInterval := generateFrom ratSubbasis
      exact isOpen_biUnion fun q hq ↦ isOpen_generateFrom_of_mem (Or.inl ⟨q, hq.1, rfl⟩)
    · have : {x : OverlappingInterval | a < toReal x} =
          ⋃ q ∈ {q : ℚ | q < 0 ∧ a < (q : ℝ)}, {x | (q : ℝ) < toReal x} := by
        ext x
        simp only [mem_ofPred_eq, mem_iUnion, exists_prop]
        refine ⟨fun hx ↦ ?_, fun ⟨q, ⟨_, haq⟩, hqx⟩ ↦ haq.trans hqx⟩
        obtain ⟨q, hq₁, hq₂⟩ := exists_rat_btwn (lt_min hx ha)
        exact ⟨q, ⟨by exact_mod_cast hq₂.trans_le (min_le_right _ _), hq₁⟩,
          hq₂.trans_le (min_le_left _ _)⟩
      rw [this]
      let : TopologicalSpace OverlappingInterval := generateFrom ratSubbasis
      exact isOpen_biUnion fun q hq ↦ isOpen_generateFrom_of_mem (Or.inr ⟨q, hq.1, rfl⟩)
  · refine le_generateFrom_iff_subset_isOpen.2 ?_
    rintro s (⟨q, hq, rfl⟩ | ⟨q, hq, rfl⟩)
    · exact isOpen_lt (by exact_mod_cast hq)
    · exact isOpen_gt (by exact_mod_cast hq)

instance instSecondCountableTopology

TopologyByExample.OverlappingInterval.instSecondCountableTopology

The overlapping interval is second countable: the subbasic sets with rational endpoints generate its topology.

instance instSecondCountableTopology : SecondCountableTopology OverlappingInterval
Proof
:=
  ⟨⟨ratSubbasis, countable_ratSubbasis, generateFrom_ratSubbasis.symm⟩⟩

On this site: The overlapping interval topology is second countable

theorem isPathConnected_of_isOpen

TopologyByExample.OverlappingInterval.isPathConnected_of_isOpen

In the overlapping interval topology every nonempty open set is path connected: the straight segment from 0 to a point of the set stays in it.

theorem isPathConnected_of_isOpen {U : Set OverlappingInterval} (hU : IsOpen U)
    (hne : U.Nonempty) : IsPathConnected U
Proof
:= by
  refine ⟨zero, zero_mem_of_isOpen hU hne, fun {y} hy ↦ ?_⟩
  have hc : Continuous fun t : I ↦ scale t y := by
    refine continuous_ofIcc.comp ?_
    exact (continuous_subtypeVal.mul continuous_const).subtype_mk _
  exact ⟨⟨⟨fun t ↦ scale t y, hc⟩, scale_zero y, scale_one y⟩, fun t ↦ scale_mem hU hy t⟩

instance instLocallyPathConnectedSpace

TopologyByExample.OverlappingInterval.instLocallyPathConnectedSpace

The overlapping interval is locally path connected: its open sets are path connected.

instance instLocallyPathConnectedSpace : LocallyPathConnectedSpace OverlappingInterval
Proof
:=
  .of_bases (fun x ↦ nhds_basis_opens x) fun _ _ h ↦ isPathConnected_of_isOpen h.2 ⟨_, h.1⟩

theorem not_ultraconnectedSpace

TopologyByExample.OverlappingInterval.not_ultraconnectedSpace

The overlapping interval topology is not ultraconnected: the closures of {-1} and {1} lie in the disjoint closed sets [-1, -1/2] and [1/2, 1].

theorem not_ultraconnectedSpace : ¬UltraconnectedSpace OverlappingInterval
Proof
:= by
  intro h
  obtain ⟨z, hz₁, hz₂⟩ := h.closure_inter_closure_nonempty negOne one
  have h₁ : closure {negOne} ⊆ {x | -1 / 2 < toReal x}ᶜ := by
    refine closure_minimal ?_ (isOpen_gt (a := -1 / 2) (by norm_num)).isClosed_compl
    simp only [singleton_subset_iff, mem_compl_iff, mem_ofPred_eq, negOne, toReal_mk]
    norm_num
  have h₂ : closure {one} ⊆ {x | toReal x < 1 / 2}ᶜ := by
    refine closure_minimal ?_ (isOpen_lt (b := 1 / 2) (by norm_num)).isClosed_compl
    simp only [singleton_subset_iff, mem_compl_iff, mem_ofPred_eq, one, toReal_mk]
    norm_num
  have h₃ := h₁ hz₁
  have h₄ := h₂ hz₂
  simp only [mem_compl_iff, mem_ofPred_eq, not_lt] at h₃ h₄
  linarith

On this site: The overlapping interval topology is not ultraconnected

theorem not_countable

TopologyByExample.OverlappingInterval.not_countable

The overlapping interval is uncountable.

theorem not_countable : ¬Countable OverlappingInterval
Proof
:= by
  intro h
  have : Countable (Icc (-1 : ℝ) 1) := h
  have h₁ := Cardinal.mk_le_aleph0 (α := Icc (-1 : ℝ) 1)
  rw [Cardinal.mk_Icc_real (by norm_num)] at h₁
  exact Cardinal.aleph0_lt_continuum.not_ge h₁

On this site: The overlapping interval topology is not countable

theorem dense_of_zero_mem

TopologyByExample.OverlappingInterval.dense_of_zero_mem

In the overlapping interval, a set containing 0 is dense.

theorem dense_of_zero_mem {s : Set OverlappingInterval} (hs : zero ∈ s) : Dense s
Proof
:=
  dense_iff_inter_open.2 fun _ hU hne ↦ ⟨zero, zero_mem_of_isOpen hU hne, hs⟩

instance instBaireSpace

TopologyByExample.OverlappingInterval.instBaireSpace

The overlapping interval is a Baire space: dense open sets contain 0, so their intersection contains 0 and is dense.

instance instBaireSpace : BaireSpace OverlappingInterval
Proof
where
  baire_property _ hf hd := dense_of_zero_mem <| mem_iInter.2 fun n ↦
    zero_mem_of_isOpen (hf n) (hd n).nonempty

On this site: The overlapping interval topology is a Baire space