1. Sets and Relations
1.4. Natural Numbers, Integers, and Rational Numbers
In this section we will define some number systems based on those numbers that anyone is familiar with: the natural numbers. In a course on logic and foundation even the natural numbers can be defined rigorously. In this course, however, we will take the numbers {1, 2, 3, 4, ...} and their basic operations of addition and multiplication for granted. Actually, the most basic properties of the natural numbers are called the Peano Axioms, and are defined (being axioms they need not be derived) as follows:Definition 1.4.1: Peano Axioms  

Theorem 1.4.2: The Integers  
Let A be the set N x N and define a relation r on
N x N by saying that (a,b) is related to (a’,b’) if
a + b’ = a’ + b. Then this relation is an equivalence relation.
If [(a,b)] and [(a’, b’)] denote the equivalence classes containing (a, b) and (a’, b’), respectively, and if we define addition and multiplication of those equivalence classes as:

When defining operations on equivalent classes, one must prove that the operation is welldefined. That means, because the operation is usually defined by picking particular representatives of a class, one needs to show that the result is independent of these particular representatives. Check the above proof for details.
The above proof is in fact rather abstract. The basic question, however, is: why would anyone even get this idea of defining those classes and their operations, and what does this really mean, if anything ? In particular, why is the theorem entitled ‘The Integers’ ? Try to go through the few examples below:
Examples 1.4.3:  

 [(a, b)] * [(a’, b’)] = [(a * a’, b * b’)]
 (b  a) * (b’  a’) = b * b’ + a * a’  (a * b’ + a’ * b)
Incidentally, now it is clear why multiplying two negative numbers together does give a positive number: it is precisely the above operation on equivalent classes that induces this interpretation. For example:
 (2) * (4) = 8
 (2) is a representative of the equivalence class of pair of natural numbers (a. b) (which we understand completely) whose difference b  a = 2.
 To represent the class that might be denoted by 4, we might choose the pair (8, 4).
 [(4, 2)] * [(8, 4)] = [ (4 * 4 + 2 * 8) , (4 * 8 + 2 * 4)] = [(32, 40)]
Next, we will define the rational numbers in much the same way, leaving the proof as an exercise. To motivate the next theorem, think about the following:
 a / b = a’ / b’ if and only if a * b’ = a’ * b
 a / b + a’ / b’ = (a b’ + b * a’) / (b * b’)
 a / b * a’ / b’ = (a * a’) / (b * b’)
Theorem 1.4.4: The Rationals  
Let A be the set N x N  {0} and define a
relation r on N x N  {0} by saying that (a,
b) is related to (a’, b’) if a * b’ = a’ * b. Then
this relation is an equivalence relation.
If [(a, b)] and [(a’, b’)] denotes the equivalence classes containing (a, b) and (a’, b’), respectively, and if we define the operations

Note that the second component of a pair of integers can not be zero (otherwise the relation would not be an equivalence relation). As before, this will yield, in a mathematically rigorous way, a new set of equivalence classes commonly called the 'rational numbers'. The individual equivalent classes [(a,b)] are commonly denoted by the symbol a / b, and are often called a 'fraction'. The requirement that the second component should not be zero is the familiar restriction on fractions that their denominator not be zero.
As a matter of fact, the rational numbers are much nicer than the integers or the natural numbers:
 A natural number has no inverse with respect to addition or multiplication
 An integer has an inverse with respect to addition, but none with respect to multiplication.
 A rational number has an inverse with respect to both addition and multiplication.
Example 1.4.5:  
So, why would anyone bother introducing more complicated numbers, such as the real (or even complex) numbers ? Find as many reasons as you can. 
The example above should provide plenty of motivation to introduce a number system more advanced and capable than the rationals. Another reason you might find interesting is the following fact, which makes for a good homework assignment.
Example 1.4.6:  
Prove that if p is a prime number, then p^{1/n}, where n > 1, is not rational. 