An integer p is *prime* if whenever p = ab with a,b Î \Bbb Z, either a = ±n or b = ±n .

[For sanity's sake, we will take the position that primes should
__also__ be ³ 2 .]

**Fundamental Theorem of Arithmetic:** Every integer n ³ 2 can be expressed as a product of primes; n = p_{1}·¼·p_{k} .

If we insist that the primes are written in increasing order, p_{1} £ ¼ £ p_{k}, then this
representation is *unique*.

**The Division Algorithm:** For any integers n ³ 0 and m > 0, there are *unique*
integers q and r with n = mq+r and 0 £ r £ m-1 .

[Note: this is also true for any integers n,m with m ¹ 0, although you need to replace ``m-1'' with ``|m-1|'' .]

The basic idea: keep repeatedly subtracting m from n until what's left is less than m.

Notation: b|a = ``b divides a'' = ``b is a divisor of a'' = ``a is a multiple of b'',
means a = bk for some integer k .

If b|a and a ¹ 0, then |b| £ |a| .

If a|b and b|c, then a|c

If a|c and b|d, then ab|cd

If p is prime and p|ab, then either p|a or p|b

Notation: (a,b) = gcd(a,b) = greatest common divisor of a and b

Different, equivalent, formulations for d = (a,b) :

(1) d|a and d|b, and if c|a and c|b, then c £ d .

(2) d is the smallest *positive* number that can be written as d = ax+by with a,b Î \Bbb Z .

(3) d|a and d|b, and if c|a and c|b, then c|d .

(4) d is the *only* divisor of a and b that can be expressed as d = ax+by with a,b Î \Bbb Z .

If c|a and c|b, then c|(a,b)

If c|ab and (c,a) = 1, then c|b

If a|c and b|c, and (a,b) = 1, then ab|c

If a = bq+r, then (a,b) = (b,r)

**Euclidean Algorithm:** This last fact gives us a way to compute (a,b), using the division algorithm:

Starting with a > b, compute a = bq_{1}+r_{1}, so (a,b) = (b,r_{1}).
Then compute b = r_{1}q_{2}+r_{2}, and repeat: r_{i-1} = r_{i}q_{i+1} +r_{i+1} .
Continue until r_{n+1} = 0, then
(a,b) = (b,r_{1}) = (r_{1},r_{2}) = ¼ = (r_{n},r_{n+1}) = (r_{n},0) = r_{n} .

Since b > r_{1} > r_{2} > r_{3} > ¼ , this process must end, by well-orderedrness.

We can reverse these calculations to recover (a,b) = ax+by, by rewriting each equation in our
algorithm as r_{i+1} = r_{i-1}-r_{i}q_{i+1}, and then repeatedly substituting the higher equations into the
lowest one, in turn, working up through the list of equations.

**Congruence modulo n :** Notation: a º b (mod n) (also written a\medspace \underset n® º \medspaceb) means n|(b-a)

Equivalently: the division algorithm will give the same remainder for a and b when you divide by n

Congruence mod n is an *equivalence relation*

The *congruence class* of a mod n is the collection of all integers congruent mod n to a:

[a]_{n} = {b Î \Bbb Z : a\medspace \underset n® º \medspaceb} = {b Î \Bbb Z : n|(b-a)}

**Fermat's Little Theorem.** If p is prime and (a,p) = 1, then a^{p-1} \medspace \underset p® º \medspace1

Because: (a·1)(a·2)(a·3)¼(a·(p-1)) \medspace \underset p® º \medspace 1·2·3¼(p-1) , and (1·2·3¼(p-1),p) = 1 . Same idea, looking at the a's between 1 and n-1 that are relatively prime to n (and letting f(n) be the number of them), gives

If (a,n) = 1, then a^{f(n)} \medspace \underset n® º \medspace1 .

If the prime factorization of n is p_{1}^{a1}¼p_{k}^{ak}, then f(n) = [p_{1}^{a1}(p_{1}-1)]¼[p_{k}^{ak}(p_{k}-1)]

The integers \Bbb Z, the integers mod n \Bbb Z_{n}, the real numbers \Bbb R, the complex numbers
\Bbb C are all *rings*.

A *homomorphism* is a function f:R® S from a ring R to a ring S satisfying:

for any r,r^{¢} Î R , f(r+r^{¢}) = f(r) + f(r^{¢}) and f(r·r^{¢}) = f(r) ·f(r^{¢}) .

The basic idea is that it is a function that ``behaves well'' with respect to addition and multiplication.

An *isomorphism* is a homomorphism that is both one-to-one and onto. If there is an isomorphism from R to S, we say
that R and S are *isomorphic*, and write R @ S .

Example: if (m,n) = 1, then \Bbb Z_{mn} @ \Bbb Z_{m}×\Bbb Z_{n} . The isomorphism is given by

f([x]_{mn}) = ([x]_{m},[x]_{n})

The main ingredients in the proof:

If f: R® S and y: R® T are ring homomorphisms, then the function w: R ® S×T given by w(r) = (f(r),y(r)) is also a homomorphism.

If m|n, then the function f: \Bbb Z_{n}® \Bbb Z_{m} given by f([x]_{n}) = [x]_{m} is a homomorphism.

Together, these give that the function we want above is a homomorphism. The fact that (m,n) = 1 implies that f is one-to-one; then the Pigeonhole Principle implies that it is also onto!

The above isomorphism and induction imply that if n_{1},¼n_{k} are *pairwise relatively prime* (i.e.,
if i ¹ j then (n_{i},n_{j}) = 1), then

\Bbb Z_{n1¼nk} @ \Bbb Z_{n1}×¼×\Bbb Z_{nk} . This implies:

**The Chinese Remainder Theorem:** If n_{1},¼n_{k} are pairwise relatively prime, then for any a_{1},¼a_{k} Î \Bbb N
the system of equations

x º a_{i} (mod n_{i}), i = 1,¼k

has a solution, and any two solutions are congruent modulo n_{1}¼n_{k} .

A solution can be found by (inductively) replacing a pair of equations x º a (mod n) , x º b (mod m), with a single equation x º c (mod nm), by solving the equation a+nk = x = b+mj for k and j, using the Euclidean Algorithm.

File translated from T