Documentation

CslibFrontier.Computability.Machines.AuxPDA.BoundedSurface

Bounded-space surface enumeration and decidable surface transitions #

A bounded-space surface configuration (Turing.AuxPDA.BoundedSurfaceCfg) restricts the work-tape cells and head positions of a Turing.AuxPDA.SurfaceCfg to the symmetric window [-s, s] (Turing.window s). This produces a concrete finite type with:

This is original formalization infrastructure for Work Package 4 of cslib-frontier #7920, supplying the finite surface-configuration indexing consumed by the balanced-depth semi-unbounded circuit compiler.

Main definitions #

Main results #

Bounded-space surface configurations #

structure Turing.AuxPDA.BoundedSurfaceCfg (k : ℕ) (StackSym : Type u_1) (State : Type u_2) (input : List Bool) (s : ℕ) :
Type (max u_1 u_2)

A surface configuration of a binary k-tape AuxPDA on input whose work-tape heads and non-blank cells are restricted to Turing.window s = [-s, s].

  • inputPos : Fin (input.length + 2)

    Input head position (shifted by one, matching SurfaceCfg.inputPos).

  • state : Option State

    Control state (none when halted).

  • workTapes : Fin k → ↥(window s) → Option Bool

    Work-tape contents on the bounded window [-s, s].

  • workTapePos : Fin k → ↥(window s)

    Work-tape head positions within [-s, s].

  • topSym : Option StackSym

    Top symbol of the pushdown stack, or none when empty.

  • outputSummary : OutputSummary

    Three-value acceptance summary of the write-only binary output tape.

