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 #
plen: a self-delimiting (Elias-γ-class) bit-length on program indices,2 · Nat.size (m+1).KP: prefix-free Kolmogorov complexity — leastplen-length over codes computingxfrom0.plen_mono,KP_eq : KP x = plen (K x):KPfactors through the existing least-indexK.K_injective: distinct outputs have distinct least-index programs.kraft_plen : ∑' m, 2⁻¹ ^ plen m ≤ 1: the Kraft inequality for theplencode (the crux).kraft_KP : ∑' x, 2⁻¹ ^ KP x ≤ 1: the headline —KPis a semimeasure.kraft_prior : ∑' i : ι, 2⁻¹ ^ KP (Encodable.encode i) ≤ 1: the prior bridge — the priorw(R') ∝ 2⁻ᴷᴾ⁽ᵉⁿᶜᵒᵈᵉ ᴿ'⁾over any encodable rule class is a semimeasure.KP_not_computable:KPis genuinely uncomputable (Berry argument, mirroringK_bitlen_not_computable).
What this does NOT establish (out of scope) #
- Two-machine / prefix-machine additive invariance — out of scope (single fixed
Code.eval; see the documented obstruction inAIT/KolmogorovBitlen.lean). - Does NOT relate
KPto an abstract real-valued description length.
Hypotheses: standard vs added #
- Standard:
∑ₓ 2⁻ᴷᴾ⁽ˣ⁾ ≤ 1for a prefix-free complexityKP. - Added / modeling: one fixed machine (
Code.eval); the Elias-γ-class length2 · Nat.size (·+1)as the concrete self-delimiting code; the input-0("output from nothing") convention inherited fromAIT/KolmogorovComplexity.lean.
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
- PrefixComplexity.plen m = 2 * (m + 1).size
Instances For
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
- PrefixComplexity.KP x = sInf {l : ℕ | ∃ (c : Nat.Partrec.Code), KolmogorovComplexity.Computes c x ∧ PrefixComplexity.plen (Encodable.encode c) = l}
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.
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).