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 pregames.
In fact, the surreals form a complete ordered field, containing a copy of the reals (and much else besides!) but we do not yet have a complete development.
Order properties #
Surreal numbers inherit the relations ≤ and < from games, and these relations satisfy the axioms
of a partial order (recall that x < y ↔ x ≤ y ∧ ¬ y ≤ x did not hold for games).
Algebraic operations #
We show that the surreals form a linear ordered commutative group.
One can also map all the ordinals into the surreals!
Multiplication of surreal numbers #
The definition of multiplication for surreal numbers is surprisingly difficult and is currently missing in the library. A sample proof can be found in Theorem 3.8 in the second reference below. The difficulty lies in the length of the proof and the number of theorems that need to proven simultaneously. This will make for a fun and challenging project.
References #
A pre-game is numeric if everything in the L set is less than everything in the R set, and all the elements of L and R are also numeric.
Pre-games defined by natural numbers are numeric.
The equivalence on numeric pre-games.
Equations
- surreal.equiv x y = x.val.equiv y.val
Construct a surreal number from a numeric pre-game.
Equations
- surreal.mk x h = ⟦⟨x, h⟩⟧
Equations
- surreal.has_zero = {zero := ⟦⟨0, pgame.numeric_zero⟩⟧}
Equations
- surreal.has_one = {one := ⟦⟨1, pgame.numeric_one⟩⟧}
Equations
- surreal.inhabited = {default := 0}
Lift an equivalence-respecting function on pre-games to surreals.
Equations
- surreal.lift f H = quotient.lift (λ (x : {x // x.numeric}), f x.val _) _
Lift a binary equivalence-respecting function on pre-games to surreals.
Equations
- surreal.lift₂ f H = surreal.lift (λ (x : pgame) (ox : x.numeric), surreal.lift (λ (y : pgame) (oy : y.numeric), f x y ox oy) _) _
The relation x ≤ y on surreals.
Equations
- surreal.le = surreal.lift₂ (λ (x y : pgame) (_x : x.numeric) (_x : y.numeric), x ≤ y) surreal.le._proof_1
The relation x < y on surreals.
Equations
- surreal.lt = surreal.lift₂ (λ (x y : pgame) (_x : x.numeric) (_x : y.numeric), x < y) surreal.lt._proof_1
Addition on surreals is inherited from pre-game addition:
the sum of x = {xL | xR} and y = {yL | yR} is {xL + y, x + yL | xR + y, x + yR}.
Equations
- surreal.add = surreal.lift₂ (λ (x y : pgame) (ox : x.numeric) (oy : y.numeric), ⟦⟨x + y, _⟩⟧) surreal.add._proof_1
Negation for surreal numbers is inherited from pre-game negation:
the negation of {L | R} is {-R | -L}.
Equations
- surreal.neg = surreal.lift (λ (x : pgame) (ox : x.numeric), ⟦⟨-x, _⟩⟧) surreal.neg._proof_1
Equations
- surreal.has_le = {le := surreal.le}
Equations
- surreal.has_lt = {lt := surreal.lt}
Equations
Equations
Equations
- surreal.ordered_add_comm_group = {add := has_add.add surreal.has_add, add_assoc := surreal.ordered_add_comm_group._proof_1, zero := 0, zero_add := surreal.ordered_add_comm_group._proof_2, add_zero := surreal.ordered_add_comm_group._proof_3, nsmul := add_comm_group.nsmul._default 0 has_add.add surreal.ordered_add_comm_group._proof_4 surreal.ordered_add_comm_group._proof_5, nsmul_zero' := surreal.ordered_add_comm_group._proof_6, nsmul_succ' := surreal.ordered_add_comm_group._proof_7, neg := has_neg.neg surreal.has_neg, sub := add_comm_group.sub._default has_add.add surreal.ordered_add_comm_group._proof_8 0 surreal.ordered_add_comm_group._proof_9 surreal.ordered_add_comm_group._proof_10 (add_comm_group.nsmul._default 0 has_add.add surreal.ordered_add_comm_group._proof_4 surreal.ordered_add_comm_group._proof_5) surreal.ordered_add_comm_group._proof_11 surreal.ordered_add_comm_group._proof_12 has_neg.neg, sub_eq_add_neg := surreal.ordered_add_comm_group._proof_13, zsmul := add_comm_group.zsmul._default has_add.add surreal.ordered_add_comm_group._proof_14 0 surreal.ordered_add_comm_group._proof_15 surreal.ordered_add_comm_group._proof_16 (add_comm_group.nsmul._default 0 has_add.add surreal.ordered_add_comm_group._proof_4 surreal.ordered_add_comm_group._proof_5) surreal.ordered_add_comm_group._proof_17 surreal.ordered_add_comm_group._proof_18 has_neg.neg, zsmul_zero' := surreal.ordered_add_comm_group._proof_19, zsmul_succ' := surreal.ordered_add_comm_group._proof_20, zsmul_neg' := surreal.ordered_add_comm_group._proof_21, add_left_neg := surreal.ordered_add_comm_group._proof_22, add_comm := surreal.ordered_add_comm_group._proof_23, le := has_le.le surreal.has_le, lt := has_lt.lt surreal.has_lt, le_refl := surreal.ordered_add_comm_group._proof_24, le_trans := surreal.ordered_add_comm_group._proof_25, lt_iff_le_not_le := surreal.ordered_add_comm_group._proof_26, le_antisymm := surreal.ordered_add_comm_group._proof_27, add_le_add_left := surreal.ordered_add_comm_group._proof_28}
Equations
- surreal.linear_ordered_add_comm_group = {add := ordered_add_comm_group.add surreal.ordered_add_comm_group, add_assoc := _, zero := ordered_add_comm_group.zero surreal.ordered_add_comm_group, zero_add := _, add_zero := _, nsmul := ordered_add_comm_group.nsmul surreal.ordered_add_comm_group, nsmul_zero' := _, nsmul_succ' := _, neg := ordered_add_comm_group.neg surreal.ordered_add_comm_group, sub := ordered_add_comm_group.sub surreal.ordered_add_comm_group, sub_eq_add_neg := _, zsmul := ordered_add_comm_group.zsmul surreal.ordered_add_comm_group, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, le := ordered_add_comm_group.le surreal.ordered_add_comm_group, lt := ordered_add_comm_group.lt surreal.ordered_add_comm_group, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, le_total := surreal.linear_ordered_add_comm_group._proof_1, decidable_le := classical.dec_rel has_le.le, decidable_eq := linear_order.decidable_eq._default ordered_add_comm_group.le ordered_add_comm_group.lt ordered_add_comm_group.le_refl ordered_add_comm_group.le_trans ordered_add_comm_group.lt_iff_le_not_le ordered_add_comm_group.le_antisymm (classical.dec_rel has_le.le), decidable_lt := linear_order.decidable_lt._default ordered_add_comm_group.le ordered_add_comm_group.lt ordered_add_comm_group.le_refl ordered_add_comm_group.le_trans ordered_add_comm_group.lt_iff_le_not_le ordered_add_comm_group.le_antisymm (classical.dec_rel has_le.le), max := linear_order.max._default ordered_add_comm_group.le ordered_add_comm_group.lt ordered_add_comm_group.le_refl ordered_add_comm_group.le_trans ordered_add_comm_group.lt_iff_le_not_le ordered_add_comm_group.le_antisymm (classical.dec_rel has_le.le), max_def := surreal.linear_ordered_add_comm_group._proof_2, min := linear_order.min._default ordered_add_comm_group.le ordered_add_comm_group.lt ordered_add_comm_group.le_refl ordered_add_comm_group.le_trans ordered_add_comm_group.lt_iff_le_not_le ordered_add_comm_group.le_antisymm (classical.dec_rel has_le.le), min_def := surreal.linear_ordered_add_comm_group._proof_3}