 Welcome to the penultimate lecture of our course. We have been discussing units in quadratic extensions of rational numbers. We saw the proof essentially of Dirichlet's theorem in the case of the quadratic extensions in our last lecture where we proved that the field q root d where d is positive will have infinitely many units. We are yet to of course prove the explicit structure of the group of units which is what we intend to do today. And we also want to describe all these units using continued fractions for root d. Basically, we are going to look at convergence of root d and these convergence will give us the solutions to the famous Brahmagupta equation. And before going to the Brahmagupta equation, we want to go to what is known as the fundamental unit. So, we observe that units in q root d is an infinite set. This is something we have observed in our last lecture. Let a be the set of units. We consider those units which are bigger than 1. So, this is a set of units. Is it an empty set or is it a non-empty set? So, we observe that if you have units, the units will be either positive or negative. Since you have that 1 and minus 1 are always units. We call them the trivial units in q root d. So, whenever you start with any non-trivial unit, if that non-trivial unit is negative, you can multiply it by minus 1 and then you get a non-trivial unit which is positive. So, we have now a non-trivial positive unit. The only trivial positive unit is 1. Since our unit eta which is now a positive unit is non-trivial, eta cannot be 1. So, the possibilities are that eta is less than 1 or eta is bigger than 1. If eta is bigger than 1, then it is in the set e. So, a is non-empty. If eta is less than 1, we will take 1 upon eta. 1 upon eta has to be bigger than 1, eta is positive. So, its multiplicative inverse is also positive. Remember, from the times of Brahma Gupta, we know that if you have a negative number and you multiply by that to a positive number, you will get a negative number. So, your eta if that is positive, its inverse should also be positive. And therefore, whenever eta is less than 1, the inverse is bigger than 1. So, in any case, we have that a is a non-empty subset. In fact, the whole set of units is expressed by elements in a by taking the plus or minus 1 power of elements in a and putting a plus minus sign outside. So, then a is non-empty and in fact, the units is equal to plus minus a to the power plus minus 1. This is the way to denote that any unit has to be plus or minus eta or eta inverse where eta is in a. This is what we mean. So, in some sense a contains about one-fourth of the units. Whenever you have any unit in a, you get 3 more units you will get. So, if you start with eta and element in a, then you will have 1 upon eta, you will have negative eta and negative 1 upon eta. So, you get 4 different units starting with 1 unit in a and then you have the 2 trivial units plus minus 1 which will give you the whole set of units in q root d. We also noticed that the units are of the form u plus v root d where u and v can be integers or half the integers. So, let us see what are the conditions on u and v. If this is of the form eta equal to u plus v root d, then eta inverse is eta conjugate because norm of a unit is 1 and the conjugate is u minus v root d. Now, eta is bigger than 1. So, its inverse is less than 1. So, this u prime is less than 1. This implies then v has to be a positive number. We cannot be 0 because if v is 0, the only integer unit is going to be plus minus 1 but we have something which is bigger than 1. So, v is non-zero, v could be either positive or negative but here we have that u minus v root d is less than u plus v root d. So, cancelling us, we get that minus v root d is less than v root d. So, v has to be positive. Now, v is positive, what about u? Is u positive or is u negative? If u is negative, then eta prime will be a negative number because now our v is positive. So, negative v is a negative number and if your u is also negative, then it tells you that you have eta prime to be a negative number which is also not possible because if you have something bigger than 1, its positive number, its inverse should also be positive. So, also u is bigger than 0. Can you have u equal to 0? What we could have here is that u is bigger than or equal to 0. If you have u equal to 0, your unit looks like v into root d and to have v into root d multiplied by some element again into the algebraic integers or you would have that the norm is equal to plus minus 1 that tells you that minus d v square is plus minus 1 and these can happen. If your d is positive, then minus d v square can be negative and so only for d equal to 1, you have a possibility of having a solution but 1 is not considered a square free integer. We are not considering d equal to 1. So, therefore, u equal to 0 is not a possibility. So, what we have obtained is that if you take a unit eta in A, then its integral part, so if you write it as u plus v root d, then u is positive and v is also positive. Moreover, we know that these u and v are integers or half the integers. So, once you start from 1 and u and v are both positive integers or half integers, you will start from 1 by 2 plus 1 by 2 root d, 1 by 2 plus 1 root d, 1 plus 1 by 2 root d, 1 plus root d and then you will increase. But you have these finitely many possibilities for the smallest possible possibilities for u and v. Therefore, we can find the smallest element in capital A. It is important to note that just because you have a set of elements of the form u plus v root d where u and v are integers does not mean that you will always find the smallest set of smallest element in such a set. What we have is that the u and v are not just integers, not just half the integers but they are both positive. So, since you have both of them positive, there is a smallest possible such unit. Call that eta naught. Call the smallest element by eta naught. Now, eta naught is a unit. So, all positive powers of eta naught are units and these powers will certainly go to infinity because eta naught is bigger than 1. So, the powers will go to infinity. If eta 1 is any unit in A, then there is a natural number small n such that eta naught power n is less than or equal to our eta 1 less than or equal to eta naught power n plus 1. Eta naught powers are going to infinity and eta naught was the smallest element in capital A. So, there will be an n such that the powers of eta naught up to that n are less than or equal to the eta 1 that you have fixed but the n plus 1 power and also the n plus 2 and so on will go beyond eta 1. So, we take that largest such integer. So, that we call that integer is called n. Now, here eta 1 is a unit. Eta naught power n is a unit. We can divide throughout by the eta naught power n. So, here we get 1 less than or equal to eta 1 upon eta naught power n less than eta naught. So, our eta 1 upon eta naught power n, remember eta 1 is a unit, eta naught is a unit. So, all powers of eta naught are units. Then this is definitely a unit and this unit is now sandwiched between the number 1 and eta naught. If this number was not equal to 1, it would give you an element in A because A is the set of all units bigger than 1. So, if this number was not equal to 1, we would get that this would then be in A, but it then cannot be less than eta naught. Eta naught was chosen to be the smallest element in A. So, this contradiction says that whatever we have assumed here that it is not equal to 1 that cannot be true. So, therefore, we get that eta 1 is eta naught power n. Therefore, every element in capital A is a power of eta naught. And then we can write down all units in A, all units in Q root D are plus minus eta naught power plus minus n or you may just have it to be n where you let n vary over integers. This very special element is called the fundamental unit. It is the generator of the infinite cyclic group which with plus or minus will give you the set of all units. So, this proves that the group of units is actually isomorphic to z cross z by 2 z. The plus part and the negative part these correspond to the group z by 2 z and then eta naught is generating the infinite cyclic group. So, thus the units thus this group is isomorphic to z by 2 z cross integers. So, we have proved Dirichlet's theorem completely for the quadratic case and we have also obtained the fundamental unit eta naught. Let us try to do an example. So, we have D equal to 2. We are looking at remember we are looking at solutions to u square minus 2 v square equal to plus or minus 1. The u and v are integers because our D is not congruent to 1 modulo 4. When D is congruent to 1 modulo 4 you have that the u and v can be half the integers but here u and v are integers. We have also noticed that when you look at the fundamental unit u plus v root D then both u and v are positive. So, we should start with the first one which is 1 and 1. So, we will look at remember our D is equal to 2. So, 1 plus root D root 2 root 2 alone is not a unit. We will look at 1 plus root 2 is this a unit we multiply by its conjugate and we get this to be 1 minus 2 which is minus 1 bravo we obtained a unit and this is clearly the smallest unit. If you have u and v to be integers which are positive then u and v will be bigger than or equal to 1 and clearly the both u and v are positive. So, they will both have to be equal to bigger than or equal to 1. So, you get 1 plus root 2 to be the smallest element of the corresponding a. So, this is our fundamental unit. The fundamental unit here in q root 2 is 1 plus root 2. Its norm is minus 1. So, if you wanted to get something whose norm is plus 1 if you wanted to get a solution to the Brahmagupta equation you have to now take the square of this 1 plus root 2. So, if you take the square of this it will be 1 square plus root 2 square. So, you get 3 plus 2 times root 2. This gives solution 2 u square minus 2 v square equal to 1. Here we had that this was a solution to u square minus 2 v square equal to minus 1. But now we have a solution to u square minus 2 v square equal to 1. 3 square is 9, 2 square is 4, 2 times 2 square is 8 and 9 minus 8 is 1. So, this is how for the simplest case we have found the solution but what now we want to do is to find the solution in the general case. So, we are going to start with d to be a positive square free integer and we are going to write down the solutions to the Brahmagupta equation u square minus d v square equal to 1. So, we consider such a solution eta bigger than 1 for x square minus d y square equal to 1. Then this eta will be of the form u plus v root d where both u and v are positive. This is something that we have already seen such an eta is going to be in the set capital A that we had defined earlier. So, here both u and v are clearly positive. Moreover, u by v is going to be a convergent to root d. So, let us see how this comes about. So, here this u minus v root d is the inverse of u plus v root d. This is less than our u plus v root d because we have that this is less than u plus v root d because we have the number 1 sandwiched between these 2 numbers. This is less than 1 and this is bigger than 1. So, we have that u minus v root d is less than u plus v root d and of course, we have that this is a positive number. So, that tells you that u has to be bigger than v root d and putting that here we get that u minus v root d has to be less than 1 upon 2 v root d. Since, u is bigger than v root d, u plus v root d is bigger than 2 times v root d and so the reciprocal is less than 1 upon 2 v root d. So, u minus v root d is these are both positive numbers. We have u minus v root d less than 1 upon 2 v root d and therefore, root d minus u by v which is really 1 upon v v root d minus u which is simply the mod of this is less than 1 upon 2 v square root d which is further less than 1 upon 2 v square. So, this u by v is a rational number which is trying to approximate root d in a way better than the convergence would do. We know that the convergence would approximate root d in a good way. That means, p n by q n are close to root d by distance at most 1 upon q n square and in fact, one of the 2 consecutive one of the each pair of consecutive convergence will have the property that one of them is less than 1 upon 2 q n square and then we saw the proof that if anything tries to do better than convergence then that has no other option but to be a convergent. So, here we see that this u upon v is trying to approximate root d in a way better than the convergence and therefore, u by v is a convergent. So, this is some nice situation because we wanted to find up non-trivial solution to x square minus y square d equal to 1 and any such non-trivial solution bigger than 1 has to be a convergent to root d. We are happy with solutions bigger than 1 because all other solutions can be obtained by taking the inverses of these solutions in q root d and putting a plus minus sign. The plus minus sign will not change the value of the norm. Norm will still be 1. So, we are looking at solutions which are bigger than 1 and satisfy x square minus dy square equal to 1. Any such solution should give you the x upon y to be a convergent. But we are going to get more and more conditions on these convergence. We first of all see that if you let root d be this particular if we consider the continued fraction expansion for root d, we have seen that root d plus its integral part has purely periodic continued fraction expansion. This is a result that we have seen which means that the continued fraction expansion for root d which will change from the continued fraction expansion of root d plus integral part of root d only in the first place because you are adding or subtracting an integer. But from second place onwards the periodicity has to start. So, you have that the continued fraction expansion will look like a 1, a 2, a m where m is your period of the expansion and you can take m to be the smallest one where you have the repetition. So, m is the period of the continued fraction expansion that you have the partial quotients getting repeated. So, from first step onwards we should have that these continued fraction expansion partial quotients start repeating. So, you will have a 1, a 2, a m then again a 1 and so on up to a m then again a 1 and so on up to a m. So, we have that root d turns out to be a 0 and then you have a 1, a 2, a 3 and so on up to a m bar. This is the continued fraction expansion for any root d and of course we know how to compute the partial quotients the complete quotients and the convergence. But we claim that our u v which gives us solution to the Brahmagupta equation. So, this u v comes from the solution to the Brahmagupta equations. If it is p n by q n for some n then n is odd. Why is this? This is because we will write root d to be p n theta n plus 1 plus p n minus 1 upon q n theta n plus 1 plus q n minus 1. This is the formula which we have already derived here, thetas are the complete quotients and now we look at q n root d minus p n. We simply multiply throughout this expression by q n and subtract p n from this. This is also something that we have done in one of the last lectures. What we get here is that this is minus 1 to the power n upon q n theta n plus 1 plus q n minus 1. So, this part turns out to be q n theta n plus 1 plus q n minus 1. If n is even then this quantity becomes positive because the numerator is positive and denominator here is anyway always positive. So, this turns out to be positive and then we get that p n minus q n root d is negative. But that cannot happen because our p n plus q n root d remember p n and q n are u by v. This is u by plus v root d. This is a positive number and its inverse then cannot be a negative number. So, if u upon v is p n by q n for some n then n has to be odd. So, this is the first condition that we obtain. We have proved that u by v where u square minus v square d is 1. If u by d there we consider the rational number u by v then it has to be a convergent to root d. Moreover, if it is p n by q n for some n being a convergent that n has to be odd. Further, we see that it is not just odd but it is of the form l m minus 1 where l is some natural number and m is the period. So, here m is the period. We will prove this also because recall once again that we have root d to be p n theta n plus 1 plus p n minus 1 upon q n theta n plus 1 plus q n minus 1. And if we consider, if we expand it out by taking this denominator multiplying it to this side and then writing it out explicitly we get p n minus q n root d into theta n plus 1 to be q n plus 1 root d minus p n minus 1. And therefore, if I multiply by p n plus q n root d to both the sides we get p n square minus q n square d into theta n plus 1 equal to on this side we get q n plus 1 root d minus p n minus 1 excuse me this is minus 1 p n plus q n root d which is again of the form some integer into root d plus another integer. But the integer that we get here is p n q n minus 1 minus p n minus 1 q n. So, this is minus 1 to the power n minus 1. We have already seen that n is odd. So, we get that this is root d plus c moreover this is equal to 1. So, we get that this is theta n plus 1. So, theta n plus 1 is root d plus an integer but we already have plus some integer c but root d already has this continued fraction expansion this is how we begin getting the continued fraction expansion for root d. So, this is a naught plus c plus 1 upon theta 1 on the other hand this would be a n plus 1 plus 1 upon theta n plus 2 because the complete quotient q theta n plus 1 its integral part is a n plus 1 and then you would have the next remaining fractional part you will write it as 1 upon theta n plus 2. But if you look at it from this point of you the integral part has to be a naught plus c. So, this expression gives us that a n plus 1 is a naught plus c and then you should have that theta 1 is theta n plus 2 which means that the theta 1 is obtained after the n plus 1 steps. So, n plus 1 has to be a multiple of your period m you remember m was chosen to be the smallest possible such number where you get periodicity. So, n minus 1 is a multiple of m call it l m and therefore, we get n to be n plus 1 then n plus 1 is l m minus 1 and so we get n to be l m minus 1 for some natural number multiple of m. Furthermore, these else have to be 1 2 3 when m is even and 2 4 6 when m is odd that is because we want our n to be odd n has to be odd. So, if m is even then any l m is even and l m minus 1 is odd this is okay. If m is odd we want l m minus 1 also to be odd the l has to be even because if you take l to be odd m to be odd l m will be odd into odd which is odd and odd minus 1 will be an even integer. So, the only possibilities are these possibilities. So, what we have done is that we have completely written down all possibilities for the n's where u upon v is the nth convergent it remains to see and it will not take more time now to see that any such convergent indeed satisfies the Brahmagupta equation. So, we now have to see that all such convergence what do we mean by such convergence we are looking at u by v to be p n by q n where n is of the form l m minus 1 and n is odd. We will prove that all such convergence also satisfy the Brahmagupta equation that is a simple check. So, this is what we do. So, we have this n and of course, then theta 1 is theta n plus 2 because n is l m minus 1 n plus 1 is l m. So, theta n plus 2 is theta 1 and we use once again the previous formula and use this to write it as theta 1. We have that root d is a naught plus 1 upon theta 1. So, theta 1 is 1 upon root d minus a naught. We put this formula in this equation for the theta 1's we would get some equation for root d and separating out we get finally that p n is q n plus 1 minus a naught q n and p n plus 1 minus a naught p n is q n into d. So, when you expand this out this particular equation by putting theta 1 equal to 1 upon root d minus a naught we get 2 sides where you have some multiple of root d plus an integer equal to some another multiple of root d plus another integer. And then these multiples of root d will have to be same and the integers then also will have to be the same. So, therefore, we get these 2 particular equations we try to eliminate the a 0 from these equations. So, you can eliminate a 0 by multiplying this equation by p n and multiplying this equation by q n but let us say with a negative sign. So, if you do that we get here p n into p n we get p n square p n into p n and to this side we are going to multiply by minus q n. So, minus q n square d this is we will have this q n plus 1 p n minus p n plus 1 q n which we know is minus 1 to the power n plus 1 but n is odd and therefore, n plus 1 is even and so we get that this is equal to 1. So, indeed p n and q n does satisfy the Brahmagupta equation. So, what we have proved is that any solution to Brahmagupta equation which is bigger than 1 is a particular type of convergent to root d and moreover if you take a particular type of convergent to root d that does satisfy the Brahmagupta equation. So, we have explained in complete detail the solutions to Brahmagupta equations which are bigger than 1 and as we have discussed the set of units in the quadratic extensions we see that all the solutions to the Brahmagupta equation can be now explained once you have these solutions with you. There is also this x square minus d y square equal to minus 1. We will simply mention the solutions to this but we will not have time to prove this. The answer is that when m the period when that period is even there is no solution. So, remember for root 3 we had the continued fraction expansion which was 1 comma 1 2 bar. So, there the period is even after two stages you get repetitions. Then you are not going to get any solution to x square minus 3 y square equal to minus 1 that can also be checked by using some simple arithmetic modulo 4. So, whenever m is even there are no solutions whenever m is odd these solutions are explicitly written down as follows that any such solution which is bigger than 1 is a convergent p n by q n where your n is still l m minus 1 but l is now an odd integer 1, 3, 5 and so on. So, here n has to be even that is quite clear because we want that minus 1 to the power odd has to come and therefore your n has to be an even integer. This is where we complete our penultimate lecture. We are just going to tie up some loose ends in the next lecture it is going to be a short lecture. I look forward to see you there and thank you very much.