Solved #
Intuitively, a position is solved for a given player if they win regardless of the moves they make.
Equations
- GameForm.IsSolved p g = (0 ∉ Moves.moves p g ∧ (g ≠ 0 → ¬Form.IsEnd (-p) g) ∧ ∀ (gp : GameForm), Moves.IsOption gp g → GameForm.IsSolved p gp)
Instances For
Ordinal sums #
Solvedness of an ordinal sum only sees the base: the branch can only be reached through the base, and every subposition of the base is a subposition of the ordinal sum.
Integers #
Zero is the only game solved for both players
Strides #
Stride measures exactly how many moves away each player is from a solved
position: the p-stride of g is 0 iff g is solved for p, every
p-move lowers it by at most one, some p-move lowers it by exactly one
without changing the opponent's stride, and no opponent move raises it.
The last requirement on the best move refers to the opponent's stride of g
itself, which would make the definition loopy. Instead we compare against the
opponent's candidate stride, the value the opponent's stride would have to
take judged from the opponent's options alone (see StrideCandidate); when
the opponent's stride exists the two agree (hasStride_strideCandidate).
Stride is not well-defined for all game forms: * has none, and neither does
{0 | -1}.
Equations
- One or more equations did not get rendered due to their size.
- GameForm.HasStride p g 0 = GameForm.IsSolved p g
Instances For
The value that the p-stride of g must take if it exists, determined by the
strides of the p-options alone: 0 when g is solved, otherwise one more
than the smallest stride of a p-option.
Equations
- One or more equations did not get rendered due to their size.
- GameForm.StrideCandidate p g 0 = GameForm.IsSolved p g
Instances For
A stride is in particular a stride candidate.
A stride candidate is unique, since it is determined by the strides of the options.
Opponent moves have stride ≤ n.
A variant of hasStride_succ_iff for when the (-p)-stride is known: the good
move then simply has to preserve it.
Build the strides of both players of g from their values n at g and the
strides of the options. This is the interface for rulesets: the hypotheses
are the "race" conditions on the ruleset's stride function at g.
Addition #
Ordinal sums #
Ordinal sums forget their branch: the strides of x : y are the strides of
the base x, for every branch y whatsoever. The base must be nonzero since
0 : y = y.
Together with hasStride_add this recovers the strides of Hackenbush trees,
Σ (ground edge : subtree), without any graph argument; see
Hackenbush.hasStride_groundCount for the general graph case.
Integers #
Dyadic rationals #
Strides of the canonical forms of 1/2 = {0 | 1} and 3/4 = {1/2 | 1}.
The latter is the smallest number whose stride only exists because the good
move is required to preserve the opponent's stride rather than the
opponent being required to be able to preserve ours: Right's only move from
3/4 is to 1, which lowers Left's stride from 2 to 1.
Outcomes #
Games with the same strides have the same outcome.
The stride difference characterises misère equivalence for strided games.
Modulo a strided class, an ordinal sum with a nonzero strided base is equal to its base, whatever the branch. This is the misère counterpart of the colon principle.
The misère quotient of a strided class is totally ordered. This follows from the fact that the ordering is determined by stride differences.
The stride difference of a game in a strided class A. This is the left stride
minus the right stride, as an integer.
Equations
- GameForm.Strided.strideDiff g hg = ↑⋯.choose - ↑⋯.choose
Instances For
The stride difference is well-defined regardless of which stride witnesses are used.
Misère equivalent games have the same stride difference.
The stride difference function on the misère quotient, defined via representative. This is well-defined because misère equivalent games have the same stride difference.
Equations
- GameForm.MisereQuotient.strideDiff = Quotient.lift (fun (g : { g : GameForm // A g }) => GameForm.Strided.strideDiff ↑g ⋯) ⋯
Instances For
The stride difference function on the quotient is injective.
The stride difference function on the quotient is surjective: for any integer
d, there is a game in A with stride difference d.
The misère quotient of a strided class is equivalent to the integers. The equivalence sends each equivalence class to its stride difference.
Equations
Instances For
If g ≥m A h then the stride difference of g is ≤ that of h. The
converse of misereGE_of_stride_diff_le.
Misère GE is equivalent to stride difference inequality.
The ordering on the misère quotient corresponds to ≥ on stride differences:
mk A g hg ≤ mk A h hh iff strideDiff A g hg ≥ strideDiff A h hh.
The misère quotient ordering via the integer equivalence: a ≤ b iff the image
of a under the equivalence is ≥ the image of b. Equivalently, the
equivalence is an order-reversing bijection.