This essay was originally published on my (now-defunct) Substack newsletter on 12/10/23.
“Do you know,” he confided, “not even the best mathematicians on other planets – all far ahead of yours – have solved it? Why, there’s a chap on Saturn – he looks something like a mushroom on stilts – who solves partial differential equations mentally; and even he’s given up.”
– Arthur Porges, The Devil and Simon Flagg
The Eleventh Hour triumphantly establishes Matt Smith as the Eleventh Doctor. After the departure of the ever-popular David Tennant, Smith had big shoes to fill. His opening story gives him a lot to do. He needs to grown-up but also childish; comedic but also dramatic; simultaneously the smartest man in the room and the biggest idiot. You can see Matt Smith stretching pretty much every acting muscle in his 29-year-old body. His take on the role saw him catapulted into being a household name. His first series finale, The Pandorica Opens/The Big Bang, won the Hugo Award for Best Dramatic Presentation (Short Form). He became the first, and to date only, actor to receive a Best Actor BAFTA nomination for his performance as the Doctor. In short, Matt Smith’s debut in The Eleventh Hour was a huge success.
I love The Eleventh Hour. It’s one of my favourite episodes of that entire decade of the show. It’s probably my favourite debut episode of any Doctor to date. But when I rewatched this episode after several years, during my halcyon university days, there was this one small detail that has irked me ever since. A teeny, tiny, little thing.
Leading up to the episode’s climactic showdown with Prisoner Zero, the Doctor barges into the bedroom of Jeff Angelo, a friend of Amy Pond who we will never meet again [1]. The Doctor commandeers Jeff’s laptop and hacks his way into a conference call featuring representatives of NASA (National Aeronautics and Space Administration), Jodrell Bank, the Tokyo Space Centre, the ESA (European Space Agency) and the CSIRO (Commonwealth Scientific and Industrial Research Organisation) [2]. And of course, Sir Patrick Moore [3]. In order to establish his credentials as a bona fide genius, the Doctor decides to show off some things that he knows.
DOCTOR: Fermat’s Theorem, the proof. And I mean the real one. Never been seen before. Poor old Fermat, got killed in a duel before he could write it down. My fault. I slept in. Oh, and here’s an oldie but a goodie. Why electrons have mass. And a personal favourite of mine, faster than light travel with two diagrams and a joke. Look at your screens. Whoever I am, I’m a genius. Look at the sun. You need all the help you can get.
Well, as far as I understand, electrons have mass because of their interaction with the Higgs field. Meanwhile, faster-than-light travel is something that firmly remains in the realms of science-fiction, but hey, two diagrams and a joke – now that’s style. But it’s the first one of his claims to cleverness that really fascinates me. Because there’s something pretty wrong about it.
Pierre de Fermat (1601 – 1665) was a French mathematician who is well-known for his work on number theory [4]. He has multiple theorems attached to his name. One of them proves that every prime that is one plus a multiple of four can be written as the sum of two square numbers. Clever! Another one allows you to find local maximum and minimum points on a curve. Amazing! My personal favourite is his ‘little theorem’, which proves that if you take any number x and raise it to the power of a prime p, and then divide that number by p, you will always get remainder x. You can have hours of fun checking this on your nearest calculator; I know I have. All of these theorems can be reasonably described as “Fermat’s theorem”, but none of these are actually being referred to here.
No, what the Doctor is talking about here is Fermat’s Last Theorem.
Fermat’s Last Theorem is, essentially, a bold twist on the simpler and easier to understand Pythagorean Theorem. You remember Pythagoras (c.570 BCE – c.490 BCE) from school, right? Weird fella, had his own cult. Anyway, you will have certainly been taught the Pythagorean Theorem: for any right-angled triangle, the square of the hypotenuse (the longest side) is equal to the sum of the squares of the other two (smaller) sides, or a2 + b2 = c2. As far as mathematical theorems go, this one’s a stone cold classic.
Now Fermat was a very playful sort of mathematician. He asked what would happen if he changed the powers of two to powers of three instead. Are there any cube numbers that can be written as the sum of two smaller cube numbers? He couldn’t find any. He tried powers of four instead. No luck. In fact, no matter which power greater than two he used, he could not find an example. So he conjectured that for any integer n > 2, there are no solutions to the equation an + bn = cn. Infamously, Fermat wrote a comment in the margin of his copy of Arithmetica that he had a marvellous proof to this conjecture of his, but that the margin was too small to contain it. He never documented his proof.
This is classic Fermat.
Fermat was a somewhat lazy mathematician; he hardly published any of his work during his lifetime. Once he was satisfied that he had solved a problem, he would just move on to the next one. As a result, many of his findings were formally proven and then published by other mathematicians once they were able to examine his manuscripts after his death, although Fermat still retained the credit. And they managed to prove all of them, except this one. That’s why it is known as his ‘last’ theorem – it was the last one that needed to be solved.
Since it had not actually been proven, it should technically have been called ‘Fermat’s Last Conjecture’. Except Fermat claimed he had solved it. So it became known as ‘Fermat’s Last Theorem’. This gives the impression that this wasn’t really a conjecture in search of a solution, but more a theorem that was missing a proof. A proof that was out there, somewhere, waiting to be discovered. And so, arguably, the greatest unsolved problem in mathematics was born.
Fermat’s Last Theorem has a notorious reputation within popular culture as a highly challenging mathematics problem. In particular, it often features in Faustian pacts. One of the earliest examples of it in prose was Arthur Porges’ short story The Devil and Simon Flagg [5] (first published in August 1954). Simon Flagg, a mathematician, wagers with the Devil that he cannot solve Fermat’s Last Theorem in the next 24 hours. If the Devil fails to solve the problem, then he has to pay Simon a large sum of money, but if the Devil succeeds, he gets Simon’s soul. Sorry to spoil the obvious ending, but the Devil does not succeed. I mean, that was the whole point of choosing Fermat’s Last Theorem.
However, the Devil managed to turn the tables in the 2000 film Bedazzled, in which the Devil (Elizabeth Hurley), whilst disguised as a school teacher, assigns Fermat’s Last Theorem as a homework problem to Elliot (Brendan Fraser). Yes, dear reader, there is a film where Oscar-winning actor Brendan Fraser is forced to solve Fermat’s Last Theorem by none other than the Devil herself.
Television is not short of examples either. Two episodes of The Simpsons, Treehouse of Horror VI (1995) and The Wizard of Evergreen Terrace (1998), feature equations that appear to be counterexamples to Fermat’s Last Theorem, which would suffice as proof that it was not actually true. But these equations are actually so-called ‘near-miss’ solutions. This was because some of the writers on the show were themselves mathematicians and they thought it would be funny to troll other mathematicians in the audience [6].
Perhaps more infamously, there’s The Royale, a 1989 episode of Star Trek: The Next Generation that’s set around 800 years in the future, in which Captain Picard boldly declares, “Like Fermat’s theorem, it is a puzzle we may never solve.” Sir Andrew Wiles (1953–) published his proof of Fermat’s Last Theorem in 1995, and this incongruous detail had to then be cleared up in the Star Trek: Deep Space Nine episode, Facets (1995). How’s that for continuity, huh?
Ah yes, Sir Andrew Wiles. He was the mathematician who finally managed to prove Fermat’s Last Theorem, over 300 years since Fermat first claimed to have a proof for it. Now it can rightfully be called a theorem! Wiles’s proof involved using modular forms of elliptic curves, an area of mathematics I have virtually no understanding of.
But that’s not the point.
The point is that this area of mathematics was new and cutting-edge in the 20th century, so it wouldn’t have been known to Fermat. So whilst we do now have an actual proof to Fermat’s Last Theorem, some people still like speculate that we haven’t found Fermat’s proof, the original you might say. This is what the Doctor means when he says “And I mean the real one. Never been seen before.” He’s gone back in time, had dinner with the mathematician, and placed the lever for the trap door here…
No wait, sorry, wrong episode…
I mean, he’s gone back in time, met Pierre de Fermat and found out the proof that he originally intended. What an absolute show-off! In summary, it’s a great joke. Very Doctor-ish. Well done Steven. Except for the bit where it’s wrong.
DOCTOR: Poor old Fermat, got killed in a duel before he could write it down.
Pierre de Fermat died on January 12 1665. The cause of his death is unknown, but we have documented evidence that a few days before his death he had been carrying out legal business in the local courthouse. Fermat had a degree in civil law, and by 1631 we know he was based in Toulouse as a lawyer and government official; he was entitled to change his name from Pierre Fermat to Pierre de Fermat because he worked in the government’s courts. And since he worked in the courts, it would have been frowned upon for Fermat to socialise with the local community, lest they end up in the courts and he be accused of bias towards them. So outside of his work duties, he spent his free time reading maths books and solving problems. This is how he became the world’s greatest amateur mathematician.
Noted mathematical historian E.T. Bell wrote that “Fermat’s life was quiet, laborious and uneventful” and described him as a “tranquilly living, honest, even-tempered, scrupulously just man” [7]. To have died in a duel would have been hugely out of character for him. It is also an event that would have more likely been documented at the time of its occurrence. A short sudden illness would be a much more likely explanation. Therefore, I would have to say that it is practically certain that Fermat did not die in a duel.
So why did Steven Moffat write the Doctor saying that he did?
I have a theory. We’ll call it Jones’s First Conjecture.
Evariste Galois (1811 – 1832) was a French mathematician who is well-known for his work on number theory [8]. He has an entire branch of mathematics named after him called Galois Theory. His work in abstract algebra and group theory provided a vital link in the eventual proof given by Sir Andrew Wiles of Fermat’s Last Theorem. Galois was also a staunch republican and was repeatedly arrested during his short life for his political activities. For reasons probably lost to time, he ended up being fatally shot in a ‘duel of honour’ on 30 May 1832. Possibly political, possibly over a broken love affair, we’re not really sure. But we do know that he got killed in a duel. It was reported in the local newspaper. And Big Finish have made a Doctor Who audio drama about it [9]!
I therefore conjecture that the most plausible explanation for this dialogue is that Steven Moffat read a book or an article, at some point, about the history of mathematics, possibly even the history of Fermat’s Last Theorem, and just simply got Fermat and Galois muddled up. Otherwise, this is one hell of a coincidence.
As for an in-universe explanation, Moffat already has built-in an answer for this:
Rule #1: The Doctor lies.
But if he isn’t lying… Then what the hell was the Doctor doing with Pierre de Fermat?
Maybe it was a good thing that he rebooted the universe after all.
>
P.S. Did you know that Steven Moffat originally intended for this scene to be set in a maths classroom?

