Lean library · module TopologyByExample.Spaces.LongCircle

The long circle

Source file

The long circle is the one-point compactification OnePoint OpenLongRay of the open long ray M = L ∖ {0} (L the long ray): the point at infinity closes up both ends of M, the short end near the missing point 0 and the long end. Equivalently it is the closed long ray L ∪ {∞} with its two end points 0 and ∞ identified (TopologyByExample.LongCircle.exists_isQuotientMap_closedLongRay).

Neighbourhoods of the point at infinity

A compact subset of M lies in some interval [a, b], so the sets {∞} ∪ {x : x < a} ∪ {x : x > b} form a neighbourhood base at ∞ (TopologyByExample.LongCircle.hasBasis_nhds_infty). Each of them is connected: the two rays are connected and both have ∞ in their closure. So the long circle is locally connected.

A sequence in a ray [p, →) of M is bounded above, so it lies in a compact interval [p, c], and cannot converge to ∞ (TopologyByExample.LongCircle.exists_eq_coe_of_tendsto). Hence the ray is sequentially closed but not closed (the long circle is not sequential), and no path leads from the long end to ∞ without passing through p (the long circle is not locally path connected).

The map from the long ray sending 0 to ∞ and fixing every other point is continuous and onto, so the long circle is path connected.

Main statements

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

Order facts about the open long ray

instance

The open long ray has no least element: below every point lies some (0, (1/2)^(n+1)).

instance : NoMinOrder OpenLongRay
Proof
:=
  ⟨fun p ↦ let ⟨n, h⟩ := OpenLongRay.exists_r_lt p; ⟨OpenLongRay.r n, h⟩⟩

instance

The open long ray has no greatest element.

instance : NoMaxOrder OpenLongRay
Proof
:=
  ⟨fun p ↦ let ⟨q, h⟩ := exists_gt (p : LongRay)
    ⟨⟨q, (mem_Ioi.1 p.property).trans h⟩, Subtype.mk_lt_mk.2 h⟩⟩

Neighbourhoods of the point at infinity

definition nbhd

TopologyByExample.LongCircle.nbhd

The neighbourhood {∞} ∪ {x : x < a} ∪ {x : x > b} of the point at infinity.

noncomputable def nbhd (a b : OpenLongRay) : Set (OnePoint OpenLongRay)
:= (↑) '' (Icc a b)ᶜ ∪ {∞}

theorem hasBasis_nhds_infty

TopologyByExample.LongCircle.hasBasis_nhds_infty

The sets {∞} ∪ {x : x < a} ∪ {x : x > b} form a neighbourhood base at the point at infinity: every compact subset of the open long ray lies in some interval [a, b].

theorem hasBasis_nhds_infty :
    (𝓝 (∞ : OnePoint OpenLongRay)).HasBasis (fun _ : OpenLongRay × OpenLongRay ↦ True)
      fun ab ↦ nbhd ab.1 ab.2
Proof
:= by
  refine OnePoint.hasBasis_nhds_infty.to_hasBasis (fun K ⟨_, hKk⟩ ↦ ?_)
    fun ab _ ↦ ⟨Icc ab.1 ab.2, ⟨isClosed_Icc, isCompact_Icc⟩, subset_rfl⟩
  obtain ⟨a, ha⟩ := hKk.bddBelow
  obtain ⟨b, hb⟩ := hKk.bddAbove
  exact ⟨(a, b), trivial, union_subset_union_left _
    (image_mono (compl_subset_compl.2 fun x hx ↦ ⟨ha hx, hb hx⟩))⟩

theorem infty_mem_closure

TopologyByExample.LongCircle.infty_mem_closure

The point at infinity lies in the closure of every set of the open long ray that lies in no interval [a, b].

theorem infty_mem_closure {S : Set OpenLongRay} (h : ∀ a b : OpenLongRay, ∃ x ∈ S, x ∉ Icc a b) :
    (∞ : OnePoint OpenLongRay) ∈ closure ((↑) '' S)
Proof
:=
  (mem_closure_iff_nhds_basis hasBasis_nhds_infty).2 fun ab _ ↦
    let ⟨x, hxS, hx⟩ := h ab.1 ab.2
    ⟨x, mem_image_of_mem _ hxS, Or.inl (mem_image_of_mem _ hx)⟩

theorem infty_mem_closure_Iio

TopologyByExample.LongCircle.infty_mem_closure_Iio

The point at infinity lies in the closure of every ray {x : x < a}.

theorem infty_mem_closure_Iio (a : OpenLongRay) :
    (∞ : OnePoint OpenLongRay) ∈ closure ((↑) '' Iio a)
