Lean library · module TopologyByExample.Spaces.SorgenfreyLine

The Sorgenfrey line

Source file

In this file we define TopologyByExample.SorgenfreyLine (notation: ℝₗ) to be the Sorgenfrey line. It is the real line with the topology generated by the half-open intervals Set.Ico a b.

We prove that it is a first countable, separable, Lindelöf, completely normal Hausdorff space that is neither second countable, metrizable nor σ-compact.

Main definitions

Main statements

Notation

Provenance

The definition of ℝₗ and its basic API (neighbourhood bases, the topology being finer than the order topology, ContinuousAdd, total disconnectedness, first countability, separability and complete normality) are adapted from Mathlib's Counterexamples/SorgenfreyLine.lean by Yury Kudryashov, at the Mathlib commit this project pins. The changes are: the namespace (Counterexample became TopologyByExample); the instances are named; the facts about the Sorgenfrey plane moved to TopologyByExample.Spaces.SorgenfreyPlane; and not_secondCountableTopology and not_metrizableSpace are proved directly (from a base and from separability) instead of from the non-normality of the plane.

New here: toReal_le_toReal, toReal_lt_toReal, the Lindelöf instance (whose key step, TopologyByExample.exists_countable_forall_mem_Ico, is in TopologyByExample.Theorems.OrderTopology), the T2Space instance, the direct proofs above, the countability of compact sets and the failure of σ-compactness.

Separation axioms

Connectedness

The Sorgenfrey line is zero-dimensional (TopologyByExample.SorgenfreyLine.instZeroDimensionalSpace): the half-open intervals [a, b) are clopen and form a base.

References

  • L. A. Steen and J. A. Seebach, Counterexamples in Topology, Example 51.
  • R. H. Sorgenfrey, On the topological product of paracompact spaces, Bull. Amer. Math. Soc. 53 (1947), 631–632.

Tags

Sorgenfrey line, lower limit topology, Lindelöf, 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 SorgenfreyLine

TopologyByExample.SorgenfreyLine

The Sorgenfrey line (denoted as ℝₗ within the TopologyByExample.SorgenfreyLine namespace). It is the real line with the topology generated by the half-open intervals Set.Ico a b.

def SorgenfreyLine : Type
:= ℝ
deriving ConditionallyCompleteLinearOrder, Field, IsStrictOrderedRing, Archimedean

On this site: Space: Sorgenfrey line

@[inherit_doc]
scoped[TopologyByExample.SorgenfreyLine] notation "ℝₗ" => TopologyByExample.SorgenfreyLine

definition toReal

TopologyByExample.SorgenfreyLine.toReal

Ring homomorphism between the Sorgenfrey line and the standard real line.

def toReal : ℝₗ ≃+* ℝ
:=
  RingEquiv.refl ℝ

theorem toReal_le_toReal

TopologyByExample.SorgenfreyLine.toReal_le_toReal

@[simp]
theorem toReal_le_toReal {x y : ℝₗ} : toReal x ≤ toReal y ↔ x ≤ y
Proof
:=
  Iff.rfl

theorem toReal_lt_toReal

TopologyByExample.SorgenfreyLine.toReal_lt_toReal

@[simp]
theorem toReal_lt_toReal {x y : ℝₗ} : toReal x < toReal y ↔ x < y
Proof
:=
  Iff.rfl

instance

instance : TopologicalSpace ℝₗ
Proof
:=
  TopologicalSpace.generateFrom {s : Set ℝₗ | ∃ a b : ℝₗ, Ico a b = s}

theorem isOpen_Ico

TopologyByExample.SorgenfreyLine.isOpen_Ico

theorem isOpen_Ico (a b : ℝₗ) : IsOpen (Ico a b)
Proof
:=
  TopologicalSpace.GenerateOpen.basic _ ⟨a, b, rfl⟩

theorem isOpen_Ici

TopologyByExample.SorgenfreyLine.isOpen_Ici

