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/levin-schnorr
@misc{martin-lof-randomness-levin-schnorr,
  title = {{The Levin–Schnorr theorem}},
  howpublished = {Lesson 3 of \emph{Martin-Löf randomness}, Computability Theory course notes},
  url = {/courses/martin-lof-randomness/levin-schnorr},
  note = {Unreleased working version}
}

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

Lesson 3 of 4

The Levin–Schnorr theorem

A sequence is Martin-Löf random if and only if its initial segments are incompressible for prefix-free complexity; Chaitin's Ω is random; the ample excess lemma and Chaitin's characterization of randomness by the growth of K(X↾n) − n.

35 min4 questions
Before this lesson:Martin-Löf tests
Martin-Löf randomness · lesson 3 of 4
  1. Measure on Cantor space
  2. Martin-Löf tests
  3. The Levin–Schnorr theorem
  4. Randomness and Turing degrees

The course on Kolmogorov complexity proposed to call a sequence random when its initial segments are incompressible, and showed that plain complexity cannot be used for this purpose (Corollary 2.4 of “Complexity of initial segments”). With prefix-free complexity, the proposal succeeds, and gives exactly the Martin-Löf random sequences. This theorem of Levin and Schnorr connects the measure-theoretic definition of the previous lesson with the definition by incompressibility. It shows at once that Ω\Omega is random, and leads to finer information on the complexity of random sequences.

Throughout, KK is the prefix-free complexity defined by an optimal prefix-free machine UU, and ≤+\leq^+ denotes inequality up to an additive constant.

3.1 Randomness and incompressibility

Theorem 3.1 (Levin, Schnorr).#

A sequence ZZ is Martin-Löf random if and only if there is a constant cc with K(Z ⁣↾n)≥n−cK(Z \uh n) \geq n - c for every nn.

Proof of Theorem 3.1.

(⇒\Rightarrow) Suppose that for every cc there is nn with K(Z ⁣↾n)<n−cK(Z \uh n) < n - c. For each cc, let Vc\mathcal V_c be the open class generated by the set of strings σ\sigma with K(σ)<∣σ∣−cK(\sigma) < |\sigma| - c. This set is c.e., uniformly in cc, since KK is approximable from above: K(σ)<kK(\sigma) < k if and only if U(τ) ⁣ ⁣↓=σU(\tau)\converge = \sigma for some τ\tau of length less than kk. Let WW be the set of the minimal elements of this set, those with no proper prefix in it; it is prefix-free and generates Vc\mathcal V_c. Then

λ(Vc)=∑σ∈W2−∣σ∣<∑σ∈W2−K(σ)−c≤2−c,\lambda(\mathcal V_c) = \sum_{\sigma \in W} 2^{-|\sigma|} < \sum_{\sigma \in W} 2^{-K(\sigma) - c} \leq 2^{-c},

by Proposition 3.4 of “Prefix-free complexity” (4), if WW is non-empty; otherwise λ(Vc)=0\lambda(\mathcal V_c) = 0. So (Vc)(\mathcal V_c) is a Martin-Löf test, and ZZ belongs to every Vc\mathcal V_c by hypothesis, so it is not random.

(⇐\Leftarrow) Suppose that ZZ is captured by a Martin-Löf test (Un)(\mathcal U_n). By Lemma 1.2, there are c.e. prefix-free sets WnW_n, uniformly in nn, with Un=[Wn]≺\mathcal U_n = [W_n]^{\prec}. Every σ∈Wn\sigma \in W_n satisfies 2−∣σ∣≤λ(Un)≤2−n2^{-|\sigma|} \leq \lambda(\mathcal U_n) \leq 2^{-n}, so ∣σ∣≥n|\sigma| \geq n. Enumerate the requests (σ,∣σ∣−c)(\sigma, |\sigma| - c) for c≥1c \geq 1 and σ∈W2c\sigma \in W_{2c}; their lengths are at least cc. Their weight is