Proof
:=
  infty_mem_closure fun a' _ ↦
    let ⟨x, hx⟩ := exists_lt (min a a')
    ⟨x, hx.trans_le (min_le_left _ _), fun h ↦ (hx.trans_le (min_le_right _ _)).not_ge h.1⟩

theorem infty_mem_closure_Ioi

TopologyByExample.LongCircle.infty_mem_closure_Ioi

The point at infinity lies in the closure of every ray {x : x > b}.

theorem infty_mem_closure_Ioi (b : OpenLongRay) :
    (∞ : OnePoint OpenLongRay) ∈ closure ((↑) '' Ioi b)
Proof
:=
  infty_mem_closure fun _ b' ↦
    let ⟨x, hx⟩ := exists_gt (max b b')
    ⟨x, (le_max_left _ _).trans_lt hx, fun h ↦ ((le_max_right _ _).trans_lt hx).not_ge h.2⟩

theorem infty_mem_closure_Ici

TopologyByExample.LongCircle.infty_mem_closure_Ici

The point at infinity lies in the closure of every ray {x : x ≥ b}.

theorem infty_mem_closure_Ici (b : OpenLongRay) :
    (∞ : OnePoint OpenLongRay) ∈ closure ((↑) '' Ici b)
Proof
:=
  closure_mono (image_mono Ioi_subset_Ici_self) (infty_mem_closure_Ioi b)

theorem isPreconnected_nbhd

TopologyByExample.LongCircle.isPreconnected_nbhd

The basic neighbourhoods of the point at infinity are connected: they are the union of the two rays {∞} ∪ {x : x < a} and {∞} ∪ {x : x > b}, each connected since the ray is connected and has ∞ in its closure.

theorem isPreconnected_nbhd (a b : OpenLongRay) : IsPreconnected (nbhd a b)
Proof
:= by
  have h₁ : IsPreconnected ((↑) '' Iio a ∪ {∞} : Set (OnePoint OpenLongRay)) :=
    (isPreconnected_Iio.image _ continuous_coe.continuousOn).subset_closure subset_union_left
      (union_subset subset_closure (singleton_subset_iff.2 (infty_mem_closure_Iio a)))
  have h₂ : IsPreconnected ((↑) '' Ioi b ∪ {∞} : Set (OnePoint OpenLongRay)) :=
    (isPreconnected_Ioi.image _ continuous_coe.continuousOn).subset_closure subset_union_left
      (union_subset subset_closure (singleton_subset_iff.2 (infty_mem_closure_Ioi b)))
  have h := h₁.union ∞ (subset_union_right rfl) (subset_union_right rfl) h₂
  convert h using 1
  ext z
  induction z using OnePoint.rec with
  | infty => simp [nbhd]
  | coe x =>
    simp only [nbhd, mem_union, mem_image, mem_compl_iff, mem_Icc, not_and_or, not_le,
      coe_injective.eq_iff, exists_eq_right, mem_singleton_iff, coe_ne_infty, or_false, mem_Iio,
      mem_Ioi]

Sequences in a ray

theorem exists_eq_coe_of_tendsto

TopologyByExample.LongCircle.exists_eq_coe_of_tendsto

A sequence in a ray [p, →) of the open long ray that converges in the long circle converges to a point of the ray: its terms are bounded above by some c, so they lie in the compact, hence closed, interval [p, c].

theorem exists_eq_coe_of_tendsto (y : ℕ → OpenLongRay) {p : OpenLongRay} (hp : ∀ n, p ≤ y n)
    {w : OnePoint OpenLongRay} (hw : Tendsto (fun n ↦ (y n : OnePoint OpenLongRay)) atTop (𝓝 w)) :
    ∃ z, p ≤ z ∧ w = z
Proof
:= by
  obtain ⟨c, hc⟩ := OpenLongRay.bddAbove_of_countable (countable_range y)
  have hK : IsClosed (((↑) : OpenLongRay → OnePoint OpenLongRay) '' Icc p c) :=
    (isCompact_Icc.image continuous_coe).isClosed
  obtain ⟨z, hz, rfl⟩ := hK.mem_of_tendsto hw
    (Eventually.of_forall fun n ↦ ⟨y n, ⟨hp n, hc (mem_range_self n)⟩, rfl⟩)
  exact ⟨z, hz.1, rfl⟩

theorem isSeqClosed_image_Ici

TopologyByExample.LongCircle.isSeqClosed_image_Ici

In the long circle a ray [p, →) of the open long ray is sequentially closed.

theorem isSeqClosed_image_Ici (p : OpenLongRay) :
    IsSeqClosed (((↑) : OpenLongRay → OnePoint OpenLongRay) '' Ici p)
Proof
:= by
  intro x w hx hw
  choose y hy hyx using hx
  have hyx' : (fun n ↦ (y n : OnePoint OpenLongRay)) = x := funext hyx
  obtain ⟨z, hz, rfl⟩ := exists_eq_coe_of_tendsto y hy (hyx' ▸ hw)
  exact ⟨z, hz, rfl⟩

theorem not_sequentialSpace

TopologyByExample.LongCircle.not_sequentialSpace

The long circle is not sequential: a ray [p, →) is sequentially closed but not closed, since the point at infinity lies in its closure.

theorem not_sequentialSpace : ¬SequentialSpace (OnePoint OpenLongRay)
Proof
:= fun _ ↦ by
  have h := infty_mem_closure_Ici (default : OpenLongRay)
  rw [(isSeqClosed_image_Ici _).isClosed.closure_eq] at h
  obtain ⟨_, _, h⟩ := h
  exact coe_ne_infty _ h

On this site: The long circle is not sequential

theorem not_locallyPathConnectedSpace

TopologyByExample.LongCircle.not_locallyPathConnectedSpace

The long circle is not locally path connected. Let p be a point of the open long ray. If the long circle were locally path connected, the neighbourhood {p}ᶜ of ∞ would contain a path connected neighbourhood of ∞, which contains a point q > p; so a path in {p}ᶜ would join q to ∞. But in {p}ᶜ the ray (p, →) is open and sequentially closed, so it traps paths.

theorem not_locallyPathConnectedSpace : ¬LocallyPathConnectedSpace (OnePoint OpenLongRay)
Proof
:=
  fun h ↦ by
  set p : OpenLongRay := default
  set N : Set (OnePoint OpenLongRay) := {(p : OnePoint OpenLongRay)}ᶜ
  have hN : N ∈ 𝓝 ∞ := isOpen_compl_singleton.mem_nhds (coe_ne_infty p).symm
  obtain ⟨V, ⟨hV, hVpc⟩, hVN⟩ := (h.path_connected_basis ∞).mem_iff.1 hN
  obtain ⟨ab, -, hab⟩ := hasBasis_nhds_infty.mem_iff.1 hV
  obtain ⟨q, hq⟩ := exists_gt (max ab.2 p)
  have hqV : (q : OnePoint OpenLongRay) ∈ V :=
    hab (Or.inl ⟨q, fun h ↦ ((le_max_left _ _).trans_lt hq).not_ge h.2, rfl⟩)
  have hJ : JoinedIn N (q : OnePoint OpenLongRay) ∞ :=
    (hVpc.joinedIn _ hqV _ (mem_of_mem_nhds hV)).mono hVN
  set A : Set N := {z | (z : OnePoint OpenLongRay) ∈ ((↑) : OpenLongRay → _) '' Ioi p}
  have hAo : IsOpen A := (isOpen_image_coe.2 isOpen_Ioi).preimage continuous_subtypeVal
  have hAs : IsSeqClosed A := by
    intro x w hx hw
    choose y hy hyx using hx
    have hw' : Tendsto (fun n ↦ (y n : OnePoint OpenLongRay)) atTop (𝓝 (w : OnePoint _)) := by
      have := (continuous_subtypeVal.tendsto w).comp hw
      convert this using 1
      exact funext fun n ↦ hyx n
    obtain ⟨z, hz, hzw⟩ := exists_eq_coe_of_tendsto y (fun n ↦ (hy n).le) hw'
    refine ⟨z, lt_of_le_of_ne hz ?_, hzw.symm⟩
    rintro rfl
    exact w.property hzw
  obtain ⟨_, _, h⟩ := Joined.mem_of_isOpen_of_isSeqClosed hAo hAs hJ.joined_subtype
    ⟨q, (le_max_right _ _).trans_lt hq, rfl⟩
  exact coe_ne_infty _ h

On this site: The long circle is not locally path connected

The map from the long ray

definition ofLongRay

TopologyByExample.LongCircle.ofLongRay

The map from the long ray onto the long circle that sends the least point 0 to the point at infinity and fixes every other point.

noncomputable def ofLongRay (x : LongRay) : OnePoint OpenLongRay
:=
  if h : ⊥ < x then ((⟨x, h⟩ : OpenLongRay) : OnePoint OpenLongRay) else ∞

theorem ofLongRay_bot

TopologyByExample.LongCircle.ofLongRay_bot

The least point of the long ray goes to the point at infinity.

theorem ofLongRay_bot : ofLongRay ⊥ = ∞
Proof
:= dite_eq_right (lt_irrefl _)

theorem ofLongRay_coe

TopologyByExample.LongCircle.ofLongRay_coe

A point of the open long ray is fixed.

theorem ofLongRay_coe (p : OpenLongRay) : ofLongRay p = p
Proof
:= dite_eq_left p.property

theorem continuous_ofLongRay

TopologyByExample.LongCircle.continuous_ofLongRay

The map from the long ray is continuous: on the open long ray it is the inclusion, and as x approaches 0 it approaches the point at infinity, since {x : x < a} lies in each basic neighbourhood of ∞.

theorem continuous_ofLongRay : Continuous ofLongRay
Proof
:= by
  refine continuous_iff_continuousAt.2 fun x ↦ ?_
  rcases eq_bot_or_bot_lt x with rfl | hx
  · rw [ContinuousAt, ofLongRay_bot]
    refine hasBasis_nhds_infty.tendsto_right_iff.2 fun ab _ ↦ ?_
    filter_upwards [Iio_mem_nhds ab.1.property] with y hy
    by_cases hy0 : ⊥ < y
    · rw [show ofLongRay y = ((⟨y, hy0⟩ : OpenLongRay) : OnePoint OpenLongRay) from
        dite_eq_left hy0]
      exact Or.inl ⟨⟨y, hy0⟩, fun h ↦ (not_le.2 hy) h.1, rfl⟩
    · rw [show ofLongRay y = ∞ from dite_eq_right hy0]
      exact Or.inr rfl
  · have hon : ContinuousOn ofLongRay (Ioi ⊥) := by
      rw [continuousOn_iff_continuous_domRestrict]
      convert continuous_coe (X := OpenLongRay) using 1
      ext p : 1
      exact ofLongRay_coe p
    exact hon.continuousAt (isOpen_Ioi.mem_nhds hx)

theorem surjective_ofLongRay

TopologyByExample.LongCircle.surjective_ofLongRay

The map from the long ray is onto.

theorem surjective_ofLongRay : Function.Surjective ofLongRay
Proof
:= by
  intro z
  induction z using OnePoint.rec with
  | infty => exact ⟨⊥, ofLongRay_bot⟩
  | coe p => exact ⟨p, ofLongRay_coe p⟩

theorem ofLongRay_eq_infty_iff

TopologyByExample.LongCircle.ofLongRay_eq_infty_iff

The map from the long ray takes the value ∞ only at 0.

theorem ofLongRay_eq_infty_iff (x : LongRay) : ofLongRay x = ∞ ↔ x = ⊥
Proof
:= by
  refine ⟨fun h ↦ ?_, fun h ↦ h ▸ ofLongRay_bot⟩
  by_contra hx
  rw [ofLongRay, dite_eq_left (bot_lt_iff_ne_bot.2 hx)] at h
  exact coe_ne_infty _ h

theorem ofLongRay_eq_coe_iff

TopologyByExample.LongCircle.ofLongRay_eq_coe_iff

The map from the long ray is injective away from 0.

theorem ofLongRay_eq_coe_iff (x : LongRay) (p : OpenLongRay) : ofLongRay x = p ↔ x = p
Proof
:= by
  refine ⟨fun h ↦ ?_, fun h ↦ h ▸ ofLongRay_coe p⟩
  by_cases hx : ⊥ < x
  · rw [ofLongRay, dite_eq_left hx] at h
    exact congrArg Subtype.val (coe_injective h)
  · rw [ofLongRay, dite_eq_right hx] at h
    exact absurd h.symm (coe_ne_infty p)

The values

theorem pathPreconnectedSpace

TopologyByExample.LongCircle.pathPreconnectedSpace

The long circle is path connected: it is the continuous image of the path connected long ray.

theorem pathPreconnectedSpace : PathPreconnectedSpace (OnePoint OpenLongRay)
Proof
:= by
  refine ⟨fun x y ↦ ?_⟩
  obtain ⟨x, rfl⟩ := surjective_ofLongRay x
  obtain ⟨y, rfl⟩ := surjective_ofLongRay y
  exact (PathPreconnectedSpace.joined x y).map continuous_ofLongRay

theorem locallyConnectedSpace

TopologyByExample.LongCircle.locallyConnectedSpace

The long circle is locally connected: the open long ray is, and the point at infinity has a neighbourhood base of connected sets.

theorem locallyConnectedSpace : LocallyConnectedSpace (OnePoint OpenLongRay)
Proof
:=
  have := locallyConnectedSpace_of_orderTopology (α := OpenLongRay)
  locallyConnectedSpace_onePoint hasBasis_nhds_infty fun ab _ ↦ isPreconnected_nbhd ab.1 ab.2

On this site: The long circle is locally connected

The quotient of the closed long ray

definition ofClosedLongRay

TopologyByExample.LongCircle.ofClosedLongRay

The map from the closed long ray L ∪ {∞} onto the long circle that identifies its end points 0 and ∞.

noncomputable def ofClosedLongRay (z : OnePoint LongRay) : OnePoint OpenLongRay
:=
  z.elim ∞ ofLongRay

theorem continuous_ofClosedLongRay

TopologyByExample.LongCircle.continuous_ofClosedLongRay

The map from the closed long ray is continuous: on the long ray it is ofLongRay, and it sends the points above b to the basic neighbourhood {∞} ∪ … ∪ {x : x > b} of ∞.

theorem continuous_ofClosedLongRay : Continuous ofClosedLongRay
Proof
:= by
  refine (OnePoint.continuous_iff _).2 ⟨?_, continuous_ofLongRay⟩
  refine (hasBasis_coclosedCompact.tendsto_iff hasBasis_nhds_infty).2 fun ab _ ↦
    ⟨Iic ab.2.val, ⟨isClosed_Iic, Icc_bot (a := ab.2.val) ▸ isCompact_Icc⟩, fun y hy ↦ ?_⟩
  have hy' : ab.2.val < y := not_le.1 hy
  have hy0 : ⊥ < y := ab.2.property.trans hy'
  change ofLongRay y ∈ nbhd ab.1 ab.2
  rw [ofLongRay, dite_eq_left hy0]
  exact Or.inl ⟨⟨y, hy0⟩, fun h ↦ (not_le.2 hy') h.2, rfl⟩

theorem exists_isQuotientMap_closedLongRay

TopologyByExample.LongCircle.exists_isQuotientMap_closedLongRay

The long circle is the closed long ray with its two end points identified: there is a quotient map from the closed long ray L ∪ {∞} onto the long circle that identifies the least point 0 with the greatest point ∞ and no other two points.

theorem exists_isQuotientMap_closedLongRay : ∃ q : OnePoint LongRay → OnePoint OpenLongRay,
    IsQuotientMap q ∧ ∀ x y, q x = q y ↔ x = y ∨
      (x ∈ ({((⊥ : LongRay) : OnePoint LongRay), ∞} : Set (OnePoint LongRay)) ∧
        y ∈ ({((⊥ : LongRay) : OnePoint LongRay), ∞} : Set (OnePoint LongRay)))
Proof
:= by
  have hsurj : Function.Surjective ofClosedLongRay := fun z ↦
    let ⟨x, hx⟩ := surjective_ofLongRay z
    ⟨x, hx⟩
  have hinf (z : OnePoint LongRay) : ofClosedLongRay z = ∞ ↔
      z ∈ ({((⊥ : LongRay) : OnePoint LongRay), ∞} : Set (OnePoint LongRay)) := by
    induction z using OnePoint.rec with
    | infty => simp [ofClosedLongRay]
    | coe x =>
      change ofLongRay x = ∞ ↔ _
      rw [ofLongRay_eq_infty_iff]
      simp [coe_injective.eq_iff]
  refine ⟨ofClosedLongRay, continuous_ofClosedLongRay.isClosedMap.isQuotientMap
    continuous_ofClosedLongRay hsurj, fun x y ↦ ⟨fun h ↦ ?_, ?_⟩⟩
  · by_cases hx : ofClosedLongRay x = ∞
    · exact Or.inr ⟨(hinf x).1 hx, (hinf y).1 (h ▸ hx)⟩
    · left
      induction x using OnePoint.rec with
      | infty => exact absurd rfl hx
      | coe x =>
        induction y using OnePoint.rec with
        | infty => exact absurd (h.trans rfl) hx
        | coe y =>
          change ofLongRay x = ofLongRay y at h
          have hx0 : ⊥ < x := bot_lt_iff_ne_bot.2 fun h' ↦ hx (by
            change ofLongRay x = ∞
            rw [h', ofLongRay_bot])
          rw [show ofLongRay x = ((⟨x, hx0⟩ : OpenLongRay) : OnePoint OpenLongRay) from
            dite_eq_left hx0, eq_comm, ofLongRay_eq_coe_iff] at h
          rw [h]
  · rintro (rfl | ⟨hx, hy⟩)
    · rfl
    · rw [(hinf x).2 hx, (hinf y).2 hy]

On this site: Long circle: The closed long ray with its end points identified

On this site: Space: Long circle