Lean library · module TopologyByExample.Spaces.CantorSet

The Cantor set

Source file

The Cantor set is the countable power ℕ → Bool of the two-point discrete space. Its row of properties follows from the transfer theorems of the countable power; this file proves the results about it shown on its page:

All four are short consequences of Mathlib's theory of the Cantor set.

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

theorem nonempty_homeomorph_cantorSet

TopologyByExample.CantorSet.nonempty_homeomorph_cantorSet

The countable power of the two-point discrete space is homeomorphic to Cantor's middle-thirds set cantorSet ⊆ ℝ.

theorem nonempty_homeomorph_cantorSet : Nonempty ((ℕ → Bool) ≃ₜ _root_.cantorSet)
Proof
:=
  ⟨cantorSetHomeomorphNatToBool.symm⟩

On this site: Cantor set: Homeomorphic to the middle-thirds set

theorem nonempty_homeomorph_pi

TopologyByExample.CantorSet.nonempty_homeomorph_pi

The Cantor set is homeomorphic to its own countable power.

theorem nonempty_homeomorph_pi : Nonempty ((ℕ → Bool) ≃ₜ (ℕ → ℕ → Bool))
Proof
:=
  ⟨cantorSpaceHomeomorphNatToCantorSpace⟩

On this site: Cantor set: Homeomorphic to its own countable power

attribute [local instance] PiNat.metricSpace in

theorem exists_retraction

TopologyByExample.CantorSet.exists_retraction

Every nonempty closed subset of the Cantor set is a retract of it: there is a continuous map of the Cantor set onto the subset that fixes each of its points.

theorem exists_retraction {s : Set (ℕ → Bool)} (hs : IsClosed s) (hne : s.Nonempty) :
    ∃ f : (ℕ → Bool) → (ℕ → Bool), Continuous f ∧ (∀ x ∈ s, f x = x) ∧ Set.range f = s
Proof
:= by
  obtain ⟨f, fs, frange, hf⟩ := PiNat.exists_lipschitz_retraction_of_isClosed hs hne
  exact ⟨f, hf.continuous, fs, frange⟩

On this site: Cantor set: Every nonempty closed subset is a retract

theorem exists_continuous_surjective_of_compactSpace

TopologyByExample.CantorSet.exists_continuous_surjective_of_compactSpace

The Hausdorff–Alexandroff theorem: every nonempty compact metrizable space is a continuous image of the Cantor set.

theorem exists_continuous_surjective_of_compactSpace (X : Type*) [TopologicalSpace X]
    [MetrizableSpace X] [CompactSpace X] [Nonempty X] :
    ∃ f : (ℕ → Bool) → X, Continuous f ∧ Function.Surjective f
Proof
:= by
  let := metrizableSpaceMetric X
  exact exists_nat_bool_continuous_surjective_of_compact X

On this site: Cantor set: Every compact metrizable space is a continuous image

On this site: Space: Cantor set