Cite

This course has no released version yet: the text at this address may change. Cite a released version when one exists.

/courses/martin-lof-randomness/measure
@misc{martin-lof-randomness-measure,
  title = {{Measure on Cantor space}},
  howpublished = {Lesson 1 of \emph{Martin-Löf randomness}, Computability Theory course notes},
  url = {/courses/martin-lof-randomness/measure},
  note = {Unreleased working version}
}

To cite a single statement, use the # link that appears next to its heading.

Lesson 1 of 4

Measure on Cantor space

The uniform measure on Cantor space; open classes generated by prefix-free sets; the measure of a Σ⁰₁ class is left-c.e. and that of a Π⁰₁ class right-c.e.; null classes; the Lebesgue density lemma.

35 min4 questions
Before this lesson:Trees and Π⁰₁ classes (Π⁰₁ classes) · The KC theorem and the coding theorem (Kolmogorov complexity)
Martin-Löf randomness · lesson 1 of 4
  1. Measure on Cantor space
  2. Martin-Löf tests
  3. The Levin–Schnorr theorem
  4. Randomness and Turing degrees

A sequence X∈2NX \in \cs chosen by tossing a fair coin for each bit belongs to a cylinder [σ][\sigma] with probability 2−∣σ∣2^{-|\sigma|}. The uniform measure extends this assignment to a large family of classes, and a property is typical if the class of sequences without it has measure 00. Random sequences, in the sense of this course, are those that avoid every null class that can be described effectively. This lesson collects the facts about the measure that the course uses, and computes how complex the measure of an effective class is.

We use the notation of Trees and Π⁰₁ classes: [σ][\sigma] is the cylinder of the sequences extending σ\sigma, [W]≺=⋃σ∈W[σ][W]^{\prec} = \bigcup_{\sigma \in W} [\sigma] the open class generated by a set of strings WW, and 2n2^n the set of strings of length nn.

1.1 The uniform measure

The Borel classes are the classes obtained from the cylinders by complements and countable unions, iterated transfinitely; they include the open, closed, Π20\Pi^0_2 and all arithmetical classes.

Fact 1.1 (Lebesgue, Carathéodory).#

There is a unique function λ\lambda from the Borel classes of 2N\cs to [0,1][0, 1] such that λ([σ])=2−∣σ∣\lambda([\sigma]) = 2^{-|\sigma|} for every string σ\sigma and λ\lambda is countably additive: if the classes Bn\mathcal B_n are pairwise disjoint, then λ(⋃nBn)=∑nλ(Bn)\lambda(\bigcup_n \mathcal B_n) = \sum_n \lambda(\mathcal B_n). Moreover λ\lambda is outer regular: for every Borel class B\mathcal B and every ε>0\varepsilon > 0, there is an open class U⊇B\mathcal U \supseteq \mathcal B with λ(U)≤λ(B)+ε\lambda(\mathcal U) \leq \lambda(\mathcal B) + \varepsilon.

This is a theorem of measure theory, admitted here: the existence is Carathéodory’s extension theorem, and outer regularity holds for every finite Borel measure on a metrizable space. See Kechris, Classical Descriptive Set Theory, Section 17, or any textbook on measure theory. The function λ\lambda is the Lebesgue measure, or uniform measure, on 2N\cs; it is the image of the Lebesgue measure on [0,1][0, 1] under the binary expansion.

The following consequences of countable additivity are used constantly:

  1. Monotonicity: if A⊆B\mathcal A \subseteq \mathcal B, then λ(A)≤λ(B)\lambda(\mathcal A) \leq \lambda(\mathcal B), and λ(B∖A)=λ(B)−λ(A)\lambda(\mathcal B \setminus \mathcal A) = \lambda(\mathcal B) - \lambda(\mathcal A).
  2. Subadditivity: λ(⋃nBn)≤∑nλ(Bn)\lambda(\bigcup_n \mathcal B_n) \leq \sum_n \lambda(\mathcal B_n) for every sequence of Borel classes.
  3. Continuity: if B0⊆B1⊆⋯\mathcal B_0 \subseteq \mathcal B_1 \subseteq \cdots, then λ(⋃nBn)=sup⁡nλ(Bn)\lambda(\bigcup_n \mathcal B_n) = \sup_n \lambda(\mathcal B_n); if B0⊇B1⊇⋯\mathcal B_0 \supseteq \mathcal B_1 \supseteq \cdots, then λ(⋂nBn)=inf⁡nλ(Bn)\lambda(\bigcap_n \mathcal B_n) = \inf_n \lambda(\mathcal B_n).

