# Number Line

Notice: Incomplete
The aim is to be able to represent a line (and much more!) using just numbers. This is the main motivator of all constructions to follow.

## Natural Numbers

Natural numbers are finite cardinal numbers/ordinal numbers (in the finite, there's no difference). We can put all natural numbers on a line (see image). There are as many numbers to the left of a number as there are the specified number. For example, there are four numbers to the left of four, 0,1,2 and 3. Addition corresponds to sliding the number line (e.g., 3+5 is formed by sliding the number line such that the new 0 is above the old 3. The new 5 is above the old 3+5, or 8). Multiplication corresponds to scaling the number line (e.g., 3*5 is formed by keeping 0 fixed and stretching the number line such that the new 1 is above the old 3. The new 5 is above the old 3*5, or 15). The naturals only go in one direction, motivating us to continue.

## Integers

Integers are an extension of the natural numbers, by continuing leftwards. Subtraction, the 'opposite of addition' corresponds to sliding the number line 'in the other direction' (i.e., adding the negative/additive inverse). The additive inverses live just as far away from zero as the starting numbers, but on the opposite side.
To demonstrate this, solve a problem like 5-3. If you slide the number line such that the new 3 is above the old 0 (in reverse to adding 3; "what gives 5 when added to 3"), that's equivalent to sliding the number line such that the new 0 is above the old -3. It is natural to continue leftwards as they're precisely the points we get when we slide 'the wrong way'.

### Formal definition of integers

Integers may be defined as pairs of natural numbers, where two pairs are the same if their subtractions give the same answer (e.g., 5-3=6-4=2). The issue is if the natural number differences are negative. What's stopping me from defining integer subtraction such that it's the same as natural subtraction where it's defined but also that 3-5=2-7, such that it doesn't line up with the discretized number line? It's actually defined in terms of addition. In my example, (5,3) is (6,4) because 5+4=6+3=9.

#### Proof that it lines up with intuition

To subtract 3 from 5, you start at 5 and add -3, the additive inverse, which is moving leftward by 3 (since -3 is left of 0). By similar logic, to subtract 4 from 6, you start at 6, and move leftward by 4. Demonstrate this by drawing two discretized number lines (see image), drawing an arrow from 0 to 5 and another arrow from 5 to 2 on the first number line, and an arrow from 0 to 6 and from 6 to 4 on the second number line, all in different colors. In this resource, I'll use green, red, blue and black respectively, though ideally, you should choose something more colorblind-friendly (in the most common type of colorblindness, red and green look the same) and try this with a variety of numbers, including those where the results of the subtractions are negative.
In terms of this representation, we want to show that a pair of arrows, one forward and one backward starting from 0, will end at the same point as doing the same with another pair of arrows, if and only if connecting the first forward arrow and second backward arrow reaches the same point as connecting the second forward arrow and the first backward arrow, when all backwards arrows are rotated to face forwards (in this example, green+black=blue+red)
If the subtractions are the same, so are the 'cross-additions':
On the first number line, draw an arrow starting at 2, 'where we left off', colored red, going forward and the same length as the original. Then draw a black arrow (going forward and the same length as the original) from the end of the red arrow you just drew.
On the second number line, draw an arrow starting at 2, 'where we left off', colored black, going forward and the same length as the original. Then draw a red arrow (going forward and the same length as the original) from the end of the black arrow you just drew.
Notice two things:
The two red arrows on the first number line and the two black arrows on the second cancel each other out. Demonstrate this by rubbing out said arrows and joining the remaining arrows.
We added the same length from both 2's on the number line (the sum of the red and black lengths), in the same direction (forwards), so the end result must be the same, and it isn't just a quirk of the numbers we chose.
But this is precisely (part of) what we wanted to show; if the subtractions are the same, so are the 'cross-additions'
To prove the converse, perform the same trick in reverse.
Once we have proven the statement and its converse, that if the subtractions are the same, so are the 'cross additions' and that if the 'cross additions' are the same, then so are the subtractions, then we've proven that the subtractions are the same if and only if the 'cross additions' are- precisely what we wanted to show.

## Rational numbers

Notice: [insert image]
Rational numbers extend the integers by adding all subdivisions of gaps. Division, the 'opposite of multiplication' corresponds to scaling the number line in the other direction (i.e., multiplying by the reciprocal/multiplicative inverse). To demonstrate this, solve a problem like 5/3. If you scale the number line such that the new 3 is above the old 1 (in reverse to scaling by 3; "what gives 5 when scaled by 3"), that's equivalent to scaling the number line such that the new 1 is one third of the old 1. It is natural to fill in subdivisions as they're precisely the points we get when we scale 'the wrong way'.

### Formal definition of rational numbers

Rational numbers may be defined as pairs of integers, where two pairs are the same if their division gives the same answer (e.g., 6/3=10/5=2). The issue is if the integer ratios are non-integral. What's stopping me from defining rational division such that it's the same as integer division where it's defined but also that 3/5=2/7, such that it doesn't line up with the rational number line? It's actually defined in terms of multiplication. In my example, (5,3) is (10,6) because 5*6=3*10.

#### Proof that it lines up with intuition

To divide 5 by 3, you start at 5 and scale 3 to 1. Similarly, to divide 10 by 6, you start at 10, and scale 6 to 1. Demonstrate this by drawing a rational number line (see image), emphasize 5 in some way, then an arrow to a second rational line directly below, scaled such that the second 3 is a third of the first 1. The new 5 will be over the old 5/3. Similarly, do this again, but with 6 and 10 instead.
In terms of this representation, we want to show that scaling the first number line down by some factor is the same as scaling the third number line down by some other factor results in the emphasized numbers lining up if and only if scaling the first number line up by the second factor is the same as scaling the third number line up by the first factor.
If the divisions are the same, so are the cross-multiplications:
From the second number line, draw an arrow to a fifth number line, scaling the second up by the amount that the first was scaled down. Then draw another arrow to a sixth number line, scaling up by the same amount that the third was scaled down.
From the fourth number line, draw an arrow to a seventh number line, scaling the fourth up by the amount that the third was scaled down. Then draw another arrow to an eighth number line, scaling up by the same amount that the first was scaled down.
Notice two things:
The two intermediate acts of scaling from each number line cancel. Demonstrate this by rubbing out rubbing out the intermediate arrows and number lines and drawing new arrows connecting the initial and final number lines.
We scaled the first scaled number lines (the fractions) by the same amount, so the end result must be the same, and it isn't just a quirk of the numbers we chose.
But this is precisely (part of) what we wanted to show; if the divisions are the same, so are the cross-multiplications
To prove the converse, perform the same trick in reverse.
Once we have proven the statement and its converse, that if the divisions are the same, so are the cross multiplications and that if the cross multiplications are the same, then so are the divisions, then we've proven that the divisions are the same if and only if the cross multiplications are- precisely what we wanted to show.

### Why we're not done

In the first two constructions, there are obvious gaps. Yet, the rational numbers are everywhere (more precisely, they're dense as between any two rational numbers, there's always a third- notably, the mean), so it's not so obvious. I'll demonstrate an example of a 'missing number' that ought to be on the number line in order to motivate the next step, notably, that there ought to be a number which when 1 is scaled by it, sends it to 2.

#### Proof that the square root of 2 is irrational

Assume that the number which when scaled by itself is 2, is rational.
Then the numerator scaled by itself will be twice the denominator scaled by itself.
Then the numerator scaled by itself must be even.
Then the numerator must be even.
Then the numerator scaled by itself must divide four.
Then the numerator scaled by itself must be twice an even number.
As the numerator is twice the denominator scaled by itself, it follows that the denominator scaled by itself must be even.
Then the denominator must be even.
If the square root of 2 doesn't have a simplest form (as the numerator and denominator must both be even), then the square root of 2 must be irrational.
This is called proof by negation, where you make an assumption and conclude nonsense from it (like the existence of a fraction without a simplest form), inferring that your assumption is nonsensical.

## Real numbers

Notice how we can represent the square root of 2 as a limit of fractions: 1, 3/2, 7/5, 17/12, 41/29... In fact, we can fill in all the gaps in the rational numbers by doing this. This is because the rational numbers are dense (see the above image). It seems intuitive that all gaps can be filled by converging sequences.

### Formal definition of real numbers

Real numbers may be defined as infinite sequences of rational numbers such that all subsequences have differences tending to 0, and two real numbers are the same if and only if their infinite sequences tend to each other- that is, if their difference tends to 0. This can be made intuitive by:
a) attempting to construct an infinite sequence such that all subsequences have differences tending to 0 that doesn't 'visually converge'
b) attempting to find a point that can't be reached by infinite rational sequences, then overlaying the rational number line over the real one
c) attempting to find a pair of infinite sequences that only formally tend towards each other
d) attempting to find a pair of infinite sequences that only visually tend towards each other
All of these are impossible to pursue.
This can also be made intuitive by making visual versions of all examples in the above link

