 This lecture is part of Berkeley Math 115, an introductory undergraduate course on number theory. And this lecture will be mostly about groups and their relation to number theory. So what I'm essentially going to do is to go through all the things I talked about so far and just comment on how they fit into the language of group theory. So let's just recall what a group is. So a group is a set with some sort of binary operation, usually denoted by multiplication. So we could write a times b or sometimes a dot b or sometimes just a b if we're feeling lazy or even a plus b. And this has two of the following properties. First of all, there's an identity element. So this is an element such that one times a is equal to a times one is equal to a. Or if you're writing it additively, you would write this as zero and have zero plus a equals a plus zero equals a. Secondly, it has inverses. So this means it's got an inverse a to the minus one such that a to the minus one times a is equal to one, which is equal to a to the minus one times a. Or if you write it additively, the inverse is minus a, so a plus minus a equals minus a plus a equals zero. And thirdly, it's associative, which just means a times b times c is a times bc. Or additively, a plus b, not c is a plus b plus c. Now in at least an elementary number theory or most all the groups we look at have an additional property, which is that they're commutative or sometimes called abelian named after the mathematician Arbel. And this just says that you can change the order of the multiplication. So we have a b equals b a or a plus b equals b plus a. So let's have some examples of groups. So basic examples. We could have the group of integers and where the group operation is addition, the usual addition, and we have the usual identity is zero and negation of an element is its inverse. You can do the same thing with the real numbers again using addition and with the usual with a zero. Or you could have the none zero real numbers where the operation is now multiplication. If you took all real numbers under multiplication, this wouldn't be a group because one of the element zero doesn't have an inverse under multiplication. So in number theory, the most important groups we've had are first of all the integers, modulo and number M under addition. And this group is often denoted by Z modulo MZ. And so here Z stands for the integers. This means the integers that are a multiple of M. And if you're quotienting out means you're sort of considering anything that's a multiple of M to be essentially zero, which is of course just what you do when you work modulo M. And so the second sort of group we've had is the integers modulo M that are co-prime to M under multiplication. And this group is usually denoted by Z modulo MZ. And then we put a star there to mean we're taking the elements co-prime to M. And the point is that the elements co-prime to M all have inverses. You remember, so this is like solving AB is congruent to one modulo M, which we can solve provided A is co-prime to B. Next we recall what a subgroup is. So a subgroup is a subset of a group H that's also a group under the same operation. So it's a subset plus a group, roughly speaking. So for example, let's take the group of integers modulo six. So we can think of this as having five elements, zero up to five. And let's look at what possible subgroups there are. Well, we can take the whole group. So one obvious subgroup is just the elements one, two, three, four, five. Next we could take just the zero element that forms a group, although obviously not a terribly interesting one. Next we could take the elements zero and three, because if we take three plus three, that gives us zero gain. We can also take the element zero, two and four. And this illustrates a common way of forming a subgroup, which is just to take an element and to take all the positive and negative powers of it. Or if we were writing a group under addition, we would take all sums and differences of copies of it. So if we take the element two, we would take, you know, all multiples of two, like two, four and six. Well, six is back to zero. And it's not difficult to check. These are the only subgroups of the group of integers mod six. Now we come to one of the basic theorems of group theory, which is Ducal Lagrange, which says the order of a subgroup divides the order of a group. So what's the order? Well, the order is just the number of elements. And of course, this only applies in an interesting way to finite groups because if groups are infinite, then this doesn't really say anything very interesting. And let's call this subgroup H and let's call the group G and we will just have a look at the standard example to remind ourselves. So we take the group of integers under multiplication as our group G. So it is elements one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve. And we're going to take our subgroup H to be three elements one, three and nine. So you can see three times nine is 27, which is congruent to one modulo 13. So this is the subgroup of order three. And what we can do is as well as the subgroup H, we can multiply everything in H by two. Let's call that two H. That's two, three and 18. Well, 18 is five modulo 13. So here's H that consists of one, three and nine. And here's two H, which consists of two, sorry, six and five. And what else? Well, we could look at four H, which is four, twelve, ten. So here we get four and twelve and ten. And what's left over? Well, there's seven H, which is seven, eight, eleven. So there's seven, eight, eleven. And if you look, every element of G is an exactly one of these four cosets of H. And this is what happens in general. So a coset of H is usually denoted by AH. It's the set of all elements, A times H1, AH2 and so on, where H is equal to H1, H2 and so on. And then we notice that any two cosets have the same order. And that's because if you've got two cosets, say H and AH, we may as well take one of the cosets to be H. We can map any element H to A times H, and this will give us a map from H to AH. And then we can map it back by, if we just multiply by the inverse of A, then these two maps are bijections and give a one-to-one correspondence between the two cosets. We can also see that two cosets are either the same or disjoint. So let's just show that two cosets H and AH are either the same or disjoint. So we've got to show that if they've got some element in common, then they're actually the same. So suppose that some element AH1 is in H. Well, this means AH1 is equal to H2 for some element in H2. So A is equal to H2H1 to minus one, which is also in H. So that means AH is now equal to H because you're just multiplying elements of the group H by themselves. And similarly, you can show that if BH and AH have an element in common, then they must be the same. So G is a disjoint union of cosets of the same size. So the order of any coset, which is just the order of H, divides the order of G because the order of G is just the order of H times the number of cosets. So if we go back to the example we looked at earlier, we saw that this cyclic group of order 6 has four subgroups and we can see the orders of the subgroup are 6, 0, 2 and 3, all of which divide 6. And for each of these subgroups, you can see the various cosets. For instance, a coset of this subgroup will be 1, 3 and 5. And this subgroup has three cosets because we can add 1 to 3 and we can also add 2 to 3. Sorry, that should be a 4. So one very important application of Lagrange's theorem is that the order of any element G in the group G divides the order of the group G. So what's the order of an element? Well, the order of an element is the smallest integer n greater than 0 such that G to the n is equal to 1. That's if it exists. If no such n exists, we say the element is infinite order but all the groups we're looking at are going to be finite. And you can see the order of an element. Well, let's look at an element G and let's keep multiplying it by itself. So we get G squared, G cubed and so on up to G to the n minus 1. And then suppose G to the n is equal to 1. Then we notice that these elements form a subgroup of order n. So the order of the subgroup is the same as the order of the element G. So the order of G divides the order of the group. So that's Lagrange's theorem. And we have two very important corollaries. First of all, we have Fermat's theorem, which says that X to the p minus 1 is congruent to 1 mod p. And for this, we just take the group to be Z modulo pz star, which is the integer's co-prime to p taken mod p. And the order is p minus 1. So the order of an element divides p minus 1. This means that X to the n equals 1 for some n dividing p minus 1. And by raising this to a sufficiently high power, you see that X to the p minus 1 is also congruent to 1. And of course, we get Euler's theorem in the same way. This just says that X to the phi of m is congruent to 1 modulo m whenever m is co-prime to x. And this again follows in much the same way because phi of m is just the order of the group Z modulo mz star of integer's modulo z up to multiplication. So incidentally, for a billion groups, there's another slightly shorter proof that A to the order of group G is equal to 1. Here, the absolute value of G is just the order of the group G. And for this, what we do, we look at that G1, G2, up to Gn, where n is the order of G and G1 up to Gn are the elements of G. And do you notice that A, G1, A, G2, and so on are also the elements of G? Because A has an inverse, so you get a one-to-one correspondence between G and itself just by multiplying by A. So let's multiply all these together. We see that G1, G2, and so on up to Gn is equal to A, G1, A, G2, up to A, Gn. And this is just equal to A to the n times G1 up to Gn. And by cancelling G1 up to Gn, which we can do because they have inverses, we see that 1 is equal to A to the n, where n is the order of G. This proof doesn't work for non-Abelian groups, although the result is still true for non-Abelian groups because it turns out that the proof using cosets works for that. Next we say a group is cyclic if it has one generator. Well, what does a generator mean? So this means that all elements are powers of the element G. So here are some examples of cyclic groups. First of all, the integers is cyclic. Here a generator is 1. And you remember when we're talking about powers of the generator, that's if a group is written multiplicatively. Here the integers are written additively. So instead of powers, we should take multiples of elements and we see that any element can be written as n times 1 for some n. Similarly, the integers modulo mz is also cyclic. And here we could take a generator to be 1, but we could also take a generator to be any element a for a co-prime to n because you know that any element of this group is a multiple of a provided a is co-prime to m. So this group is phi of m generators. I guess I should have said that the group z has two generators because we could also take minus 1 as a generator. So these are the obvious cyclic groups. We've seen some non-obvious cyclic groups. And here if we take the integers modulo pz and take the non-zero elements under multiplication, this has a generator. Well, that's because a generator is the same as what we previously called a primitive root. So for example, if we take z modulo 7z under multiplication, which has elements 1, 2, 3, 4, 5 and 6, if we take the element 3 and look at its powers, we get 1, 3, 3 squared, which is congruent to 2. Then we get 3 cubed, which is congruent to 6. 3 to the 4 is there and 3 to the 5 is there. So every element is power of 3. And therefore this is a cyclic group. And as we saw, it's actually a little bit tricky to prove these groups are cyclic. We also saw that z modulo p to the nz star is cyclic for p odd. As usual, the prime p equals 2 goes a bit wrong. We can also say two groups are isomorphic. So if we've got two groups, g and h, these are called isomorphic. If they are really the same, what does that mean? It means that they become the same if you re-label the elements. And you have to re-label the elements in such a way that it still preserves the multiplication or possibly addition. For example, the group z modulo 7z star and the group z modulo 6z are in fact isomorphic. So what I've got to do is to show that if you re-label the elements of this group and also re-label addition as multiplication, then it becomes the same as this group. So let's see how we do that. Well, here's z modulo 6z and it's got the element 0, 1, 2, 3, 4 and 5. And here's the element z. Here's the group z modulo 7z. And I'm going to map the element 0 to 1 because it has to be because it's the identity. I'm going to map the element 1 to 3 and then 2 to 3 squared, which happens to be 2, and then 3 to 3 cubed, which is 6 and 4 to 3 to the 4, which happens to be 4 and 5 to 3 to the 5. Which happens to be 5 again. So here we get 1, 3, 2, 6, 4, 5. So here is how you re-label the elements of this additive group as elements of multiplicative group. And you can see that this is just changing addition to multiplication because 3 to the a plus b is equal to 3 to the a times 3 to the b. So although these groups at first sight look quite different, you see that in some sense really the same if you just look at them as group theory. There's a well-known example you all come across in calculus where if you take the real numbers and the real numbers that are greater than 0, then these two groups are isomorphic because we have the exponential map for re-labeling real numbers and it has an inverse which is the logarithm map. And you notice that x of a plus b is x of a times x of b. So this map really is preserving the multiplication or rather it's turning addition into multiplication. For another example, let's look at the group z modulo 4 z and the group z modulo 8 z under multiplication. That's the non-zero elements. This is 1, 3, 5 and 7 and this is element 0, 1, 2 and 3. And just as we saw the additive group of order 6 was isomorphic to the group of non-zero elements modulo 7, we can ask if these two groups are the same, they've got the same number of elements so it seems plausible they are the same. And you notice they're not the same because this group has a generator. Obviously it has a generator 1 but this group doesn't have a generator because if we take any one of these elements it's square is just 1. So this group doesn't have a generator because if we take 5 say not all elements of powers of 5 because we only get 1 and 5. So there are actually two quite different groups of order 4. So you notice this one has elements that have order 4 whereas this one has three elements of order 2. Well what about the group z modulo 12 z under multiplication? So this also has four elements 1, 5, 7 and 11. And now these two groups are actually isomorphic because I can give you an isomorphism between them. So I could for example obviously have to map 1 to 1 and then I can map 3 to 5 and 5 to 7, 7 to 11. And you can check this actually preserves the multiplication of these two groups. So we've got three groups of order 4 here. This one, this one and this one and these two are isomorphic and this one isn't. Next we have Wilson's theorem which says p-1 factorial is congruent to minus 1 mod p whenever p is a prime. And let me rewrite this in terms of group theory. It says that if g is a finite abelian group then let's take the product of all elements. And the product of all elements is g if there is exactly one element g of order 2 and 1 otherwise. So Wilson's theorem really is a special case of this because if we take g to be the group of non-zero elements under addition, then the collection of all elements is 1, 2, 3, up to p-1. And we notice the product is p-1 factorial. So now we need to know how many elements are there of order 2. Well this means we're looking at solutions for x squared is congruent to 1 modulo p. And since p is prime we know that x must be equal to plus 1 or minus 1. So that one has order 1 and so there's only one element of order 2. And so the product of all elements which is p-1 factorial has to be equal to this unique element of order 2 by the group theoretic version of Wilson's theorem. So how do we prove a group theoretic elements of Wilson's theorem? Well let's look at the elements of our group g. So we have an element 1 and we might have an element g and maybe it's got an element. It's inverse and we've got an element h and the inverse of h and there might be some element a equal to the inverse of a and there might be another element b equal to the inverse of b and so on. And let's take the product. So well we've got the element 1 just gives us 1 and then we've got a pair of elements g and g inverse and the product of these is just 1 and the product of these is just 1 and so on. So all the elements cancel out except for the elements equal to their own inverses. So the product of all elements is equal to the product of elements g with g squared equals 1 because otherwise g is equal to its inverse. So this is the condition that says g is actually equal to g to the minus 1 so it doesn't cancel out with its inverse. And now let's work out the product of all elements of g with g squared equals 1. Suppose there's only one solution of g squared equals 1. Well in this case the product it must be the identity elements the product is 1. Suppose there are two solutions of g squared equals 1 so that 1 would have to be 1 and 1 would have to be g. So in this case there's only one element of order 2 and in this case the product is 1 times g which is equal to g. Now suppose there are more than two solutions of g squared equals 1 so let's look. There's 1 and there's g and there must be an element a and then there must be an element a times g. So the next case is when there are four solutions and you can easily check these must all be different if one g and a are all different. I mean if a g was equal to a for example this would say g would have to be equal to 1. Now the product is just equal to 1 times g times a times a g which is just equal to 1. Well now suppose there's more than four so there might be another element b. Well then we can find yet more elements whose square is 1 because there's b and there's b g and there's b a and there's b a g. And there might be another element say c so we get c, c g, c a, c a g and so on. So we can group the remaining elements into these clusters of four where we take some element and we multiply it by these four elements and we've got one g a and a g so if you remember we were talking about cosets and these are just cosets of this group. And now if we multiply together all the elements of a coset we get b to the 4 times g times a times a g which is equal to 1 because b squared is 1 and g squared is 1 and a squared equals 1 and similarly the product of these is equal to 1. So if there are more than four elements then the elements form clusters of four whose product is 1 so we find product is 1. So this shows the product of all elements of an Abellion group is 1 unless there's exactly one element of order 2 in which case the product is that element of order 2. OK next lecture I'll be giving some applications of products of groups.