For (2), the classes Bn∖⋃m<nBm\mathcal B_n \setminus \bigcup_{m < n} \mathcal B_m are pairwise disjoint, have the same union, and are contained in the classes Bn\mathcal B_n. For (3), the first statement applies additivity to the differences Bn+1∖Bn\mathcal B_{n+1} \setminus \mathcal B_n, and the second follows by complementation.

1.2 Open classes

Two cylinders are either disjoint or contained in one another: [σ]∩[τ]=∅[\sigma] \cap [\tau] = \emptyset unless σ\sigma and τ\tau are comparable. A set of strings WW is prefix-free if no element of WW is a proper prefix of another; the cylinders [σ][\sigma], σ∈W\sigma \in W, are then pairwise disjoint, and by additivity

λ([W]≺)=∑σ∈W2−∣σ∣.\lambda([W]^{\prec}) = \sum_{\sigma \in W} 2^{-|\sigma|}.

For an arbitrary set WW, subadditivity gives only λ([W]≺)≤∑σ∈W2−∣σ∣\lambda([W]^{\prec}) \leq \sum_{\sigma \in W} 2^{-|\sigma|}. Every open class has a prefix-free generator: the set of σ∈W\sigma \in W with no proper prefix in WW generates [W]≺[W]^{\prec}. This set is not c.e. in general when WW is, but another prefix-free generator is.

Lemma 1.2.#

From an index of a c.e. set of strings WW, one computes an index of a c.e. prefix-free set W′W' with [W′]≺=[W]≺[W']^{\prec} = [W]^{\prec} and such that every element of W′W' extends an element of WW.

Proof of Lemma 1.2.

Enumerate WW as σ0,σ1,…\sigma_0, \sigma_1, \dots (if WW is finite, possibly empty, the stages after the last element of WW add nothing), and build W′W' as an increasing union of finite prefix-free sets Ws′W'_s, with W0′=∅W'_0 = \emptyset and [Ws′]≺=[{σi:i<s}]≺[W'_s]^{\prec} = [\{ \sigma_i : i < s \}]^{\prec}. At stage ss, let LL be the maximum of ∣σs∣|\sigma_s| and of the lengths of the elements of Ws′W'_s, and let Ws+1′W'_{s+1} be Ws′W'_s together with every string τ⪰σs\tau \succeq \sigma_s of length LL that has no prefix in Ws′W'_s.

A new string τ\tau has no prefix in Ws′W'_s, and no element of Ws′W'_s properly extends it, since these elements have length at most L=∣τ∣L = |\tau|; distinct new strings have the same length, so they are incomparable. Hence Ws+1′W'_{s+1} is prefix-free. Every new string extends σs\sigma_s, so [Ws+1′]≺⊆[{σi:i≤s}]≺[W'_{s+1}]^{\prec} \subseteq [\{ \sigma_i : i \leq s \}]^{\prec}. Conversely, let X≻σsX \succ \sigma_s; if X ⁣↾LX \uh L has no prefix in Ws′W'_s, it is one of the new strings, so in every case X∈[Ws+1′]≺X \in [W'_{s+1}]^{\prec}. The construction is effective and uniform in an index of WW.

1.3 The measure of effective classes

A real number rr is left-c.e. if it is the limit of a computable non-decreasing sequence of rationals, and right-c.e. if it is the limit of a computable non-increasing sequence of rationals, that is, if −r-r is left-c.e. A real is computable if and only if it is both: given the two approximations, wait until they are within 2−n2^{-n} of each other to approximate rr to precision 2−n2^{-n}. Chaitin’s number Ω\Omega is left-c.e. and not computable (Chaitin).

