Welcome to another Mathologer video. Last
time I showed you a simple and beautiful way to derive that wonderful and
apparently circle-free pi formula over there from the area formula of the
circle. 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 to be the tenth most beautiful theorem ever.
There that's the result of the beauty pageant that appeared in the
Mathematical Intelligencer in 1990. As you can see, Fermat's theorem is in really
good company: No surprise, e to the i pi is equal to minus one at number one. Then
there's Euler's polyhedra formula, infinitely many primes, five regular
polyhedra, the pi squared over 6 formula, Brower's fixed-point theorem came sixth, the
rationality of root 2, pi is transcendental and the four-color
theorem, all great stuff. Half of these I've already covered in
previous videos and the rest are definitely on my to-do list. Anyway today
we'll tick off Fermat at number 10. The two square theorem is a very surprising
result about prime numbers that even little kids can understand. However,
although the theorem is very simple to state all the standard proofs of the
theorem devised by some of the greatest mathematicians ever are very tricky and
pretty much out of reach of non mathematicians. Until now! What I'd like
to do today is to show you a recent super simple visual proof that you won't
find in any textbook and that even most experts don't seem to be aware of. Not
that I'm an expert in number theory but certainly I had never heard of this
proof before my 2019 Christmas video just one months ago. But then the
mysterious YouTuber of TheOneThreeSeven pointed out the proof to me in the comments of
my video. And with apologies to my darling children and my darling wife
this proof was my own favorite Christmas present. Thank you again very much
TheOneThreeSeven whoever you are. Let's quickly rediscover the two-square theorem
perhaps in the way Fermat discovered it 400 years ago.
Okay, Fermat's theorem is about primes so let's start by listing the first few
primes. Fermat was interested in writing each prime as the sum of two squares of
positive integers. Why on earth would anybody be interested in doing that?
Yes, it's sort of Pythagorasy but that doesn't smell like the real reason and
indeed it isn't. It may surprise you but the problem of writing primes in this
way it turns out to be at the heart of a ton of amazing and important mathematics:
the amazing law of quadratic reciprocity, Gaussian integers, class field theory, and so
on. Over there is a whole book dedicated to the mats that originated with Fermat's
question. All right, let's get going. Can you write 2 as the sum of two
integer squares? Tough one :) Yes, of course, 1 squared plus 1 squared. But, actually,
since 2 is the only even prime it turns out to be a bit of a distraction from
the main problem. So let's kick the number 2 out of the room and forget
about it for this discussion. So for the rest of this video
when I say prime I really mean an odd prime. Back to work. What about 3? Can 3 be
written as the sum of two integer squares? Going through a few candidates
it's very easy to check that this is impossible. 5? Well 1 squared plus 2
squared, of course. 7? Not possible. 11? Not possible .13 is another easy one: 2
squared plus 3 squared. And so on. So certain primes can be written as sums
of two integer squares and others cannot. Now, how difficult is it to decide
whether a given prime can be written this way? In principle it's easy. We just
have to systematically check through the integer squares less than that prime. For
example, for 31 one squared is not possible because 30
is not a square. 2 squared is not possible because 27 is not a square.
3 squared also impossible. Nope. Of course we can stop with 5 squared, and
in fact even earlier, because the next square is greater than 31. And at this
point we can be certain that 31 cannot be written as a sum of two integer
squares. So there's a simple and systematic check for any given prime.
However, and this is Fermat's theorem, there's a much much easier way to check.
There's a super simple pattern hiding in the cans and cannot over there. Can you
spot it? Too few examples? Well, have a look at this longer list. Can you see the
pattern now? Maybe? Well, let's first have a look at the cans, 5, 13, 17, ... Hmm, what do
all of these successful numbers have in common? Apart from being primes, of course :)
Well, I've tried these numbers on quite a few people and after a while most will
notice all of these numbers are one up from 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 of these numbers appear
to be of the form 4k+1. What about the primes that cannot be written
as a sum of two integer squares. Well, as you can check,
none of the primes in our list are of the form 4k+1. What does that leave.
Yes, all the unsuccessful primes are of the form4k+3. And that's Fermat's
theorem: all 4k+1 primes can be written as the sum of two integer
squares and the remaining primes, the 4k+3 primes cannot. Pretty easy
to state and to understand what this theorem says, isn't it? And very beautiful !
Now here's a little challenge for you. Over there is a 100 digit number.
Prove that it's prime. No, only kidding :) Of course, it's hugely difficult to prove
such a huge numbers prime. But take my word for it, as I took some number
crunchers word for it, that number there is prime. And now your real challenge.
Can this prime be written as the sum of two integer squares. With Fermat's
theorem that's an easy one. Now I'd like to show you that new super simple proof
of Fermat' theorem that I'm so excited about. However, to make it really clear
how miraculously super simple this proof is, let me first tell you a little about
the super complicated proofs that came before. These are due to some of the most
brilliant mathematicians and they are what I grew up with. Fermat
announced the two square theorem in 1640. However, although Fermat claimed he'd also
found a proof, as far as we know he never published one. In fact, another
mathematician Albert Girard already stated the theorem 15 years earlier but he
also did not provide a proof. The first proof we can be sure of was, as it
happened so often, by the great Leonard Euler, 100 years after Fermat stated it and
Euler actually struggled with finding a proof for a couple of years. Here's a
summary of Euler's proof which you can find on Wikipedia. Well, not hard to see
why he struggled. Definitely, not for amateurs, right? Among other things, the
argument includes a tricky infinite descent proof by contradiction and an
ingenious application of Fermat's little theorem, a theorem which we already
covered in another video. As well as Euler's proof Wikipedia lists a number of other
proofs by other top mathematicians. These are some of the proofs that you
will usually find in textbooks. All of them at least as tricky as Euler's and
are only accessible to people with some reasonable background in mathematics. Of
these proofs definitely Zagier's one sentence proof sounds like the most
inviting. 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." All clear? Maybe not :) Three years
ago Numberphile had a go at explaining the sentence in two videos. The videos
featured the German mathematician Mathias Kreck and I don't think I could have done a better job explaining Zagier's proof to
Numberphile's audience based on my understanding of this proof back in 2016.
However the videos didn't really motivates Zagier's proof and didn't
explain the central and very tricky part of the proof that strange function there.
In the end, after watching the videos you were still left with the feeling that
Zagier's proof just dropped from the sky. I'm not saying this in order to
criticize Kreck or Numberphile. By telling you about Euler, Zagier, Kreck and all
those other great mathematicians I'm just prepping you so that you will
really, really appreciate the simplicity of the visual version of Zagier's proof
that I am about to present to you. The really easy part of the theorem is
to show that none of the red 4k+3 primes can be written as the sum of
two integer squares. In fact, this part of the theorem is not only true for primes
but for absolutely all integers of the form 4k+3. I already gave the
short proof at the end of the last video. So you can either go back and look at
that or consider it a little challenge. What I'll focus on today is the much
much trickier part, to show that any 4k+1 prime can be written as a sum
of two integer squares. Okay, to start let's suppose we have a 4k+1
prime in hand and let's imagine 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 one has to be
even. It's easy to see that two odds and two evens are both impossible. What shall
we call the odd number? Well let's go for something super original like x. Now it's
the even bit that will focus on so let's write the even integer as 2y.
2y in brackets squared that's just 4y squared. All good though it's hard to see
how it helps. It feels that we're pretty stuck. So a fairly standard approach at
this stage is to consider a related but more general problem with more easily
spotted solutions. Then, with luck and with fingers and toes all crossed, these
general solutions may provide some insight into our original problem. In our
situation a natural way to gain more space to maneuver is to change one of
the y's in our formula into a z and now there's at least one super easy
solution to our new more general equation. Can you spot it? Not yet? Well
here's a hint: Remember that p was a 4k+1 prime. See it
now? Well the 4s in the two equations
match and of course 1 equals 1 squared and k equals 1 times k. So choosing x and
y both equal to 1 and z equal to k will do the job. It's definitely not clear how
that helps with our original problem but let's keep going. Along with the basic 1
1 k solution to our new equation there are in general many other solutions as
well and for any particular prime these other solutions are also easy to find.
Let's have 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 we are really interested in, if they exist, are the ones
for which y equals z. Why? Because any y equals z solution translates back to
the solution of our original equation, into a way of writing our prime as a sum
of integer squares, like this. Right, turns back into a square. Cool ! Next
important observation. What if y and z are not equal? Well then swapping y and z in a
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 paired up by
switching y and z. There's one pairing there's another pairing, third pairing.
But the solutions we are really interested in and hoping for ,with y and
z equal, sit by themselves. Ok, now the next
important observation is the key to the whole business. When you take a couple of
4k+1 primes and actually calculate all the solutions of this new equation
it seems that there's 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 solution, again an odd number of solutions. And so on. Now what
if we could prove that for any 4k+1 prime there's always an odd number of solutions? Well, actually, then we would
have proved Fermat's theorem. Why? Well the solutions with y and z not equal
come in pairs and so in total give us an even number of solutions. But if the
total number of solutions is odd that means there's at least one more solution
around and this solution must be of this special y equals z type !!! Got it? and so
now we have Fermat's square theorem cornered. To finish the proof all that
remains to do is to convince ourselves that for any 4k+1 prime our more
general equation has an odd number of solutions. And the magic to come is a
super nifty visual way to see that odd number of solutions. Okay we are out to prove that for a 4k+1
prime our general equation has an odd number of solutions. To motivate the idea
for our proof let's focus on the highlighted solution for 37 over there. Now let's turn
this equation into geometry. So 37 is equal to 3 squared plus 4 times 7 times
1. 3 squared that's the area of a square of side length 3. And 4 times 7 times 1
that's the area of four rectangles with sides 7 and 1. A famous and prettily
symmetric arrangement of a square and four rectangles is this windmill. So this
windmill is a geometric counterpart of one solution to our equation. In particular
the total area of the windmill is 37. Also if we swap 7 and 1 the corresponding
windmill looks like this. Whoa nice, hmm? Okay let's swap back. And here all seven
windmill solutions four 37. Pretty, pretty pretty!
Now the straight cross down there corresponds to our basic 1 1 9 solution.
And these are the pairs corresponding to swapping y and z. One pair, two pairs
and there's the third one. And that last windmill corresponds to our critical y
is equal to z solution. Okay, back to the example we started with. Now here's the
magic trick. Can you see another solution hiding in this windmill? Nope?
Well, maybe step back a bit and squint your eyes. See it now? Well, ready or not
here it comes. There a second windmill solution just appeared out of thin air. Of course the new windmill
still has a total area of 37 but now the square has side lengths 5 and so x is
equal to 5. And the rectangles have side lengths 1 and 3. Looking at any of the
other windmills you'll usual also have a second windmill
jump out at you. For example, if you're facing a windmill like the one over
there, whose core is all green we get a second windmill by cutting into the
middle along the windmill blades, like this. There have a look. And in the middle and
you see the square appearing and there's the second solution. This new solution
and the original solution are related by their windmills having congruent
underlying footprints. Ok, let's have another look at all our solutions. As you
can see, arranging these windmills by congruent footprints gives another
pairing. There. The only exception is the footprint of
the straight cross windmill which occurs just once. In general it's always true
that the footprints of the twisted windmills come in congruent pairs.
Showing this requires ticking off a handful of different cases for how the
rectangle blades can wrap around the square core. Not hard, however also not
boringly trivial and without its own charm. Maybe give it a go yourself and if
you get stuck follow the link in the description to this summary. As well it's
definitely clear that footprints of straight cross windmills occur just once and there's always at least one such
straight cross windmill corresponding to the basic solution. However, conceivably
in general there could be a few such straight crosses. Right? There, apart from
this basic straight cross maybe there's also a straight cross like this or one
like that. However, it turns out that only the basic straight cross ever occurs and
here's how you can see this. For a straight cross the side length x of the
square is the same as the sidelength y of one one of the rectangles. That means in the
equation we can replace y by x, pull out 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 itself and so it's clear that the smaller factor which
is x must be equal to 1. However x is equal to y for a straight cross and so y
is also equal to 1 and so we conclude that for absolutely every 4k+1
prime there's only the one straight cross corresponding to the basic 1 1 K
solution. But, remember, all the other twisted crosses come in pairs giving an
even number of twisted crosses. And an even number plus 1 is odd. Tada,
the number of solutions is always odd!!! What a bloody amazing proof :) There was quite a bit there so just a quick recap before we continue. We use the windmill pairing
to show that there is an odd number of solutions. This implies, via the y z
swap pairing that there is one critical solution in which y is equal to z. And so
4yz is a square and therefore p is the sum of two squares. Nice, nice, nice, nice!!! And what I've gone through for you is really just a visual version of
Zagier's proof. In particular, the very clever windmill pairing corresponds to
the tricky central part of the proof that was
skipped in Numberphile videos. For those of you who fought with understanding
Zagier's proof, let me just point out that the three cases here correspond to three
different ways the windmill blades can wrap around in a square. Now I've not
been able to find out who we have to thank for discovering the beautiful
windmill interpretation of the tricky part of Zagier's proof. Maybe one of you
knows in which case definitely make it known in the comments. Anyway I've linked
to what I do know in the description of this video and I'll update this information if I find out more. We've proved that any 4k+1 prime can be written as a sum of two integers squares but there's an extra
neat and very important aspect that I haven't mentioned yet. It turns out that
the 4k+1 prime can be written as a sum of two positive integer squares in exactly one
way. For example, over there 2 squared plus 5 squared that's the only way for
29. Ok, yes, there's also 5 squared plus 2 squared but unlike in the last video we
won't distinguish between these two trivial variations of writing the same
sum. I'll show you a proof for uniqueness in the next chapter but first a fun
windmill interlude as a bit of light relief. Are you familiar with the 2007
Spanish movie Fermat's room. No? Then forget all the Marvel stuff and go watch
it. In this movie a group of mathematicians
are trapped in a shrinking room. An absolute must see. Fun fact, to enable the
four walls of Fermat's room to contract they're arranged in the shape of a
windmill. There if those are the walls of the room they contract like this. That
windmill configuration is really very versatile, isn't it. Now apart from
proving Fermat and murdering mathematicians here is another very pretty
application, a windmill consisting of a square surrounded by four copies of
another square. That's what the windmills of the critical solutions of our Fermat
equation looked like right. This diagram happens to also be very
interesting mathematically outside our proof of Fermat's theorem. First the windmill
can be extended to this non obvious tiling. Nice, hmm. Even more interesting and
related to the Pythagorean aspect of Fermat's theorem you can use the tiling to
prove Pythagoras's theorem. Want to see how that works? You do? Well of course you
do :) So what we want to prove is that in this
right angled 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. Right?
Okay, so tile as before with copies of the two smaller squares. Now you can
check that a square tiling consisting of copies of the large square aligns
neatly like this. Focus on one each of the different tiles. So the large square
is cut into a few little puzzle pieces and it's easy to see that these puzzle
pieces reassemble into the pieces for the two smaller squares and it shows
that the area of the two smaller squares is equal to the area of the larger
square. So, there you have it, a very pretty windmill based proof of Pythagoras's
theorem. Finally, for you really serious Mathologerers
who can handle a little more, let me round things off with one more proof.
Let me prove for you that a 4k+1 prime can be written as a sum of two
squares of positive integers in exactly one way. Now this is a typically crazy
number theory proof with letters flying around all over the place.
It's also another opportunity for you to appreciate how incredibly nice the Zagier
a windmill proof really is. To begin there are definitely numbers that can be
written as a sum of two squares of positive integers in more than one way.
For example, 50 over there or a 325. Now in terms of our 4k+1 primes we've
already proved that any such prime can be written as a sum of two squares in at
least one way. What remains to prove is that there can never be more than one
way. Okay? Well, let's begin. Suppose you're given two numbers that are both sums of
two integer squares. Then the product of these numbers is also a sum of two
integer squares. This follows from a famous identity was already known to the
ancient Greeks. Here it is. We obtain a second version of the
identity by swapping the plus and minus in the brackets at the bottom. And now to
the primes. Suppose we have a 4k+1 prime and let's assume 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 identity gives a
second way of doing this. We'll need these two identities later so let's just
store them away for the moment. Next solve for b squared and d squared
to make the right sides of these equations equal. We multiply the first
equation by d squared and the second equation by b squared. Ok, now since the
right sides are equal the left sides are also equal and we get
this new equation. Now collect all the p's on the left hand side and factorize.
This is just autopilot here. Okay. On the right we have a difference
of two squares. Let's also pull it apart as usual. Getting there. Remember p is a
prime and so p must either divide the red term or the blue term. Also what's
promising is that the red and blue numbers appear in the identities that we
tucked away. So let's untuck them. Ok, so p definitely
divides either the red or the blue. Let's first assume that p divides the red. Now
p dividing red means that p is equal to 0 or p or 2P or 3P or another
multiple of p. Right? But if red is not 0, if it's a nonzero multiple of p, then red
squared would be equal to p squared or larger. But that would make the right
side of the equation greater than the left side which is impossible. Therefore
we conclude that red is equal to 0. But now return to the top equation. If red
equals 0 that means that the right side of the
top equation is 0 and so d squared has to be equal to b squared. Skipping back
to the very beginning this implies that a squared is also equal to c squared.
There like this. Again auto-pilot. Cool. But that means that the two ways of
writing our prime as the sum of two integer squares that we started with
have to be the same. Ok, summarizing that argument we've seen that the first
possibility that p divides red implies that any two ways of writing p as a sum
of two integer squares must be the same and so, on to the second case, where p
divides blue. If this case gives the same conclusion our
proof is finished. We will have shown that there is no more than one way to
write our prime as the sum of two integer squares. Okay, take a deep breath. Now suppose p divides blue. Then because blue cannot be 0 it has to be equal to p.
Why? Because otherwise the left side of the equation would definitely be smaller
than the right side. Okay so the blue is equal to p. Then ac is equal to bd. Right?
There ac is equal to bd. Again, let's skip back
to the beginning to see what this extra information gives us. Now notice that a
and b cannot have a common factor (other than 1 of course) Why? Because if they did
then p would have that same factor. And that's impossible since p is prime. Let
that sink in for a bit. All good? Great! But then because 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. Huh? With c and d at least as large as b and a? How's that
going to work? Well clearly the only way is if p equals c and a equals d and so,
as before, we conclude that the two ways of writing p as a sum of integer squares
are the same. And this finishes the proof that there is exactly one way of writing
a 4k+1 prime as a sum of two integer squares. Like this? Well I really
like this, too. Phew. Anyway, lots of a's and a's and so on zinging around there. So
definitely don't stress if you didn't catch every detail of this proof in the
first go. Also if there are any parts of this video that you struggled with just
ask in the comments. As always there will be lots of very cluey people watching
this video who will be happy to help. The uniqueness argument
that I just showed you may seem much more involved then the Zagier windmill
proof but really it's much easier for the most part. We just had to follow our
nose using well-known ingredients such as that Greek identity. True, we had to
follow our nose a pretty long way but coming up with an argument like this is
really a trivial task compared to the ingeniousness of Zagier's proof and
its windmill incarnation. Finally a very easy challenge for you. We've been
working hard on sums of integer squares But what about differences? Your
challenge is to show that a nonzero 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 it for today. Except I'd like to
thank all of you who've taken out a Mathologer membership via a my new
Patreon page or supported Mathologer directly via PayPal donations. I
really appreciate it. From this video on the names of all supporters of Mathologer 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 very much again for
supporting Mathologer simply by watching and engaging. Until next time :)
Man, I love this healthy ecosystem math has on youtube of numberphile, 3b1b and mathologer, they complement each other so nicely. I wish physics had something like this.
A rather beautiful interpretation of the famous one line proof.
Absolutely loved this video!
I really like the mathologer's system of introducing advanced maths in longer, more structured videos. I don't know of any other person who introduces such advanced topics without getting the viewer lost even once.
Only tangentially related, but I was at a conference a year(ish) ago and one day of that conference just happened to be the same day that Zagier was giving a (colloquium?) talk at the same university. I actually had never heard of Zagier and the title of the talk didn't seemed like anything I was interested in, but my advisor suggested I attend it.
Zagier was incredible and that talk blew my mind. He spoke really fast and hardly took a breath in that hour, but he was able to explain certain deep math connections with incredible ease and provided multiple perspectives or instances of certain phenomena in various branches of mathematics (I think this talk was mostly differential equations and number theory). It was surreal seeing somebody who has such an inmate understanding of mathematics.
Anyway, from what I saw in that hour, it wouldn't surprise me at all if Zagier had that visual interpretation of his proof in mind at some point, but just didn't write it down (in this way, he allowed us mere mortals to rediscover the idea and feel a sense of accomplishment).
Because I hid it so well. I wanted it to be called Fermatβs Last Scavenger Hunt
Marvelous. As the video was progressing I kept thinking, where will we use the fact that p is prime? Then it came, very simply and elegantly.
I just realized something... the top 10 had results from: Euler (1st, 2nd and 5th) Euclid (3rd), Plato (4th), Brouwer (6th), Hippasus (7th), Lindeman (8th), Appel, Haken (both 9th) and Fermat (10th).
This shows just how influential Euler was, and still is, to mathematics..
An interesting corrolary is that a 4k+1 prime has only one sum of squared integers as a solution.
Very cool! The visual interpretation is surprisingly beautiful but the real genius is even before that, when we go from x2 + 4 y2 to instead solve the more general (and seemingly less interesting) x2 + 4 y z .
Gian Francesco Malfatti gave a way to pack 3 circles in a triangle in 1803. He declared that his method maximizes the area of the circles. Nobody questioned the theorem , until someone found out that it was wrong. Not only is Malfatti's method not maximal , it is never maximal for any triangle . This was discovered in 1923.