A journey to the world of Numbers

2 The rationals

We can now define the rationals, starting with our copy of the integers \(\mathrm{MyInt}\).

We follow a similar path to the one for \(\mathrm{MyInt}\).

2.1 The prerationals

\(\mathrm{MyRat}\) will be a quotient of a type called \(\mathrm{MyPrerat}\).

Definition 40
#

Let \(\mathrm{MyPrerat}\) be \(\mathrm{MyInt}\times \mathrm{MyInt}\backslash \{ 0\} \)

Definition 41
#

We define a relation \(R\) on \(\mathrm{MyPrerat}\) as follows: \((a,b)\) and \((c, d)\) are related if and only if

\[ a * d = b * c \]
Lemma 42
#

\(R\) is a reflexive relation.

Proof

Exercice.

Lemma 43
#

\(R\) is a symmetric relation.

Proof

Exercice.

Lemma 44
#

\(R\) is a transitive relation.

Proof

Exercice.

Lemma 45
#

We have that \(R\) is an equivalence relation. From now on, we will write \(x \approx y\) for \(x R y\).

Proof

Clear from Lemma 42, Lemma 43 and Lemma 44.

Definition 46
#

We define an operation, called negation on \(\mathrm{MyPrerat}\) as follows: the negation of \(x = (a,b)\) is \((-a,b)\):

\[ -x = -(a,b) = (-a,b) \]

Note that it is automatically well defined (meaning that second component of \((-a,b)\) is different from \(0\)).

Lemma 47
#

If \(x \approx x'\), then \(-x \approx -x'\).

Proof

Exercice.

Definition 48
#

We define an operation, called addition on \(\mathrm{MyPrerat}\) as follows: the addition of \(x = (a,b)\) and \(y = (b, c)\) is

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

Do you see why it is well defined?

Lemma 49
#

If \(x \approx x'\) and \(y \approx y'\), then \(x + y \approx x' + y'\).

Proof

Exercice.

Definition 50
#

We define an operation, called multiplication on \(\mathrm{MyPrerat}\) as follows: the multiplication of \(x = (a,b)\) and \(y = (b, c)\) is

\[ x * y = (a,b) * (c,d) = (a*c, b*d) \]
Lemma 51
#

If \(x \approx x'\) and \(y \approx y'\), then \(x * y \approx x' * y'\).

Proof

Exercice.

Definition 52
#

We define an operation, called negation on \(\mathrm{MyPrerat}\) as follows: the inverse of \(x = (a,b)\) is:

\[ \mbox{if} b \neq 0 \mbox{ then } x^{-1} = (b, a), \mbox{ otherwise } x^{-1} = (0, 1) \]

Note that \(x^{-1}\) is always defined!

Lemma 53
#

If \(x \approx x'\), then \(x^{-1} \approx x'^{-1}\).

Proof

Exercice.

2.2 The rationals

2.2.1 Definitions

Definition 54
#

We define our rationals \(\mathrm{MyRat}\) as

\[ \mathrm{MyRat}= \mathrm{MyPrerat}\, / \approx \]

We will write \(⟦ (a, b) ⟧\) for the class of \((a,b)\).

Definition 55
#

We define the zero of \(\mathrm{MyRat}\), denoted \(0\) as the class of \((0,1)\) (note that \(1 \neq 0\) in \(\mathrm{MyInt}\)).

Definition 56
#

We define the one of \(\mathrm{MyRat}\), denoted \(1\) as the class of \((1,1)\) (note that \(1 \neq 0\) in \(\mathrm{MyInt}\)).

2.2.2 Commutative ring structure

Definition 57
#

We define the negation of \(x = ⟦ (a, b) ⟧\) in \(\mathrm{MyInt}\) as

\[ -x = ⟦ -(a, b) ⟧ \]

Thanks to Lemma 47 this is well defined.

Definition 58
#

We define the addition of \(x = ⟦ (a, b) ⟧\) and \(y = ⟦ (c, d) ⟧\) in \(\mathrm{MyInt}\) as

\[ x + y = ⟦ (a,b)+(c,d) ⟧ \]

Thanks to Lemma 49 this is well defined.

Definition 59
#

We define the multiplication of \(x = ⟦ (a, b) ⟧\) and \(y = ⟦ (c, d) ⟧\) in \(\mathrm{MyInt}\) as

\[ x * y = ⟦ (a, b)*(c,d) ⟧ \]

Thanks to Lemma 51 this is well defined.

Definition 60
#

We define the negation of \(x = ⟦ (a, b) ⟧\) in \(\mathrm{MyInt}\) as

\[ x^{-1} = ⟦ (a, b)^{-1} ⟧ \]

Thanks to Lemma 53 this is well defined.

Proposition 61
#

\(\mathrm{MyRat}\) with addition and multiplication is a commutative ring.

