The machine of a second-order game #
The alternating machine emitted by SO-GAME ≤ʳᶠᵒ[≤] ATMAcceptSpace, assembled
on the tape of DescriptiveComplexity.Exponential.GameTape with the phases of
DescriptiveComplexity.Exponential.GameCtrl.
The shape of a transition #
A transition is an element of the emitted universe, so it carries a tag and a
tuple. The tag is DescriptiveComplexity.TrTag: the phase it applies in, the
phase it moves to, the symbol it reads, the symbol it writes, and its
direction. The tuple carries, in one piece,
coordinates 0 … V-1 the valuation of the question's variables
coordinates V … V+a-1 the address of the cell the symbol sits in
which is what makes every relation of
DescriptiveComplexity.TMData first-order and uniform:
SrcandDstread the valuation, each up to the arity its own phase declares – so a step of the prefix, whose destination declares one more variable than its source, writes exactly one coordinate, and the existential quantification over transitions is the quantification over the value written;ReadandWriteread the address, and a symbol shape together with an address is a point (DescriptiveComplexity.symPt).
Everything specific to the machine is therefore confined to one predicate, the
rule DescriptiveComplexity.TrTag → (Fin dim → A) → Prop saying which
tagged transitions are real. This file takes it as a parameter and proves what
does not depend on it: the two promises ATMAcceptSpace folds into its
yes-instances.
The two promises are rule-independent #
DescriptiveComplexity.TMData.WellFormed and
DescriptiveComplexity.ATMData.BlocksSplit are proved here once and for all
(DescriptiveComplexity.gameMachine_wellFormed,
DescriptiveComplexity.gameMachine_blocksSplit), because neither mentions the
transitions: the first is about the order, the positions, the input and the
blank – all fixed by the layout – and the second is about the marks, which are
DescriptiveComplexity.MachPh.IsUniv read off the phase.
Symbols, as a shape and an address #
The shape of a symbol: a sentinel's mark, or a cell's bit together with the region and relation variable of the cell it sits in. The address itself is carried by the transition's tuple, not by the shape.
- mark
{B : SOBlock}
(b : Bool)
: SymTag B
A sentinel's mark.
- val
{B : SOBlock}
(b r : Bool)
(i : B.ι)
: SymTag B
The bit
bin a cell of regionrholding the relation variablei.
Instances For
Dependency graph
The symbol shapes as a sum, for the Finite instance.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Dependency graph
The dimension, and the two halves of a tuple #
The dimension of the emitted universe: room for the valuation of a question's variables, and for the address of a cell.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
The address half of a transition's tuple.
Equations
- DescriptiveComplexity.addrOf w l = w ⟨V + ↑l, ⋯⟩
Instances For
Dependency graph
The address a symbol shape reads, truncated to the arity of its relation variable.
Equations
- DescriptiveComplexity.argsOf i ā l = ā (Fin.castLE ⋯ l)
Instances For
Dependency graph
The tuple of a transition, from the valuation it carries and the address it reads: the two halves, side by side.
Instances For
Dependency graph
Dependency graph
The address of a cell, read as a symbol's address.
Dependency graph
Dependency graph
The tuple a walk step carries: the valuation its phase already holds,
and the address of the cell it is reading. The first half is what Src and
Dst compare against the state, the second what Read and Write turn into a
symbol.
Equations
Instances For
Dependency graph
Dependency graph
A walk step agrees with its own state: it carries the valuation the phase declares, whatever the address it is reading.
Dependency graph
The valuation a phase keeps: the tuple of the transition entering it, truncated to the coordinates the phase declares and pinned to the minimum elsewhere. This is the destination state a control step builds – any tuple with the same two properties would do, and this is the canonical one.
Instances For
Dependency graph
Dependency graph
Dependency graph
A phase that declares nothing keeps the constant tuple.
Dependency graph
And it is the only such tuple: a state's tuple is determined by the transition that entered it, because the domain pins everything the phase does not declare.
Dependency graph
One step of a prefix writes exactly one coordinate: the tuple the next phase keeps is the one it came from, updated at the coordinate just declared. This is the whole of the arithmetic the prefix costs.
Dependency graph
Updating a coordinate commutes with taking a prefix, when the coordinate is in the prefix.
Dependency graph
A symbol shape at an address is a point.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
The tags of the machine #
The tag of a transition: where it applies, where it goes, what it reads and writes, and which way it moves.
- src : MachPh V M
The phase the transition applies in.
- dst : MachPh V M
The phase it moves to.
- rd : SymTag B
The symbol it reads.
- wr : SymTag B
The symbol it writes.
- right : Bool
Whether it moves the head right.
Instances For
Dependency graph
A transition tag as a tuple, for the Finite instance.
Instances For
Dependency graph
Dependency graph
Dependency graph
The control's tags: the phases, which are the states, and the rules, which are the transitions.
Equations
Instances For
Dependency graph
The tags of the emitted machine: the tape's, and the control's.
Equations
Instances For
Dependency graph
The coordinates a control tag uses: a phase declares its own, a transition uses the whole tuple.
Equations
- DescriptiveComplexity.ctrlArity vars = Sum.elim (DescriptiveComplexity.MachPh.arity vars) fun (x : DescriptiveComplexity.TrTag B V M) => DescriptiveComplexity.gameDim B V
Instances For
Dependency graph
The machine #
A point of the emitted universe.
Equations
- DescriptiveComplexity.GamePt B V M A = DescriptiveComplexity.Pt B (DescriptiveComplexity.GameCtrlTag B V M) (DescriptiveComplexity.gameDim B V) A
Instances For
Dependency graph
The point of a phase, at a given valuation.
Instances For
Dependency graph
A state belongs to the universal player exactly when its phase does.
Equations
- DescriptiveComplexity.isUnivPt pol p = match p.1 with | Sum.inr (Sum.inl ph) => DescriptiveComplexity.MachPh.IsUniv pol ph = true | x => False
Instances For
Dependency graph
The state the machine starts in: the initial sweep, writing region 0.
Equations
Instances For
Dependency graph
The machine of a second-order game, with its rules as a parameter.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The two promises #
The tape order is linear on the whole universe, which is what
DescriptiveComplexity.TMData.WellFormed asks of it.
Dependency graph
The machine is well formed, whatever its rules: the order is linear, there is a position, the input is functional and total, and there is exactly one blank.
Dependency graph
The two marks split the states, whatever the rules: a point is universal exactly when it is a state whose phase is.
Dependency graph
A state is universal exactly when its phase is.
Dependency graph
The two ends, and what a position is #
What a position is: a left sentinel, a cell, or the right sentinel. This is what a walk's step analysis begins with – the head is one of the three, and the symbol it reads follows.
Dependency graph
The rules #
The rules of the machine, all nine families.
Two of them are still parameters, and for the same reason the rules themselves were one: they are the only places where the machine consults the source structure rather than its own tape.
concOkis the guard of a concluding transition – the residual formula ofDescriptiveComplexity.QuestionData, which mentions no block atom and is therefore a first-order condition on the valuation;isTargetis the test a seek makes at a cell: is the symbol I am reading the one the challenged atom addresses, carrying the bit that was claimed? Both the address and the claim come from the phase and the tuple.
The control's own steps (family A) are DescriptiveComplexity.MachPh.CtrlStep,
which is False at every walk phase, so no family overlaps another except
where the design means it to: family C at a cell of the swept region, where the
two choices of the written bit are the guess.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
A rule out of a walk phase is never a control step: the control graph is empty there, so the nine families do not overlap at a walk.
Dependency graph
The machine of a specification #
What a machine needs to know about a specification: one
DescriptiveComplexity.QuestionData per question, and the two bounds that let
the phases carry a common prefix index and a common claim vector. Nothing
is padded – each question keeps its own vars and natoms, and the tuples are
restricted with Fin.castLE.
- data : GameQuestion → QuestionData K B
The machine-ready form of each of the six questions.
Every question's prefix fits in the phase's index.
Every question's atoms fit in the phase's claim vector.
Instances For
Dependency graph
The length of each question's prefix.
Instances For
Dependency graph
The number of block atoms in each question's matrix.
Instances For
Dependency graph
Whose turn each prefix variable is.
Instances For
Dependency graph
Dependency graph
The valuation a tuple gives the variables of a question.
Equations
- prog.valOf q w l = w (Fin.castLE ⋯ l)
Instances For
Dependency graph
The guard of a concluding transition: the residual formula of the question, under the claims the phase carries, read at the valuation the tuple carries. It mentions no block atom, so it is a condition on the source structure – written by the interpretation, never computed by the machine.
Equations
Instances For
Dependency graph
The test a seek makes at a cell: is the symbol I am reading the one the challenged atom addresses, carrying the bit that was claimed? The region and the relation variable are named by the atom – the copy being read against the region the game sits in – and the address is the atom's arguments applied to the valuation.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The machine of a specification, complete: the layout, the control, the nine rule families, and the two guards that read the source structure.
Equations
- prog.machine a₀ hdim = DescriptiveComplexity.gameMachine prog.vars prog.pol a₀ hdim (DescriptiveComplexity.gameRule prog.vars prog.natoms prog.concOk prog.isTarget)
Instances For
Dependency graph
The machine is well formed.
Dependency graph
The two marks split its states.
Dependency graph
Every specification has such a program. The six questions are read in one language and normalized independently; the phases' index types are the maxima, and nothing is padded.
Dependency graph
Reading a step off its transition #
The point of a transition: its tag, and its tuple.
Instances For
Dependency graph
Every transition is a tagged tuple, and its rule holds of it. This is the one place the tag of a transition is destructured; everything downstream reads the five lemmas below.
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
A step, read off its transition. The tuple w of the transition is what
carries the value a prefix step writes and the address a walk step reads; the
five clauses about it are exactly the five attributes of
DescriptiveComplexity.TMData.Step.
Dependency graph
Building one step #
One step, built from a rule. The destination configuration is forced:
the state is whatever Dst allows, the head is the neighbor, and the tape is
the old one with the written symbol at the head. Every case of every walk goes
through this, so the frame condition is discharged once.
Dependency graph
What a walk may do #
The three things a sweep may do, and nothing else: cross a left
sentinel, act at a cell – guessing the bit in the swept region, copying it back
elsewhere – or reach the right mark and hand over to its rewind. The other six
families die on the phase's kind, and the control's own family dies because
DescriptiveComplexity.MachPh.CtrlStep is empty at a walk.
Dependency graph
The two things a rewind may do: cross a cell without changing it, or reach the left mark and hand over to its continuation. Both move left, so it really does walk back.
Dependency graph
The three things a seek may do: cross a left sentinel, cross a cell that is not its target, or stop at the one that is. Every one of them writes back what it read, so a seek never changes the tape; and the last is the only way out of the phase, so a seek that never meets its target simply runs off the tape and loses.
Dependency graph
The only thing a control phase may do is a step of the control graph. The eight tape families all name a walk kind, so at any other phase they are empty and family (A) is what is left – with the guard of a concluding transition, which is the one thing the control graph does not carry.
Dependency graph
A rewind never changes the tape.
Dependency graph
The two steps of a sweep #
A sweep crosses a sentinel, changing nothing.
Dependency graph
A sweep acts at a cell: in the region it is writing it may put either bit there, and elsewhere it writes back what it read.
Dependency graph
A sweep reaches the right mark and hands over to its rewind, moving left in the same step – so the rewind starts strictly below the right sentinel.
Dependency graph
A walk along the positions #
The induction the three walks run on, stated for an arbitrary machine: each
step moves the head to the neighboring position and preserves an invariant, so
the walk reaches the end of the tape. The measure is
DescriptiveComplexity.bitRank, which increases by one along
DescriptiveComplexity.SuccPos
(DescriptiveComplexity.bitRank_succPos) and is bounded by the number of
positions (DescriptiveComplexity.bitRank_lt_card), so nothing here depends on
which position follows which – the successor is whatever the step produces.
That is the payoff of §2.1a: a walk needs no address of its own.
A rightward walk runs until something stops it, or to the end of the tape. A sweep is stopped by nothing and so reaches the right sentinel; a seek is stopped by the cell it is looking for, and reaching the sentinel instead is how it learns there was none.
Dependency graph
A rightward walk reaches the highest position, when nothing stops it.
Dependency graph
A leftward walk reaches the lowest position.
Dependency graph
What a walk has already passed #
A walk's invariant has to say what it has already rewritten, and the only
handle on that is the order: the cells strictly below the head. The two facts
below are all it needs, and neither mentions the tape's layout – so the sweep's
invariant never has to compare two cells, and the order on cells
(cellPt r i ā against cellPt r' i' ā') does not have to be characterized at
all.
A step of the walk moves exactly one position from ahead to behind: the positions strictly below the successor are those strictly below the head, together with the head itself.
Dependency graph
The element immediately above a given one is unique – the mirror of
DescriptiveComplexity.succPos_left_unique, and what pins the head a control
step lands on.
Dependency graph
The control's own step #
A step of the control graph, built. The head bounces between the two
left sentinels – which is what DescriptiveComplexity.MachPh.par records, and
why every such step flips it – and the tape is untouched. The destination keeps
the transition's tuple up to the arity it declares, so a prefix step writes
exactly one coordinate and the choice of the transition is the choice of the
value written.
Dependency graph
The run of a sweep #
A sweep writes an arbitrary assignment into its region. Starting at the
lowest position with the tape holding ρ and σ, it reaches the right
sentinel with the tape holding any ρ', σ' that agree with them outside the
swept region – and, since the phase owns the choice, every play of the sweep
is such a run, which is what a universal sweep needs.
The tape is controlled only at the positions: a cell tag with a non-canonical tuple is not one, and is never read.
Dependency graph
The run of a rewind #
A rewind changes nothing – both its rules write back what they read – so its
invariant is about the state, not the tape. Unlike a sweep it does not end in
the phase it began: its last step, at the second left sentinel, both moves to
the lowest position and hands over to
DescriptiveComplexity.MachPh.rewindTarget. So the invariant it runs on is
(the tape is unchanged) ∧ (the head is not the right sentinel) ∧
(the state is the rewind, or it is the target and the head is lowest)
and closing it needs the two order facts of the layout: the two left sentinels
are adjacent (DescriptiveComplexity.succPos_leftPt), so the handover really
does land on the lowest position; and a cell is never next to the first
sentinel (DescriptiveComplexity.succPos_ne_leftPt), so the walk cannot
reach the lowest position without reading the mark first.
A rewind crosses a cell, changing nothing.
Dependency graph
A rewind reads the left mark and hands over, moving left in the same step – which is why it has to be the second sentinel it reads it on.
Dependency graph
A rewind walks back to the lowest position and hands over. It starts
anywhere strictly below the right sentinel – which is where the sweep's last
step leaves it – changes nothing, and ends on the lowest position in the phase
DescriptiveComplexity.MachPh.rewindTarget names.
Dependency graph
The run of a seek #
A seek walks right, writing back everything it reads, and stops at the cell whose symbol answers its test – the address and the claimed bit, which is why a wrong claim is not a stop. It therefore either meets its cell and accepts, or runs off the tape and, having no rule at the right sentinel, is stuck. Since a seek is an existential phase, that is a loss: asking an unprovable question costs the player who asked.
The cell a seek is looking for: a cell whose symbol – the bit included – answers the phase's test at the address the valuation gives. The bit is read off the tape, so this is where a claim being right or wrong is decided.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
A sentinel is never the cell a seek is looking for.
Dependency graph
Dependency graph
A seek crosses a sentinel, changing nothing.
Dependency graph
A seek crosses a cell that is not the one it is looking for, changing nothing.
Dependency graph
A seek stops at the cell it is looking for, and accepts.
Dependency graph
A seek either meets its cell and accepts, or runs off the tape – and then no cell at all answered its test, which is how a false claim is punished. It starts on a sentinel, where nothing below it can have been passed.