### Are we done?

Maybe there's a sequence of real numbers whose subsequences' differences tend to 0, yet don't tend to a real number. This can be shot down easily. Take the first real number. Find the first rational number in its rational sequence within 1 from its limit. Then take the second real number and find the first rational number within 1/2, then take the third real and the third rational within 1/3, and so on. Then we have a sequence of rational numbers tending to the limit of the initial reals. This can be shown visually by an infinite vertical sequence of horizontal real lines, selecting a point on each real line (to represent the terms of the sequence), selecting converging points (to represent the rational sequences representing the terms), drawing progressively smaller circles around the initial chosen points and highlighting the first rational number that shows up within the initial chosen points, and we are done! But we can add more dimensions, right?

## Complex numbers

Now surely this is the limit. If you try the same trick in 3d for multiplication (scaling and rotating until 1 fits over the target), you inevitably run into the problem of rotation axes, which can keep 1 on the target whilst moving everything else around, causing ambiguity. However, there is another solution, and it's mind-breaking.

## Quaternions

To represent 3D space, let's just throw away the real axis and represent every point with three imaginary axes, i, j, and k, representing x, y, and z respectively.

### Rotation on a plane

Note: This only considers rotations on the yz plane around the x axis, on the xz plane around the y axis, and on the xy plane around the z axis.
Consider a 90-degree counterclockwise rotation around the positive x axis (i.e., i). This sends j to k, k to -j, -j to -k, and -k to j. So we say that ij=k, ik=-j, i(-j)=-k and i(-k)=j.
Similarly, let's consider a 90-degree counterclockwise rotation around the positive y axis (i.e., j). This sends i to -k, -k to -i, -i to k and k to i. So we say that ji=-k, j(-k)=-i, j(-i)=k and jk=i.
Now, consider a 90-degree counterclockwise rotation around the positive z axis (i.e., k). This sends i (the x axis) to j (the y axis), j to -i, -i to -j, and -j to i. So we say that ki=j, kj=-i, k(-i)=-j, and k(-j)=i.
Activity: Have students create a 3d model using square paper. Each piece of square paper is used to represent the xy, yz and xz planes. Have students label the intersection lines i, j, and k, such that i is clockwise from j when viewed from k. Now, have students draw in the appropriate arrows (e.g., an arrow from j to k may be labeled 'xi')
You may notice something weird: i(-j)=-(ij). This in fact holds for any multiplication. To see why, have students build a model with two intersecting sticks (that are straight lines). Now, notice that if you rotate along one stick, the ends of the other stick (which are opposite to each other, therefore each other's negative) are still opposite to each other (which means that they're still each other's negative). If the first stick is i and the second stick is j, it's obvious that -j rotated around i is the negative of j rotated around i.
A good mnemonic to remember the multiplications of imaginary parts is here:
If you go in the same direction as the arrows when multiplying, you get a positive answer (e.g., ij=k, jk=i ki=j). If you go in the opposite direction to the arrows, you get a negative answer (e.g., ik=-j, kj=-i, ji=-k).

#### Rotation by arbitrary angles

So far, I've been talking about 90-degree counterclockwise rotations. However, what if you wanted to rotate by some other angle? Notice that to rotate by 0 degrees counterclockwise around i, you multiply by 1. If you rotate 90 degrees counterclockwise around i, you multiply by i. Now, notice that 0 degrees counterclockwise off the origin in the image is 1 and 90 degrees counterclockwise off the origin in the image is i. This seems like a natural thing to extend to arbitrary angles. For example, if you wanted to rotate by the angle sending 1 in the image to 0.6+0.8i, you'd multiply by 0.6+0.8i. To rotate by 180 degrees around i, you'd multiply by -i.
Notice that if you multiply by i (rotate 90 degrees counterclockwise around the x axis), then multiply by i again (rotating another 90 degrees counterclockwise around the x axis), you multiply by -1 (points on the yz plane are being flipped; demonstrate with 3d paper model). Therefore ii=-1. Using similar arguments, jj=-1 and kk=-1.
This gives us the full quaternion multiplication table:
| x | 1 | i | j | k |
| 1 | 1 | i | i | k |
| i | i | -1 | -k | j |
| j | j | k | -1 | -i |
| k | k | -j | i | -1 |
Notice that multiplying distinct imaginary axes is anti-commutative, that is, if you change the order, the answer stays the same, but the sign flips.

### Multiplication outside the plane

All of this works as long as you stick to the plane at right angles to what you're multiplying by. However, it falls apart quickly. Say that you want to rotate a point on the z axis 90 degrees counterclockwise around the positive z axis. Obviously, it doesn't work, for kk is -1, but the actual point would remain fixed. How do we resolve this?
Notice that if we just split the angle into two equal parts, each, in this case 45 degrees, we can do this: (~.707+~.707k)k(~.707-~.707k). Now, we just have complex numbers from the previous section, where multiplication order doesn't matter, so we can change the order to (~.707+~.707k)(~.707-~.707)k=(.5-.5k^2)k=k. This works as you're rotating counterclockwise 45 degrees, then clockwise again, so they cancel out. However, if we replaced that k with, say, i, we get (~.707+~.707k)i(~.707-~.707k)=(~.707+~.707k)(~.707i-~.707ik)=(~.707+~.707k)(~.707i+~.707ki)=(~.707+~.707k)(~.707+~.707k)i. Due to i being at right angles to k, (~.707+~.707k) still rotates counterclockwise 45 degrees, but (~.707-~.707k) actually rotates counterclockwise as well (it would rotate clockwise, but the direction got flipped as i(~.707-~.707k) is (~.707+~.707k)i due to anticommutativity)
Intuitively, the left-hand side rotates by half the specified angle, whereas the right-hand side is selective, rotating the opposite way for points on the axis of rotation, but the same way for points at right angles to points on the axis of rotation. This means that for points on the axis of rotation, the rotations cancel out, whereas for points perpendicular to the axis of rotations, the rotations by half the specified angle, double, resulting in the specified angle.