Time-bounded Kolmogorov complexity (K^t) and Levin's Kt #
This module defines the universal multi-tape Turing machine description method
Cslib.Kolmogorov.DescriptionMethod.universalTM for binary strings, the corresponding plain and
time-bounded Kolmogorov complexities Cslib.Kolmogorov.plain (K),
Cslib.Kolmogorov.timeBoundedAt, and Cslib.Kolmogorov.timeBounded (K^t), and Levin's
time-bounded Kolmogorov complexity Cslib.Kolmogorov.levinKt (Kt).
Modeling conventions #
- Clock counts steps of the described machine:
A binary program
p : List Boolis parsed into a multi-tape Turing machine descriptiondecodeDesc (unframe p)(Turing.MultiTapeTM.Universal.decodeDesc) and an input bit stringdropFrame p(Turing.MultiTapeTM.dropFrame). At step boundt,universalTMruns the described machine on(dropFrame p).map eBitfortsteps (Universal.Desc.runFor). In Liu and Pass, Section 2.2, $U(\Pi, 1^t)$ denotes the output of $M(w)$ when emulated for $t$ steps (whose proof of Theorem 5.2 requires counting steps of the described machine $M$, or a constant-overhead universal simulator). Counting the steps of the described multi-tape machine directly inuniversalTMmakes $K^t$ exact at linear time scales while the polynomial overhead of the universal simulatorUniversal.universalappears only in algorithmic membership results such asMINKT ∈ NP. For Levin'sKt(levinKt), charging $\lceil \log_2 s \rceil$ for the step count $s$ of the described multi-tape machine—rather than the step count of the fixed universal simulatorUniversal.universal, whose simulation overhead is polynomial in $s$—means that fixed-machine $\mathrm{Kt}$ differs by a constant factor on the $\log s$ term rather than an $O(1)$ additive term. - Global output:
When the described machine halts within
tsteps, the entire output tape contents are mapped back toList Boolvia(· != 0), matching the global "print $x$" convention of Ko, Liu and Pass, Section 2.2, and Hirahara, as well asTuring.MultiTapeTM.runFor_eq_simulate. - Values in
ℕ∞with finite-form bridges:plain,timeBoundedAt,timeBounded, andlevinKttake values inℕ∞viaDescriptionMethod.ecomplexityandDescriptionMethod.etimeBoundedComplexity, accompanied byℕ-valued wrappers (plainNat,timeBoundedNat,levinKtNat) and proved equivalence bridges (timeBounded_le_natCast_iff,timeBoundedNat_le_iff,timeBoundedNat_eq_sInf,levinKt_le_natCast_iff) showing agreement with the literature'sminoverℕwhenever a witness exists.
Main definitions #
Cslib.Kolmogorov.DescriptionMethod.universalTMRunFor: clocked evaluation of a binary programpfortsteps of the described multi-tape machine.Cslib.Kolmogorov.DescriptionMethod.universalTM: the universal multi-tape description method onList Bool.Cslib.Kolmogorov.plain,Cslib.Kolmogorov.plainNat: plain Kolmogorov complexity $K(x)$ underuniversalTMinℕ∞andℕ.Cslib.Kolmogorov.timeBoundedAt,Cslib.Kolmogorov.timeBounded,Cslib.Kolmogorov.timeBoundedNat: step-indexed and function-indexed time-bounded Kolmogorov complexity $K^t(x)$ inℕ∞andℕ.Cslib.Kolmogorov.copyOverhead: fixed program overhead of the identity machine simulatingliteralinuniversalTM.Cslib.Kolmogorov.levinKt,Cslib.Kolmogorov.levinKtNat: Levin's time-bounded complexity $\mathrm{Kt}(x) = \inf_{s \ge 1} (K^s(x) + \lceil \log_2 s \rceil)$, inℕ∞andℕ.
Main results #
Cslib.Kolmogorov.DescriptionMethod.computableInPolyTime_universalTMRunFor,Cslib.Kolmogorov.DescriptionMethod.computable_universalTMRunFor: polynomial-time and MathlibComputable₂certificates foruniversalTMRunFor.Cslib.Kolmogorov.DescriptionMethod.exists_simulation_ofMultiTapeTM: every finite-state binaryMultiTapeTMis simulated byuniversalTMwith constant program overhead and zero time overhead.Cslib.Kolmogorov.DescriptionMethod.exists_etimeBoundedComplexity_universalTM_le_ofMultiTapeTM,Cslib.Kolmogorov.DescriptionMethod.exists_etimeBoundedComplexity_universalTM_le_ofSingleTapeTM: time-bounded optimality over multi-tape and single-tape Turing machines.Cslib.Kolmogorov.timeBounded_eq_timeBoundedAt:timeBounded t x = timeBoundedAt (t x.length) x.Cslib.Kolmogorov.timeBoundedAt_antitone,Cslib.Kolmogorov.timeBounded_antitone,Cslib.Kolmogorov.timeBounded_anti: monotonicity in the time bound $t$.Cslib.Kolmogorov.timeBoundedAt_le_length_add,Cslib.Kolmogorov.timeBounded_le_length_add,Cslib.Kolmogorov.timeBounded_le,Cslib.Kolmogorov.exists_timeBounded_le: $K^t(x) \le |x| + c$ whenever $t(|x|) \ge |x| + 1$ (Liu and Pass, Fact 2.1 under the multi-tape output convention).Cslib.Kolmogorov.plain_le_timeBoundedAt,Cslib.Kolmogorov.plain_le_timeBounded,Cslib.Kolmogorov.exists_ecomplexity_universal_le_timeBounded,Cslib.Kolmogorov.exists_ecomplexity_universal_le_timeBounded_bits: the direct comparisonplain x ≤ timeBounded t x(universalTM.ecomplexity), and for any computable decoderdec : List Bool → ℕ, the Partrec comparisonDescriptionMethod.universal.ecomplexity (dec x) ≤ timeBounded t x + c.Cslib.Kolmogorov.encard_setOf_timeBounded_lt,Cslib.Kolmogorov.exists_length_eq_forall_le_timeBounded,Cslib.Kolmogorov.exists_length_eq_le_timeBounded,Cslib.Kolmogorov.two_pow_lt_ncard_setOf_length_eq_le_timeBounded_add: counting and incompressibility bounds for $K^t$.Cslib.Kolmogorov.plain_le_levinKt,Cslib.Kolmogorov.levinKt_le_length_add,Cslib.Kolmogorov.levinKt_le_natCast_iff,Cslib.Kolmogorov.levinKtNat_le_iff: lower and upper bounds and witness characterization for Levin'sKt.
References #
- Y. Liu, R. Pass, On One-way Functions and Kolmogorov Complexity
- Y. Liu, R. Pass, On the Possibility of Basing Cryptography on EXP ≠ BPP
- L. A. Levin, Universal Sequential Search Problems
- L. A. Levin, Randomness Conservation Inequalities; Information and Independence in Mathematical Theories
- K.-I. Ko, On the Notion of Infinite Pseudorandom Sequences
- E. Allender, H. Buhrman, M. Koucký, D. van Melkebeek, D. Ronneburger, Power from Random Strings
- S. Hirahara, Non-Black-Box Worst-Case to Average-Case Reductions within NP
- M. Li, P. Vitányi, An Introduction to Kolmogorov Complexity and Its Applications
The universal multi-tape description method (universalTM) #
Clocked evaluation of a binary program p for t steps of the described multi-tape machine:
parses p into the machine description decodeDesc (unframe p) and the input string dropFrame p,
simulates the described machine for t steps, and maps the output symbol numbers to bits via
(· != 0).
Instances For
Membership in universalTMRunFor p t unpacked via the underlying simulate output list.
Membership in universalTMRunFor p t expressed directly as projections of simulate.
Running universalTMRunFor for 0 steps always returns none.
The universal multi-tape Turing machine description method for binary strings
(Liu and Pass, Section 2.2). A binary program p encodes the machine description
decodeDesc (unframe p) and the input string dropFrame p. The clock counts steps of the
described multi-tape machine, and the output is the global output tape contents upon halting.
Instances For
(universalTM.run p).runFor t is universalTMRunFor p t.
At 0 steps, universalTM.etimeBoundedComplexity 0 x = ⊤.
Polynomial-time and partial-recursive evaluation of universalTM #
Evaluating universalTMRunFor on a program and a unary step budget is computable in
polynomial time.
universalTMRunFor is computable in Mathlib's sense (Computable₂).
Mapping any computable decoder dec : List Bool → ℕ over universalTM yields a partial
recursive description method.
Partrec's universal description method universal is at most an additive constant worse than
universalTM under any computable decoder dec : List Bool → ℕ.
Clock-preserving simulation of every binary MultiTapeTM #
Every finite-state binary MultiTapeTM is simulated by universalTM with constant program
overhead and zero time overhead.
Plain Kolmogorov complexity under universalTM is at most an additive constant worse than
under any finite-state binary MultiTapeTM.
Clock-preserving time-bounded optimality of universalTM over MultiTapeTM: for every
finite-state binary MultiTapeTM, universalTM is at most an additive constant worse at the exact
same step count t.
Time-bounded complexity transfer from a single-tape Turing machine SingleTapeTM Bool to
universalTM.
universalTM simulates the literal description method with constant program overhead and
one extra step (t + 1).
Plain and time-bounded Kolmogorov complexity (plain, timeBoundedAt, timeBounded) #
Plain Kolmogorov complexity $K(x)$ of a binary string $x$ under universalTM, in ℕ∞.
Instances For
Plain Kolmogorov complexity $K(x)$ of a binary string $x$ under universalTM, as a natural
number. Since every string has a finite description (plain_ne_top),
(plainNat x : ℕ∞) = plain x (natCast_plainNat).
Instances For
Step-indexed time-bounded Kolmogorov complexity $K^t(x)$ of a binary string $x$ at a concrete
step budget $t : \mathbb{N}$ (Ko; Liu and Pass, Section 2.2): the length
of a shortest binary program that outputs $x$ within $t$ steps of the described multi-tape machine
under universalTM, in ℕ∞.
Instances For
Time-bounded Kolmogorov complexity $K^t(x)$ of a binary string $x$ with respect to the time
bound $t : \mathbb{N} \to \mathbb{N}$ (Ko; Liu and Pass, Section 2.2):
the length of a shortest binary program that outputs $x$ within $t(|x|)$ steps of the described
multi-tape machine, in ℕ∞.
Instances For
timeBounded t x is timeBoundedAt (t x.length) x.
Time-bounded Kolmogorov complexity $K^t(x)$ as a natural number. Whenever a program outputs $x$
within $t(|x|)$ steps (timeBounded t x ≠ ⊤), (timeBoundedNat t x : ℕ∞) = timeBounded t x
(natCast_timeBoundedNat).
Instances For
Equivalence bridges between ℕ∞ and finite (ℕ) formulations #
At 0 steps, timeBoundedAt 0 x = ⊤.
timeBoundedAt t x ≤ k iff some program of length at most k outputs x within t steps.
timeBoundedAt t x < k iff some program of length strictly less than k outputs x within
t steps.
timeBoundedAt t x = ⊤ iff no program outputs x within t steps.
timeBoundedAt t x ≠ ⊤ iff some program outputs x within t steps.
timeBounded t x < k iff some program of length strictly less than k outputs x within
t |x| steps.
timeBounded t x = ⊤ iff no program outputs x within t |x| steps.
timeBounded t x ≠ ⊤ iff some program outputs x within t |x| steps.
Whenever timeBounded t x ≠ ⊤, the natural-number wrapper timeBoundedNat t x casts back to
timeBounded t x.
Whenever timeBounded t x ≠ ⊤, the ℕ-valued inequality timeBoundedNat t x ≤ k is
equivalent to timeBounded t x ≤ k.
Whenever timeBounded t x ≠ ⊤, timeBoundedNat t x is the exact length of a shortest program
outputting x within t |x| steps.
Whenever a witness program exists (timeBounded t x ≠ ⊤), timeBoundedNat t x equals the
ℕ-infimum sInf {p.length | x ∈ (universalTM.run p).runFor (t x.length)}, matching the source
definition $K^t(x) = \min\{|\Pi| : U(\Pi, 1^{t(|x|)}) = x\}$ in
Liu and Pass, Section 2.2.
Basic properties of K^t: monotonicity, upper bound, and relation to plain K #
Antitonicity in the step bound. Giving more steps cannot increase timeBoundedAt t x.
If t₁ ≤ t₂, then timeBoundedAt t₂ x ≤ timeBoundedAt t₁ x.
Antitonicity in the time function. More time cannot increase K^t(x).
The fixed program overhead of the identity machine simulating literal in universalTM.
Instances For
Under universalTM, every string x can be printed by a program of length at most
|x| + copyOverhead within |x| + 1 steps.
Trivial upper bound (Liu and Pass, Fact 2.1 under multi-tape global output): if $t(|x|) \ge |x| + 1$, then $K^t(x) \le |x| + \mathrm{copyOverhead}$.
Trivial upper bound for all inputs (Liu and Pass, Fact 2.1): if $t(n) \ge n + 1$ for all $n$, then $K^t(x) \le |x| + \mathrm{copyOverhead}$ for all $x$.
If x.length + 1 ≤ t x.length, then timeBounded t x ≠ ⊤.
Natural-number upper bound timeBoundedNat t x ≤ x.length + copyOverhead when
x.length + 1 ≤ t x.length.
Relation to plain complexity (K(x) ≤ K^t(x) at step budget t). Dropping the step bound
cannot increase Kolmogorov complexity under universalTM.
Relation to plain complexity (K(x) ≤ K^t(x)). Dropping the time bound cannot increase
Kolmogorov complexity under universalTM.
Trivial upper bound plain x ≤ x.length + copyOverhead for plain complexity.
Whenever timeBounded t x ≠ ⊤, plainNat x ≤ timeBoundedNat t x.
Plain complexity plain x is the infimum of timeBoundedAt t x over all step bounds
t : ℕ.
Relation to Partrec.universal (K_U(dec x) ≤ K^t(x) + O(1)). For any computable decoder
dec : List Bool → ℕ, the plain complexity of dec x under DescriptionMethod.universal
(Partrec.lean) is at most timeBounded t x + c.
Using Nat.bits and List.foldr Nat.bit 0,
universal.ecomplexity n ≤ timeBounded t n.bits + c for all t and n.
Counting and incompressibility facts for K^t #
Existence of $K^t$-incompressible strings. For every $n$ and every time bound $t$, some string $x \in \{0, 1\}^n$ has $K^t(x) \ge n$ (in fact, a single string works for all $t$ simultaneously).
For every time bound t and length n, there exists a string x of length n with
n ≤ timeBounded t x.
Counting nearly $K^t$-incompressible strings. All but fewer than $2^{n - c}$ of the $2^n$ strings of length $n$ satisfy $K^t(x) \ge n - c$.
Levin's time-bounded Kolmogorov complexity (Kt) #
Levin's time-bounded Kolmogorov complexity $\mathrm{Kt}(x)$
(Levin; Levin;
Allender et al.;
Liu and Pass, Section 2.2):
$$\mathrm{Kt}(x) = \inf_{s \in \mathbb{N}} \bigl(K^s(x) + \lceil \log_2 s \rceil\bigr).$$
Because timeBoundedAt 0 x = ⊤ (timeBoundedAt_zero), the $s = 0$ term is $\top$ and the infimum
over $s : \mathbb{N}$ coincides with the infimum over $s \ge 1$.
Here $s$ counts steps of the described multi-tape machine (universalTM); relative to a fixed
universal simulator with polynomial step overhead (Universal.universal), this changes the
$\lceil \log_2 s \rceil$ term by a constant factor rather than an $O(1)$ additive term.
Instances For
Levin's $\mathrm{Kt}(x)$ as a natural number.
Instances For
Restricting the infimum in levinKt to positive step counts $s > 0$ gives the exact same
value, since no program halts in $0$ steps (timeBoundedAt_zero).
For every step count s, levinKt x ≤ timeBoundedAt s x + Nat.clog 2 s.
For every time bound t : ℕ → ℕ, levinKt x ≤ timeBounded t x + Nat.clog 2 (t x.length).
Casting levinKtNat x to ℕ∞ yields levinKt x.
Threshold characterization of levinKt. $\mathrm{Kt}(x) \le k$ iff some program $p$
outputs $x$ within $s$ steps with $|p| + \lceil \log_2 s \rceil \le k$.
ℕ-valued threshold characterization of levinKtNat.