Documentation

DescriptiveComplexity.SecondOrderReplicate

A quantifier prefix of k copies of one block #

The shape every Σₖ definition in this library has: k alternating blocks that are all the same block, one per round of whatever the definition describes — one truth assignment per quantifier block for DescriptiveComplexity.QBF, one run per round of the game for the machine bridge of the polynomial hierarchy.

DescriptiveComplexity.SecondOrderMerge collapses a prefix into a single block, at the cost of turning the alternation into DescriptiveComplexity.altAssign, an alternating quantification over the pieces of one merged assignment. That is awkward to use: the pieces are indexed by the shape of the merge rather than by the round. This file removes the awkwardness when all the blocks are equal:

Nothing here is specific to a block: the symbol and the assignment are built by the same recursion on k, so the reading lemma is Iff.rfl at the head and the induction hypothesis at the tail.

The prefix and its merge #

@[reducible, inline]

A quantifier prefix of k copies of the block B.

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

    The single block merging a prefix of k copies of B.

    Equations
    Instances For
      Dependency graph
      def DescriptiveComplexity.repSym (B : SOBlock) {n : } (x : B.ι) (h : B.arity x = n) (k : ) :
      Fin k(repMerged B k).lang.Relations n

      The relation variable of B used by the i-th round, as a symbol of the merged block's vocabulary. The arity proof is carried along the recursion, so that reading the symbol back needs no cast.

      Equations
      Instances For
        Dependency graph

        The merged assignment determined by one assignment of B per round.

        Equations
        Instances For
          Dependency graph
          theorem DescriptiveComplexity.relMap_repSym (B : SOBlock) {A : Type} {n : } (x : B.ι) (h : B.arity x = n) (k : ) (ρs : Fin kB.Assignment A) (i : Fin k) (v : Fin nA) :
          FirstOrder.Language.Structure.RelMap (repSym B x h k i) v ρs i x fun (j : Fin (B.arity x)) => v (Fin.cast h j)

          Reading back the relation variable of a round.

          Dependency graph

          Alternating over the rounds #

          def DescriptiveComplexity.altBlockQuant (A : Type) (B : SOBlock) (k : ) :
          ((Fin kB.Assignment A)Prop)BoolProp

          Alternating quantification over one assignment of B per round: the round of index 0 is quantified outermost, existentially if pol is true, and the polarities alternate inwards.

          Equations
          Instances For
            Dependency graph
            theorem DescriptiveComplexity.altBlockQuant_congr {A : Type} {B : SOBlock} (k : ) (P Q : (Fin kB.Assignment A)Prop) :
            (∀ (ρs : Fin kB.Assignment A), P ρs Q ρs)∀ (pol : Bool), altBlockQuant A B k P pol altBlockQuant A B k Q pol

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

            Dependency graph
            theorem DescriptiveComplexity.altAssign_repBlocks (B : SOBlock) {A : Type} (k : ) (P : (repMerged B k).Assignment AProp) (pol : Bool) :
            altAssign A (repBlocks B k) P pol altBlockQuant A B k (fun (ρs : Fin kB.Assignment A) => P (repBlockAssign B A k ρs)) pol

            The prefix quantifies one assignment per round: alternating over the pieces of the merged assignment of k copies of B is alternating over k assignments of B.

            Dependency graph

            The definability statement #

            Put together: a sentence over the single merged block, transported into the iterated expansion by DescriptiveComplexity.unmergeHom, is satisfied alternately exactly when the k round assignments are quantified alternately. This is the form a Σₖ-definability proof consumes.

            theorem DescriptiveComplexity.sorealize_repBlocks (B : SOBlock) (L : FirstOrder.Language) (A : Type) (instL : L.Structure A) (k : ) (ψ : (L.sum (repMerged B k).lang).Sentence) (pol : Bool) :
            SORealize L A (repBlocks B k) ((unmergeHom (repBlocks B k) L).onSentence ψ) pol altBlockQuant A B k (fun (ρs : Fin kB.Assignment A) => A ψ) pol
            Dependency graph