UNREACHd, and L = coL #
Deterministic logarithmic space is closed under complement
(DescriptiveComplexity.LOGSPACE_eq_coLOGSPACE), and UNREACHd – non-reachability
along forced arcs – is LOGSPACE-complete
(DescriptiveComplexity.UNREACHd_LOGSPACE_complete).
Unlike NL = coNL this needs no inductive counting, and unlike the clausal
fragments FO(DTC) has no built-in asymmetry between a problem and its
complement: everything reduces to one membership statement,
DescriptiveComplexity.unreachd_dtcDefinable. Given it, the complement of any
FO(DTC) definable problem is FO(DTC) definable, because a reduction complements
along with the problem (DescriptiveComplexity.OrderedFOReduction.compl) and REACHd is
LOGSPACE-hard.
Complementing a deterministic walk #
REACHdᶜ says that no marked source has a marked target ahead of it. Three
things make that a deterministic walk:
- The walk is functional, so from a given vertex there is only one thing to
do: follow the forced arc (
DescriptiveComplexity.detNext, the successor map, a dead end being its own successor). Reachability along forced arcs is exactly iteration of that map (DescriptiveComplexity.reflTransGen_detEdge_iff_iterate). - A step budget replaces cycle detection. A walk that has not arrived after
|A| - 1steps never will: taking a minimal number of steps to a vertex makes the visited vertices distinct, so it is bounded by the size of the universe (DescriptiveComplexity.exists_iterate_lt_card). The budget is carried as a third coordinate holding a vertex, counted throughDescriptiveComplexity.orank– the universe has exactly as many elements as the walk may take steps. - The sources are scanned in order. Acceptance quantifies the start node existentially, while the complement must quantify sources universally, so the walk loops over the candidates itself, in the order of the structure, and accepts only after exhausting them.
A node is therefore a mode – scanning or done – with a triple
(s, x, c): the source candidate, the current position, the budget. The walk
gets stuck exactly when it finds a marked target ahead of a marked source, so
it reaches its accepting node exactly when there is nothing to find.
The forced-arc successor map #
The forced arcs are functional: that is the whole point of
DescriptiveComplexity.DetEdge.
Dependency graph
A vertex is stuck when no arc out of it is forced: either it has no outgoing arc at all, or it has several.
Equations
- DescriptiveComplexity.Stuck x = ¬∃ (y : A), DescriptiveComplexity.DetEdge x y
Instances For
Dependency graph
The successor map of the deterministic walk: the endpoint of the forced arc
out of x, and x itself where the walk is stuck – the walk of the forced arcs
read as an iterated function, DescriptiveComplexity.stepNext. Making it total is
what lets reachability be read as iteration.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Reachability along forced arcs is iteration of the successor map.
Dependency graph
The step budget: a vertex reachable along forced arcs is reachable in
fewer steps than the universe has elements – the machine-free
DescriptiveComplexity.exists_iterate_lt_card, read for the forced arcs.
Dependency graph
The scanning walk #
A node is a mode – false while scanning, true once done – together with a
triple (s, x, c): the source candidate being tested, the current position of
the walk, and the budget, itself a vertex, counted by its rank in the order.
u is a marked source, as a formula.
Equations
Instances For
Dependency graph
u is a marked target, as a formula.
Equations
Instances For
Dependency graph
There is an arc from u to v, as a formula.
Equations
Instances For
Dependency graph
The arc from u to v is forced, as a formula: it is an arc, and it is
the only one out of u.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
No arc out of u is forced, as a formula.
Equations
Instances For
Dependency graph
Equality of two variables, as a formula.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The specification #
The current source candidate.
Equations
Instances For
Dependency graph
The current position of the walk.
Equations
Instances For
Dependency graph
The current budget.
Equations
Instances For
Dependency graph
The next source candidate.
Equations
Instances For
Dependency graph
The next position.
Equations
Instances For
Dependency graph
The next budget.
Equations
Instances For
Dependency graph
The transition of the scanning mode to itself: either follow the forced arc and spend one unit of budget, or – when the walk is stuck or the budget is exhausted – move on to the next source candidate. Both are guarded by the absence of a marked target ahead of a marked source, which is where the walk stops for good.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The transition to the accepting mode: the last candidate has been scanned through.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The starting nodes: the least candidate, the walk at that candidate, the full budget.
Equations
Instances For
Dependency graph
The specification whose deterministic walk scans for a forced path from a marked source to a marked target, accepting when it finds none.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Semantics of the walk #
a is a least element of the order.
Equations
- DescriptiveComplexity.UnreachD.IsMinA a = ∀ (b : A), a ≤ b
Instances For
Dependency graph
a is a greatest element of the order.
Equations
- DescriptiveComplexity.UnreachD.IsMaxA a = ∀ (b : A), b ≤ a
Instances For
Dependency graph
z covers w: the budget goes from w to z in one step.
Instances For
Dependency graph
One step of the scanning walk, in Lean: follow the forced arc while there is budget, otherwise move to the next candidate, or finish.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
Dependency graph
The walk of the specification is the scanning walk.
Dependency graph
The starting nodes of the walk.
Dependency graph
The accepting nodes of the walk: those of the finished mode.
Dependency graph
Order arithmetic for the budget #
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
The rank of an element is smaller than the size of the universe: the budget allows exactly as many steps as there are elements, less one.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Determinism of the scanning walk #
The scanning walk is deterministic.
Dependency graph
Correctness of the scan #
A marked source with a marked target ahead of it: what the scan looks for, and what its acceptance denies.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
The invariant carried along the scan: every candidate already passed is harmless, and if the current one is not, its target is still ahead of the walk and within the remaining budget.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
At the end of an inner loop – the walk stuck, or the budget spent – the current candidate is harmless: its target would have to be where the walk already stands, and the walk has not stopped there.
Dependency graph
The invariant is preserved by every step of the scan.
Dependency graph
Dependency graph
The starting node satisfies the invariant: nothing has been scanned, and the whole universe is still available as budget.
Dependency graph
Soundness: if the scan finishes, there was nothing to find.
Dependency graph
Completeness of the scan #
Nothing to find means nothing stops the walk, so it runs the inner loop to its end for every candidate and finishes.
The inner loop: from any position of the walk on the candidate s, with any
budget, the node z that ends the loop is reached.
Dependency graph
The outer loop: every candidate is reached, in the order of the structure.
Dependency graph
Completeness: if there is nothing to find, the scan finishes.
Dependency graph
The scan decides non-reachability along forced arcs.
Dependency graph
UNREACHd, and the closure of LOGSPACE under complement #
The complement of REACHd is FO(DTC) definable: the scan is
deterministic (DescriptiveComplexity.UnreachD.functional_unreachdSpec), so its
determinization is itself, and it accepts exactly the marked graphs in which no
marked target lies ahead of a marked source.
Dependency graph
FO(DTC) definability is closed under complement. The complement of P
reduces to the complement of REACHd – a reduction complements along with its two
problems – and that complement is FO(DTC) definable.
Dependency graph
Membership in LOGSPACE is closed under complement.
Dependency graph
coLOGSPACE, the complement class of LOGSPACE. That it is LOGSPACE is
DescriptiveComplexity.LOGSPACE_eq_coLOGSPACE.
Instances For
Dependency graph
L = coL: deterministic logarithmic space is closed under complement.
Unlike NL = coNL (DescriptiveComplexity.NL_eq_coNL, Immerman–Szelepcsényi) this
needs no inductive counting: a deterministic walk has only one thing to do at
each node, so not arriving is witnessed by walking until the budget runs
out.
Dependency graph
UNREACHd, the complement of REACHd: no marked target is reachable from a marked source along forced arcs.
Instances For
Dependency graph
UNREACHd is in LOGSPACE, by the scan.
Dependency graph
UNREACHd is LOGSPACE-hard, by complementing the discharge: the complement of a problem of the class is again in the class, it reduces to REACHd, and the very same interpretation reduces the problem itself to UNREACHd.
Dependency graph
UNREACHd is LOGSPACE-complete. Both halves come from the same side here, unlike the REACH/UNREACH pair one level up: an operator-based logic defines a problem and its complement alike, so no analogue of Immerman–Szelepcsényi is needed to complete the picture.