Documentation

AIT.PrefixComplexity

Prefix-free Kolmogorov complexity KP is a semimeasure #

Solomonoff/Levin. Extends AIT/KolmogorovComplexity.lean (Computes, codelen, K, K_le, exists_min_code). Formalizes the universal a-priori semimeasure bound ∑ₓ 2⁻ᴷᴾ⁽ˣ⁾ ≤ 1 (Levin's coding theorem / Solomonoff prior), the defining property of a prefix-free Kolmogorov complexity.

Why this is genuine content (not reusable from the existing measures) #

The plain bit-length complexity K_bitlen (AIT/KolmogorovBitlen.lean) carries no Kraft inequality: nothing here bounds ∑ₓ 2⁻ᴷᵇⁱᵗˡᵉⁿ⁽ˣ⁾, and whether it converges is not settled — the classical divergence counts ≈ 2ⁿ strings of complexity n, which needs a data embedding at constant cost that no code here supplies. The semimeasure bound holds only after paying the prefix premium: descriptions must be self-delimiting. We charge that premium with an Elias-γ-class length plen m = 2 · Nat.size (m + 1) on program indices, so that the description set is prefix-free and its Kraft sum is ≤ 1.

What this establishes #

What this does NOT establish (out of scope) #

Hypotheses: standard vs added #

A self-delimiting (Elias-γ-class) bit-length on program indices: twice the number of bits of m + 1. The doubling is the prefix premium that makes the code's Kraft sum ≤ 1.

Equations
Instances For
    noncomputable def PrefixComplexity.KP (x : ℕ) :

    Prefix-free Kolmogorov complexity: the least self-delimiting description length plen over codes that output x from input 0. Well-defined — Code.const x computes x (see Computes).

    Equations
    Instances For

      plen is monotone: more bits in the index ⇒ longer self-delimiting description.

      The least-index complexity K is injective: distinct outputs need distinct least-index programs (a code has a unique output, and Encodable.encode is injective).

      KP factors through the existing least-index K: minimizing a monotone length over the same index set is the length of the minimizing index.

      Kraft inequality for the plen code (the crux): the self-delimiting plen lengths satisfy ∑' m, 2⁻¹ ^ plen m ≤ 1. Each weight is ≤ ((m+2)²)⁻¹ (via Nat.lt_size_self), and the additive telescoping bound 2⁻¹ ^ plen m + (m+2)⁻¹ ≤ (m+1)⁻¹ controls every partial sum.

      Headline: KP is a semimeasure — ∑' x, 2⁻¹ ^ KP x ≤ 1 (Levin's coding theorem / universal a-priori semimeasure). Inject outputs into descriptions via the injective least-index K (tsum_comp_le_tsum_of_injective), then apply the Kraft bound kraft_plen.

      theorem PrefixComplexity.kraft_prior {ι : Type u_1} [Encodable ι] :

      The prior w(R') = 2⁻ᴷᴾ⁽ᵉⁿᶜᵒᵈᵉ ᴿ'⁾ is a semimeasure over any encodable rule class ι: ∑' R' : ι, 2⁻¹ ^ KP (encode R') ≤ 1. Re-index kraft_KP along the injective encode : ι → ℕ (tsum_comp_le_tsum_of_injective).

      Uncomputability of KP (sanity follow-on; not load-bearing for the semimeasure headline) #

      Uncomputability of prefix-free Kolmogorov complexity KP. The same Kleene-fixed_point₂ Berry argument as K_bitlen_not_computable: were KP computable, a self-referential program c₀ would output the least x with plenc c₀ < KP x, forcing KP x ≤ plenc c₀ < KP x.