Documentation

Mathlib.SetTheory.Surreal.Basic

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 (Surreal.instLE and Surreal.instLT), and these relations satisfy the axioms of a partial order.

Algebraic operations #

In this file, we show that the surreals form a linear ordered commutative group.

In Mathlib/SetTheory/Surreal/Multiplication.lean, we define multiplication and show that the surreals form a linear ordered commutative ring.

One can also map all the ordinals into the surreals!

TODO #

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.

Equations
    Instances For
      theorem SetTheory.PGame.numeric_def {x : PGame} :
      x.Numeric ↔ (βˆ€ (i : x.LeftMoves) (j : x.RightMoves), x.moveLeft i < x.moveRight j) ∧ (βˆ€ (i : x.LeftMoves), (x.moveLeft i).Numeric) ∧ βˆ€ (j : x.RightMoves), (x.moveRight j).Numeric
      theorem SetTheory.PGame.Numeric.mk {x : PGame} (h₁ : βˆ€ (i : x.LeftMoves) (j : x.RightMoves), x.moveLeft i < x.moveRight j) (hβ‚‚ : βˆ€ (i : x.LeftMoves), (x.moveLeft i).Numeric) (h₃ : βˆ€ (j : x.RightMoves), (x.moveRight j).Numeric) :
      theorem SetTheory.PGame.Numeric.isOption {x' x : PGame} (h : x'.IsOption x) (hx : x.Numeric) :
      theorem SetTheory.PGame.numeric_rec {C : PGame β†’ Prop} (H : βˆ€ (l r : Type u_1) (L : l β†’ PGame) (R : r β†’ PGame), (βˆ€ (i : l) (j : r), L i < R j) β†’ (βˆ€ (i : l), (L i).Numeric) β†’ (βˆ€ (i : r), (R i).Numeric) β†’ (βˆ€ (i : l), C (L i)) β†’ (βˆ€ (i : r), C (R i)) β†’ C (mk l r L R)) (x : PGame) :
      x.Numeric β†’ C x

      Relabellings preserve being numeric.

      theorem SetTheory.PGame.lf_asymm {x y : PGame} (ox : x.Numeric) (oy : y.Numeric) :
      x.LF y β†’ Β¬y.LF x
      theorem SetTheory.PGame.le_of_lf {x y : PGame} (h : x.LF y) (ox : x.Numeric) (oy : y.Numeric) :
      theorem SetTheory.PGame.LF.le {x y : PGame} (h : x.LF y) (ox : x.Numeric) (oy : y.Numeric) :

      Alias of SetTheory.PGame.le_of_lf.

      theorem SetTheory.PGame.lt_of_lf {x y : PGame} (h : x.LF y) (ox : x.Numeric) (oy : y.Numeric) :
      x < y
      theorem SetTheory.PGame.LF.lt {x y : PGame} (h : x.LF y) (ox : x.Numeric) (oy : y.Numeric) :
      x < y

      Alias of SetTheory.PGame.lt_of_lf.

      theorem SetTheory.PGame.lf_iff_lt {x y : PGame} (ox : x.Numeric) (oy : y.Numeric) :
      x.LF y ↔ x < y
      theorem SetTheory.PGame.le_iff_forall_lt {x y : PGame} (ox : x.Numeric) (oy : y.Numeric) :
      x ≀ y ↔ (βˆ€ (i : x.LeftMoves), x.moveLeft i < y) ∧ βˆ€ (j : y.RightMoves), x < y.moveRight j

      Definition of x ≀ y on numeric pre-games, in terms of <

      theorem SetTheory.PGame.lt_iff_exists_le {x y : PGame} (ox : x.Numeric) (oy : y.Numeric) :
      x < y ↔ (βˆƒ (i : y.LeftMoves), x ≀ y.moveLeft i) ∨ βˆƒ (j : x.RightMoves), x.moveRight j ≀ y

      Definition of x < y on numeric pre-games, in terms of ≀

      theorem SetTheory.PGame.lt_of_exists_le {x y : PGame} (ox : x.Numeric) (oy : y.Numeric) :
      ((βˆƒ (i : y.LeftMoves), x ≀ y.moveLeft i) ∨ βˆƒ (j : x.RightMoves), x.moveRight j ≀ y) β†’ x < y
      theorem SetTheory.PGame.lt_def {x y : PGame} (ox : x.Numeric) (oy : y.Numeric) :
      x < y ↔ (βˆƒ (i : y.LeftMoves), (βˆ€ (i' : x.LeftMoves), x.moveLeft i' < y.moveLeft i) ∧ βˆ€ (j : (y.moveLeft i).RightMoves), x < (y.moveLeft i).moveRight j) ∨ βˆƒ (j : x.RightMoves), (βˆ€ (i : (x.moveRight j).LeftMoves), (x.moveRight j).moveLeft i < y) ∧ βˆ€ (j' : y.RightMoves), x.moveRight j < y.moveRight j'

      The definition of x < y on numeric pre-games, in terms of < two moves later.

      theorem SetTheory.PGame.insertLeft_numeric {x x' : PGame} (x_num : x.Numeric) (x'_num : x'.Numeric) (h : x' ≀ x) :

      Inserting a smaller numeric left option into a numeric game results in a numeric game.

      theorem SetTheory.PGame.insertRight_numeric {x x' : PGame} (x_num : x.Numeric) (x'_num : x'.Numeric) (h : x ≀ x') :

      Inserting a larger numeric right option into a numeric game results in a numeric game.

      @[irreducible]
      theorem SetTheory.PGame.Numeric.add {x y : PGame} :
      x.Numeric β†’ y.Numeric β†’ (x + y).Numeric
      theorem SetTheory.PGame.numeric_nat (n : β„•) :
      (↑n).Numeric

      Pre-games defined by natural numbers are numeric.

      def Surreal :
      Type (u_1 + 1)

      The type of surreal numbers. These are the numeric pre-games quotiented by the equivalence relation x β‰ˆ y ↔ x ≀ y ∧ y ≀ x. In the quotient, the order becomes a total order.

      Equations
        Instances For

          Construct a surreal number from a numeric pre-game.

          Equations
            Instances For
              theorem Surreal.mk_eq_mk {x y : SetTheory.PGame} {hx : x.Numeric} {hy : y.Numeric} :
              mk x hx = mk y hy ↔ x β‰ˆ y
              def Surreal.lift {Ξ± : Sort u_1} (f : (x : SetTheory.PGame) β†’ x.Numeric β†’ Ξ±) (H : βˆ€ {x y : SetTheory.PGame} (hx : x.Numeric) (hy : y.Numeric), x.Equiv y β†’ f x hx = f y hy) :
              Surreal β†’ Ξ±

              Lift an equivalence-respecting function on pre-games to surreals.

              Equations
                Instances For
                  def Surreal.liftβ‚‚ {Ξ± : Sort u_1} (f : (x : SetTheory.PGame) β†’ (y : SetTheory.PGame) β†’ x.Numeric β†’ y.Numeric β†’ Ξ±) (H : βˆ€ {x₁ : SetTheory.PGame} {y₁ : SetTheory.PGame} {xβ‚‚ : SetTheory.PGame} {yβ‚‚ : SetTheory.PGame} (ox₁ : x₁.Numeric) (oy₁ : y₁.Numeric) (oxβ‚‚ : xβ‚‚.Numeric) (oyβ‚‚ : yβ‚‚.Numeric), x₁.Equiv xβ‚‚ β†’ y₁.Equiv yβ‚‚ β†’ f x₁ y₁ ox₁ oy₁ = f xβ‚‚ yβ‚‚ oxβ‚‚ oyβ‚‚) :
                  Surreal β†’ Surreal β†’ Ξ±

                  Lift a binary equivalence-respecting function on pre-games to surreals.

                  Equations
                    Instances For
                      @[simp]
                      theorem Surreal.mk_le_mk {x y : SetTheory.PGame} {hx : x.Numeric} {hy : y.Numeric} :
                      mk x hx ≀ mk y hy ↔ x ≀ y
                      theorem Surreal.mk_lt_mk {x y : SetTheory.PGame} {hx : x.Numeric} {hy : y.Numeric} :
                      mk x hx < mk y hy ↔ x < y
                      theorem Surreal.mk_moveLeft_lt_mk {x : SetTheory.PGame} (o : x.Numeric) (i : x.LeftMoves) :
                      mk (x.moveLeft i) β‹― < mk x o

                      Same as moveLeft_lt, but for Surreal instead of PGame

                      theorem Surreal.mk_lt_mk_moveRight {x : SetTheory.PGame} (o : x.Numeric) (j : x.RightMoves) :
                      mk x o < mk (x.moveRight j) β‹―

                      Same as lt_moveRight, but for Surreal instead of PGame

                      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

                        Negation for surreal numbers is inherited from pre-game negation: the negation of {L | R} is {-R | -L}.

                        Equations
                          theorem Surreal.mk_add {x y : SetTheory.PGame} (hx : x.Numeric) (hy : y.Numeric) :
                          mk (x + y) β‹― = mk x hx + mk y hy
                          theorem Surreal.mk_sub {x y : SetTheory.PGame} (hx : x.Numeric) (hy : y.Numeric) :
                          mk (x - y) β‹― = mk x hx - mk y hy

                          Casts a Surreal number into a Game.

                          Equations
                            Instances For
                              @[simp]
                              theorem Surreal.nat_toGame (n : β„•) :
                              toGame ↑n = ↑n
                              theorem Surreal.bddAbove_range_of_small {ΞΉ : Type u_1} [Small.{u, u_1} ΞΉ] (f : ΞΉ β†’ Surreal) :

                              A small family of surreals is bounded above.

                              A small set of surreals is bounded above.

                              theorem Surreal.bddBelow_range_of_small {ΞΉ : Type u_1} [Small.{u, u_1} ΞΉ] (f : ΞΉ β†’ Surreal) :

                              A small family of surreals is bounded below.

                              A small set of surreals is bounded below.

                              Converts an ordinal into the corresponding surreal.

                              Equations
                                Instances For