Proof

We have to prove various properties, namely:

  • addition is associative

  • \(0\) works as neutral element for addition (on both sides)

  • existence of an inverse for addition (we prove that \(x + (-x) = (-x) + x = 0\))

  • addition is commutative

  • left and right distributivity of multiplication with respect to addition

  • associativity of multiplication

  • \(1\) works as neutral element for multiplication (on both sides)

All the proofs are essentially identical, going to \(\mathrm{MyInt}\), unravelling the definition and then checking the equality holds in \(\mathrm{MyInt}\).

Lemma 62
#

In \(\mathrm{MyRat}\) we have \(0 \neq 1\).

Proof

If \(0 = 1\) by definition we would have \(⟦ (0,1) ⟧ = ⟦ (1,1) ⟧\) so \(0*1=1*0\) in \(\mathrm{MyInt}\), that is absurd.

Lemma 63
#

Let \(x \neq 0\) be in \(\mathrm{MyRat}\). Then \(x * x^{-1} = 1\).

Proof

Let \(x = ⟦ (a,b) ⟧\), with \(b \neq 0\). Since \(x \neq 0\) we have \(a \neq 0\) and so \(x^{-1} = ⟦ (b,a) ⟧\). The lemma follows by definition of multiplication.

Proposition 64
#

\(\mathrm{MyRat}\) with addition and multiplication is a field.

Proof

Clear because of Lemma 63.

2.2.3 The inclusion \(i \colon \mathbb {N}\to \mathrm{MyRat}\)

Definition 65
#

We define a map

\begin{gather*} i \colon \mathbb {N}\to \mathrm{MyRat}\\ n \mapsto ⟦ (\mathrm{MyInt}.i n,1) ⟧ \end{gather*}
Lemma 66
#

We have that \(i(0) = 0\).

Proof

Clear from the definition.

Lemma 67
#

We have that \(i(1) = 1\).

Proof

Clear from the definition.

Lemma 68
#

For all \(a\) and \(b\) in \(\mathbb {N}\) we have that

\[ i(a+b) = i(a) + i(b) \]
Proof

We have \(i(a+b) = ⟦ (\mathrm{MyInt}.i (a+b), 1) ⟧ = ⟦ (\mathrm{MyInt}.i (a), 1) + (\mathrm{MyInt}.i (b), 1) ⟧\), \(i(a) = ⟦ (\mathrm{MyInt}.i(a), 1) ⟧\) and \(i(b) = ⟦ (\mathrm{MyInt}.i (b), 1) ⟧\), so we need to prove that

\[ ⟦ (\mathrm{MyInt}.i (a), 1) + (\mathrm{MyInt}.i (b), 1) ⟧ = ⟦ (\mathrm{MyInt}.i (a), 1) ⟧ + ⟦ (\mathrm{MyInt}.i (b), 1) ⟧ \]

that is obvious from the definition ().

Lemma 69
#

For all \(a\) and \(b\) in \(\mathbb {N}\) we have that

\[ i(a*b) = i(a) * i(b) \]
Proof

Similar to the proof of Lemma 68.

Lemma 70
#

We have that \(i\) is injective.

Proof

Let \(a\) be such that \(i(a)=0\). This means \(⟦ (\mathrm{MyInt}.i a,1) ⟧ = ⟦ (0,1) ⟧\) so \((\mathrm{MyInt}.i a) * 1 = 1 * 0\) and hence \(\mathrm{MyInt}.i a = 0\) so \(a = 0\).

2.2.4 The inclusion \(j \colon \mathrm{MyInt}\to \mathrm{MyRat}\)

Definition 71
#

We define a map

\begin{gather*} j \colon \mathrm{MyInt}\to \mathrm{MyRat}\\ n \mapsto ⟦ (n,1) ⟧ \end{gather*}
Lemma 72
#

We have that \(j(0) = 0\).

Proof

Clear from the definition.

Lemma 73
#

We have that \(j(1) = 1\).

Proof

Clear from the definition.

Lemma 74
#

For all \(a\) and \(b\) in \(\mathrm{MyInt}\) we have that

\[ j(a+b) = j(a) + j(b) \]
Proof

Exercice.

Lemma 75
#

For all \(a\) and \(b\) in \(\mathbb {N}\) we have that

\[ j(a*b) = j(a) * j(b) \]
Proof

Exercice.

Lemma 76
#

We have that \(j\) is injective.

Proof

Exercice.

Lemma 77
#

Let \(n\) be a natural number. Then \(\mathrm{MyRat}.j (\mathrm{MyInt}.i (n)) = MyRat.i (n)\).

Proof

It follows from unravelling all the definitions.

Lemma 78
#

