Martin-Löf randomness, the Levin–Schnorr theorem, and Solovay tests #
This module develops the general theory of Martin-Löf randomness on infinite binary sequences
ℕ → Bool under Cslib.BitString.coinFlips, proving the remaining directions of [LV19]
and [SUV17] on top of ChaitinOmega.lean:
- Left-c.e. measure of effectively open cylinder unions: for any computably enumerable set
{w | (e.eval (encode w)).Dom}of binary prefixes,reCoverMass e : ℕ → ℚis uniformly computable, monotone, and converges to(Cslib.BitString.coinFlips (⋃ w ∈ S, prefixCylinderList w)).toReal(tendsto_reCoverMass). - Universal Martin-Löf test and full measure:
universalMartinLofTest : MartinLofTestcaptures everyT : MartinLofTest(exists_subset_universalMartinLofTest), characterizesIsMartinLofRandom(isMartinLofRandom_iff_passes_universalMartinLofTest), and yieldsae_isMartinLofRandom : ∀ᵐ x ∂Cslib.BitString.coinFlips, IsMartinLofRandom x. - Levin–Schnorr theorem [LiVitanyi2019, ShenUspenskyVereshchagin2017]: an infinite binary
sequence
xis Martin-Löf random if and only if its initial segments have prefix-free complexityn ≤ K(x ↾ n) + O(1)(isMartinLofRandom_iff_exists_le_complexity,isMartinLofRandom_iff_exists_le_ecomplexity), invariant across prefix-free optimal decoders (isMartinLofRandom_iff_exists_le_complexity_of_optimal,isMartinLofRandom_iff_exists_le_ecomplexity_of_optimal). - Solovay tests and Borel normality:
SolovayTestandPassesSolovayTestare equivalent to Martin-Löf randomness (passesSolovayTest_iff_isMartinLofRandom); combined with sub-Gaussian Rademacher concentration this yields Borel's strong law of large numbers for every Martin-Löf random sequence (tendsto_freq_true_of_isMartinLofRandom) and for Chaitin'sΩ(tendsto_freq_true_chaitinOmega).
Main definitions #
Cslib.Kolmogorov.reWords: monotone enumeration of the prefixes accepted by a codee.Cslib.Kolmogorov.finitePrefixMass: exactcoinFlips-measure of a finite list of cylinders.Cslib.Kolmogorov.reCoverMass: computable rational lower approximant to the measure of an r.e. union of cylinders.Cslib.Kolmogorov.universalMartinLofTest: a universal Martin-Löf randomness test.Cslib.Kolmogorov.SolovayTest,Cslib.Kolmogorov.PassesSolovayTest: Solovay randomness tests with finite sum of cylinder measures.
Main results #
Cslib.Kolmogorov.toReal_coinFlips_biUnion_list,Cslib.Kolmogorov.finitePrefixMass_nonneg,Cslib.Kolmogorov.finitePrefixMass_le_one: measure characterization and bounds forfinitePrefixMass.Cslib.Kolmogorov.reCoverMass_nonneg,Cslib.Kolmogorov.reCoverMass_le_one,Cslib.Kolmogorov.reCoverMass_le_coinFlips,Cslib.Kolmogorov.tendsto_reCoverMass,Cslib.Kolmogorov.exists_computable_approx_coinFlips_of_rePred: uniform left-c.e. measure of effectively open cylinder sets.Cslib.Kolmogorov.DescriptionMethod.isPartrec_universalPrefixBits: partial recursive evaluator foruniversalPrefixBits.Cslib.Kolmogorov.exists_subset_universalMartinLofTest,Cslib.Kolmogorov.isMartinLofRandom_iff_passes_universalMartinLofTest,Cslib.Kolmogorov.ae_isMartinLofRandom: universality andcoinFlips-almost-everywhere randomness.Cslib.Kolmogorov.le_complexity_of_isMartinLofRandom,Cslib.Kolmogorov.isMartinLofRandom_iff_exists_le_complexity,Cslib.Kolmogorov.isMartinLofRandom_iff_exists_le_ecomplexity,Cslib.Kolmogorov.isMartinLofRandom_iff_exists_le_complexity_of_optimal,Cslib.Kolmogorov.isMartinLofRandom_iff_exists_le_ecomplexity_of_optimal: Levin–Schnorr theorem and its invariance across optimal prefix-free machines.Cslib.Kolmogorov.passesSolovayTest_of_isMartinLofRandom,Cslib.Kolmogorov.isMartinLofRandom_of_forall_passesSolovayTest,Cslib.Kolmogorov.passesSolovayTest_iff_isMartinLofRandom: equivalence of Solovay tests and Martin-Löf randomness.Cslib.Kolmogorov.tendsto_freq_true_of_isMartinLofRandom,Cslib.Kolmogorov.tendsto_freq_true_chaitinOmega: Borel's strong law of large numbers for Martin-Löf random sequences and Chaitin'sΩ.
References #
Left-c.e. measure of effectively open cylinder unions #
The real value of finitePrefixMass L equals the coinFlips-measure of the finite cylinder
union ⋃ w ∈ L, prefixCylinderList w.
Every finite cylinder union mass finitePrefixMass L is nonnegative.
Every finite cylinder union mass finitePrefixMass L is at most 1.
Stage-t distinct prefix list enumerated by partial recursive code e.
Uniformly computable monotone rational lower approximant to the coinFlips-measure of the
effectively open union ⋃ w ∈ {w | (e.eval (encode w)).Dom}, prefixCylinderList w.
Because ℚ has no canonical Mathlib Primcodable instance, uniform computability of the exact
dyadic numerator/denominator pair representing (reCoverMass e t : ℝ) is stated in
exists_computable_approx_coinFlips_of_rePred.
Each rational approximant reCoverMass e t is nonnegative.
Left-c.e. measure of effectively open cylinder sets: uniformly in a code e, the rational
approximants reCoverMass e t converge from below to the coinFlips-measure of
⋃ w ∈ {w | (e.eval (encode w)).Dom}, prefixCylinderList w.
Every approximant reCoverMass e t bounds
(Cslib.BitString.coinFlips (⋃ w ∈ {w | (e.eval (encode w)).Dom}, prefixCylinderList w)).toReal
from below.
Every computably enumerable prefix set S : Set (List Bool) has a computable monotone rational
sequence converging from below to (coinFlips (⋃ w ∈ S, prefixCylinderList w)).toReal.
Capped effective tests and a universal Martin-Löf test #
A universal Martin-Löf randomness test, combining every effective randomness test i : ℕ
with shifted tolerance (m + i + 1) so its level-m union has measure at most 2⁻¹ ^ m.
Universality of universalMartinLofTest: every Martin-Löf test T has a constant index
shift d such that level m + d of T is contained in level m of
universalMartinLofTest.
An infinite sequence x is Martin-Löf random if and only if it passes
universalMartinLofTest.
Full measure of Martin-Löf randomness: coinFlips-almost every infinite binary sequence
is Martin-Löf random.
The Levin–Schnorr theorem #
Levin–Schnorr randomness theorem (converse direction) [LV19],
[SUV17]: every Martin-Löf random infinite bit sequence x has prefix-free
incompressible initial segments n ≤ K(x ↾ n) + c for a uniform constant c.
Levin–Schnorr theorem: an infinite bit sequence x is Martin-Löf random if and only if
every initial segment x ↾ n has prefix-free complexity at least n - c for some constant
c.
Extended-natural (ℕ∞) form of the Levin–Schnorr theorem.
Machine-invariant Levin–Schnorr theorem: for every prefix-free partial recursive description
method U on binary strings that minorizes all prefix-free partial recursive decoders,
IsMartinLofRandom x is equivalent to n ≤ K_U(x ↾ n) + O(1).
Natural-number form of the machine-invariant Levin–Schnorr theorem.
Solovay tests and equivalence with Martin-Löf randomness #
A Solovay randomness test [LiVitanyi2019, ShenUspenskyVereshchagin2017]: a computably enumerable collection of binary prefixes whose cylinder measures have finite sum.
Every Martin-Löf random sequence passes every Solovay test.
Solovay completeness: any sequence x : ℕ → Bool passing every SolovayTest is
Martin-Löf random [LiVitanyi2019, ShenUspenskyVereshchagin2017].
Characterization by Solovay tests [LiVitanyi2019, ShenUspenskyVereshchagin2017]: an
infinite bit sequence x is Martin-Löf random if and only if it passes every SolovayTest.
Borel's strong law of large numbers for Martin-Löf random sequences #
Borel's strong law of large numbers for Martin-Löf randomness
[LiVitanyi2019, ShenUspenskyVereshchagin2017]: every Martin-Löf random infinite binary sequence x
is simply normal in base 2, with asymptotic frequency 1 / 2 of true bits.
Borel normality of Chaitin's Ω: the binary expansion of chaitinOmega universalPrefix
has limiting bit frequency 1 / 2.