Algebraic Systems, Spring 2014, January, 2014 Edition

Gabriel Kerr

Contents

Chapter 0. Peano Axioms for Natural Numbers - An Introduction to Proofs 5 0.1. Sets and Logic 5 Exercises 7 0.2. Peano Axioms 8 Exercises 15 0.3. Relations 15 Exercises 19 Chapter 1. Basic Arithmetic 21 1.1. The set Z 21 Exercises 23 1.2. The Z 23 Exercises 27 1.3. Factoring integers, part I 27 Exercises 30 1.4. Factoring integers, part II 30 Exercises 32 1.5. Modular Arithmetic 32 Exercises 34 1.6. The fields Q and R 34 Exercises 39 1.7. The field C 39 Exercises 40

3

CHAPTER 0

Peano Axioms for Natural Numbers - An Introduction to Proofs

We begin this course with the construction of the system. The Peano Axioms form the heart of much of and lay the foundation for algebra and analysis. Every attempt will be made to stay away from unnecessary abstraction. This should be a guiding principle when working out the exercises as well!

0.1. Sets and Logic This section should serve as a very short introduction to 20th century mathe- matics. That is, it is an introduction to proofs involving sets. Set theory is in fact a subject within itself that was initiated and studied by many in the early 20th century. This was in response to several paradoxes that had come up. For us, a set is a collection of things, called elements. For example, Atoms could be the set of all atoms in the universe while Adams could be the set of all people named Adam in your family. You say there is no Adam in your family? Then Adams is known as the empty set which is the set that contains no elements at all. The notation for this important set is Adams = ∅. Unfortunately, this is just the beginning of new notation. Now that we know what sets are, we need a slew of symbols to describe how they work and interact with each other. First, we often write a set with only a few elements by enclosing the elements inside curly brackets. For example, if we wanted to write the set S of letters in the alphabet that occur before g we would write S = {a, b, c, d, e, f}. If you have a set with a lot of elements that are ordered, you can use the dot-dot- dot notation... For example the set of integers T between 3 and 600 and the set of integers T 0 greater than 5 can be written T = {3, 4, ..., 600} T 0 = {6, 7,...}. In general, we will be interested in stating whether something is or is not an element of a given set. If a is in A (which is the same thing as saying a is an element of A), we write a ∈ A while if it is not, we write a 6∈ A. For the above examples we could say a ∈ S but a 6∈ T and 5 ∈ T but 5 6∈ T 0. Sometimes we want to define a set that has elements in another set which satisfy a property. For example, if we want to consider atoms H that have only one proton we can write H = {a ∈ Atoms : a has one proton }.

5 6 0. PEANO AXIOMS FOR NATURAL NUMBERS - AN INTRODUCTION TO PROOFS

It is clear that any element of the set H is also an element of Atoms, after all, that was how H was defined. This is precisely what it means for H to be a subset of Atoms. To express this relationship we write H ⊆ Atoms. If we have two sets A and B, we can define a whole lot of new sets. We will sum many of these constructions (and one property) up in the following definition. Definition 0.1.1. Suppose A and B are sets. (1) The set A ∩ B is the intersection of A and B. It consists of elements c such that c ∈ A and c ∈ B. (2) Two sets A and B are called disjoint if A ∩ B = ∅. (3) The set A ∪ B is the union of A and B. It consists of elements c such that c ∈ A or c ∈ B. (4) The set A × B is the Cartesian product of A and B. It consists of elements c = (a, b) where a ∈ A and b ∈ B. Enough of the definitions. Let’s try proving something algebraic. Proposition 0.1.1 (Commutativity of intersection). If A and B are sets then A ∩ B = B ∩ A You may think about this a second and say “What’s the big deal? Of course this is true!”, but us mathematicians really need something better than “of course”... we need a proof! The way to prove a statement like this is to go back to the definition and methodically show that the definitions force the statement to be correct. This way of proving something is called a direct proof. Proof. Suppose c ∈ A ∩ B. Then, by definition, c ∈ A and c ∈ B which implies that c ∈ B and c ∈ A. But this means, again by definition, that c ∈ B ∩ A. Thus A ∩ B ⊆ B ∩ A. Conversely, suppose c ∈ B ∩ A. Then, by definition, c ∈ B and c ∈ A which implies that c ∈ A and c ∈ B. Again by definition, we get that c ∈ A ∩ B. Thus B ∩ A ⊆ A ∩ B. So every element in A ∩ B is an element of B ∩ A and vice-versa. This means that these two sets consist of the same elements and are therefore equal.  What should not be lost in this discussion is that a new term was introduced in the title of the proposition, namely commutativity. It simply means that a combined with b equals b combined with a for some way of combining things. It is one of the key ideas in algebra that can sometimes fail, and will come up repeatedly in the course. Leaving this fascinating stuff for later, let us return to sets. If you are generous and have a set that you would like to share with others, then you may be tempted to break it up into subsets and pass those subsets around. In fact, the idea of breaking up a set into subsets is a precise and important notion in mathematics whose definition is given below. Definition 0.1.2. A partition P of a set A is a collection of non-empty subsets, P = {Ai}i∈I indexed by I such that

(1) For any element a ∈ A, there is an i ∈ I such that a ∈ Ai. 0 (2) For any two distinct elements i, i ∈ I, the Ai and Ai0 are disjoint. EXERCISES 7

In this definition, the indexing set is arbitrary could be called J or √π or S 2 anything you want. The important thing is that you have a set P of subsets of Asatisfying (1) and (2). We will encounter many partitions as we progress through this course, but for now, let’s look at a simple example. Example 0.1.1. For our set Atoms, we can form the partition

P = {An}n∈{1,...,103} where An = {atoms with n protons}. Now let’s return back to relationships between sets. One way of relating two sets is by defining a function or a map from one to another. Here is the mathematical definition. Definition 0.1.3. Suppose A and B are sets. A function f from A to B is a subset f ⊂ A × B such that for every a ∈ A there exists exactly one element c = (a, b) ∈ f. A function can be denoted f : A → B There is a lot of notation that comes along with a function. For example, we write f(a) as the unique element b for which (a, b) ∈ f. We also call A the of f and B the codomain. This latter term should be prevalent in secondary school but is frequently confused with the different notion of range. The range of f is defined as the subset range(f) = {b ∈ B : there is an a ∈ A such that (a, b) ∈ f}. Connection 0.1.1. Most middle and high school texts (and too many college texts) content themselves with saying ’a function is an assignment’. This is a good description of what a function does, but perhaps not what a function is. Neverthe- less, a teacher can usually pull off this type of definition and use it successfully at the high school and early college level. A worse situation occurs when high school students are taught that functions always send real numbers to real numbers. This is a sad injustice that no student of Math 511 will perpetuate! However, a question from this type of thinking arises. Why does the vertical line test for graphs mean that a graph is defined by a function? Functions are most useful when they are combined and compared. The most common way of combining two functions f : A → B and g : B → C is by compo- sition. Definition 0.1.4. If f : A → B and g : B → C are functions then g◦f : A → C is defined as the set g ◦ f = {(a, g(f(a))) : a ∈ A}.

Exercises (1) Using the notation developed, write the set of vowels V and the set of integers I between −100 and 100. (2) Using your previous notation, write the set EI of even integers between −100 and 100. (3) Prove that if A ⊆ B then A ∩ B = A. 8 0. PEANO AXIOMS FOR NATURAL NUMBERS - AN INTRODUCTION TO PROOFS

(4) Prove that intersection is an associative operation. I.e. prove that if A, B and C are sets, then A ∩ (B ∩ C) = (A ∩ B) ∩ C

(5) Suppose P = {Ai}i∈I is a partition of A. Prove that the set

π = {(a, Ai): a ∈ Ai} ⊆ A × P defines a function π : A → P. (6) Give an example of a set A and two functions f and g with domain and codomain A such that f ◦ g 6= g ◦ f. (7) A function f : A → B is one to one if the equality f(a1) = f(a2) implies a1 = a2. (a) Give an example of a function that is one to one. (b) Give an example of a function that is not one to one. (8) A function f : A → B is onto if for every b ∈ B there exists an a ∈ A such that f(a) = b. (a) Give an example of a function that is onto. (b) Give an example of a function that is not onto. (c) Give an example of a function that is both onto and one to one.

0.2. Peano Axioms Let us now write down the basic ingredients that come together to produce the set of the natural numbers which is denoted N. Axiom 1. The number 0 is a natural number.

Another way of writing this axiom is 0 ∈ N. Even though we have just begun, the first axiom is not without some controversy. To some mathematicians, the natural numbers start with 1 instead of 0. We will adopt the more mainstream attitude though and keep Axiom 1 as it is written. Axiom 2. If n is a natural number, then n++ is also a natural number. In the context of Peano axioms, the notation n++ is stolen from Terrance Tao’s book on real analysis. He, in turn, stole it from the world of computer programming where it means to add 1 to the number n. The mathematical way of writing Axiom 2 is to say that there is a function ++ : N → N. Combining Axioms 1 and 2 gives us a way of writing some potentially new natural numbers! Definition 0.2.1. The number 3 is ((0++)++)++.

Let us try now to prove our first proposition about N. Proposition 0.2.1. The number 3 is a natural number. Proof. We work our way step by step to show that the proposition is true. • 0 is a natural number (Axiom 1). • 0++ is a natural number (Axiom 2). Let’s call this number 1 from now on! • 1++ is a natural number (Axiom 2). Let’s call this number 2 from now on! • 2++ is a natural number. 0.2. PEANO AXIOMS 9

We can appeal to Definition 0.2.1 for the meaning of 3 as ((0++)++)++ = 2++. So we conclude that it is indeed a natural number.  Before moving on, let’s pause and look over that proof again. Each step ap- pealed to either a definition or an axiom. We never made anything up (except the notation 1 and 2), and directly concluded that the statement in the proposition was true. Recall that this type of argument, i.e. an unraveling of definitions and axioms, was called a direct proof. Let’s return to the axioms. Axiom 3. The number 0 is not n++ for any natural number n. This axiom says that 0 is not in the range of the function ++. Axiom 4. If n++ is the same natural number as m++ then n and m are the same. To use the language of the last section, Axiom 4 states that the function ++ is one to one. We can now prove the following proposition. Proposition 0.2.2. 1 does not equal 2. We will do this by using what is called a proof by contradiction. Here’s how it works. Step 1) Assume the proposition is false. Step 2) Arrive at a contradiction. Step 3) Conclude that the assumption in Step 1) was false and therefor the propo- sition is true.

