Kraft's inequality and the online Kraft–Chaitin theorem #
This file develops the quantitative side of binary prefix-free codes for Kolmogorov complexity:
- Kraft's inequality: specialization of Mathlib's
InformationTheory.IsPrefixFreeKraft theorems (Mathlib/InformationTheory/Coding/Kraft.lean) to binary prefix-free sets andDescriptionMethod.IsPrefixFree, together with tail and incomparable-prefix bounds needed for Chaitin'sΩ. - Executable online Kraft–Chaitin allocator: given any stream of codeword-length requests
reqs : ℕ → Option ℕwhose finite partial Kraft sums∑ i < n, 2⁻¹ ^ ℓ_istay below1,kcTracemaintains a list of prefix-disjoint available dyadic intervals of pairwise distinct lengths (splitAtLen,bestLenLe?,splitFrom), always allocating a codeword of the requested length disjoint from all previous allocations and remaining intervals. - Kraft–Chaitin theorem [LiVitanyi2019, ShenUspenskyVereshchagin2017]: any computable stream
req : ℕ → Option (ℕ × α)with Kraft sum at most1is realized by a computable prefix-freeDescriptionMethod α, givingK_U(y) ≤ ℓ + O(1)for everyU.MinorizesPrefixPartrec.
Main definitions #
Cslib.Kolmogorov.PrefixDisjoint: prefix incomparability of two binary strings.Cslib.Kolmogorov.splitFrom,Cslib.Kolmogorov.bestLenLe?,Cslib.Kolmogorov.splitAtLen,Cslib.Kolmogorov.kcStep,Cslib.Kolmogorov.kcAllocList,Cslib.Kolmogorov.kcTrace,Cslib.Kolmogorov.kcCode: executable online binary Kraft–Chaitin allocator.
Main results #
Cslib.Kolmogorov.DescriptionMethod.IsPrefixFree.finsetSum_two_inv_pow_length_le_one,Cslib.Kolmogorov.DescriptionMethod.IsPrefixFree.summable_two_inv_pow_length,Cslib.Kolmogorov.DescriptionMethod.IsPrefixFree.tsum_two_inv_pow_length_le_one: binary Kraft's inequality for prefix-free description methods.Cslib.Kolmogorov.kcAllocList_eq_some_of_sum_le_one: correctness of the finite executable allocator on any list of lengths with Kraft sum at most1.Cslib.Kolmogorov.DescriptionMethod.kraftChaitin_of_sum_le_one,Cslib.Kolmogorov.DescriptionMethod.kraftChaitin: construction of a prefix-free computable description method realizing any valid computable request stream.Cslib.Kolmogorov.DescriptionMethod.MinorizesPrefixPartrec.kraftChaitin_of_sum_le_one,Cslib.Kolmogorov.DescriptionMethod.MinorizesPrefixPartrec.kraftChaitin:K_U(y) ≤ ℓ + O(1)for any prefix-free minorizing methodU.
References #
Prefix-disjointness and Kraft's inequality #
Two binary words are prefix-disjoint when neither is a prefix of the other.
If u is prefix-disjoint with y and x extends u, then x is prefix-disjoint with y.
Any finite prefix subset T ⊆ S plus any outside element p ∈ S \ T has total weight at most
the full Kraft sum over S.
Kraft's inequality for a finite set of halting programs of a prefix-free method.
Summability of 2⁻¹ ^ |p| over the halting domain of a prefix-free description method.
Kraft's inequality for the halting domain of a prefix-free description method.
Executable online binary Kraft–Chaitin allocator #
List.replicate on Bool is primitive recursive.
One online step of the Kraft–Chaitin allocator is primitive recursive.
Finite executable Kraft–Chaitin correctness: any list of lengths reqs with dyadic Kraft sum
at most 1 is realized by a pairwise prefix-disjoint list of codewords of exact lengths reqs.
Every request reqs i = some ℓ in a stream with partial dyadic Kraft sums at most 1 is
allocated a codeword kcCode reqs i = some w of exact length ℓ.
Distinct steps of kcCode produce prefix-disjoint codewords whenever partial dyadic Kraft
sums stay at most 1.
Joint computability of kcStreamEval across any uniformly computable family of request streams
req : β → ℕ → Option (ℕ × α).
Prefix-freeness of the halting domain of Nat.rfindOpt (kcStreamEval req ·) whenever partial
dyadic Kraft sums stay at most 1.
Kraft–Chaitin theorem (finite-partial-sum form) [LiVitanyi2019,
ShenUspenskyVereshchagin2017]: every computable sequence of requests (ℓ_i, y_i) whose partial
Kraft sums stay at most 1 is realized by a prefix-free partial recursive DescriptionMethod α.
Kraft–Chaitin theorem (tsum form) [LiVitanyi2019, ShenUspenskyVereshchagin2017]: every
computable sequence of requests (ℓ_i, y_i) whose Kraft sum ∑' i, 2⁻¹ ^ ℓ_i is summable and
at most 1 is realized by a prefix-free partial recursive DescriptionMethod α.
Prefix-free minorization form of the Kraft–Chaitin theorem (finite partial sums): any
computable request stream (ℓ_i, y_i) with partial Kraft sums at most 1 gives
K_U(y_i) ≤ ℓ_i + c for a uniform constant c.
Prefix-free minorization form of the Kraft–Chaitin theorem (tsum form).