Documentation

DescriptiveComplexity.Problems.Qbf.Defs

QBF: quantified Boolean formulas with bounded alternation #

The problems QBF k – quantified Boolean formulas with k alternating blocks of propositional quantifiers – as decision problems on first-order structures. The vocabulary FirstOrder.Language.qbf k is that of SAT (FirstOrder.Language.sat: clauses, positive and negative occurrences) together with k unary block marks qbfBlock i splitting the propositional variables into the k quantifier blocks.

The semantics is the alternating quantification DescriptiveComplexity.altQuant: block 0 is quantified outermost, block k - 1 innermost, and the polarities alternate starting from start. Each quantifier picks a truth assignment for its own block; the combined truth value of a variable (DescriptiveComplexity.qbfVal) is given by the assignment of a block that marks it.

The innermost quantifier-free matrix comes in two shapes, selected by a Boolean parameter:

Both shapes are needed. The hardness proof (DescriptiveComplexity.Problems.Qbf.Hardness) encodes the first-order kernel of a second-order definition by a Tseitin translation (Tseitin 1968), which introduces auxiliary gate variables; these are functionally determined by the block variables, so they can be absorbed into the innermost quantifier only when that quantifier is existential. For a prefix starting existentially the innermost quantifier is existential exactly when k is odd, which is why DescriptiveComplexity.QBF takes a conjunctive matrix for odd k and a disjunctive one for even k – the standard form of the Σₖᵖ-complete quantified Boolean formula problems (Stockmeyer 1976; Wrathall 1976).

inductive FirstOrder.Language.qbfRel (k : ) :
Type

Relation symbols of the language of quantified Boolean formulas with k quantifier blocks.

  • isClause {k : } : qbfRel k 1

    isClause c: the element c is a clause (a term, for a disjunctive matrix).

  • posIn {k : } : qbfRel k 2

    posIn c x: the variable x occurs positively in the clause c.

  • negIn {k : } : qbfRel k 2

    negIn c x: the variable x occurs negatively in the clause c.

  • block {k : } : Fin kqbfRel k 1

    block i x: the variable x belongs to the i-th quantifier block.

Instances For
    Dependency graph
    Dependency graph
    Dependency graph

    The relational vocabulary of quantified Boolean formulas with k quantifier blocks: that of CNF instances, together with k unary predicates marking the variables of each quantifier block.

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

      The symbol for “is a clause”.

      Equations
      Instances For
        Dependency graph
        @[reducible, inline]

        The symbol for “occurs positively in”.

        Equations
        Instances For
          Dependency graph
          @[reducible, inline]

          The symbol for “occurs negatively in”.

          Equations
          Instances For
            Dependency graph
            @[reducible, inline]

            The symbol marking the variables of the i-th quantifier block.

            Equations
            Instances For
              Dependency graph

              Alternating quantification over truth assignments #

              def DescriptiveComplexity.altQuant (A : Type) (k : ) :
              ((Fin kAProp)Prop)BoolProp

              Alternating quantification over k truth assignments on A: the assignment of index 0 is quantified outermost, existentially if pol is true, and the polarities alternate inwards.

              Equations
              Instances For
                Dependency graph
                theorem DescriptiveComplexity.altQuant_congr {A : Type} (k : ) (P Q : (Fin kAProp)Prop) :
                (∀ (νs : Fin kAProp), P νs Q νs)∀ (pol : Bool), altQuant A k P pol altQuant A k Q pol

                Alternating quantification only depends on the quantified predicate up to pointwise equivalence.

                Dependency graph
                theorem DescriptiveComplexity.altQuant_equiv {A B : Type} (e : A B) (k : ) (P : (Fin kAProp)Prop) (pol : Bool) :
                altQuant B k (fun (νs : Fin kBProp) => P fun (i : Fin k) (a : A) => νs i (e a)) pol altQuant A k P pol

                Transport of alternating quantification along an equivalence of universes: quantifying over assignments on B and reading them back through e is quantifying over assignments on A.

                Dependency graph

                The matrix of a quantified Boolean formula #

                def DescriptiveComplexity.qbfVal {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] (νs : Fin kAProp) (x : A) :

                The truth value of the variable x under a tuple of block assignments: x is true when some block marking it assigns it the value true. (In a well-formed instance the block marks partition the variables, so exactly one assignment is consulted.)

                Equations
                Instances For
                  Dependency graph
                  def DescriptiveComplexity.CnfSatWith {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] (swap : Bool) (νs : Fin kAProp) :

                  Conjunctive satisfaction, with the sign of every literal flipped when swap is true: every clause then has to contain a literal that the block assignments make false.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Dependency graph
                    @[reducible, inline]
                    abbrev DescriptiveComplexity.CnfSat {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] (νs : Fin kAProp) :

                    The conjunctive matrix: every clause contains a literal made true by the block assignments.

                    Equations
                    Instances For
                      Dependency graph
                      def DescriptiveComplexity.DnfSat {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] (νs : Fin kAProp) :

                      The disjunctive matrix: some term has all of its literals made true by the block assignments.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Dependency graph
                        def DescriptiveComplexity.QbfMatrix {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] (cnf : Bool) (νs : Fin kAProp) :

                        The matrix of a quantified Boolean formula: conjunctive when cnf is true, disjunctive when it is false.

                        Equations
                        Instances For
                          Dependency graph

                          Propositional duality: the disjunctive matrix is the negation of the conjunctive one with the sign of every literal swapped. This is what lets a single Tseitin translation serve both parities of k: at even k the innermost quantifier is universal, and it absorbs the gate variables through this negation.

                          Dependency graph

                          Optional negation, indexed by a Boolean.

                          Equations
                          Instances For
                            Dependency graph
                            theorem DescriptiveComplexity.xorP_congr (b : Bool) {P Q : Prop} (h : P Q) :
                            xorP b P xorP b Q
                            Dependency graph
                            theorem DescriptiveComplexity.qbfMatrix_eq_xorP {k : } {A : Type} [(FirstOrder.Language.qbf k).Structure A] (sw : Bool) (νs : Fin kAProp) :
                            QbfMatrix (!sw) νs xorP sw (CnfSatWith sw νs)

                            The two matrix shapes, uniformly: whichever matrix QBF uses at a given parity is the conjunctive one with the corresponding sign swap, negated exactly when the swap happens. This is what lets the hardness proof treat both parities at once.

                            Dependency graph

                            Isomorphism-invariance #

                            The decision problems #

                            Quantified Boolean formulas with k alternating quantifier blocks: the prefix starts with an existential block when start is true, and the matrix is conjunctive when cnf is true.

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

                              QBF with k alternating blocks, the canonical Σₖᵖ-complete problem: an existential outermost block, and a matrix whose shape follows the parity of k – conjunctive when the innermost quantifier is existential (k odd), disjunctive when it is universal (k even). See DescriptiveComplexity.Problems.Qbf for the completeness theorem.

                              Equations
                              Instances For
                                Dependency graph

                                The dual family, with a universal outermost block: the canonical Πₖᵖ-complete problem.

                                Equations
                                Instances For
                                  Dependency graph