PSPACE is closed under complement #
⚠️ Unreviewed by Bolton
TM.complementTM already flips a decider's verdict, and TM.complementTM_decidesInTime accounts
for its time. The space account is what PH ⊆ PSPACE needs, and it is not immediate: the space
predicate constrains every reachable configuration, so it is not enough to know where the
machine ends up — one has to know that no configuration along the way strays outside the window.
The complement machine has three phases. In the first it simulates the source machine, so every
configuration it meets is an embedded reachable configuration of that machine and inherits its
bound. In the other two it idles every tape except the output, whose head it walks left to the
marker and then one cell right. The one lemma that makes the accounting work is that an idle
move on a tape carrying its left marker sends the head to max head 1 — it bounces off cell 0
and otherwise stands still — so no head can drift outward however long the rewind takes. One
extra cell therefore covers the whole construction.
The head-bounce lemmas it uses are shared with the loop combinator and live in
Complexitylib.Models.TuringMachine.Combinators.Internal.IdleHeads.
Main definitions #
TM.CompInv— the invariant carried along a run of the complement machine
Main results #
TM.complement_head_bound— after the simulation, no head passesmax head 1TM.complementTM_withinDecisionSpace— every reachable configuration stays in the windowTM.complementTM_decidesInSpace— the complement is decided in spaceS + 1DSPACE_compl— a space class with room for one more cell is closed under complementPSPACE_compl—PSPACEis closed under complement
After the simulation, the complement machine never grows a head beyond max head 1.
Every phase idles the input and work tapes, and moves the output head right only when it is
sitting on the left marker.
After the simulation phase the machine never returns to it.
The invariant carried along a run of the complement machine: every tape keeps its left marker, the simulation phase only ever holds an embedded reachable configuration of the source machine, and every later phase respects the space bound with one cell to spare.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The invariant is preserved by a step.
The invariant holds at the start of the run.
The invariant holds at every reachable configuration.
The complement machine respects the space bound with one cell to spare.
The complement machine decides the complement, in one more cell of space.
PSPACE is closed under complement. The same machine runs, then rewinds its output head
to the verdict cell and flips the bit; the rewind only moves heads leftward or off the left
marker, so it costs one extra cell of space and no more.