Proof. Following Step 1) we will assume that the proposition is false and that 1 does equal 2. Then, • 1 = 0++ and 2 = 1++ (Definitions of 1 and 2) • 0 = 1 (Axiom 4) • 0 = 0++ (Definition of 1 again) • 0 is n++ for a natural number n . This conclusion contradicts Axiom 3. We have reached a contradiction, so our initial assumption that 1 = 2 must be false. This means that the proposition is true.  Now that we are getting somewhere, let’s throw a real winner into the mix.

Axiom 5 (Induction). Given statements Pn for every natural number n. If

(A) P0 is true, (B) Pn implies Pn++ for every natural number n, then Pn is true for all natural numbers n. This axiom has a bit of vocabulary associated with it. Part (A) is usually called the base case and one can think of it as the first step of a ladder. Part (B) as a whole is called the induction step and can be thought of as saying: “if you can get to the n-th step on the ladder, then you can climb to the (n + 1)-st step”. The assumption in Part (B) that Pn is true is called the induction hypothesis. One immediate consequence to the induction axiom is the following proposition. 10 0. PEANO AXIOMS FOR NATURAL NUMBERS - AN INTRODUCTION TO PROOFS

Proposition 0.2.3. If n ∈ N then either n = 0 or n is obtained by applying ++ to 0 a finite number of times, but not both. Proof. Let’s try using induction here. The statement in the proposition can be written (Pn) Either n = 0 or n = (··· (0++) ··· )++ but not both. (A) Base case P0. The P0 case is true since 0 = 0 and 0 6= m++ by Axiom 3. (B) Now assume the statement Pn is true (or, with our new vocabulary, assume the induction hypothesis). Is Pn++ true? If n = 0 then n++ = 0++ and the statement is true. Otherwise n is obtained by successively applying ++ to 0. But then n++ is obtained by applying ++ to zero exactly one more time, which is still a finite number of times. Also, by Axiom 3 we again have that n 6= 0 since it is the result of applying ++. Thus Pn++ is true and the induction step is proven. Since we proved the base case and the induction step, we have proved that Pn is true for all n ∈ N by Axiom 5. But Pn being true for all n is the proposition, so the proposition is proved.  The upshot of this is that we can almost write down the natural numbers as the set N = {0, 1, 2, 3, 4, 5,...}. Connection 0.2.1. Induction is used throughout high school education. Ex- amples range from Gauss’ trick for adding the first 100 (or 103,211, or ...) numbers together to the binomial theorem. A high school calculus course can use induction to prove several formulas such as the power rule d xn = nxn−1. dx One should think of it as an essential instrument in the mathematical toolkit! We now use induction to prove that and multiplication are “well de- fined” operations. What does this mean? It means that they make sense. Before we can be sure they make sense though, we have to define them. Definition 0.2.2. Addition and multiplication, denoted + and · respectively, are binary operations (i.e. functions from N × N to N). Addition is defined as the operation that satisfies the following two properties for any m ∈ N: (i) m + 0 = m. (ii) m + (n++) = (m + n)++. Multiplication is defined as the operation that satisfies the following two properties for any m ∈ N (i) m · 0 = 0, (ii) m · (n + +) = m · n + m. This is what is known as an inductive definition. Let’s prove it makes sense. Proposition 0.2.4. For any natural numbers m and n, there exists a unique number m + n and a unique number m · n. Proof. We will prove the statement involving addition and leave the multi- plication case as an exercise. We prove this by induction (which means we use the axiom of induction to prove the statement). Take m to be any natural number and let Pn be the statement 0.2. PEANO AXIOMS 11

(Pn) There is a unique number m + n. (A) To prove P0 we just use property (i) to see m + 0 = m. (B) Now assume m + n is defined and unique. Then by property (ii), m + (n++) = (m + n)++ so that it is defined. Since m + n is unique, (m + n)++ is also uniquely defined by Axiom 2. Having proved both conditions (A) and (B), we have that Pn is true for all natural numbers n and the proposition is proved.  Try to prove this next proposition out for fun.

Proposition 0.2.5. If n ∈ N then n++ = n + 1. Rather than being coy about these operations and forestalling the inevitable, let’s write down straightaway the most important properties. We do this with the next two theorems which should be taken as foundational and important. In fact, without these theorems, practical arithmetic would be nearly impossible.

Theorem 0.2.1 (Algebraic properties of (N, +)). The following properties hold. Additive identity: For any n ∈ N, 0 + n = n = n + 0. Associativity of addition: For any three natural numbers l, m, n ∈ N, (0.1) (l + m) + n = l + (m + n) Commutativity of addition: For any two natural numbers m, n ∈ N, (0.2) m + n = n + m Cancellation law for addition: For any natural number n ∈ N, if n + m1 = n + m2, then m1 = m2. Proof. We prove these in order. Additive identity: The right hand equality n = n + 0 follows from Defi- nition 0.2.2, part (i). To see that 0 + n = n, we use induction. The base case is 0 + 0 = 0 which again follows from Definition 0.2.2, part (i). Now assume 0 + n = n. We need to prove that 0 + (n++) = n++. For this, we see 0 + (n++) = (0 + n)++ Definition 0.2.2, part (ii) = n++ Induction hypothesis Associativity of addition: Here we use induction on n with l and m fixed. For the base case, we need to prove (l + m) + 0 = l + (m + 0). But by the additive identity result we just proved, we see that (l+m)+0 = l+m and l + (m + 0) = l + (m) = l + m. So the base case is proven. Now assume equation (0.1) holds for n. We must prove (l + m) + (n++) = l + (m + (n++)). Observe, (l + m) + (n++) = ((l + m) + n)++ Definition 0.2.2, part (ii) = (l + (m + n))++ Induction hypothesis = l + (m + n)++ Definition 0.2.2, part (ii) = l + (m + (n++)) Definition 0.2.2, part (ii) 12 0. PEANO AXIOMS FOR NATURAL NUMBERS - AN INTRODUCTION TO PROOFS

Commutativity of addition: Induction again! First let’s show that m + 1 = m + + = 1 + m by induction on m. The base case of m = 0 is true by the additive identity and the definition of 1. Now the induction step can be shown by observing that (m++) + 1 = (m + 1) + 1 Proposition 0.2.5 = (1 + m) + 1 Induction hypothesis = 1 + (m + 1) Associativity of addition = 1 + (m++) Definition of m++ So we have shown that m + 1 = 1 + m for any m ∈ N. Now we want to do this for any n. Again we use induction, this time on n. The base case is simply the fact that 0 is an additive identity. Now for the induction step, m + (n++) = m + (n + 1) Proposition 0.2.5 = (m + n) + 1 Associativity of addition = (n + m) + 1 Induction hypothesis = n + (m + 1) Associativity of addition = n + (1 + m) Commutativity of 1 and m = (n + 1) + m Associativity of addition = (n++) + m Proposition 0.2.5 Cancellation law for addition: Guess what we use... you got it, induc- tion on n! Base case is the statement that if 0 + m1 = 0 + m2, then m1 = m2. This follows immediately from 0 being the additive identity. Now for the induction step. Let us assume the statement is true for n and suppose that (n++) + m1 = (n++) + m2. Then

(n + m1)++ = (n + m1) + 1 Proposition 0.2.5

= (n + 1) + m1 Associativity and commutativity

= (n++) + m1 Proposition 0.2.5

= (n++) + m2 Assumption

= (n + 1) + m2 Proposition 0.2.5

= (n + m2) + 1 Associativity and commutativity

= (n + m2)++ Proposition 0.2.5

But by Axiom 4, this equality implies that n + m1 = n + m2. By the induction hypothesis, this means that m1 = m2.  Before proving a similar theorem for multiplication, it will help to have a prop- erty that involves both operations. Theorem 0.2.2 (Distributive Property). If l, m and n are any natural numbers, then l · (m + n) = l · m + l · n (l + m) · n = l · n + m · n 0.2. PEANO AXIOMS 13

Proof. We will prove that multiplication is left distributive which is the first of the two equations. The proof that it is right distributive will be left as an exercise. We use induction on n. The base case can be shown as l · (m + 0) = l · m, Additive identity = l · m + 0, Additive identity = l · m + l · 0. Definition 0.2.2 Now assume the theorem is true for n. Then l · (m + (n++)) = l · ((m + n)++), Definition 0.2.2 = l · (m + n) + l, Definition 0.2.2 = (l · m + l · n) + l, Induction hypothesis = l · m + (l · n + l), Associativity of addition = l · m + l · (n++). Definition 0.2.2

This concludes the proof of the induction step and the theorem. 

Now let us establish the algebraic properties of multiplication in N. Theorem 0.2.3 (Algebraic properties of (N, ·)). following properties hold. Multiplicative identity: For any n ∈ N, 1 · n = n = n · 1. Associativity of multiplication: For any three natural numbers l, m, n, (0.3) (l · m) · n = l · (m · n) Commutativity of multiplication: For any two natural numbers m, n, (0.4) m · n = n · m Cancellation rule for multiplication: For any natural number n, if

n · m1 = n · m2 6= 0

then m1 = m2. Proof. We examine these in order. Multiplicative identity: Let us prove this by induction on n. The base case states 1 · 0 = 0 = 0 · 1. The left equation follows from Definition 0.2.2. The right follows from this definition as well and the definition that 1 = 0 + + via the equation 0 · 1 = 0 · (0++) = 0 · 0 + 0 = 0 + 0 = 0. In the last equation we used the additive identity. Now assume 1 · n = n = n · 1. Then 1·(n++) = 1·n+1 = n+1 = n++ by the induction hypothesis and Proposition 0.2.5. For the other side we have (n++)·1 = (n++)·(0++) = [(n++) · 0] + n++ = 0 + n++ = n++. Associativity of multiplication: Again we proceed by induction on n. The base case is easily established l · (m · 0) = l · 0, Definition 0.2.2 = 0, Definition 0.2.2 = (l · m) · 0. Definition 0.2.2 14 0. PEANO AXIOMS FOR NATURAL NUMBERS - AN INTRODUCTION TO PROOFS

