Surreal and natural numbers

After reading a recent post on Good Math, Bad Math concerning surreal numbers, I got to thinking about how to model these in Haskell. I came up with the following formulation:

data Surreal = Zero | Plus Surreal | Minus Surreal

… which also seems very similar to the usual construction for natural numbers:

data Nat = Zero | Succ Nat

(I noted this in a comment on the original post.)

This got me thinking about how this construction (the sign-expanded version) mapped onto the original construction of the surreal numbers, which uses a left and a right set:

data Surreal = Surreal [Surr] [Surr]

These types translate to the following (in order of appearance):

\begin{aligned}S &= 1 + S + S\\&= 1 + 2S\\N &= 1 + N\\S &= e^S \times e^S \\&= e^{2S}\end{aligned}

This last type is suggestive for the natural numbers as well, and of course there is a analogous construction for the naturals:

N = e^N

…which is a set-based construction for the naturals. (Note that in the above formulas multisets are used instead of true sets, but I don’t think this makes a difference in this context.)

Of course this raises the question of what is possible with three sets (or a 3-enum (3-num?)). More on this in another post.

Post a Comment

Your email is never published nor shared. Required fields are marked *