🍐 nguyen
Overview

A Little Bit About "Numbers" and "Mathematics" Part 1: Natural Numbers and Integers

January 3, 2026
16 min read
index

During my self-study of pure mathematics, I have long wanted to write about how “number systems” such as the natural numbers N\mathbb{N}, the integers Z\mathbb{Z}, the rational numbers Q\mathbb{Q}, and the real numbers R\mathbb{R} 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 Z\mathbb{Z} from the natural numbers N\mathbb{N}, construct Q\mathbb{Q} from Z\mathbb{Z}, and construct R\mathbb{R} from Q\mathbb{Q}.

Have you ever wondered why a(b+c)=ab+aca(b + c) = ab + ac holds true? We will understand this thoroughly in this blog post. Most of the content is taken from the book Analysis I by Terence Tao [] (this is an excellent book, though somewhat challenging for self-learners like myself, so having assistance from Gemini 3.0 Pro or Claude Opus 4.5 can be helpful).

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 Peano Axioms, a set of axioms used to define the natural numbers, introduced by Giuseppe Peano.

Axiom (Axiom 2.1)

00 is a natural number.

Axiom (Axiom 2.2)

If nn is a natural number, then S(n)S(n) is also a natural number. Here, S(n)S(n) denotes the operation of incrementing nn by one unit (also called the successor of nn).

Definition (Definition 2.1.3)

We define 11 to be the number S(0)S(0), 22 to be the number S(S(0))S(S(0)) (or equivalently S(1)S(1)), and similarly 33 to be S(S(S(0)))S(S(S(0))). More formally, 1S(0),2S(S(0)),3S(S(S(0))),1 \coloneqq S(0), 2 \coloneqq S(S(0)), 3 \coloneqq S(S(S(0))), \ldots.

We now have the first two axioms of the Peano axiom system. Here we can see that the natural numbers N\mathbb{N} form a set consisting of 00 and successive applications of the successor operation from 00 (infinitely many times).

N={0,S(0),S(S(0)),}={0,1,2,}\mathbb{N} = \{0, S(0), S(S(0)), \ldots\} = \{0, 1, 2, \ldots\}

Now, to ensure you remember the axioms, try proving the following lemma yourself:

Lemma
33 is a natural number
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 3S(S(S(0)))3 \coloneqq S(S(S(0))). By Axiom 2.1, 00 is a natural number, and by Axiom 2.2, S(0)1S(0) \coloneqq 1 is also a natural number. Similarly, applying Axiom 2.2, S(S(0))S(S(0)) is a natural number, and applying Axiom 2.2 once more, we obtain that S(S(S(0)))3S(S(S(0))) \coloneqq 3 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 0,1,2,30, 1, 2, 3 where S(0)=1,S(1)=2,S(2)=3S(0) = 1, S(1) = 2, S(2) = 3, and S(3)=0S(3) = 0 (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)

00 is not the successor of any natural number. In other words, S(n)0S(n) \neq 0 for every natural number nn.

After having three axioms, is the natural number system complete? The answer is no. Consider the following number system consisting of 0,1,2,3,40, 1, 2, 3, 4 where S(0)=1,S(1)=2,S(2)=3,S(3)=4,S(4)=4S(0) = 1, S(1) = 2, S(2) = 3, S(3) = 4, S(4) = 4, or in other words (5=S(4)=4,6=S(5)=S(4)=4,5 = S(4) = 4, 6 = S(5) = S(4) = 4, \ldots). This number system “loops” at 44; 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 n,mn, m are two natural numbers and mnm \neq n, then S(n)S(m)S(n) \neq S(m). Equivalently, if S(n)=S(m)S(n) = S(m), then n=mn = m.

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

K={0,0.5,1,1.5,2,2.5,3,3.5,}K = \{ 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, \ldots \}

still satisfies all four axioms above. What we want here is for the Peano axioms to uniquely define a set N\mathbb{N} and call that set the natural numbers. Furthermore, our number system N\mathbb{N} should consist only of natural numbers and their successors, to exclude “intermediate” numbers like 0.50.5 or 1.51.5.

