Second-order definability with bounded alternation #
Foundation for defining the levels Σₖ/Πₖ (k ≥ 1) of the polynomial
hierarchy logically, by Fagin's (Fagin 1974) and
Stockmeyer's (Stockmeyer 1976) theorems: Σₖᵖ
consists of
the problems definable by a second-order sentence with k alternating blocks
of second-order quantifiers starting existentially – on unordered finite
structures (the first existential block can guess a linear order, so the
order-free definition is equivalent to the classical ordered one).
No object-level second-order syntax is needed: a second-order quantifier
block (DescriptiveComplexity.SOBlock) is a finite family of relation variables with
given arities, its instantiations are Lean-level (SOBlock.structure turns
an assignment of relations into a structure over the block's vocabulary
SOBlock.lang), and only the first-order kernel is object-level – a sentence
over the base language expanded by all blocks (DescriptiveComplexity.soLang).
DescriptiveComplexity.SORealize evaluates the alternating quantification, and
DescriptiveComplexity.SigmaSODefinable / DescriptiveComplexity.PiSODefinable state that a
decision problem is defined by such a sentence on nonempty finite
structures.
This file proves the two structural facts about these notions that do not involve reductions:
- isomorphism-invariance (
DescriptiveComplexity.sorealize_iso) – so second-order definable properties are bona fide decision problems; - the duality
Πₖ = co-Σₖ(DescriptiveComplexity.piSODefinable_iff_compl), by negating the kernel and flipping the quantifiers.
The rest of the definitional theory lives in dedicated files: functoriality
and padding in DescriptiveComplexity.SecondOrderLift, closure under FO reductions in
DescriptiveComplexity.SecondOrderPull, closure under ordered FO reductions in
DescriptiveComplexity.SecondOrderOrdered, and the resulting definition of the levels
Σₖᵖ/Πₖᵖ for k ≥ 1 in DescriptiveComplexity.Hierarchy.
Second-order quantifier blocks #
A second-order quantifier block: finitely many relation variables, with
given arities. (The index type is arbitrary rather than an initial segment of
ℕ, so that constructions on blocks – e.g. pulling a block back through an
interpretation – can build their natural index types directly.)
- ι : Type
The index type of the relation variables of the block.
A block has finitely many relation variables.
The arity of each relation variable.
Instances For
Dependency graph
The (relational) vocabulary of a block: one relation symbol per relation variable.
Equations
Instances For
Dependency graph
Dependency graph
A bound on the arities of a block: every relation variable of the block
has arity at most blockArityBound B. Interpretations encoding the relation
variables as tagged tuples use it to size their dimension.
Equations
Instances For
Dependency graph
Dependency graph
An assignment of actual relations (on a universe A) to the relation
variables of a block.
Instances For
Dependency graph
The structure over the block's vocabulary determined by an assignment.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The base language expanded by the vocabularies of a list of blocks.
Equations
- DescriptiveComplexity.soLang L [] = L
- DescriptiveComplexity.soLang L (B :: Bs) = DescriptiveComplexity.soLang (L.sum B.lang) Bs
Instances For
Dependency graph
Alternating second-order satisfaction: SORealize L A Bs φ pol states
that the sentence obtained from the first-order kernel φ by quantifying the
blocks Bs alternately – existentially first if pol is true – holds in
the L-structure A.
Equations
- DescriptiveComplexity.SORealize L A [] φ x✝ = A ⊨ φ
- DescriptiveComplexity.SORealize L A (B :: Bs) φ true = ∃ (ρ : B.Assignment A), DescriptiveComplexity.SORealize (L.sum B.lang) A Bs φ false
- DescriptiveComplexity.SORealize L A (B :: Bs) φ false = ∀ (ρ : B.Assignment A), DescriptiveComplexity.SORealize (L.sum B.lang) A Bs φ true
Instances For
Dependency graph
A decision problem is Σₖ-definable if, on nonempty finite structures, it
is defined by a second-order sentence with k alternating blocks of
second-order quantifiers, starting existentially. (As everywhere in this
development, complexity notions are about nonempty finite structures.)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
A decision problem is Πₖ-definable if, on nonempty finite structures, it
is defined by a second-order sentence with k alternating blocks of
second-order quantifiers, starting universally.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Isomorphism-invariance #
Transport of a block assignment along an equivalence.
Instances For
Dependency graph
An L-isomorphism extends to the vocabulary expanded by a block, when
the block is interpreted by an assignment on one side and its transport on
the other.
Equations
- B.extendEquiv e ρ = { toEquiv := e.toEquiv, map_fun' := ⋯, map_rel' := ⋯ }
Instances For
Dependency graph
Alternating second-order satisfaction is isomorphism-invariant: what a second-order sentence expresses is a decision problem.
Dependency graph
Duality: Πₖ is co-Σₖ #
A problem is Πₖ-definable iff its complement is Σₖ-definable.
Dependency graph
A problem is Σₖ-definable iff its complement is Πₖ-definable.
Dependency graph
Atoms in the relation variables of a block #
The clausal fragments of existential second-order logic – SO-Horn
(DescriptiveComplexity.SecondOrderHorn) and SO-Krom
(DescriptiveComplexity.SecondOrderKrom) – represent their first-order kernel as
data: a list of clauses built from atoms in the quantified relation
variables, over a shared list of universally quantified first-order variables.
The atom type and its semantics are common to both fragments, so they live
here.
An atom R i (x_{f 0}, …) in the relation variables of a block, with
arguments read from k universally quantified first-order variables.
- idx : B.ι
The relation variable of the block the atom is about.
The arguments, as indices among the
kuniversally quantified variables.
Instances For
Dependency graph
The truth value of a second-order atom under an assignment of the block and a valuation of the universally quantified variables.
Instances For
Dependency graph
Atoms are insensitive to transporting an assignment along an isomorphism.