 This lecture is part of Berkeley Math 115, an introductory undergraduate course on number theory, and will be about Gauss-Sums. More precisely, we'll be talking about Gauss-Sums and how to use them to prove the law of quadratic reciprocity, which you remember says PQ times QB is equal to minus 1 to the P minus 1 over 2 times Q minus 1 over 2 for P and Q odd distinct primes, positive primes, that is. So last lecture, we gave a proof of this, and as I said, there are something like 300 proofs of the quadratic reciprocity law, so we're going to give the second one. You can see a list of many of them in this rather nice book by Lemma May on reciprocity laws. So there's the law of quadratic reciprocity, and the pictures are Euler and Eisenstein, I believe. And in the back of the book, he has a list of some of the proofs. So you see, here are the first six proofs by Gauss. He saw a list of Le Gendre at the beginning, but Le Gendre's proof wasn't actually complete, so Gauss has the first proof of it. And the list goes on for several pages, and it ends in the year 2000, of course there have been several proofs since then. So there are a couple of hundred listed here, and in fact he lists about 300 proofs in another book. So anyway, so we're just going to give a second proof of it. So first of all, we need to define what a Gauss sum is. So a Gauss sum, often denoted by the Greek letter tau, is denoted by sum over x mod p of the take Le Gendre symbol, and you multiply it by epsilon to the x, and let me explain what epsilon is. So what we're going to do is we're going to assume that q is congruent to 1 mod p for simplicity. And at the end of the lecture, I'll explain what you do if q is not congruent to 1 mod p. But this means that the integers modulo q under multiplication, we remember their cyclic of order divisible by p, but this means that it has an element epsilon in z modulo qz star of order exactly p. So you can think of epsilon as being a pth root of 1, so epsilon to the p is congruent to 1 mod q. In fact, since epsilon is not 1, we also find that 1 plus epsilon plus epsilon squared plus all the way up to epsilon to p minus 1 is also congruent to 0. And more generally, 1 plus epsilon to the i plus epsilon to 2i and so on plus epsilon to the p minus 1i is congruent to 0 for i not congruent to 0 modulo p. So these are the usual properties that sums of roots of unity tend to be 0 unless the root of unity is 1. So that's what the Gauss sum is. So this is an element of z modulo qz because all of these, this is plus or minus 1 and this is obviously an element of z modulo qz. Gauss sums are actually very closely related to gamma functions. So if you look at the definition of a gamma function, gamma of s is the integral 0 to infinity of e to the minus t, that's s minus 1 dt. What you notice is that if you compare the definition of a Gauss sum with the definition of a gamma function, there seems to be no relation between them whatsoever. But if you look more closely, they're actually really rather similar. First of all, integration is really a sort of summation. So here we're integrating over the positive reels and here we're summing over the integers mod p. Well, positive reels are almost a field if you ignore the negative reels and the integers mod p are also a field. So in both of these, we're sort of summing or integrating over a field. Next, we have this term epsilon to the x corresponds to e to the minus t. That's because these are the properties that epsilon to the x plus y is equal to epsilon to the x times epsilon to the y minus t1 plus t2 is equal to e to the minus t1 times e to the minus t2. So that expression and that expression are both sort of exponentials of something. And finally, these two terms here are also kind of similar because they're both multiplicative. We notice that xyp is equal to xp times yp and t to the s1 s2 is equal to t to the s1 times t to the s2. So the Gaussian sum is actually reasonably similar to the Gamma function. And it turns out that any formula you can prove for the Gamma function quite often has a sort of analog for Gauss sums and vice versa. I mean, not exactly the same. I mean, obviously Gauss sums aren't exactly the same as Gamma functions, but there's just a very strong formal similarity. Anyway, what we're going to do is to write down some basic properties of Gauss sums. So the first property is that tau squared is equal to minus one p minus one over two times p. So and the proof of this, we take the formula for tau, which is sum over x mod p of xp times e to the x. And then we're going to square it. So tau squared is going to be we have to sum over both x and y of xp times yp times. So that should be epsilon times epsilon to the x times epsilon to the y. So that's just epsilon to the x plus y. And we can write this as sum over all x, y. And now we're going to take both of them to be none zero since these two terms are both vanish if x or y is zero. And then we can take xyp times epsilon to the x plus y. Now we're going to make a change of variable. We're going to write this as sum over x, y not zero of xp. So we're going to just divide x. We're going to multiply x by y. And you notice that x, y squared p is the same as xp. And then we get epsilon to the xy plus y. Now we can write this as a sum over all x and y of xp times epsilon to the x plus one times y. And you notice that the sum, we can just include x equals zero because this vanishes and we can include y equals zero because the sum over these things vanishes if we sum over y. And now we write this as a sum over x times xp. Then we have a sum over y of epsilon to the x plus one y. And this is a sum over powers of a root of unity. So this term here, it's not if x plus one is not congruent to zero modulo p. And it's p if x plus one is congruent to zero. So the only term here we get is where x is equal to minus one. So this sum becomes minus one choose minus one p times p. And now we notice this is what we're trying to prove because minus one to the p minus one over two is equal to minus one p. So these are both just plus one if p is congruent to one mod four and minus one if p is congruent to minus one mod four. So this has proved this first relation for the Gauss sum. I said that Gauss sums are related to the gamma function. There's an analogous property of the gamma function which says that gamma of s times gamma of one minus s is equal to pi over sine pi s, which again doesn't look at all like this relation here. But if you look at the proof of this relation for the gamma function, you find it's very similar to the proof of this relation for Gauss sums, except instead of making a change of variable in a double sum, you have to make it a similar change of variable in a double integral. Anyway, that's the first property we need for Gaussian sums. The second property is the following. It says that tau to the power of q is equal to q, the Legendre symbol qp times tau. And to this, we just take the sum x, sum of x mod p of xp times epsilon to the x. So this is just tau. And now we're going to raise both sides to the power of q. And we notice we're working modulo q because epsilon is just a number taken mod q. So let's raise both sides to the power of q. Now, this is going to be sum over x mod p of x over p to the q times epsilon to the qx. And here we're using the fact that a plus b to the q is common to a to the q plus b to the q modulo q. So if we're working modulo q, then taking q's powers is very easy. And you notice this is just the sum over x mod p of xp, because since this is 1 or minus 1, taking the q's power doesn't make any difference. You remember q is odd. And then we get epsilon to the qx. And then we can make the change of variable. x goes to xq to the minus 1. And we have a sum over x mod p of xq to the minus 1p times epsilon to the x. And this is just equal to a sum over all x of q to the minus 1p times xp times epsilon to the x, which you notice is just q to the minus 1p. Here we're taking q mod p of tau, which is of course just the same as qp. Again, q to the minus 1 means q to the minus 1 taking mod p. It doesn't mean a rational number. So that's what we were trying to prove. So again, it's a rather straightforward calculation making some obvious changes of variable and so on. So let's summarize what we've got. We've got tau squared is equal to minus 1 to the p minus 1 over 2 times p. And we have tau to the q is equal to qp times tau. And now just by manipulating these two, we can easily get the law of quadratic reciprocity. First of all, we take this one here and we notice that it says tau to the q minus 1 is equal to qp times tau. And now we can write tau to the q minus 1 is just tau squared q minus 1 over 2. So we substitute in tau squared from this and we find minus 1 to p minus 1 over 2 times p. The power of q minus 1 over 2 is equal to, sorry that tau shouldn't be there, is equal to qp. And now this is just the law of quadratic reciprocity because this gives us minus 1 to the p minus 1 over 2 times q minus 1 over 2 times p to the q minus 1 over 2 is equal to qp. This is all modulo q. But if you're working modulo q, then this term here is just q legionre symbol qp. So we've got the law of quadratic reciprocity. So again, as I said last lecture, most proofs consist of one key idea followed by a lot of rather routine calculation. In this particular proof, the key idea which is not obvious is to write down the definition of a Gauss sum. Once you've written down the definition of a Gauss sum, both of these formulas here are rather straightforward routine calculations and deducing the law of quadratic reciprocity from them is also fairly straightforward. So as usual, there's a very short key idea which is rather difficult to think of and followed by a lot of straightforward calculation. I'm not sure how Gauss managed to think of Gauss sums. It may have been related to his construction of a 17-sided regular polygon because Gauss sums turn up naturally in that construction. So maybe that's what gave him the idea. Anyway, you remember there was one slight problem we had earlier that we said q is congruent to 1 modulo p. Because we needed that in order to find an element epsilon such that epsilon to the p is congruent to 1 and epsilon is not congruent to 1. So we can ask what if q is not congruent to 1 modulo p? Well, what we have to do then is we change the field z modulo qz to a bigger field. Containing some epsilon with epsilon to the p is congruent to 1. And the way we do this is by using some of the ideas from abstract algebra we mentioned earlier. What we do is we take the polynomial x to the p minus 1, except we don't want the root 1 so let's divide it out. And then we write this as x to the 0 plus x to the 1 plus and sum plus x to the p minus 1. And what we do is we take an irreducible factor of this polynomial, let's call it f of x. And what we do is we take the field of integers modulo q and we join a variable x and we quotient out by f of x. And this is now a field and the order is equal to q to the power of the degree of f of x. So if q is 1 mod p then this has an irreducible factor of degree 1 and this field is just equal to z modulo qz. But in general it might be slightly bigger. And it contains an element epsilon with epsilon to the p congruent to 1 and epsilon is not congruent to 1. So it has a primitive pth root of unity which is just the image of x. And now we can just repeat the proof we gave except instead of using the integers modulo q we use the integers modulo q with this extra pth root of unity adjoined. So that gives a proof of the law of quadratic reciprocity that works for all odd primes p and q. Okay, next lecture I'll be talking about an extension of the Legendre symbol called the Jacobi symbol.