Documentation

Complexitylib.Classes.Containments.Internal.SavitchAssemble

Savitch's machine #

⚠️ Unreviewed by Bolton

Everything is in place: Complexity.savG is the polynomial-time function Complexity.SpaceIter.mem_PSPACE_of_iterate wants, Complexity.Sav.run_top says its orbit reaches an answer, Complexity.Sav.runBound_le bounds how long that takes, and Complexity.Sav.StkSize bounds how much room it needs. This file puts them together.

Main results #

The run at a fixed input #

noncomputable def Complexity.savSemAt {k : } (tm : NTM k) (qp : Polynomial ) (x : List Bool) :

The abstract step Complexity.savG performs, at the ruler it builds.

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

    The answer the recursion returns at x.

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

      What a run of T steps at x achieves: the flag stays down, then goes up, then becomes the answer.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem Complexity.savRun_exists {k : } (tm : NTM k) (qp lp : Polynomial ) (x : List Bool) :
        ∃ (T : ), SavRunSpec tm qp lp x T
        noncomputable def Complexity.savT {k : } (tm : NTM k) (qp lp : Polynomial ) (x : List Bool) :

        The number of steps Savitch's recursion takes at x.

        Equations
        Instances For
          theorem Complexity.savT_spec {k : } (tm : NTM k) (qp lp : Polynomial ) (x : List Bool) :
          SavRunSpec tm qp lp x (savT tm qp lp x)

          The pieces of the space-bounded iteration #

          theorem Complexity.frameVal_savRoot {k : } (tm : NTM k) {L : Language} {S : } (hdec : tm.DecidesInSpace L S) (qp lp : Polynomial ) (hqp : ∀ (n : ), n + S n + 1 Polynomial.eval n qp) (hcardq : ∀ (n : ), Fintype.card tm.Q Cobham.blockWidth (Polynomial.eval n qp)) (x : List Bool) (hmem : x L ∃ (c : Cfg k tm.Q), tm.ReachesCfgLe (2 ^ Polynomial.eval x.length lp) (tm.initCfg x) c tm.halted c c.output.cells 1 = Γ.one) :
          savAns tm qp lp x = true x L

          The answer the recursion returns is membership.

          The whole containment #

          theorem Complexity.savitch_mem_PSPACE {k : } (tm : NTM k) {L : Language} {S : } (hdec : tm.DecidesInSpace L S) (qp lp r w : Polynomial ) (hqp : ∀ (n : ), n + S n + 1 Polynomial.eval n qp) (hcardq : ∀ (n : ), Fintype.card tm.Q Cobham.blockWidth (Polynomial.eval n qp)) (hmem : ∀ (x : List Bool), x L ∃ (c : Cfg k tm.Q), tm.ReachesCfgLe (2 ^ Polynomial.eval x.length lp) (tm.initCfg x) c tm.halted c c.output.cells 1 = Γ.one) (hr : ∀ (n : ), 2 * (2 * (2 * Polynomial.eval n qp + 2) + (Polynomial.eval n lp + 1) * (2 * (2 * Polynomial.eval n lp + 5 * (codeBlocks k * (2 * Polynomial.eval n qp + 2)) + 14) + 2) + 14) + 2 + n Polynomial.eval n r) (hw : ∀ (n : ), (codeBlocks k * (2 * Polynomial.eval n qp + 2) + 3) * Polynomial.eval n lp + 2 Polynomial.eval n w) :

          Savitch's machine. A language whose membership is reachability within 2 ^ lp(|x|) steps of a machine bounded by S is in PSPACE.

          The containment #

          noncomputable def Complexity.savWidthPoly (cardQ : ) (p : Polynomial ) :

          The polynomial bounding the width of the window Savitch's machine writes on.

          Equations
          Instances For
            noncomputable def Complexity.savStatePoly (k : ) (qp lp : Polynomial ) :

            The polynomial bounding the length of the state Savitch's machine carries.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              noncomputable def Complexity.savCountPoly (k : ) (qp lp : Polynomial ) :

              The polynomial bounding the logarithm of the number of steps it takes.

              Equations
              Instances For
                theorem Complexity.savWidthPoly_eval (cardQ : ) (p : Polynomial ) (n : ) :
                Polynomial.eval n (savWidthPoly cardQ p) = n + Polynomial.eval n p + 1 + cardQ
                theorem Complexity.savStatePoly_eval (k : ) (qp lp : Polynomial ) (n : ) :
                Polynomial.eval n (savStatePoly k qp lp) = 2 * (2 * (2 * Polynomial.eval n qp + 2) + (Polynomial.eval n lp + 1) * (2 * (2 * Polynomial.eval n lp + 5 * (codeBlocks k * (2 * Polynomial.eval n qp + 2)) + 14) + 2) + 14) + 2 + n

                NPSPACE ⊆ PSPACE (Savitch's theorem).