Documentation

DescriptiveComplexity.Problems.Tiling.CorridorMem

Tiling a corridor is in PSPACE #

The membership half: a corridor is a walk. Its states are the rows – one binary relation variable R x t, read as “the column x of this row carries the tile t” – its starting states are the rows the bottom-row description allows, its transitions are the vertical compatibility, and its accepting states are the rows carrying an accepting tile. That is exactly the shape of DescriptiveComplexity.SOTCSpec, so the specification is a transcription rather than a construction, and PSPACE is SO(TC).

Being a row – one tile per column, horizontally compatible, with the tiles the two edge columns allow – is asked of the starting state and of every state a transition enters, so every reachable state is a row.

The sentence shapes #

The three sentences of the specification live over two different vocabularies (one copy of the block for the endpoints, two for the transition), so each shape is written once over an arbitrary vocabulary with its symbols as parameters, and read back by one realization lemma. Read over an exponential expansion the same specification asks about a corridor of exponential width, which is the EXPSPACE half.

Atoms and guards, over an arbitrary vocabulary #

noncomputable def DescriptiveComplexity.atom₁ {L : FirstOrder.Language} {γ : Type} (r : L.Relations 1) (x : γ) :
L.Formula γ

A unary relation, as a formula.

Equations
Instances For
    Dependency graph
    noncomputable def DescriptiveComplexity.atom₂ {L : FirstOrder.Language} {γ : Type} (r : L.Relations 2) (x y : γ) :
    L.Formula γ

    A binary relation, as a formula.

    Equations
    Instances For
      Dependency graph
      noncomputable def DescriptiveComplexity.atomEq {L : FirstOrder.Language} {γ : Type} (x y : γ) :
      L.Formula γ

      Equality of two variables, as a formula.

      Equations
      Instances For
        Dependency graph
        noncomputable def DescriptiveComplexity.minPosF {L : FirstOrder.Language} {γ : Type} (posn : L.Relations 1) (le : L.Relations 2) (x : γ) :
        L.Formula γ

        x is the least position.

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

          x is the greatest position.

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

            x' is the position immediately above x.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Dependency graph
              theorem DescriptiveComplexity.realize_infS {L : FirstOrder.Language} {M : Type} [L.Structure M] (φ ψ : L.Sentence) :
              M φψ M φ M ψ

              Splitting a conjunction of sentences, kept at the level of so that the clause lemmas of this file still apply to the parts.

              Dependency graph
              @[simp]
              Dependency graph
              @[simp]
              theorem DescriptiveComplexity.realize_atom₂ {L : FirstOrder.Language} {γ M : Type} [L.Structure M] {v : γM} (r : L.Relations 2) (x y : γ) :
              Dependency graph
              @[simp]
              theorem DescriptiveComplexity.realize_atomEq {L : FirstOrder.Language} {γ M : Type} [L.Structure M] {v : γM} (x y : γ) :
              (atomEq x y).Realize v v x = v y
              Dependency graph
              @[simp]
              theorem DescriptiveComplexity.realize_minPosF {L : FirstOrder.Language} {γ M : Type} [L.Structure M] {v : γM} (posn : L.Relations 1) (le : L.Relations 2) (x : γ) :
              (minPosF posn le x).Realize v MinPos (fun (a b : M) => FirstOrder.Language.Structure.RelMap le ![a, b]) (fun (a : M) => FirstOrder.Language.Structure.RelMap posn ![a]) (v x)
              Dependency graph
              @[simp]
              theorem DescriptiveComplexity.realize_maxPosF {L : FirstOrder.Language} {γ M : Type} [L.Structure M] {v : γM} (posn : L.Relations 1) (le : L.Relations 2) (x : γ) :
              (maxPosF posn le x).Realize v MaxPos (fun (a b : M) => FirstOrder.Language.Structure.RelMap le ![a, b]) (fun (a : M) => FirstOrder.Language.Structure.RelMap posn ![a]) (v x)
              Dependency graph
              @[simp]
              theorem DescriptiveComplexity.realize_succPosF {L : FirstOrder.Language} {γ M : Type} [L.Structure M] {v : γM} (posn : L.Relations 1) (le : L.Relations 2) (x x' : γ) :
              (succPosF posn le x x').Realize v SuccPos (fun (a b : M) => FirstOrder.Language.Structure.RelMap le ![a, b]) (fun (a : M) => FirstOrder.Language.Structure.RelMap posn ![a]) (v x) (v x')
              Dependency graph

              What a row is, and what the walk asks of it #

              noncomputable def DescriptiveComplexity.rowTotalS {L : FirstOrder.Language} (posn tile : L.Relations 1) (row : L.Relations 2) :

              Every column of this row carries a tile of the instance.

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

                And it carries only one.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Dependency graph
                  noncomputable def DescriptiveComplexity.rowHorizS {L : FirstOrder.Language} (posn : L.Relations 1) (le horiz row : L.Relations 2) :

                  Neighboring columns of this row are compatible.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Dependency graph
                    noncomputable def DescriptiveComplexity.rowEdgeLS {L : FirstOrder.Language} (posn ledge : L.Relations 1) (le row : L.Relations 2) :

                    Its leftmost column carries a tile allowed there.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Dependency graph
                      noncomputable def DescriptiveComplexity.rowEdgeRS {L : FirstOrder.Language} (posn redge : L.Relations 1) (le row : L.Relations 2) :

                      And its rightmost column one allowed there.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Dependency graph
                        noncomputable def DescriptiveComplexity.rowLegalS {L : FirstOrder.Language} (posn tile ledge redge : L.Relations 1) (le horiz row : L.Relations 2) :

                        Being a row: one tile per column, horizontally compatible, with the tiles the two edge columns allow.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          Dependency graph
                          noncomputable def DescriptiveComplexity.rowFirstS {L : FirstOrder.Language} (posn start base : L.Relations 1) (le first row : L.Relations 2) :

                          Being the bottom row: the corner carries a start tile and every other column one the description allows there.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            Dependency graph
                            noncomputable def DescriptiveComplexity.rowAccS {L : FirstOrder.Language} (posn acc : L.Relations 1) (row : L.Relations 2) :

                            Being an accepting row: some column of it carries an accepting tile.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              Dependency graph
                              noncomputable def DescriptiveComplexity.rowsVertS {L : FirstOrder.Language} (posn : L.Relations 1) (vert rowCur rowNext : L.Relations 2) :

                              One row above another: every column's two tiles are vertically compatible.

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

                                What each clause says #

                                Dependency graph
                                Dependency graph
                                @[simp]
                                theorem DescriptiveComplexity.realize_rowHorizS {L : FirstOrder.Language} {M : Type} [L.Structure M] (posn : L.Relations 1) (le horiz row : L.Relations 2) :
                                Dependency graph
                                @[simp]
                                theorem DescriptiveComplexity.realize_rowEdgeLS {L : FirstOrder.Language} {M : Type} [L.Structure M] (posn ledge : L.Relations 1) (le row : L.Relations 2) :
                                Dependency graph
                                @[simp]
                                theorem DescriptiveComplexity.realize_rowEdgeRS {L : FirstOrder.Language} {M : Type} [L.Structure M] (posn redge : L.Relations 1) (le row : L.Relations 2) :
                                Dependency graph
                                Dependency graph
                                @[simp]
                                theorem DescriptiveComplexity.realize_rowsVertS {L : FirstOrder.Language} {M : Type} [L.Structure M] (posn : L.Relations 1) (vert rowCur rowNext : L.Relations 2) :
                                Dependency graph
                                Dependency graph
                                @[simp]
                                theorem DescriptiveComplexity.realize_rowLegalS {L : FirstOrder.Language} {M : Type} [L.Structure M] (posn tile ledge redge : L.Relations 1) (le horiz row : L.Relations 2) :
                                M rowLegalS posn tile ledge redge le horiz row M rowTotalS posn tile row M rowFuncS row M rowHorizS posn le horiz row M rowEdgeLS posn ledge le row M rowEdgeRS posn redge le row
                                Dependency graph

                                Well-formedness, as a sentence #

                                noncomputable def DescriptiveComplexity.orderWfS {L : FirstOrder.Language} (posn : L.Relations 1) (le : L.Relations 2) :

                                The order is linear and there is a position: the promises the yes-instances fold in.

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

                                  The specification #

                                  @[reducible]

                                  The block of the SO(TC) specification of the corridor: one binary relation variable, read as “the column x of this row carries the tile t”.

                                  Marked @[reducible] so that the numerals of a tuple of its arity elaborate: without it w 1 at the type Fin (corBlock.arity i) → A has no OfNat instance.

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

                                    The input vocabulary together with the order, over which the sentences of an SO(TC) specification live.

                                    Equations
                                    Instances For
                                      Dependency graph
                                      @[reducible, inline]

                                      The vocabulary of the endpoint sentences: one copy of the block.

                                      Equations
                                      Instances For
                                        Dependency graph
                                        @[reducible, inline]

                                        The vocabulary of the transition sentence: two copies of the block.

                                        Equations
                                        Instances For
                                          Dependency graph
                                          @[reducible, inline]

                                          An input symbol, in the endpoint vocabulary.

                                          Equations
                                          Instances For
                                            Dependency graph
                                            @[reducible, inline]

                                            An input symbol, in the transition vocabulary.

                                            Equations
                                            Instances For
                                              Dependency graph
                                              @[reducible, inline]

                                              The row variable, in the endpoint vocabulary.

                                              Equations
                                              Instances For
                                                Dependency graph
                                                @[reducible, inline]

                                                The row variable of the current state, in the transition vocabulary.

                                                Equations
                                                Instances For
                                                  Dependency graph
                                                  @[reducible, inline]

                                                  The row variable of the next state, in the transition vocabulary.

                                                  Equations
                                                  Instances For
                                                    Dependency graph

                                                    The SO(TC) specification of the corridor. The states are the rows: a starting state is a row the bottom-row description allows, a transition is the vertical compatibility with a row entering it, and an accepting state is a row carrying an accepting tile. Being a row is asked of the source and of every state a transition enters, so every reachable state is one.

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

                                                      Reading the specification back #

                                                      def DescriptiveComplexity.corRow {A : Type} (ρ : corBlock.Assignment A) :
                                                      AAProp

                                                      The row an assignment is.

                                                      Equations
                                                      Instances For
                                                        Dependency graph

                                                        Being a row: one tile per column, horizontally compatible, with the tiles the two edge columns allow.

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

                                                          Being the bottom row: the corner carries a start tile, every other column one the description allows there.

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

                                                            What a starting state is: the instance is well-formed and the state is the bottom row.

                                                            Dependency graph
                                                            theorem DescriptiveComplexity.step_iff {A : Type} [FirstOrder.Language.tiling.Structure A] [LinearOrder A] (ρ σ : corBlock.Assignment A) :
                                                            corSpec.Step ρ σ RowLegal (corRow σ) ∀ (x t t' : A), TLPosn xcorRow ρ x tcorRow σ x t'TLVert t t'

                                                            What a transition is: the state entered is a row, and it stands above the state left.

                                                            Dependency graph

                                                            What an accepting state is: a row with an accepting tile in it.

                                                            Dependency graph

                                                            The walk is the corridor #

                                                            def DescriptiveComplexity.corAsg {A : Type} (τ : AA) (k : ) :

                                                            The assignment a row of a corridor is.

                                                            Equations
                                                            Instances For
                                                              Dependency graph
                                                              @[simp]
                                                              theorem DescriptiveComplexity.corRow_corAsg {A : Type} (τ : AA) (k : ) (x t : A) :
                                                              corRow (corAsg τ k) x t t = τ k x
                                                              Dependency graph

                                                              A corridor is a walk: its rows, read as assignments, start at a bottom row, step one above the other, and end at a row with an accepting tile.

                                                              Dependency graph
                                                              noncomputable def DescriptiveComplexity.rowFun {A : Type} (R : AAProp) :
                                                              AA

                                                              The tile a row puts in a column, read off the relation the walk carries.

                                                              Equations
                                                              Instances For
                                                                Dependency graph
                                                                theorem DescriptiveComplexity.rowFun_spec {A : Type} {R : AAProp} {x : A} (h : ∃ (t : A), R x t) :
                                                                R x (rowFun R x)
                                                                Dependency graph

                                                                The corridor a walk has built so far, with the row it has reached on top: the induction invariant of DescriptiveComplexity.corridor_of_accepts.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.exists_corridorTo {A : Type} [FirstOrder.Language.tiling.Structure A] [LinearOrder A] {ρ σ : corBlock.Assignment A} (hsrc : corSpec.IsSrc ρ) (hreach : corSpec.Reach ρ σ) :
                                                                  ∃ (n : ) (τ : AA), CorridorTo n τ σ

                                                                  A row a walk reaches stands on a corridor: the rows it went through are its cells, and the row itself is its top.

                                                                  Dependency graph

                                                                  A walk is a corridor: the rows it goes through tile one, up to the row where the accepting tile stands.

                                                                  Dependency graph

                                                                  Tiling a corridor is SO(TC) definable: the walk on rows is the corridor.

                                                                  Dependency graph

                                                                  Tiling a corridor is in PSPACE.

                                                                  Dependency graph