Documentation

Complexitylib.Classes.Containments.Internal.CodeStep

What the encoded step does to a reachable configuration #

⚠️ Unreviewed by Bolton

Cobham.stepFn tracks a machine's step only on configurations that respect the encoding's window: every head inside it, every tape carrying its left-end marker. This file collects those side conditions into Complexity.CodeInv, shows that every configuration of a space-bounded machine's configuration graph satisfies it, and reads off what Complexity.nstepFn computes there.

Main definitions #

Main results #

The width of a code #

The number of blocks in a code: one for the state and two per tape.

Equations
Instances For
    @[simp]

    A code is exactly 2(k+2)+1 blocks wide.

    A code is unchanged by the width normalisation.

    The window conditions #

    structure Complexity.CodeInv {k : } {Q : Type} (W : ) (c : Cfg k Q) :

    The side conditions under which the encoded step tracks the real one.

    Instances For
      theorem Complexity.nstepFn_code {k : } (tm : NTM k) (b : Bool) (W : ) (c : Cfg k tm.Q) (hq : Fintype.card tm.Q Cobham.blockWidth W) (hinv : CodeInv W c) (hne : c.state tm.qhalt) :

      The encoded successor is the code of the successor.

      theorem Complexity.nstepFn_code_halted {k : } (tm : NTM k) (b : Bool) (W : ) (c : Cfg k tm.Q) (hq : Fintype.card tm.Q Cobham.blockWidth W) (hinv : CodeInv W c) (hhalt : c.state = tm.qhalt) :

      A halted configuration is a fixed point of the encoded step.

      The graph stays inside the window #

      theorem Complexity.startInvariant_of_reachesCfg {k : } (tm : NTM k) (x : List Bool) {c : Cfg k tm.Q} (h : tm.ReachesCfg (tm.initCfg x) c) :

      Every configuration of the graph carries its left-end markers.

      theorem Complexity.codeInv_of_reachesCfg {k : } (tm : NTM k) {L : Language} {S : } (hdec : tm.DecidesInSpace L S) (x : List Bool) {c : Cfg k tm.Q} (h : tm.ReachesCfg (tm.initCfg x) c) (W : ) (hW : x.length + S x.length + 1 W) :

      The graph stays inside the encoded window.