Documentation

Complexitylib.Classes.Containments.Internal.SavitchStep

One step of Savitch's stack machine #

⚠️ Unreviewed by Bolton

The recursion of Savitch's theorem, written as a single polynomial-time function on the stack of Complexitylib.Classes.Containments.Internal.SavitchFrame.

A step does exactly one of five things.

Main definitions #

Main results #

Reading the state #

The frame on top of the state's stack.

Equations
Instances For

    The stack below the top frame.

    Equations
    Instances For

      The wide ruler a whole configuration code is measured against.

      Equations
      Instances For

        The all-zero code: the first midpoint the enumeration tries.

        Equations
        Instances For

          The base cases #

          noncomputable def Complexity.baseReach {k : } (tm : NTM k) (R u v : List Bool) :

          The base case of a reachability frame: v is u, or one step from it.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            noncomputable def Complexity.baseAcc {k : } (tm : NTM k) (R rl u : List Bool) :

            The base case of an acceptance frame: an accepting configuration is u, or one step from it.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem Complexity.baseReach_flag {k : } (tm : NTM k) (R u v : List Bool) :
              baseReach tm R u v = [true] baseReach tm R u v = [false]
              theorem Complexity.baseAcc_flag {k : } (tm : NTM k) (R rl u : List Bool) :
              baseAcc tm R rl u = [true] baseAcc tm R rl u = [false]

              The step #

              noncomputable def Complexity.savChild (k : ) (s : List Bool) :

              The child the top frame pushes: the first half of its interval while its phase is zero, the second half afterwards.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                noncomputable def Complexity.savAdvance (s : List Bool) :

                A failed subcall: try the next midpoint, or give up if the enumeration has wrapped.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  noncomputable def Complexity.savReturn (s : List Bool) :

                  A returning subcall.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    noncomputable def Complexity.savDescend {k : } (tm : NTM k) (s : List Bool) :

                    A descending step: bottom out, or push the half being tried.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      noncomputable def Complexity.savStep {k : } (tm : NTM k) (s : List Bool) :

                      One step of Savitch's recursion.

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

                        The initial state #

                        noncomputable def Complexity.savR (qp : Polynomial ) (x : List Bool) :

                        The block ruler of the window, as a function of the input.

                        Equations
                        Instances For
                          noncomputable def Complexity.savInit {k : } (tm : NTM k) (qp lp : Polynomial ) (x : List Bool) :

                          The state Savitch's recursion starts from: one acceptance frame, at the top level, on the code of the initial configuration.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            noncomputable def Complexity.savG {k : } (tm : NTM k) (qp lp : Polynomial ) (z : List Bool) :

                            The function the space-bounded iteration runs. The running state is the first component and the input the second, so the very first call — on pair [] x — is the one that builds the initial state.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              @[simp]
                              theorem Complexity.savG_pair {k : } (tm : NTM k) (qp lp : Polynomial ) (s x : List Bool) :
                              savG tm qp lp (pair s x) = pair (Cobham.selectHead (emptyFlag s) (savInit tm qp lp x) (savStep tm s)) x
                              theorem Complexity.savG_nil {k : } (tm : NTM k) (qp lp : Polynomial ) (x : List Bool) :
                              savG tm qp lp (pair [] x) = pair (savInit tm qp lp x) x
                              theorem Complexity.savG_step {k : } (tm : NTM k) (qp lp : Polynomial ) (s x : List Bool) (hs : s []) :
                              savG tm qp lp (pair s x) = pair (savStep tm s) x

                              The step is polynomial-time #

                              theorem Complexity.savRulerFn_mem_FP (k : ) {a : List BoolList Bool} (ha : a FP) :
                              (fun (z : List Bool) => savRuler k (a z)) FP
                              theorem Complexity.savZeroFn_mem_FP (k : ) {a : List BoolList Bool} (ha : a FP) :
                              (fun (z : List Bool) => savZero k (a z)) FP
                              theorem Complexity.baseReachFn_mem_FP {k : } (tm : NTM k) {Rf uf vf : List BoolList Bool} (hR : Rf FP) (hu : uf FP) (hv : vf FP) :
                              (fun (z : List Bool) => baseReach tm (Rf z) (uf z) (vf z)) FP
                              theorem Complexity.baseAccFn_mem_FP {k : } (tm : NTM k) {Rf rlf uf : List BoolList Bool} (hR : Rf FP) (hrl : rlf FP) (hu : uf FP) :
                              (fun (z : List Bool) => baseAcc tm (Rf z) (rlf z) (uf z)) FP
                              theorem Complexity.savRFn_mem_FP (qp : Polynomial ) {a : List BoolList Bool} (ha : a FP) :
                              (fun (z : List Bool) => savR qp (a z)) FP
                              theorem Complexity.savInitFn_mem_FP {k : } (tm : NTM k) (qp lp : Polynomial ) {a : List BoolList Bool} (ha : a FP) :
                              (fun (z : List Bool) => savInit tm qp lp (a z)) FP
                              theorem Complexity.savG_mem_FP {k : } (tm : NTM k) (qp lp : Polynomial ) :
                              savG tm qp lp FP