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. In CombinatorialGames.Surreal.Division we further show the
surreals are a field.
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.
- of_NumericAux :: (
- out : IGame.NumericAux✝ x
- )
Instances
numeric eagerly adds all possible Numeric hypotheses.
Equations
- IGame.Numeric.tacticNumeric = Lean.ParserDescr.node `IGame.Numeric.tacticNumeric 1024 (Lean.ParserDescr.nonReservedSymbol "numeric" false)
Instances For
Alias of IGame.Numeric.isOption.
Simplicity theorem #
x fits within y when z ⧏ x for every z ∈ yᴸ, and x ⧏ z for every
z ∈ yᴿ.
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
Equations
- x.Fits y = ((∀ z ∈ IGame.moves Player.left y, ¬x ≤ z) ∧ ∀ z ∈ IGame.moves Player.right y, ¬z ≤ x)
Instances For
Alias of IGame.fits_of_equiv.
Alias of the reverse direction of IGame.fits_neg_iff.
A specialization of the simplicity theorem to 0.
A specialization of the simplicity theorem to 1.
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.
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.