Computably short games #
We already have a definition of short games at IGame.Short
, but it is, regrettably, noncomputable.
Here, we provide a computable definition of short games from the ground up, following a similar
construction method presented in IGame.lean
.
We define FGame
and its auxiliary backing type SGame
as data, providing data for the left and
right moves of a game in the form of an auxiliary SGame
type. This makes us capable of performing
some basic computations on IGame
. Since we would like to use the same standard interface for
theorem proving in combinatorial games, we restrict this file only for computability usage and
FGame generation. Since some of IGame
's basic definitions are computable, these theorems
suffice for most of the computability we need.
In general, You should not build any substantial theory based off of this file. The theorems here are intended to check for definitional correctness over theory building.
For Mathlib #
Equations
The type of "short pre-games", before we have quotiented by equivalence (identicalSetoid
).
This serves the exact purpose that PGame
does for IGame
. However, unlike PGame
's relatively
short construction, we must prove some extra definitions for computing on top of SGame
.
This could perfectly well have been in Type 0
, but we make it universe polymorphic for
convenience when building quotient types. However, conversions from computable games to their
noncomputable counterparts are squeezed to Type 0
.
Instances For
Perform a right move.
Instances For
Equations
- SGame.instWellFoundedRelation = { rel := SGame.IsOption, wf := SGame.isOption_wf }
Equations
- SGame.tacticSgame_wf = Lean.ParserDescr.node `SGame.tacticSgame_wf 1024 (Lean.ParserDescr.nonReservedSymbol "sgame_wf" false)
Instances For
Equations
- One or more equations did not get rendered due to their size.
The identical relation on short games. See PGame.Identical
.
Equations
- SGame.«term_≡_» = Lean.ParserDescr.trailingNode `SGame.«term_≡_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ≡ ") (Lean.ParserDescr.cat `term 51))
Instances For
Equations
- SGame.identicalSetoid = { r := SGame.Identical, iseqv := SGame.identicalSetoid._proof_1 }
Instances For
If x ≡ y
, then a right move of x
is identical to some right move of y
.
If x ≡ y
, then a right move of y
is identical to some right move of x
.
Equations
- One or more equations did not get rendered due to their size.
Game moves #
Alias of the reverse direction of FGame.mk_eq_mk
.
Equations
The finset of left moves of the game.
Equations
- FGame.leftMoves = Quotient.lift (fun (x : SGame) => Finset.image (fun (y : Fin x.LeftMoves) => FGame.mk (x.moveLeft y)) Finset.univ) FGame.leftMoves._proof_1
Instances For
The finset of right moves of the game.
Equations
- FGame.rightMoves = Quotient.lift (fun (x : SGame) => Finset.image (fun (y : Fin x.RightMoves) => FGame.mk (x.moveRight y)) Finset.univ) FGame.rightMoves._proof_1
Instances For
Construct a FGame
from its left and right lists. This is an auxiliary definition
used to define the more general FGame.ofFinsets
.
Equations
Instances For
Construct a FGame
from its left and right finsets.
This is given notation {s | t}ꟳ
, where the superscript F
is to disambiguate from set builder
notation, and from the analogous constructors on other game types.
Equations
Instances For
Construct a FGame
from its left and right finsets.
This is given notation {s | t}ꟳ
, where the superscript F
is to disambiguate from set builder
notation, and from the analogous constructors on other game types.
Conventions for notations in identifiers:
- The recommended spelling of
{· | ·}ꟳ
in identifiers isofFinsets
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A (proper) subposition is any game in the transitive closure of IsOption
.
Instances For
Equations
- FGame.instWellFoundedRelation = { rel := FGame.Subposition, wf := ⋯ }
Discharges proof obligations of the form ⊢ Subposition ..
arising in termination proofs
of definitions using well-founded recursion on FGame
.
Equations
- FGame.tacticFgame_wf = Lean.ParserDescr.node `FGame.tacticFgame_wf 1024 (Lean.ParserDescr.nonReservedSymbol "fgame_wf" false)
Instances For
Basic games #
Repr #
The Repr of FGame. We confine inputs to {0} to make universe determinism easy on #eval
,
and we prefer our notation of games {{a, b, c}|{d, e, f}} over the usual flattened out one
{a, b, c|d, e, f} to match with the IGame
builder syntax.
Equations
- FGame.instRepr = { reprPrec := fun (g : FGame) (x : ℕ) => FGame.instRepr_aux✝ g }