Numbers Reborn

The real numbers and Conway’s surreals rebuilt as data types — the foundation Conway asked for in 1976

Numbers Reborn

Turn the machinery of higher inductive types on the number systems themselves. Declaring what exists and when two things are equal, in one definition, builds the reals, the surreals, and a world where isomorphic groups are equal.

The Number Line as a Data Type

Ask for a precision and watch the funnel close on a point. Then tighten the tolerance until two approximations fuse into one real number.

rat : ℚ → ℝ
every rational is a real
lim : Cauchy → ℝ
every Cauchy approximation has a limit
eq : (∀ε. x ∼ε y) → x = y
closer than every ε means equal
Each request drops a rat point with its ε error bar. Keep tightening: once the funnel is converging, the lim constructor will claim the point it is squeezing down onto.
Go deeper:Declaring the Continuum

A real number is one of two things: a rational, or the limit of a Cauchy approximation — a function that, for any precision you name, hands you a rational that close to the answer. And then a path constructor settles equality up front: two reals are equal when they are within epsilon of each other for every epsilon. No quotient afterwards, no axiom of countable choice needed to climb back out of one. What you get is the free complete metric space on the rationals, and the construction is new enough that it was unfamiliar to classical mathematicians too.

The recursion principle is the part that will feel familiar to anyone who has taken analysis. To define a function on the reals you give its values on rationals, give its behaviour on limits, and check that it respects closeness. That is precisely the old slogan — define it on the rationals and extend by continuity — except it has stopped being advice about how to organize a proof and become the literal elimination rule of the type.

Born on Day Omega

Scrub through the days and watch the surreal numbers be born. Then jump past every finite day to meet omega.

Day:7 numbers born so far
-2-10120-11-2-1/21/22d0d1d2
Hover or click a number to see its defining cut { L | R }. Every surreal number is nothing but a cut between two sets of earlier-born numbers — day 0 births 0 from the empty cut, and each new day fills every gap and extends both ends.

One construction, one number system: the dyadic fractions arrive on finite days, every real number arrives by day ω, and the infinite ordinals keep going after that — the reals and the ordinals living side by side, with ω − 1 and 1/ω in the gaps between them.

Go deeper:Conway’s Complaint, Answered

A surreal number is a cut: a pair of collections of numbers born earlier, with everything on the left strictly below everything on the right. That is the entire definition, and it generates an astonishing range. After all the finite days come omega, larger than every integer; one over omega, positive but smaller than every ordinary fraction; omega minus one, which is a perfectly respectable number; and omega over two. The real numbers embed in this system. So do the infinite ordinals. One number line holding both.

Here is where the module closes a loop it opened at the start. In 1976 Conway observed that every set-theoretic formalization of his numbers came out curiously complicated, and said what he actually wanted was a foundation that let you create objects freely and then stipulate what equality means for them. He wrote that down and waited. Higher inductive types are, almost verbatim, the thing he asked for: his habit of defining the numbers first and their equality afterwards is exactly a path constructor, and the quotient he had to hand-roll disappears into the definition.

One Point per Isomorphism Class

Match the elements of two presentations of one group, and watch univalence merge them into a single point.

0/4 matched
(ℤ₄, +) — numbers mod 4
+0123
00123
11230
22301
33012
(Rot □, ∘) — rotations of a square, r = quarter turn
∘err²r³
eerr²r³
rrr²r³e
r²r²r³er
r³r³err²
the space of all groupsℤ₁ℤ₂ℤ₃ℤ₅ℤ₆V₄S₃(ℤ₄, +)(Rot □, ∘)ℤ₄ — one point
Click a number on the left, then the rotation it should become — or press auto-match. Four matches define a candidate map φ : ℤ₄ → Rot □, and the space of groups on the right is waiting to see whether it respects the two tables.

The type of groups has one point per isomorphism class, so every property and construction that can be written down automatically respects isomorphism. Note that V₄ keeps its own point: it has four elements too, but no matching of tables exists — merging is earned by isomorphism, never by size.

Go deeper:Where the Whole Arc Lands

The structure identity principle is the general statement behind the last demo: for any reasonable notion of structure — groups, rings, ordered sets, topological spaces — isomorphic instances are equal. It is a theorem, not a convention, and it climbs a level: with the right definition of category, equivalent categories are equal too. The type of groups genuinely has one point per isomorphism class, and so every construction you can express automatically respects isomorphism. You cannot even state a property that distinguishes isomorphic groups.

That is the whole arc in one sentence. Equality became a space rather than a verdict. Univalence widened it until it matched equivalence. Higher inductive types let us declare objects and their equality in the same breath — a circle from one point and one loop, the continuum from three constructors, and a number system in which the reals and the ordinals finally sit on the same line.

See also: Category Theory for universal properties in their own right, Set Theory for the foundation this one is offered as an alternative to, and Real Analysis for the classical continuum.

Key Takeaways

  • A real number is a rational or a limit, plus a path saying when two are equal.
  • Defining equality alongside the objects removes the need for choice.
  • The surreals contain the reals and the infinite ordinals in one system.
  • With univalence, the type of groups has one point per isomorphism class.

Spot a mistake or have an idea?

Search