 This lecture is part of Berkeley Math 115, an introductory undergraduate course on our number theory, and will be about equivalents of binary quadratic forms, AX squared plus BXY plus CY squared, where A, B and C are integers. And the problem we want to solve is to find which integers N are represented by the form. And we're going to take primitive representation, so X and Y are co-prime. And we remember we had a sort of theorem about this last lecture, which says that N is representable by this form if and only, but by some form of this discriminant, if and only if D, which is the discriminant, is B squared minus four AC, is a square mod four N. So N is this for some form. But the trouble, so if there were only one form of discriminant minus D, for instance, if D is minus four, then the form X squared plus Y squared is a positive definite form of that discriminant. Then we would find a theorem that says that N is equal to X squared plus Y squared, if and only if minus four is a square mod four N. And that would be very useful. If we take P to be a prime, for example, we see that P is equal to X squared plus Y squared, if and only if minus one is a square mod P, which says that P equals two or one P is one mod four. So that would give us a very nice condition of saying that a prime is a sum of two squares, if and only if it's one or two mod four. The problem is that this is not the unique form of discriminant minus four. In general, there are quite a lot of ways of changing a form to one of the same discriminant. So suppose we change X to X plus Y and we take a form AX squared plus BXY plus CY squared. Well, let's see what that becomes. That becomes AX plus Y squared plus BX plus Y times Y plus C times Y squared, which is equal to AX squared plus two A plus BXY plus A plus B plus CY squared. So what's the discriminant of this? Well, it's two A plus B squared minus four A, A plus B plus C, which is equal to four A squared plus four AB plus B squared minus four A squared minus four AB minus four AC, which is equal to B squared minus four AC. So making this change of variable X goes to X plus Y doesn't actually change the discriminant. So for example, we can change X squared plus Y squared to X squared plus two X Y plus two Y squared. And there are lots of other changes we can do. We can change X to X plus NY for any N because that's just repeating this N times. Or we could swap X and Y and that obviously doesn't change the discriminant because the form becomes CX squared plus BXY plus AX squared or we can even change X to minus X. So there are quite a lot of things we can do to the form without changing its discriminant. So more generally, we can make the following change of variables. We can change X to AX plus BY and Y to CX plus DY. So this is really just multiplying the vector XY by the matrix A, B, C, D. And we want this to have an inverse. Well, you can find the inverse of a matrix if its determinant is invertible and here the determinant is AD minus BC. And we want this to be invertible. But we'll remember all our matrices are integers. So we want this to be an integer with an inverse. So the condition is just AD minus BC equals plus or minus one. And you can easily check this because if AD minus BC is plus or minus one then the inverse is going to be given by D minus C minus BA. And this will be equal to plus or minus one, plus or minus one depending on what this sign is. So if we make this change of variable with AD minus BC plus or minus one, then we're not really going to change the form very much. We'll obviously still represent the same numbers. So we say forms are called properly equivalent if we get AD minus BC equals plus one here and improperly equivalent if AD minus BC is equal to minus one. So here we'd be taking two forms, A1X squared plus B1XY plus C1Y squared. And we're just changing it to A1AX plus BY squared plus B1AX plus BY CX plus DY plus C1CX plus DY all squared, which is a little bit of a mess to write out. And we can ask what happens to the discriminant if we might do this. And well, we could do this by brute force calculation, but it's a bit messy. So let's see if there's a slightly easier way of doing it. So we're changing X to AX plus BY and Y to CX plus DY. And you notice the form AX squared plus BXY plus CY squared can be written like this. You take AB over two, B over two C and you multiply it by XY on the right and by the row matrix XY on the left. So this little two by two matrix here is really a way of representing this quadratic form as a matrix. And now if we're changing XY to ABCD times XY, you see this is this linear transformation. So we're changing the form to A, C, B over two, B over two. And then we put A, B, C, D, XY here and then we put XY and now we need to transpose this matrix because we're multiplying by XY on the right. So we get A, C, B, D. And now this is going to be the matrix of the new form. And we notice that the discriminant of this, D, is equal to the determinant of this matrix. So it's AC minus B over two times B over minus B over two or rather the discriminant over four is equal to that. So in order to work out the discriminant of the new form, the discriminant of the new quadratic form, we've got to work out what is the determinant of this matrix? Well, the determinant is equal to the determinant of ACBD times the determinant of A, B over two, B over two, C times the determinant of A, B, C, D. Well, that's easy because this is plus or minus one and this is also the same plus or minus one and this is just the discriminant over four. So we see that the discriminant gets multiplied by the square of this determinant, which is one. So the discriminant does not change if we change our quadratic form to an equivalent one. So let's see a few examples of this. So suppose we take the form four x squared plus xy plus six y squared and four x squared minus xy plus six y squared. So if we change x to minus x, we see that the form is improperly equivalent. You notice this corresponds to the chain using this matrix to make the change of variables which obviously has the determinant equal to minus one. These forms are not properly equivalent. You can do this by brute force calculation but I'm not going to do it now because later on we will have a much easier way of checking whether forms are properly equivalent. So it is possible for forms to be improperly equivalent but not properly equivalent. Now let's take a look at forms of discriminant minus 12. We can write down two forms. At least, well, we can write down following two forms and you see they both have discriminant minus 12 and we can see that these are definitely not equivalent and that's easier to see because this one here is always even whatever x and y are. However, this one here is sometimes odd. We put x equals one, y equals zero, this is odd. So these forms do not represent the same numbers so they can't possibly be equivalent because equivalent forms have to represent the same numbers. Well, you may say we're cheating a little bit on this one because all the coefficients on this one are even so somehow that forces all the values to be even. So can we find two non-equivalent forms of the same discriminant which don't have this property and the answer is yes. If we take d equals minus 15, we can take the form to two x squared plus xy plus two y squared and x squared plus xy plus four y squared and these are again not equivalent. And in order to see they're not equivalent, we can just show they don't represent the same numbers. So for instance, this represents one. We take x equals one and y equals zero and this does not and this is a little bit harder to see but you can see this by completing the square. So this becomes two x plus y over four squared plus 15 over eight y squared if I've calculated it right. And now this is a sum of two squares. So if it's one, each of these must be at most one. So well, y must be zero and then obviously there's no way of choosing x. So this one does not represent one for any integer values of x and y. So we definitely can sometimes get two in equivalent forms of the same discriminant. So the problem we want to understand is classify forms of discriminant e up to equivalents or maybe proper equivalents. I mean, I'm not worrying too much about the difference between proper and improper equivalents just now. And suppose that all forms of discriminant e are equivalent. Actually, if the forms are definite, they're almost never equivalent because they can be either positive definite or negative definite. So we would say all positive definite forms if we're looking at definite forms. Then if ax squared plus bxy plus cy squared has discriminant b squared minus four ac plus d, then this represents n if and only if d is a square mod four n because we showed earlier that d is a square modulo four n if it's represented by some form of that discriminant. But if all the forms are equivalent, they all represent the same numbers. So any form must actually represent n. So we have to ask when is this condition satisfied? And this depends on d. There are some values of d when it is satisfied and some values of d when it isn't satisfied. So the problem is to try and understand equivalence classes of forms. So now we look at the following problem. Given a form ax squared plus bxy plus cy squared, can we find a simplest form equivalent to it? So is there a sort of best possible choice of an equivalence class of forms? Well, what do we mean by simplest? Well, first of all, let's try to make a as small as possible. That means under equivalent. So we're allowed to change x to x and y to some linear combination. And if a is minimal, let's try to make b minimal as small as possible. So let's do this as an example. Suppose we've got a form 2x squared plus 10xy plus 13y squared. Well, let's try and adjust it. So let's try and adjust it as small as possible. Well, let's try and adjust it to make a and b as small as possible. First of all, we can make b smaller by making the change of variable, changing x to x plus 2y. So we can think of this as being 2 times x plus 2y squared plus 2 times x plus 2y times y plus y squared. And if we now make the change of variable, changing x to x plus 2y, we find this becomes 2x squared plus 2xy plus y squared. And now we can change x and minus y and this becomes y squared minus 2xy and plus 2x squared. You may ask, why don't we change x to y? Well, changing x to y is actually this matrix which has determinant minus one. So this would be an improper transformation. In improper transformations, you should kind of avoid if possible. That should be an x squared and that should be a y squared. So now we've made a equal to one and now we can change x to x minus y and this just becomes x minus y squared plus y squared which now becomes x squared plus y squared if we change x to x plus y. So this form of discriminant, what, minus four, is actually equivalent to this form of discriminant minus four which we can find by trying to simplify it. And if we use the two operations, we can swap x with minus y or we can change x to x plus y. And let's see what this does. Well, we say the form is reduced. So this form is a x squared plus b x y c y c y squared. So this form is x squared plus b x y c y c y squared. So let's say it's reduced to mean that b is less than or equal to a in absolute value and the absolute value of a is less than or equal to c plus some other small conditions that I will mention a bit later. And the key point is that every form is equivalent to a reduced one. And to show this, we can make a minimal and secondly, we make b minimal given this smallest value of a. And let's check that a form with these two properties is actually reduced. Well, first of all, we must have a is less than or equal to c or else we can swap x and y in order to make so swapping x and y would make c less than or equal to a so a wouldn't be minimal. And then we can change x to x plus n y and by choosing n, we can choose n to make minus a is less than or equal to b is less than or equal to a. So the absolute value of b is then less than or equal to a. I mentioned there are actually two other small conditions we can put in. If you look at this carefully, we can also see that if a equals c or a equals b, we can take b to be greater than or equal to zero. So the reduced form has this rather minor extra condition but really you should forget about it. It's not really all that important. This is the key condition of reduced forms. So we've seen that every form is equivalent to reduced form and now we can see that there are only a finite number of reduced forms of a given value of the discriminant b squared minus four ac. And to see this, first suppose the form is positive definite. So that means a is greater than zero and c is greater than zero and d is less than zero. So we have b squared minus four ac equals d less than zero. So three a squared, which is equal to four a squared minus a squared is going to be less than or equal to four ac minus b squared because here we're using the fact that b is less than or equal to a is less than c, which is equal to minus d. So if we compare this, we have a bound on a. A is less than or equal to the square root of minus d over three. So there are only a finite number of values of a and b has absolute value less than or equal to a. So a finite number, number of values of b and c is equal to minus d plus b squared over a. So c is now fixed. So there are a finite number of values of a and only a finite number of values of b and only one and given a and b, there's only one value of c. So there are only a finite number of reduced forms. So now what we want to do is given a discriminant d, we want to classify these finite number of forms of discriminant d. And if we're really lucky, there will only be one reduced form of one reduced form of discriminant d. And this will then show that all forms of discriminant d are equivalent because we've shown that every form is equivalent to a reduced one and there's only one reduced one. And this will allow us to work out which primes are represented by the form and so on. So we're going to work out several examples of that next lecture.