theorem isOpen_Ici (a : ℝₗ) : IsOpen (Ici a)
Proof
:=
  iUnion_Ico_right a ▸ isOpen_iUnion (isOpen_Ico a)

theorem nhds_basis_Ico

TopologyByExample.SorgenfreyLine.nhds_basis_Ico

theorem nhds_basis_Ico (a : ℝₗ) : (𝓝 a).HasBasis (a < ·) (Ico a ·)
Proof
:= by
  rw [TopologicalSpace.nhds_generateFrom]
  have : Nonempty { x // x ≤ a } := Set.nonempty_Iic_subtype
  have : (⨅ x : { i // i ≤ a }, 𝓟 (Ici ↑x)) = 𝓟 (Ici a) := by
    refine (IsLeast.isGLB ?_).iInf_eq
    exact ⟨⟨⟨a, le_rfl⟩, rfl⟩,
      forall_mem_range.2 fun b => principal_mono.2 <| Ici_subset_Ici.2 b.property⟩
  simp only [mem_ofPred_eq, iInf_and, iInf_exists, @iInf_comm _ (_ ∈ _), @iInf_comm _ (Set ℝₗ),
    iInf_iInf_eq_right, mem_Ico]
  simp_rw [@iInf_comm _ ℝₗ (_ ≤ _), iInf_subtype', ← Ici_inter_Iio, ← inf_principal,
    ← inf_iInf, ← iInf_inf, this, iInf_subtype]
  suffices (⨅ x ∈ Ioi a, 𝓟 (Iio x)).HasBasis (a < ·) Iio from this.principal_inf _
  refine hasBasis_biInf_principal ?_ nonempty_Ioi
  exact directedOn_iff_directed.2 <| Monotone.directed_ge fun x y hxy ↦ Iio_subset_Iio hxy

theorem nhds_basis_Ico_rat

TopologyByExample.SorgenfreyLine.nhds_basis_Ico_rat

theorem nhds_basis_Ico_rat (a : ℝₗ) :
    (𝓝 a).HasCountableBasis (fun r : ℚ => a < r) fun r => Ico a r
Proof
:= by
  refine ⟨(nhds_basis_Ico a).to_hasBasis (fun b hb => ?_) fun r hr => ⟨_, hr, Subset.rfl⟩,
    Set.to_countable _⟩
  rcases exists_rat_btwn hb with ⟨r, har, hrb⟩
  exact ⟨r, har, Ico_subset_Ico_right hrb.le⟩

theorem nhds_basis_Ico_inv_pnat

TopologyByExample.SorgenfreyLine.nhds_basis_Ico_inv_pnat

theorem nhds_basis_Ico_inv_pnat (a : ℝₗ) :
    (𝓝 a).HasBasis (fun _ : ℕ+ => True) fun n => Ico a (a + (n : ℝₗ)⁻¹)
Proof
:= by
  refine (nhds_basis_Ico a).to_hasBasis (fun b hb => ?_) fun n hn =>
    ⟨_, lt_add_of_pos_right _ (inv_pos.2 <| Nat.cast_pos.2 n.pos), Subset.rfl⟩
  rcases exists_nat_one_div_lt (sub_pos.2 hb) with ⟨k, hk⟩
  rw [one_div] at hk
  rw [← Nat.cast_add_one] at hk
  exact ⟨k.succPNat, trivial, Ico_subset_Ico_right (le_sub_iff_add_le'.1 hk.le)⟩

theorem nhds_countable_basis_Ico_inv_pnat

TopologyByExample.SorgenfreyLine.nhds_countable_basis_Ico_inv_pnat

theorem nhds_countable_basis_Ico_inv_pnat (a : ℝₗ) :
    (𝓝 a).HasCountableBasis (fun _ : ℕ+ => True) fun n => Ico a (a + (n : ℝₗ)⁻¹)
Proof
:=
  ⟨nhds_basis_Ico_inv_pnat a, Set.to_countable _⟩

theorem nhds_antitone_basis_Ico_inv_pnat

TopologyByExample.SorgenfreyLine.nhds_antitone_basis_Ico_inv_pnat

theorem nhds_antitone_basis_Ico_inv_pnat (a : ℝₗ) :
    (𝓝 a).HasAntitoneBasis fun n : ℕ+ => Ico a (a + (n : ℝₗ)⁻¹)
Proof
:=
  ⟨nhds_basis_Ico_inv_pnat a, monotone_const.Ico <| Antitone.const_add
    (fun k _l hkl => inv_anti₀ (Nat.cast_pos.2 k.property)
      (Nat.mono_cast <| Subtype.coe_le_coe.2 hkl)) _⟩

theorem isOpen_iff

TopologyByExample.SorgenfreyLine.isOpen_iff

theorem isOpen_iff {s : Set ℝₗ} : IsOpen s ↔ ∀ x ∈ s, ∃ y > x, Ico x y ⊆ s
Proof
:=
  isOpen_iff_mem_nhds.trans <| forall₂_congr fun x _ => (nhds_basis_Ico x).mem_iff

theorem isClosed_iff

TopologyByExample.SorgenfreyLine.isClosed_iff

theorem isClosed_iff {s : Set ℝₗ} : IsClosed s ↔ ∀ x, x ∉ s → ∃ y > x, Disjoint (Ico x y) s
Proof
:= by
  simp only [← isOpen_compl_iff, isOpen_iff, mem_compl_iff, subset_compl_iff_disjoint_right]

theorem exists_Ico_disjoint_closed

TopologyByExample.SorgenfreyLine.exists_Ico_disjoint_closed

theorem exists_Ico_disjoint_closed {a : ℝₗ} {s : Set ℝₗ} (hs : IsClosed s) (ha : a ∉ s) :
    ∃ b > a, Disjoint (Ico a b) s
Proof
:=
  isClosed_iff.1 hs a ha

theorem map_toReal_nhds

TopologyByExample.SorgenfreyLine.map_toReal_nhds

@[simp]
theorem map_toReal_nhds (a : ℝₗ) : map toReal (𝓝 a) = 𝓝[≥] toReal a
Proof
:= by
  refine ((nhds_basis_Ico a).map _).eq_of_same_basis ?_
  simpa only [toReal.image_eq_preimage_symm] using! nhdsGE_basis (toReal a)

theorem nhds_eq_map

TopologyByExample.SorgenfreyLine.nhds_eq_map

theorem nhds_eq_map (a : ℝₗ) : 𝓝 a = map toReal.symm (𝓝[≥] (toReal a))
Proof
:= by
  simp_rw [← map_toReal_nhds, map_map, Function.comp_def, toReal.symm_apply_apply, map_id']

theorem nhds_eq_comap

TopologyByExample.SorgenfreyLine.nhds_eq_comap

theorem nhds_eq_comap (a : ℝₗ) : 𝓝 a = comap toReal (𝓝[≥] (toReal a))
Proof
:= by
  rw [← map_toReal_nhds, comap_map toReal.injective]

theorem continuous_toReal

TopologyByExample.SorgenfreyLine.continuous_toReal

@[continuity]
theorem continuous_toReal : Continuous toReal
Proof
:=
  continuous_iff_continuousAt.2 fun x => by
    rw [ContinuousAt, Tendsto, map_toReal_nhds]
    exact inf_le_left

On this site: Sorgenfrey line: The topology is finer than the Euclidean topology

instance instOrderClosedTopology

TopologyByExample.SorgenfreyLine.instOrderClosedTopology

The order of the Sorgenfrey line is closed: {(x, y) | x ≤ y} is closed in ℝₗ × ℝₗ, since the topology is finer than the Euclidean one.

instance instOrderClosedTopology : OrderClosedTopology ℝₗ
Proof
:=
  ⟨(isClosed_le_prod (α := ℝ)).preimage (continuous_toReal.prodMap continuous_toReal)⟩

instance instContinuousAdd

TopologyByExample.SorgenfreyLine.instContinuousAdd

Addition is continuous on the Sorgenfrey line.

instance instContinuousAdd : ContinuousAdd ℝₗ
Proof
:= by
  refine ⟨continuous_iff_continuousAt.2 ?_⟩
  rintro ⟨x, y⟩
  rw [ContinuousAt, nhds_prod_eq, nhds_eq_comap (x + y), tendsto_comap_iff,
    nhds_eq_map, nhds_eq_map, prod_map_map_eq, ← nhdsWithin_prod_eq, Ici_prod_Ici]
  simp only [Function.comp_def, map_add, tendsto_map'_iff, RingEquiv.apply_symm_apply]
  exact (continuous_add.tendsto _).inf (MapsTo.tendsto fun x hx => add_le_add hx.1 hx.2)

On this site: Sorgenfrey line: Addition is continuous

theorem isClopen_Ici

TopologyByExample.SorgenfreyLine.isClopen_Ici

theorem isClopen_Ici (a : ℝₗ) : IsClopen (Ici a)
Proof
:=
  ⟨isClosed_Ici, isOpen_Ici a⟩

theorem isClopen_Iio

TopologyByExample.SorgenfreyLine.isClopen_Iio

theorem isClopen_Iio (a : ℝₗ) : IsClopen (Iio a)
Proof
:= by
  simpa only [compl_Ici] using (isClopen_Ici a).compl

theorem isClopen_Ico

TopologyByExample.SorgenfreyLine.isClopen_Ico

theorem isClopen_Ico (a b : ℝₗ) : IsClopen (Ico a b)
Proof
:=
  (isClopen_Ici a).inter (isClopen_Iio b)

On this site: Sorgenfrey line: Half-open intervals are clopen

instance instTotallyDisconnectedSpace

TopologyByExample.SorgenfreyLine.instTotallyDisconnectedSpace

The Sorgenfrey line is totally disconnected: if a preconnected set contains x and y, then the clopen rays [x, ∞) and [y, ∞) contain it, so y ≤ x and x ≤ y.

instance instTotallyDisconnectedSpace : TotallyDisconnectedSpace ℝₗ
Proof
:=
  ⟨fun _ _ hs x hx y hy =>
    le_antisymm (hs.subset_isClopen (isClopen_Ici x) ⟨x, hx, self_mem_Ici⟩ hy)
      (hs.subset_isClopen (isClopen_Ici y) ⟨y, hy, self_mem_Ici⟩ hx)⟩

instance instFirstCountableTopology

TopologyByExample.SorgenfreyLine.instFirstCountableTopology

The Sorgenfrey line is first countable: the intervals [a, r) with r rational form a countable basis of neighbourhoods of a.

instance instFirstCountableTopology : FirstCountableTopology ℝₗ
Proof
:=
  ⟨fun x => (nhds_basis_Ico_rat x).isCountablyGenerated⟩

On this site: The Sorgenfrey line is first countable

instance instCompletelyNormalSpace

TopologyByExample.SorgenfreyLine.instCompletelyNormalSpace

The Sorgenfrey line is a completely normal topological space.

instance instCompletelyNormalSpace : CompletelyNormalSpace ℝₗ
Proof
:= by
  /-
  Let `s` and `t` be disjoint closed sets.
  For each `x ∈ s` we choose `X x` such that `Set.Ico x (X x)` is disjoint with `t`.
  Similarly, for each `y ∈ t` we choose `Y y` such that `Set.Ico y (Y y)` is disjoint with `s`.
  Then `⋃ x ∈ s, Ico x (X x)` and `⋃ y ∈ t, Ico y (Y y)` are
  disjoint open sets that include `s` and `t`.
  -/
  refine ⟨fun s t hd₁ hd₂ => ?_⟩
  choose! X hX hXd using fun x (hx : x ∈ s) =>
    exists_Ico_disjoint_closed isClosed_closure (disjoint_left.1 hd₂ hx)
  choose! Y hY hYd using fun y (hy : y ∈ t) =>
    exists_Ico_disjoint_closed isClosed_closure (disjoint_right.1 hd₁ hy)
  refine disjoint_of_disjoint_of_mem ?_
    (bUnion_mem_nhdsSet fun x hx => (isOpen_Ico x (X x)).mem_nhds <| left_mem_Ico.2 (hX x hx))
    (bUnion_mem_nhdsSet fun y hy => (isOpen_Ico y (Y y)).mem_nhds <| left_mem_Ico.2 (hY y hy))
  simp only [disjoint_iUnion_left, disjoint_iUnion_right, Ico_disjoint_Ico]
  intro y hy x hx
  rcases le_total x y with hle | hle
  · calc
      min (X x) (Y y) ≤ X x := min_le_left _ _
      _ ≤ y := (not_lt.1 fun hyx => (hXd x hx).le_bot ⟨⟨hle, hyx⟩, subset_closure hy⟩)
      _ ≤ max x y := le_max_right _ _
  · calc
      min (X x) (Y y) ≤ Y y := min_le_right _ _
      _ ≤ x := (not_lt.1 fun hxy => (hYd y hy).le_bot ⟨⟨hle, hxy⟩, subset_closure hx⟩)
      _ ≤ max x y := le_max_left _ _

On this site: The Sorgenfrey line is completely normal

instance instT2Space

TopologyByExample.SorgenfreyLine.instT2Space

The Sorgenfrey line is Hausdorff. Its topology is finer than the order topology of ℝ (see continuous_toReal), so this follows from OrderClosedTopology.

instance instT2Space : T2Space ℝₗ
Proof
:=
  inferInstance

On this site: The Sorgenfrey line is Hausdorff

theorem denseRange_ratCast

TopologyByExample.SorgenfreyLine.denseRange_ratCast

theorem denseRange_ratCast : DenseRange ((↑) : ℚ → ℝₗ)
Proof
:= by
  refine dense_iff_inter_open.2 ?_
  rintro U Uo ⟨x, hx⟩
  rcases isOpen_iff.1 Uo _ hx with ⟨y, hxy, hU⟩
  rcases exists_rat_btwn hxy with ⟨z, hxz, hzy⟩
  exact ⟨z, hU ⟨hxz.le, hzy⟩, mem_range_self _⟩

instance instSeparableSpace

TopologyByExample.SorgenfreyLine.instSeparableSpace

The Sorgenfrey line is separable: the rationals are dense.

instance instSeparableSpace : SeparableSpace ℝₗ
Proof
:=
  ⟨⟨_, countable_range _, denseRange_ratCast⟩⟩

On this site: The Sorgenfrey line is separable

instance instLindelofSpace

TopologyByExample.SorgenfreyLine.instLindelofSpace

The Sorgenfrey line is a Lindelöf space.

Given an open cover, choose for each x a member U (i x) of the cover and b x > x with [x, b x) ⊆ U (i x). By TopologyByExample.exists_countable_forall_mem_Ico, applied in ℝ, countably many of the intervals [x, b x) cover the line.

instance instLindelofSpace : LindelofSpace ℝₗ
Proof
:= by
  refine ⟨isLindelof_of_countable_subcover fun U hUo hU ↦ ?_⟩
  have : ∀ x : ℝₗ, ∃ i, ∃ b > x, Ico x b ⊆ U i := fun x ↦
    let ⟨i, hi⟩ := mem_iUnion.1 (hU (mem_univ x))
    ⟨i, isOpen_iff.1 (hUo i) x hi⟩
  choose i b hxb hbU using this
  obtain ⟨t, htc, ht⟩ := exists_countable_forall_mem_Ico
    (b := fun x : ℝ ↦ toReal (b (toReal.symm x))) fun x ↦ by
      simpa only [toReal.apply_symm_apply] using toReal_lt_toReal.2 (hxb (toReal.symm x))
  refine ⟨i ∘ toReal.symm '' t, htc.image _, fun y _ ↦ ?_⟩
  obtain ⟨x, hx, hyx₁, hyx₂⟩ := ht (toReal y)
  rw [← toReal.apply_symm_apply x, toReal_le_toReal] at hyx₁
  rw [toReal_lt_toReal] at hyx₂
  exact mem_biUnion (mem_image_of_mem _ hx) (hbU _ ⟨hyx₁, hyx₂⟩)

On this site: The Sorgenfrey line is Lindelöf

theorem not_secondCountableTopology

TopologyByExample.SorgenfreyLine.not_secondCountableTopology

The Sorgenfrey line is not second countable.

For any base, each x lies in some basic set contained in [x, ∞), whose least element is then x. This gives an injection of ℝₗ into the base, so the base is uncountable.

theorem not_secondCountableTopology : ¬SecondCountableTopology ℝₗ
Proof
:= by
  intro
  have : ∀ x : ℝₗ, ∃ s ∈ countableBasis ℝₗ, x ∈ s ∧ s ⊆ Ici x := fun x ↦
    (isBasis_countableBasis ℝₗ).exists_subset_of_mem_open self_mem_Ici (isOpen_Ici x)
  choose s hs hxs hsx using this
  have : Countable (countableBasis ℝₗ) := (countable_countableBasis ℝₗ).to_subtype
  have : Countable ℝₗ :=
    Function.Injective.countable (f := fun x ↦ (⟨s x, hs x⟩ : countableBasis ℝₗ)) fun x y h ↦ by
      have h : s x = s y := congrArg Subtype.val h
      exact le_antisymm (hsx x (h ▸ hxs y)) (hsx y (h ▸ hxs x))
  exact Cardinal.not_countable_real (countable_univ_iff.2 toReal.symm.injective.countable)

On this site: The Sorgenfrey line is not second countable

theorem not_metrizableSpace

TopologyByExample.SorgenfreyLine.not_metrizableSpace

The Sorgenfrey line is not metrizable: a separable metrizable space is second countable.

theorem not_metrizableSpace : ¬MetrizableSpace ℝₗ
Proof
:= by
  intro
  let := metrizableSpaceMetric ℝₗ
  exact not_secondCountableTopology inferInstance

theorem exists_rat_lt_forall_lt_of_isCompact

TopologyByExample.SorgenfreyLine.exists_rat_lt_forall_lt_of_isCompact

If K is a compact subset of the Sorgenfrey line, then below each point x there is a rational q < x that lies above every point of K below x: the set K ∩ (-∞, x) is compact, since (-∞, x) is clopen, so it is empty or has a greatest element.

theorem exists_rat_lt_forall_lt_of_isCompact {K : Set ℝₗ} (hK : IsCompact K) (x : ℝₗ) :
    ∃ q : ℚ, (q : ℝₗ) < x ∧ ∀ y ∈ K, y < x → y < q
Proof
:= by
  rcases (K ∩ Iio x).eq_empty_or_nonempty with h | h
  · obtain ⟨q, hq⟩ := exists_rat_lt x
    exact ⟨q, hq, fun y hy hyx ↦ (eq_empty_iff_forall_notMem.1 h y ⟨hy, hyx⟩).elim⟩
  · obtain ⟨m, ⟨-, hmx⟩, hm⟩ := (hK.inter_right (isClopen_Iio x).isClosed).exists_isGreatest h
    obtain ⟨q, hmq, hqx⟩ := exists_rat_btwn hmx
    exact ⟨q, hqx, fun y hy hyx ↦ (hm ⟨hy, hyx⟩).trans_lt hmq⟩

theorem countable_of_isCompact

TopologyByExample.SorgenfreyLine.countable_of_isCompact

Every compact subset of the Sorgenfrey line is countable.

Choosing for each x a rational q x as in exists_rat_lt_forall_lt_of_isCompact gives a strictly monotone, hence injective, map from K to ℚ: if x < y in K, then q x < x < q y.

theorem countable_of_isCompact {K : Set ℝₗ} (hK : IsCompact K) : K.Countable
Proof
:= by
  choose q hqx hq using exists_rat_lt_forall_lt_of_isCompact hK
  refine (mapsTo_univ q K).countable_of_injOn
    (StrictMonoOn.injOn fun x hx y _ hxy ↦ ?_) countable_univ
  exact_mod_cast (hqx x).trans (hq y x hx hxy)

On this site: Sorgenfrey line: Compact subsets are countable

theorem not_sigmaCompactSpace

TopologyByExample.SorgenfreyLine.not_sigmaCompactSpace

The Sorgenfrey line is not σ-compact: its compact subsets are countable (countable_of_isCompact), but it is uncountable.

theorem not_sigmaCompactSpace : ¬SigmaCompactSpace ℝₗ
Proof
:= by
  intro
  have : Countable ℝₗ := countable_univ_iff.1 <| iUnion_compactCovering ℝₗ ▸
    countable_iUnion fun n ↦ countable_of_isCompact (isCompact_compactCovering ℝₗ n)
  exact Cardinal.not_countable_real (countable_univ_iff.2 toReal.symm.injective.countable)

On this site: The Sorgenfrey line is not σ-compact

Hereditary Lindelöfness and perfect normality

theorem exists_countable_biUnion_eq

TopologyByExample.SorgenfreyLine.exists_countable_biUnion_eq

Every family of open subsets of the Sorgenfrey line has a countable subfamily with the same union.

Let Ω ⊆ ℝ be the union of the Euclidean interiors of the members. Countably many members cover the points of Ω, as ℝ is second countable. Any other point x of the union lies in some [x, b) inside a member, so (x, b) ⊆ Ω while x ∉ Ω; there are only countably many such x.

theorem exists_countable_biUnion_eq {ι : Type*} (U : ι → Set ℝₗ) (hU : ∀ i, IsOpen (U i)) :
    ∃ r : Set ι, r.Countable ∧ ⋃ i ∈ r, U i = ⋃ i, U i
Proof
:= by
  set O : ι → Set ℝ := fun i ↦ {x | ∀ᶠ y in 𝓝 x, toReal.symm y ∈ U i}
  have hO (i : ι) : IsOpen (O i) := isOpen_setOfPred_eventually_nhds
  have hOU (i : ι) (p : ℝₗ) (hp : toReal p ∈ O i) : p ∈ U i := by
    simpa using (show ∀ᶠ y in 𝓝 (toReal p), toReal.symm y ∈ U i from hp).self_of_nhds
  obtain ⟨r₀, hr₀c, hr₀⟩ := isOpen_iUnion_countable O hO
  set Ω := ⋃ i, O i
  set R := (⋃ i, U i) \ toReal ⁻¹' Ω
  have hR : (toReal '' R).Countable := by
    refine (countable_setOf_notMem_Ioo_subset_right Ω).mono ?_
    rintro _ ⟨p, ⟨hpU, hpΩ⟩, rfl⟩
    obtain ⟨i, hpi⟩ := mem_iUnion.1 hpU
    obtain ⟨b, hpb, hbU⟩ := isOpen_iff.1 (hU i) p hpi
    refine ⟨hpΩ, toReal b, toReal_lt_toReal.2 hpb, fun z hz ↦ mem_iUnion.2 ⟨i, ?_⟩⟩
    filter_upwards [isOpen_Ioo.mem_nhds hz] with w hw
    refine hbU ⟨?_, ?_⟩
    · rw [← toReal_le_toReal, RingEquiv.apply_symm_apply]
      exact hw.1.le
    · rw [← toReal_lt_toReal, RingEquiv.apply_symm_apply]
      exact hw.2
  have hRc : R.Countable := by
    refine (hR.image toReal.symm).mono fun p hp ↦ ?_
    exact ⟨toReal p, mem_image_of_mem _ hp, toReal.symm_apply_apply p⟩
  have : ∀ p : R, ∃ i, (p : ℝₗ) ∈ U i := fun p ↦ mem_iUnion.1 p.property.1
  choose j hj using this
  have := hRc.to_subtype
  refine ⟨r₀ ∪ range j, hr₀c.union (countable_range j),
    (iUnion₂_subset fun i _ ↦ subset_iUnion U i).antisymm fun p hp ↦ ?_⟩
  by_cases hpΩ : toReal p ∈ Ω
  · rw [← hr₀, mem_iUnion₂] at hpΩ
    obtain ⟨i, hi, hpi⟩ := hpΩ
    exact mem_biUnion (.inl hi) (hOU i p hpi)
  · exact mem_biUnion (.inr ⟨⟨p, hp, hpΩ⟩, rfl⟩) (hj ⟨p, hp, hpΩ⟩)

On this site: Sorgenfrey line: Countably many members of any family of open sets have the same union

instance instHereditarilyLindelofSpace

TopologyByExample.SorgenfreyLine.instHereditarilyLindelofSpace

The Sorgenfrey line is hereditarily Lindelöf: every subspace is Lindelöf.

instance instHereditarilyLindelofSpace : HereditarilyLindelofSpace ℝₗ
Proof
where
  isHereditarilyLindelof_univ _ _ := isLindelof_of_countable_subcover fun U hU htU ↦ by
    obtain ⟨r, hr, h⟩ := exists_countable_biUnion_eq U hU
    exact ⟨r, hr, h ▸ htU⟩

On this site: The Sorgenfrey line is hereditarily Lindelöf

instance instPerfectlyNormalSpace

TopologyByExample.SorgenfreyLine.instPerfectlyNormalSpace

The Sorgenfrey line is perfectly normal: it is regular (a completely normal T₁ space) and hereditarily Lindelöf.

instance instPerfectlyNormalSpace : PerfectlyNormalSpace ℝₗ
Proof
:=
  have : RegularSpace ℝₗ := regularSpace_of_t1Space_of_normalSpace
  perfectlyNormalSpace_of_regularSpace_of_hereditarilyLindelofSpace

instance instZeroDimensionalSpace

TopologyByExample.SorgenfreyLine.instZeroDimensionalSpace

The Sorgenfrey line is zero-dimensional: the clopen intervals [a, b) with a < b form a neighbourhood base at a.

instance instZeroDimensionalSpace : ZeroDimensionalSpace ℝₗ
Proof
:=
  zeroDimensionalSpace_iff_nhds_hasBasis_isClopen.2 fun x ↦
    (nhds_basis_Ico x).to_hasBasis'
      (fun y hy ↦ ⟨Ico x y, ⟨isClopen_Ico x y, left_mem_Ico.2 hy⟩, subset_rfl⟩)
      fun _ hs ↦ hs.1.isOpen.mem_nhds hs.2

On this site: The Sorgenfrey line is zero-dimensional

The Sorgenfrey line and the Sorgenfrey plane

theorem baireSpace

TopologyByExample.SorgenfreyLine.baireSpace

The Sorgenfrey line is a Baire space: every nonempty open set contains a half-open interval [x, y), hence the preimage of the usual open interval (x, y).

theorem baireSpace : BaireSpace ℝₗ
Proof
:= by
  refine baireSpace_of_continuous_of_surjective continuous_toReal toReal.surjective
    fun U hU ⟨x, hx⟩ ↦ ?_
  obtain ⟨y, hxy, hyU⟩ := isOpen_iff.1 hU x hx
  refine ⟨Ioo (toReal x) (toReal y), isOpen_Ioo, nonempty_Ioo.2 (toReal_lt_toReal.2 hxy),
    fun z hz ↦ hyU ?_⟩
  obtain ⟨h1, h2⟩ := hz
  exact ⟨(toReal_lt_toReal.1 h1).le, toReal_lt_toReal.1 h2⟩

On this site: The Sorgenfrey line is a Baire space

theorem not_isMeagre_univ

TopologyByExample.SorgenfreyLine.not_isMeagre_univ

The Sorgenfrey line is of second category in itself.

theorem not_isMeagre_univ : ¬IsMeagre (Set.univ : Set ℝₗ)
Proof
:=
  haveI := baireSpace
  not_isMeagre_univ_of_baireSpace