Documentation

CombinatorialGames.Surreal.Sign

Sign sequences #

One can define a sequence of approximations for any surreal number x, such that the n-th approximant is the number {s | t} where s and t are the numbers with birthday less than n which are lesser and greater to x, respectively. This yields an ordinal-indexed sequence of signs, where the n-th entry represents whether the n-th approximant to x is lesser, equal, or greater than x.

As it turns out, the correspondence between surreal numbers and sign sequences is both bijective and order-preserving, where the order given to sign sequences is the lexicographic ordering.

Todo #

Signs #

inductive Sign :

Represents a sign in a SignSeq, which is either plus, zero, or minus.

For convenience, and to avoid introducing more notation, we write for plus, 0 for zero, and for minus.

Instances For
    @[simp]
    @[simp]
    theorem Sign.zero_def :
    @[simp]
    Equations
    @[simp]
    @[simp]
    theorem Sign.neg_zero :
    -0 = 0
    @[simp]
    @[simp]
    theorem Sign.neg_eq_zero {x : Sign} :
    -x = 0 x = 0

    Turns a sign into an integer in the obvious way.

    Equations
    Instances For
      @[simp]
      @[simp]
      theorem Sign.toInt_zero :
      toInt 0 = 0
      @[simp]
      @[simp]
      theorem Sign.toInt_inj {x y : Sign} :
      x.toInt = y.toInt x = y

      Sign sequences #

      def SignSeq :
      Type (u + 1)

      A sign sequence is a sequence OrdinalSign, which is equal to 0 after some point, and only takes or as values before that point.

      Sign sequences are ordered lexicographically. We show that sign sequences are order-isomorphic to the surreal numbers.

      Equations
      Instances For
        def SignSeq.mk (s : Ordinal.{u}Sign) (l : Ordinal.{u}) (h : ∀ (o : Ordinal.{u}), s o = 0 l o) :

        Construct a sign sequence from a function.

        Equations
        Instances For
          @[simp]
          theorem SignSeq.get_mk (s : Ordinal.{u_1}Sign) (l : Ordinal.{u_1}) (h : ∀ (o : Ordinal.{u_1}), s o = 0 l o) (o : Ordinal.{u_1}) :
          (mk s l h)[o] = s o
          theorem SignSeq.ext {s t : SignSeq} (h : ∀ (o : Ordinal.{u_1}), s[o] = t[o]) :
          s = t
          theorem SignSeq.ext_iff {s t : SignSeq} :
          s = t ∀ (o : Ordinal.{u_1}), s[o] = t[o]

          The length of a sign sequence is the first ordinal o such that s[o] = 0.

          Equations
          Instances For
            @[simp]
            theorem SignSeq.length_eq_iff {s : SignSeq} {a : Ordinal.{u_1}} :
            s.length = a ∀ (o : Ordinal.{u_1}), s[o] = 0 a o
            @[simp]
            theorem SignSeq.length_mk (s : Ordinal.{u}Sign) (l : Ordinal.{u}) (h : ∀ (o : Ordinal.{u}), s o = 0 l o) :
            (mk s l h).length = l

            The constant 0 sequence.

            Equations
            @[simp]
            theorem SignSeq.get_zero (o : Ordinal.{u_1}) :
            0[o] = 0
            @[simp]

            The negative of a sign sequence is created by flipping all signs.

            Equations
            @[simp]
            theorem SignSeq.get_neg (s : SignSeq) (o : Ordinal.{u_1}) :
            (-s)[o] = -s[o]
            @[simp]

            Append two sequences by putting one after the other ends.

            Equations
            theorem SignSeq.get_append_of_lt (s t : SignSeq) {o : Ordinal.{u_1}} (h : o < s.length) :
            (s ++ t)[o] = s[o]
            theorem SignSeq.get_append_of_le (s t : SignSeq) {o : Ordinal.{u_1}} (h : s.length o) :
            (s ++ t)[o] = t[o - s.length]
            @[simp]
            theorem SignSeq.get_append_add (s t : SignSeq) (o : Ordinal.{u_1}) :
            (s ++ t)[s.length + o] = t[o]
            @[simp]
            theorem SignSeq.length_append (s t : SignSeq) :
            (s ++ t).length = s.length + t.length