Now assume the induction hypothesis. Then l · (m · (n++)) = l · (m · n + m), Definition 0.2.2 = l · (m · n) + l · m, Distributive property = (l · m) · n + (l · m), Induction hypothesis = (l · m) · (n + 1), Distributive property = (l · m) · (n++). Proposition 0.2.5 Commutativity of multiplication: Again we use induction on n. For the base case we have 0 = m · 0. On the other hand, for any m, we also need to show that 0 · m = 0. For this, observe 0 · m + 0 = 0 · m = (0 + 0) · m = 0 · m + 0 · m. By the cancellation property for addition, this implies 0 = 0 · m. Thus, 0 · m = 0 = m · 0 for all m. Now let us prove the induction step. Observe m · (n++) = m · n + m, Definition 0.2.2 = n · m + m, Induction hypothesis = n · m + 1 · m, Multiplicative identity = (n + 1) · m, Distributive property = (n++) · m. Proposition 0.2.5

Cancellation for multiplication: Let us prove this by induction on m1. If m1 = 0 then n · m1 6= 0 is false which implies the statement is true vacuously (this means that an implication A ⇒ B is true if A is false). So the base case is established. Now assume cancellation is true for m1. Assume n·(m1++) = n·m2. If m2 = 0, then n·(m1++) = n·m2 = 0 which 0 violates the assumption. Thus m2 6= 0 and there is a natural number m2 0 such that m2 = m2++. Thus,

n + n · m1 = n · m1 + n, Commutativity of addition

= n · (m1++), Definition 0.2.2

= n · m2, Assumption 0 0 = n · (m2++), Definition of m2 0 = n · m2 + n, Definition 0.2.2 0 = n + n · m2. Commutativity of addition 0 By the cancellation property of addition, this implies that n · m1 = n · m2. 0 By the induction hypothesis, this implies m1 = m2 and thus m1++ = 0 m2++ = m2. This proves the induction step.  The associative property for a binary operation gives us the ability to forget about the order in which we combine things altogether. For example, ((n · m) · k) · (l · r) = n · (((m · k) · l) · r) for any natural numbers. It is helpful to have this as a general fact about any binary operation which is the content of the next theorem. Theorem 0.2.4 (Generalized associativity). If a binary operation ∗ on a set A is associative, then combining n elements of A using ∗ does not depend on the order of combination. 0.3. RELATIONS 15

The following proof is included for completeness, but it can be left for later reading. In it, we assume that composition of functions satisfies generalized asso- ciativity. This can be easily proved independently. Proof. Let us consider the combination of two elements. In fact, this is given by the function ∗ : A × A → A. If we consider (a ∗ b) ∗ c , this is given by ∗ ◦ (∗ × 1) : A × A × A → A, while a ∗ (b ∗ c) is given by ∗ ◦ (1 × ∗): A × A × A → A. So the associative operation is just the equality of functions ∗ ◦ (∗ × 1) = ∗ ◦ (1 × ∗). n n n−1 Now define the map mk : ×i=1A → ×i=1 A to be the identity on the first (k − 1) factors and the last n − k − 1 factors, and to be the operation ∗ on the k-th 6 and (k + 1)-st factors. For example, m4(a, b, c, d, e, f) = (a, b, c, d ∗ e, f) while 6 m1(a, b, c, d, e, f) = (a ∗ b, c, d, e, f). With this notation, we can write (a ∗ b) ∗ (c ∗ d) 2 3 4 as (m1 ◦ m1 ◦ m3)(a, b, c, d). The notation also allows us to rephrase the theorem as the following statement:

n Claim: For every natural number n there is a map Mn : ×i=1A → A such that for any sequence of natural numbers i2, . . . , in with 0 < ij < j, M = m2 ◦ m3 ◦ m4 ◦ · · · ◦ mn n i2 i3 i4 in Let us prove this claim by induction on n. The base case starts with n = 2 for which it is clear that we can let M2 = ∗. Now assume the claim for n and observe that for any sequence i1, . . . , in+1, the composition m2 ◦ m3 ◦ m4 ◦ · · · ◦ mn ◦ mn+1 = M ◦ mn+1 i2 i3 i4 in in+1 n in+1 n+1 by the induction hypothesis. So define Mn+1 = Mn◦m1 . Now we need only prove n+1 n+1 that Mn ◦mk = Mn ◦m1 for any k between 2 and n. To see this, observe that if k ≥ 2 there is a sequence i , . . . , i = k−1 for which M = m2 ◦m3 ◦m4 ◦· · ·◦mn . 1 n n i2 i3 i4 in n n+1 n n+1 But the associative property gives us that mk−1 ◦ mk = mk−1 ◦ mk−1 so that M ◦ mn+1 = m2 ◦ m3 ◦ m4 ◦ · · · ◦ mn ◦ mn+1, n k i2 i3 i4 k−1 k = m2 ◦ m3 ◦ m4 ◦ · · · ◦ mn ◦ mn+1, i2 i3 i4 k−1 k−1 n+1 = Mn ◦ mk−1 . n+1 n+1 n+1 Thus Mn ◦ mk = Mn ◦ mk−1 = ··· = Mn ◦ m1 = Mn+1, proving the claim and the theorem.  Exercises (1) Prove the power rule by induction. (2) Prove Proposition 0.2.4 for the operation of multiplication. (3) Prove Proposition 0.2.5. (4) Prove the right distributive property: For any l, m, n ∈ N, (l + m) · n = l · n + m · n.

0.3. Relations We saw in the first section that a function is defined as a subset of a Cartesian product of sets satisfying a particular property. The idea of a relation is similar to this, but without the additional property. Definition 0.3.1. A binary relation on a set A is a subset R ⊆ A × A. 16 0. PEANO AXIOMS FOR NATURAL NUMBERS - AN INTRODUCTION TO PROOFS

There are some key properties that a relation might satisfy. These terms per- meate common language because of their relationship to basic logic. Definition 0.3.2. Let R ⊆ A × A be a binary relation. (1) R is called reflexive if (a, a) ∈ R for every a ∈ A. (2) R is called symmetric if (a, b) ∈ R implies (b, a) ∈ R for every a, b ∈ A. (3) R is called antisymmetric if (a, b), (b, a) ∈ R implies a = b (4) R is called transitive if (a, b), (b, c) ∈ R implies (a, c) ∈ R for every a, b, c ∈ A. Let’s take some time to humanize these properties. Example 0.3.1. Suppose A is the set of all of the people in Kansas. The relation R(−blank−) is defined as (a, b) ∈ R(−blank−) if and only if a -blank- b Which of the properties in Definition 0.3.2 are satisfied by R(has had lunch with), R(has the same color hair as), R(is a step sibling of) and R(loves)? There are a couple of relations that have great utility in mathematics. First, let’s go back to preschool and make sure that we understand the “size” of a number. Definition 0.3.3. A (non-strict) partial order on a set A is a binary relation R that is reflexive, antisymmetric and transitive. A set with a partial order is sometimes called a poset. Now, as promised, we return to our early youth with the following definition.

Definition 0.3.4. If a, b ∈ N we say that a is greater than or equal to b, written a ≥ b if there exists c ∈ N such that a = b + c.

This definition is the same as giving the relation R≥ ⊂ N × N defined by

a ≥ b if and only if (a, b) ∈ R≥. Let’s establish that ≥ is indeed a partial order on N. Theorem 0.3.1. The relation a ≥ b is a partial order on N. Proof. We need to show that the relation is reflexive, antisymmetric and transitive. Reflexive: Exercise. Antisymmetric: We need to prove If a ≥ b and b ≥ a then a = b. 0.3. RELATIONS 17

By definition, there are natural numbers c1 and c2 such that

a = b + c1

b = a + c2

So that a + 0 = a = b + c1 = (a + c2) + c1 = a + (c2 + c1). But by the cancellation law for addition we have that 0 = c2 + c1. If c1 6= 0, then c1 = c + + for some c ∈ N by Proposition 0.2.3. But then 0 = (c2 + c)++ which contradicts Axiom 3. Thus c1 = 0 and a = b + c1 = b + 0 = b which proves antisymmetry. Transitive: Exercise.  In fact, the relation ≥ has an additional property, making it a total order. Proposition 0.3.1. If a and b are natural numbers, then either a ≥ b or b ≥ a. Proof. Let us prove this by induction on a. The base case of a = 0 is true since for any b we have b = 0 + b so that b ≥ 0. Now assume the proposition is true for a. Assume b is any natural number. If a ≥ b then since a++ = a + 1 we have a++ ≥ a ≥ b so the transitive property implies a++ ≥ b. On the other hand, if b ≥ a, then b = a + n for some n ∈ N. If n = 0 then b = a and a++ ≥ b. If n 6= 0 then n = m++ for some natural number m and b = a + (m++) = a + m + 1 = (a++) + m so that b ≥ a++. This concludes the proof.  The following theorem is a very useful and important property of subsets of N. Theorem 0.3.2 (Well ordering principle). Given any non-empty subset A ⊆ N, there exists a unique smallest element a ∈ A. By the smallest element, we mean an element a ∈ A such that if b ∈ A then b ≥ a.

Proof. We use induction for this theorem. First, assume that A ⊆ N does not contain a smallest element. Now let Pn be the statement If m ∈ N such that n ≥ m then m 6∈ A Let us show the base case is true. Clearly, if 0 ≥ m then m = 0, but m is less than or equal to all natural numbers and so m 6∈ A (for otherwise it would be a smallest element). Now if Pn is true, but Pn++ is false, then n ∈ A and there is no m strictly less than n such that m ∈ A. But then for every m ∈ A we must have m ≥ n which means n is a smallest element. This is a contradiction, so Pn++ is true and we have proven Pn for all n. This means that there is no natural number n ∈ A and thus, since A ⊆ N, A must be the empty set. In conclusion, if A is non-empty, then it must have a smallest element (for otherwise the above argument would show it to be empty).  A partial order is not the only type of binary relation that is important to us. As we will see very shortly, the following notion may be even more important in algebra. Definition 0.3.5. A binary relation R on a set A is an equivalence relation if it is reflexive, symmetric and transitive. 18 0. PEANO AXIOMS FOR NATURAL NUMBERS - AN INTRODUCTION TO PROOFS

As we saw above with ≥, often it is convenient to denote a relation with a symbol separating two elements of the set. We can do this generally for a binary relation R ⊆ A × A by writing

a ∼R b if and only if (a, b) ∈ R. This is just notation to indicate the relation as a “relationship” between elements. For example, in this notation, R is a transitive relation if and only if

a ∼R b and b ∼R c implies a ∼R c. So what can we do with a relation R on A? Well, we can take each element a ∈ A and make it into a subset [a]R, called the equivalence class of a, by defining