Proposition 1.3.#
  1. If U=[W]≺\mathcal U = [W]^{\prec} with WW c.e., then λ(U)\lambda(\mathcal U) is left-c.e., uniformly in an index of WW: with W′W' as in Lemma 1.2, λ(U)=lim⁡s∑σ∈Ws′2−∣σ∣\lambda(\mathcal U) = \lim_s \sum_{\sigma \in W'_s} 2^{-|\sigma|}.
  2. If P=[T]\mathcal P = [T] with TT a computable tree, then λ(P)=lim⁡n2−n∣T∩2n∣\lambda(\mathcal P) = \lim_n 2^{-n} |T \cap 2^n|, a non-increasing limit. So λ(P)\lambda(\mathcal P) is right-c.e., uniformly in an index of TT.
  3. In both cases the measure is computable in ∅′\emptyset'.
Proof of Proposition 1.3.
  1. The classes [Ws′]≺[W'_s]^{\prec} increase with union U\mathcal U, and λ([Ws′]≺)=∑σ∈Ws′2−∣σ∣\lambda([W'_s]^{\prec}) = \sum_{\sigma \in W'_s} 2^{-|\sigma|} since Ws′W'_s is prefix-free. By continuity, λ(U)\lambda(\mathcal U) is the supremum of these computable rationals.
  2. Let Cn=[T∩2n]≺\mathcal C_n = [T \cap 2^n]^{\prec}; its measure is 2−n∣T∩2n∣2^{-n}|T \cap 2^n|, since 2n2^n is prefix-free. Since TT is closed under prefixes, every node of length n+1n+1 extends a node of length nn, so Cn+1⊆Cn\mathcal C_{n+1} \subseteq \mathcal C_n. A sequence XX belongs to every Cn\mathcal C_n if and only if X ⁣↾n∈TX \uh n \in T for every nn, that is, X∈[T]X \in [T]. By continuity, λ(P)=inf⁡nλ(Cn)\lambda(\mathcal P) = \inf_n \lambda(\mathcal C_n).
  3. A real that is left-c.e. or right-c.e. is the limit of a computable sequence of rationals that is monotone. With ∅′\emptyset' one decides, for a rational qq, whether some term of a non-decreasing sequence exceeds qq, a Σ10\Sigma^0_1 question; this suffices to compute the binary expansion, or approximations to any precision. The same holds for non-increasing sequences.

The bounds of the proposition are sharp: by the first exercise below, every left-c.e. real of [0,1][0, 1] is the measure of a Σ10\Sigma^0_1 class. Since Ω\Omega is not computable, neither is the measure 1−Ω1 - \Omega of the complementary Π10\Pi^0_1 class.

1.4 Null classes

Definition 1.4.#

A Borel class N\mathcal N is null if λ(N)=0\lambda(\mathcal N) = 0, and conull, or of measure one, if its complement is null. A property of sequences holds for almost every XX if the class of sequences with this property is conull.

By outer regularity, N\mathcal N is null if and only if, for every ε>0\varepsilon > 0, it is contained in an open class of measure at most ε\varepsilon. A countable union of null classes is null, by subadditivity. A singleton {X}\{ X \} is null, since it is contained in [X ⁣↾n][X \uh n] for every nn; so every countable class is null, the class of computable sequences for instance.

Example 1.5.#
  1. The class N\mathcal N of sequences XX with X(2i)=X(2i+1)X(2i) = X(2i+1) for every ii is null and uncountable. Let WnW_n be the set of strings σ\sigma of length 2n2n with σ(2i)=σ(2i+1)\sigma(2i) = \sigma(2i+1) for i<ni < n. Then N⊆[Wn]≺\mathcal N \subseteq [W_n]^{\prec}, and λ([Wn]≺)=2n⋅2−2n=2−n\lambda([W_n]^{\prec}) = 2^n \cdot 2^{-2n} = 2^{-n}.
  2. For a computable infinite set AA, the class of sequences XX with X(a)=0X(a) = 0 for every a∈Aa \in A is null: if a0<a1<⋯a_0 < a_1 < \cdots enumerate AA, it is contained in the clopen class of sequences vanishing at a0,…,an−1a_0, \dots, a_{n-1}, of measure 2−n2^{-n}.

In both examples, the covers are given by an algorithm: the open class of measure at most 2−n2^{-n} is computed from nn. The next lesson calls a sequence random if it avoids every null class that admits such an effective sequence of covers.

1.5 Relative measure and density

For a Borel class B\mathcal B and a string σ\sigma, the relative measure of B\mathcal B in [σ][\sigma] is

λ(B∣σ)=λ(B∩[σ])λ([σ])=2∣σ∣ λ(B∩[σ]).\lambda(\mathcal B \mid \sigma) = \frac{\lambda(\mathcal B \cap [\sigma])}{\lambda([\sigma])} = 2^{|\sigma|}\, \lambda(\mathcal B \cap [\sigma]).

It is the proportion of [σ][\sigma] occupied by B\mathcal B. Since [σ][\sigma] is the disjoint union of [σ0][\sigma 0] and [σ1][\sigma 1], λ(B∣σ)\lambda(\mathcal B \mid \sigma) is the average of λ(B∣σ0)\lambda(\mathcal B \mid \sigma 0) and λ(B∣σ1)\lambda(\mathcal B \mid \sigma 1); more generally, it is the average of λ(B∣τ)\lambda(\mathcal B \mid \tau) over the 2k2^k extensions τ\tau of σ\sigma of length ∣σ∣+k|\sigma| + k.

A class of positive measure cannot be spread thinly over every cylinder: some cylinder is almost filled by it.

Lemma 1.6 (Lebesgue density lemma).#

Let B\mathcal B be a Borel class with λ(B)>0\lambda(\mathcal B) > 0. For every ε>0\varepsilon > 0, there is a string σ\sigma with λ(B∣σ)>1−ε\lambda(\mathcal B \mid \sigma) > 1 - \varepsilon.

Proof of Lemma 1.6.

If ε≥1\varepsilon \geq 1, the empty string works, since λ(B)>0\lambda(\mathcal B) > 0; so assume ε<1\varepsilon < 1. By outer regularity, there is an open class U⊇B\mathcal U \supseteq \mathcal B with λ(U)<λ(B)/(1−ε)\lambda(\mathcal U) < \lambda(\mathcal B) / (1 - \varepsilon), a number larger than λ(B)\lambda(\mathcal B). Write U=[W]≺\mathcal U = [W]^{\prec} with WW prefix-free. The classes B∩[σ]\mathcal B \cap [\sigma], σ∈W\sigma \in W, are pairwise disjoint with union B\mathcal B. If λ(B∣σ)≤1−ε\lambda(\mathcal B \mid \sigma) \leq 1 - \varepsilon for every σ∈W\sigma \in W, then

λ(B)=∑σ∈Wλ(B∩[σ])≤(1−ε)∑σ∈W2−∣σ∣=(1−ε) λ(U)<λ(B),\lambda(\mathcal B) = \sum_{\sigma \in W} \lambda(\mathcal B \cap [\sigma]) \leq (1 - \varepsilon) \sum_{\sigma \in W} 2^{-|\sigma|} = (1 - \varepsilon)\, \lambda(\mathcal U) < \lambda(\mathcal B),

a contradiction. So some σ∈W\sigma \in W satisfies λ(B∣σ)>1−ε\lambda(\mathcal B \mid \sigma) > 1 - \varepsilon.

Lebesgue proved a stronger statement, the density theorem: for almost every X∈BX \in \mathcal B, λ(B∣X ⁣↾n)\lambda(\mathcal B \mid X \uh n) tends to 11. The lemma suffices for this course.

1.6 Exercises

Exercise 1.7 ★.

Show that for every left-c.e. real r∈[0,1]r \in [0, 1] there is a Σ10\Sigma^0_1 class of measure rr. Deduce that there is a non-empty Π10\Pi^0_1 class whose measure is not computable.

Solution

Let (rs)(r_s) be a computable non-decreasing sequence of rationals with limit rr; replacing rsr_s by max⁡(rs,0)\max(r_s, 0), we may assume 0≤rs≤10 \leq r_s \leq 1. For a string σ\sigma, let 0.σ=∑i<∣σ∣σ(i)2−i−10.\sigma = \sum_{i < |\sigma|} \sigma(i) 2^{-i-1}, and let WW be the c.e. set of strings σ\sigma with 0.σ+2−∣σ∣≤rs0.\sigma + 2^{-|\sigma|} \leq r_s for some ss. For fixed nn and ss, let Wn,sW_{n,s} be the set of strings σ\sigma of length nn with 0.σ+2−n≤rs0.\sigma + 2^{-n} \leq r_s. The numbers 0.σ0.\sigma, ∣σ∣=n|\sigma| = n, are the k 2−nk\, 2^{-n} with k<2nk < 2^n, so Wn,sW_{n,s} has ⌊2nrs⌋\lfloor 2^n r_s \rfloor elements and λ([Wn,s]≺)=2−n⌊2nrs⌋\lambda([W_{n,s}]^{\prec}) = 2^{-n} \lfloor 2^n r_s \rfloor. Both extensions of an element of Wn,sW_{n,s} belong to Wn+1,sW_{n+1,s}, and Wn,s⊆Wn,s+1W_{n,s} \subseteq W_{n,s+1}. So [W]≺[W]^{\prec} is the increasing union of the classes [Wn,n]≺[W_{n,n}]^{\prec}, and its measure is lim⁡n2−n⌊2nrn⌋=r\lim_n 2^{-n} \lfloor 2^n r_n \rfloor = r, since ∣2−n⌊2nrn⌋−rn∣≤2−n|2^{-n}\lfloor 2^n r_n \rfloor - r_n| \leq 2^{-n}.

For the second statement, apply this to Ω\Omega, which is left-c.e. and in (0,1)(0, 1): the complement of the class obtained is a Π10\Pi^0_1 class of measure 1−Ω>01 - \Omega > 0, hence non-empty, and 1−Ω1 - \Omega is not computable since Ω\Omega is not.

Exercise 1.8 ★★.

Let P=[T]\mathcal P = [T] be a Π10\Pi^0_1 class, with TT computable, such that λ(P)=0\lambda(\mathcal P) = 0. Show that there is a computable function n↦Fnn \mapsto F_n, with FnF_n a finite set of strings given by its canonical index, such that P⊆[Fn]≺\mathcal P \subseteq [F_n]^{\prec} and λ([Fn]≺)≤2−n\lambda([F_n]^{\prec}) \leq 2^{-n} for every nn. Show also that a Π10\Pi^0_1 class of positive measure has a non-computable member.

Solution

By Proposition 1.3 (2), 2−m∣T∩2m∣2^{-m}|T \cap 2^m| tends to λ(P)=0\lambda(\mathcal P) = 0. Given nn, search for the least mm with 2−m∣T∩2m∣≤2−n2^{-m}|T \cap 2^m| \leq 2^{-n}, which exists and is found since TT is computable, and let Fn=T∩2mF_n = T \cap 2^m. Then P⊆[Fn]≺\mathcal P \subseteq [F_n]^{\prec}, as in the proof of the proposition.

For the second statement, the class of computable sequences is countable, hence null. If every member of P\mathcal P were computable, P\mathcal P would be null.

1.7 Notes and references

Borel introduced the measure of sets of reals in 1898; Lebesgue (1901, 1902) defined the measure of arbitrary sets through countable covers by intervals, which is the origin of outer regularity. Carathéodory (1914) gave the abstract construction. The computation of the measure of effective classes is folklore; the density theorem is due to Lebesgue (1904).

  • A. S. Kechris, Classical Descriptive Set Theory, Springer, 1995.
  • R. G. Downey and D. R. Hirschfeldt, Algorithmic Randomness and Complexity, Springer, 2010.
  • A. Nies, Computability and Randomness, Oxford University Press, 2009.