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
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
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
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
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
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
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 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
The two ends, and what a position is #
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
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
Reading a step off its transition #
The point of a transition: its tag, and its tuple.
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Building one step #
What a walk may do #
The two steps of a sweep #
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.
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.
The control's own step #
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 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
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.