(0.5) [a]R := {b ∈ A : a ∼R b}. If we have a fixed relation that we know about, we will just write [a] instead of [a]R. By the way, the notation := means that we define the left hand side by the right hand side. A cool fact comes up when R is an equivalence relation. Proposition 0.3.2. Assume R is an equivalence relation on A. For any a, b ∈ A either [a] = [b] or [a] is disjoint from [b]. Proof. We can do this directly. Suppose [a] and [b] are not disjoint, then there is a c ∈ [a] ∩ [b]. Now suppose d ∈ [a]. Since c is in [a] we have a ∼R c and since R is symmetric c ∼R a. Since d is in [a] we have a ∼R d. Thus c ∼R a and a ∼R d which implies c ∼R d by the transitivity of R. On the other hand, since c ∈ [b] we have b ∼R c. Since b ∼R c and c ∼R d we get b ∼R d which implies d ∈ [b]. Thus [a] ⊆ [b]. But switching the a and b in the above argument shows [b] ⊆ [a]. Thus [a] = [b] as was to be shown.  For an equivalence relation R on A we can define A (0.6) := {S ⊆ A : there is an a ∈ A such that S = [a]}. ∼R If Cartesian products are the set theory analog of products of numbers (which they are), then A is the set theory analog of a quotient. ∼R Theorem 0.3.3. If R is an equivalence relation then A is a partition of A. ∼R Proof. By definition, we have that if S and S0 are in A then there is an a ∼R and b such that S = [a] and S0 = [b]. By Proposition 0.3.2, we know that either S = S0 which means they are the same element in A or they are disjoint. Thus ∼R property (2) in Definition 0.1.2 is satisfied. To see property (1), namely that every element a ∈ A is an element of some S ∈ A , simply observe that [a] ∈ A by ∼R ∼R definition. But since R is reflexive, a ∼R a and a ∈ [a].  It is hard to overstate the importance of this last theorem. It manifests itself in a huge number of constructions in algebra, geometry and analysis. The idea that an equivalence relation makes partitions means that a ∼R b can be thought of as saying a is equal to b in some R sense. So if we want to think about a in the R sense of equality, we only need to think of the element [a] ∈ A . For example, say ∼R we think of the set of students S in the class. We can define an equivalence relation R as a ∼R b if and only if student a and student b get the same letter grade. Then the quotient S is the list of grades that the students will receive. Mike and Mary ∼R EXERCISES 19 are equal from the perspective of ∼R if they get the same grade, otherwise they are not equal. The map π : S → S from the exercises in Section 0.1 will be equal on ∼R R-equivalent elements and will be distinct on R-inequivalent elements.

Exercises (1) Give an example of a binary relation on a set A that satisfies exactly two of the conditions in Definition 0.3.2. (2) Prove the reflexive and transitive properties in Theorem 0.3.1. (3) Give an example of a partially ordered set that does not satisfy the well ordering principle. (4) Show that there is a converse to Theorem 0.3.3 in the following sense. If P is a partition of A, define a relation R = {(a, b) ∈ A × A : there exists S ∈ P such that a, b ∈ S}. Prove that (a) ∼R is an equivalence relation. (b) P = A . ∼R

CHAPTER 1

Basic Arithmetic

While the title of this chapter may strike the college upper class-men as slightly offensive, it is my hope that the impression will be overcome by a study of its contents. For many mathematicians, a modern viewpoint on arithmetic is more subtle and complicated than several other advanced sounding subjects. So what do I mean by arithmetic? I mean working with integers and their basic operations.

1.1. The set Z In this section we utilize the construction of the natural numbers N to construct the integers Z. Let us first define the binary relation ∼ on N × N via

(1.1) (a, b) ∼ (c, d) if and only if a + d = b + c.

There are some fundamental facts about this relation that we now establish.

Proposition 1.1.1. The following statements hold with respect to relation 1.1. (1) The relation ∼ is an equivalence relation. (2) For every (a, b) there exists a unique natural number c ∈ N for which either (a, b) ∼ (0, c) or (a, b) ∼ (c, 0) with both occurring if and only if c = 0. (3) If (a, b) ∼ (a0, b0) and (c, d) ∈ N × N then

(1.2) (a + c, b + d) ∼ (a0 + c, b0 + d).

(4) If (a, b) ∼ (a0, b0) and (c, d) ∈ N × N then

(1.3) (a · c + b · d, a · d + b · c) ∼ (a0 · c + b0 · d, a0 · d + b0 · c)

Proof. We will prove the first two properties and leave the last two as exer- cises. (1) We need to prove that ∼ is reflexive, symmetric and transitive. reflexive: Let (a, b) ∈ N × N then a + b = a + b since addition is well defined. By definition of ∼, this implies (a, b) ∼ (a, b) and so ∼ is reflexive. symmetric: Suppose (a, b) ∼ (c, d). Then c + b = b + c = a + d = d + a by commutativity of addition. Thus (c, d) ∼ (a, b) which shows that ∼ is symmetric.

21 22 1. BASIC ARITHMETIC

transitive: Now assume (a, b) ∼ (c, d) and (c, d) ∼ (e, f). Then d + (a + f) = (d + a) + f, associativity = (a + d) + f, commutativity = (b + c) + f, definition of ∼ = b + (c + f), associativity = b + (d + e), definition of ∼ = (d + e) + b, commutativity = d + (e + b), associativity = d + (b + e). commutativity By the cancellation property in Theorem 0.2.1, this implies that a + f = b + e which in turn yields (a, b) ∼ (e, f). Thus ∼ is transitive. (2) We first show the existence of such a c. Let us consider the equivalence class of the pair (a, b) which is defined as

[(a, b)]∼ := {(c, d) ∈ N × N :(a, b) ∼ (c, d)}. This is the set of elements that are ∼-equivalent to (a, b). Now we define another set,

S(a,b) = {c ∈ N : there exists d ∈ N such that (c, d) ∈ [(a, b)]∼}.

Note that S(a,b) is non-empty since a ∈ S(a,b). Thus, by the Well Ordering Principle of N, there is a smallest element e ∈ S(a,b). If e = 0 then there is an element (0, c) ∈ [(a, b)]∼ and we have shown existence. If e > 0, then we claim (e, 0) ∈ [(a, b)]∼. If not, then (e, f) ∈ [(a, b)]∼ with e > 0 and f > 0. Thus f = f˜+ 1 and e =e ˜+ 1 for natural numberse, ˜ f˜. Note e > e˜ and e + f˜ = (˜e + 1) + f,˜ definition ofe ˜ =e ˜ + (1 + f˜), associativity =e ˜ + (f˜+ 1), commutativity =e ˜ + f, definition of f˜ = f +e. ˜ commutativity ˜ ˜ Thus (e, f) ∼ (˜e, f) implying (˜e, f) ∈ [(a, b)]∼ ande ˜ ∈ S(a,b). But since e > e˜ and e was assumed to be the smallest element of S(a,b), we have achieved a contradiction. So we must have that (e, 0) ∈ [(a, b)]∼ showing the existence of c. Now we come to uniqueness. There are three options to consider. • Suppose (c, 0) ∼ (a, b) ∼ (c0, 0). Then, since ∼ is transitive (c, 0) ∼ (c0, 0), we have c = c + 0 = 0 + c0 = c0. • Suppose (c, 0) ∼ (a, b) ∼ (0, c0). Then, since ∼ is transitive (c, 0) ∼ (0, c0), we have c + c0 = 0 + 0 = 0. But this implies that c0 = 0 = c (otherwise 0 = n++ for some natural number n, violating Axiom 3). • Suppose (0, c) ∼ (a, b) ∼ (0, c0). Then, since ∼ is transitive (0, c) ∼ (0, c0), we have c0 = 0 + c0 = c + 0 = c.  1.2. THE RING Z 23

Do not worry, it is OK if you are feeling lost. This proposition may have looked looked arbitrary and unnecessary, but now let’s see the motivation by thinking about the next definition.

Definition 1.1.1. The set of integers, denoted Z is the quotient × (1.4) = N N Z ∼ If (a, b) ∼ (c, 0), we denote [(a, b)]∼ by c. If (a, b) ∼ (0, c) for c > 0, we denote [(a, b)]∼ by −c. Thus, we have introduced negative numbers by partitioning relative to the equivalence relation ∼. Let’s extend the order ≥ to the integers.

Definition 1.1.2. We write [(a, b)]∼ ≥ [(c, d)]∼ if and only if a + d ≥ b + c. Nearly all of the properties that held for ≥ on N hold for Z, except the Well Ordering Principle. We write this as a proposition and leave the proof as an exercise.

Proposition 1.1.2. The following properties hold for the relation ≥ on Z. (1) ≥ is a partial order. (2) If [(a, b)]∼, [(c, d)]∼ ∈ Z then either [(a, b)]∼ ≥ [(c, d)]∼ or [(c, d)]∼ ≥ [(a, b)]∼. Before moving on, we should assess what we have and what we do not have! What we have is the set of integers Z. However, we do not yet have arithmetic of the integers. In fact, we do not even know how to add or multiply two integers, much less whether these operations satisfy the properties in Theorem 0.2.1.

Exercises

(1) Write each of the integers [(2, 4)]∼ and [(5, 4)]∼ in the form ±c for an appropriate natural number c. (2) Prove part (3) of Proposition 1.1.1. (3) Prove part (4) of Proposition 1.1.1. (4) Draw N × N in the Cartesian plane. Highlight the equivalence classes [(0, 0)]∼ and [(0, 2)]∼. (5) Prove Proposition 1.1.2.

1.2. The ring Z Having defined the integers as a set, we now want to extend our arithmetic to include these negative numbers. Before we do this, let us introduce a very general definition which we will come back to later on in the text. Definition 1.2.1. A ring R is a set with two binary operations called addition ( + ) and multiplication ( · ), satisfying the following properties. Identities: There are elements 0 and 1 that are additive and multiplicative identities. Associativity: Both + and · are associative operations. Commutativity of addition: The addition operation is commutative. Distributive property: Multiplication is left and right distributive. Additive inverse: For every r ∈ R, there exists an element −r such that r + (−r) = 0. 24 1. BASIC ARITHMETIC

If multiplication is commutative, we call R a commutative ring.

Now our goal is to show that Z is one of these commutative rings, but first we need to define addition and multiplication.

Definition 1.2.2. If [(a1, b1)]∼ and [(a2, b2)]∼ are integers then define

(1.5) [(a1, b1)]∼ + [(a2, b2)]∼ = [(a1 + a2, b1 + b2)]∼

(1.6) [(a1, b1)]∼ · [(a2, b2)]∼ = [(a1 · a2 + b1 · b2, a1 · b2 + b1 · a2)]∼ As before, it is necessary to prove that these definitions make sense. To do this, we must show that if we represented the equivalence class by different elements, then the resulting sum and product would be the same equivalence class.

