Building Math from Ordered Pairs

Founding math with Sets

Ozaner Hansha
11 min readDec 22, 2017

Mathematics is not a large collection of unrelated fields and topics but in fact a large tree. Topics higher up rely on topics lower down. Calculus relies on algebra, which in turn relies on arithmetic which relies on numbers.

This is nice. It connects all of mathematics together and makes it all understandable, at least in theory, in terms of simpler concepts. But there is a problem with this: what’s at the bottom? What is the most basic math? What is the foundation of mathematics?

Set theory.

Sets are the most fundamental mathematical construct and they can be used to build all other math.

But what is set theory based on? Well it is defined by a list of 9 axioms or statements, called ZFC set theory. From these 9 axioms you can derive all of set theory and, as a result, all of mathematics as well.

Don’t worry you don’t have to understand what this means. Just know that whatever these are, they define all of math!

In this article I will focus on a particular mathematical object you can create from sets: an ordered pair. Using the ordered pair I will demonstrate how one might go about constructing more complicated mathematical objects like vectors, graphs, and functions. Different fields of math study different mathematical objects and so if you are able to build those objects from the same, simpler ones you would have, in essence, connected them together into one cohesive ‘mathematics’.

**Side Note: Just as a refresher a set is just a collection of objects (numbers, letters, equations, other sets, etc.) and is usually denoted with curly braces (ex. {5,4,3,6,7}).

The Ordered Pair

The ordered pair is a common tool used in math. It is one of the first things children learn about in their middle school classes on algebra and is most commonly used to describe a point on a graph:

Graph of y= √x with the point (4,2) highlighted.

But the ordered pair has far more use than that and is key in grounding many fields of mathematics to set theory. At its core this mathematical structure is like a set of 2 elements but with one key difference: order. The set {a,b}={b,a} but the ordered pair (a,b)≠(b,a).

So how do we define what an ordered pair is solely using unordered sets? As follows:

The Formal Definition of an Ordered Pair, P

This definition is unambiguous as the first element, a, is always the element that is in both sets and the second, b, is always the one that is in only one of the sets. Ordered pairs are also called 2-tuples.

Now before we move on let us try and define an ordered triplet, or 3-tuple. We could define it by extending the definition above to include 3 sets with a third containing a, b, and c, but that would end up getting to convoluted as we extend the definition to n-tuples (tuples with any number of elements). Instead we define the 3-tuple as follows:

The definition of an ordered triplet, P

As you can see a 3-tuple is just an ordered pair with the first element being another pair. From this it is easy to see how we might expand the definition of a 3-tuple to an n-tuple. Just place the last tuple as the first element in an ordered pair and repeat, adding a new element each time.

This expression can be further decomposed back into sets by using the definition of an ordered pair we established earlier, with the first element being (a,b) and the second being c:

The fully decomposed, set form of an ordered triplet (a,b,c)

As you can see this expression is unwieldy and hard to even look at. But that’s okay. The point of grounding mathematics in set theory was not to reduce all mathematical statements into these convoluted expressions, but to rest assured in the knowledge that we could if we wanted to. The ability to do so means that the math in question, in this case the ordered n-tuple, is describable and manipulable by the same basic axioms that all of set theory is based upon, thus grounding it.

Vectors, Matrices & Tensors

Vectors are used all over math, physics and computer science. In truth they are the same thing as ordered points: an ordered set of elements. There are a variety of names for them and the difference is solely connotative. Vectors usually denote physical quantities with directions in space (physicists), Arrays usually denote an ordered list of data (computer scientists), and n-tuples usually denote a point in space or just some set theoretic construct with order (mathematicians). We’ll use the term vector for this section as it is commonly associated with the terms ‘Matrix’, ‘Tensor’ and ‘Linear Algebra’. A vector can be written as follows:

The definition of a n-dimensional vector, v, is the same as an n-tuple. Sometimes arrow brackets are used instead of parenthesis.

Matrices are a common mathematical structure and are often used in conjunction with vectors. They can be defined in a way similar to n-tuples:

The definition of matrix, M, as a vector of vectors.

The definition above shows that you can consider an m×n matrix as a vector that has n vectors where each of those inner vectors has m elements.

Vectors and Matrices can actually be considered as one and the same of a more general structure: a Tensor. Tensors are the generalization of scalars, vectors and matrices. They are used in very advanced physics and engineering. Scalars are rank 0 tensors (a single number), vectors are rank 1 tensors (a 1D list of numbers), and matrices are rank 2 tensors (A 2D square of numbers). Here is an example of a rank 3 m×n×p tensor:

A rank 3 tensor, T, can be described as a vector of matrices.

As I mentioned before vectors, matrices, and tensors are all related to the field of Linear Algebra. So by constructing these objects in terms of ordered pairs, which are in turn constructed by sets, we have connected linear algebra (and all the other math that use vectors) to set theory.

Graph Theory

Graph theory studies the properties of graphs. These graphs are used to model everything from planning travel routes (cars, planes, trains), computer processing schedules, sociology (interactions between people), and even advanced physics and chemistry. Graphs in this sense are not plots of functions but a list of vertices and the edges that connect them. Something like this:

A graph with 8 vertices and 15 edges (I counted)

Defining graphs in terms of ordered points is straightforward. A graph is an ordered point (V, E) where V is a set of vertices and E is a set of edges. But what is a vertex and what is an edge? We have to define those in terms of sets as well.

