Documentation

CslibFrontier.Computability.Kolmogorov.LevinCoding

Algorithmic probability and Levin's coding theorem #

For any description method M : DescriptionMethod α, the algorithmic (or a priori) probability of x : α is the probability that a prefix-free program halts with output x:

M.universalProb x = ∑' p : {p : List Bool // M.Produces p x}, (2 : ℝ)⁻¹ ^ p.1.length.

When M is prefix-free (M.IsPrefixFree), the fibers {p // M.Produces p x} partition M.haltingSet, so ∑' x, M.universalProb x = M.chaitinOmega ≤ 1 (IsPrefixFree.tsum_universalProb_eq_chaitinOmega).

A nonnegative summable function μ : α → ℝ with ∑' x, μ x ≤ 1 is lower semicomputable (IsLowerSemicomputable μ) when its strict nonnegative rational lower graph {(x, a, b) | (a : ℝ) / (b + 1) < μ x} (a, b : ℕ) is recursively enumerable (REPred).

Using the online Kraft–Chaitin theorem (CslibFrontier.Computability.Kolmogorov.KraftChaitin), every lower-semicomputable discrete semimeasure satisfies K(x) ≤ -log₂ μ(x) + O(1) (exists_le_two_pow_mul_universalPrefix_of_isLowerSemicomputable, exists_complexity_universalPrefix_le_neg_logb_of_isLowerSemicomputable). Since universalProb is lower semicomputable for every prefix-free partial recursive machine (universalPrefix, universalPrefixBits, and also the marginal semimeasure fun x => ∑' y, m (Nat.pair x y)), this yields Levin's coding theorem [LiVitanyi2019, ShenUspenskyVereshchagin2017]:

2⁻¹ ^ K(x) ≤ m(x) ≤ 2 ^ c * 2⁻¹ ^ K(x) and |K(x) + log₂ m(x)| ≤ c,

and universality of universalPrefix.universalProb and universalPrefixBits.universalProb among all lower-semicomputable discrete semimeasures.

Main definitions #

Main results #

References #

Algorithmic probability #

noncomputable def Cslib.Kolmogorov.DescriptionMethod.universalProb {α : Type u_1} (M : DescriptionMethod α) (x : α) :

Algorithmic (a priori) probability m_M(x) = ∑' {p // M.Produces p x}, 2⁻¹ ^ |p| [LV19].

The total algorithmic probability across all outputs equals Chaitin's halting probability Ω.

Summability of y ↦ M.universalProb (Nat.pair x y) for a prefix-free method M on ℕ.

Summability of the first-coordinate marginal x ↦ ∑' y, M.universalProb (Nat.pair x y) for a prefix-free method M on ℕ.

The iterated pair sum ∑' x, ∑' y, M.universalProb (Nat.pair x y) of a prefix-free method on ℕ is at most 1.

Shortest-program lower bound: 2⁻¹ ^ K_M(x) ≤ M.universalProb x for every prefix-free method whenever M.ecomplexity x ≠ ⊤.

Lower-semicomputable discrete semimeasures #

A nonnegative function μ : α → ℝ is lower semicomputable when its strict nonnegative rational lower graph {(x, a, b) | (a : ℝ) / (b + 1) < μ x} (a, b : ℕ, testing ℚ≥0) is recursively enumerable (REPred). For nonnegative μ, every negative rational is trivially below μ x, so restricting numerators to a : ℕ characterizes lower semicomputability on ℝ≥0-valued functions.

theorem Cslib.Kolmogorov.isLowerSemicomputable_of_computable_monotone_tendsto {α : Type u_1} [Primcodable α] {μ : α → ℝ} {num den : α → ℕ → ℕ} (hnum : Computable₂ num) (hden : Computable₂ den) (hpos : ∀ (x : α) (t : ℕ), 0 < den x t) (hmono : ∀ (x : α), Monotone fun (t : ℕ) => ↑(num x t) / ↑(den x t)) (htend : ∀ (x : α), Filter.Tendsto (fun (t : ℕ) => ↑(num x t) / ↑(den x t)) Filter.atTop (nhds (μ x))) :

A function approximated monotonically from below by computable integer fractions num x t / den x t is lower semicomputable.

Enumerating algorithmic probability of a prefix-free code #

Maximum length among a finite list of binary codewords.

Integer-scaled dyadic Kraft sum ∑ w ∈ L, 2 ^ (codeMaxLen L - |w|).

Casting codeScaledSum L to ℝ equals the dyadic Kraft sum of L scaled by 2 ^ codeMaxLen L.

theorem Cslib.Kolmogorov.isLowerSemicomputable_universalProb_of_partrec_eval {α : Type u_1} [Primcodable α] {M : DescriptionMethod α} (hM : M.IsPrefixFree) {eval : List Bool →. α} (heval : Partrec eval) (hprod : ∀ (p : List Bool) (x : α), M.Produces p x ↔ x ∈ eval p) :

Algorithmic probability M.universalProb is lower semicomputable for every prefix-free description method with a partial recursive evaluator.

theorem Cslib.Kolmogorov.summable_universalPrefix_produces_pair (x : ℕ) :
Summable fun (x_1 : (y : ℕ) × { p : List Bool // DescriptionMethod.universalPrefix.Produces p (Nat.pair x y) }) => match x_1 with | ⟨fst, ⟨p, property⟩⟩ => 2⁻¹ ^ p.length

Joint summability of 2⁻¹ ^ |p| over pairs (y, p) where universalPrefix produces Nat.pair x y.

The marginal semimeasure x ↦ ∑' y, universalPrefix.universalProb (Nat.pair x y) is lower semicomputable.

Levin's coding theorem #

theorem Cslib.Kolmogorov.exists_le_complexity_of_isLowerSemicomputable {α : Type u_1} [Primcodable α] {μ : α → ℝ} (hnonneg : ∀ (x : α), 0 ≤ μ x) (hsummable : Summable μ) (hle : ∑' (x : α), μ x ≤ 1) (hμ : IsLowerSemicomputable μ) {U : DescriptionMethod α} (hU : U.MinorizesPrefixPartrec) :
∃ (c : ℕ), ∀ (x : α) (k : ℕ), 2⁻¹ ^ (k + 1) < μ x → U.ecomplexity x ≤ ↑k + ↑c

Core Levin coding lemma: any lower-semicomputable discrete semimeasure μ on α gives K_U(x) ≤ k + c whenever 2⁻¹ ^ (k + 1) < μ x.

theorem Cslib.Kolmogorov.DescriptionMethod.MinorizesPrefixPartrec.exists_le_two_pow_mul_complexity_of_isLowerSemicomputable {α : Type u_1} [Primcodable α] {U : DescriptionMethod α} (hU : U.MinorizesPrefixPartrec) {μ : α → ℝ} (hnonneg : ∀ (x : α), 0 ≤ μ x) (hsummable : Summable μ) (hle : ∑' (x : α), μ x ≤ 1) (hμ : IsLowerSemicomputable μ) :
∃ (c : ℕ), ∀ (x : α), 0 < μ x → U.ecomplexity x ≠ ⊤ ∧ μ x ≤ 2 ^ c * 2⁻¹ ^ U.complexity x

General coding bound for any prefix-free minorizing description method U: μ x ≤ 2 ^ c * 2⁻¹ ^ K_U(x) whenever 0 < μ x.

theorem Cslib.Kolmogorov.exists_le_two_pow_mul_universalPrefix_of_isLowerSemicomputable {μ : ℕ → ℝ} (hnonneg : ∀ (x : ℕ), 0 ≤ μ x) (hsummable : Summable μ) (hle : ∑' (x : ℕ), μ x ≤ 1) (hμ : IsLowerSemicomputable μ) :
∃ (c : ℕ), ∀ (x : ℕ), μ x ≤ 2 ^ c * 2⁻¹ ^ DescriptionMethod.universalPrefix.complexity x

For every lower-semicomputable discrete semimeasure μ : ℕ → ℝ, μ x ≤ 2 ^ c * 2⁻¹ ^ K(x).

theorem Cslib.Kolmogorov.exists_le_two_pow_mul_universalPrefixBits_of_isLowerSemicomputable {μ : List Bool → ℝ} (hnonneg : ∀ (x : List Bool), 0 ≤ μ x) (hsummable : Summable μ) (hle : ∑' (x : List Bool), μ x ≤ 1) (hμ : IsLowerSemicomputable μ) :

For every lower-semicomputable discrete semimeasure μ : List Bool → ℝ, μ x ≤ 2 ^ c * 2⁻¹ ^ K(x).

theorem Cslib.Kolmogorov.exists_complexity_universalPrefix_le_neg_logb_of_isLowerSemicomputable {μ : ℕ → ℝ} (hnonneg : ∀ (x : ℕ), 0 ≤ μ x) (hsummable : Summable μ) (hle : ∑' (x : ℕ), μ x ≤ 1) (hμ : IsLowerSemicomputable μ) :
∃ (c : ℕ), ∀ (x : ℕ), 0 < μ x → ↑(DescriptionMethod.universalPrefix.complexity x) ≤ -Real.logb 2 (μ x) + ↑c

Logarithmic coding bound: K(x) ≤ -log₂ μ(x) + c whenever 0 < μ x.

theorem Cslib.Kolmogorov.exists_complexity_universalPrefixBits_le_neg_logb_of_isLowerSemicomputable {μ : List Bool → ℝ} (hnonneg : ∀ (x : List Bool), 0 ≤ μ x) (hsummable : Summable μ) (hle : ∑' (x : List Bool), μ x ≤ 1) (hμ : IsLowerSemicomputable μ) :
∃ (c : ℕ), ∀ (x : List Bool), 0 < μ x → ↑(DescriptionMethod.universalPrefixBits.complexity x) ≤ -Real.logb 2 (μ x) + ↑c

Binary-string logarithmic coding bound: K(x) ≤ -log₂ μ(x) + c whenever 0 < μ x.

Levin's coding theorem for universalPrefix [LiVitanyi2019, ShenUspenskyVereshchagin2017]: algorithmic probability m(x) equals 2⁻¹ ^ K(x) up to a multiplicative constant.

Levin's coding theorem for binary strings (logarithmic form): |K(x) + log₂ m(x)| ≤ c.

theorem Cslib.Kolmogorov.exists_mul_universalProb_universalPrefix_ge {μ : ℕ → ℝ} (hnonneg : ∀ (x : ℕ), 0 ≤ μ x) (hsummable : Summable μ) (hle : ∑' (x : ℕ), μ x ≤ 1) (hμ : IsLowerSemicomputable μ) :
∃ (c : ℕ), ∀ (x : ℕ), μ x ≤ 2 ^ c * DescriptionMethod.universalPrefix.universalProb x

Universality of the Solomonoff–Levin prior on ℕ: universalPrefix.universalProb multiplicatively dominates every lower-semicomputable discrete semimeasure.

theorem Cslib.Kolmogorov.exists_mul_universalProb_universalPrefixBits_ge {μ : List Bool → ℝ} (hnonneg : ∀ (x : List Bool), 0 ≤ μ x) (hsummable : Summable μ) (hle : ∑' (x : List Bool), μ x ≤ 1) (hμ : IsLowerSemicomputable μ) :

Universality of the Solomonoff–Levin prior on binary strings List Bool.