Documentation

Complexitylib.Interop.Cslib.Guard.Internal

Correctness and linear cost of regular-domain validation #

The DFA scan and input rewind leave every work tape and the output empty. The execution phase then reproduces the original machine's complete run.

def Complexity.CslibGuard.baseCfg {k : ℕ} {σ Q : Type} (w : List Bool) (q : Option (State σ Q)) (p : Fin (w.length + 2)) :
Turing.Cfg k Bool (State σ Q) w

An otherwise initial configuration at a specified input position and control.

Equations
Instances For
    def Complexity.CslibGuard.scanCfg {k : ℕ} {σ Q : Type} (D : DFA Bool σ) (w : List Bool) (t : ℕ) (ht : t ≤ w.length) :
    Turing.Cfg k Bool (State σ Q) w

    The DFA scan after the first t input bits.

    Equations
    Instances For
      def Complexity.CslibGuard.rewindCfg {k : ℕ} {σ Q : Type} (w : List Bool) (t : ℕ) (ht : t ≤ w.length) :
      Turing.Cfg k Bool (State σ Q) w

      Rewinding with the input head at native position t.

      Equations
      Instances For
        def Complexity.CslibGuard.liftCfg {k : ℕ} {σ Q : Type} {w : List Bool} (c : Turing.Cfg k Bool Q w) :
        Turing.Cfg k Bool (State σ Q) w

        Embed source execution without changing any tape or head.

        Equations
        Instances For
          theorem Complexity.CslibGuard.scan_step {k : ℕ} {σ Q : Type} (M : Turing.MultiTapeTM k Bool Q) (D : DFA Bool σ) (w : List Bool) (t : ℕ) (ht : t < w.length) :
          Turing.MultiTapeTM.step (scanCfg D w t ⋯) = scanCfg D w (t + 1) ⋯
          theorem Complexity.CslibGuard.rewind_step {k : ℕ} {σ Q : Type} (M : Turing.MultiTapeTM k Bool Q) (D : DFA Bool σ) (w : List Bool) (t : ℕ) (ht : t + 1 ≤ w.length) :
          theorem Complexity.CslibGuard.run_rewind {k : ℕ} {σ Q : Type} (M : Turing.MultiTapeTM k Bool Q) (D : DFA Bool σ) (w : List Bool) (t : ℕ) (ht : t ≤ w.length) :