Documentation

Complexity.Computability.Kolmogorov.SingleTape

Description methods of single-tape Turing machines (SingleTapeTM, TM0, TM1) #

A binary single-tape Turing machine tm : SingleTapeTM Bool (or a finitely supported Mathlib TM0.Machine or TM1.Stmt program) defines a description method for binary strings: a program p : List Bool is placed on the tape as BiTape.mk₁ p, the clock counts steps, and once tm reaches none with the tape in standard output form BiTape.mk₁ x, it outputs x (ofSingleTapeTM, ofTM0, ofTM1).

Using Turing.MultiTapeTM.ofSingleTapeTM and Turing.MultiTapeTM.computesInTimeAndSpace_ofSingleTapeTM_of_input, every single-tape description method ofSingleTapeTM tm is simulated by the 1-work-tape multi-tape description method ofMultiTapeTM (MultiTapeTM.ofSingleTapeTM tm) with zero program overhead (compile := id) and linear time overhead 3 * |p| + 2 * t + 6 (singleTapeSimulation).

Furthermore, tm.eval is partial recursive (Cslib.Turing.SingleTapeTM.partrec_eval), so mapping any computable decoder dec : List Bool → ℕ over ofSingleTapeTM tm, ofTM0 M S hs, or ofTM1 M S hs yields a partial recursive description method (isPartrec_ofSingleTapeTM_map, isPartrec_ofTM0_map, isPartrec_ofTM1_map). By the invariance theorem (isAdditivelyOptimal_universal), universal is at most an additive constant worse than any single-tape Turing machine.

Main definitions #

Main results #

References #

The description method of a binary single-tape Turing machine tm : SingleTapeTM Bool: on program p, after t steps, outputs x if tm has halted with BiTape.mk₁ x on its tape.

Instances For

    A program outputs x within t steps under ofSingleTapeTM tm iff tm.OutputsWithinTime p x t.

    @[simp]

    A program describes x under ofSingleTapeTM tm iff tm.Outputs p x.

    Description methods of Mathlib's TM0 and TM1 #

    The description method of a finitely supported Mathlib TM0.Machine (Option Bool) Λ.

    Instances For
      noncomputable def Cslib.Kolmogorov.DescriptionMethod.ofTM1 {Λ σ : Type} [Inhabited Λ] [Inhabited σ] [Fintype σ] (M : Λ → Turing.TM1.Stmt (Option Bool) Λ σ) (S : Finset Λ) (hs : Turing.TM1.Supports M S) :

      The description method of a finitely supported Mathlib TM1 statement table.

      Instances For

        Simulation of ofSingleTapeTM and ofTM0 by ofMultiTapeTM #

        Every single-tape description method ofSingleTapeTM tm is simulated by the 1-work-tape multi-tape description method ofMultiTapeTM (MultiTapeTM.ofSingleTapeTM tm) with zero program overhead (compile := id) and linear time overhead 3 * |p| + 2 * t + 6.

        Instances For

          Time-bounded Kolmogorov complexity transfer from SingleTapeTM to MultiTapeTM: a description of length at most k running in t single-tape steps gives a multi-tape description of length at most k running in 3 * k + 2 * t + 6 steps.

          Every TM0 description method ofTM0 M S hs is simulated by a 1-work-tape MultiTapeTM with zero program overhead and linear time overhead 3 * |p| + 2 * t + 6.

          Instances For

            Partial recursiveness and optimality of universal over SingleTapeTM, TM0, TM1 #

            For every tm : SingleTapeTM Bool and computable decoder dec : List Bool → ℕ, mapping dec over ofSingleTapeTM tm yields a partial recursive description method.

            theorem Cslib.Kolmogorov.DescriptionMethod.isPartrec_ofTM0_map {Λ : Type} [Inhabited Λ] [DecidableEq Λ] (M : Turing.TM0.Machine (Option Bool) Λ) (S : Finset Λ) (hs : Turing.TM0.Supports M ↑S) {dec : List Bool → ℕ} (hdec : Computable dec) :
            (map dec (ofTM0 M S hs)).IsPartrec

            For every finitely supported TM0.Machine (Option Bool) Λ and computable decoder dec : List Bool → ℕ, mapping dec over ofTM0 M S hs yields a partial recursive description method.

            theorem Cslib.Kolmogorov.DescriptionMethod.isPartrec_ofTM1_map {Λ σ : Type} [Inhabited Λ] [Inhabited σ] [Fintype σ] (M : Λ → Turing.TM1.Stmt (Option Bool) Λ σ) (S : Finset Λ) (hs : Turing.TM1.Supports M S) {dec : List Bool → ℕ} (hdec : Computable dec) :
            (map dec (ofTM1 M S hs)).IsPartrec

            For every finitely supported TM1 statement table and computable decoder dec : List Bool → ℕ, mapping dec over ofTM1 M S hs yields a partial recursive description method.

            Optimality of universal over single-tape Turing machines: for every tm : SingleTapeTM Bool and computable decoder dec : List Bool → ℕ, universal is at most an additive constant worse than ofSingleTapeTM tm.

            Using Nat.bits and List.foldr Nat.bit 0, universal is at most an additive constant worse than any tm : SingleTapeTM Bool on binary representations of natural numbers.