Proposition 1.2.1. Addition and multiplication are well defined on Z. 0 0 0 0 Proof. We need to prove that if (a1, b1) ∼ (a1, b1) and (a2, b2) ∼ (a2, b2) then 0 0 0 0 (a1 + a2, b1 + b2) ∼ (a1 + a2, b1 + b2)(1.7) 0 0 0 0 0 0 0 0 (1.8) (a1 · a2 + b1 · b2, a1 · b2 + a2 · b1) ∼ (a1 · a2 + b1 · b2, a1 · b2 + a2 · b1) We will prove equation 1.7 and leave equation 1.8 as an exercise. Observe

0 0 (a1 + a2, b1 + b2) ∼ (a1 + a2, b1 + b2), Proposition 1.1.1, part (3) 0 0 ∼ (a2 + a1, b2 + b1), Commutativity of addition 0 0 0 0 ∼ (a2 + a1, b2 + b1), Proposition 1.1.1, part (3) 0 0 0 0 ∼ (a1 + a2, b1 + b2). Commutativity of addition  It may seem that we took a very hard route to defining the integers in the last section. However, this construction allows us to prove the following theorem with ease.

Theorem 1.2.1. The integers Z form a commutative ring. Proof. We will prove some of the properties and leave others as exercises. In the interest of saving space, we drop the · notation and write [(a, b)]∼ as [a, b]. Identities: Exercise. Associativity: We leave the proof that addition is associative as an exercise. Here we prove it for multiplication. Let ∗ = ([a1, b1][a2, b2])[a3, b3], then using Definition 1.2.2, Theorems 0.2.1, 0.2.2 and 0.2.3 we have

∗ = ([a1a2 + b1b2, a1b2 + b1a2])[a3, b3]

= [(a1a2 + b1b2)a3 + (a1b2 + b1a2)b3, (a1a2 + b1b2)b3 + (a1b2 + b1a2)a3]

= [a1a2a3 + b1b2a3 + a1b2b3 + b1a2b3, a1a2b3 + b1b2b3 + a1b2a3 + b1a2a3]

= [a1(a2a3 + b2b3) + b1(a2b3 + b2a3), a1(a2b3 + b2a3) + b1(a2a3 + b2b3)]

= [a1, b1][a2a3 + b2b3, a2b3 + b2a3]

= [a1, b1]([a2, b2][a3, b3]) Commutativity: Exercise. 1.2. THE RING Z 25

Distributive Property: We show that multiplication is left distributive. It can then be shown to be right distributive by commutativity of multi- plication. Repeatedly using Definition 1.2.2 and Theorems 0.2.1,0.2.2 we have [a, b]([c, d] + [e, f]) = [a, b][c + e, d + f], = [a(c + e) + b(d + f), a(d + f) + b(c + e)], = [(ac + bd) + (ae + bf), (ad + bc) + (af + be)], = [ac + bd, ad + bc] + [ae + bf, af + be], = [a, b][c, d] + [a, b][e, f].

Additive inverse: This is the property that really separates Z from N. In the latter case, there are no additive inverses. But here we have, if [a, b] ∈ Z, then let −[a, b] = [b, a]. Observe that [a, b] + (−[a, b]) = [a, b] + [b, a] = [a + b, b + a]. The additive identity is [0, 0]. But since (a + b) + 0 = (b + a) + 0, equation 1.1 gives us that (a + b, b + a) ∼ (0, 0). Thus [a, b] + (−[a, b]) = [a + b, b + a] = [0, 0] proving the existence of an additive inverse.  This theorem gives us the capability to add and multiply integers without excessive brackets and with the freedom to reorder the summands and factors in any way we choose. Now that we have these essential properties established, we will write integers as c and −c instead of as equivalence classes [a, b], and use the latter notation only in proofs when necessary. We will also use subtraction, which is defined by the equation a − b := a + (−b). Note that such a definition makes sense for any ring. Connection 1.2.1. Formally proving the basic properties of arithmetic may not be a part of the secondary school curriculum. However, the properties them- selves are a part of the curriculum and being able to explain why these properties are true is very important. Consider ways in which you would explain associativity of addition or commutativity of multiplication. There is much to say about the integers as a ring, but let’s start by proving that the rules hold for inequalities.

Theorem 1.2.2. The following properties hold for any a, b, c ∈ Z. (1) If a ≥ b then a + c ≥ b + c. (2) If a ≥ b and c ≥ 0, then a · c ≥ b · c. (3) If a ≥ b and c < 0, then a · c ≤ b · c. Furthermore, strict inequalities can be used instead of non-strict inequalities.

Proof. Let a = [a1, a2], b = [b1, b2] and c = [c1, c2] and observe that the hypothesis in each property contains the statement that a ≥ b which holds if and only if

(1.9) a1 + b2 ≥ a2 + b1. 26 1. BASIC ARITHMETIC

We prove the properties for the non-strict case in order and leave the strict case as an optional exercise. (1) Note that this statement is true if a, b and c are natural numbers because if a ≥ b then there exists d such that a = b + d. But then the same d must satisfy a + c = (b + c) + d implying a + c ≥ b + c. For the general case of integers. Equation (1.9) implies that (a1 +c1)+(b2 +c2) ≥ (a2 +c2)+(b1 +c1) which in turn shows [a1 +c1, a2 +c2] ≥ [b1 +c1, b2 +c2]. Using the definition of addition in Z we then get a + c ≥ b + c. (2) Again, let us verify this for natural numbers first. We see that if a = b + d then a · c = b · c + d · c by the distributive property. Thus a · c ≥ b · c. In case of integers, multiplying equation (1.9) on both sides by c gives c · a1 + c · b2 ≥ c · a2 + c · b1 (we can do this by the argument for natural numbers and because c ∈ N). But this is equivalent to [c · a1, c · a2] ≥ [c · b1, c · b2] or c · a ≥ c · b. (3) If c < 0, then we can choose c = [0, n] for some natural number n. By the definition of multiplication, we have c · a = [n · a2, n · a1] and c · b = [n·b2, n·b1]. Equation (1.9) and the previous property imply n·b2 +n·a1 ≥ n · b1 + n · a2 which is equivalent to c · b ≥ c · a.  Connection 1.2.2. This theorem establishes the properties needed to solve linear inequalities, a skill in the common core standards. Usually in secondary school, they are called rules instead of properties because a rule is not expected to be proven. However, we still should be able to explain a rule. How would you explain these rules to a student?

We now show that the cancellation property holds for Z. We follow an abstract path that will generalize to a broad class of rings. Definition 1.2.3. A non-zero ring is called a domain if for any two elements r, s ∈ R, the equation r · s = 0 implies r = 0 or s = 0. It is called an if it is a commutative domain. Now that we have the essential terminology, let’s prove a simple proposition.

Proposition 1.2.2. The ring Z is an integral domain. Proof. Since we know it is a commutative ring, we need only show that r·s = 0 implies r = 0 or s = 0. First observe that for any integer n, 0 · n = (0 + 0) · n = 0 · n + 0 · n and subtracting 0 · n from both sides we have 0 · n = 0. We can prove this by contradiction. If r 6= 0 and s 6= 0 then one of four possibilities can occur. By Exercise 6 either r > 0 or r < 0, and either s > 0 or s < 0. If r > 0 then by Theorem 1.2.2, 0 = r · s > r · 0 = 0 or 0 = r · s < r · 0 = 0, both of which are contradictions (since a > b is defined to be a ≥ b and a 6= b). On the other hand, if r < 0 then by Theorem 1.2.2, 0 = r · s < r · 0 = 0 or 0 = r · s > r · 0 = 0, yielding another set of contradictions. Thus either r or s must be 0.  The upshot of this is the following theorem. Theorem 1.2.3 (Cancellation for rings). Let R be a ring and a, b, c ∈ R. Cancellation for addition: If a + b = a + c, then b = c. 1.3. FACTORING INTEGERS, PART I 27

Cancellation for multiplication: If R is a domain, a 6= 0 and a·b = a·c, then b = c. Proof. Cancellation for addition is left as an exercise. To prove cancellation for multiplication, assume a · b = a · c. Then a · (b − c) = a · b − a · c, Distributive property = a · c − a · c, Assumption = 0. Definition of additive inverse Since R is a domain, this implies that either a = 0 or b − c = 0. Since a 6= 0 by assumption, we have that b − c = 0 and so b = (b − c) + c = 0 + c = c which concludes the proof.  You may ask why we wrote a proof for a ring instead of for Z. The answer is that this property comes in handy for several rings later on, and is brings out the essential argument we need in the case of Z. Of course, we can also apply this to the integers as our first Corollary! Corollary 1.2.1. The integers have cancellation for addition and multiplica- tion.

Proof. By Proposition 1.2.2, Z is an integral domain and therefore a domain. By Theorem 1.2.3, it has both cancellation properties.  Exercises

(1) Give an example of a ring that is not Z (you do not need to prove that it is a ring). (2) Prove that multiplication is well defined on Z by verifying equation 1.8. (3) Using Definition 1.2.2, show that 0 = [(0, 0)]∼ and 1 = [(1, 0)]∼ are the additive and multiplicative identities, respectively. (4) Prove that addition in Z is associative. (5) Prove that addition and multiplication are commutative in Z. (6) Prove that if c is an integer, then −c = (−1) · c. Conclude that every integer is either a natural number or the negative of a natural number.

1.3. Factoring integers, part I We know by the Peano Axioms that every integer can be written as a sum of 1’s or −1’s. However, decomposing an integer as a product into elementary factors is a more subtle game. For this, we first introduce a definition.

Definition 1.3.1. For integers a, b ∈ Z, we say that a divides b if there exists an integer n such that b = a · n. We denote this by a | b. There are some elementary properties of divisibility that we can establish right off the bat. Proposition 1.3.1. The following properties hold for any integers a, b and c. (1) If a | b then a | b · c. (2) If a | b and b > 0 then −b ≤ a ≤ b. (3) If a | b and a | c then a | (b + c). (4) If a | b and b | c then a | c. 28 1. BASIC ARITHMETIC

(5) If a | b and b | a then a = ±b. Proof. We leave the first four as exercises and prove the last statement. If a | b and b | a then there are integers n and m such that b = a · n and a = b · m. Thus a = a · n · m. The cancellation property of multiplication shows that 1 = n · m so that n | 1. By part (2) of the proposition, −1 ≤ n ≤ 1 and since n 6= 0 this implies n = ±1. Consequently, a = ±b and the claim is justified.  As we learn in elementary school, sometimes when we divide one integer by another, we end up with a remainder. It is very useful to formalize this elementary fact into a theorem.

