Documentation

DescriptiveComplexity.Problems.Machine.AltPrefix

The quantifier prefix, read from the middle #

DescriptiveComplexity.altQuant quantifies the k block assignments from the outside in, building the tuple with Fin.cons: the assignment of index 0 is the outermost, and the type shrinks as the recursion goes. That is the right shape for a definition and the wrong one for a run, which fixes the blocks in place and rewrites them one at a time with Function.update.

DescriptiveComplexity.AltTail is the second shape: AltTail P r m νs pol quantifies the r blocks from m up, leaving the blocks below m at whatever νs says. The two agree (DescriptiveComplexity.altTail_iff_altQuant), by an induction that pushes one block from the tail into the prefix at a time. The gluing map DescriptiveComplexity.glueTail is what translates between them, and the whole content of the bridge is that pushing a block past it is Function.update.

Quantification from the middle of the prefix #

def DescriptiveComplexity.AltQbf.polQuant {A : Type} (pol : Bool) (Q : (AProp)Prop) :

One quantifier at the polarity pol.

Equations
Instances For
    Dependency graph
    theorem DescriptiveComplexity.AltQbf.polQuant_congr {A : Type} {pol : Bool} {Q Q' : (AProp)Prop} (h : ∀ (ν : AProp), Q ν Q' ν) :
    polQuant pol Q polQuant pol Q'
    Dependency graph
    def DescriptiveComplexity.AltQbf.AltTail {k : } {A : Type} (P : (Fin kAProp)Prop) :
    (Fin kAProp)BoolProp

    Quantifying the last r blocks, the ones below m already fixed by νs. Each block is written in place, which is the shape a run of the machine produces: round m replaces the m-th assignment and leaves the others alone.

    Equations
    Instances For
      Dependency graph
      theorem DescriptiveComplexity.AltQbf.altTail_succ {k : } {A : Type} (P : (Fin kAProp)Prop) {r m : } (h : m < k) (νs : Fin kAProp) (pol : Bool) :
      AltTail P (r + 1) m νs pol = polQuant pol fun (ν : AProp) => AltTail P r (m + 1) (Function.update νs m, h ν) !pol
      Dependency graph

      Gluing a tail onto a prefix #

      def DescriptiveComplexity.AltQbf.glueTail {k : } {A : Type} (m r : ) (νs : Fin kAProp) (σ : Fin rAProp) (i : Fin k) :
      AProp

      The tuple that follows νs below m and reads the r blocks from m up off σ.

      Equations
      Instances For
        Dependency graph
        theorem DescriptiveComplexity.AltQbf.glueTail_zero {k : } {A : Type} (m : ) (νs : Fin kAProp) (σ : Fin 0AProp) :
        glueTail m 0 νs σ = νs

        Gluing nothing leaves the prefix alone.

        Dependency graph
        theorem DescriptiveComplexity.AltQbf.glueTail_cons {k : } {A : Type} {m r : } (h : m < k) (νs : Fin kAProp) (ν : AProp) (σ : Fin rAProp) :
        glueTail m (r + 1) νs (Fin.cons ν σ) = glueTail (m + 1) r (Function.update νs m, h ν) σ

        Pushing one block from the tail into the prefix is an update. This is the whole content of the bridge between the two shapes of the prefix.

        Dependency graph

        The two shapes agree #

        theorem DescriptiveComplexity.AltQbf.altTail_iff_altQuant {k : } {A : Type} (P : (Fin kAProp)Prop) (r m : ) :
        m + r k∀ (νs : Fin kAProp) (pol : Bool), AltTail P r m νs pol altQuant A r (fun (σ : Fin rAProp) => P (glueTail m r νs σ)) pol

        Quantifying from the middle is quantifying from the outside, once the blocks already fixed are glued back on.

        Dependency graph
        theorem DescriptiveComplexity.AltQbf.altTail_zero_iff_altQuant {k : } {A : Type} (P : (Fin kAProp)Prop) (νs : Fin kAProp) (pol : Bool) :
        AltTail P k 0 νs pol altQuant A k P pol

        The whole prefix: quantifying every block in place is the alternating quantification of DescriptiveComplexity.QbfProblem.

        Dependency graph