Footnotes
[1] Although Jeff does reappear in a photograph presented by Amy Pond when she struggles to remember Rory in The Wedding of River Song.
[2] I had to go and watch the actual episode to compile this list because, would you believe, TARDIS Wiki doesn’t have a complete list of the six attendees on this conference call. Useless website.
[3] My introduction to Patrick Moore was on the back page of a 2008 issue of Official Nintendo Magazine. The article jokingly suggested Patrick Moore as a potential new fighter in the next Super Smash Bros. game. His ‘Final Smash’ move would be to remove his monocle and use it as a throwing discus in order to behead his opponent. This meant that when I saw him appear in The Eleventh Hour in 2010 I was probably the only person in the United Kingdom who was thinking, ‘Hey, it’s that guy who beheads people!”
[4] All biographical details about the life of Fermat are taken from p56-77 of Men of Mathematics by E.T. Bell and p60-72 of Fermat’s Last Theorem by Simon Singh. The latter is an excellent and accessible popular science book if you’re interested.
[5] You can read The Devil and Simon Flagg for free on this website. Be warned: it has an eccentric style of prose.
[6] For more on the mathematics in The Simpsons and also Futurama, I can recommend The Simpsons and Their Mathematical Secrets by Simon Singh.
[7] Respectively taken from p57 & p58 of Men of Mathematics by E.T. Bell.
[8] Since E.T. Bell’s account of the life of Galois on p362-377 of Men of Mathematics is somewhat contested, I’ve instead used Tony Rothman’s Genius and Biographers: The Fictionalization of Evariste Galois as a primary source. But again, the relevant details can be be cross-referenced with Fermat’s Last Theorem by Simon Singh.
[9] The Eleventh Doctor meets Evariste Galois in the Short Trip, The Galois Group, written by Felicia Barker. I strongly recommend it. It’s a brilliant story, well researched and has some top-tier maths puns. You can purchase it here in Doctor Who: Short Trips – Volume 12. And yes, we will return to the subject of Evariste Galois in a future blog post.

Leave a comment