Incompressible strings, and Kolmogorov complexity is not computable
DefinitionPadding a string to a given length#✓fully proved
For a natural number \(n\) and a binary string \(p\), the padding of \(p\) to length \(n\) is the string \(0^k 1 p\) with \(k = \max(n - 1 - |p|, 0)\); when \(|p| < n\) it has length \(n\).
Used by 1
TheoremFew strings have small complexity#✓fully proved
Fewer than 2 ^ m strings have complexity below m.
Padding their shortest descriptions to length m maps them injectively to strings of length m
other than 0ᵐ.
theorem card_lt_two_pow {m : ℕ} (S : Finset (List Bool)) (hS : ∀ x ∈ S, K x < m) :
S.card < 2 ^ m
noncomputable def K (x : List Bool) : ℕ :=
Nat.find (⟨_, (exists_mem_U x).choose, rfl, (exists_mem_U x).choose_spec⟩ :
∃ n, ∃ p : List Bool, p.length = n ∧ x ∈ U p)
CSLibExt/Computability/Kolmogorov/Basic.lean:96
Uses 4 · Used by 2
DefinitionBinary strings of a given length#✓fully proved
For a natural number \(n\), the finite set of all binary strings of length \(n\).
noncomputable def stringsOfLength (n : ℕ) : Finset (List Bool) :=
(Finset.univ : Finset (List.Vector Bool n)).map
⟨List.Vector.toList, List.Vector.toList_injective⟩
Used by 2
TheoremMost strings are incompressible#✓fully proved
For all natural numbers \(n\) and \(c\), fewer than \(2^{n-c}\) binary strings of length \(n\) have Kolmogorov complexity less than \(n - c\), where \(n - c\) is read as \(0\) when \(c > n\).
Hence at least \(2^n - 2^{n-c} + 1\) strings of length \(n\) have complexity at least \(n - c\).
theorem card_compressible_lt (n c : ℕ) :
((stringsOfLength n).filter fun x ↦ K x < n - c).card < 2 ^ (n - c)
noncomputable def stringsOfLength (n : ℕ) : Finset (List Bool) :=
(Finset.univ : Finset (List.Vector Bool n)).map
⟨List.Vector.toList, List.Vector.toList_injective⟩
CSLibExt/Computability/Kolmogorov/Incompressible.lean:104
noncomputable def K (x : List Bool) : ℕ :=
Nat.find (⟨_, (exists_mem_U x).choose, rfl, (exists_mem_U x).choose_spec⟩ :
∃ n, ∃ p : List Bool, p.length = n ∧ x ∈ U p)
CSLibExt/Computability/Kolmogorov/Basic.lean:96
Uses 3
TheoremIncompressible strings exist at every length#✓fully proved
Some string of length n has complexity at
least n.
theorem exists_incompressible (n : ℕ) : ∃ x : List Bool, x.length = n ∧ n ≤ K x
noncomputable def K (x : List Bool) : ℕ :=
Nat.find (⟨_, (exists_mem_U x).choose, rfl, (exists_mem_U x).choose_spec⟩ :
∃ n, ∃ p : List Bool, p.length = n ∧ x ∈ U p)
CSLibExt/Computability/Kolmogorov/Basic.lean:96
Uses 3 · Used by 3
TheoremKolmogorov complexity is not computable#✓fully proved
The function sending each binary string \(x\) to its Kolmogorov complexity \(K(x)\) is not computable: no partial recursive function, acting on binary strings through their encodings as natural numbers, halts on every binary string \(x\) with output \(K(x)\).
The proof is a form of Berry's paradox.
theorem not_computable_K : ¬Computable K
noncomputable def K (x : List Bool) : ℕ :=
Nat.find (⟨_, (exists_mem_U x).choose, rfl, (exists_mem_U x).choose_spec⟩ :
∃ n, ∃ p : List Bool, p.length = n ∧ x ∈ U p)
CSLibExt/Computability/Kolmogorov/Basic.lean:96
Uses 3
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.