 Welcome back, we have proved the one of the most important theorems in number theory, the Chinese remainder theorem and then in the last lecture we also took some problems related to the theorem, we applied the theorem in various cases. We are going to see one more application of this theorem and do some more computations in the set Z modulo nz. So, this is the set which we denote by Z sub n and we will call it Zn or sometimes we call it Zn. The set of integers Z is sometimes pronounced as Z. So, Zn is the set that we will be looking at and we will start some arithmetic in it. So, we have solved linear congruences in Zn. We saw exactly when x congruent to b mod n has solutions. We go one step further and we try to solve quadratic congruences. So, the very beginning step is to solve for x square congruent to 1 modulo n. This is the non-linear, the quadratic congruence that we are going to solve. In general, it is not easy to give the solutions to the equation x square equal to 1 in Zn, but what we can definitely do is to compute the number of solutions. So, what we want to do to begin with is to compute the number of solutions to x square congruent to 1 mod n. These are the square roots of 1 in Zn, the square roots of the identity element in the set Zn. So, we notice one thing immediately that whenever we have some natural number a. So, if a in the set of natural numbers is a solution to x square congruent to 1 in Zn, then a is a solution to the same equation, but we are going to change the modulus. So, instead of looking at Zn, we are going to look at Zpi power ni for every i where we have that n is p1 power n1 pk power nk. So, whenever we have n dividing a square minus 1, we have these Pi power ni also divide a square minus 1. And therefore, we get that the number a is a solution modulo Pi power ni also. Therefore, to solve the equation x square congruent to 1 mod n, we should first solve it modulo the prime powers. So, we are going to solve the equation x square congruent to 1 mod n modulo n where n is a prime power. This is what we are going to do, but then there are two cases. Case one is where our prime is odd and case two is when p is the oddest of all the primes which is that p is equal to 2. These are the two cases that we are going to study. So, case number one once again is where we are solving x square congruent to 1 modulo power of an odd prime. And case number two would be where we will solve for x square congruent to 1 modulo 2 power e. Those are the two cases and then we will combine these two cases and come back to our general equation x square congruent to 1 modulo n and we will see how many solutions there can be. So, we begin with p equal to an odd prime. This is what we have x square congruent to 1 mod n in z n where n is p power e and p is odd. So, there is one thing that everyone should notice immediately which is that there are two God given solutions 1 and minus 1 are always the solutions to x square congruent to 1 mod n for any n and so also for p power e we will have these solutions. So, also in this case but we will actually show that there are no further solutions. We will in fact show that there are no other solutions in the present case. So, when p is an odd prime and we are looking at z modulo n z where n is power of this odd prime then we will show that x square congruent to 1 mod n has only two solutions and those are p a equal to 1 and a equal to minus 1. So, suppose a in natural numbers is a solution we will then prove that a has to be congruent to 1 mod p or that a has to be congruent to minus 1 mod p this is what we will show. So, start with a solution a such that a square congruent to 1 modulo p and by this we mean that here it is p power e p power e divides a square minus 1 this is what we have whenever you have a square congruent to 1 modulo a number you will have that the number n divides the difference of the numbers which are there on the two sides of the congruent sign. Now, it is a high school mathematics to see that the a square minus 1 is product of a plus 1 and a minus 1. So, what we ultimately get is that p divides this product. So, we get that p divides a plus 1 into a minus 1 this is what we get but p is a prime and whenever a prime divides product of two numbers it will have to divide one of the two. So, here we have three cases p will either divide only a plus 1 and not divide a minus 1 or it will divide only a minus 1 and not divide a plus 1 or it will divide both a plus 1 and a minus 1 these are the three possibilities. However, if p divides a plus 1 and p divides a minus 1 then p will have to divide the difference which is a plus 1 minus a minus 1 as you see this difference is 2. A will get cancelled 1 minus minus becomes plus 1 plus 1 is 2 but this is a contradiction because p is an odd prime p being a prime when it divides two it will have to be equal to 2 but p is odd and 2 is even. So, this contradiction says that the initial assumption that we had that p divides both a plus 1 and a minus 1 cannot hold. So, p will divide exactly one of them it divides both it divides the product of them and if it divides both then we have a contradiction hence p divides a plus 1 or p divides a minus 1 but not both and this already tells us that the first case is that a is congruent to minus 1 modulo p and the second case says that a is congruent to 1 modulo p. So, there are precisely two cases in the case of p being an odd prime that the solutions to x square congruent to 1 in Z p power e will have to be just 1 or minus 1. So, this is what we have done here is for p but the case that it cannot divide both will tell you that when p divides a plus 1 all the powers of p which are p power e will have to divide a plus 1 they cannot divide a minus 1. So, we actually get that we have the possibility modulo p power e also to be only the that a is 1 mod p power e or a is minus 1 modulo p power e. So, to summarize whenever p is an odd prime in the set Z mod p power e Z there are only two solutions to x square congruent to 1 mod p power e and those are a equal to 1 modulo p power e and a equal to minus 1 modulo p power e for all odd primes the situation is the same when we go to the even prime p equal to 2 there the situation is somewhat different. We do the case of p equal p power e equal to 2 and p power e equal to 4 separately and then from 8 onwards we will be dealing the case differently. So, let us just look at these sets let us write them down. So, here we have this set to be 0 and 1 0 square is 0 1 square is 1. So, 1 or what we would say as a congruent to 1 mod 2 is the only solution. Remember I had said that minus 1 and 1 are always the solutions, but unfortunately modulo 2 1 and minus 1 happen to be congruent to each other. So, these two which were distinct elements in Z mod n Z they collapse to a single element when n is 2 and therefore, here we have this as the only solution. Let us go to the next set which is Z mod 4 Z we have 4 elements 0 1 2 and 3. As we know that a congruent to 1 mod 4 and a congruent to minus 1 mod 4 these are always the solutions. So, what is 1 mod 4 that is simply 1 the class of 1 this is 1 mod 4 and this is minus 1 mod 4 these two are always the solutions and so they are solutions here also if you take the square of 2 you get 0 2 square is 0 and of course, 0 square is 0. So, it tells you that in Z mod 4 Z now there are 2 solutions. So, for p power e equal to 2 we have one solution. So, this gives you one solution and this gives you that there are 2 solutions for p power e equal to 8 and onwards situation is going to be different. So, we begin with the case where n is 8 and let us write this set carefully we have 0 we have 2 we have 4 and 6 I am writing all the even classes first then I write the odd classes and note here that all these numbers they square to 1 the squares of all these 4 numbers is 1 1 square is of course, 1 and 7 squares remember 7 is minus 1 when you are looking at modulo 8 1 square is 1 and 7 square which is also minus 1 square that is 1. But these 2 middle numbers 3 and 5 their squares 3 square is 9 which is 1 modulo 8 and 5 square is 25 which is also 1 modulo 8. So, here we have 4 solutions of course these numbers do not square to 1. So, their square is not 1. So, what we get ultimately in the case Z mod 8 Z that there are 4 solutions this is a very striking situation this is completely different from what we have seen so far we saw that modulo a prime power there are exactly 2 solutions 1 and minus 1 modulo 4 there are 2 solutions 1 and minus 1 and modulo 2 there is a single solution. So, other than 1 and minus 1 which happens to collapse in the case of n equal to 2 we have not seen any different solution. But when we go to 8 the prime power becomes 8 we have 4 solutions what will happen when you go to 16 let us just think about it for 16 we have 1 square which is 1 and 15 square which is 225 which is 1 modulo 4 if you do not say it quickly remember that 15 is minus 1 modulo 16. Therefore, its square is going to be 1 modulo 16 but there are 2 more numbers the number 7 its square is 7 square is 49 that minus 148 is divisible by 16. And similarly 9 square is 81 when you subtract 1 from 81 you get 80 that is also divisible by 16. So, we have 4 square roots of 1 modulo 16 1 7 minus 7 minus 1 are there any more that would be the natural question and we will prove that there are no further whenever you have n equal to a power of 2 which is bigger than or equal to 8 then there are exactly 4 solutions to x square congruent to 1 modulo n. This is the thing that we would now like to prove. So, consider n equal to 2 power e and assume that this is bigger than or equal to 8. Let a in the natural numbers be a solution to x square congruent to 1 mod this 2 power e. Then of course 2 power e divides a square minus 1 and we recall our high school mathematics once again to write it as a plus 1 a minus 1. We have done exactly what we had done in the prime power case but now there is a different thing here 2 power e divides a power product of 2 numbers. So, in particular 2 divides the product of these 2 numbers. But if 2 divides the product of these 2 numbers 2 will have to divide 1 of them it may divide a plus 1 it may divide a minus 1 and as we know the third case that it may divide both. In this case in contrast it has to divide both. The first 2 cases that 2 divides only a plus 1 and not a minus 1 or 2 divides only a minus 1 and not a plus 1 is not going to occur. How does that happen? Since 2 divides 2 power e which divides a square minus 1 which we will further write as a plus 1 a minus 1 a is odd. Because 2 divides a square minus 1 so a square minus 1 is an even integer. So, a square is an odd integer and then a has to be odd. If a was even a square would be even and then a square minus 1 would be odd which would be a contradiction. So, here a is odd and then both a minus 1 and a plus 1 are even. And therefore 2 has to divide both of them. 2 will divide a minus 1 and 2 will also divide a plus 1. So, when we have to decide modulo 2 power e we know that the factors the copies of 2 that are there in 2 power e one of them has to go and divide a minus 1. One another copy has to go and divide a plus 1. What about the remaining ones? Will they also split? Will some of them go and divide one? Will the remaining ones go and divide the other? Or do they all go to one of those 2 factors? That is the thing that we now have to think about. But then we see that a minus 1 and a plus 1 these are both even. So, they are both 0 modulo 2 but their difference is only 2. So, one of them when you go modulo 4 one of them will have to be 0 mod 4 and the other will have to be 2 mod 4. But exactly one of them is divisible by 4. Both cannot be divisible by 4 because then 4 will have to divide the difference which is 2. So, exactly one of them is divisible by 4. If you assume that 4 divides a plus 1 then a plus 1 is 0 mod 4 and therefore a minus 1 is 2 mod 4. And then all the remaining powers of 2 will necessarily divide a plus 1 because no higher power of 2 other than 2 can divide a minus 1. a minus 1 is just 2 mod 4. Even 4 does not divide it. So, higher powers of 2 cannot divide. So, all the other factors of 2 will collect themselves and go and divide a plus 1. Similarly, if we have the other case that 4 divides a minus 1 then 2 power e minus 1 will have to divide a minus 1. And a plus 1 in this case is congruent to 2 mod 4. So, this is what we have obtained that if a is a solution to x square congruent to 1 mod 2 power e then a plus minus 1 has to be divisible by 2 power e minus 1. So, thus if a in the natural numbers is a solution to x square congruent to 1 mod 2 power e and remember we are in this case then a is congruent to 1 modulo 2 power e minus 1 or a is congruent to minus 1 modulo 2 power e minus 1. So, when we look at the whole set of numbers where we begin this is 0 which we ignore then we have 1 then 2 and so on this is where we have 2 power e and somewhere exactly in the middle we have 2 power e minus 1. So, the first case tells us that a has to be congruent to 1 mod 2 power e minus 1. So, that can be this number 2 power e minus 1 plus 1 or it can be this number a equal to 1 both are 1 modulo 2 power e minus 1. The second case which says that a is minus 1 modulo 2 power e minus 1 will tell you that it can either be 2 power whole e minus 1 or this quantity which is 2 power e minus 1 minus 1. These are the only 4 solutions in the case when the power of 2 is more than 4. So, we have now obtained all solution we have solved all the cases when n is a prime power when p is odd there are only 2 solutions when n is a power of 2 but equal to 2 itself then there is only one solution if n is 4 then there are 2 solutions and when n is a power of 2 but strictly bigger than 4 then we see that there are 4 solutions. Now, we want to go back to our general situation and compute the number of solutions to x square congruent to 1 modulo n. So, that is the case that we want to now do. So, now we go to the general case. So, recall that a square is congruent to 1 mod n if and only if a square is congruent to 1 mod p i power ni where we have this prime factorization. So, we start with this prime factorization to begin with to refresh the statement we would begin with this then we have that a square congruent to 1 mod n holds if and only if a square congruent to 1 mod p i power ni holds. Now, the condition that a square is congruent to 1 mod p i power ni can be written in terms of linear congruences. This is because we have solved the cases a square congruent to 1 mod p i power ni. So, these cases let me just summarize them in the next slide for you in the following way. So, the solutions x square congruent to 1 mod n r plus or minus 1 mod n when you have n to be p power e and p is odd. Another case is when you have just 1 or minus 1 modulo 4 of course you have n equal to 4 modulo 2 you have only one solution and in the final case when you are looking at 2 power e then we have these 4 solutions. So, we will take our n write its prime power factorization also put the p i's in the increasing order. So, p 1 less than p 2 less than dot dot dot then we will look at. So, this is what we do n equal to p 1 power n 1 p 2 power n 2 up to p k power n k and we write it in this way then we know that for obtaining the square. So, a square congruent to 1 mod n if and only if a equal to plus or minus 1 mod p i power ni or i bigger than or equal to 2 and then there are these bunch of solutions. So, a equal to 1 mod 2 or a equal to plus or 1 mod 4 or a congruent to plus minus 1 2 power e minus 1 plus minus 1 mod 2 power e these are the only possibilities. So, we will combine these in all the cases suppose that there is no prime equal to 2 in the factorization then we have only this case and in fact then you will have i equal to 1 and ahead. So, we are going to get 2 possibilities for each prime when we write them all together you have 2 power k possibilities you have 2 power k linear congruences there are going to be simultaneous systems of linear congruences which are given by plus or minus 1 modulo each p i power ni and there are unique solutions modulo the product of these moduli which is n and so you are going to get exactly 2 power k solutions. So, there are exactly 2 power k solutions when 2 does not divide your number when 2 divides your number there are 2 possibilities 2 divides but 4 does not divide 4 divides but 8 does not divide and 8 divides it. So, depending on these 3 cases we have 3 possibilities once again when 2 divides but 4 does not divide then we will be in this case 2 divides but 4 does not divide. So, we are in this case and in this case there are no for there is a single equation. So, you have k primes dividing n the 2 onwards p 2 up to p k these are the k minus 1 primes they give you 2 power k minus 1 systems of simultaneous linear congruences and for 2 there is no condition except that a b congruent to 1 mod 2. So, there is only one congruence given here for 2 and then there are varying congruences for p i power ni whenever p i are odd. So, you get exactly 2 power k minus 1 solutions when you are looking at 4 divides but 8 does not divide then you have again 2 power k solutions because this behaves like the power of odd primes and when you have 8 divides then you actually have 4 congruences. So, your equations have now 2 possibilities modulo odd primes but 4 possibilities modulo 2 power. So, you have 2 power k plus 1 solutions. So, when we write it in the summary we have that whenever 2 divides it 4 does not divide that is the case number 1 and we see that in this case 2 divides n and 4 does not divide n. In this case we have exactly 2 power k minus 1 solutions here either n is odd or 4 divides n and 8 does not divide n. In this case we have exactly 2 power k solutions and this is the case where 8 divides n. So, this has been a somewhat intricate analysis of computing the square roots of 1 in z power nz. We will be looking at some simpler things now once you we begin our next lecture. So, think about this this is not very difficult it is only slightly intricate but if you read it carefully if you solve the things carefully I am sure you will get it. I hope to see you in the next lecture. Thank you.