Documentation

DescriptiveComplexity.Problems.Machine.Space

The space-bounded machine problems are in PSPACE #

The membership half of the machine bridge for PSPACE. A configuration of a machine is a state, a head position and a tape, and each of the three is a relation on the universe: the tape is a binary relation (the graph of a function), the state and the head are unary marks (singletons). So a configuration is an assignment of a three-variable block (DescriptiveComplexity.mBlock), one step of the machine is a first-order condition on two consecutive assignments, and acceptance – reachability in the configuration graph, since DescriptiveComplexity.TMData.AcceptsSpace has no step bound – is a transitive closure over those assignments. That is an SO(TC) specification on the nose.

This is the same phenomenon as for SUCCINCT-REACH: the problem is the syntactic image of the logic, so membership is a transcription rather than a construction. Nothing here plays the role of DescriptiveComplexity.Problems.Machine.Walk, which exists only to cash in the unary time bound of the time-bounded model by indexing a run by the positions; with the bound dropped a run may be exponentially long and no longer fits in the structure, which is precisely why the space-bounded problems are SO(TC) rather than Σ₁.

The one wrinkle is that an assignment of the block is an arbitrary triple of relations, while a configuration is a functional total tape and two singletons. That is a first-order condition (DescriptiveComplexity.cfgS), it holds of every assignment coming from a configuration, and the transition sentence demands it of the state it moves to, so every state along an accepting walk is a configuration.

The formula builders #

Kept in a namespace of their own: the shapes below (wfF, stepF, …) are the transcription of one machine model into sentences, and their names are the generic ones the other reduction layers of the catalog also use.

Generic sentence shapes #

Each builder is parameterized by the relation symbols it reads, so that the same one serves over the one-copy and the two-copy expansions.

noncomputable def DescriptiveComplexity.SpaceTM.totalF {L' : FirstOrder.Language} {γ : Type} (t : L'.Relations 2) :
L'.Formula γ