Theorem 1.3.1. For any integer b ∈ Z and positive integer a, there exists a unique pair of integers q and r for which (1.10) b = a · q + r and 0 ≤ r < a. The letter q is to remind you of quotient and r of remainder. Proof. Examine the set R = {n ∈ N : there exists m ∈ Z such that b = a · m + n} First observe that R is non-empty. Indeed, if b ≥ 0, then b = a · 0 + b and so b ∈ R. While if b < 0, then since a ≥ 1, we have b ≥ a · b so that n = b − a · b ≥ 0 and n ∈ R. Thus R is a non-empty subset of N and the Well Ordering Principle implies that there is a smallest element in R, which we call r. By the definition of R, there exists q such that equation (1.10) is satisfied. Since r is a natural number 0 ≤ r. On the other hand, if r ≥ a, then r > r − a ≥ 0 is a natural number and b = a · (q + 1) + (r − a) which implies r − a ∈ R. But this contradicts the fact that r is the smallest element, thus r < a. To show that q and r are unique, assume that q0 and r0 also satisfy the statement of the theorem. We may assume r ≥ r0 and observe that a · (q0 − q) = r − r0 so that a divides r −r0. But a > r > r −r0 ≥ 0 so if (q0 −q) < 0 then r −r0 = a·(q0 −q) < 0 which is a contradiction. While if (q0 − q) ≥ 1 then r − r0 = a · (q0 − q) ≥ a > r − r0 which is another contradiction. The only other possibility is q0 − q = 0 or q0 = q 0 0 0 which implies r − r = a · (q − q) = 0 and r = r .  Connection 1.3.1. Theorem 1.3.1 is often called the Algorithm, which more accurately refers to the algorithm that produces q and r. This al- gorithm is what we learn in elementary school, perhaps never knowing that there is a theorem to go along with it! Now that we know that we can divide and find remainders, let’s see the ways in which we can compare divisors of two integers.

Definition 1.3.2. For a, b ∈ Z, not both equal to zero, the greatest common divisor of a and b is the largest integer that divides both a and b. It is denoted gcd(a, b). If gcd(a, b) = 1, we say that a and b are relatively prime.

Let us just check and make sure that this definition makes sense. Let Da,b = {d : d divides a and b} and observe that any such d must be greater than C = min{−|a|, −|b|} by Proposition 1.3.1, Part (2). Thus D˜ = {e : e = C + d, d ∈ 1.3. FACTORING INTEGERS, PART I 29

˜ Da,b} ⊆ N and is non-empty because 1 ∈ D. So by the Well Ordering Principle D has a smallest element. By Theorem 1.2.2, this implies D˜ has a smallest element. Multiplying this element by −1 must produce the largest element by Theorem 1.2.2 and Proposition 1.3.1. So we know that a greater common divisor must exist. As it turns out, there is a very old algorithm that produces the greatest common divisor gcd(a, b) known as the Euclidean Algorithm. You begin by dividing a by b to get a remainder r0 less than b. You continue by dividing b by r0 and get another remainder r1. Then divide r0 by r1 to get remainder r2 and so on and so forth until you get rn+1 = 0.

a = b · q0 + r0

b = r0 · q1 + r1

r0 = r1 · q2 + r2 .. ..

rn−1 = rn · qn+1 + 0

Once you are at that point, you can conclude that d = rn is the greatest common divisor. Let us apply this in a computational example. Example 1.3.1. Let a = 245 and b = 84. Applying the algorithm gives us the following sequence of equations. 245 = 84 · 2 + 77, 84 = 77 · 1 + 7, 77 = 7 · 11 + 0, So we conclude that 7 = gcd(245, 84). Now that we know that greatest common divisors exist and how to compute them, let’s show that it can always be obtained by multiplying a and b by integers and adding the result together.

Theorem 1.3.2 (B´ezout’sidentity). Assume a, b ∈ Z are not both zero and d = gcd(a, b). Then there exist integers n, m ∈ Z such that (1.11) n · a + m · b = d Proof. Again we introduce a set S = {c ∈ N : c > 0 and there exist x, y ∈ Z such that c = x · a + y · b} It is clear that S is non-empty since we may take c = a · (±1) or c = b · (±1) to obtain an element in S. Let d˜ be the smallest element of S andn, ˜ m˜ the integers satisfying a · n˜ + b · m˜ = d.˜ Since d divides a and b, Proposition 1.3.1, Part (1) and (3) imply that d | d˜. By Proposition 1.3.1, Part (2), we have that d ≤ d˜. By Theorem 1.3.1, there exists an qa, ra and an qb, rb for which ˜ ˜ a = qa · d + ra 0 ≤ ra < d, ˜ ˜ b = qb · d + rb 0 ≤ rb < d. 30 1. BASIC ARITHMETIC

If either ra or rb is non-zero, then we would have ˜ a · (1 − qa · n˜) + b · (−qa · m˜ ) = a − qa · d, ˜ = ra < d, or ˜ a · (−qb · n˜) + b · (1 − qb · m˜ ) = b − qb · d ˜ = rb < d, ˜ both of which contradict the fact that d is the smallest element of S. Thus ra = 0 = ˜ ˜ rb which implies that d divides a and divides b. Said another way, d is a common divisor of a and b. Since d is the greatest common divisor, we have d˜ ≤ d. Thus ˜ ˜ d ≤ d ≤ d which implies, by anti-symmetry, that d = d and we are done.  Reversing the Euclidean algorithm for a and b and using substitution can pro- duce the integers n and m appearing in B´ezout’sidentity. Example 1.3.2. Take a = 245 and b = 84 as in Example 1.3.1. There we saw that 7 was the greatest common divisor. The second equation gives us 7 = 84 − 77 · 1 and the first gives us that 77 = 245 − 84 · 2. Substituting this into the first equation gives 7 = 84 − (245 − 84 · 2) = (−1) · 245 + 3 · 84. So n = −1 and m = 3 solve B´ezout’sidentity in this case.

Exercises (1) Prove two of the first four claims in Proposition 1.3.1. (2) Find the greatest common divisor d for 34 and 8. Find integers n and m satisfying B´ezout’sidentity in this case. (3) Show that for any a, b ∈ Z not both equal to zero, the integers n, m ∈ Z solving B´ezout’sidentity are not unique. (4) Prove that every common divisor of a and b must also be a divisor of gcd(a, b).

1.4. Factoring integers, part II One of the deepest mysteries about arithmetic lies in the following definition. Definition 1.4.1. A prime number p is a natural number, not equal to 1, for which n|p implies n = 1 or n = p for any natural number n. The following proposition gives a few basic properties of prime numbers.

Proposition 1.4.1. (1) If a ∈ N and a > 1, then either there exists a prime p dividing a or a is prime. (2) If a, b ∈ Z, p is a prime number and p | a · b then p | a or p | b. 1.4. FACTORING INTEGERS, PART II 31

Proof. (1) This is a proof by induction on n for

(Pn) If a ∈ Z and 1 < a ≤ n+2, then either there exists a prime p dividing a or a is prime.

The base case of Pn is true, since the only a satisfying the hypothesis 1 < a ≤ 2 is 2 which is prime. Now suppose it Pn holds. If 1 < a ≤ (n + 1) + 2 then either a = n + 3 or the conclusion holds by the induction hypothesis. If a = n + 3 is not prime, then there is a natural number m satisfying 1 < m < n + 3 and m | a. But then, again by the induction hypothesis, m is either prime, in which case the conclusion holds, or there exists a prime p for which p | m. By Proposition 1.3.1, this implies p | a and we are finished. (2) Suppose p - a. Then, since 1 and p are the only divisors of p and p does not divide a, we have gcd(p, a) = 1. B´ezout’sIdentity then asserts there exists integers n, m ∈ Z such that n · p + m · a = 1. Multiplying by b we get n · p · b + m · a · b = b. But p divides both summands on the left, so by Proposition 1.3.1, p divides their sum and also b.  The key questions which historically vex mathematicians about prime numbers are how they are distributed. However, one question that was answered early on by Euclid, was how many primes exist. Theorem 1.4.1. The set of prime numbers is infinite. Proof. Suppose the theorem is false and there are a finite number of primes. We can then list all of them p1, . . . , pn, and we can take their product

N = p1 · p2 ··· pn.

It is clear that N + 1 > N ≥ pi for all primes pi. But since pi | N for every i, pi cannot divide (N + 1) (for then it divides 1 = (N + 1) − N). Thus (N + 1) is not divisible by any prime and, by Proposition 1.4.1, (N + 1) is prime. But this contradicts the fact that it is greater than all prime numbers.  We come to a central theorem in this chapter. Theorem 1.4.2 (Fundamental Theorem of Arithmetic). Every natural number a ∈ N with a > 1 can be expressed as a product of prime numbers

r1 rn (1.12) a = p1 ··· pn . Moreover, this expression is unique up to reordering the factors. Proof. We proceed by induction.

(Pn) If a ∈ Z and 1 < a ≤ n + 2, then the Fundamental Theorem of Arithmetic (FTAr) holds. Base case is true since 2 is prime. Now assume Pn is true. If 1 < a ≤ (n + 1) + 2 then either a ≤ n + 2 in which (FTAr) holds, or a = n + 3. In the latter case, Proposition 1.4.1 asserts that either a is prime, in which (FTAr) holds, or a is divisible by a prime p. Then, since 1 < a/p ≤ n + 2, the induction r1 rn hypothesis yields a prime factorization a/p = p1 ··· pn . Multiplying by p gives r1 rn a = pp1 ··· pn , showing the existence of such a factorization for any a > 1. 32 1. BASIC ARITHMETIC

To show uniqueness, assume a is the smallest natural number greater than 1 for which there exist two distinct prime factorizations

s1 sm r1 rn q1 ··· qm = a = p1 ··· pn .

