Documentation

AIT.KolmogorovComplexity

Kolmogorov complexity on Mathlib's universal machine #

Kolmogorov complexity K relative to a fixed universal reference machine, with the invariance-constant caveat. Built directly on Mathlib's Nat.Partrec.Code (the universal partial-recursive machine Code.eval) and Kleene's recursion theorem Nat.Partrec.Code.fixed_point₂.

Status: PROVED. A genuine Kolmogorov complexity with its basic API, unboundedness, and uncomputability — on the least-index measure (see the length-measure note).

Length measure: least-INDEX complexity (read this — the value is NOT the bit-length r) #

We take codelen c := Encodable.encode c, the code's index (Gödel number). So K x here is least-index complexity: the smallest index of a program outputting x. This is a deliberate pragmatic choice — codelen is then trivially Computable, avoiding a Nat.size-computability detour.

The bit-length measure is r = Nat.size (encode c) (number of bits of the index). Relation to this file's measure:

Consequently no later step may read this K x as the bit-length r, which is what a bound in bits refers to. The bit-length refinement Nat.size ∘ encode is the natural companion when K is later reconnected to r (a separate, deferred step).

The qualitative headlines — uncomputability and unboundedness — transfer to the bit-length measure unchanged (the recursion-theorem proof never uses the value of codelen, only that it is computable and that K is unbounded), so they are faithful even though the value is not r.

What this DOES establish #

What this does NOT establish (flagged / other steps) #

Hypotheses: standard vs added #

Program "length": the code's index (Gödel number). This is the least-index measure; the bit-length r is Nat.size (encode c) (same minimizer, exponentially smaller value).

Equations
Instances For
    noncomputable def KolmogorovComplexity.K (x : ℕ) :

    Kolmogorov (least-index) complexity on Mathlib's universal machine Code.eval: the least program length over codes outputting x from input 0. Well-defined — Code.const x computes x, so the minimand is nonempty.

    Equations
    Instances For

      Any program computing x bounds K x.

      K x is achieved by some code.

      The trivial generator bound: the constant program witnesses finiteness/totality of K.

      Only finitely many x have K x ≤ n: finitely many short programs, each outputting at most one value.

      theorem KolmogorovComplexity.K_unbounded (n : ℕ) :
      ∃ (x : ℕ), n < K x

      K is unbounded: incompressible numbers of every complexity exist.

      Uncomputability of Kolmogorov complexity (the headline). Via Kleene's recursion theorem (fixed_point₂): were K computable, a self-referential program c₀ could output the least x with codelen c₀ < K x, forcing K x ≤ codelen c₀ < K x. The recursion theorem supplies c₀ with its own code, so no program-size/encoding bound is needed (sidestepping the quadratic-pairing blowup of encodeCode).