YTread Logo
YTread Logo

Why was this visual proof missed for 400 years? (Fermat's two square theorem)

May 30, 2021
Welcome to another Mathologer video. Last time I showed you a beautiful and simple way to derive that wonderful, seemingly circle-free pi formula from the circle area formula. One of the main stepping stones in

this

derivation was Fermat's incredible Christmas

theorem

, also known as Fermat's two

square

theorem

. A couple of

years

ago, in an incredibly scientific poll, mathematicians voted Fermat's theorem the tenth most beautiful theorem of all time. This is the result of the beauty contest that appeared in Mathematical Intelligencer in 1990. As you can see, Fermat's theorem is in very good company: Not surprisingly, e to the power of i pi equals negative one at the number one.
why was this visual proof missed for 400 years fermat s two square theorem
Then there is Euler's formula for polyhedra, infinitely many prime numbers, five regular polyhedra, the formula for pi

square

d over 6, Brower's fixed point theorem came in sixth, the rationality of the root of 2, pi is transcendental. and the four color theorem, all great. Half of these I've already covered in previous videos and the rest are definitely on my to-do list. Anyway, today we will mark Fermat at number 10. The two square theorem is a very surprising result about prime numbers that even small children can understand. However, although the theorem is very simple to state, all the standard

proof

s of the theorem devised by some of the greatest mathematicians of all time are very complicated and are practically out of the reach of non-mathematicians.
why was this visual proof missed for 400 years fermat s two square theorem

More Interesting Facts About,

why was this visual proof missed for 400 years fermat s two square theorem...

Until now! What I'd like to do today is show you a recent, super simple

visual

test that you won't find in any textbook and that even most experts don't seem to know about. Not that I'm an expert in number theory, but I had certainly never heard of

this

test before my 2019 Christmas video just a month ago. But then the mysterious YouTuber TheOneThreeSeven pointed out the

proof

to me in the comments of my video. And with apologies to my dear children and my dear wife, this test was my favorite Christmas gift. Thank you very much again TheOneThreeSeven, whoever you are.
why was this visual proof missed for 400 years fermat s two square theorem
Let's quickly rediscover the two square theorem, perhaps just as Fermat discovered it 400

years

ago. Well, Fermat's theorem is about prime numbers, so let's start by listing the first prime numbers. Fermat was interested in writing each prime as the sum of two squares of positive integers. Why would anyone be interested in doing that? Yes, it is a kind of Pythagorasia, but that does not seem to be the real reason and in fact it is not. It may surprise you, but the problem of writing prime numbers this way turns out to be at the heart of a lot of amazing and important mathematics: the amazing law of quadratic reciprocity, Gaussian integers, class field theory, etc.
why was this visual proof missed for 400 years fermat s two square theorem
There is a whole book there dedicated to the mats that arose from Fermat's question. Alright, let's go. Can you write 2 as the sum of two whole squares? Tough :) Yes, of course, 1 squared plus 1 squared. But in reality, since 2 is the only even prime, it turns out to be a distraction from the main problem. So let's get number 2 out of the room and forget it for this discussion. So for the rest of this video, when I say cousin, I actually mean odd cousin. Back to work. What about 3? Can you write 3 as the sum of two whole squares? Examining some candidates it is very easy to see that this is impossible. 5?
Well, 1 squared plus 2 squared, of course. 7? Impossible. eleven? It's not possible. 13 is another easy one: 2 squared plus 3 squared. Etc. Therefore, certain prime numbers can be written as sums of two integer squares and others cannot. Now, how difficult is it to decide whether a given prime number can be written this way? In principle it is easy. We just have to systematically check the integer squares smaller than that prime. For example, for 31 a square is not possible because 30 is not a square. 2 squared is not possible because 27 is not a square. 3 squared is also impossible. No. Of course, we can stop at 5 squared, and in fact even before, because the next square is greater than 31.
And at this point we can be sure that 31 cannot be written as a sum of two whole squares. Therefore, there is a simple and systematic verification of any given prime number. However, and this is Fermat's theorem, there is a much simpler way to check it. There is a super simple pattern hidden on the cans and you can't see it there. Can you tell it apart? Too few examples? Well, check out this longer list. Can you see the pattern now? Maybe? Well, first let's take a look at the cans, 5, 13, 17,... Hmm, what do all these successful numbers have in common?
Aside from being cousins, of course :) Well, I've tested these numbers on quite a few people and after a while most of them will notice that all of these numbers are one more than a multiple of 4. Right? 5 is 4 plus 1, 13 is 12 plus 1, 17 is 16 plus 1, and so on. So all these numbers seem to have the form 4k+1. What about prime numbers that cannot be written as the sum of two integer squares? Well, as you can see, none of the prime numbers on our list have the form 4k+1. What does that leave? Yes, all failed primes have the form 4k+3.
And that is Fermat's theorem: all 4k+1 primes can be written as the sum of two integer squares and the remaining primes, 4k+3 primes cannot. It's pretty easy to state and understand what this theorem says, right? And very pretty ! Now here's a little challenge for you. There is a 100 digit number there. Prove that you are a cousin. No, just kidding :) Of course, it is enormously difficult to prove that such a large number is prime. But believe me, as I took some number crunchers at their word, that number is prime. And now your real challenge. Can this prime be written as the sum of two integer squares?
With Fermat's theorem that is easy. Now I would like to show you that new super simple proof of Fermat's theorem that I am so excited about. However, to make it really clear how miraculously super simple this test is, let me first tell you a little about the super complicated tests that came before. These are due to some of the most brilliant mathematicians and are what I grew up with. Fermat announced the two square theorem in 1640. However, although Fermat claimed that he had also found a proof, as far as we know, he never published one. In fact, another mathematician, Albert Girard, had already stated the theorem 15 years earlier, but he also proved nothing.
The first proof we can be sure of was, as was so often the case, by the great Leonard Euler, 100 years after Fermat declared it and Euler really struggled to find proof for a couple of years. Here is a summary of Euler's proof which you can find on Wikipedia. Well, it's not hard to see why he had problems. Definitely not for amateurs, right? Among other things, the argument includes a complicated proof of infinite descent by contradiction and an ingenious application of Fermat's little theorem, a theorem we already covered in another video. In addition to Euler's proof, Wikipedia lists other tests performed by other important mathematicians.
These are some of the tests that you will usually find in textbooks. All of them are at least as complicated as Euler's and are only accessible to people with a reasonable background in mathematics. Of these tests, Zagier's one-sentence test definitely sounds the most attractive. That is until you read Zagier's sentence: "The involution on the complicated finite set S, defined by something even more complicated, has exactly one fixed point. So the number of elements of S is odd and the involution defined by swapping y and z has a fixed point." Everything clear? Maybe not :) Three years ago, Numberphile attempted to explain the phrase in two videos.
The videos featured the German mathematician Mathias Kreck and I don't think he could have done a better job explaining the Zagier proof to the Numberphile audience based on my understanding of this proof in 2016. However, the videos didn't really motivate the Zagier proof and no I don't explain the central and very complicated part of the proof of that strange function there. In the end, after watching the videos, you still had the feeling that Zagier's test had just fallen from the sky. I don't say this to criticize Kreck or Numberphile. By telling you about Euler, Zagier, Kreck, and all those other great mathematicians, I am simply preparing you to really appreciate the simplicity of the

