Documentation

Complexitylib.Models.TuringMachine.Subroutines.BinaryLength.Internal

Binary input-length counter — proof internals #

The exact run proof scans the read-only input and lifts one proved binarySuccTM run per symbol. The space proof separately tracks every reachable driver/body phase so input length is never charged as work space.

A blank tape parked immediately to the right of its start marker.

Equations
Instances For

    The immutable input tape for x, with its head at head.

    Equations
    Instances For

      The canonical binary counter tape representing value.

      Equations
      Instances For
        def Complexity.TM.binaryLengthWork {n : } (counterIdx : Fin n) (value : ) :
        Fin nTape

        Work tapes with value on the selected counter tape and blank tapes elsewhere.

        Equations
        Instances For
          def Complexity.TM.binaryLengthDoneCfg {n : } (x : List Bool) (counterIdx : Fin n) :
          Cfg n (binaryLengthTM counterIdx).Q

          Canonical halted configuration produced after measuring x.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Public-theorem internals #

            theorem Complexity.TM.binaryLengthTime_le_internal (length : ) :
            binaryLengthTime length 2 + length * (2 * length.size + 4)
            theorem Complexity.TM.binaryLengthTM_reachesIn_frame_internal {n : } (counterIdx : Fin n) (x : List Bool) :
            ∃ (c' : Cfg n (binaryLengthTM counterIdx).Q), (binaryLengthTM counterIdx).reachesIn (binaryLengthTime x.length) ((binaryLengthTM counterIdx).initCfg x) c' (binaryLengthTM counterIdx).halted c' c'.input.cells = (Tape.init (List.map Γ.ofBool x)).cells c'.input.head = x.length + 1 (c'.work counterIdx).HasBinaryNat x.length (∀ (i : Fin n), i counterIdxc'.work i = (Tape.init []).move Dir3.right) c'.output = (Tape.init []).move Dir3.right
            theorem Complexity.TM.binaryLengthTM_hoareTime_internal {n : } (counterIdx : Fin n) (x : List Bool) :
            (binaryLengthTM counterIdx).HoareTime (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = Tape.init (List.map Γ.ofBool x) (work = fun (x : Fin n) => Tape.init []) out = Tape.init []) (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp.cells = (Tape.init (List.map Γ.ofBool x)).cells inp.head = x.length + 1 (work counterIdx).HasBinaryNat x.length (∀ (i : Fin n), i counterIdxwork i = (Tape.init []).move Dir3.right) out = (Tape.init []).move Dir3.right) (binaryLengthTime x.length)
            theorem Complexity.TM.binaryLengthTM_hoareTimeSpace_internal {n : } (counterIdx : Fin n) (x : List Bool) :
            (binaryLengthTM counterIdx).HoareTimeSpace (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp = Tape.init (List.map Γ.ofBool x) (work = fun (x : Fin n) => Tape.init []) out = Tape.init []) (fun (inp : Tape) (work : Fin nTape) (out : Tape) => inp.cells = (Tape.init (List.map Γ.ofBool x)).cells inp.head = x.length + 1 (work counterIdx).HasBinaryNat x.length (∀ (i : Fin n), i counterIdxwork i = (Tape.init []).move Dir3.right) out = (Tape.init []).move Dir3.right) (binaryLengthTime x.length) x.length (binaryLengthSpace x.length)