Then since q1 | a, by Exercise 4, q1 | pi for some 1 ≤ i ≤ n. After reordering we may assume i = 1. Since p1 is prime and q1 6= 1, this implies that q1 = p1. But then s1−1 sm r1−1 rn q1 ··· qm = a/p1 = p1 ··· pn . Since a was the smallest element for which prime factorizations were not unique, we must have that these factorizations are identical after reordering. But this implies that the original factorizations were the same contradicting our assumption. Thus every number has a unique factorization.  Exercises √ (1) Suppose a is not divisible by any number less than or equal to a. Show that a is a prime number. (2) Goldbach’s conjecture (still unproven after 272 years) is that every even natural number greater than two can be written as the sum of two prime numbers. Show that it is true for all such even numbers less ≤ 20. (3) The twin primes conjecture (still unproven after over 160 years) states that there are an infinite number of pairs p, p + 2, both of which are prime. Give an example of one such pair for p ≥ 150. (4) Use induction and Proposition 1.4.1 to prove that if a prime number p | a1 ··· an then p | ai for at least one 1 ≤ i ≤ n. 1.5. Modular Arithmetic In this section, we will define a quotient ring. This will have applications in the coming sections, but for now we will content ourselves with one main example, the ring Z/(n). Let’s start with a definition. Definition 1.5.1. Assume R is a commutative ring. An ideal in R is a non- empty subset I ⊆ R satisfying (1) If a, b ∈ I then a + b ∈ I. (2) If r ∈ R and a ∈ I then r · a ∈ I. In this case, we write I E R. In the non-commutative case, the set I above is called a left ideal. Rather than engage in the highest level of generality, we will constrain the discussion to the commutative setting. At this point, our only example of ring is Z, so let’s take a look at some ideals. Example 1.5.1. For any integer n ∈ Z the set (n) = {k · n : k ∈ Z} is an ideal. In fact, these are the only ideals in Z. The ideals in this example have a special name which we describe in the fol- lowing definition. Definition 1.5.2. Given a ring R, an ideal I is called a principal ideal if there exists r ∈ R such that I = {s · r : s ∈ R}. 1.5. MODULAR ARITHMETIC 33

Ideals partition a ring in such a way as to preserve a notion of arithmetic on the equivalence classes. First let’s assume I E R and define the equivalence relation (1.13) a ≡ b (mod I) if and only if b − a ∈ I. The following proposition, whose proof is left as an exercise, gives us everything we need to define quotient rings.

Proposition 1.5.1. If R is a commutative ring and I E R, then (1) The relation ≡ is an equivalence relation. (2) If a ≡ b (mod I) and c ∈ R then a + c ≡ b + c (mod I). (3) If a ≡ b (mod I) and c ∈ R then a · c ≡ b · c (mod I). Since we have an equivalence relation, we obtain a partition of R. The usual notation in ring theory differs slightly from the set theory notation and we define R R := I ≡ as a set. Equivalence classes [r] := [r]≡ can be written in different ways, depending on the author and context. For example, one often sees r or r + I as the notation for [r]. I will keep our notation of [r] and define addition and subtraction as [r] + [s] := [r + s] [r] · [s] := [r · s] Let us quickly check that these operations do not depend on the choice of represen- tative. If [r1] = [r2] and [s1] = [s2] then applying Proposition 1.5.1 Part (2) twice we see

[r1 + s1] = [r2 + s1] = [r2 + s2]. Applying Proposition 1.5.1 Part (3) twice we seem

[r1 · s1] = [r2 · s1] = [r2 · s2]. Furthermore, all of the properties for a ring are satisfied with respect to these operations, since they are satisfied for R. We have justified the following definition. Definition 1.5.3. Given a commutative ring R and an ideal I, we call R/I with the induced addition and multiplication, the quotient ring of R by I. Now that we have a general strategy for quotienting rings, let’s apply it to our one example.

Proposition 1.5.2. The quotient ring Z/(n), pronounced “z mod n”, consists of exactly n elements Z/(n) = {[0], [1],..., [n − 1]}. Two integers a, b ∈ Z belong to the same equivalence class if and only if n | (b − a). Proof. Let us prove the second assertion first. The integers a and b belong to the same equivalence class if and only if a ≡ b(mod(n)). This is true if and only if (b − a) ∈ (n) which holds if and only if (b − a) = n · k or n | (b − a). Now suppose [a] ∈ Z/(n), then by Theorem 1.3.1, there exists q and r such that a = q · n + r with 0 ≤ r < n. But since q · n = (a − r) we have that [a] = [r], so every equivalence classes is represented by some integer between 0 and (n − 1).  34 1. BASIC ARITHMETIC

From this point on, when we consider elements in Z/(n), we write [a] as ra where ra is the remainder of a divided by q. For example, in Z/(7) we write [23] as 2 and [19] as 5. When we write our elements this way, funny things occur in our arithmetic mod n. For example, in Z/(2) we have that 1 + 1 = 0 and in Z/(5) we have that 24 = 1 (although we will usually use ≡ (mod a) instead of = to remember what ring we are working in). We can use this to our advantage to gain an upper hand in factoring many numbers. Example 1.5.2. The number 23k+1 − 62r − 1 is divisible by 7 for all natural numbers k and r. We can see this by observing that 23 ≡ 1 (mod 7) and 62 ≡ 1 (mod 7), so 23k+1 − 62r − 1 ≡ (23)k · 2 − (62)r − 1 (mod 7), ≡ 2 − 1 − 1 (mod 7), ≡ 0 (mod 7).

Exercises (1) Prove the claims made in Example 1.5.1. Namely, show that I is an ideal of Z if and only if I = (n) for some integer a. (2) Prove all three properties in Proposition 1.5.1. (3) Explain why 5n − 32m is divisible by 4 for any natural numbers n and m. (4) Prove that the following fact is true. The sum of the digits of a number a is divisible by 3 if and only if a is divisible by 3. (5) Show that if gcd(a, b) = 1 then there exists an integer c such that b · c ≡ 1 (mod a). (6) Show that Z/(a) is an integral domain if and only if a is a prime number or 0.

1.6. The fields Q and R We have already encountered the desire to extend our number system from N to Z. In fact, we could have considered this as a necessity which arises when solving the equation x + 1 = 0. Indeed, no natural number would do the job here, because of Axiom 3. So if we want to solve that equation, we must consider a larger set of numbers Z. However, we can now write a new equation n · x − 1 = 0 where n ∈ Z and n 6= 0, and try to solve for x in Z. We find that only when n = ±1 do we have a solution. So we need more numbers! Before constructing these numbers, let us think about this equation a bit more and write it as n · x = 1. We know that 1 is the multiplicative identity, so what we are really asking for is a number system in which every non-zero element of Z has a multiplicative inverse. The same question can be asked for any ring R. In fact, an element u in a ring R that has a multiplicative inverse is called a . So we can ask: For a ring R, does there exist a larger ring S containing R in which every non-zero element s ∈ S is a unit? The answer in general is no! There is a whole subject of mathematics dedicated to rings like S, but let us content ourselves now by making the formal definition. Definition 1.6.1. A field F is a commutative ring in which all non-zero ele- ments are units. In fact, we already have an example of a field. 1.6. THE FIELDS Q AND R 35

Example 1.6.1. Let p be a prime number and examine the ring Z/(p). If [a] ∈ Z/(p) is not equal to zero, then gcd(p, a) = 1. But then B´ezoutsidentity implies that there exists integers m, n such that m·p+n·a = 1 implying p | (n·a−1). Thus n · a ≡ 1 (mod p) and [n] ∈ Z/(p) is a multiplicative inverse of [a]. Before we can verify that Q is a field, we need to construct it! As it turns out, the construction is a part of a general construction in ring theory which can be performed for any integral domain R. So, we will assume that R is an integral domain and denote the set of non-zero elements of R by R∗. Define an equivalence relation on R × R∗ as follows (1.14) (a, b) ' (c, d) if and only if a · d = b · c. Note that this is the exact same relation as in Equation 1.1, but with + replaced by ·. We need proposition which mimics Proposition 1.1.1. Proposition 1.6.1. For an integral domain R, the following properties hold. (1) The relation ' is an equivalence relation. (2) If (a, b) ' (a0, b0) and (c, d) ∈ R × R∗ then (1.15) (a · c, b · d) ' (a0 · c, b0 · d). (3) If (a, b) ' (a0, b0) and (c, d) ∈ R × R∗ then (1.16) (a · d + b · c, b · d) ' (a0 · d + b0 · c, b0 · d) Proof. We prove the statements in order. (1) It is easy to see that ' is reflexive and symmetric. To show that it is transitive, suppose (a, b) ' (c, d) and (c, d) ' (e, f). Then a · d = b · c and c · f = d · e. Multiplying the first equation by f and the second by b we obtain a · d · f = b · c · f = b · d · e. Since R is an integral domain, Theorem 1.2.3 implies that we can cancel d from both sides to obtain a · f = b · e and therefore (a, b) ' (e, f). (2) We have that a·b0 = b·a0. Multiplying both sides by c·d gives (a·c)·(b0·d) = (b · d) · (a0 · d) which implies the result. (3) Again, we have that a · b0 = b · a0. So (a · d + b · c)(b0 · d) = (a · b0) · d2 + b · c · b0 · d, = (b · a0) · d2 + b · c · b0 · d, = (a0 · d + b0 · c)(b · d).  Let us now make a very general definition that will come in handy as we progress. Definition 1.6.2. Given an integral domain R, the field of fractions of R is R × R∗ F rac(R) = . ' Addition is defined as

[(a, b)]' + [(c, d)]' = [(a · d + b · c, b · d)]' while multiplication is defined as

[(a, b)]' · [(c, d)]' = [(a · c, b · d)]' 36 1. BASIC ARITHMETIC

We leave it as an exercise to see that the operations of + and · are well defined and satisfy the properties needed in the definition of a ring. We will usually write elements of the field of fractions as, well, as fractions a := [(a, b)] . b ' a When written this way, it is not hard to see that any non-zero element b has a b multiplicative inverse a in F rac(R). Thus F rac(R) is a field. We can now define our beloved rational numbers

Definition 1.6.3. The field of rational numbers, denoted Q, is defined as F rac(Z).

Of course, we want to see that Z is contained in Q in a natural way. In general, F rac(R) is really an extension of the ring R in the sense that it contains a copy of R inside of it. It is high time we made this type of a relationship between two rings a formal definition.

Definition 1.6.4. Let R and S be rings. A function f : R → S is a ring if, for every a, b ∈ R,

(1) f(1R) = 1S (2) f(a + b) = f(a) + f(b), (3) f(a · b) = f(a) · f(b). If f is one to one and onto, we call it an isomorphism.

Sometimes condition (1) is omitted for the notion of a ring homomorphism and f is called a unital homomorphism with condition (1). We will usually drop the adjective “ring” and just say homomorphism if it is clear that the domain and codomain are rings. This definition gives us the ability to compare rings in a way that preserves their algebraic structure. Our first application is the following proposition.

