 Welcome back, we are discussing congruence, this is an equivalence relation modulo a given in natural number n. After seeing some basic properties of congruence classes, we did some very basic examples, computing products, divisions, taking powers etc. Let me just remind you about that. So, these four are the problems that we did in one of the previous lectures 13 square modulo 5 15 into 59 modulo 75 where if you recall we replaced 59 by negative of 16 and then 15 by 3 into 5. So, that made our calculations quite easy. Then we computed 25 upon 16 modulo 79 and we observed that 16 into 5 is 80 that is 1 mod 79. So, 16 inverse modulo 79 is 5 and therefore, 25 upon 16 is simply 25 into 5 modulo 79 and so that is how we did it. Then we completed 3 power 8 modulo 13. So, we kept on taking various powers and saw what answer we received. These were some of the numerical problems, then we also turned to some theoretical problems. So, the very first was this one that 6 divides A into A plus 1 into 2A plus 1 for every natural number A. We gave two proofs for this. We first considered every residue class modulo 6. There are 6 such classes and we verified that the product A into A plus 1 into 2A plus 1 for every such residue class is 0. That would show that 6 divides the product A A plus 1 to A plus 1 for every A in N. Later we also saw that 6 divides a number if and only if 2 divides the number and 3 divides the number. And so initially the 5 non-trivial classes because if A is 0 mod 6 then of course 6 will divide the product A A plus 1 to A plus 1. That so we had to compute the values for 5 non-trivial residue classes modulo 6. This was reduced to computing it to 3 non-trivial classes, 1 non-trivial modulo 2 and 2 non-trivial modulo 3. So, just this basic observation that 6 divides a number if and only if 2 divides it and 3 divides it made our computation very easy. So, we went ahead with that and formulated a very general statement which is that if you have a prime factorization for N which is Pi power Ni product Pi power Ni then two numbers A and B are congruent modulo N if and only if A is congruent to B modulo Pi power Ni for every i. That would then if you were so the initial fifth problem was modulo 6 if it was say modulo 24 then it reduces to checking it modulo 8 and modulo 3 or if you had a problem modulo 120 it would reduce it reduce it to checking modulo 3 modulo 8 and modulo 5. So, 120 would give you 119 non-trivial classes whereas these together will give you a much smaller number. This is how fundamental theorem of arithmetic is very useful in doing several computations in number 3. Finally, we saw one application to show that this polynomial x to the 5 minus x square plus x minus 3 has no integer solution. We saw that if you go modulo N equal to 4 then there are indeed no solutions to this polynomial and therefore there cannot be any solution in the set of natural numbers or integers if you wish. So, I will do one more small problem and then we will develop some more theory or look at some more theoretical results. So, this problem is as follows. This is something that I have mentioned in when we were closing out the theme of primes and now we have techniques developed that we can use and prove this result that if you have a non-constant polynomial f of x whose coefficients are all integers and if you say that this polynomial takes only prime values whenever you input a natural number then that is not possible. So, the precise statement is that there is no non-constant polynomial fx with integer coefficients which takes only prime values on natural numbers. So, here we may just add this statement that we are talking about this on we may take x in N or z. Both the possibilities will give us a solution. So, how do we go about proving this? The proof is quite simple. I am not going to give you a minute this time to think about the proof. I will tell you the proof myself. So, suppose you have take your favorite integer take your favorite natural number say a. So, let a be a natural number and consider the function value at a. So, the statement says we want to prove that there is no such non-constant polynomial. So, to begin with we assume that there is one such polynomial fx this is our assumption. And then what we do is that we start with a natural number n consider the value f a and the assumption on f is that f of a is a prime. So, since so let f of a equal to p and we know that this is a prime. Now there is another thing that we have learned which is that when you take two natural numbers which are congruent modulo n then any integer polynomial evaluated on those numbers will give you values which are also congruent modulo n. So, if we take b to be a plus p then a is congruent to b modulo p because the difference is divisible by p. So, b is congruent to a mod p and then what we get is that f a has to be congruent to a b mod p. This is 0 mod p because this is actually p. So, since this is p this is congruent to 0 mod p and you can do this for every natural number which is congruent to a mod p. So, we get so thus p divides f of b but f of b should also be a prime because a plus p is a natural number after all. So, f of b should also be a prime and here p divides it p is a prime if f of b was not equal to p then we would get a contradiction because we would have the number fb which would have one fb as its two divisors and then here we are getting one more divisor in that case fb cannot be a prime. So, the only way f of b can be a prime is that it be equal to p. So, now if I take any further integer say b plus p, b plus 2p, b plus 3p and so on all those values will be equal to p. We repeat it by the same way. So, in the same way f of a plus np is p for every natural number n and what it tells us is that then the non-constant polynomial fx minus p has infinitely many zeros. So, we have that f of a is p, f of a plus p is p, f of a plus 2p is p and so on f of a plus np is going to be p and since the polynomial fx is non-constant by subtracting p from that we will still get a non-constant polynomial. If fx minus p becomes a constant polynomial then fx will be p plus that constant polynomial and therefore fx would be constant. So, since fx is non-constant fx minus p will remain non-constant and now we have infinitely many zeros for such a polynomial. A polynomial of degree n can have at most n roots at most n zeros in complex numbers and since we are getting infinitely many zeros here this polynomial has to be a constant polynomial equal to 0 and that tells us that fx has to be equal to p for all x which says that f has to be a constant polynomial. So, this contradiction proves the result which completes the proof. So, let me go through this proof once again. What we did was simply that we took any integer a evaluated the polynomial at a that gave us a prime number because the non-constant polynomial f should give us a prime for every integer or for every natural number whichever set you are working with. Once you get f of a equal to p then you will look at f of a plus p call that b. Now this b is congruent to a modulo p therefore the function value the value of the polynomial f at a and a plus b will be congruent to each other modulo p. This is where we are using that the function the polynomial has integer coefficients that is an important thing here. So, p will divide f of a plus p but f of a plus p f of b that should also be a prime and if a prime divides another prime then both the primes better be equal otherwise we get some contradiction. So, f of a plus p is p f of a plus 2 p will be p by the same method and so on that gives us that there are infinitely many natural numbers of the form a a plus n p such that the polynomial f evaluated at all these infinitely many values will give us the same constant p and that is a contradiction because a non-constant polynomial number 1 can have only finitely many zeros and therefore it can have only finitely many points where same value is taken there. It cannot happen that a non-constant polynomial takes infinitely many take one value at infinitely many points because you can just subtract that value and get a contradiction. So, what we have done so far after having defined the congruence and so on I have studied several possibilities for solutions modulo the congruence and we also proved that one polynomial does not have natural does not have a root in integers because we do not have roots for that modulo 4. So, the next question comes when do we get roots modulo and integer n or modulo a natural number n but before we go on we should begin we should set up the notation. So, sometimes I may use this we have been working with this arithmetic of residue classes modulo n and the residue classes modulo n will be denoted the set of all of these will be denoted by z which stands for integers subscript n. So, I will just call it z n. If you know little bit more about algebra maybe the group theory or ring theory and so on then you will immediately notice that this z n is nothing but the quotient of z modulo nz whether you are looking at it from group theoretic point of view or ring theoretic point of view it is all the same. So, now we go towards finding conditions which will guarantee that there are solutions to congruence equations. Before we go to higher degree let us first look at degree 1. So, suppose that we want to solve a congruence relation congruence equation of the type ax plus b is equal to c modulo n. So, we are working in z n and we want to solve ax plus b equal to c in that set in the set of residue classes modulo n. Now here the b can be put on the other side you can add n minus b to both sides and that will tell you that ax plus b plus n minus b this is going to be congruent to n minus b plus c modulo n. So, these b gates cancelled because you are allowed to do the addition and subtraction and the n is anyway 0 because you are going modulo n this n is also 0 modulo n. So, we get ax equal to c minus b mod n what we have done simply is that we have moved this b to the other side with a negative sign that is all that we have done. So, this says that we need to be able to solve the linear congruence ax plus b congruent to c mod n that b is really superfluous you can solve for ax equal to k modulo n. It is enough to solve for this. So, we will take various possibilities of k various possibilities of a having fixed an n and we want to know when we can have a solution when we can have solution to this linear congruence when there can be a root to the polynomial ax minus k or when there is a solution to ax equal to k modulo n this is what we want to do. Now there are two problems as we have seen earlier that first of all there need not be a unique solution this is something that we have seen earlier already in the clock arithmetic we have seen. So, there may not be a unique solution you may have multiple solutions for instance 2x congruent to 8 modulo 12. So, if you remember x equal to 4 and x equal to 10 these were the two solutions that we obtained. So, this is one type of problem that we may not get a unique solution but at least we have a solution there may be another type of problem that you may not get even a solution sometimes we may not get any solution at all. How can this happen? So, let me give you an example. So, consider for instance this 2x congruent to 9 modulo 12. So, what do we want to have here? We want to have so you can of course check one can check by looking at elements z 12 that the above congruence adds no solution. This is of course something that you can do of course you have to just multiply by 2 there are 12 possibilities there are 12 elements in z 12. So, you simply compute 2 into x for each of them and check whether you are getting 9 as the answer but there is another simpler method which is as follows x in n was a solution the congruence 12 divides 2x minus 9. So, this number has to be even because it is a multiple of 12 2x minus 9 is a solution you know if you are getting confused with x being taken to be the same elements let us take it to be x naught. So, 2x naught minus 9 is an even number because it is divisible by 12 and 2x naught is of course even which gives you a contradiction because 9 is not an even number at all. So, this is a simpler solution and this works without having to do all those 12 computations that we would have needed to do otherwise. So, what is going wrong here the thing that is going wrong is that there is a common divisor of 2 and 12 which is 2 and this divisor should divide 9 the problem is that 2 does not divide 9 9 is an odd number. So, because 2 does not divide 9 we are not getting a solution. So, when we are looking at common divisor of 2 numbers dividing yet another number what we are really looking at is the GCD. So, we can formulate a condition and prove it which will guarantee exactly when we are going to have a solution to the linear congruence. So, that comes in the next slide. So, here is the lemma the linear congruence a x congruent to b mod n has a solution if and only if d which is the GCD of a and n divides b. So, once again let me remind you that here we have two parts the part 1 is if and the part 2 is only if. So, what we would be proving is that if d which is the GCD of a comma n divides b then we get a solution for the linear congruence this is something that we will prove and we will also prove that if there is a solution then d should divide b this is the part which says only if. So, you get a solution only if d divides b otherwise you would not get a solution if d does not divide b then you would not get a solution if d divides b then you get a solution. So, these both the directions need to be proved. So, we will begin with the only if condition and try to prove this. So, we assume a x congruent to b mod n n has a solution say k in the natural numbers. So, we assume that there is a solution to the congruence a x congruent to b mod n then what we get is that n divides a k minus b or a k minus b is n into alpha for some alpha n z. So, we have that a k minus b is a multiple of n and we can rearrange these terms to get b to be minus b will be a k minus n alpha. We will put b to the n alpha side to make it plus and then n alpha comes to this side to become negative. So, b is a k minus n alpha now d which is the GCD of a and n divides the LHS hence it should also divide the RHS that completes our proof. We assume that there is a solution say k then we can write b as n k minus n alpha for some alpha coming from integers and now d being the GCD of a and n should divide the RHS not the LHS sorry the right hand side this is where d divides and then d should divide b. So, this was quite simple we now go to prove the other side that we assume that d divides b and we want to get a solution to ax congruent to b modulo n. So, d remember is the GCD of a and n and we also know that this GCD can be written as a alpha plus n beta for some alpha beta coming from integers d divides b. So, b is d into k and therefore, this is a alpha k plus n beta k because d is a alpha plus n beta we have that d into k which is b is a alpha k plus n beta k which implies that b is a times alpha k modulo n. So, we got a solution to the congruence. Of course, this may not be a natural number if you really want a natural number you can keep adding multiples of n to this and you will get so alpha k plus a suitable high enough multiple high enough multiple of n will give you a natural number and then a into alpha k plus a into that high enough multiple of n will be same as b modulo n and therefore, you will have a solution in the set of natural numbers. We will see more on this in the next lecture. So, see you until then. Thank you.