In our previous post, we provided a literary prologue to the study of universal structures, objects that, in a sense, “contain” all other objects of the same type. Today, we return to the world of mathematics to look at a fascinating concrete example of such a universal structure.
The mathematical objects we will be working with are graphs, which we briefly introduced in our Ultrafilters series. Recall that a graph is a set of vertices and a set of edges, where each edge connects two distinct vertices. For example:

A graph is often represented as a pair
, where
is the set of vertices and
is the set of edges. An edge is represented by a set containing the two vertices it connects. If
and
are two graphs, then we say that
embeds into
if there is a function
such that:
- for all
, if
, then
;
- for all
, if
, then
;
- for all
, if
, then
;
One can think of the statement “ embeds into
” as saying that “
contains a copy of
.” To really understand this idea, try the following exercise.
Exercise: Every graph with three vertices embeds into the graph pictured above.
In light of this exercise, we might be tempted to say that the graph we have drawn above is universal for graphs with three vertices. However, we are cheating a little bit, since our graph has more than three vertices itself. We would really like for a universal object to itself be a member of the class for which it is universal; otherwise, finding universal objects is too easy! A bit of thought should convince you that, with this more stringent definition of “universal,” no graph that is universal for a meaningful class of graphs can be finite (the word “meaningful” here is just meant to rule out whatever trivial examples you can think of).
We therefore will waste no time trying to find finite universal graphs and will instead move on to the next step: graphs with a countable infinity of vertices. And here we will succeed: we will find a graph with countably many vertices such that, for every graph
with countably many vertices,
embeds into
. What’s more, we will succeed with a wonderfully interesting graph: the random graph.
One commonly cited criterion for an idea or an object to possess mathematical beauty is that it arise independently in a variety of different contexts, in a variety of guises that are only revealed to be identical upon close inspection. By this accounting, I would say that the random graph is quite beautiful indeed. Let us give just a few descriptions of this graph.
1: Hereditarily finite sets. For a set , the transitive closure of
is, roughly, the set consisting of all elements of
, all elements of elements of
, all elements of elements of elements of
, and so on. It is quite possible that a set
is finite but its transitive closure is infinite (consider, for example, the set whose one element is the set of all natural numbers). A set is called hereditarily finite if its transitive closure is finite. Assuming that all sets are built up from the empty set, one can prove that there are only countably many hereditarily finite sets. Moreover, if
is a natural numbers and
are hereditarily finite sets, then
is a hereditarily finite set. Now form a graph
by letting
be the set of all hereditarily finite sets and, for all
, letting
if and only if either
or
.
2: Binary expansion. We typically write natural numbers in base 10, or decimal, notation, but one could just as well write them in base 2, or binary, notation, using only 0s and 1s. I will assume the reader is at least passingly familiar with this. As a brief refresher, recall that, in binary notation, 1 is 1, 2 is 10, 3 is 11, 4 is 100, 5 is 101, and so on. We define a graph such that
is the set of natural numbers. If
are natural numbers, then we put an edge between
and
if and only if the
digit (from the right, starting with 0) in the binary expansion of
is 1. For example, the number 10 in binary is 1010. Therefore, there is no edge between 0 and 10 or 2 and 10 but there is an edge between 1 and 10 and between 3 and 10. If
, then there is no edge between
and 10 because the binary expansion of 10 only has 4 digits.