The tape is total: every cell holds a symbol.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    Dependency graph
    noncomputable def DescriptiveComplexity.SpaceTM.funcF {L' : FirstOrder.Language} {γ : Type} (t : L'.Relations 2) :
    L'.Formula γ

    The tape is functional: a cell holds at most one symbol.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Dependency graph
      Dependency graph
      noncomputable def DescriptiveComplexity.SpaceTM.uniqF {L' : FirstOrder.Language} {γ : Type} (s : L'.Relations 1) :
      L'.Formula γ

      The mark holds of at most one element.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Dependency graph
        noncomputable def DescriptiveComplexity.SpaceTM.cfgF {L' : FirstOrder.Language} {γ : Type} (t : L'.Relations 2) (s h : L'.Relations 1) :
        L'.Formula γ

        The assignment is a configuration: a total functional tape and two singleton marks.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          Dependency graph
          @[simp]
          theorem DescriptiveComplexity.SpaceTM.realize_totalF {L' : FirstOrder.Language} {M : Type} [L'.Structure M] {γ : Type} {v : γM} (t : L'.Relations 2) :
          (totalF t).Realize v ∀ (p : M), ∃ (a : M), FirstOrder.Language.Structure.RelMap t ![p, a]
          Dependency graph
          @[simp]
          Dependency graph
          @[simp]
          Dependency graph
          Dependency graph
          Dependency graph

          The guarded conjuncts #

          noncomputable def DescriptiveComplexity.SpaceTM.markImpF {L' : FirstOrder.Language} {γ : Type} (s r : L'.Relations 1) :
          L'.Formula γ

          Everything the first mark holds of, the second holds of too.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Dependency graph
            noncomputable def DescriptiveComplexity.SpaceTM.minPosF {L' : FirstOrder.Language} {γ : Type} (h posn : L'.Relations 1) (le : L'.Relations 2) :
            L'.Formula γ

            The marked position is a least position.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Dependency graph
              noncomputable def DescriptiveComplexity.SpaceTM.initTapeF {L' : FirstOrder.Language} {γ : Type} (t inp : L'.Relations 2) (blank : L'.Relations 1) :
              L'.Formula γ

              The tape is an initial tape: each cell holds its input symbol where the input is defined, and the blank elsewhere.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph
                Dependency graph
                @[simp]
                theorem DescriptiveComplexity.SpaceTM.realize_minPosF {L' : FirstOrder.Language} {M : Type} [L'.Structure M] {γ : Type} {v : γM} (h posn : L'.Relations 1) (le : L'.Relations 2) :
                Dependency graph
                Dependency graph

                The conjuncts of the transition sentence #

                noncomputable def DescriptiveComplexity.SpaceTM.markArgF {L' : FirstOrder.Language} {γ : Type} (r : L'.Relations 2) (s : L'.Relations 1) (τ : L'.Term γ) :
                L'.Formula γ

                The transition has the marked element as its source (or destination).

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Dependency graph
                  noncomputable def DescriptiveComplexity.SpaceTM.cellArgF {L' : FirstOrder.Language} {γ : Type} (r : L'.Relations 2) (h : L'.Relations 1) (t : L'.Relations 2) (τ : L'.Term γ) :
                  L'.Formula γ

                  The transition reads (or writes) the symbol held by the marked cell.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Dependency graph
                    noncomputable def DescriptiveComplexity.SpaceTM.frameF {L' : FirstOrder.Language} {γ : Type} (t t' : L'.Relations 2) (h : L'.Relations 1) :
                    L'.Formula γ

                    Cells other than the marked one hold the same symbol before and after.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Dependency graph
                      noncomputable def DescriptiveComplexity.SpaceTM.succPosF {L' : FirstOrder.Language} {γ : Type} (le : L'.Relations 2) (posn : L'.Relations 1) (x y : L'.Term γ) :
                      L'.Formula γ

                      y is the position immediately after x.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Dependency graph
                        noncomputable def DescriptiveComplexity.SpaceTM.moveF {L' : FirstOrder.Language} {γ : Type} (right h h' posn : L'.Relations 1) (le : L'.Relations 2) (τ : L'.Term γ) :
                        L'.Formula γ

                        The head moves to the neighbouring position in the direction the transition names.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          Dependency graph
                          Dependency graph
                          Dependency graph
                          Dependency graph
                          @[simp]
                          theorem DescriptiveComplexity.SpaceTM.realize_succPosF {L' : FirstOrder.Language} {M : Type} [L'.Structure M] {γ : Type} {v : γM} (le : L'.Relations 2) (posn : L'.Relations 1) (x y : L'.Term γ) :
                          Dependency graph
                          Dependency graph

                          Well-formedness #

                          noncomputable def DescriptiveComplexity.SpaceTM.linOrdF {L' : FirstOrder.Language} {γ : Type} (le : L'.Relations 2) :
                          L'.Formula γ

                          The relation is a linear order.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            Dependency graph
                            noncomputable def DescriptiveComplexity.SpaceTM.wfF {L' : FirstOrder.Language} {γ : Type} (le inp : L'.Relations 2) (posn blank : L'.Relations 1) :
                            L'.Formula γ

                            Well-formedness of the instance, as a sentence: the order is linear, there is a position, the input is functional, and there is exactly one blank.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              Dependency graph
                              @[simp]
                              theorem DescriptiveComplexity.SpaceTM.realize_linOrdF {L' : FirstOrder.Language} {M : Type} [L'.Structure M] {γ : Type} {v : γM} (le : L'.Relations 2) :
                              Dependency graph
                              @[simp]
                              theorem DescriptiveComplexity.SpaceTM.realize_wfF {L' : FirstOrder.Language} {M : Type} [L'.Structure M] {γ : Type} {v : γM} (le inp : L'.Relations 2) (posn blank : L'.Relations 1) :
                              Dependency graph

                              The transition sentence #

                              noncomputable def DescriptiveComplexity.SpaceTM.stepF {L' : FirstOrder.Language} {γ : Type} (tr right posn : L'.Relations 1) (src rd dst wr le : L'.Relations 2) (s h : L'.Relations 1) (t : L'.Relations 2) (s' h' : L'.Relations 1) (t' : L'.Relations 2) :
                              L'.Formula γ

                              One step of the machine, as a condition on two consecutive assignments.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                Dependency graph
                                @[simp]
                                theorem DescriptiveComplexity.SpaceTM.realize_stepF {L' : FirstOrder.Language} {M : Type} [L'.Structure M] {γ : Type} {v : γM} (tr right posn : L'.Relations 1) (src rd dst wr le : L'.Relations 2) (s h : L'.Relations 1) (t : L'.Relations 2) (s' h' : L'.Relations 1) (t' : L'.Relations 2) :
                                (stepF tr right posn src rd dst wr le s h t s' h' t').Realize v ∃ (τ : M), (FirstOrder.Language.Structure.RelMap tr ![τ] (∀ (q : M), FirstOrder.Language.Structure.RelMap s ![q]FirstOrder.Language.Structure.RelMap src ![τ, q]) ∀ (p a : M), FirstOrder.Language.Structure.RelMap h ![p]FirstOrder.Language.Structure.RelMap t ![p, a]FirstOrder.Language.Structure.RelMap rd ![τ, a]) ((∀ (q : M), FirstOrder.Language.Structure.RelMap s' ![q]FirstOrder.Language.Structure.RelMap dst ![τ, q]) ∀ (p a : M), FirstOrder.Language.Structure.RelMap h ![p]FirstOrder.Language.Structure.RelMap t' ![p, a]FirstOrder.Language.Structure.RelMap wr ![τ, a]) (∀ (p a : M), ¬FirstOrder.Language.Structure.RelMap h ![p] → (FirstOrder.Language.Structure.RelMap t' ![p, a] FirstOrder.Language.Structure.RelMap t ![p, a])) ((FirstOrder.Language.Structure.RelMap right ![τ] ∀ (p p' : M), FirstOrder.Language.Structure.RelMap h ![p]FirstOrder.Language.Structure.RelMap h' ![p']SuccPos (fun (a b : M) => FirstOrder.Language.Structure.RelMap le ![a, b]) (fun (a : M) => FirstOrder.Language.Structure.RelMap posn ![a]) p p') ¬FirstOrder.Language.Structure.RelMap right ![τ] ∀ (p p' : M), FirstOrder.Language.Structure.RelMap h ![p]FirstOrder.Language.Structure.RelMap h' ![p']SuccPos (fun (a b : M) => FirstOrder.Language.Structure.RelMap le ![a, b]) (fun (a : M) => FirstOrder.Language.Structure.RelMap posn ![a]) p' p)
                                Dependency graph
                                noncomputable def DescriptiveComplexity.SpaceTM.trUniqF {L' : FirstOrder.Language} {γ : Type} (tr : L'.Relations 1) (src rd : L'.Relations 2) :
                                L'.Formula γ

                                At most one transition applies in a given state on a given symbol.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  Dependency graph
                                  noncomputable def DescriptiveComplexity.SpaceTM.detF {L' : FirstOrder.Language} {γ : Type} (tr start : L'.Relations 1) (src rd dst wr : L'.Relations 2) :
                                  L'.Formula γ

                                  Determinism of the instance, as a sentence.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    Dependency graph
                                    Dependency graph
                                    @[simp]
                                    theorem DescriptiveComplexity.SpaceTM.realize_detF {L' : FirstOrder.Language} {M : Type} [L'.Structure M] {γ : Type} {v : γM} (tr start : L'.Relations 1) (src rd dst wr : L'.Relations 2) :
                                    Dependency graph

                                    The block and the specification #

                                    @[reducible, inline]

                                    The block whose assignments are the configurations: the tape as a binary relation variable, the state and the head as unary marks.

                                    Equations
                                    Instances For
                                      Dependency graph
                                      Dependency graph
                                      Dependency graph
                                      Dependency graph
                                      @[reducible, inline]

                                      The ordered expansion of the machine vocabulary.

                                      Equations
                                      Instances For
                                        Dependency graph
                                        Dependency graph
                                        Dependency graph
                                        @[reducible, inline]

                                        A machine symbol in the one-copy expansion.

                                        Equations
                                        Instances For
                                          Dependency graph
                                          @[reducible, inline]

                                          The tape of the state, in the one-copy expansion.

                                          Equations
                                          Instances For
                                            Dependency graph
                                            @[reducible, inline]

                                            The state mark, in the one-copy expansion.

                                            Equations
                                            Instances For
                                              Dependency graph
                                              @[reducible, inline]

                                              The head mark, in the one-copy expansion.

                                              Equations
                                              Instances For
                                                Dependency graph
                                                @[reducible, inline]

                                                A machine symbol in the two-copy expansion.

                                                Equations
                                                Instances For
                                                  Dependency graph
                                                  Dependency graph
                                                  @[reducible, inline]

                                                  The state mark of the current state.

                                                  Equations
                                                  Instances For
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph
                                                    Dependency graph

                                                    The specification: the states are the configurations, the transition is one step of the machine, the starting states are the initial configurations of a well-formed instance and the accepting ones are those in an accepting state.

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

                                                      The deterministic specification: the same walk, with determinism of the instance demanded of the starting states.

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

                                                        Reading a state back as a configuration #

                                                        The tape held by a state of the walk.

                                                        Equations
                                                        Instances For
                                                          Dependency graph

                                                          The state mark held by a state of the walk.

                                                          Equations
                                                          Instances For
                                                            Dependency graph

                                                            The head mark held by a state of the walk.

                                                            Equations
                                                            Instances For
                                                              Dependency graph

                                                              A state of the walk is a configuration: its tape is total and functional and its two marks are singletons.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                Dependency graph
                                                                Dependency graph
                                                                @[simp]
                                                                theorem DescriptiveComplexity.SpaceTM.mTape_cfgAssign {A : Type} (c : Config A) (p a : A) :
                                                                mTape (cfgAssign c) p a c.tape p = a
                                                                Dependency graph
                                                                Dependency graph
                                                                @[simp]
                                                                Dependency graph
                                                                Dependency graph
                                                                noncomputable def DescriptiveComplexity.SpaceTM.cfgOf {A : Type} {ρ : mBlock.Assignment A} (h : IsCfgOn ρ) :

                                                                The configuration a state of the walk is, when it is one.

                                                                Equations
                                                                Instances For
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.SpaceTM.mTape_cfgOf {A : Type} {ρ : mBlock.Assignment A} (h : IsCfgOn ρ) (p a : A) :
                                                                  mTape ρ p a (cfgOf h).tape p = a
                                                                  Dependency graph

                                                                  The symbols, read back #

                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  Dependency graph

                                                                  A state of the walk represents a configuration.

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

                                                                    Correctness #

                                                                    One step of the machine, read off two states of the walk.

                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      Dependency graph
                                                                      theorem DescriptiveComplexity.SpaceTM.mSpec_isSrc_iff {A : Type} [FirstOrder.Language.turing.Structure A] [LinearOrder A] (ρ : mBlock.Assignment A) :
                                                                      mSpec.IsSrc ρ (tmData A).WellFormed IsCfgOn ρ (∀ (q : A), mState ρ q(tmData A).Start q) (∀ (p : A), mHead ρ pMinPos (tmData A).Le (tmData A).Posn p) ∀ (p a : A), mTape ρ p a(tmData A).InitTape p a
                                                                      Dependency graph
                                                                      Dependency graph
                                                                      Dependency graph

                                                                      The transition sentence is one step of the machine, on states that represent configurations.

                                                                      Dependency graph

                                                                      Every state reachable from one representing a configuration represents one too, and the walk is a run of the machine.

                                                                      Dependency graph
                                                                      Dependency graph

                                                                      The specification is correct: its walk accepts exactly the well-formed instances whose machine accepts in bounded space.

                                                                      Dependency graph
                                                                      Dependency graph
                                                                      Dependency graph

                                                                      The two problems are in PSPACE #

                                                                      The space-bounded nondeterministic machine problem is in PSPACE: a configuration is an assignment of the block, a step is a first-order condition on two of them, and an unbounded run is their transitive closure.

                                                                      Dependency graph
                                                                      Dependency graph

                                                                      The space-bounded deterministic machine problem is in PSPACE: the same walk, with determinism of the instance checked by the source sentence.

                                                                      Dependency graph
                                                                      Dependency graph