Surreal numbers #
The basic theory of surreal numbers, built on top of the theory of combinatorial (pre-)games.
A pregame is Numeric
if all the Left options are strictly smaller than all the Right options, and
all those options are themselves numeric. In terms of combinatorial games, the numeric games have
"frozen"; you can only make your position worse by playing, and Left is some definite "number" of
moves ahead (or behind) Right.
A surreal number is an equivalence class of numeric games.
Surreal numbers inherit the relations ≤
and <
from games, and these relations satisfy the axioms
of a linear order. In fact, the surreals form a complete ordered field, containing a copy of the
reals, and much else besides!
Algebraic operations #
In this file, we show that the surreals form a linear ordered commutative group.
In CombinatorialGames.Surreal.Multiplication
, we define multiplication and show that the surreals
form a linear ordered commutative ring.
TODO #
- Prove that surreals with finite birthday are dyadic rationals.
- Build the embedding from reals into surreals.
- Define sign sequences.
Numeric games #
A game {s | t}ᴵ
is numeric if everything in s
is less than everything in t
, and all the
elements of these sets are also numeric.
The Surreal
numbers are built as the quotient of numeric games under equivalence.
- out : IGame.NumericAux✝ x
Instances
Alias of IGame.Numeric.isOption
.
To prove a game is numeric, it suffices to show the left options are less or fuzzy to the right options.
Simplicity theorem #
x
fits within y
when z ⧏ x
for every z ∈ y.leftMoves
, and y ⧏ z
for every
z ∈ y.rightMoves
.
The simplicity theorem states that if a game fits a numeric game, but none of its options do, then the games are equivalent. In particular, a numeric game is equivalent to the game of the least birthday that fits in it
Instances For
Alias of the reverse direction of IGame.fits_neg_iff
.
Surreal numbers #
The type of surreal numbers. These are the numeric games quotiented by the antisymmetrization
relation x ≈ y ↔ x ≤ y ∧ y ≤ x
. In the quotient, the order becomes a total order.
Equations
- Surreal = Antisymmetrization (Subtype IGame.Numeric) fun (x1 x2 : Subtype IGame.Numeric) => x1 ≤ x2
Instances For
Alias of the reverse direction of Surreal.mk_eq_mk
.
Choose an element of the equivalence class using the axiom of choice.
Equations
- x.out = ↑(Quotient.out x)
Instances For
Equations
- Surreal.instInhabited = { default := 0 }
Equations
- Surreal.instAdd = { add := Quotient.map₂ (fun (a b : Subtype IGame.Numeric) => ⟨↑a + ↑b, ⋯⟩) Surreal.instAdd._proof_2 }
Equations
- Surreal.instNeg = { neg := Quotient.map (fun (a : Subtype IGame.Numeric) => ⟨-↑a, ⋯⟩) Surreal.instNeg._proof_2 }
Equations
- Surreal.instPartialOrder = inferInstanceAs (PartialOrder (Antisymmetrization (Subtype IGame.Numeric) fun (x1 x2 : Subtype IGame.Numeric) => x1 ≤ x2))
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Casts a Surreal
number into a Game
.
Equations
- Surreal.toGame = { toFun := Quotient.lift (fun (x : Subtype IGame.Numeric) => Game.mk ↑x) Surreal.toGame._proof_1, inj' := Surreal.toGame._proof_2, map_rel_iff' := @Surreal.toGame._proof_3 }
Instances For
Surreal.toGame
as an OrderAddMonoidHom
Equations
- Surreal.toGameAddHom = { toFun := ⇑Surreal.toGame, map_zero' := Surreal.toGameAddHom._proof_1, map_add' := Surreal.toGameAddHom._proof_2, monotone' := Surreal.toGameAddHom._proof_3 }
Instances For
Construct a Surreal
from its left and right sets, and a proof that all elements from the left
set are less than all the elements of the right set.
This is given notation {s | t}ˢ
, where the superscript s
is to disambiguate from set builder
notation, and from the analogous constructors on IGame
and Game
. This notation will attempt to
construct the relevant proof using aesop
.
Note that although this function is well-defined, this function isn't injective, nor do equivalence classes in Surreal have a canonical representative. (Note however that every short numeric game has a unique "canonical" form!)
Equations
- Surreal.ofSets s t H = Surreal.mk {Surreal.out '' s | Surreal.out '' t}ᴵ
Instances For
Construct a Surreal
from its left and right sets, and a proof that all elements from the left
set are less than all the elements of the right set.
This is given notation {s | t}ˢ
, where the superscript s
is to disambiguate from set builder
notation, and from the analogous constructors on IGame
and Game
. This notation will attempt to
construct the relevant proof using aesop
.
Note that although this function is well-defined, this function isn't injective, nor do equivalence classes in Surreal have a canonical representative. (Note however that every short numeric game has a unique "canonical" form!)
Equations
- One or more equations did not get rendered due to their size.