Proposition 1.6.2. If R is an integral domain, then there is a one to one homomorphism ι : R → F rac(R)

r defined as ι(r) = 1 . Proof. We need to show that ι is one to one and that it is a homomorphism. To see that it is one to one, suppose ι(r) = ι(r0). Then (r, 1) ' (r0, 1) which implies r = r · 1 = 1 · r0 = r0. Thus it is one to one by definition. 1 To see that it is a homomorphism, we verify that f(1) = 1 which, by exercise 3 is the multiplicative identity in F rac(R). Also,

r + r0 f(r + r0) = , 1 r r0 = + , 1 1 = f(r) + f(r0), 1.6. THE FIELDS Q AND R 37 and r · r0 f(r · r0) = , 1 r r0 = · , 1 1 = f(r) · f(r0).  r We will usually write r instead of 1 when considering elements in the image of ι. Returning to the rationals, we can write down some special properties that are satisfied. Proposition 1.6.3. Every non-zero element r ∈ Q there exists a unique pair a a ∈ Z and b ∈ N such that r = b and gcd(a, b) = 1. We call such a representation a reduced fraction. a0 0 0 0 0 0 0 Proof. Let r = b0 and suppose d = gcd(a , b ). If b > 0, define a = a /d and b = b0/d0 while if b0 < 0 define a = −a0/d0 and b = −b0/d0. Observe that if gcd(a, b) = d > 1, then d · d0 is a common divisor of a0 and b0 which is greater than d0. But this cannot occur, so gcd(a, b) = 1. It is immediate from the definition of a, b and ' that (a, b) ' (a0, b0). e To see that the representative is unique, suppose r = f with gcd(e, f) = 1. Then a · f = b · e and if p | b then p | a · f. But since gcd(a, b) = 1, we must then have that p | f by Proposition 1.4.1 (since it cannot divide a). A similar result holds for any power pk of p dividing b. Thus all of the prime powers which divide b divide f which implies, by the Fundamental Theorem of Arithmetic, that b divides f. Using the exact same logic, we also have that f divides b. But by Proposition 1.3.1, this implies that b = ±f and since both are positive, we have b = f. Thus a · b = b · e and by Theorem 1.2.3, we have a = e as well.  From this we get the result that confused the ancient Greeks quite a bit. Theorem 1.6.1. There does not exist a rational number that solves the equation x2 = 2. Proof. This is a proof by contradiction, so let us suppose that r ∈ Q satisfied 2 a r = 2. Then by Proposition 1.6.3, there exists a reduced fraction r = b with gcd(a, b) = 1. Since a2 = 2 · b2, we have that 2 | a and because gcd(a, b) = 1, we have that 2 - b. Suppose a has prime factorization

k r1 rn a = 2 p1 ··· pn

2 k 2r1 2rn 2 2 k−1 2r1 2rn where k > 0. Then a = 4 p1 ··· pn = 2b so that b = 2 · 4 · p1 ··· pn which implies 2 | b2 = b · b. Applying Proposition 1.4.1 gives that 2 | b, and a contradiction. Thus no such rational number exists.  So here we are again in a situation where our number system does not have enough elements to solve an equation. As we will see in the next chapter, solving this type of equation leads us into a long and interesting story about rings, fields and other algebraic structures we have not yet met. To finish this chapter, let’s give a short construction of the system, leaving proofs and elaborations to your analysis course. 38 1. BASIC ARITHMETIC

First we must extend the inequality ≥ to Q.

a1 a2 Definition 1.6.5. Suppose r1 and r2 have reduced fractions and . We b1 b2 say r1 ≥ r2 if and only if a1 · b2 ≥ a2 · b1. We leave the following proposition as an optional exercise. Proposition 1.6.4. The following properties hold for the relation ≥ on Q. (1) ≥ is a partial order. (2) If r, s ∈ Q then either r ≥ s or s ≥ r. We use this partial order to define a real number. Definition 1.6.6. A Dedekind cut is a subset D ⊂ Q such that (1) D contains no greatest element, (2) D is neither empty, nor all of Q, (3) if r ∈ D and s ∈ Q satisfies r ≥ s, then s ∈ D. The best way of thinking about a Dedekind cut is as a half infinite interval (∞, r). The only difference is that that we don’t know if r exists in our number system Q or not. We say that a Dedekind cut D is non-negative, denoted D ≥ 0 if it containes an element greater than or equal to zero. Otherwise, we say it is negative. For any Dedekind cut D, we define −D = {r − d : r < 0 and d 6∈ D}. Definition 1.6.7. The real numbers R is the set of all Dedekind cuts. Ad- dition is defined as

D1 + D2 := {d1 + d2 : di ∈ Di}.

Multiplication is defined first for non-negative D2 as

D1 · D2 := {r ∈ Q : there exists d1 ∈ D1 such that if d2 6∈ D2 then r < d1 · d2}, and then for negative D2 via

D1 · D2 := −(D1 · (−D2)) It is left as an optional exercise to show that R is a field and that the map i : Q → R defined as i(r) = {s : s < r} is a one to one homomorphism. The real number system has several wonderful properties that are encountered in other more algebraic settings, but they generally involve the topology of this set and will be left out of the discussion. One thing we can show is that x2 = 2 does have a solution in R. In fact, we can write it down √ 2 2 := {r ∈ Q : either r ≤ 0 or r < 2}. Connection 1.6.1. This section contained a formal introduction to the algebra of fractions in the abstract setting. There are a variety of ways of teaching this in an informal, explanatory way when developing the rational numbers. On the other hand, extending the basic algebraic rules to the real numbers involves the difficult type of definitions that we have introduced. There is a new perspective though that when secondary teachers make the jump from Q to R, they should explicity mention that they are invoking the following basic assumption (see Milgram’s book “The Mathematics Pre-service Teachers Need to Know”). The Fundamental Assumption of School Mathematics All the arithmetic properties enjoyed by the rational numbers are also enjoyed by the real numbers. 1.7. THE FIELD C 39

Exercises

(1) Find the multiplicative inverses of 3, 4 and 5 in Z/(13). (2) Prove the reflexive and symmetric conditions in Part (1) of Proposition 1.6.1. (3) Prove the following assertions regarding definition 1.6.2 (a) The operations + and · are well defined on F rac(R) (you need to show that they do not depend on the element representing the equivalence class). (b) The operations + and · are associative in F rac(R). (c) The operations + and · are commutative in F rac(R). (d) The distributive property is satisfied in F rac(R). (e) The additive and multiplicative identities 0R and 1R in R are the additive and multiplicative identities in F rac(R). (4) Prove that if F is a field, then ι : F → F rac(F ) is an isomorphism. (5) Suppose I is an ideal of a commutative ring R and is not equal to R. Show that the function π : R → R/I defined by π(r) = [r] is an onto, ring homomorphism. (6) Show that if r ∈ Q, r ≥ 0 and n ∈ N∗, then there is a solution to xn = r in R. (7) Prove that every rational number has a repeating decimal expansion. (Hint: Note that, for any a, b ∈ Z with b 6= 0, the set {a, 10a, 102a, . . .} is finite in Z/(b). Observe then that there exist numbers m < n such m n a that 10 a ≡ 10 a (mod b). Use this observation to conclude that b has a repeating decimal expansion.)

1.7. The field C This section we give a brief account of the largest number system that is intro- duced in secondary education, the field of complex numbers.

Definition 1.7.1. The field of complex numbers is denoted C and equals the set R × R. Addition and multiplication are defined as (a, b) + (c, d) := (a + c, b + d), (a, b) · (c, d) := (a · c − b · d, a · d + b · c). The element (a, b) is denoted a + bi. For any z = a + bi we write <(z) = a and =(z) = b. If =(z) = 0 we say that z is real and if <(z) = 0 we say that z is purely imaginary. The fact that C is a field is left as an exercise. We observe that i2 = −1 by definition.

Definition 1.7.2. If z = a + bi ∈ C, we call z = a − bi ∈ C the complex conjugate of z.

We can extend the absolute value on R to C by defining the norm, or modulus, of z = a + bi to be √ p |z| = z · z = a2 + b2. Let’s make some observations about the norm.

Proposition 1.7.1. Let z, w ∈ C. (1) |z · w| = |z| · |w|, 40 1. BASIC ARITHMETIC

(2) |z + w| ≤ |z| + |w|. Just as we make the real numbers into a line, we geometrically represent com- plex numbers as points on the plane z = a + bi = (a, b). From this viewpoint, the norm |z| is the distance from the origin 0 to z. Then Proposition 1.7.1, part (2) is known as the triangle inequality, because it says the sum of the length of two sides of a triangle is greater then the length of the remaining side. On the other hand, Proposition 1.7.1 says that the distance of a product of complex numbers from the origin is the product of the distances. In fact, this fits into an even more natural description of complex multiplication. Proposition 1.7.2. Every non-zero complex number z can be written uniquely as reiθ = r cos(θ) + ir sin(θ) for some θ ∈ [0, 2π). Proof. If z 6= 0 then |z| 6= 0. It is then clear that z/|z| has unit norm and therefor lies on the unit circle and can be expressed as (cos(θ), sin(θ)). Letting r = |z| then shows that z = r cos(θ) + ir sin(θ). To see that this equals reiθ, simply substitute iθ into the Taylor series expansion of ex (this can be proven to be a convergent power series on the complex numbers, but we leave that to the a course on complex analysis).  This last theorem yields the famous equality eiπ = −1, one of the gems of mathematics. More generally, we can completely solve the equation zn = 1 for any natural number n and obtain exactly n solutions

n 2πki o µn := e n : k ∈ N, 0 ≤ k < n . This set is called the set of n-th roots of unity. The n roots can be found evenly distributed on the unit circle. Finally, we observe that the proposition, along with the fundamental assump- tion of school mathematics (complex version), gives us the addition formulas for the trigonometric functions. In particular, for any two real numbers θ, φ ∈ R we have cos(θ + φ) + i sin(θ + φ) = ei(θ+φ), = eiθeiφ, = (cos(θ) + i sin(θ))(cos(φ) + i sin(φ)), = (cos(θ) cos(φ) − sin(θ) sin(φ))+ + i(cos(θ) sin(φ) + sin(θ) cos(φ)). By taking < and = of both sides, we obtain the addition formulas for sin and cos.

Exercises

(1) Prove that C is a field. You may assume that + and · are associative and commutative. (2) Prove that the function f : C → C defined as f(z) = z is a field isomor- phism. (3) Prove Proposition 1.7.1.