Instances For
    theorem Turing.AuxPDA.BoundedSurfaceCfg.ext {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} {x y : BoundedSurfaceCfg k StackSym State input s} (inputPos : x.inputPos = y.inputPos) (state : x.state = y.state) (workTapes : x.workTapes = y.workTapes) (workTapePos : x.workTapePos = y.workTapePos) (topSym : x.topSym = y.topSym) (outputSummary : x.outputSummary = y.outputSummary) :
    x = y
    theorem Turing.AuxPDA.BoundedSurfaceCfg.ext_iff {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} {x y : BoundedSurfaceCfg k StackSym State input s} :
    @[instance_reducible]
    instance Turing.AuxPDA.BoundedSurfaceCfg.instDecidableEq {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} [DecidableEq StackSym] [DecidableEq State] :
    DecidableEq (BoundedSurfaceCfg k StackSym State input s)
    def Turing.AuxPDA.BoundedSurfaceCfg.toSurface {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) :
    SurfaceCfg k StackSym State input

    Embed a bounded-space surface configuration into SurfaceCfg, padding cells outside Turing.window s with blanks (none).

    theorem Turing.AuxPDA.BoundedSurfaceCfg.toSurface_fitsIn {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) :
    b.toSurface.storage.FitsIn fun (x : Fin k) => s

    Every embedded bounded surface configuration fits in the uniform window fun _ => s.

    theorem Turing.AuxPDA.BoundedSurfaceCfg.toSurface_injective {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} :

    Embedding into SurfaceCfg is injective.

    def Turing.AuxPDA.BoundedSurfaceCfg.ofSurface {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (sc : SurfaceCfg k StackSym State input) (h : sc.storage.FitsIn fun (x : Fin k) => s) :
    BoundedSurfaceCfg k StackSym State input s

    Restrict a surface configuration fitting in fun _ => s to BoundedSurfaceCfg.

    @[simp]
    theorem Turing.AuxPDA.BoundedSurfaceCfg.toSurface_ofSurface {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (sc : SurfaceCfg k StackSym State input) (h : sc.storage.FitsIn fun (x : Fin k) => s) :
    @[simp]
    theorem Turing.AuxPDA.BoundedSurfaceCfg.ofSurface_toSurface {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) :
    def Turing.AuxPDA.BoundedSurfaceCfg.inputSymbol {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) :

    The input symbol under the head of a bounded surface configuration.

    def Turing.AuxPDA.BoundedSurfaceCfg.workTapeSymbols {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) (i : Fin k) :

    The work-tape symbols under the heads of a bounded surface configuration.

    theorem Turing.AuxPDA.BoundedSurfaceCfg.workTapeSymbols_eq_toSurface {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) :
    @[reducible, inline]
    abbrev Turing.AuxPDA.BoundedSurfaceCfg.IsAccepting {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) :

    A bounded surface configuration is accepting when halted with output summary .accept.

    @[reducible, inline]
    abbrev Turing.AuxPDA.BoundedSurfaceCfg.IsAcceptingEmpty {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) :

    An accepting bounded surface configuration with an empty stack (topSym = none).

    def Turing.AuxPDA.initBoundedSurface {k : ℕ} {StackSym : Type u_1} {State : Type u_2} (M : AuxPDA k Bool StackSym State) (input : List Bool) (s : ℕ) :
    BoundedSurfaceCfg k StackSym State input s

    The initial bounded surface configuration of M on input within window [-s, s].

    @[simp]
    theorem Turing.AuxPDA.toSurface_initBoundedSurface {k : ℕ} {StackSym : Type u_1} {State : Type u_2} (M : AuxPDA k Bool StackSym State) (input : List Bool) (s : ℕ) :

    Computable mixed-radix Fin indexing and polynomial cardinality bounds #

    def Turing.AuxPDA.optionEquivFin {α : Type u_1} {m : ℕ} (e : α ≃ Fin m) :
    Option α ≃ Fin (m + 1)

    Encode a surface state or stack top, with zero for absence and positive codes for values.

    def Turing.AuxPDA.boundedSurfaceCard (mStack mState k n s : ℕ) :

    Exact cardinality of BoundedSurfaceCfg k StackSym State input s when |StackSym| = mStack and |State| = mState.

    def Turing.AuxPDA.boundedSurfaceEquivFin {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) (input : List Bool) (s : ℕ) :
    BoundedSurfaceCfg k StackSym State input s ≃ Fin (boundedSurfaceCard mStack mState k input.length s)

    Computable mixed-radix bijection indexing every bounded-space surface configuration by Fin (boundedSurfaceCard mStack mState k input.length s).

    def Turing.AuxPDA.boundedSurfaceStartIndex (mStack mState k s stateCode : ℕ) :

    Pack the initial input head, initial state, centered work heads and blank contents. The parameter stateCode includes the positive offset of the running state.

    theorem Turing.AuxPDA.boundedSurfaceStartIndex_eq {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} (M : AuxPDA k Bool StackSym State) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) (input : List Bool) (s : ℕ) :
    boundedSurfaceStartIndex mStack mState k s ↑((optionEquivFin eState) (some M.q₀)) = ↑((boundedSurfaceEquivFin eStack eState input s) (M.initBoundedSurface input s))

    The numeric initial surface is the index assigned by the bounded surface equivalence.

    Numeric fields of a bounded surface index, before unpacking the work tapes.

    • inputPos : ℕ

      Read-only input head position.

    • state : ℕ

      Optional state code. Zero denotes a halted state.

    • workPositions : ℕ

      Packed positions of the work-tape heads.

    • workContents : ℕ

      Packed ternary work-tape contents.

    • top : ℕ

      Optional top-symbol code. Zero denotes an empty stack.

    • output : ℕ

      Encoded output summary.

    Extract the numeric fields of a bounded surface index by repeated division and remainder.

    def Turing.AuxPDA.BoundedSurfaceCfg.digits {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) :

    Encode the fields separately using the same radices as the surface index.

    theorem Turing.AuxPDA.BoundedSurfaceCfg.digits_readInput {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (u : BoundedSurfaceCfg k StackSym State input s) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) :
    inputAt input (u.digits eStack eState).inputPos = u.inputSymbol

    The numeric input position reads exactly the bounded surface's input symbol.

    Decode the head position as an offset from the left boundary of the window.

    def Turing.AuxPDA.boundedWorkTapeWord (k s tape contents : ℕ) :

    Extract one packed work tape from the contents of all the work tapes.

    Read the ternary symbol at a work head. The codes are 0 for blank, 1 for false, and 2 for true.

    Replace the symbol under the selected work head and return that tape's ternary word.

    theorem Turing.AuxPDA.BoundedSurfaceCfg.digits_workHead {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) (i : Fin k) :
    (b.digits eStack eState).workHead k s ↑i = (↑(b.workTapePos i) + ↑s).toNat

    The numeric head query recovers the encoded head at the selected tape.

    theorem Turing.AuxPDA.BoundedSurfaceCfg.digits_workSymbol {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) (i : Fin k) :

    The numeric symbol query gives the code of the symbol under the selected head.

    Move a work head in the offset coordinates of its window. A move past the window fails.

    Test the destination head and contents of a single work tape after a fixed action.

    theorem Turing.AuxPDA.BoundedSurfaceCfg.digits_matchesWorkTape {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b c : BoundedSurfaceCfg k StackSym State input s) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) (i : Fin k) (write : Option (Option Bool)) (step : SignType) :
    (b.digits eStack eState).matchesWorkTape (c.digits eStack eState) k s (↑i) write step = true ↔ ↑(c.workTapePos i) = ↑(b.workTapePos i) + ↑step ∧ c.workTapes i = match (motive := Option (Option Bool) → ↥(window s) → Option Bool) write with | none => b.workTapes i | some value => Function.update (b.workTapes i) (b.workTapePos i) value

    The numeric tape-action check agrees with the original work-tape fields.

    Test the work-tape part of a fixed action against the destination's numeric fields.

    theorem Turing.AuxPDA.BoundedSurfaceCfg.digits_matchesWorkTapes {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b c : BoundedSurfaceCfg k StackSym State input s) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) (action : Fin k → Option (Option Bool) × SignType) :
    (b.digits eStack eState).matchesWorkTapes (c.digits eStack eState) s action = true ↔ ∀ (i : Fin k), ↑(c.workTapePos i) = ↑(b.workTapePos i) + ↑(action i).2 ∧ c.workTapes i = match (motive := Option (Option Bool) → ↥(window s) → Option Bool) (action i).1 with | none => b.workTapes i | some value => Function.update (b.workTapes i) (b.workTapePos i) value

    The test checks each head move and each tape write in the fixed action.

    theorem Turing.AuxPDA.boundedSurfaceDigits_equivFin {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) :
    boundedSurfaceDigits mStack mState k s ↑((boundedSurfaceEquivFin eStack eState input s) b) = b.digits eStack eState

    Digit extraction agrees with the existing mixed-radix numbering.

    Empty-stack acceptance is a test of three numeric fields.

    theorem Turing.AuxPDA.BoundedSurfaceCfg.digits_state_eq_zero {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (u : BoundedSurfaceCfg k StackSym State input s) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) :
    (u.digits eStack eState).state = 0 ↔ u.state = none

    A surface's state code is zero exactly when the machine has halted.

    theorem Turing.AuxPDA.BoundedSurfaceCfg.digits_acceptsEmpty {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) :

    Testing the state, stack and output fields agrees with bounded surface acceptance.

    theorem Turing.AuxPDA.boundedSurfaceDigits_acceptsEmpty_iff {k mStack mState : ℕ} {StackSym : Type u_1} {State : Type u_2} (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) (input : List Bool) (s : ℕ) (index : Fin (boundedSurfaceCard mStack mState k input.length s)) :
    (boundedSurfaceDigits mStack mState k s ↑index).acceptsEmpty = true ↔ ((boundedSurfaceEquivFin eStack eState input s).symm index).IsAcceptingEmpty

    Testing the numeric fields of a valid index recognizes accepting empty-stack surfaces.

    @[instance_reducible]
    noncomputable instance Turing.AuxPDA.instFintypeBoundedSurfaceCfg {k : ℕ} {StackSym : Type u_1} {State : Type u_2} [Fintype StackSym] [Fintype State] {input : List Bool} {s : ℕ} :
    Fintype (BoundedSurfaceCfg k StackSym State input s)
    theorem Turing.AuxPDA.card_boundedSurfaceCfg {k : ℕ} {StackSym : Type u_1} {State : Type u_2} [Fintype StackSym] [Fintype State] (input : List Bool) (s : ℕ) :
    Fintype.card (BoundedSurfaceCfg k StackSym State input s) = boundedSurfaceCard (Fintype.card StackSym) (Fintype.card State) k input.length s
    theorem Turing.AuxPDA.input_length_add_two_le_boundedSurfaceCard (mStack mState k n s : ℕ) :
    n + 2 ≤ boundedSurfaceCard mStack mState k n s

    The bounded surface-configuration count is always at least n + 2 (from the input head).

    theorem Turing.AuxPDA.boundedSurfaceCard_le_surfaceCfgBound {StackSym : Type u_1} {State : Type u_2} [Fintype StackSym] [Fintype State] (k n s : ℕ) :
    boundedSurfaceCard (Fintype.card StackSym) (Fintype.card State) k n s ≤ surfaceCfgBound StackSym State k n (k * s)

    The bounded surface-configuration cardinality is at most surfaceCfgBound … (k * s).

    theorem Turing.AuxPDA.boundedSurfaceCard_log_polynomiallyBounded (mStack mState k c : ℕ) :
    Cslib.PolynomiallyBounded fun (n : ℕ) => boundedSurfaceCard mStack mState k n (c * (n.log2 + 1))

    Polynomial bounded-surface cardinality in logarithmic space: for s(n) = c * (log₂ n + 1), boundedSurfaceCard is polynomially bounded in n.

    Window-checked tape updates and decidable bounded surface transitions #

    def Turing.AuxPDA.applyBoundedTapes? {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (act : Turing.Action k Bool State) (b : BoundedSurfaceCfg k StackSym State input s) (newTop : Option StackSym) :
    Option (BoundedSurfaceCfg k StackSym State input s)

    Apply a Turing.Action to a bounded surface configuration, returning none if any work-tape head steps outside Turing.window s.

    def Turing.AuxPDA.BoundedSurfaceDigits.matchesObservation {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {mStack mState : ℕ} (d : BoundedSurfaceDigits) (s : ℕ) (state : State) (top : Option StackSym) (work : Fin k → Option Bool) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) :

    Check the control state, stack top and work symbols required by a fixed transition.

    theorem Turing.AuxPDA.BoundedSurfaceCfg.digits_matchesObservation {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s mStack mState : ℕ} (b : BoundedSurfaceCfg k StackSym State input s) (state : State) (top : Option StackSym) (work : Fin k → Option Bool) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) :
    (b.digits eStack eState).matchesObservation s state top work eStack eState = true ↔ b.state = some state ∧ b.topSym = top ∧ b.workTapeSymbols = work

    The observation test compares exactly the source fields read by a transition.

    def Turing.AuxPDA.BoundedSurfaceDigits.matchesTapeAction {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {mStack mState : ℕ} (before after : BoundedSurfaceDigits) (n s : ℕ) (act : Turing.Action k Bool State) (newTop : Option StackSym) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) :

    Test a fixed tape action, including the destination's scalar fields and all work tapes.

    theorem Turing.AuxPDA.BoundedSurfaceCfg.digits_matchesTapeAction {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s mStack mState : ℕ} (act : Turing.Action k Bool State) (b c : BoundedSurfaceCfg k StackSym State input s) (newTop : Option StackSym) (eStack : StackSym ≃ Fin mStack) (eState : State ≃ Fin mState) :
    (b.digits eStack eState).matchesTapeAction (c.digits eStack eState) input.length s act newTop eStack eState = true ↔ applyBoundedTapes? act b newTop = some c

    The complete numeric test is exact for the window-checked bounded tape action.

    theorem Turing.AuxPDA.applyBoundedTapes?_eq_some_iff {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (act : Turing.Action k Bool State) (b c : BoundedSurfaceCfg k StackSym State input s) (newTop : Option StackSym) :

    Window-checked bounded application agrees identically with applySurfaceTapes on embedded surface configurations.

    def Turing.AuxPDA.BoundedStayStep {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (M : AuxPDA k Bool StackSym State) (u v : BoundedSurfaceCfg k StackSym State input s) :

    Bounded-space height-preserving surface transition (StayStep on embedded surfaces).

    Instances For
      def Turing.AuxPDA.BoundedPushStep {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (M : AuxPDA k Bool StackSym State) (u : BoundedSurfaceCfg k StackSym State input s) (γ : StackSym) (v : BoundedSurfaceCfg k StackSym State input s) :

      Bounded-space push transition (PushStep on embedded surfaces).

      Instances For
        def Turing.AuxPDA.BoundedPopStep {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (M : AuxPDA k Bool StackSym State) (u : BoundedSurfaceCfg k StackSym State input s) (γ : StackSym) (baseTop : Option StackSym) (v : BoundedSurfaceCfg k StackSym State input s) :

        Bounded-space pop transition (PopStep on embedded surfaces).

        Instances For
          def Turing.AuxPDA.BoundedPushPopStep {k : ℕ} {StackSym : Type u_1} {State : Type u_2} {input : List Bool} {s : ℕ} (M : AuxPDA k Bool StackSym State) (u u' v' v : BoundedSurfaceCfg k StackSym State input s) :

          Bounded-space matched push-pop pair wrapping (u', v') into (u, v).

          Instances For

            Computable finiteness of actions and decidability of bounded surface steps #

            @[instance_reducible]
            instance Turing.AuxPDA.instFintypeStackOp {StackSym : Type} [Fintype StackSym] :
            Fintype (StackOp StackSym)
            @[instance_reducible]
            instance Turing.AuxPDA.instFintypeTuringAction {k : ℕ} {State : Type} [Fintype State] :
            @[instance_reducible]
            instance Turing.AuxPDA.instFintypeAuxPDAAction {k : ℕ} {StackSym State : Type} [Fintype StackSym] [Fintype State] :
            Fintype (Action k Bool StackSym State)
            @[instance_reducible]
            @[instance_reducible]
            instance Turing.AuxPDA.instDecidableEqAuxPDAAction {k : ℕ} {StackSym State : Type} [DecidableEq StackSym] [DecidableEq State] :
            DecidableEq (Action k Bool StackSym State)
            @[instance_reducible]
            instance Turing.AuxPDA.instDecidableWithEmptyStackHaltTr {k : ℕ} {StackSym State : Type} [Fintype StackSym] [Fintype State] [DecidableEq StackSym] [DecidableEq State] {M : AuxPDA k Bool StackSym State} [(q : State) → (inp : Option Bool) → (work : Fin k → Option Bool) → (top : Option StackSym) → (act : Action k Bool StackSym State) → Decidable (M.Tr q inp work top act)] (q : Option State) (inp : Option Bool) (work : Fin k → Option Bool) (top : Option StackSym) (act : Action k Bool StackSym (Option State)) :
            Decidable (M.withEmptyStackHalt.Tr q inp work top act)

            withEmptyStackHalt.Tr is decidable whenever M.Tr is decidable over finite StackSym and State.

            theorem Turing.AuxPDA.boundedStayStep_iff {k : ℕ} {StackSym State : Type} {input : List Bool} {s : ℕ} {M : AuxPDA k Bool StackSym State} {u v : BoundedSurfaceCfg k StackSym State input s} :
            M.BoundedStayStep u v ↔ u.state = none ∧ v = u ∨ ∃ (q : State) (act : Action k Bool StackSym State), u.state = some q ∧ M.Tr q u.inputSymbol u.workTapeSymbols u.topSym act ∧ act.stackOp = StackOp.stay ∧ applyBoundedTapes? act.tape u u.topSym = some v
            theorem Turing.AuxPDA.boundedPushStep_iff {k : ℕ} {StackSym State : Type} {input : List Bool} {s : ℕ} {M : AuxPDA k Bool StackSym State} {u v : BoundedSurfaceCfg k StackSym State input s} {γ : StackSym} :
            M.BoundedPushStep u γ v ↔ ∃ (q : State) (act : Action k Bool StackSym State), u.state = some q ∧ M.Tr q u.inputSymbol u.workTapeSymbols u.topSym act ∧ act.stackOp = StackOp.push γ ∧ applyBoundedTapes? act.tape u (some γ) = some v
            theorem Turing.AuxPDA.boundedPopStep_iff {k : ℕ} {StackSym State : Type} {input : List Bool} {s : ℕ} {M : AuxPDA k Bool StackSym State} {u v : BoundedSurfaceCfg k StackSym State input s} {γ : StackSym} {baseTop : Option StackSym} :
            M.BoundedPopStep u γ baseTop v ↔ u.topSym = some γ ∧ ∃ (q : State) (act : Action k Bool StackSym State), u.state = some q ∧ M.Tr q u.inputSymbol u.workTapeSymbols (some γ) act ∧ act.stackOp = StackOp.pop ∧ applyBoundedTapes? act.tape u baseTop = some v
            @[instance_reducible]
            instance Turing.AuxPDA.instDecidableBoundedStayStep {k : ℕ} {StackSym State : Type} {input : List Bool} {s : ℕ} [Fintype StackSym] [Fintype State] [DecidableEq StackSym] [DecidableEq State] {M : AuxPDA k Bool StackSym State} [(q : State) → (inp : Option Bool) → (work : Fin k → Option Bool) → (top : Option StackSym) → (act : Action k Bool StackSym State) → Decidable (M.Tr q inp work top act)] (u v : BoundedSurfaceCfg k StackSym State input s) :
            @[instance_reducible]
            instance Turing.AuxPDA.instDecidableBoundedPushStep {k : ℕ} {StackSym State : Type} {input : List Bool} {s : ℕ} [Fintype StackSym] [Fintype State] [DecidableEq StackSym] [DecidableEq State] {M : AuxPDA k Bool StackSym State} [(q : State) → (inp : Option Bool) → (work : Fin k → Option Bool) → (top : Option StackSym) → (act : Action k Bool StackSym State) → Decidable (M.Tr q inp work top act)] (u : BoundedSurfaceCfg k StackSym State input s) (γ : StackSym) (v : BoundedSurfaceCfg k StackSym State input s) :
            @[instance_reducible]
            instance Turing.AuxPDA.instDecidableBoundedPopStep {k : ℕ} {StackSym State : Type} {input : List Bool} {s : ℕ} [Fintype StackSym] [Fintype State] [DecidableEq StackSym] [DecidableEq State] {M : AuxPDA k Bool StackSym State} [(q : State) → (inp : Option Bool) → (work : Fin k → Option Bool) → (top : Option StackSym) → (act : Action k Bool StackSym State) → Decidable (M.Tr q inp work top act)] (u : BoundedSurfaceCfg k StackSym State input s) (γ : StackSym) (baseTop : Option StackSym) (v : BoundedSurfaceCfg k StackSym State input s) :
            Decidable (M.BoundedPopStep u γ baseTop v)
            @[instance_reducible]
            instance Turing.AuxPDA.instDecidableBoundedPushPopStep {k : ℕ} {StackSym State : Type} {input : List Bool} {s : ℕ} [Fintype StackSym] [Fintype State] [DecidableEq StackSym] [DecidableEq State] {M : AuxPDA k Bool StackSym State} [(q : State) → (inp : Option Bool) → (work : Fin k → Option Bool) → (top : Option StackSym) → (act : Action k Bool StackSym State) → Decidable (M.Tr q inp work top act)] (u u' v' v : BoundedSurfaceCfg k StackSym State input s) :