3: Coin flipping. We will define a graph probabilistically, where
is the set of natural numbers. For each pair of natural numbers
, we will flip a fair coin. If the coin lands heads, we put an edge between
and
. If it lands tails, we do not put an edge between
and
.
4: Quadratic residues. If and
are natural numbers, we say that
is a quadratic residue modulo
if there is a natural number
such that
is divisible by
. We define a graph
such that
is the set of all prime numbers that leave a remainder of 1 when divided by 4. It is an elementary fact of number theory that there are infinitely many such prime numbers. If
are two elements of
, then we put an edge between
and
if and only if
is a quadratic residue modulo
or
is a quadratic residue modulo
.
5: Fraïssé limit. Let be the Fraïssé limit of the class of finite graphs. I am not going to explain this further; I just wanted to use the phrase “Fraïssé limit.”
One of the almost miraculous aspects of our story is that all five of these graphs are the same, and we shall refer to all of them as “the random graph.” Before we go any further, though, I should explain what I mean by “the same,” since these graphs are not literally “the same” (some of them don’t even have the same sets of vertices). By “the same” we mean isomorphic, or “structurally the same,” in the way in which we would say that any two graphs with three vertices and edges between all three vertices are “the same.” More precisely, if and
we say that
and
are “the same” (or isomorphic) if there is a one-to-one correspondence (i.e., a bijection)
such that, for all
, we have
if and only if
. The point is that the way in which we label the vertices of a graph is immaterial to the actual structural properties of the graph, which are what we care about.
Now, how can we show that all of these graphs are the same? We show that all of the graphs have a very special property, and that all countable graphs with this property are isomorphic. This property is called the extension property.
Definition: A graph satisfies the extension property if, for all finite subsets
with
, there is a vertex
such that:
;
- for all
, we have
;
- for all
, we have
.
I will leave the verification that all five of our graphs have the extension property as an exercise. For graphs 1 and 2, this is pretty easy. For graph 3, since the definition of the graph is probabilistic, it is conceivable (just ask Rosencrantz and Guildenstern) that every coin flip somehow comes up heads, in which case the graph would obviously not satisfy the extension property. However, the graph will satisfy the extension property with probability 1, so we can be almost sure. The fact that graph 4 satisfies the extension property follows from the Chinese Remainder Theorem and Dirichlet’s theorem about primes in arithmetic progressions, two somewhat non-trivial theorems from number theory.
Theorem: Suppose and
are two countably infinite graphs with the extension property. Then
and
are isomorphic.
Proof sketch: Since and
are countable, we can enumerate
as
and
as
. We will construct an isomorphism
in infinitely many steps by defining
on more and more elements of
.
Suppose is a natural number. We now describe Step
of the construction. Assume that we have already defined
on finitely many elements of
in such a way that
is thus far an isomorphism, i.e., for all pairs
on which
is thus far defined, we have
and
if and only if
. Suppose moreover that, for all
,
is defined on
and there is
such that
is defined on
and
.
We now extend so that it is defined on
. If it happens to be the case that it is already defined on
, then we have nothing to do. Otherwise, let
be the set of vertices on which
is thus far defined. Let
be the set of vertices in
to which
is connected by an edge, and let
be the set of vertices in
to which
is not connected. Let
and
. Since
satisfies the extension property, we can find
such that:
;
- for all
, we have
;
- for all
, we have
.
Let . Next, we extend
so that
is in its image. If there is already
such that
, then there is nothing to do. Otherwise, let
be the set of
such that, for some
, we have
. Let
and
. Let
and
. Since
satisfies the extension property, we can find
such that:
;
- for all
, we have
;
- for all
, we have
.
Let . This completes Step
of the construction. Continuing through all of the steps, one for each natural number, we find that we have constructed a full isomorphism from
to
, thus completing the proof of the theorem.
The theorem shows that we are justified in referring to the random graph rather than a random graph. Up to isomorphism (and with probability 1), all of the graphs we have called “the random graph” are the same! Essentially the same proof as that given above shows that every countable graph embeds into the random graph (Exercise: Do it!). Thus, the random graph can truly be said to be universal for the class of countable graphs.
P.S. To what extent do these ideas generalize to higher infinities? Assuming some assumptions about cardinal arithmetic, they generalize quite straightforwardly. If is an infinite cardinal and
, then it is meaningful to talk about the “random graph of size
,” and this graph will be universal for graphs of size
. However, the assumption
is not necessarily true for uncountable cardinals. In fact, it is consistent with the axioms of set theory that there are no universal graphs of size
. The question of the existence of universal graphs becomes especially interesting at cardinals of the form
, where
is a singular cardinal; much work has been done even in the last few years on this topic.