Axiom (Axiom 2.5 (Principle of Mathematical Induction))

Let P(n)P(n) be any property pertaining to a natural number nn (for example, P(n)P(n) \coloneqqnn is even”). Suppose that P(0)P(0) is true, and suppose that whenever P(n)P(n) is true, P(S(n))P(S(n)) is also true. Then P(n)P(n) is true for every natural number nn.

This may sound somewhat theoretical, but this is precisely how we exclude “outliers” (such as 0.50.5) from the set of natural numbers. Let us return to the example of the number system KK above. This system satisfies all four previous axioms. How does Axiom 2.5 exclude the number system KK? Suppose we have any property P(n)P(n); if P(0)P(0) is true, then P(S(0))=P(1)P(S(0)) = P(1) is true; similarly, if P(1)P(1) is true, then P(S(1))=P(2)P(S(1)) = P(2) is true, and so on. There is no way to conclude that P(0.5)P(0.5) or P(1.5)P(1.5) is true because there is no counting sequence (no application of SS) that leads from any number nn to 0.5,1.5,2.5,0.5, 1.5, 2.5, \ldots. Therefore, the system KK does not satisfy Axiom 2.5.

Definition (Natural Numbers)

There exists a number system N\mathbb{N} in which the elements of N\mathbb{N} are called natural numbers, and Axioms 2.12.1 through 2.52.5 hold in N\mathbb{N}. We call Axioms 2.12.1 through 2.52.5 the Peano Axioms.

1.2. Addition on Natural Numbers

Definition (Definition 2.2.1: Addition)

Let mm be a natural number. To add 00 to mm, we define 0+mm0 + m \coloneqq m. Now, suppose inductively that we have defined how to add nn to mm. Then we can add S(n)S(n) to mm by defining S(n)+m=S(n+m)S(n) + m = S(n + m).

Proposition

If nn and mm are natural numbers, then n+mn + m is also a natural number.

Proof

