Documentation

Complexitylib.Models.TuringMachine.Placement.Defs

Work-tape placement #

This file defines a layout combinator that places the work tapes of a machine inside a larger, contiguous middle block. The surrounding physical tapes are idled, so later phases can reserve disjoint tape regions without changing the source machine.

Main definitions #

def Complexity.TM.placeWorkIdx {n : } (pre post : ) (i : Fin n) :
Fin (pre + n + post)

Physical work-tape index occupied by source work tape i after placement.

Equations
Instances For
    def Complexity.TM.placeWorkInMiddle (pre n : ) {post : } (i : Fin (pre + n + post)) :

    A physical work tape lies in the block occupied by the source machine.

    Equations
    Instances For
      @[implicit_reducible]
      instance Complexity.TM.instDecidablePlaceWorkInMiddle (pre n : ) {post : } (i : Fin (pre + n + post)) :
      Equations
      def Complexity.TM.placeWorkCoord (pre n : ) {post : } (i : Fin (pre + n + post)) (h : placeWorkInMiddle pre n i) :
      Fin n

      Source coordinate corresponding to a physical tape in the middle block.

      Equations
      Instances For
        @[simp]
        theorem Complexity.TM.placeWorkIdx_val {n : } (pre post : ) (i : Fin n) :
        (placeWorkIdx pre post i) = pre + i
        @[simp]
        theorem Complexity.TM.placeWorkInMiddle_placeWorkIdx {n : } (pre post : ) (i : Fin n) :
        placeWorkInMiddle pre n (placeWorkIdx pre post i)
        @[simp]
        theorem Complexity.TM.placeWorkCoord_placeWorkIdx {n : } (pre post : ) (i : Fin n) :
        placeWorkCoord pre n (placeWorkIdx pre post i) = i
        theorem Complexity.TM.placeWorkIdx_placeWorkCoord {n pre post : } (i : Fin (pre + n + post)) (h : placeWorkInMiddle pre n i) :
        placeWorkIdx pre post (placeWorkCoord pre n i h) = i
        def Complexity.TM.placeWorkTM {n : } (pre post : ) (tm : TM n) :
        TM (pre + n + post)

        Place tm after pre reserved work tapes and before post reserved work tapes. Physical tapes in the middle block simulate tm; every other work tape writes back the symbol it reads and idles. Input and output actions are unchanged.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Complexity.TM.placeWorkCfg {n : } (tm : TM n) (pre post : ) (extras : Fin (pre + n + post)Tape) (c : Cfg n tm.Q) :
          Cfg (pre + n + post) (placeWorkTM pre post tm).Q

          Embed c into the placed layout. The supplied physical extras frame is used outside the middle block and ignored inside it.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Complexity.TM.placeWorkFrameStep {pre n post : } (extras : Fin (pre + n + post)Tape) :
            Fin (pre + n + post)Tape

            Apply the placement machine's idle work-tape action to an extra-tape frame. Only values outside the middle block are observable through placeWorkCfg.

            Equations
            Instances For
              def Complexity.TM.placeWorkParkedCfg {n : } (tm : TM n) (pre post : ) (c : Cfg n tm.Q) :
              Cfg (pre + n + post) (placeWorkTM pre post tm).Q

              Canonical embedding whose prefix and suffix tapes are parked and blank.

              Equations
              Instances For
                @[simp]
                theorem Complexity.TM.placeWorkCfg_state {n : } (tm : TM n) (pre post : ) (extras : Fin (pre + n + post)Tape) (c : Cfg n tm.Q) :
                (tm.placeWorkCfg pre post extras c).state = c.state
                @[simp]
                theorem Complexity.TM.placeWorkCfg_input {n : } (tm : TM n) (pre post : ) (extras : Fin (pre + n + post)Tape) (c : Cfg n tm.Q) :
                (tm.placeWorkCfg pre post extras c).input = c.input
                @[simp]
                theorem Complexity.TM.placeWorkCfg_output {n : } (tm : TM n) (pre post : ) (extras : Fin (pre + n + post)Tape) (c : Cfg n tm.Q) :
                (tm.placeWorkCfg pre post extras c).output = c.output
                @[simp]
                theorem Complexity.TM.placeWorkCfg_work_middle {n : } (tm : TM n) (pre post : ) (extras : Fin (pre + n + post)Tape) (c : Cfg n tm.Q) (i : Fin n) :
                (tm.placeWorkCfg pre post extras c).work (placeWorkIdx pre post i) = c.work i
                theorem Complexity.TM.placeWorkCfg_work_extra {n : } (tm : TM n) (pre post : ) (extras : Fin (pre + n + post)Tape) (c : Cfg n tm.Q) (i : Fin (pre + n + post)) (h : ¬placeWorkInMiddle pre n i) :
                (tm.placeWorkCfg pre post extras c).work i = extras i
                theorem Complexity.TM.placeWorkCfg_work_prefix {n : } (tm : TM n) (pre post : ) (extras : Fin (pre + n + post)Tape) (c : Cfg n tm.Q) (i : Fin pre) :
                (tm.placeWorkCfg pre post extras c).work i, = extras i,
                theorem Complexity.TM.placeWorkCfg_work_suffix {n : } (tm : TM n) (pre post : ) (extras : Fin (pre + n + post)Tape) (c : Cfg n tm.Q) (i : Fin post) :
                (tm.placeWorkCfg pre post extras c).work pre + n + i, = extras pre + n + i,