visual

version of the Zagier proof that I am about to present to you.
The really easy part of the theorem is to show that none of the red primes 4k+3 can be written as the sum of two integer squares. In fact, this part of the theorem is true not only for prime numbers but also for absolutely all integers of the form 4k+3. I already gave the brief test at the end of the last video. Then you can go back and look at that or consider it a little challenge. What I'll focus on today is the much more complicated part: showing that any 4k+1 prime can be written as a sum of two integer squares.
Well, to begin with, let's assume that we have a 4k+1 prime in our hand and imagine that it can be written as the sum of two integer squares. What do we know about those squares? Well, since p is an odd number, one of the squares has to be odd and the other has to be even. It is easy to see that two even and two odd are impossible. What will we call the odd number? Well let's go for something super original like x. Now we'll focus on the even bit, so let's write the even integer as 2y. 2y squared in parentheses is just 4y squared.
All good, although it's hard to see how it helps. It seems like we're pretty stuck. Therefore, a fairly standard approach at this stage is to consider a related but more general problem with easier to spot solutions. Then, with luck and fingers and toes crossed, these general solutions can give us some insight into our original problem. In our situation, a natural way to gain more room to maneuver is to change one of the y's in our formula to a z, and now there is at least one super easy solution to our new, more general equation. Can you tell it apart?
Not yet? Well, here's a hint: remember that p was a 4k+1 prime. Watch it now? Well, the 4 in the two equations match and, of course, 1 equals 1 squared and k equals 1 multiplied by k. So choosing x and y equal to 1 and z equal to k will be enough. It's definitely not clear how that helps with our original problem, but let's move on. In addition to the basic 1 1 k solution to our new equation, in general there are also many other solutions, and for any particular prime, these other solutions are also easy to find. Let's take a look at an example: 37 which is a 4k+1 prime.
So the basic solution for 37 is 1 1 9 and here are all the other solutions. In the end the solutions that really interest us, if they exist, are those for which y is equal to z. Because? Because any solution of y equals z translates back into the solution of our original equation, into a way of writing our prime number as a sum of integer squares, like this. On the right, it becomes a square again. Cool ! Next important observation. What happens if y and z are not equal? Well, then swapping y and z into one solution gives another solution, for free!
Like here, swap 1 and 3 and we get this second solution. Easy, right? So solutions with different y and z are matched by changing y and z. There is a pair, there is another pair, a third pair. But the solutions that we are really interested in and hope for, with y and z equal, are left alone. Well, now the next important observation is the key to the whole matter. When you take a pair of 4k+1 primes and calculate all the solutions to this new equation, it seems that there is always, always an odd number of solutions. For our example 37, for example :) there are one, two, three, four, five, six, seven solutions and seven is an odd number.
The next 4k+1 prime is 41 and you can easily check that 41 has 11 solutions, again an odd number of solutions. Etc. Now, what if we could show that for any 4k+1 prime there are always an odd number of solutions? Well, actually, then we would have proven Fermat's theorem. Because? Well, the solutions where y and z are not equal come in pairs, so in total they give us an even number of solutions. But if the total number of solutions is odd, that means that there is at least one more solution and this solution must be of this special type and is equal to z.
I understand? and now we have Fermat's square theorem cornered. To finish the proof all that remains to be done is to convince ourselves that for any prime 4k+1 our most general equation has an odd number of solutions. And the magic to come is a super clever visual way to see that odd number of solutions. Well, let's show that for a 4k+1 prime our general equation has an odd number of solutions. To motivate our proof idea, let's focus on the highlighted solution for 37 there. Now let's convert this equation into geometry. So 37 is equal to 3 squared plus 4 times 7 times 1.3 squared is the area of ​​a square of side 3.
And 4 times 7 times 1 is the area of ​​four rectangles with sides 7 and 1. A famous and beautifully symmetrical arrangement of a square and four rectangles is this windmill. So this windmill is a geometric counterpart to a solution of our equation. In particular, the total area of ​​the windmill is 37. Furthermore, if we exchange 7 for 1, the corresponding windmill looks like this. How cute, huh? Okay, let's switch back. And here are the seven windmill solutions four 37. Pretty, pretty, pretty! Now the straight cross down there corresponds to our basic solution 1 1 9. And these are the pairs corresponding to the exchange of y and z.
One pair, two pairs and there's the third. And that last windmill corresponds to our critical solution and is equal to z. Well, let's go back to the example we started with. Now here's the magic trick. Can you see another solution hidden in this windmill? No? Well, maybe step back a little and squint. Watch it now? Well, ready or not, here it comes. There a second windmill solution appeared out of nowhere. Of course, the new mill still has a total area of ​​37, but now the square has sides of length 5, so x is equal to 5. And the rectangles have sides of length 1 and 3.
When looking at any of the others windmills, usually a second windmill will also appear. For example, if you are in front of a windmill like the one there, whose core is completely green, we get a second windmill by cutting in half along the windmill blades, like this. Check it out. And in the middle you see the square appear and there is the second solution. This new solution and the original solution are related because their windmills have congruent underlying footprints. Well, let's take another look at all of our solutions. As you can see, arranging these windmills according to congruent footprints gives another combination.
There. The only exception is the straight cross windmill footprint, which appears only once. In general, it is always true that twisted windmill prints come in congruent pairs. Demonstrating this requires marking a handful of different cases of how the rectangular sheets can be wrapped around the square core. It's not difficult, but it's not boring or charmless either. Maybe try it yourself and if you get stuck, follow the link in the description of this summary. Furthermore, it is clearly clear that traces of straight cross windmills appear only once and there is always at least one straight cross windmill corresponding to the basic solution.
However, it is possible that in general some straight crossings of this type exist. Good? There, apart from this basic straight junction, maybe there is also a straight junction like this or that. However, it turns out that only the basic straight crossing occurs and that's how you can see it. For a straight cross, the length of the x side of the square is the same as the length of the y side of one of the rectangles. That means that in the equation we can replace y with x, get the x. So, in the case of a straight cross, the number p is a product of two integers, but since p is prime, it only has two factors: 1 and p, so it is clear that the smallest factor which is x must be equal to 1.
However, x is equal to y for a straight cross, so y is also equal to 1, so we conclude that for absolutely every prime 4k+1 there is only one straight cross corresponding to the basic solution 1 1 K But remember, all other twisted crosses come in pairs, which gives an even number of twisted crosses. And an even number plus 1 is odd. Tada, the number of solutions is always odd!!! What an amazing test :) There was quite a bit there, so just a quick recap before we continue. We use windmill matching to show that there are an odd number of solutions.
This implies, through the exchange pair y z, that there exists a critical solution in which y equals z. So 4yz is a square and therefore p is the sum of two squares. Beautiful, beautiful, beautiful, beautiful!!! And what I've seen for you is really just a visual version of the Zagier test. In particular, the very clever pairing of windmills corresponds to the complicated middle part of the demo that was omitted in the Numberphile videos. For those of you who struggled to understand Zagier's proof, let me point out that the three cases here correspond to three different ways that the blades of a windmill can rotate in a square.
Now I haven't been able to figure out who we have to thank for discovering the beautiful windmill interpretation of the difficult part of the Zagier test. Maybe some of you know, in which case definitely let us know in the comments. Anyway, I've linked what I do know in the description of this video and will update this information if I find out more. We have shown that any prime number 4k+1 can be written as the sum of two squared integers, but there is a very interesting and very important aspect that I have not mentioned yet. It turns out that the prime 4k+1 can be written as a sum of two positive integer squares in exactly one way.
For example, there 2 squared plus 5 squared is the only way to get 29. Ok, yes, there is also 5 squared plus 2 squared, but unlike the last video, we won't distinguish between these two trivial variations of writing the same sum. I'll show you proof of the singularity in the next chapter, but first a fun interlude with a windmill as a slight relief. Do you know the 2007 Spanish film Fermat's Room? No? Then forget about all things Marvel and go see it. In this film, a group of mathematicians are trapped in an increasingly smaller room. A must visit. As a curious fact, to allow the four walls of Fermat's room to contract, they are arranged in the shape of a windmill.
There, those are the walls of the room, they contract like this. That windmill setup is really very versatile, isn't it? Now, apart from proving Fermat and murdering mathematicians, here is another very nice application: a windmill consisting of a square surrounded by four copies of another square. This is what the windmills of the critical solutions of our Fermat equation looked like. It turns out that this diagram is also very interesting mathematically outside of our proof of Fermat's theorem. First of all, the windmill can be extended to this non-obvious tile. Well, mmm. Even more interesting and related to the Pythagorean aspect of Fermat's theorem, you can use mosaic to prove the Pythagorean theorem.
Do you want to see how it works? You do? Well, of course you do :) So what we want to prove is that in this right triangle the area of ​​the two smaller squares is equal to the area of ​​the larger square: a squared plus b squared equals c squared. Good? Okay, let's tile as before with copies of the two smaller squares. Now you can check that a square tile consisting of copies of the large square lines up perfectly in this way. Focus on one of each of the different tiles. So the large square is cut into a few small puzzle pieces and it is easy to see that these puzzle pieces are reassembled into the pieces of the two smaller squares and it shows that the area of ​​the two smaller squares is equal to the area of ​​the largest square. .
There you have it, a very nice demonstration of the Pythagorean theorem based on a windmill. Finally, for those really serious matologists who can handle a little more, let me finish with one more test. Let me show you that a 4k+1 prime can be written as the sum of two squares of positive integers in exactly one way. Now this is a typically crazy number theory test with letters flying everywhere. It's also another chance for you to appreciate how incredibly pretty the windmill-proof Zagier is. To start with there are definitely numbers that can be written as the sum of two squares of positive integers in more than one way.
For example, 50 there or 325. Now, in terms of our 4k+1 primes, we have already shown that any prime can be written as a sum of two squares in at least one way. What remains to be demonstrated is that there can never be more than one path. Well? Well let's get started. Suppose you are given two numbers that are sums of two integer squares. So the product of these numbers is also the sum of two whole squares. This is due to a famous identity that the ancient Greeks already knew. Here it is. We obtain a second version of the identity by swapping the plus and minus in parentheses at the bottom.
And now to the prime numbers. Suppose we have a 4k+1 prime and suppose that a squared plus b squared and c squared plus d squared are two different ways of writing p. Then, using our Greek identity we can see that p squared is also the sum of two integer squares and the second version of the identity offers a second way of doing this. We'll need these two identities later, so let's save them for now. Then solve for b squared and d squared to equal the right sides of these equations. We multiply the first equation by d squared and the second equation by b squared.
Okay, now that the right sides are equal, the left sides are also equal and we get this new equation. Now put all the p's on the left side together and factor. This is just autopilot. Well. On the right we have a difference of two squares. Also separate it as usual. Get there. Remember that p is prime and therefore p must divide either the red term or the blue term. Also, the promising thing is that the red and blue numbers appear in the identities we keep. So let's undo them. Ok, so p definitely divides red or blue.
First suppose that p divides red. Now p dividing red means that p is equal to 0 or p or 2P or 3P or another multiple of p. Good? But if red is not 0, if it is a nonzero multiple of p, then red squared would be equal to p squared or greater. But that would make the right side of the equation larger than the left side, which is impossible. Therefore we conclude that red is equal to 0. But now let's go back to the upper equation. If red equals 0, that means the right side of the equation above is 0, so d squared has to equal b squared.
Going back to the beginning, this implies that a squared is also equal to c squared. There are so. Back on autopilot. Cool. But that means that the two ways of writing our prime number as the sum of two whole squares that we started with have to be the same. Well, summarizing that argument, we have seen that the first possibility of p dividing red implies that any two ways of writing p as the sum of two integer squares must be equal, and so on to the second case, where p divides blue. If this case reaches the same conclusion our test will be finished.
We will have shown that there is only one way to write our prime number as the sum of two integer squares. Okay, take a deep breath. Now suppose that p divides blue. So since blue can't be 0, it has to be equal to p. Because? Because otherwise the left side of the equation would definitely be smaller than the right side. Okay, so blue is equal to p. So ac is equal to bd. Good? There ac is equal to bd. Again, let's go back to the beginning to see what this additional information gives us. Now notice that a and b cannot have a common factor (other than 1, of course).
Because? Because if they did then p would have the same factor. And that is impossible since p is prime. Let that sink in for a moment. Everything's fine? Excellent! But then, since ac is equal to bd, the number a has to divide d and b has to divide c. Now p is also c squared plus d squared. Hey? With c and d at least as large as b and a? How is that going to work? Well, clearly the only way is if p equals c and a equals d and then, as before, we conclude that the two ways of writing p as a sum of integer squares are the same.
And this completes the proof that there is exactly one way to write a 4k+1 prime as the sum of two integer squares. Like this? Well, I really like this too. Phew. Anyway, there are a lot of a's and a's and so on hanging around there. So definitely don't stress if you didn't get all the details of this test on the first try. Also, if there is any part of this video that you had trouble with, just ask in the comments. As always, there will be many very knowledgeable people watching this video who will be happy to help.
The uniqueness argument I just showed you may seem much more complicated than Zagier's windmill test, but it's actually much easier for the most part. We just had to follow our nose using ingredients as well known as that Greek identity. It's true that we had to follow our nose for quite a while, but coming up with an argument like this is really a trivial task compared to the ingenuity of the Zagier test and its windmill incarnation. Finally a very easy challenge for you. We have been working hard on sums of whole squares. But what about thedifferences? His challenge is to prove that a non-zero integer can be written as the difference of two integer squares exactly if the integer is odd.
And the second part of the challenge is to show that this way of writing an odd integer is essentially unique if the integer is prime. And that's all for today. Except I'd like to thank everyone who became a Mathologer member through my new Patreon page or supported Mathologer directly through PayPal donations. I really appreciate it. Starting with this video, the names of all followers of Mathologer's videos will appear in the credits. I guess that means you'll be remembered forever or at least as long as YouTube exists. And thank you all so much again for supporting Mathologer by simply watching and interacting.
Until next time :)

If you have any copyright issue, please Contact