The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V15. Real analysis in one variable

Mathlib.Analysis.Real.Cardinality

30 declarations. Mathlib docs Β· Source

The cardinality of the reals

This file shows that the real numbers have cardinality continuum, i.e. #ℝ = 𝔠.

We show that #ℝ ≀ 𝔠 by noting that every real number is determined by a Cauchy-sequence of the form β„• β†’ β„š, which has cardinality 𝔠. To show that #ℝ β‰₯ 𝔠 we define an injection from {0, 1} ^ β„• to ℝ with f ↦ Ξ£ n, f n * (1 / 3) ^ n.

We conclude that all intervals with distinct endpoints have cardinality continuum.

Main definitions

  • Cardinal.cantorFunction is the function that sends f in {0, 1} ^ β„• to ℝ by f ↦ Ξ£' n, f n * (1 / 3) ^ n

Main statements

  • Cardinal.mk_real : #ℝ = 𝔠: the reals have cardinality continuum.
  • Cardinal.not_countable_real: the universal set of real numbers is not countable. We can use this same proof to show that all the other sets in this file are not countable.
  • 8 lemmas of the form mk_Ixy_real for x,y ∈ {i,o,c} state that intervals on the reals have cardinality continuum.

Notation

  • 𝔠 : notation for Cardinal.continuum in scope Cardinal, defined in SetTheory.Continuum.

Tags

continuum, cardinality, reals, cardinality of the reals

def Cardinal.cantorFunctionAux E0 #

ℝ β†’ (β„• β†’ Bool) β†’ β„• β†’ ℝ

The body of the sum in cantorFunction. cantorFunctionAux c f n = c ^ n if f n = true; cantorFunctionAux c f n = 0 if f n = false.

theorem Cardinal.cantorFunctionAux_true E0 #

βˆ€ {c : ℝ} {f : β„• β†’ Bool} {n : β„•}, f n = true β†’ Cardinal.cantorFunctionAux c f n = c ^ n

theorem Cardinal.cantorFunctionAux_false E0 #

βˆ€ {c : ℝ} {f : β„• β†’ Bool} {n : β„•}, f n = false β†’ Cardinal.cantorFunctionAux c f n = 0

theorem Cardinal.cantorFunctionAux_nonneg E1 #

βˆ€ {c : ℝ} {f : β„• β†’ Bool} {n : β„•}, 0 ≀ c β†’ 0 ≀ Cardinal.cantorFunctionAux c f n

theorem Cardinal.cantorFunctionAux_eq E0 #

βˆ€ {c : ℝ} {f g : β„• β†’ Bool} {n : β„•}, f n = g n β†’ Cardinal.cantorFunctionAux c f n = Cardinal.cantorFunctionAux c g n

theorem Cardinal.cantorFunctionAux_zero E1 #

βˆ€ {c : ℝ} (f : β„• β†’ Bool), Cardinal.cantorFunctionAux c f 0 = bif f 0 then 1 else 0

theorem Cardinal.cantorFunctionAux_succ E1 #

βˆ€ {c : ℝ} (f : β„• β†’ Bool),
  (fun n ↦ Cardinal.cantorFunctionAux c f (n + 1)) = fun n ↦ c * Cardinal.cantorFunctionAux c (fun n ↦ f (n + 1)) n

theorem Cardinal.summable_cantor_function E1 #

βˆ€ {c : ℝ} (f : β„• β†’ Bool), 0 ≀ c β†’ c < 1 β†’ Summable (Cardinal.cantorFunctionAux c f)

def Cardinal.cantorFunction E3 #

ℝ β†’ (β„• β†’ Bool) β†’ ℝ

cantorFunction c (f : β„• β†’ Bool) is Ξ£ n, f n * c ^ n, where true is interpreted as 1 and false is interpreted as 0. It is implemented using cantorFunctionAux.

theorem Cardinal.cantorFunction_le E1 #

βˆ€ {c : ℝ} {f g : β„• β†’ Bool},
  0 ≀ c β†’ c < 1 β†’ (βˆ€ (n : β„•), f n = true β†’ g n = true) β†’ Cardinal.cantorFunction c f ≀ Cardinal.cantorFunction c g

theorem Cardinal.cantorFunction_succ E1 #

