Documentation

DescriptiveComplexity.Problems.Machine.AltInterp

The machine of a formula, written in first-order logic #

DescriptiveComplexity.altAccepts_iff_qbf says that the alternating machine built in an ordered QBF instance accepts exactly when the formula is true. This file writes that machine down: an FOInterpretation of the alternating-machine vocabulary in the ordered QBF vocabulary, dimension two, tagged by DescriptiveComplexity.AltTag.

The shape is the one of DescriptiveComplexity.SatTM.satTuringInterp:

The block marks are new here: blk i holds of a state exactly when DescriptiveComplexity.altBlockOf returns i, which is a function of the tag alone, so those formulas are or too.

The ordered vocabulary of the source #

@[reducible, inline]

The vocabulary of ordered QBF instances.

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

    Occurring positively.

    Equations
    Instances For
      Dependency graph
      @[reducible, inline]

      Occurring negatively.

      Equations
      Instances For
        Dependency graph
        @[reducible, inline]

        Carrying the mark of the i-th block.

        Equations
        Instances For
          Dependency graph
          @[reducible, inline]

          The ambient order.

          Equations
          Instances For
            Dependency graph

            The formula builders #

            Dependency graph
            Dependency graph
            Dependency graph
            def DescriptiveComplexity.AltQbf.blkF {k : } {α : Type} (i : Fin k) (x : α) :

            x carries the mark of the i-th block.

            Equations
            Instances For
              Dependency graph
              Dependency graph
              Dependency graph
              Dependency graph
              noncomputable def DescriptiveComplexity.AltQbf.minF {k : } {α : Type} (x : α) :

              x is the least element.

              Equations
              Instances For
                Dependency graph
                noncomputable def DescriptiveComplexity.AltQbf.minClF {k : } {α : Type} (c : α) :

                c is the lowest clause.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Dependency graph
                  noncomputable def DescriptiveComplexity.AltQbf.maxClF {k : } {α : Type} (c : α) :

                  c is the highest clause.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Dependency graph
                    noncomputable def DescriptiveComplexity.AltQbf.nextClF {k : } {α : Type} (c c' : α) :

                    c' is the clause immediately above c.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Dependency graph
                      Dependency graph
                      def DescriptiveComplexity.AltQbf.litF {k : } {α : Type} (v : Bool) (c x : α) :

                      The cell of x holding the value v satisfies the clause c: the literal test the check phase performs.

                      Equations
                      Instances For
                        Dependency graph

                        Realization of the builders #

                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_clF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {x : α} :
                        (clF x).Realize v QbfCl k (v x)
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_posF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {c x : α} :
                        (posF c x).Realize v QbfPos k (v c) (v x)
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_negF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {c x : α} :
                        (negF c x).Realize v QbfNeg k (v c) (v x)
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_blkF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {i : Fin k} {x : α} :
                        (blkF i x).Realize v QbfBlk i (v x)
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_ordF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {x y : α} :
                        (ordF x y).Realize v v x v y
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_eqF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {x y : α} :
                        (eqF x y).Realize v v x = v y
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_ordLtF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {x y : α} :
                        (ordLtF x y).Realize v v x < v y
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_minF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {x : α} :
                        (minF x).Realize v ∀ (a : A), v x a
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_minClF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {c : α} :
                        (minClF c).Realize v QbfMinCl k (v c)
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_maxClF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {c : α} :
                        (maxClF c).Realize v QbfMaxCl k (v c)
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_nextClF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {c c' : α} :
                        (nextClF c c').Realize v QbfNextCl k (v c) (v c')
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_noClF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} :
                        noClF.Realize v ∀ (e : A), ¬QbfCl k e
                        Dependency graph
                        @[simp]
                        theorem DescriptiveComplexity.AltQbf.realize_litF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {v : αA} {b : Bool} {c x : α} :
                        (litF b c x).Realize v QbfLit k (v c) (v x) b
                        Dependency graph

                        The shapes of the machine's elements, as formulas #

                        A side condition decided when the formula is built: the sweep indices are static, so “this is a real sweep” is a truth value, not a subformula.

                        Equations
                        Instances For
                          Dependency graph
                          @[simp]
                          theorem DescriptiveComplexity.AltQbf.realize_sideF {k : } {α A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {p : Prop} [Decidable p] {v : αA} :
                          (sideF α p).Realize v p
                          Dependency graph
                          noncomputable def DescriptiveComplexity.AltQbf.acstF {k : } (s t' : AltTag k) :
                          (qbfOrd k).Formula (Fin 2 × Fin 2)

                          The second argument is the constant of the tag s: the right tag, and both coordinates least.

                          Equations
                          Instances For
                            Dependency graph
                            noncomputable def DescriptiveComplexity.AltQbf.aoneF {k : } (s : AltTag k) (x : Fin 2 × Fin 2) (t' : AltTag k) :
                            (qbfOrd k).Formula (Fin 2 × Fin 2)

                            The second argument is the tag s carrying the value of x.

                            Equations
                            Instances For
                              Dependency graph
                              theorem DescriptiveComplexity.AltQbf.realize_acstF {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {v : Fin 2 × Fin 2A} {s : AltTag k} {q : AltV k A} (h0 : v (1, 0) = q.2 0) (h1 : v (1, 1) = q.2 1) :
                              (acstF s q.1).Realize v q = acstI s.1 s.2
                              Dependency graph
                              theorem DescriptiveComplexity.AltQbf.realize_aoneF {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] {v : Fin 2 × Fin 2A} {s : AltTag k} {x : Fin 2 × Fin 2} {a : A} {q : AltV k A} (h0 : v (1, 0) = q.2 0) (h1 : v (1, 1) = q.2 1) (hx : v x = a) :
                              (aoneF s x q.1).Realize v q = aoneI s.1 s.2 a
                              Dependency graph

                              The block of a state, read off its tag #

                              The quantifier block of a state, as a function of its tag alone: this is what makes the block marks statically decided formulas.

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

                                The defining formulas #

                                One per symbol of FirstOrder.Language.turingAlt, each matching on the base tag of its arguments. The sweep index is static: a condition on it is sideF, and so is the block a state belongs to.

                                noncomputable def DescriptiveComplexity.AltQbf.posnF {k : } :
                                AltTag k(qbfOrd k).Formula (Fin 1 × Fin 2)

                                Defining formula for posn.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  Dependency graph
                                  noncomputable def DescriptiveComplexity.AltQbf.trF {k : } (cnf : Bool) :
                                  AltTag k(qbfOrd k).Formula (Fin 1 × Fin 2)

                                  Defining formula for tr: the payload promises of DescriptiveComplexity.AltTr, the index conditions decided statically.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    Dependency graph
                                    noncomputable def DescriptiveComplexity.AltQbf.startF {k : } :
                                    AltTag k(qbfOrd k).Formula (Fin 1 × Fin 2)

                                    Defining formula for start.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      Dependency graph
                                      noncomputable def DescriptiveComplexity.AltQbf.accF {k : } :
                                      AltTag k(qbfOrd k).Formula (Fin 1 × Fin 2)

                                      Defining formula for acc: acceptance is read off the base tag alone.

                                      Equations
                                      Instances For
                                        Dependency graph
                                        noncomputable def DescriptiveComplexity.AltQbf.blankF {k : } :
                                        AltTag k(qbfOrd k).Formula (Fin 1 × Fin 2)

                                        Defining formula for blank.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          Dependency graph
                                          noncomputable def DescriptiveComplexity.AltQbf.rightF {k : } :
                                          AltTag k(qbfOrd k).Formula (Fin 1 × Fin 2)

                                          Defining formula for right: a static condition on the tag.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            Dependency graph
                                            noncomputable def DescriptiveComplexity.AltQbf.inpF {k : } :
                                            AltTag kAltTag k(qbfOrd k).Formula (Fin 2 × Fin 2)

                                            Defining formula for inp, the initial tape.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              Dependency graph
                                              noncomputable def DescriptiveComplexity.AltQbf.tsrcF {k : } (cnf : Bool) :
                                              AltTag kAltTag k(qbfOrd k).Formula (Fin 2 × Fin 2)

                                              Defining formula for tsrc.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                Dependency graph
                                                noncomputable def DescriptiveComplexity.AltQbf.treadF {k : } :
                                                AltTag kAltTag k(qbfOrd k).Formula (Fin 2 × Fin 2)

                                                Defining formula for tread.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  Dependency graph
                                                  noncomputable def DescriptiveComplexity.AltQbf.tdstF {k : } (cnf : Bool) :
                                                  AltTag kAltTag k(qbfOrd k).Formula (Fin 2 × Fin 2)

                                                  Defining formula for tdst: the one place the instance is consulted, in the check clause, through DescriptiveComplexity.AltTM.litF.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For
                                                    Dependency graph
                                                    noncomputable def DescriptiveComplexity.AltQbf.twriteF {k : } :
                                                    AltTag kAltTag k(qbfOrd k).Formula (Fin 2 × Fin 2)

                                                    Defining formula for twrite.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      Dependency graph
                                                      noncomputable def DescriptiveComplexity.AltQbf.blkStF {k : } (i : Fin k) :
                                                      AltTag k(qbfOrd k).Formula (Fin 1 × Fin 2)

                                                      Defining formula for the i-th block mark: the block of a state is a function of its tag.

                                                      Equations
                                                      Instances For
                                                        Dependency graph

                                                        The interpretation of alternating machine instances in ordered QBF instances: the machine M_φ of the formula, written down.

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

                                                          The realization lemmas #

                                                          One per symbol, each saying that its defining formula defines the corresponding predicate of DescriptiveComplexity.altMachine. The universe of the interpreted structure is definitionally DescriptiveComplexity.AltV k A.

                                                          The identity equivalence between the tagged tuples and the interpreted universe.

                                                          Equations
                                                          Instances For
                                                            Dependency graph
                                                            @[simp]
                                                            theorem DescriptiveComplexity.AltQbf.altMapEquiv_apply {k : } {A : Type} (cnf : Bool) (p : AltV k A) :
                                                            (altMapEquiv cnf) p = p
                                                            Dependency graph
                                                            theorem DescriptiveComplexity.AltQbf.realize_blkAtF {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] {j : Fin (k + 1)} {x : A} {v : Fin 1 × Fin 2A} (hx : v (0, 0) = x) :
                                                            (if h : j < k then blkF j, h (0, 0) else ).Realize v QbfBlkAt j x

                                                            The block mark of a sweep index, read as a formula.

                                                            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
                                                            theorem DescriptiveComplexity.AltQbf.relMap_blk {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] (cnf : Bool) (hk : 0 < k) (j : ) (p : AltV k A) :
                                                            ATMBlk j ((altMapEquiv cnf) p) AltBlkOf j p
                                                            Dependency graph

                                                            The machines agree, and the reduction #

                                                            The interpreted structure describes the machine of the instance: every field of DescriptiveComplexity.atmData on the interpreted structure agrees, along the identity equivalence, with DescriptiveComplexity.altMachine.

                                                            Dependency graph
                                                            theorem DescriptiveComplexity.AltQbf.atmAccept_map_iff {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] [LinearOrder A] [Finite A] [Nonempty A] (cnf : Bool) (hk : 0 < k) (start : Bool) :
                                                            (ATMAccept k start).Holds ((altTuringInterp k cnf).Map A) altQuant A k (QbfMatrix cnf) start

                                                            Correctness of the interpretation: the interpreted structure is a yes-instance of alternating acceptance exactly when the quantified formula is true. Both promises hold unconditionally, and acceptance is DescriptiveComplexity.altAccepts_iff_qbf, transported along the agreement.

                                                            Dependency graph
                                                            noncomputable def DescriptiveComplexity.AltQbf.qbf_ordered_fo_reduction_atmAccept {k : } (hk : 0 < k) (start cnf : Bool) :
                                                            OrderedFOReduction (QbfProblem k start cnf) (ATMAccept k start)

                                                            A quantified Boolean formula reduces to acceptance by an alternating machine: the ordered first-order reduction building M_φ inside the instance.

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