∑c≥1∑σ∈W2c2−∣σ∣+c=∑c≥12cλ(U2c)≤∑c≥12−c=1.\sum_{c \geq 1} \sum_{\sigma \in W_{2c}} 2^{-|\sigma| + c} = \sum_{c \geq 1} 2^c \lambda(\mathcal U_{2c}) \leq \sum_{c \geq 1} 2^{-c} = 1.

By the KC theorem (KC theorem; Levin, Schnorr, Chaitin), there is a constant dd with K(σ)≤∣σ∣−c+dK(\sigma) \leq |\sigma| - c + d for every c≥1c \geq 1 and σ∈W2c\sigma \in W_{2c}. Since Z∈U2cZ \in \mathcal U_{2c}, some prefix Z ⁣↾nZ \uh n belongs to W2cW_{2c}, and K(Z ⁣↾n)≤n−c+dK(Z \uh n) \leq n - c + d. As cc is arbitrary, no constant bounds n−K(Z ⁣↾n)n - K(Z \uh n).

The two directions use the two faces of KK. Incompressibility fails on an effectively open class of small measure, because KK satisfies the Kraft inequality and is approximable from above. Conversely, the KC theorem turns a test into a machine that compresses the strings generating its components, the gain cc being paid for by the measure 2−2c2^{-2c} of the component used.

Corollary 3.2.#

The classes Vc=[{σ:K(σ)<∣σ∣−c}]≺\mathcal V_c = [\{ \sigma : K(\sigma) < |\sigma| - c \}]^{\prec} form a universal Martin-Löf test.

Proof of Corollary 3.2.

The first part of the proof shows that (Vc)(\mathcal V_c) is a Martin-Löf test. The second shows that if ZZ is captured by some test, then for every cc there is nn with K(Z ⁣↾n)<n−cK(Z \uh n) < n - c, that is, Z∈VcZ \in \mathcal V_c.

3.2 The halting probability is random

Corollary 3.3 (Chaitin).#

The binary expansion of Ω\Omega is Martin-Löf random. In particular there is a random sequence Turing equivalent to ∅′\emptyset', and a random left-c.e. real.

Proof of Corollary 3.3.

By Chaitin, K(ω ⁣↾n)≥n−cK(\omega \uh n) \geq n - c for every nn, and ω≡T∅′\omega \equiv_T \emptyset'. Apply Theorem 3.1.

Random sequences can therefore be computationally powerful, unlike the low random sequences of Corollary 2.5. A left-c.e. real of (0,1)(0, 1) is random if and only if it is the halting probability of some optimal prefix-free machine, by results of Calude, Hertling, Khoussainov and Wang, and of Kučera and Slaman (2001); this is admitted here.

3.3 The ample excess lemma

The Levin–Schnorr theorem gives a lower bound n−cn - c on the complexity of the prefixes of a random sequence. The excess K(Z ⁣↾n)−nK(Z \uh n) - n is in fact large for most nn.

Theorem 3.4 (Ample excess lemma; Miller, Yu).#

A sequence ZZ is Martin-Löf random if and only if ∑n2n−K(Z ⁣↾n)<∞\sum_n 2^{n - K(Z \uh n)} < \infty.

Proof of Theorem 3.4.

(⇐\Leftarrow) If the sum is at most 2c2^c, each term is, so K(Z ⁣↾n)≥n−cK(Z \uh n) \geq n - c for every nn, and ZZ is random by Theorem 3.1.

(⇒\Rightarrow) For a string τ\tau of length NN, let F(τ)=∑n≤N2n−K(τ ⁣↾n)F(\tau) = \sum_{n \leq N} 2^{n - K(\tau \uh n)}. For each kk, let DND_N be the set of strings τ\tau of length NN with F(τ)>2kF(\tau) > 2^k, and Vk=⋃N[DN]≺\mathcal V_k = \bigcup_N [D_N]^{\prec}. Since KK is approximable from above, F(τ)F(\tau) is the limit of a computable non-decreasing sequence of rationals, so F(τ)>2kF(\tau) > 2^k is a Σ10\Sigma^0_1 property of τ\tau and kk, and (Vk)(\mathcal V_k) is uniformly Σ10\Sigma^0_1.