βˆ€ {c : ℝ} (f : β„• β†’ Bool),
  0 ≀ c β†’
    c < 1 β†’ Cardinal.cantorFunction c f = (bif f 0 then 1 else 0) + c * Cardinal.cantorFunction c fun n ↦ f (n + 1)

theorem Cardinal.increasing_cantorFunction E1 #

βˆ€ {c : ℝ},
  0 < c β†’
    c < 1 / 2 β†’
      βˆ€ {n : β„•} {f g : β„• β†’ Bool},
        (βˆ€ k < n, f k = g k) β†’ f n = false β†’ g n = true β†’ Cardinal.cantorFunction c f < Cardinal.cantorFunction c g

cantorFunction c is strictly increasing with if 0 < c < 1/2, if we endow β„• β†’ Bool with a lexicographic order. The lexicographic order doesn't exist for these infinitary products, so we explicitly write out what it means.

theorem Cardinal.cantorFunction_injective E1 #

βˆ€ {c : ℝ}, 0 < c β†’ c < 1 / 2 β†’ Function.Injective (Cardinal.cantorFunction c)

cantorFunction c is injective if 0 < c < 1/2.

theorem Cardinal.mk_real E1 #

Cardinal.mk ℝ = Cardinal.continuum

The cardinality of the reals, as a type.

theorem Cardinal.mk_univ_real E1 #

Cardinal.mk ↑Set.univ = Cardinal.continuum

The cardinality of the reals, as a set.

instance Cardinal.instUncountableReal E0 #

Uncountable ℝ

Non-Denumerability of the Continuum: The reals are not countable.

theorem Cardinal.not_countable_real E3 #

Β¬Set.univ.Countable

theorem Cardinal.mk_Ioi_real E1 #

βˆ€ (a : ℝ), Cardinal.mk ↑(Set.Ioi a) = Cardinal.continuum

The cardinality of the interval $(a, ∞)$.

theorem Cardinal.mk_Ici_real E1 #

βˆ€ (a : ℝ), Cardinal.mk ↑(Set.Ici a) = Cardinal.continuum

The cardinality of the interval $[a, ∞)$.

theorem Cardinal.mk_Iio_real E1 #

βˆ€ (a : ℝ), Cardinal.mk ↑(Set.Iio a) = Cardinal.continuum

The cardinality of the interval $(-∞, a)$.

theorem Cardinal.mk_Iic_real E1 #

βˆ€ (a : ℝ), Cardinal.mk ↑(Set.Iic a) = Cardinal.continuum

The cardinality of the interval $(-∞, a]$.

theorem Cardinal.mk_Ioo_real E1 #

βˆ€ {a b : ℝ}, a < b β†’ Cardinal.mk ↑(Set.Ioo a b) = Cardinal.continuum

The cardinality of the interval $(a, b)$.

theorem Cardinal.mk_Ico_real E1 #

βˆ€ {a b : ℝ}, a < b β†’ Cardinal.mk ↑(Set.Ico a b) = Cardinal.continuum

The cardinality of the interval $[a, b)$.

theorem Cardinal.mk_Icc_real E1 #

βˆ€ {a b : ℝ}, a < b β†’ Cardinal.mk ↑(Set.Icc a b) = Cardinal.continuum

The cardinality of the interval $[a, b]$.

theorem Cardinal.mk_Ioc_real E1 #

βˆ€ {a b : ℝ}, a < b β†’ Cardinal.mk ↑(Set.Ioc a b) = Cardinal.continuum

The cardinality of the interval $(a, b]$.

theorem Cardinal.mk_unitInterval E0 #

Cardinal.mk ↑unitInterval = Cardinal.continuum

theorem Cardinal.Real.Ioo_countable_iff E0 #

βˆ€ {x y : ℝ}, (Set.Ioo x y).Countable ↔ y ≀ x

theorem Cardinal.Real.Ico_countable_iff E0 #

βˆ€ {x y : ℝ}, (Set.Ico x y).Countable ↔ y ≀ x

theorem Cardinal.Real.Ioc_countable_iff E0 #

βˆ€ {x y : ℝ}, (Set.Ioc x y).Countable ↔ y ≀ x

theorem Cardinal.Real.Icc_countable_iff E0 #

βˆ€ {x y : ℝ}, (Set.Icc x y).Countable ↔ y ≀ x