Let \(a\) and \(b\) be in \(\mathrm{MyInt}\) with \(b \neq 0\). Then \(⟦ (a, b) ⟧ = j(a)*j(b)^{-1}\).

Proof

Exercice.

2.2.5 Nonegativity

Before defining the order on \(\mathrm{MyRat}\), let’s define the notion of nonnegativity.

Definition 79
#

Given \(x = (a,b)\) in \(\mathrm{MyRat}\), we say that \(x\) is nonnegative if \(0 \leq a\) and \(0 {\lt} b\).

Can you see why it corresponds to the “usual definition” when we think that \(x = a/b\)?

Lemma 80
#

We have that \(0\) in \(\mathrm{MyRat}\) is nonnegative.

Proof

Obvious.

Lemma 81
#

We have that \(1\) in \(\mathrm{MyRat}\) is nonnegative.

Proof

Obvious.

Lemma 82
#

Let \(x\) be in \(\mathrm{MyRat}\) such that both \(x\) and \(-x\) are nonnegative. Then \(x = 0\).

Proof

Unravelling all the definitions we end up with \(a\), \(b\), \(c\) and \(d\) in \(\mathrm{MyInt}\) such that \(0 \leq a\), \(0 {\lt} b\), \(0 \leq c\), \(0 {\lt} d\) and \(-(a*d)=b*c\). This implies \(a=0\).

Lemma 83

Let \(x\) be in \(\mathrm{MyRat}\) such that \(x\) is not nonnegative. Then \(-x\) is nonnegative.

Proof

Annoying but easy, left as an exercice.

Lemma 84

Let \(x\) and \(y\) be in \(\mathrm{MyRat}\) both nonnegative. Then \(x+y\) is nonnegative.

Proof

Exercice.

Lemma 85

Let \(x\) and \(y\) be in \(\mathrm{MyRat}\) both nonnegative. Then \(x*y\) is nonnegative.

Proof

Exercice.

Lemma 86

Let \(x\) be in \(\mathrm{MyRat}\) be nonnegative. Then \(x^{-1}\) is nonnegative.

Proof

Exercice.

2.2.6 The order

Definition 87
#

Let \(x\) and \(y\) in \(\mathrm{MyRat}\). We write \(x \leq y\) if \(y - x\) is nonnegative.

Lemma 88
#

We have that \(0 \leq x\) if and only if \(x\) is nonnegative.

Proof

Clear.

Lemma 89
#

In \(\mathrm{MyRat}\) we have that \(0 \leq 1\).

Proof

Clear because of Lemma 81.

Lemma 90
#

The relation \(\leq \) on \(\mathrm{MyRat}\) is reflexive.

Proof

Clear because of Lemma 80.

Lemma 91
#

The relation \(\leq \) on \(\mathrm{MyRat}\) is transitive.

Proof

It follows from Lemma 84.

Lemma 92
#

The relation \(\leq \) on \(\mathrm{MyRat}\) is antisymmetric.

Proof

It follows from Lemma 82.

It follows that \(\leq \) is an order relation.

2.2.7 Interaction between the order and the ring structure

Lemma 93
#

Let \(x\), \(y\) and \(z\) in \(\mathrm{MyRat}\) be such that \(x \leq y\). Then \(z + x ≤ z + y\).

Proof

Clear from the definitions.

Lemma 94
#

Let \(x\) and \(y\) in \(\mathrm{MyRat}\) be such that \(0 \leq x\) and \(0 \leq y\). Then \(0 \leq x * y\).

Proof

It follows from Lemma 85.

We have proved that \(\mathrm{MyRat}\) is an ordered ring.

2.2.8 Interaction between the order and the inclusions

Lemma 95
#

Let \(x\) and \(y\) in \(\mathrm{MyInt}\). We have that \(j(x) \leq j(y)\) if and only if \(x \leq y\).

Proof

Exercice.

Lemma 96
#

Let \(x\) and \(y\) in \(\mathbb {N}\). We have that \(i(x) \leq i(y)\) if and only if \(x \leq y\).

Proof

It follows immediately by Lemma 37, Lemma 95 and Lemma 77.

2.2.9 The linear order structure

Lemma 97
#

The order \(\leq \) on \(\mathrm{MyRat}\) is a total order.

Proof

This follows by Lemma 83.

Lemma 98
#

We have that \(\mathrm{MyRat}\) with \(\leq \) is a linear order

Proof

Clear from the lemma above.

Lemma 99
#

Let \(x\) and \(y\) in \(\mathrm{MyRat}\) be such that \(0 {\lt} x\) and \(0 {\lt} y\). Then \(0 {\lt} x * y\).

Proof

Exercice.

We now have that \(\mathrm{MyRat}\) is a strict ordered ring: a nontrivial ring with a partial order such that addition is strictly monotone and multiplication by a positive number is strictly monotone.