 Welcome back, we saw in the last lecture that whenever there are two natural numbers A and B then we have the GCD of A and B. This is yet another natural number possibly it could be one of them but it is a natural number D which has two properties. Property number 1 says that D should divide both A and B. This is the first property. So, GCD stands for Greatest Common Deviser. So, that the property 1 which says that D should divide both A and B says that it is a common divisor and now we have to say that it is the greatest among all the common divisors. So, you could say that among all the common divisors this number is the biggest that is one way to say but since we are talking about divisibility we encode it in the second property in the following way that whenever there is a natural number E which divides both A and B then E should divide D. Two properties D divides A, D divides B. Second property E divides A, E divides B then E divides D. This is the greatest common divisor and if you saw the proof carefully we actually wrote this greatest common divisor as a linear combination of A and B itself. We wrote it as A alpha plus B beta where alpha beta could be from integers they could be positive or negative or sometimes they could even be 0. That is indeed possible. You may have A dividing B in that case A will be the GCD and then we will have that the GCD which is A is A into 1 plus B into 0. So, now once we define any such thing the question is how do you compute it? It is not so easy at all. How do you compute GCD of any two given numbers? This is the question that we must answer and we are going to use Euclid's division algorithm. I hope you remember the division algorithm. Division algorithm says that whenever you have A and B two natural numbers then you can write A as B into Q plus R where Q was the quotient and R was the remainder. Apply the division algorithm that is our first step of computing GCD AB. So, we have A equal to BQ plus R and remember R is between 0 to B but it is not equal to B. It is only up to B minus 1. So, if R is not equal to 0 then you consider now R is less than B. So, you can divide B by R. You can call B as the new A1 and R will be the new B1 and you will then have A1 equal to B1 Q1 plus R1 where R1 will be further smaller and we proceed this way. So, that step number 2 if R is bigger than 0 then apply step 1 to B, R. Ultimately, R will be 0 and we are then done. So, what we have to do is the following thing. We start with A and B. Assume that A is bigger than or equal to B and apply the division algorithm for the pair A and B to get A as BQ plus R. So, R now starts from 0, R can be 0, R can be 1, R can be 2 all the way up to R can be B minus 1. If it is not equal to 0, if R is 0 then we have got our GCD which is B because B divides A. So, if R is not 0 then we have not yet got our GCD. Therefore, we apply the division algorithm to new A1 which is B and new B1 which is R. Then we get a new Q1, new R1 where this new R1 will be again from 0 all the way up to B1 minus 1 but B1 was our R. So, it will go up to R minus 1 and since you had earlier B, R was a natural number which was strictly less than B. Now, you have a new natural number R1 which is strictly less than R and so on at each step you are coming down at least by 1 and therefore, this process will eventually end in 0. So, eventually R is going to be 0 and then we are done. So, let us apply this and try to compute a GCD. So, if you remember we had applied our division algorithm to be pair 2020 and 25. So, we want to compute the GCD of these two numbers. So, our A is 2020, B is 25. If you remember the calculation that we have done we noticed that 2020 is 25 into AT plus 20. So, here the R is 20 it is less than B but it is not 0. So, this our new A1 is 25, new B1 is 20. Again applied division algorithm to get 25 to be 20 into 1 plus 5. Once again our new R1 remember A1 was 25, B1 is 20, Q1 is 1 and R1 is 5, R1 is still not 0. So, we let A2 to be 20, B2 to be 5 but then we get 20 equal to 5 into 4 plus 0. So, we are done 5 is our GCD. So, the GCD of 2020 comma 25 is 5. You may say that you know you could tell this GCD just by looking at the numbers which is true. Many of you would be able to tell this GCD just by looking at these two numbers. In fact if some of you are not able to tell it at the first step certainly by the time you reach the second step where you have 20 and 25 I am sure that almost everybody of you would tell the GCD to be 5. But still a process is important and this process can be applied to any pair of natural numbers not just to some simple numbers like 2020, 25 or 25, 20. You can apply to any such thing but wait there is one more thing remaining. We now want to write 5 as a linear combination of these two numbers 2020 and 25. So, how do you want to write this? You can use division algorithm to go back. We have been able to write 5 as a linear combination of 25 and 20. We know that the GCD of 2020 and 25 is 5. But now we want to write 5 as 2020 into alpha plus 25 into beta where alpha beta are coming from integers. Of course they cannot be natural numbers because if you have any non-zero multiple of 2020 from natural numbers you would be at least 2020 or beyond and then you cannot write 5. Or if you put 0 for 2020 and any non-zero multiple of 25 again coming from natural numbers you will go beyond 25. So, it will not be possible to write the GCD as a linear combination of natural numbers AB again over natural numbers. We have to go outside the set of natural numbers but that is okay. So, here we want to write this and if you remember we had obtained 5 as 25 minus 20 and how did we get 20? It was a difference of 2020 and a multiple of 25. So, we just applied that we write 5 as 25 minus 20. How did we get 20? We got it as 2020 into 25 into 80. That is it. So, we ultimately get this as 2020 into minus 1 plus 25 into 79 because here you have 80 comes with 2 negative signs. So, that gives you 80 and then of course you have to add 1. You are not going to subtract 1. So, it will be 81 as you will see this easily that the difference of 25 into 81 which is going to be 20 25 to 0 to 5 and when you subtract 2020 once from that note that here we have minus 1 multiplied to 2020. So, that will indeed give you 5. So, we have computed the GCD of 2020 and 25 and then we also wrote it as a linear combination of these 2 numbers over integers. Let us do one more problem to have a better practice. What is the GCD of 107 and 17? So, we are going to apply division algorithm once again. We write 107. If you remember your multiplication tables 17 into 6 is 102 and the remainder is 5. Now, we have to work with 17 and 5. So, we write 17 as 5 into 3 plus 2. Next, we work with 5 and 2. We have still not got our remainder to be 0. So, we need to continue but now this is very easy. So, the GCD of 107 and 17 is 1 and you can just go back this way and write 1 as a linear combination of 107 and 17, but you should know that there are more than one ways to do that. I am going to tell you one way to write 1 as a linear combination of 107 and 17, not by tracing the steps back but by just observing what the products are. 107, 17, the GCD is 1 and we want to write this 1 as 107 into alpha plus 17 into beta where we want alpha, beta to be integers. When we multiplied 17 by 6 and subtracted from 107, we were left with 5. 17 into 6 is 102. 107 minus 102 gives you 5. So, if I multiply all the equation, the whole equation, 107 equal to 17 into 6 plus 5 by 10, then we would get 107 into 10. So, we will get 1070 equal to 17 into 60 which is 1020 plus 50 and you of course know that 17 into 3 is 51. So, the 50 that here we have obtained will help us in that. So, 17 into 3 which is 51 minus 50 which is 17 into 3 minus 50 is 1070 minus 17 into 60 to give us ultimately 17 into 63 plus 1070 into minus 1. So, we have obtained 1 as a linear combination of 17 and 107 I should indeed make that correction here to write this as 107 into minus 10 that will do. So, this is one way by which we can write the GCD. What we have done here in a nutshell is using the theory of congruences. So, we observed something which is that when you divide 107 by 17, you take all multiples of 17 away from it as long as you are left with a number which is less than 17, then you were left with 5. So, if we did this for 107 into 10, what you will be left with is going to be 5 into 10, 50 and then you can of course remove some more multiples of 17, but that is okay. We have observed that if you remove multiples of 17 from 107, you are left with 5. So, there is a way to remove multiples of 17 from 107 into 10 which is 1070 and we left with 50. And now 50 is very close to a multiple of 17. In fact, the difference is just one. This is another way to write GCD as a linear combination of the 2 numbers A and B with integer coefficients. So, what did we do? We have since we began this lecture course, we defined the prime number. Using primes, we want to now write every integer as a product of primes. And this is indeed true which we call the fundamental theorem of arithmetic. There is just one more step to go before we go to this theorem. This is called a lemma. So, you will see that mathematical statements have many names. You will have a theorem, you will have a proposition, you will have a lemma, you will have a corollary. Typically, lemma is something which is used in proving a big theorem. So, a theorem should really be a statement which is a grand statement, which is an important statement. And lemma should be the one which is actually a step of use proving the theorem. Just that taking this step out would make the theorem more accessible. So, this is the statement that if you have a prime p which divides product of 2 natural numbers, you take any 2 natural numbers m and n. And assume that p divides the product mn, then p should divide m or p should divide n. The prime p will have to divide one of them. It cannot happen that p is a prime, it divides mn and yet it does not divide any of the m and n. So, let us see a proof of this. Proof is actually quite simple. Suppose p does not divide m. We started with a prime p dividing the product mn and now we assume that p does not divide m. If this statement of the lemma has to be true, then p should now divide n, correct? Because our statement says that when you have p dividing mn and p does not divide m, it should divide n. It should divide one of the 2 m or n. We have assumed that p does not divide m, then we should prove that p divides n. So, how do we go about that? We use the notion of GCD. The GCD of p and m should be 1 since p is a prime. It has exactly factors in n, 1 and p. Now if we want to compute the GCD of p and m, it should first of all be a divisor of both p and m. The factors of p are 1 and p. So, the GCD has to be among these 2. Can it be p? GCD cannot be p because p does not divide m. GCD has to divide both p and m. So, GCD, this is the same call which we mathematicians use to say that the earlier statement implies the next statement. It says that the GCD of p and m is 1, but if 1 is the GCD of p and m, we should be able to write 1 as a linear combination of p and m. So, then 1 is p alpha plus m beta for some alpha beta in z. Now, what do we do? We will multiply both sides of this equation by n, n equal to p n alpha plus m n beta. We multiplied both sides of the equation 1 equal to p alpha plus m beta by n and we obtained n equal to p n alpha plus m n beta. Now, p divides the right hand side because p divides p n alpha and p divides m n beta, p divides m n. So, it should divide m n beta and therefore, p divides n since p divides the RHS which stands for the right hand side of the equation p also divides the LHS. Hence, p divides n. Mind you that we have not used the fundamental theorem of arithmetic here. What we have done is the following. We had n equal to p n alpha plus m n beta which can be written as p into some natural number and therefore, we conclude that n has to be a multiple of p. So, we have now proved that p divides m n and p does not divide m then p should divide n. There is one more small thing which we have used here. Note that we have used the following. If a comma b are natural numbers and a equal to bc for some c in integers then b divides e. Our definition of division was that this c has to be among the natural numbers. But if you see the previous proof carefully, we had alpha and beta which were coming from integers. There was no guarantee that those alpha, beta are positive. In fact, if you have the GCD to be 1 and you have these numbers which are m, n and p which are bigger than 1 then one of the alpha, beta has to be negative. Otherwise, you do not get 1 as a linear combination of p and m. Even then, we would then have n as a product of prime into a natural number. So, how do we do it? We use this statement. If you have a, b both are natural numbers but a is b into c for some integer c then b divides a. So, this c has to be a natural number and that is very easy to see because we have a trichotomy. Remember, whenever we have any two natural numbers, we have the trichotomy that a is b or a is less than b or a is bigger than b. And this trichotomy holds actually for the whole set of integers. So, we use this trichotomy for the pair 0 and c. So, now c can be 0. If c is 0 then you have that a itself is 0 which is a contradiction because 0 is not an element in n. So, c cannot be 0. Can c be negative? Can c be less than 0? You have b which is positive being a natural number and if you multiply it to that by a negative number the product has to be negative which will mean that a cannot be natural. In fact, a is a negative of a natural number. So, we conclude that the third case, third possibility of the trichotomy must hold which is that c has to be bigger than 0 and therefore c has to be a natural number. Thus, we have that b divides a. All right. So, we will stop for the moment here and in the next lecture we will really begin with the proof of the fundamental theorem of arithmetic. See you then.