A string extending an element of DND_N has a larger value of FF, so [DN]≺⊆[DN+1]≺[D_N]^{\prec} \subseteq [D_{N+1}]^{\prec}. We bound the size of DND_N by summing FF over all strings of length NN. Each string ρ\rho of length n≤Nn \leq N is the prefix of 2N−n2^{N - n} strings of length NN, so

2k∣DN∣<∑∣τ∣=NF(τ)=∑n≤N∑∣ρ∣=n2N−n 2n−K(ρ)=2N∑∣ρ∣≤N2−K(ρ)≤2N,2^k |D_N| < \sum_{|\tau| = N} F(\tau) = \sum_{n \leq N} \sum_{|\rho| = n} 2^{N-n}\, 2^{n - K(\rho)} = 2^N \sum_{|\rho| \leq N} 2^{-K(\rho)} \leq 2^N,

when DND_N is non-empty, by Proposition 3.4 of “Prefix-free complexity” (4). Hence λ([DN]≺)≤2−k\lambda([D_N]^{\prec}) \leq 2^{-k} for every NN, and λ(Vk)≤2−k\lambda(\mathcal V_k) \leq 2^{-k} by continuity. So (Vk)(\mathcal V_k) is a Martin-Löf test. If the sum diverges for ZZ, then F(Z ⁣↾N)>2kF(Z \uh N) > 2^k for some NN, for every kk, and ZZ is captured.

The proof is an averaging argument: the average of ∑n2n−K(X ⁣↾n)\sum_n 2^{n - K(X \uh n)} over all sequences XX is ∑ρ2−K(ρ)≤1\sum_\rho 2^{-K(\rho)} \leq 1, and the test collects the sequences on which the sum is large.

Corollary 3.5 (Chaitin).#

A sequence ZZ is Martin-Löf random if and only if lim⁡n(K(Z ⁣↾n)−n)=+∞\lim_n (K(Z \uh n) - n) = +\infty.

Proof of Corollary 3.5.

If ZZ is random, the terms 2n−K(Z ⁣↾n)2^{n - K(Z \uh n)} of a convergent series tend to 00, so K(Z ⁣↾n)−nK(Z \uh n) - n tends to +∞+\infty. Conversely, if the limit is infinite, K(Z ⁣↾n)−nK(Z \uh n) - n is bounded from below, and ZZ is random by Theorem 3.1.

The lemma says more than the corollary. Let AA be the set of n≥1n \geq 1 with K(Z ⁣↾n)<n+log⁡nK(Z \uh n) < n + \log n. Each n∈An \in A contributes more than 1/n1/n to the convergent series, so ∑n∈A1/n<∞\sum_{n \in A} 1/n < \infty: for a random sequence, the excess falls below log⁡n\log n only on a sparse set of lengths.

3.4 Exercises

Exercise 3.6 ★.

Let ZZ be Martin-Löf random and ff a strictly increasing computable function. Show that the sequence Y=Z(f(0)) Z(f(1)) Z(f(2))⋯Y = Z(f(0))\, Z(f(1))\, Z(f(2)) \cdots is random.

Solution

For a string σ\sigma, the class of XX with X(f(i))=σ(i)X(f(i)) = \sigma(i) for i<∣σ∣i < |\sigma| is a clopen class [σ]f[\sigma]_f of measure 2−∣σ∣2^{-|\sigma|}, computable from σ\sigma. If YY is captured by (Un)(\mathcal U_n), write Un=[Wn]≺\mathcal U_n = [W_n]^{\prec} with WnW_n c.e. prefix-free (Lemma 1.2), and let Vn=⋃σ∈Wn[σ]f\mathcal V_n = \bigcup_{\sigma \in W_n} [\sigma]_f. The classes [σ]f[\sigma]_f, σ∈Wn\sigma \in W_n, are pairwise disjoint since the strings are incomparable, so λ(Vn)=λ(Un)≤2−n\lambda(\mathcal V_n) = \lambda(\mathcal U_n) \leq 2^{-n}. The sequence (Vn)(\mathcal V_n) is uniformly Σ10\Sigma^0_1, and it captures ZZ.

