Alternating Turing machines over a universe, without a vocabulary #
The semantics half of the machine bridge for the polynomial hierarchy: what it
means for an alternating Turing machine, presented as relations on a
universe, to accept. As in DescriptiveComplexity.Machines no vocabulary
appears, so the reductions – which build machines rather than read them – can
reason about acceptance without unfolding any RelMap.
The model #
DescriptiveComplexity.ATMData is DescriptiveComplexity.TMData together with
one further family of marks, Blk j q: the state q belongs to the j-th
quantifier block. Two conventions fix the game the marks describe.
- Which player owns a state. Block
jis existential whenDescriptiveComplexity.blockPol start jistrue, that is, whenjis even andstartistrueorjis odd andstartisfalse: the polarities alternate outwards-in fromstart, exactly asDescriptiveComplexity.altQuantalternates the quantifiers of a quantified Boolean formula. A state marked by a block of the other polarity is universal (DescriptiveComplexity.ATMData.IsUniv). - Blocks mark states, not times. A variant marking the time – the phases of the run scheduled in advance – makes the round structure independent of the run, and is rejected for exactly that: it clocks the alternation, which is half of what the model is supposed to say.
- A stuck universal state rejects. A universal configuration accepts when
every successor accepts and there is one
(
DescriptiveComplexity.ATMData.AltAcc). The other convention – vacuous universal quantification, so that a stuck universal configuration accepts – is equally standard, and this one is chosen because it makes “the machine stops without accepting” mean reject in every block, which is what a reduction needs: a checking phase that fails may then simply run out of transitions, whatever the polarity of the block it runs in.
With one block the model is the nondeterministic one: AltAcc start n c
unfolds to “some run of at most n steps from c reaches an accepting
state”, so DescriptiveComplexity.ATMData.AltAccepts at k = 1 is
DescriptiveComplexity.TMData.Accepts.
The alternation bound #
Nothing above bounds the number of alternations; the bound is
DescriptiveComplexity.ATMData.BlocksWellFormed, folded into the yes-instances
of the decision problem exactly as linearity of the order is: every state
carries exactly one of the k marks, a transition raises the block index by
0 or 1, and a start state is in block 0. All three are first-order for a
fixed k – the second because it is a condition on a single transition, which
is what makes “at most k - 1 alternations” checkable by the kernel of a Σₖ
definition rather than by an inspection of runs. The last two together make a
run pass through the blocks in succession, starting at the first, which is what
lets it be read as k rounds of a game with the right player in each.
Transport #
DescriptiveComplexity.ATMData.AltAgree records that two alternating machines
over different universes correspond along an equivalence, and the lemmas below
transport acceptance along it – all the isomorphism-invariance proof of the
decision problem needs.
An alternating Turing machine presented as relations on a universe: a
machine in the sense of DescriptiveComplexity.TMData, together with marks
splitting its states into quantifier blocks.
Blk j q: the stateqbelongs to thej-th quantifier block.
Instances For
Dependency graph
The polarity of the j-th quantifier block of a prefix starting with
polarity start: true for an existential block, false for a universal one.
The polarities alternate, so the parity of j decides.
Instances For
Dependency graph
Dependency graph
The polarities of consecutive blocks are opposite.
Dependency graph
Quantification with a polarity, guarded. Existentially, the guard is conjoined; universally it is assumed – and, in the same breath, required to be satisfiable by something. That extra clause is the “a stuck universal state rejects” convention of the module docstring, at the level of quantifiers: a universal player with no legal move loses rather than winning vacuously.
Equations
- DescriptiveComplexity.guardQ true C P = ∃ (a : α), C a ∧ P a
- DescriptiveComplexity.guardQ false C P = ((∃ (a : α), C a) ∧ ∀ (a : α), C a → P a)
Instances For
Dependency graph
Dependency graph
Dependency graph
Guarded quantification only depends on its two predicates up to pointwise equivalence.
Dependency graph
The players #
The state q belongs to a block below i.
Instances For
Dependency graph
The state q is universal: it carries the mark of a block whose
polarity is universal, so the moves out of it belong to the universal
player.
Instances For
Dependency graph
No step is available from the configuration c: the machine stops there.
Whether that is an acceptance depends only on the state, never on the block –
see the module docstring.
Equations
- M.Stuck c = ∀ (c' : DescriptiveComplexity.Config A), ¬M.Step c c'
Instances For
Dependency graph
Alternating acceptance #
Alternating acceptance within a budget. M.AltAcc start n c says the
configuration c accepts with n steps to spare: an accepting state accepts
outright, an existential configuration accepts when some successor does, and
a universal one when it has a successor and every successor accepts.
The budget recurses, so the definition is a Lean-level recursion rather than a
fixed point, and DescriptiveComplexity.ATMData.AltAccepts cashes it in at the
number of positions – the same unary bound as
DescriptiveComplexity.TMData.Accepts.
Equations
Instances For
Dependency graph
Alternating acceptance: an initial configuration accepts within as many
steps as there are positions – chosen by the player of block 0, which is what
DescriptiveComplexity.guardQ at the polarity start says.
The residual freedom in the initial configuration (a machine may have several
start states, and its input may leave cells to the blank) belongs to the same
player as the first move, since it is the first move; at start = true this
is the ∃ c₀ of DescriptiveComplexity.TMData.Accepts, which the problem
therefore specializes to when every state lies in an existential block.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The block structure is well formed, in the style of
DescriptiveComplexity.TMData.WellFormed: every state carries exactly one of
the k block marks, and every transition either stays in its block or moves to
the next one. The second clause is what bounds the number of alternations by
k - 1, and it is a condition on a single transition, hence first-order.
The blocks are entered in order – a transition may not skip one, and the run
starts in block 0 – so that the phases of a run are the blocks in succession.
Skipping would be harmless for the number of alternations but not for the
reading of the run as k rounds of a game: the round of a player would no
longer be the block whose moves it makes, and a run starting above block 0
would hand the choice of its initial configuration to the wrong player.
Padding a machine that skips is a matter of inserting one state per skipped
block.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Elementary properties #
Being stuck is the negation of having a successor.
Dependency graph
Spare budget is never harmful: one more step to spare cannot turn an accepting configuration into a rejecting one.
Dependency graph
Acceptance is monotone in the budget.
Dependency graph
An accepting state accepts, whatever the budget.
Dependency graph
Unfolding one step, in the form the proofs use: with a positive budget an accepting configuration either is accepting outright, or hands the choice to the player owning its state.
Dependency graph
With no universal state the model is the nondeterministic one: the
recursion unfolds to “some run of at most n steps reaches an accepting
state”. This is what makes the one-block problem the machine problem of
DescriptiveComplexity.Machines again, and it is why the alternating model is
a conservative extension rather than a new one.
Dependency graph
The one-block model accepts exactly when the underlying machine does.
Stated at an existential outermost polarity, where the initial configuration is
chosen existentially, as DescriptiveComplexity.TMData.Accepts chooses it.
Dependency graph
Transport along an equivalence of universes #
Two alternating machines over different universes agree along an equivalence when their underlying machines do and their block marks correspond.
- base : TMData.Agree u N.toTMData M.toTMData
The underlying machines agree.
The block marks correspond.
Instances For
Dependency graph
Universality of a state transports along an equivalence.
Dependency graph
Being stuck transports along an equivalence.
Dependency graph
Alternating acceptance within a budget transports along an equivalence.
Dependency graph
Alternating acceptance transports along an equivalence.