# The rational numbers

## Rational numbers

### Rational numbers

#### Defining rational numbers

We previously defined integers in terms of natural numbers. Similarly we can define rational numbers in terms of integers.

$$\forall ab \in \mathbb{I} (\neg (b=0)\rightarrow \exists c (b.c=a))$$

A rational is an ordered pair of integers.

$$\{\{a\},\{a,b\}\}$$

So that:

$$\{\{a\},\{a,b\}\}=\dfrac{a}{b}$$

#### Converting integers to rational numbers

Integers can be shown as rational numbers using:

$$(i,1)$$

Integers can then be turned into rational numbers:

$$\mathbb{Q}=\dfrac{a}{1}$$

$$a=\dfrac{a_1}{a_2}$$

$$b=\dfrac{b_1}{b_2}$$

$$c=\dfrac{c_1}{c_2}$$

#### Equivalence classes of rationals

There are an infinite number of ways to write any rational number, as with integers. $$\dfrac{1}{2}$$ can be written as $$\dfrac{1}{2}$$, $$\dfrac{-2}{-4}$$ etc.

The class of these terms form an equivalence class.

We can show these are equal:

$$\dfrac{a}{b}=\{\{a\},\{a,b\}\}$$

$$\dfrac{ca}{cb}=\{\{a\},\{a,b\}\}$$

$$\dfrac{ca}{cb}=\{\{ca\},\{ca,cb\}\}$$

$$\{\{a\},\{a,b\}\}=\{\{ca\},\{ca,cb\}\}$$

### Functions of rational numbers

Then we can define addition as:

$$(a,b)+(c,d)=(a.d+b.c,b.d)$$

$$a+b=c$$

$$c_1=a_1b_2+a_2b_1$$

$$c_1=a_2b_2$$

#### Rational subtraction

$$a-b=c$$

$$c_1=a_1b_2-a_2b_1$$

$$c_1=a_2b_2$$

#### Rational multiplication

Similarly, multiplication can be defined as:

$$(a,b).(c,d)=(a.c, b.d)$$

$$ab=c$$

$$c_1=a_1b_1$$

$$c_1=a_2b_2$$

#### Rational division

$$\dfrac{a}{b}=c$$

$$c_1=a_1b_2$$

$$c_1=a_2b_1$$

### Cardinality of the rationals

#### Cardinality of rational numbers

We can see rational numbers as cartesian products of integers. That is:

$$\mathbb{Q}=Z.Z$$

We can order the rational numbers like so:

$$\{\dfrac{1}{1},\dfrac{2}{1},\dfrac{1}{2},\dfrac{1}{3},\dfrac{2}{2}\dfrac{3}{1}...\}$$

These can be mapped from natural numbers, so there is a bijunctive function.

So:

$$|\mathbb{Q} |=|\mathbb{Z}.\mathbb{Z} |=|\mathbb{N} |=\aleph_0$$

As: $$|\mathbb{Z}.\mathbb{Z} |=|\mathbb{Z}|^2$$

$$|\mathbb{N}|^n=\mathbb{N}$$

### Fraction rules

$$\dfrac{A}{B}+\dfrac{C}{D}=\dfrac{AD+BC}{BD}$$

#### Multiplication

$$\dfrac{A}{B}\dfrac{C}{D}=\dfrac{AC}{BD}$$

$$C+\dfrac{A}{B}=\dfrac{BC+A}{B}$$

#### Scaler multiplication

$$C\dfrac{A}{B}=\dfrac{AC}{B}$$

#### Other

$$\dfrac{A+B}{C}=\dfrac{A}{C}+\dfrac{B}{C}$$

$$\dfrac{A}{B}=\dfrac{AC}{BC}$$

### Partial fraction decomposition

We have: $$\dfrac{1}{A.B}$$

We want this in the form of:

$$\dfrac{a}{A}+\dfrac{b}{B}$$

First, lets define $$M$$ as the mean of these two numbers, and define $$\delta=M-B$$. Then:

$$\dfrac{1}{AB}=\dfrac{1}{(M+\delta)(M-\delta)}=\dfrac{a}{M+\delta}+\dfrac{b}{M-\delta}$$

We can rearrange the latter two to find:

$$1=a(M-\delta)+b(M+\delta)$$

Now we need to find values of $$a$$ and $$b$$ to choose.

Let’s examine $$a$$.

$$a=\dfrac{1-b(M+\delta)}{M-\delta}$$

$$a=-\dfrac{bM+b\delta -1}{M-\delta}$$

$$a=-\dfrac{bM+b\delta -1}{M-\delta}$$

For this to divide neatly we need both the numerator to be a constant multiplier of the denominator. This means the ratio the multiplier for the left hand side of the denominator is equal to the right:

$$\dfrac{bM}{M}=\dfrac{b\delta -1}{-\delta}$$

$$b=\dfrac{b\delta -1}{-\delta}$$

$$b=\dfrac{1}{2\delta}$$

We can do the same for $$a$$.

$$a=-\dfrac{1}{2\delta}$$

We can plug these back into our original formula:

$$\dfrac{1}{(M+\delta)(M-\delta)}=\dfrac{-\dfrac{1}{2\delta}}{M+\delta}+\dfrac{\dfrac{1}{2\delta}}{M-\delta}$$

$$\dfrac{1}{(M+\delta)(M-\delta)}=\dfrac{1}{2\delta}[\dfrac{1}{M-\delta}-\dfrac{1}{M+\delta}]$$

### Density of the rationals

#### Rationals are dense in rationals

For any pair of rationals, there is another rational between them:

$$a=\dfrac{p}{q}$$

$$b=\dfrac{m}{n}$$

Where $$b>a$$.

We define a new rational:

$$c=\dfrac{a+b}{2}$$

$$c=\dfrac{pn+qm}{2qn}$$

This is a rational number.

We can write:

$$a=\dfrac{2pn}{2qn}$$

$$b=\dfrac{2qm}{2qn}$$

As $$b>a$$ we know $$2qm>2pn$$

So: $$a < c < b$$