Documentation

CslibFrontier.Logics.Propositional.QBF.Blocks

Blocks of quantifiers in Boolean formulas #

QBF.blocks q bs φ prefixes φ with the lists of variables in bs, alternating existential and universal blocks, existential first when q = true. Empty blocks are allowed. The matrix and the resulting formula use the existing QBF syntax.

The word-quantifier interpretation is proved in CslibFrontier.Computability.Complexity.Classes.PH.QBF.

def Cslib.Logic.PL.QBF.blocks {V : Type u_1} :
Bool → List (List V) → QBF V → QBF V

Prefix a formula by alternating blocks of quantifiers, starting existentially for true. An empty block is allowed and still changes the polarity of the next block.

theorem Cslib.Logic.PL.QBF.updates_append {V : Type u_1} [DecidableEq V] {vs : List V} {u : List Bool} (hu : u.length = vs.length) (σ : V → Bool) (ws : List V) (w : List Bool) :
updates σ (vs ++ ws) (u ++ w) = updates (updates σ vs u) ws w

Updating a concatenated list of variables by a concatenated list of values is sequential updating, when the first lists have the same length.

theorem Cslib.Logic.PL.QBF.eval_exs_iff_word {V : Type u_1} [DecidableEq V] (vs : List V) (φ : QBF V) (σ : V → Bool) :
eval σ (exs vs φ) = true ↔ ∃ (w : List Bool), w.length = vs.length ∧ eval (updates σ vs w) φ = true

An existential block quantifies over all words assigning its variables in order, even if some variable names repeat.

theorem Cslib.Logic.PL.QBF.eval_alls_iff_word {V : Type u_1} [DecidableEq V] (vs : List V) (φ : QBF V) (σ : V → Bool) :
eval σ (alls vs φ) = true ↔ ∀ (w : List Bool), w.length = vs.length → eval (updates σ vs w) φ = true

A universal block quantifies over all words assigning its variables in order.

theorem Cslib.Logic.PL.QBF.freeVars_blocks {V : Type u_1} [DecidableEq V] (q : Bool) (bs : List (List V)) (φ : QBF V) :

The free variables of alternating blocks are the free variables of the matrix with all variables of the prefix removed.

def Cslib.Logic.PL.QBF.appendLast {V : Type u_1} (bs : List (List V)) (vs : List V) :

Append variables to the last block, leaving earlier blocks unchanged.

theorem Cslib.Logic.PL.QBF.length_appendLast {V : Type u_1} {bs : List (List V)} (h : bs ≠ []) (vs : List V) :

Appending variables to a nonempty prefix preserves its number of blocks.

theorem Cslib.Logic.PL.QBF.flatten_appendLast {V : Type u_1} (bs : List (List V)) (vs : List V) :
(appendLast bs vs).flatten = bs.flatten ++ vs

Appending variables to the final block appends them to the flattened prefix.

theorem Cslib.Logic.PL.QBF.appendLast_eq_reverse {V : Type u_1} (bs : List (List V)) (vs : List V) :

Appending to the final block can be computed by reversing the prefix.

theorem Cslib.Logic.PL.QBF.blocks_appendLast {V : Type u_1} (q r : Bool) {bs : List (List V)} (hbs : bs ≠ []) (hr : Bool.not^[bs.length] q = !r) (vs : List V) (φ : QBF V) :
blocks q (appendLast bs vs) φ = blocks q bs (if r = true then exs vs φ else alls vs φ)

Appending variables to the last block merges a quantifier of the same polarity into it. The hypothesis identifies that last polarity without an arithmetic parity convention.