 This is a math talk for undergraduates on Fermat's last theorem where I will explain how Fermat proved his theorem for the case of exponent 4. So I just recall what Fermat's last theorem is. So Fermat's last theorem says that x the n plus y to the n equals z to the n has no solutions where x, y and z are positive integers and the exponent n is greater than 2. So if n is a product of two numbers, both greater than one, so if we have x to the a b plus y to the a b equals z to the a b, then we see that x to the a to the b plus y to the a to the b equals z to the a to the b. So if it's true for some exponent, then Fermat's last theorem is true for all multiples of that exponent. So it's enough to prove it for n equals 4 and n an odd prime, because every number greater than 3 is divisible either by 4 or by some odd prime. Well the case of an odd prime is extremely difficult and was finally solved by Andrew Wiles after work by Kummer and others. The case n equals 4 is a lot easier and was done by Fermat and I'm going to present Fermat's solution because I frankly can't figure out how to fit Andrew Wiles' solution into a short YouTube video. And we're going to do this using Fermat's method of descent. So the idea of his method of descent is Fermat shows that if you've got a solution of the equation x to the 4 plus y to the 4 equals z squared, then you can find a smaller solution in integers x, y and z. And this gives a contradiction because you can't keep finding smaller and smaller solutions. This isn't a misprint by the way. I really do mean z squared, not z to the 4. Well, so how do you prove it? Well first of all, we need to look at the equation x squared plus y squared equals z squared. So this is the famous Pythagoras equation that has lots of solutions like 3 squared plus 4 squared equals 5 squared. And let's try and find all solutions of this. So we can write x squared equals z squared minus y squared equals z minus y z plus y. And now we may as well assume x, y and z co-prime. So there's no common factor dividing them. Otherwise, we could just divide up by that common factor and we'll assume x, y and z are greater than 0 to eliminate silly cases. And now we can examine whether they're odd or even. And remember, if something is square, then it has remained a 0 or 1 mod 4. And if we use this, we see that one of x and y must be even and one must be odd because if they are both odd, then this would be 2 mod 4 and couldn't be a square. So we're going to assume that y is odd and we factorize it like this. So x is even. So then we find x over 2 squared is equal to z minus y over 2 z plus y over 2. And now z minus y over 2 and z plus y over 2 must be co-prime as you can easily see. And the product is a square. So each of them must be a square. So let's write z minus y over 2 equals a squared z plus y over 2 equals b squared. And you can see that other numbers a and b, one must be odd and one must be even. So this gives us the solution. We see z minus y is equal to a squared z is equal to 2 a squared z plus y is equal to 2 b squared. And from this you can solve for z and y and we find z is equal to a squared plus b squared and y is equal to b squared minus a squared and x is equal to 2 a b. And we can see solutions of this. For example if we put a equals 2 b equals 1 we get the solution 3 squared plus 4 squared equals 5 squared. And if we try other values like a equals 7 b equals 2 we find that 45 squared plus 28 squared equals 53 squared. So this is 7 squared minus 2 squared and this is 7 squared plus 2 squared and so on. So this gives a very easy way of finding all solutions of Pythagoras equation. So now let's look at what Fermat did. So we look at the equation x to the 4 plus y to the 4 equals z to the 4. So we're going to take this exponent to be 4 for the moment. And of course this is a special case of Pythagoras's equation because we're going to have x squared squared plus y squared squared equals z squared all squared. So now we just substitute in the solution we had for the Pythagoras equation and we may as well take one of these to be odd and the other to be even as usual. So we find let's say x squared is equal to 2ab y squared equals b squared minus a squared and z squared is b squared plus a squared but we don't actually care what z squared is. And if we look at this we see one of b and a is odd and the other is even and in fact if b is even and a was odd then y squared would be 3 mod 4 which is impossible so we see b is odd and a is even. And if we substitute this in here we see that x squared is a product of 2ab and b must be co-prime to 2a. So we must have a is equal to 2 times a square and b is equal to a square. And now we substitute these into this equation here and we find y squared is equal to d to the 4 minus 4c to the 4. And let's mark that because it's going to be quite important. So what we've done is we've started with this equation and we've found a solution of this slightly different equation. Well what's the use of that? Well let's carry on a bit further. So we can write this as 4c to the 4 plus y squared equals d to the 4 and this is again a form of Pythagoras's equation. It says 2c squared squared plus y squared equals d squared squared. So this is a form of Pythagoras's equation so is this. So we can substitute in the solution of Pythagoras's equation that we have before we find 2c squared is equal to 2ef and d squared is equal to e squared plus f squared and y is equal to say e squared minus f squared except we don't really care about that. So we've got these two equations here and now we look at this and e and f are co-prime and their product is a square. So this implies that e is a square and f is a square and now let's take this equation and this equation and substitute e and f into here and we find that d squared is equal to g to the 4 plus h to the 4 and let me put a red ring around this because it's another key equation and now let's compare this equation with this equation. Well it's not quite the same because this is saying a fourth power is the sum of two fourth powers and this is saying a square is the sum of two fourth powers but now we do something a little bit clever. We notice we never actually used the fact that z squared was a square so let's cross out this four and change it to a two and we can cross out that two and change it to a one and the same argument still works. So what have we shown? Well we've shown that if you've got a solution to this equation then we can find a solution to the same equation which sounds completely useless. All we've done is we've shown that from a solution to an equation we can get a solution to exactly the same equation and we just seem to have gone round in circles. However the solution has become smaller. You see the numbers a and b are going to be smaller than, so the numbers c and d and y are going to be smaller than the numbers z, x and y in some sense and similarly you find that the number d here is smaller than the number z there. So what Fermat showed is from any solution of this equation in positive integers we can find a solution in smaller positive integers. So if we've got one equation we can repeat this and just keep on getting an infinite sequence of smaller and smaller positive integers and this is impossible so we see that x to the four plus y to the four equals z squared has no solutions for x, y, z greater than zero. Of course it's got a trivial solution for x, y and z equal to zero and okay um Wiles' solution is very much more difficult than that so I will stop there.