Lean library · module TopologyByExample.Spaces.RealLine

The real line

Source file

The real line ℝ with its Euclidean topology. Every value of the space's properties that is not a consequence of others is a Mathlib instance: the line is completely metrizable, σ-compact, weakly locally compact, noncompact, path connected and locally path connected.

Its own theory: the connected subsets of the line are exactly its order-convex subsets (the intervals), so removing any point disconnects it; the line is not a countable union of nowhere dense sets, and so it is uncountable; it is contractible.

Main statements

Tags

real line, Euclidean topology, interval, Baire category, contractible

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

Values

theorem isCompletelyMetrizableSpace

TopologyByExample.RealLine.isCompletelyMetrizableSpace

The real line is completely metrizable: its usual metric is complete.

theorem isCompletelyMetrizableSpace : IsCompletelyMetrizableSpace ℝ
Proof
:= inferInstance

On this site: The real line is completely metrizable

theorem sigmaLocallyCompact

TopologyByExample.RealLine.sigmaLocallyCompact

The real line is σ-locally compact: σ-compact (the union of the intervals [-n, n]) and weakly locally compact (every point has the compact neighbourhood [x - 1, x + 1]).

theorem sigmaLocallyCompact : SigmaCompactSpace ℝ ∧ WeaklyLocallyCompactSpace ℝ
Proof
:=
  ⟨inferInstance, inferInstance⟩

On this site: The real line is σ-locally compact

theorem not_compactSpace

TopologyByExample.RealLine.not_compactSpace

The real line is not compact.

theorem not_compactSpace : ¬CompactSpace ℝ
Proof
:= not_compactSpace_iff.2 inferInstance

On this site: The real line is not compact

theorem pathPreconnectedSpace

TopologyByExample.RealLine.pathPreconnectedSpace

Any two points of the real line are joined by a path.

theorem pathPreconnectedSpace : PathPreconnectedSpace ℝ
Proof
:= inferInstance

On this site: The real line is path connected

theorem locallyPathConnectedSpace

TopologyByExample.RealLine.locallyPathConnectedSpace

The real line is locally path connected.

theorem locallyPathConnectedSpace : LocallyPathConnectedSpace ℝ
Proof
:= inferInstance

On this site: The real line is locally path connected

theorem nonempty

TopologyByExample.RealLine.nonempty

The real line is nonempty.

theorem nonempty : Nonempty ℝ
Proof
:= inferInstance

Results

theorem isPreconnected_iff_ordConnected

TopologyByExample.RealLine.isPreconnected_iff_ordConnected

A subset of the real line is preconnected if and only if it contains every point between any two of its points.

theorem isPreconnected_iff_ordConnected {s : Set ℝ} : IsPreconnected s ↔ OrdConnected s
Proof
:=
  _root_.isPreconnected_iff_ordConnected

On this site: Real line: The connected subsets are the intervals

theorem not_isPreconnected_compl_singleton

TopologyByExample.RealLine.not_isPreconnected_compl_singleton

Removing a point from the real line leaves a set that is not preconnected: a - 1 and a + 1 lie in it and a does not.

theorem not_isPreconnected_compl_singleton (a : ℝ) : ¬IsPreconnected ({a}ᶜ : Set ℝ)
Proof
:= by
  rw [isPreconnected_iff_ordConnected]
  intro h
  have := h.out (show a - 1 ∈ ({a}ᶜ : Set ℝ) by simp) (show a + 1 ∈ ({a}ᶜ : Set ℝ) by simp)
    ⟨by linarith, by linarith⟩
  simp at this

theorem not_isMeagre_univ

TopologyByExample.RealLine.not_isMeagre_univ

The real line is not meagre in itself.

theorem not_isMeagre_univ : ¬IsMeagre (univ : Set ℝ)
Proof
:=
  not_isMeagre_of_isOpen isOpen_univ univ_nonempty

theorem univ_ne_iUnion_isNowhereDense

TopologyByExample.RealLine.univ_ne_iUnion_isNowhereDense

The real line is not the union of countably many nowhere dense sets.

theorem univ_ne_iUnion_isNowhereDense (f : ℕ → Set ℝ) (hf : ∀ n, IsNowhereDense (f n)) :
    ⋃ n, f n ≠ univ
Proof
:= fun h ↦
  not_isMeagre_univ <| by
    rw [← h]
    exact isMeagre_iUnion fun n ↦ (hf n).isMeagre

theorem not_countable

TopologyByExample.RealLine.not_countable

The real line is uncountable.

theorem not_countable : ¬(univ : Set ℝ).Countable
Proof
:= fun hc ↦
  not_isMeagre_univ <| by
    rw [← biUnion_of_singleton (univ : Set ℝ)]
    exact isMeagre_biUnion hc fun x _ ↦
      (isClosed_singleton.isNowhereDense_iff.2 (interior_singleton x)).isMeagre

On this site: Real line: The real line is uncountable

theorem contractibleSpace

TopologyByExample.RealLine.contractibleSpace

The real line is contractible.

theorem contractibleSpace : ContractibleSpace ℝ
Proof
:= inferInstance

On this site: Real line: The real line is contractible

On this site: Space: Real line; Space: Real line with an isolated point