Exercise 3.7 ★★.

Let ZZ be Martin-Löf random. Show that for almost every nn, the bits Z(n),…,Z(n+K(n)−1)Z(n), \dots, Z(n + K(n) - 1) are not all 00.

Hint

Use a Solovay test whose nn-th component has measure 2−K(n)2^{-K(n)}.

Solution

Let Sn\mathcal S_n be the class of sequences XX with X(n+i)=0X(n + i) = 0 for every i<K(n)i < K(n). It is the union over ss of the clopen classes defined with Ks(n)K_s(n) instead of K(n)K(n), where KsK_s approximates KK from above; these increase with ss, so (Sn)(\mathcal S_n) is uniformly Σ10\Sigma^0_1. Its measure is 2−K(n)2^{-K(n)}, so ∑nλ(Sn)≤1\sum_n \lambda(\mathcal S_n) \leq 1 by the Kraft inequality. By Theorem 2.9, ZZ belongs to only finitely many Sn\mathcal S_n.

Exercise 3.8 ★★.

Identify a sequence XX with the real 0.X=∑iX(i)2−i−10.X = \sum_i X(i) 2^{-i-1}. Let ZZ be random, and suppose that there is a computable sequence of rationals (rt)(r_t) converging to α=0.Z\alpha = 0.Z with ∑t∣rt+1−rt∣<∞\sum_t |r_{t+1} - r_t| < \infty. Show that α\alpha is left-c.e. or right-c.e.

Solution

For rationals a<ba < b, the class of XX with a<0.X<ba < 0.X < b is a Σ10\Sigma^0_1 class of measure at most b−ab - a, uniformly in aa and bb: it is generated by the strings σ\sigma whose dyadic interval [0.σ,0.σ+2−∣σ∣][0.\sigma, 0.\sigma + 2^{-|\sigma|}] is contained in (a,b)(a, b). Let St\mathcal S_t be this class for the open interval with endpoints rtr_t and rt+1r_{t+1} (empty if they are equal). This is a Solovay test, so there is t0t_0 such that α\alpha lies strictly between rtr_t and rt+1r_{t+1} for no t≥t0t \geq t_0. The real α\alpha is not rational: a sequence XX with 0.X0.X rational is eventually periodic, hence computable, hence not random. So α≠rt\alpha \neq r_t for every tt, and for t≥t0t \geq t_0, rtr_t and rt+1r_{t+1} lie on the same side of α\alpha. All rtr_t, t≥t0t \geq t_0, are then on the same side. If they are below α\alpha, the computable non-decreasing sequence max⁡t0≤u≤tru\max_{t_0 \leq u \leq t} r_u converges to α\alpha, which is left-c.e.; if they are above, α\alpha is right-c.e. by the symmetric argument.

3.5 Notes and references

The characterization of randomness by prefix-free complexity was found independently by Levin (1973), with monotone complexity, and Schnorr (1973), with process complexity; the form with KK, and Corollary 3.5, are due to Chaitin. The ample excess lemma is due to Miller and Yu (2008). A third characterization of randomness, by the failure of c.e. martingales to win unbounded capital, is due to Schnorr (1971); see Downey and Hirschfeldt, Chapter 6. The last exercise is due to Rettinger, as reported by Nies.

  • L. A. Levin, On the notion of a random sequence, Soviet Mathematics Doklady 14 (1973), 1413–1416.
  • C.-P. Schnorr, Process complexity and effective random tests, Journal of Computer and System Sciences 7 (1973), 376–388.
  • G. J. Chaitin, A theory of program size formally identical to information theory, Journal of the ACM 22 (1975), 329–340.
  • J. S. Miller and L. Yu, On initial segment complexity and degrees of randomness, Transactions of the American Mathematical Society 360 (2008), 3193–3210.
  • A. Kučera and T. A. Slaman, Randomness and recursive enumerability, SIAM Journal on Computing 31 (2001), 199–211.