 Welcome and we will continue with our study of natural numbers. And in this session, we will look at how to prove properties of numbers. So, we have seen how to define numbers, we have seen how to define operations on numbers. Now, we will look at how to prove properties of these operations and properties of numbers. So, why it is this useful? So, the formal definitions allow you to prove mathematically prove properties of the operations and values that you have defined. And these properties can be exploited to write better programs. So, if you know certain properties are satisfied by the values, you can think of better representations or better ways of manipulating those values. In the case of numbers, for example, number theory involves just proving properties of natural numbers. And it is an independent subject of its own interest, irrespective of how whether numbers are used in computers or not. So, we will see how examples of properties are proved. And let us look at a simple property of the addition operation, which we know it is familiar with that is commutative. That means m plus n is equal to n plus m, the order in which you add does not matter. Or in terms of our defined operations, this means that if I add mn and add nm, the result should be equal. So, the equal operator applied to add mn, add nm should give me true for all numbers m and n. So, for simplicity, we will denote equality by the double equal sign as in c plus plus and we will just call it equal. So, what we want to prove that add mn is equal to add nm for all numbers n and n. So, this is not obvious from the definition because if you see the definition, it is not symmetric in m and n. So, we have defined add 0 of n is equal to n and add of next m comma n as next of add of m comma n. So, this is not if I replace m by n, this does not give me the same definition. It gives a different thing. So, just by looking at this, it is not obvious that add of m of n is equal to add of n of n. But let us try to prove it. So, we will first show that add of m comma 0 is equal to m for all n. Note that our assumption is definition is add of 0 comma n is equal to n for all n. We have not defined that add of m comma 0 is m for all n, but we can actually formally prove it. How is that add of 0 comma 0 is 0 because of the first definition which says that add of 0 n is n for all n. So, add of 0 0 is equal to 0 and add of next m comma 0 is now by the second definition next of add of m comma 0 and by assuming the property holds for add of m comma 0 that is add of m comma 0 is equal to m. Then we get this is equal to next of n. Add of next m comma 0 becomes equal to next of n assuming the property is true for m. Therefore, add 0 n becomes equal to n which is equal to add of n comma 0 for all n. So, we know that this property holds when m is equal to 0. Now, we will assume that m is an arbitrary number and assuming it holds for m so that it holds for next of n, but before that we need to prove an intermediate property. This says that add of next of m comma n equals add of m of next comma n for all n m. Remember, next is just a notation for m plus 1. So, this property just says that adding m plus 1 to n gives the same number as adding n plus 1 to n. This is not part of our definition. This is something that can be proved formally. And how again let us show this for m equal to 0 that m equal to 0 what we want to show is that add of next 0 n equals add of m next 0. So, add of next 0 m is next of add 0 n by definition which is equal to add of next of n add of 0 anything is n. So, this is next of n and this is equal to add 0 comma next n again by definition. So, we have shown that add of next 0 comma n is add of 0 comma next n. And now assuming it is true for m we will show it for next of n that is add of next of next of m comma n which by definition is next of add of next m comma n by assumption that the property holds for m this is equal to next of add of m comma next of n. And again going by definition this is same as add of next of m comma next of n. And therefore, this property holds for next of m also assuming it holds for n. So, what we have shown is that add next m n equals add m comma next n. Now we can finally complete the proof. So, we want to prove that add of next m comma n is add of next n comma next n. We have shown that this holds for m is equal to 0. Now we want to assume that it holds for m and show that it is true for next n. So, add of next m comma n equals add of n comma next n assuming add m n is add m n. So, again simplify in the same way add next m comma n is next of add of m comma n this is the definition of the add operation. This is equal to next of add of n comma n. So, we assume that the property holds for m. So, add of m comma n is equal to add of n comma n. And this again by definition of addition is equal to add of next of n comma n. Next of add of n comma n is add of next of n comma n. And now using the property that we proved in the previous slide this simplifies to add of n comma next of m. So, finally, we get that add of next m comma n becomes equal to add of next n comma next of m. So, we can change the order of the variables and get the same result. So, note that to prove this property we needed to prove several intermediate statement. And this is true in general if you want to prove some complicated property of numbers you need to start by proving simpler and smaller properties. And similarly, build up just like you build functions you need to prove properties or they are called theorems you prove more theorems using theorems or properties that you know already holds. So, here is an example here is another property of the associate of the addition operation which is called associativity. So, this says that add of x comma add of y comma z or informally it says x plus y plus z is equal to x plus y plus z. So, the first expression on the left hand side says you add y to z and then add x to it. The second one says add x to y first and then add z to it, but the result should be the same no matter how you want. Now, this is again a property that can be proved formally in exactly the same way just going by the definition of the addition operation. We try to keep our definition as simple as possible, but then try to prove more and more properties. So, that these properties can be exploited whenever we write. So, we will look at some more properties of numbers in the next session. So, thank you for the moment.