A vertex is simply an element that represents a point, its common to use letters or numbers to denote them. An edge is a set of 2 vertices, the two that the edge connects together. Let’s do an example with a simpler graph:

A graph, which we’ll call G. It has 5 vertices and 5 edges.

Below is how we would define the graphs in terms of sets and ordered points:

The set theoretic definition of the graph above.

Here V is the set of vertices, E is the set of edges, and G is the graph itself (an ordered pair of these 2 sets. Since we know we could write out the full definition of G using just sets, by plugging in the sets and using the definition of an ordered pair, we know that graphs and graph theory can be founded upon set theory.

**Side note: Also notice how that E, the set of edges in the graph, contains only combinations of elements in V because it wouldn’t make sense to connect two vertices that were not on the graph. When a set is solely composed of elements of another set we call it a subset of that bigger set. In this case E is made up of subsets of V.

But hold on, you may already know this but there exist other types of graphs. One example is the directed graph. This type of graph is the same as before except this time every edge is pointed from one edge to another rather than just being connected. Here’s an example:

A directed graph, which we’ll call H. It has 5 vertices and 5 directed edges.

The only thing different about this graph is that the edges are pointed. This means that there should be an order to how we express the edges. We already have a tool to deal with that: ordered pairs! So all we have to change about our definition is that the edges are expressed as set of ordered pairs rather than sets:

The set theoretic definition of the directed graph above.

This example is the same as the previous one except that, in this case, the edges are ordered points rather than sets. The first element is where the arrow starts and the second where it ends.

There are other variations of graphs, like ones with multiple edges connecting the same vertices or even ones where the same edge connects multiple vertices. These may have slightly different definitions but their main concept stays the same: an ordered pair of a vertex set and edge set.

Cartesian Product

An useful operation we can perform on two sets is called the Cartesian product. The Cartesian product of two sets A and B is denoted A×B and is itself a set. To be more precise, it is the set of all combinations of ordered pairs with the first element being a member of A and the second a member of B. Here’s a diagram of how it works:

The Cartesian product (A×B) of the two sets A and B.

In the example above A and B are both 3 element sets and the set A×B is their Cartesian product.

As you can see, from just 3 elements in each set the product has 9 elements. As it turns out the size, or cardinality, of the Cartesian product of any two sets is the product of the cardinalities of the the two original sets, A and B. In this example A has cardinality 3 and so does B: 3×3=9.

Also note that repeated multiplication with other sets produce n-tuples, where n is the number of sets being multiplied together. For 3 sets, this would technically be denoted (A×B)×C, but we can also just write it as A×B×C.

A real world example of the Cartesian product might be if you want to know all the combinations of meals you can eat for breakfast, lunch and dinner. The set of all breakfast foods would be B, all lunch items L, and all dinner items D. Thus the Cartesian product B×L×D would result in a set of ordered triplets of all the combinations of meals you could have on a particular day.

4 points on the Cartesian plane

A more mathy example is the set of ordered pairs on the Cartesian plane, named René Descartes. This ‘Cartesian’ plane is actually a representation of the ‘Cartesian’ product of the real numbers with themselves. It’s usually denoted ℝ×ℝ or ℝ². Here ℝ stands for “real numbers” and is, in fact, an infinite set. Keep in mind that this doesn’t stop us from being able to take a Cartesian product with it. All that changes it that the resulting set will also be infinite.

This can, of course, be extended to any n-dimensional space representing the set ℝⁿ, which is the Cartesian product of the real numbers with itself n times over.

Functions

For this last section we will try to found functions on set theory. Functions are a staple of mathematics and extend to all fields, even set theory itself. The idea of transforming an input to produce an unique output is so broad that it can be applied to almost anything imaginable.

So how do we define functions in terms of sets? If you didn’t guess already the answer is, once again, ordered pairs. You see all functions have some defined domain of inputs. When plugged into the function, each of those inputs returns some output, all of which are members of the co-domain. Here is an example of a simple function:

A function, F, from X to Y

The function above, which we’ll call F, is a mapping from the set X to Y. We denote this with F: X →Y. The set X = {1,2,3,4} and is the domain, while the set Y = {D,B,C} and is the co-domain.

We can use this diagram to define F in terms of ordered pairs. Every input has exactly one output, so we’ll define F as the set of all ordered pairs with the first element being an input and the second its output:

The definition of the function shown above.

**Side Note: Notice that the first element is always a member of the domain and the second a member of the co-domain (this should come as no surprise as that’s their very definition). This means that the function F is a subset of the Cartesian product of the domain and co-domain.

This idea can be applied to any function even ones with an infinite domain. Take the function x² with the domain of the integers, denoted ℤ. That function would look like:

The set definition of the function x²

In the first line we are establishing that this function maps the set of integers to itself. So both the first and second elements of each pair will be integers. The second line just shows how we would write out these pairs for the function x², the second element is the first element squared.

Again, Why?

In the above sections I showed how one might construct things like vectors, matrices, graphs and functions out of sets and ordered pairs (which are also made of sets). These mathematical structures are what many fields of math are based upon and indeed all structures in math can undergo the same treatment of being constructed via sets.

But why?

As I said from the outset, the point of all of this is not to do math using complicated set definitions. It’s to prove to ourselves that math can arise from the simplest of conditions. Imagine, all of the formal sciences, derived from 9 axioms.

--

--

Ozaner Hansha

Interested in Machine Learning, Math, Quantum Computing, Philosophy, etc. My projects/notes are on https://ozaner.github.io