 This lecture is part of Berkeley Math 115, an introductory undergraduate course on number theory, and will be more about binary quadratic forms. So we recall that a binary quadratic form is something of the form AX squared plus BXY plus CY squared. So binary means there are two variables X and Y and quadratic means it has degree two. And we want to be able to solve this equation given A, B, C, and N as integers. We want to find X and Y solving this. For example, last lecture we discussed the equation X squared minus 67 Y squared equals one and showed how we could find some non-trivial solutions of this apart from the trivial solution where Y is zero. Well, before solving it over the integers, we should first just recall what happens over the complex numbers. So what I'm going to do is I'm going to solve AX squared plus BXY plus CY squared equals zero over the complex numbers. And obviously we want a solution with X and Y none zero, otherwise it's kind of boring. And if we divide by Y squared, we find AX over Y squared plus BX over Y plus C equals zero and this is just a quadratic equation in X and Y. And we all know how to solve that by completing the square. We find the formula X over Y is minus B plus or minus the square root of B squared minus four AC over two A. Now, this term B squared minus four AC here is called the discriminant and it very much determines the behavior of this form over not only over the complex numbers but also over the integers. So we normally denote it by D. So D is B squared minus four AC. And we note that the behavior of this depends on the sign of the discriminant. So if D is greater than zero, the roots X over Y are real and distinct. If D is equal to zero, the roots are equal and if D is less than zero, the roots are non real because we're taking the square root of a negative real number. So we necessarily get some multiple of I in there. The case when D equals zero is kind of boring. It's sort of trivial to find integer solutions. So we generally sort of ignore this case. And we can ask, what are the possible values of D? So what are the possible values? And we notice that D is equal to B squared minus four AC. So in particular, D is congruent to B squared modulo four. So B squared modulo four can only be zero or one. So this implies that D must actually be congruent to zero or one modulo four. So not all integers can appear as the discriminant of a binary quadratic form. Conversely, if D satisfies this condition, there's always a form with that discriminant. For example, X squared minus NY squared has discriminant D is equal to four N and X squared plus XY minus NY squared has discriminant D equals four N plus one. So for any number of the form, four N or four N plus one, there's at least one binary quadratic form with that discriminant. So the possible discriminant, so minus 12, minus 11, minus eight, minus seven, minus four, minus three, zero, one, four, five, and so on. And these numbers also turned up when we were discussing the chronicle symbol. You remember there was a chronicle symbol, D over B. And we pointed out the chronicle symbol actually behaves rather better when the numerator is zero or one mod four. And the numerator and the chronicle symbol is very often taken to be the discriminant of some binary quadratic form. And so it's very nice that binary quadratic forms will always have discriminant satisfying this condition because that makes the chronicle symbol very nice. So let's look at what effect the discriminant has on the behavior of the form. So let's look at three forms as an example. So there's x squared plus y squared, x squared minus two y squared, minus x squared, minus two y squared. And here the discriminant is minus four, discriminant is eight, and the discriminant here is minus eight. And you'll notice this is less than zero. This is greater than zero and this is less than zero. And now we can see that these forms have the following properties. This one is always greater than or equal to zero. And this one is always less than or equal to zero. On the other hand, this one here is a bit different because this one can be greater than zero and can also be less than zero. So the cases when the form is always either positive or negative, the form is said to be definite. So it's always either definitely positive or definitely negative. And the case when the form can be both positive or negative is called indefinite. And there are two sorts of definite forms. They can either be positive definite when the value of the form is always positive or they can be negative definite. But there's not really that much difference between positive definite and negative definite forms because you can just change one to the other by multiplying it by minus one. So usually people only discuss positive definite forms because negative definite is a trivial variation of this. And definite forms correspond to D being less than zero and indefinite forms correspond to D being greater than zero. We're ignoring the case when D equals zero because that's kind of trivial. So in order to see this, all you have to do is complete the square of the form. What you do is you notice if you've got a form AX squared plus BXY and CY squared and you change X to X plus KY, the discriminant D remains unchanged. So it's a sort of straightforward piece of algebra. You just have to work at B squared minus four AC for the two forms. Now by choosing a suitable value of K, you can arrange for the value of B to be equal to zero. So we only have to check this for the form AX squared plus CY squared. Now you notice the discriminant is minus four AC. So if this is greater than zero, then that means that one of AC is greater than zero. And one is less than zero. So this means the form is indefinite. On the other hand, if D is less than zero, this means A and C are both greater than zero or A and C are both less than zero. And both of these cases correspond to the form being definite. Of course, the first one, the form is positive definite and the next one, the form is negative definite. But the discriminant can't tell the difference between positive definite and negative definite. So the discriminant is called a discriminant because it discriminates between the two cases when the form is definite or when it's indefinite. And the theory of these two forms turns out to be quite different. For instance, you can see this if you try and draw the graph of the form being equal to some constant. So if the form is definite, the equation of x squared plus y squared equals constant is going to be some sort of ellipse. In fact, it'll be a circle in this case. Whereas in the indefinite case, x squared minus two y squared equals a constant is usually a hyperbola unless it degenerates into two straight lines or something. So definite forms correspond to ellipses and indefinite forms correspond to hyperbolas. Next, we are going to say that a x squared plus b xy plus cy squared equals n. We'll say the form represents n. So it just means n is one of the values. Of course, x and y have to be integers. And there's a small technical variation of this. We say it primitively represents n if x and y are co-prime. We'll see in a few minutes why we need this condition. Before then, I'll just give a few examples of this. So the form x squared plus y squared represents five because five is equal to one squared plus two squared. And this is primitive cause one and two are co-prime. x squared plus y squared does not represent minus one. Rather, obviously you can't write minus one as the square of some integer plus the square of some other integer because this is always positive. But x squared plus y squared also represents eight because eight is equal to two squared plus two squared. And you notice this representation is not primitive. In fact, there's no way for x squared plus y squared to represent eight primitively as you can easily check. If you write eight as the sum of two squares, then the two squares have to be both have to be four and this has to be plus or minus two and so on. If you look at the form x squared plus four y squared, this represents eight. So it represents four in two ways. We can write four is equal to two squared plus four times one, four times zero squared. And this is not primitive cause two and zero are not co-prime. But we can also write four is equal to zero squared plus four times one squared. And this is primitive. So the same number can be represented by form in both a primitive way and an imprimitive way. Now we come to the main reason why we've introduced the concept of primitive representations. We have the following theorem. So if n is primitively represented by a x squared plus b x y plus c y squared with discriminant d is b squared minus four ac as usual. Then d is a square modulo four n. And before proving this, let's just show that we really do need this condition about being primitively represented. It really becomes false if we drop this. Suppose we take the form to be x squared plus y squared and we take n to be eight. Then n is represented because n is equal to two squared plus two squared. So that's of that form. But d equals minus four is not square mod four n which is 32. And we can see that because of minus four is equal to b squared plus, better not use b, minus four is equal to z squared plus 32 times sum number t. Then if we look at this, that's even, so z must be even so we can divide z by two and we find minus one is equal to z over two squared plus eight t. But this says that minus one is a square modulo eight and we know that minus one is not a square modulo eight. So this fails. So without this condition here, this theorem is definitely false. So let's see how to prove it. The proof is very short. It's a little bit tricky. So suppose n is primitively represented by this form. So n is equal to a x squared plus b x y plus c y squared and x and y co-prime. So we're trying to show that d is a square modulo four n. Well, now we multiply this by four a, and we get four a n is equal to four a squared x squared plus four a b x y plus four a c y squared. Now we're going to complete the square. So this is two a x plus b y squared minus b squared minus four a c times y squared which is equal to some square minus d y squared. So, d y squared is a square modulo four n because there we have d y squared is a square modulo four n. Also, d x squared is a square mod four n because x and y are kind of symmetric. Anything we can do with x, we can do with y just by switching x squared. So far, we haven't used the fact that x and y are co-prime but now what we're going to do is we can put four n is equal to n one n two with n one x, n one and x co-prime and n two and y co-prime. And in order to do this, we need to use the fact that x and y are co-prime. And we're also going to take n one n two to be co-prime with each other. So now we notice that x squared d is a square modulo n one because n one divides four n. So d is a square modulo n one because x n one is equal to one. So we can, if x squared is the square of an invertible element. So if x squared d is a square, then d is also a square. We can just divide by x squared. Also, by the same argument, d is a square modulo n two because as we said, it's anything we can do with x, we can do with y. So by the Chinese remainder theorem, d is a square modulo n one times n two, which is equal to four n because n one and n two are co-prime. So that's shown that d is a square modulo four n if it's primitively represented. Now we can ask, is there a converse to this? So we can ask, is there a converse? If d is a square modulo four n, is n represented primitively? And the answer is no in general. Let's have an example. Let's take the form to be x squared plus five y squared. So discriminant is minus 20 and d equals minus 20 is a square modulo four times three. So we're going to take n to be three, but x squared plus five y squared does not represent n. Actually, there's a trivial reason why this could fail. The form could be definite, say the form could be positive definite and n might be negative. But this shows that even if we don't have this sign condition here, n is positive and the form is positive definite, but n is still not represented by the form. However, there's a weak converse. The weak converse is equivalent. So if d is a square modulo four n, then n is primitively represented by some form of the form. Discriminant d. And that's very easy because d is a square modulo four n, that means d is equal to a square minus four n times something. So this just says d is a square modulo four n. But then we can take the form to be a x squared plus b x y plus n y squared. And we see the discriminant of this form is just b squared minus four a n, which is what we wrote down there. And this represents n. Well, it's obvious how it represents n. We just put x equals zero, y equals one. And this is certainly primitive because zero and one are co-prime. So we have the following very important basic result. So the following are equivalent. First of all, d is a square modulo four n. And secondly, n is primitively represented by some form of discriminant d. So we're going to use this quite a lot. You see, it gives us some information about which numbers are represented by forms. There's a little bit of a problem because we can't, don't seem to be able to pin down exactly which form n is being represented by. But we'll see how to deal with this problem later on. Let's just give an example. Let's take d equals minus four. And let's take n to be a prime because it turns out that primes are rather easier to deal with. Now there's a form of discriminant d equals minus four which is x squared plus y squared. So this theorem says that if p is represented by this form, then this implies that d is a square modulo four n which is equal to four p because n is just equal to p. So this says that minus four is a square modulo four p and it certainly is square modulo four. So this is equivalent to saying minus one is a square modulo p. And we saw earlier that this is equivalent to saying p equals two or p is equivalent to one modulo four. So this says that if x squared plus y squared is p, then p is one modulo four which we actually saw earlier. It's actually rather easier to prove this. But so this is, so the fact that any prime of the form x squared plus y squared is of the form one mod four is a special case of this result here. We'd also like to show the converse. If p is one mod four, we would like to show it's the sum of two squares. Now if this were the only form of discriminant minus four, then this theorem would give us that result because it says that there's some form representing p and it would have to be this form. The trouble is this is far from being the only form of discriminant minus four. There are loads of other forms. For example, there's x squared plus two xy plus three y squared and lots and lots of others. However, the key point is that these are all equivalent. So we will explain what equivalent means in a later lecture, but in particular, two equivalent forms represent the same numbers. I should say they're equivalent to why they're positive definite. So if all positive definite forms of discriminant D are equivalent, then if N satisfies this condition, then N must be primitively represented by all these forms because it must be primitively represented by one of them and they all represent the same numbers. So if we can show that all positive definite forms have given discriminant or equivalent, then we can use this theorem to show which numbers are represented by the form. Okay, well, we now need to discuss what it means for two forms to be equivalent, which I will do in the next lecture.