Documentation

DescriptiveComplexity.Problems.Qsat.Blocks

Playing a whole quantifier block at once #

DescriptiveComplexity.QsatWins plays one variable at a time, in the order the instance prescribes: that is what makes it the honest reading of a quantifier prefix, and what the membership walk of DescriptiveComplexity.Problems.Qsat.Membership follows step by step. Every hardness proof needs the opposite reading, the one the textbooks write: the prefix is a sequence of blocks of like polarity, and a block is a single quantifier over an assignment of the whole block.

This file proves the two peeling lemmas that turn one reading into the other, DescriptiveComplexity.qsatWins_block_ex and DescriptiveComplexity.qsatWins_block_all: if B is a set of unplayed variables of the same polarity that comes first among the unplayed ones (DescriptiveComplexity.QBlock), then winning the position (D, τ) is winning (D ∪ B, τ) for some (resp. every) assignment of B. Iterating them along the blocks of a constructed instance is how a reduction into QSAT states its correctness.

Both go by induction on the size of B: the next variable to play lies in B as soon as B is nonempty, and the induction hypothesis applies to B minus that variable. The bookkeeping is done with Prop-valued updates (DescriptiveComplexity.qSet) rather than the Bool-valued ones of the game rules, so that a block assignment ν : A → Prop never has to be converted; the two are related by DescriptiveComplexity.qsatWins_ex_iff' and DescriptiveComplexity.qsatWins_all_iff'.

Propositional updates #

def DescriptiveComplexity.qSet {A : Type} (τ : AProp) (x : A) (P : Prop) :
AProp

Giving the variable x the value P, a proposition rather than a Boolean: the shape a block assignment produces.

Equations
Instances For
    Dependency graph
    @[simp]
    theorem DescriptiveComplexity.qSet_self {A : Type} (τ : AProp) (x : A) (P : Prop) :
    qSet τ x P x P
    Dependency graph
    theorem DescriptiveComplexity.qSet_ne {A : Type} (τ : AProp) {x y : A} (P : Prop) (h : y x) :
    qSet τ x P y τ y
    Dependency graph
    theorem DescriptiveComplexity.qUpd_eq_qSet {A : Type} (τ : AProp) (x : A) (b : Bool) :
    qUpd τ x b = qSet τ x (b = true)

    A Boolean update is a propositional one.

    Dependency graph
    theorem DescriptiveComplexity.qSet_congr {A : Type} (τ : AProp) (x : A) {P Q : Prop} (h : P Q) :
    qSet τ x P = qSet τ x Q
    Dependency graph
    theorem DescriptiveComplexity.qSet_self_eq {A : Type} (τ : AProp) (x : A) :
    qSet τ x (τ x) = τ
    Dependency graph

    The one-variable rules, propositionally #

    theorem DescriptiveComplexity.qsatWins_ex_iff' {A : Type} [FirstOrder.Language.qsat.Structure A] (hwf : QsatWf A) {D τ : AProp} {x : A} (hx : QLeast D x) (hq : ¬IsQAll x) :
    QsatWins D τ ∃ (P : Prop), QsatWins (qAdd D x) (qSet τ x P)

    The existential rule, with the played value a proposition.

    Dependency graph
    theorem DescriptiveComplexity.qsatWins_all_iff' {A : Type} [FirstOrder.Language.qsat.Structure A] (hwf : QsatWf A) {D τ : AProp} {x : A} (hx : QLeast D x) (hq : IsQAll x) :
    QsatWins D τ ∀ (P : Prop), QsatWins (qAdd D x) (qSet τ x P)

    The universal rule, with the played value a proposition.

    Dependency graph

    Blocks #

    def DescriptiveComplexity.qUnion {A : Type} (D B : AProp) :
    AProp

    The union of the played variables and a block.

    Equations
    Instances For
      Dependency graph
      def DescriptiveComplexity.qOver {A : Type} (B τ ν : AProp) :
      AProp

      The valuation that reads ν on the block B and τ outside it.

      Equations
      Instances For
        Dependency graph

        B is the next block of the position (D, ·): a set of unplayed variables that comes first among the unplayed ones. Together with a uniform polarity this is what lets the whole of B be played by one quantifier.

        • isVar (x : A) : B xIsQVar x

          A block holds variables.

        • unplayed (x : A) : B x¬D x

          A block holds unplayed variables.

        • first (x y : A) : B xIsQVar y¬D y¬B yQPrec x y

          A block comes first among the unplayed variables.

        Instances For
          Dependency graph
          theorem DescriptiveComplexity.QBlock.mem_of_qLeast {A : Type} [FirstOrder.Language.qsat.Structure A] {D B : AProp} (hB : QBlock D B) {x z : A} (hx : QLeast D x) (hz : B z) :
          B x

          The next variable to play lies in the block, as soon as the block is nonempty.

          Dependency graph
          theorem DescriptiveComplexity.qsatWins_block_ex {A : Type} [FirstOrder.Language.qsat.Structure A] [Finite A] (hwf : QsatWf A) {D B τ : AProp} (hdc : QDownClosed D) (hB : QBlock D B) (hpol : ∀ (x : A), B x¬IsQAll x) :
          QsatWins D τ ∃ (ν : AProp), QsatWins (qUnion D B) (qOver B τ ν)

          An existential block is played by one quantifier: if B is the next block of the position (D, τ) and all its variables are existential, winning (D, τ) is winning (D ∪ B, τ) under some assignment of B.

          Dependency graph
          theorem DescriptiveComplexity.qsatWins_block_all {A : Type} [FirstOrder.Language.qsat.Structure A] [Finite A] (hwf : QsatWf A) {D B τ : AProp} (hdc : QDownClosed D) (hB : QBlock D B) (hpol : ∀ (x : A), B xIsQAll x) :
          QsatWins D τ ∀ (ν : AProp), QsatWins (qUnion D B) (qOver B τ ν)

          A universal block is played by one quantifier: dually, under every assignment of B.

          Dependency graph

          The union of the played variables and a block is downward closed again, so the peeling lemmas can be iterated along the blocks of a prefix.

          Dependency graph