FO(TC) is closed under complement #
Immerman–Szelepcsényi, as a theorem about the logic: on finite ordered structures, the complement of an FO(TC) definable problem is FO(TC) definable (Immerman 1988, Szelepcsényi 1988).
The proof runs the inductive-counting machine of DescriptiveComplexity.InductiveCounting
inside a single transitive closure. The machine's nodes are the nodes of the
given DescriptiveComplexity.TCSpec, linearly ordered mode-major by the order of the
structure; its configurations are a finite control together with eight
registers, each holding a node or a count, and each stored as one k-tuple of
elements beside a mode kept in the control. So a configuration is a mode
together with a 8k-tuple, which is exactly what a TCSpec of arity 8k can
walk on.
The one thing the translation must supply is the formulas: each atomic
constraint of DescriptiveComplexity.InductiveCounting.VAtom becomes, given the modes recorded
by the two control states, either a first-order formula over the two tuples or
the information that no tuples can satisfy it (compileAtom). Since the modes
are finite control data, every mode-level condition – "these two registers hold
the same mode", "this mode is the least one", "this mode is covered by that
one" – is decided outside the formula, and what remains for the formula is a
condition on tuples of elements: equality, the lexicographic minimum, maximum
or successor (DescriptiveComplexity.OrderWalk), or one of the given spec's own
formulas.
Padding a specification with a spare mode #
The specification with one spare, isolated mode added, so that the mode type is nonempty: the new mode has no transitions and is neither a source nor a target.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Padding does not change acceptance.
Dependency graph
The nodes of a specification as a finite linear order #
The nodes of the walk, ordered mode-major and then lexicographically on tuples.
Instances For
Dependency graph
The node underlying an ordered node.
Instances For
Dependency graph
The ordered node of a node.
Instances For
Dependency graph
Dependency graph
Dependency graph
The edges of the walk, on ordered nodes.
Equations
Instances For
Dependency graph
The starting nodes of the walk, on ordered nodes.
Equations
Instances For
Dependency graph
The accepting nodes of the walk, on ordered nodes.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Acceptance of the specification, read on the ordered nodes.
Dependency graph
Registers inside one tuple #
The arity of the complement specification: eight registers of k elements
each.
Equations
- DescriptiveComplexity.TCCompl.dim spec = 8 * spec.k
Instances For
Dependency graph
The variables of a transition formula: two tuples of that arity.
Equations
- DescriptiveComplexity.TCCompl.Var spec = (Fin (DescriptiveComplexity.TCCompl.dim spec) ⊕ Fin (DescriptiveComplexity.TCCompl.dim spec))
Instances For
Dependency graph
The variable holding coordinate i of register r.
Equations
- DescriptiveComplexity.TCCompl.regIdx spec r i = finProdFinEquiv (r, i)
Instances For
Dependency graph
The variables holding the tuple a slot reads.
Equations
- DescriptiveComplexity.TCCompl.slotSel spec (false, r) = fun (i : Fin spec.k) => Sum.inl (DescriptiveComplexity.TCCompl.regIdx spec r i)
- DescriptiveComplexity.TCCompl.slotSel spec (true, r) = fun (i : Fin spec.k) => Sum.inr (DescriptiveComplexity.TCCompl.regIdx spec r i)
Instances For
Dependency graph
The tuple a register holds inside a tuple of the walk.
Equations
- DescriptiveComplexity.TCCompl.regTup x r i = x (DescriptiveComplexity.TCCompl.regIdx spec r i)
Instances For
Dependency graph
Assembling the eight registers into one tuple.
Equations
- DescriptiveComplexity.TCCompl.mkTup spec f q = f (finProdFinEquiv.symm q).1 (finProdFinEquiv.symm q).2
Instances For
Dependency graph
Dependency graph
The tuple a slot reads, from the two tuples of a transition.
Equations
Instances For
Dependency graph
Dependency graph
The formulas of the atomic constraints #
Two slots hold the same tuple.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The two slots hold tuples joined by a transition of the given modes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The slot holds a starting tuple of the given mode.
Equations
- DescriptiveComplexity.TCCompl.srcF spec m a = FirstOrder.Language.Formula.relabel (DescriptiveComplexity.TCCompl.slotSel spec a) (spec.src m)
Instances For
Dependency graph
The slot holds an accepting tuple of the given mode.
Equations
- DescriptiveComplexity.TCCompl.tgtF spec m a = FirstOrder.Language.Formula.relabel (DescriptiveComplexity.TCCompl.slotSel spec a) (spec.tgt m)
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Register values #
The value of a register: ⊥ when the control records no mode, the node
made of the mode and the tuple otherwise.
Equations
- DescriptiveComplexity.TCCompl.fuse spec none t = ⊥
- DescriptiveComplexity.TCCompl.fuse spec (some m) t = ↑(DescriptiveComplexity.TCCompl.ofNode (m, t))
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Compiling an atomic constraint #
The mode a slot reads, from the modes the two control states record.
Equations
Instances For
Dependency graph
The formula of an atomic constraint, given the modes recorded by the two
control states: none when those modes already make the constraint
unsatisfiable. Every mode-level condition is decided here, outside the
formula.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The registers a control state and a tuple describe.
Equations
- DescriptiveComplexity.TCCompl.regsOf pm x r = DescriptiveComplexity.TCCompl.fuse spec (pm r) (DescriptiveComplexity.TCCompl.regTup x r)
Instances For
Dependency graph
Dependency graph
Dependency graph
The atomic constraints are first-order: given the modes, an atomic constraint holds of the registers exactly when its compiled formula holds of the tuples.
Dependency graph
Compiling a table entry #
The formula of one alternative: the conjunction of its atomic constraints.
Equations
Instances For
Dependency graph
The formula of a table entry: the disjunction of its satisfiable alternatives.
Equations
- DescriptiveComplexity.TCCompl.compileDisj spec pm qm ls = DescriptiveComplexity.listSup (List.filterMap (DescriptiveComplexity.TCCompl.compileConj spec pm qm) ls)
Instances For
Dependency graph
Dependency graph
Dependency graph
The complement specification #
The control states of the counting machine: a phase, the flag, and the mode of each of the eight registers.
Equations
Instances For
Dependency graph
The formula defining the initial configurations: the source scan is about to start with a zero count and the outer register at the least node.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The complement specification: the inductive-counting machine, as a
single transitive closure over 8k-tuples.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The configuration a node of the complement specification describes.
Equations
- DescriptiveComplexity.TCCompl.toCfg n = { phase := n.1.1, flag := n.1.2.1, regs := DescriptiveComplexity.TCCompl.regsOf n.1.2.2 n.2 }
Instances For
Dependency graph
The mode a register value records.
Equations
Instances For
Dependency graph
The tuple a register value records.
Equations
- DescriptiveComplexity.TCCompl.splitTup none = fun (x : Fin spec.k) => Classical.arbitrary A
- DescriptiveComplexity.TCCompl.splitTup (some z) = (DescriptiveComplexity.TCCompl.toNode z).2
Instances For
Dependency graph
Dependency graph
Every configuration comes from a node of the complement specification.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The complement specification is correct: it accepts exactly the structures the given specification rejects.