For n=0n = 0, we have 0+m=m0 + m = m, which is a natural number. Assume nn holds, so that n+mn + m is a natural number. We have S(n)+m=S(n+m)S(n) + m = S(n + m) (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 nn, n+0=nn + 0 = n.

Proof

If n=0n = 0, then 0+0=00 + 0 = 0. Assume n+0=nn + 0 = n holds. Consider S(n)S(n): we
have S(n)+0=S(n+0)=S(n)S(n) + 0 = S(n + 0) = S(n). Thus, by induction, the lemma holds.

Lemma (Lemma 2.2.3)

For every natural numbers nn and mm, n+S(m)=S(n+m)n + S(m) = S(n + m).

Proof

If n=0n = 0, then 0+S(m)=S(m)0 + S(m) = S(m) (by definition). Assume n+S(m)=S(n+m)n + S(m) = S(n + m) holds. We need to prove S(n)+S(m)=S(S(n)+m)S(n) + S(m) = S(S(n) + m). For the left-hand side, we have S(n)+S(m)=S(n+S(m))=S(S(n+m))S(n) + S(m) = S(n + S(m)) = S(S(n + m)) (by the inductive hypothesis). For the right-hand side, we have S(n)+m=S(n+m)    S(S(n)+m)=S(S(n+m))S(n) + m = S(n + m) \implies S(S(n) + m) = S(S(n + m)) (by the definition of addition), so both sides are equal. The lemma is proved.

Proposition
S(n)=n+1S(n) = n + 1.
Proof

We have 1S(0)1 \coloneqq S(0), so n+1=n+S(0)=S(n+0)=S(n)n + 1 = n + S(0) = S(n + 0) = S(n) (by Lemmas 2.2.3 and 2.2.2).

Lemma (Lemma 2.2.4: Addition is Commutative)

For every natural numbers nn and mm, n+m=m+nn + m = m + n.

Proof

Consider n=0n = 0: we have 0+m=m=m+00 + m = m = m + 0. Assume nn holds, so that n+m=m+nn + m = m + n. We need to prove S(n)+m=m+S(n)S(n) + m = m + S(n). We have S(n)+m=S(n+m)=n+S(m)S(n) + m = S(n + m) = n + S(m) (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 a,b,ca, b, c, we have (a+b)+c=a+(b+c)(a + b) + c = a + (b + c).

Proof

Consider c=0c = 0: we have (a+b)+0=a+b(a + b) + 0 = a + b and a+(b+0)=a+ba + (b + 0) = a + b, so (a+b)+c=a+(b+c)(a + b) + c = a + (b + c). Assume c=nc = n holds, so that (a+b)+n=a+(b+n)(a + b) + n = a + (b + n). We need to prove (a+b)+S(n)=a+(b+S(n))(a + b) + S(n) = a + (b + S(n)). For the left-hand side, we see (a+b)+S(n)=S((a+b)+n)=S(a+(b+n))(a + b) + S(n) = S((a + b) + n) = S(a + (b + n)) (by Lemma 2.2.3 and the inductive hypothesis). For the right-hand side, we have a+(b+S(n))=a+S(b+n)=S(a+(b+n))a + (b + S(n)) = a + S(b + n) = S(a + (b + n)) (by Lemma 2.2.3). Since the left and right sides are equal, the proposition holds.

Lemma (Lemma 2.2.6: Cancellation Law)

Let a,b,ca, b, c be natural numbers such that a+b=a+ca + b = a + c. Then b=cb = c.

Proof

Consider a=0a = 0: we have a+b=0+b=ba + b = 0 + b = b and a+c=0+c=ca + c = 0 + c = c, so b=cb = c. Assume a=na = n holds, so that n+b=n+c    b=cn + b = n + c \implies b = c. We need to prove S(n)+b=S(n)+c    b=cS(n) + b = S(n) + c \implies b = c. First, we have S(n)+b=S(n+b)S(n) + b = S(n + b) and S(n)+c=S(n+c)S(n) + c = S(n + c), so by Axiom 2.4 and the inductive hypothesis, S(n+b)=S(n+c)    n+b=n+c    b=cS(n + b) = S(n + c) \implies n + b = n + c \implies b = c.

Definition (Definition 2.2.7)

A natural number nn is said to be positive if and only if (iff) it is not equal to 00.

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 mm be a natural number. To “multiply” mm by 00, we define 0×m00 \times m \coloneqq 0. By assuming inductively that we have defined multiplication for nn, multiplication for S(n)S(n) is defined as follows:

S(n)×m(n×m)+mS(n) \times m \coloneqq (n \times m) + m

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 acac instead of a×ca \times c, and similarly a(b+c)a(b + c) instead of a×(b+c)a \times (b + c).

Lemma (Lemma 2.3.2 (Multiplication is Commutative))

Let n,mn, m be natural numbers. Then n×m=m×nn \times m = m \times n.

Proof

Here we will have two stages of proof. To apply induction, we must first prove the base case for 00, i.e., n×0=0×nn \times 0 = 0 \times n for all nn.

  1. We will prove 0×n=00 \times n = 0, hence 0×n=0=n×00 \times n = 0 = n \times 0 (by definition)

Consider n=0n = 0: we see 0×0=00 \times 0 = 0 (by definition). Assume n=kn = k holds, i.e., 0×k=00 \times k = 0 for kNk \in \mathbb{N}. Consider S(k)S(k): we have 0×S(k)=0×k+0=0+0=00 \times S(k) = 0 \times k + 0 = 0 + 0 = 0 (by definition). Therefore, 0×n=00 \times n = 0 for all nNn \in \mathbb{N}.

  1. We will prove n×m=m×nn \times m = m \times n for all n,mNn, m \in \mathbb{N}

Consider n=0n = 0: we see 0×m=m×0=00 \times m = m \times 0 = 0 (by the proof above). Assume n=kn = k holds, i.e., k×m=m×kk \times m = m \times k for kNk \in \mathbb{N}. Consider S(k)S(k): we have S(k)×m=(k×m)+m=(m×k)+m=m×S(k)S(k) \times m = (k \times m) + m = (m \times k) + m = m \times S(k) (by definition). Therefore, n×m=m×nn \times m = m \times n for all n,mNn, m \in \mathbb{N}.

Proposition (Proposition 2.3.4 (Distributive Law))

For every natural numbers a,b,ca, b, c, we have a(b+c)=ab+aca(b + c) = ab + ac and (b+c)a=ba+ca(b + c)a = ba + ca.

Proof

The reader may refer to the proof in the book Analysis I [] page 34.

1.4. The Peano Axioms and Computer Science

Godel
Kurt Gödel, a mathematician and logician, extremely famous for his Incompleteness Theorems.

We have just constructed the natural numbers N\mathbb{N} from the Peano axioms. As we can see, this axiom system can be understood simply through “counting”. However, in 1931, Gödel showed that N\mathbb{N} (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 N\mathbb{N} 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.

Alan Turing
Alan Turing, a mathematician and computer scientist, extremely famous for the Turing Machine and the Turing Test for artificial intelligence systems.

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 N\mathbb{N}, we can use these definitions to solve equations such as 2+3=x2 + 3 = x. However, suppose we want to solve the following equation:

a+x=ba + x = b

We have two cases:

  1. If bab \geq a, then the solution xNx \in \mathbb{N} and x=bax = b - a.
  2. If b<ab < a, then the solution xx does not exist in N\mathbb{N} (e.g., x=1x = -1).

The integers were constructed to ensure that the equation a+x=ba + x = b always has a solution (fun fact: if you know the purpose of constructing the complex numbers C\mathbb{C}, you will understand why—they were also constructed to ensure that the equation x2+1=0x^2 + 1 = 0 has a solution).

For this reason, we will define an integer as a pair (a,b)(a, b) where a,ba, b are natural numbers, such that (a,b)(a, b) is the solution to the equation b+x=ab + x = a (in other words, the integer is x=abx = a - b).

  • (3,1)(3, 1) means 1+x=3x=311 + x = 3 \Leftrightarrow x = 3 - 1.
  • (1,3)(1, 3) means 3+x=1x=133 + x = 1 \Leftrightarrow x = 1 - 3.

However, different pairs such as (1,3)(1, 3) and (2,4)(2, 4) can define the same solution (which is x=2x = -2), so how do we define the equivalence between these two pairs?

More formally, let N×N\mathbb{N} \times \mathbb{N} be the set consisting of all ordered pairs (a,b)(a, b) (ordered pair means (a,b)(a, b) is different from (b,a)(b, a)). Then, we define a relation between two pairs (a,b)(a, b) and (c,d)(c, d) as follows:

(a,b)(c,d)a+d=c+b(a, b) \ast (c, d) \Leftrightarrow a + d = c + b

In this definition, we avoid using subtraction; note that a+d=c+ba + d = c + b is equivalent to ab=cda - b = c - d.

Definition (Equivalence Relation)

An equivalence relation on a set SS is a relation, denoted \sim, satisfying the following properties: - Symmetry: (a,b)(b,a)(a, b) \sim (b, a).

  • Reflexivity: (a,b)(a,b)(a, b) \sim (a, b).
  • Transitivity: If (a,b)(c,d)(a, b) \sim (c, d) and (c,d)(e,f)(c, d) \sim (e, f), then (a,b)(e,f)(a, b) \sim (e, f).

The relation \ast that we defined above is an equivalence relation. Thus, we can define the equivalence between two pairs of “solutions” to the equations b+x=ab + x = a and d+y=cd + y = c.

Definition (Equivalence Class)

Let \sim be an equivalence relation on SS. For aSa \in S, the equivalence class of aa is:

[a]{sSsa}[a] \coloneqq \{s \in S \mid s \sim a\}

Sometimes we may write [a][a]_{\sim} to specify the equivalence relation \sim. A subset UU of SS is called an equivalence class if U=[a]U = [a] for some aSa \in S. An element sUs \in U is called a representative of UU.

An integer is an equivalence class under the relation \ast (which we defined above). We define the set of all integers as Z\mathbb{Z}. As per the definition above, an integer represented by a pair (a,b)(a, b) is denoted [(a,b)][(a, b)].

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 f:ZNf: \mathbb{Z} \to \mathbb{N} with f([(a,b)])=af([(a, b)]) = a (in other words, for each representative of an equivalence class, we choose the first element of the pair). - Consider x=[(2,1)]x = [(2, 1)]; then f(x)=2f(x) = 2.

  • Consider y=[(3,2)]y = [(3, 2)]; we can see that (2,1)(3,2)(2, 1) \ast (3, 2) because 21=322 - 1 = 3 - 2, so xx and yy are representatives of the same equivalence class.
  • But f(y)=3f(y) = 3, and since 232 \neq 3, the function ff is not well-defined.
Definition (Definition 3.2.1: Addition)

Let x=[(a,b)]x = [(a, b)] and y=[(c,d)]y = [(c, d)] be two integers. We define their sum as:

x+y[(a+c,b+d)]x + y \coloneqq [(a + c, b + d)]

This corresponds to the usual logic: (ab)+(cd)=(a+c)(b+d)(a - b) + (c - d) = (a + c) - (b + d).

Definition (Definition 3.2.2: Negation and Subtraction)

The negation of an integer x=[(a,b)]x = [(a, b)] is defined as x[(b,a)]-x \coloneqq [(b, a)]. We define subtraction as adding the negation: xyx+(y)x - y \coloneqq x + (-y).

Definition (Definition 3.2.3: Multiplication)

Let x=[(a,b)]x = [(a, b)] and y=[(c,d)]y = [(c, d)]. We define their product as:

x×y[(ac+bd,ad+bc)]x \times y \coloneqq [(ac + bd, ad + bc)]

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 (ab)(cd)(a - b)(c - d), we get:

(ab)(cd)=acadbc+bd=(ac+bd)(ad+bc)(a - b)(c - d) = ac - ad - bc + bd = (ac + bd) - (ad + bc)

Converting to the equivalence class definition, the positive part is (ac+bd)(ac + bd) and the negative part is (ad+bc)(ad + bc).

Note

We have constructed a new set Z\mathbb{Z}, but where are the natural numbers 0,1,2,0, 1, 2, \ldots that we already know? We need a way to “see” N\mathbb{N} inside Z\mathbb{Z}.

To do this, we proceed as follows:

  • We identify the natural number nn with the integer [(n,0)][(n, 0)].
  • We identify the integer [(0,n)][(0, n)] with the notation n-n.

With this identification, we can abbreviate [(a,b)][(a, b)] as aba - b. Consequently, Z\mathbb{Z} becomes an extension of N\mathbb{N}.

2.4. Some Facts About Integers

We constructed the integers Z\mathbb{Z} 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 Zn\mathbb{Z}_n.

More advanced and important topics such as Elliptic Curves (used in Bitcoin and cryptography) operate on Modular Arithmetic Zn\mathbb{Z}_n rather than the ordinary integer system Z\mathbb{Z}.

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:

  • a2+b2=c2a^2 + b^2 = c^2 is a Diophantine Equation with integer solutions (this is also the Pythagorean theorem; examples of satisfying triples include (3,4,5)(3, 4, 5)).
  • an+bn=cna^n + b^n = c^n for n>2n > 2 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.


  1. Analysis I, Tao, Terence
    2022
    https://doi.org/10.1007/978-981-19-7261-4
  2. Abstract algebra: Structures and Applications, Lovett, Stephen
    2015
    https://doi.org/10.1201/b18722