During my self-study of pure mathematics, I have long wanted to write about how “number systems” such as the natural numbers , the integers , the rational numbers , and the real numbers are constructed, and particularly how they relate to one another.
One of the most elegant aspects of mathematics is using fundamental concepts to prove complex results—everything can be built up from a few simple axioms. For instance, one can construct the integers from the natural numbers , construct from , and construct from .
Have you ever wondered why holds true? We will understand this thoroughly in this blog post. Most of the content is taken from the book
To read this blog more effectively, you should pretend to forget everything you have learned about number systems—negative numbers, positive numbers, addition, subtraction, multiplication, division, etc. do not “exist” yet, and we will gradually define and prove these “known” concepts.
1. Natural Numbers
1.1. The Peano Axioms
The natural numbers constitute the most fundamental number system, and all other number systems are constructed from them. How can we define this fundamental number system as rigorously as possible? We will explore the
Axiom (Axiom 2.1)
is a natural number.
Axiom (Axiom 2.2)
If is a natural number, then is also a natural number. Here, denotes the operation of incrementing by one unit (also called the successor of ).
Definition (Definition 2.1.3)
We define to be the number , to be the number (or equivalently ), and similarly to be . More formally, .
We now have the first two axioms of the Peano axiom system. Here we can see that the natural numbers form a set consisting of and successive applications of the successor operation from (infinitely many times).
Now, to ensure you remember the axioms, try proving the following lemma yourself:
Lemma
Proof
Remember that we currently have only 2 axioms and 1 definition at our disposal; we can only use these three things to prove this lemma. First, by Definition 2.1.3, we have . By Axiom 2.1, is a natural number, and by Axiom 2.2, is also a natural number. Similarly, applying Axiom 2.2, is a natural number, and applying Axiom 2.2 once more, we obtain that is also a natural number. Thus, the lemma is proved.
However, the two axioms above are still insufficient. Suppose we have a number system consisting of where , and (a wrap-around). This number system still satisfies both axioms, but it contradicts our intuitive understanding of natural numbers. Therefore, we introduce the next axiom.
Axiom (Axiom 2.3)
is not the successor of any natural number. In other words, for every natural number .
After having three axioms, is the natural number system complete? The answer is no. Consider the following number system consisting of where , or in other words (). This number system “loops” at ; although it satisfies all three axioms, it still contradicts our understanding of natural numbers.
Axiom (Axiom 2.4)
Different natural numbers must have different successors; i.e., if are two natural numbers and , then . Equivalently, if , then .
With this axiom, our natural number system is closer to completion by eliminating “wrap-around” and “loop” behaviors, while also ensuring that numbers must be distinct. However, suppose we look slightly into the future (knowing about real numbers); then the number system
still satisfies all four axioms above. What we want here is for the Peano axioms to uniquely define a set and call that set the natural numbers. Furthermore, our number system should consist only of natural numbers and their successors, to exclude “intermediate” numbers like or .
Axiom (Axiom 2.5 (Principle of Mathematical Induction))
Let be any property pertaining to a natural number (for example, ” is even”). Suppose that is true, and suppose that whenever is true, is also true. Then is true for every natural number .
This may sound somewhat theoretical, but this is precisely how we exclude “outliers” (such as ) from the set of natural numbers. Let us return to the example of the number system above. This system satisfies all four previous axioms. How does Axiom 2.5 exclude the number system ? Suppose we have any property ; if is true, then is true; similarly, if is true, then is true, and so on. There is no way to conclude that or is true because there is no counting sequence (no application of ) that leads from any number to . Therefore, the system does not satisfy Axiom 2.5.
Definition (Natural Numbers)
There exists a number system in which the elements of are called natural numbers, and Axioms through hold in . We call Axioms through the Peano Axioms.
1.2. Addition on Natural Numbers
Definition (Definition 2.2.1: Addition)
Let be a natural number. To add to , we define . Now, suppose inductively that we have defined how to add to . Then we can add to by defining .
Proposition
If and are natural numbers, then is also a natural number.
Proof
For , we have , which is a natural number. Assume holds, so that is a natural number. We have (by Definition 2.2.1), which is also a natural number (by Axiom 2.2). Thus, by induction, Lemma 1 holds.
Lemma (Lemma 2.2.2)
For every natural number , .
Proof
If , then . Assume holds. Consider : we
have . Thus, by induction, the lemma holds.
Lemma (Lemma 2.2.3)
For every natural numbers and , .
Proof
If , then (by definition). Assume holds. We need to prove . For the left-hand side, we have (by the inductive hypothesis). For the right-hand side, we have (by the definition of addition), so both sides are equal. The lemma is proved.
Proposition
Proof
We have , so (by Lemmas 2.2.3 and 2.2.2).
Lemma (Lemma 2.2.4: Addition is Commutative)
For every natural numbers and , .
Proof
Consider : we have . Assume holds, so that . We need to prove . We have (by the definition and Lemma 2.2.3). Thus, the proposition is proved.
Lemma (Lemma 2.2.5: Addition is Associative)
For every natural numbers , we have .
Proof
Consider : we have and , so . Assume holds, so that . We need to prove . For the left-hand side, we see (by Lemma 2.2.3 and the inductive hypothesis). For the right-hand side, we have (by Lemma 2.2.3). Since the left and right sides are equal, the proposition holds.
Lemma (Lemma 2.2.6: Cancellation Law)
Let be natural numbers such that . Then .
Proof
Consider : we have and , so . Assume holds, so that . We need to prove . First, we have and , so by Axiom 2.4 and the inductive hypothesis, .
Definition (Definition 2.2.7)
A natural number is said to be positive if and only if (iff) it is not equal to .
This may feel exhausting with so many proofs, but since we are building nearly from scratch, whenever we need a property or rule (even if we already know it to be true), we must prove it using what we have established (the Peano axioms, the lemmas, and the propositions).
1.3. Multiplication on Natural Numbers
Definition (Definition 2.3.1)
Let be a natural number. To “multiply” by , we define . By assuming inductively that we have defined multiplication for , multiplication for is defined as follows:
We can see that multiplication is defined in terms of addition, and addition is defined in terms of the most fundamental axioms. This is an example of the hierarchical nature of mathematics: multiplication is built on addition, and exponentiation is built on multiplication. Additionally, we write instead of , and similarly instead of .
Lemma (Lemma 2.3.2 (Multiplication is Commutative))
Let be natural numbers. Then .
Proof
Here we will have two stages of proof. To apply induction, we must first prove the base case for , i.e., for all .
- We will prove , hence (by definition)
Consider : we see (by definition). Assume holds, i.e., for . Consider : we have (by definition). Therefore, for all .
- We will prove for all
Consider : we see (by the proof above). Assume holds, i.e., for . Consider : we have (by definition). Therefore, for all .
Proposition (Proposition 2.3.4 (Distributive Law))
For every natural numbers , we have and .
1.4. The Peano Axioms and Computer Science
We have just constructed the natural numbers from the Peano axioms. As we can see, this axiom system can be understood simply through “counting”. However, in 1931, Gödel showed that (and the Peano axioms) is powerful enough to encode all of logic within it. Nevertheless, this power is still insufficient: there exist true statements about that the Peano axioms cannot prove. This is known as Gödel’s Incompleteness Theorem. This theorem demonstrates that no set of axioms can “capture” all true statements of a number system.
Years later, Alan Turing applied Gödel’s ideas to define the limits of computation (through a formal system called the Turing machine). Turing proved that there exist problems that computers cannot and will never be able to solve. This is also the foundation of a rather “niche” field in computer science: Computability Theory and Complexity Theory. I recommend reading Introduction to the Theory of Computation by Michael Sipser to understand more about these topics (or wait for me to write more blog posts about this book 😳).
2. Integers
Having defined addition and the natural numbers , we can use these definitions to solve equations such as . However, suppose we want to solve the following equation:
We have two cases:
- If , then the solution and .
- If , then the solution does not exist in (e.g., ).
The integers were constructed to ensure that the equation always has a solution (fun fact: if you know the purpose of constructing the complex numbers , you will understand why—they were also constructed to ensure that the equation has a solution).
For this reason, we will define an integer as a pair where are natural numbers, such that is the solution to the equation (in other words, the integer is ).
- means .
- means .
However, different pairs such as and can define the same solution (which is ), so how do we define the equivalence between these two pairs?
More formally, let be the set consisting of all ordered pairs (ordered pair means is different from ). Then, we define a relation between two pairs and as follows:
In this definition, we avoid using subtraction; note that is equivalent to .
Definition (Equivalence Relation)
An equivalence relation on a set is a relation, denoted , satisfying the following properties: - Symmetry: .
- Reflexivity: .
- Transitivity: If and , then .
The relation that we defined above is an equivalence relation. Thus, we can define the equivalence between two pairs of “solutions” to the equations and .
Definition (Equivalence Class)
Let be an equivalence relation on . For , the equivalence class of is:
Sometimes we may write to specify the equivalence relation . A subset of is called an equivalence class if for some . An element is called a representative of .
An integer is an equivalence class under the relation (which we defined above). We define the set of all integers as . As per the definition above, an integer represented by a pair is denoted .
2.2. Operations on Integers
An integer is an equivalence class (a set of pairs), but when we compute, we take only one representative (a specific pair) to calculate with. We must ensure that our choice of representative from an equivalence class does not change the final result. This property is called well-definedness.
Example
Suppose we define a function with (in other words, for each representative of an equivalence class, we choose the first element of the pair). - Consider ; then .
- Consider ; we can see that because , so and are representatives of the same equivalence class.
- But , and since , the function is not well-defined.
Definition (Definition 3.2.1: Addition)
Let and be two integers. We define their sum as:
This corresponds to the usual logic: .
Definition (Definition 3.2.2: Negation and Subtraction)
The negation of an integer is defined as . We define subtraction as adding the negation: .
Definition (Definition 3.2.3: Multiplication)
Let and . We define their product as:
Why is the multiplication formula so “cumbersome”? Recall the basic knowledge learned in middle school (which we are pretending not to know): if we expand the expression , we get:
Converting to the equivalence class definition, the positive part is and the negative part is .
Note
We have constructed a new set , but where are the natural numbers that we already know? We need a way to “see” inside .
To do this, we proceed as follows:
- We identify the natural number with the integer .
- We identify the integer with the notation .
With this identification, we can abbreviate as . Consequently, becomes an extension of .
2.4. Some Facts About Integers
We constructed the integers using equivalence classes on pairs of natural numbers. If we apply equivalence classes once more but on modular congruence among integers, we obtain a new structure called Modular Arithmetic, denoted .
More advanced and important topics such as Elliptic Curves (used in Bitcoin and cryptography) operate on Modular Arithmetic rather than the ordinary integer system .
Additionally, finding integer solutions to equations is very important. There is a concept called Diophantine Equations, which are polynomial equations where the solutions must be integers. For example:
- is a Diophantine Equation with integer solutions (this is also the Pythagorean theorem; examples of satisfying triples include ).
- for has no integer solutions.
This is Fermat’s Last Theorem, and it took over 358 years until it was proved by Andrew Wiles in 1994.