SO(TC): second-order logic with transitive closure #
The logic that captures polynomial space on ordered structures (Immerman
1999, ch. 10): a transitive closure taken not over
tuples of elements, as in DescriptiveComplexity.TransitiveClosure, but over
tuples of relations. A state of the walk is an assignment of relations to a
second-order quantifier block, so a structure of size n has 2^(n^a) states
and a walk through them is a computation of exponentially many steps – each one
first-order, hence cheap – on a polynomial amount of remembered information.
That is exactly the resource PSPACE measures.
Why no fragment of plain SO would do #
DescriptiveComplexity.SigmaSODefinable and its levels give the polynomial
hierarchy, and plain second-order logic gives PH as a whole
(Fagin 1974; Stockmeyer
1976), so no fragment of plain SO can define PSPACE
without collapsing PH. Some iteration operator is unavoidable, and the
transitive closure is the cheapest one: it needs no positivity condition, no
stage or inflationary machinery, and no syntax of its own.
The operator as data #
As in DescriptiveComplexity.TransitiveClosure (and for the same reasons – not
touching Mathlib's FirstOrder.Language.BoundedFormula), the operator lives at
the Lean level. A DescriptiveComplexity.SOTCSpec bundles
- a second-order quantifier block
B, whose assignments are the states of the walk; - a
stepsentence over the base vocabulary expanded by the order and by two copies of the block – the current state and the next one; srcandtgtsentences over one copy of the block.
Reachability itself is Relation.ReflTransGen, and a structure is accepted
when some tgt state is reachable from some src state
(DescriptiveComplexity.SOTCSpec.Accepts). A single application of TC in front
of a first-order matrix is taken as the definition, exactly as a single
existential block is taken as the definition of Σ₁-definability.
No modes, no tuples #
DescriptiveComplexity.TCSpec carries a finite mode beside its tuple of elements,
because a tuple of elements cannot hold finite data on a one-element universe.
Here nothing of the sort is needed: a relation variable of arity 0 is a
bit, so finite control is already inside a block, and a relation variable of
arity 1 holding a singleton is an element register. A state is therefore a
bare DescriptiveComplexity.SOBlock.Assignment and the walk carries no extra
components – which also makes the pullback of a specification through an
interpretation (DescriptiveComplexity.SecondOrderTransitiveClosurePull) purely a
matter of pulling the block back.
What this file contains #
The semantics (DescriptiveComplexity.SOTCSpec.Step,
DescriptiveComplexity.SOTCSpec.Reach, DescriptiveComplexity.SOTCSpec.Accepts),
its isomorphism-invariance, the transfer of acceptance along a bijection of
states (DescriptiveComplexity.SOTCSpec.accepts_congr, the workhorse of the
pullback), and the definability notion
DescriptiveComplexity.SOTCDefinable. The class DescriptiveComplexity.PSPACE
itself is built on top of it in DescriptiveComplexity.PSpace, once closure
under reductions is available.
Expanding a structure by one or two copies of a block #
FirstOrder.Language.StrongHomClass.realize_sentence with the two structures
passed explicitly rather than by instance search. The structures a walk is read
against are built from block assignments (DescriptiveComplexity.SOBlock.structure₁,
DescriptiveComplexity.SOBlock.structure₂) and are never instances, so every
transport in this file and in
DescriptiveComplexity.SecondOrderTransitiveClosurePull goes through this form.
Dependency graph
The structure over L expanded by one copy of a block's vocabulary,
interpreted by an assignment.
Equations
- B.structure₁ ρ = L.sumStructure B.lang A
Instances For
Dependency graph
The structure over L expanded by two copies of a block's vocabulary –
the current state and the next one – interpreted by two assignments.
Equations
- B.structure₂ ρ σ = (L.sum B.lang).sumStructure B.lang A
Instances For
Dependency graph
DescriptiveComplexity.SOBlock.extendEquiv with the two structures passed
explicitly rather than by instance search, for the same reason as
DescriptiveComplexity.realize_sentence_of_equiv: the layers a walk is read
against are block expansions, which are not instances.
Equations
- B.extendEquiv' e ρ = B.extendEquiv e ρ
Instances For
Dependency graph
Transport of block assignments along an equivalence of universes, as an equivalence: the states of the walk are in bijection with the states of the transported walk.
Equations
Instances For
Dependency graph
Dependency graph
An L-isomorphism extends to L expanded by two copies of a block, the
two assignments being transported.
Equations
- B.extendEquiv₂ e ρ σ = B.extendEquiv (B.extendEquiv e ρ) σ
Instances For
Dependency graph
Specifications #
A single-TC definition over a second-order block: the states of the walk
are the assignments of the block B, and the transition, source and target
conditions are first-order sentences over the base vocabulary expanded by the
order and by copies of the block. The transition sentence sees two copies –
the current state and the next one.
The order is visible to all three sentences, as the ordered setting of the
capture theorem allows; the problem itself does not see it (see
DescriptiveComplexity.SOTCDefinable).
- B : SOBlock
The block whose assignments are the states of the walk.
The transition sentence, over two copies of the block: the current state reads the first copy, the next state the second.
The sentence defining the admissible starting states.
The sentence defining the accepting states.
Instances For
Dependency graph
A state of the walk: an assignment of the block.
Equations
- spec.State A = spec.B.Assignment A
Instances For
Dependency graph
One step of the walk: the transition sentence, read with the current state in the first copy of the block and the next state in the second.
Instances For
Dependency graph
Reachability in the walk: the reflexive-transitive closure of
DescriptiveComplexity.SOTCSpec.Step.
Equations
- spec.Reach = Relation.ReflTransGen spec.Step
Instances For
Dependency graph
A state is a starting state when it satisfies the source sentence.
Instances For
Dependency graph
A state is accepting when it satisfies the target sentence.
Instances For
Dependency graph
The structure is accepted: some accepting state is reachable from some starting state.
Equations
Instances For
Dependency graph
Transfer along a bijection of states #
Acceptance only depends on the walk up to a bijection of its states. Stated for two specifications over two vocabularies, since the pullback through an interpretation relates a specification over the base structure to one over the interpreted structure.
Dependency graph
Acceptance transfers along a bijection of states carrying steps to steps and endpoints to endpoints.
Dependency graph
Isomorphism-invariance #
One step is preserved by an isomorphism of the ordered expansions, the states being transported.
Dependency graph
Starting states are preserved by an isomorphism of the ordered expansions.
Dependency graph
Accepting states are preserved by an isomorphism of the ordered expansions.
Dependency graph
Acceptance is isomorphism-invariant (for isomorphisms of the ordered expansions, the order being visible to the sentences).
Dependency graph
SO(TC) definability #
A decision problem is SO(TC) definable if, on nonempty finite ordered
structures, it is defined by a single transitive closure over the assignments
of a second-order quantifier block: there is a DescriptiveComplexity.SOTCSpec
whose accepting states are reachable from its starting states exactly on the
yes-instances.
As for DescriptiveComplexity.TCDefinable and the clausal fragments, the
equivalence is required for every linear order on the universe, so this is
order-invariant SO(TC) definability: the problem itself does not see the order,
while the three sentences may.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
SO(TC) definability only depends on the finite instances of a problem.