The Accidental Mathematician

The girl who played with Fermat’s theorem


I finally got around to reading Stieg Larsson’s Millennium trilogy over the last couple of weeks. In case you too are late to the party, here’s a New York Times article about Larsson, his books and his legacy, and here’s the trailer for The Girl With The Dragon Tattoo, the Swedish movie based on the first book in the series.

The best thing about the trilogy is its feminist angle. The villains are “men who hate women” (the Swedish title of The Girl With The Dragon Tattoo), and here Larsson has a point of view that’s all too rare in mainstream popular culture. His female characters aren’t just props against whom crimes can be committed so that the action could advance. They’re actual human beings who have agency, fight back and take control of their lives, even as they remain damaged by the experience. Larsson does not romanticize domestic or sexual violence – it’s not about love or sex, it’s about control and humiliation – nor does he spare the legal and welfare systems that let the victims fall through the cracks too often. (The Robert Pickton case comes to mind, for several reasons.)

Parallel to this, and not entirely unrelated, is the nagging sexism in the workplace, the media, and the society at large:

She had been the first journalist to pounce on the story, and without her programme on the evening that Millennium released the scoop, it might not have made the impact it did. Only later did Blomkvist find out that she had had to fight tooth and nail to convince her editor to run it. […] Several of her more senior colleagues had given it a thumbs-down and told her that if she was wrong, her career was over. She stood her ground, and it became the story of the year.

She had covered the story herself that first week – after all, she was the only reporter who had thoroughly researched the subject – but some time before Christmas Blomkvist noticed that all the new angles in the story had been handed over to male colleagues. Around New Year’s Blomkvist heard through the grapevine that she had been elbowed out […].

This is stuff that I normally only read on feminist websites. I’m not used to seeing it in #1 New York Times bestsellers.

The first book in the series, The Girl With The Dragon Tattoo, is also the best one and I’ve caught myself wishing that Larsson had stopped there. It feels like a cop-out when we learn in the third book that “All The Evil” (Larsson’s term) was really the work of a few deranged individuals overstepping legal boundaries and that the negligent legal system of TGWTDT just needs a good kick to snap back into place. If only it were so simple.

The worst thing about the series is the mathematical interludes in The Girl Who Played With Fire. We’re told that Lisbeth Salander, the goth hacker played by Noomi Rapace in the movie, is also a puzzle-loving math genius who solves Fermat’s last theorem, or thinks she does, in a passage that Tim Gowers singled out for attention some time ago.

Mind you, I’m all for having more novels and movies with strong, resourceful and mathematically talented heroines. I just wish that the math part weren’t so far off the mark. Then again, Salander performs an even more unbelievable feat in a follow-up action sequence, and I’ve commented on the resolution of the third book already, so there’s that to consider.

Salander comes to mathematics by way of puzzles: Rubik’s cube, intelligence tests in magazines, every logical puzzle that she can lay her hands on. She has always been good at solving them, but was not aware of their mathematical side until sometime between the end of TGWTDT and the start of TGWPWF. Mathematics, to her, is “a logical puzzle with endless variations”, a meta-riddle where the goal is to understand the rules for solving numerical or geometric puzzles.

Salander’s primary resource is a book called Dimensions in Mathematics by a Dr. L. C. Parnault (Harvard University Press), a 1,200 page book that’s allegedly considered the bible of mathematics. Quite unsurprisingly, neither Dr. Parnault nor the book in question exist in real life, but Larsson tells us that Dimensions is a book about “the history of mathematics from the ancient Greeks to modern-day attempts to understand spherical astronomy”. It’s supposed to be pedagogical, entertaining, gorgeously illustrated and full of anecdotes. Salander is fascinated by a theorem on perfect numbers – one can verify it for as many numbers as one wishes, and it never fails! – and then advances through “Archimedes, Newton, Martin Gardner, and a dozen other classical mathematicians”, all the way to Fermat’s last theorem. Unwilling to look at the “answer key”, she skips the section on Wiles’s proof and tries to figure it out for herself, which eventually leads to the episode described in Tim’s post.

This is all easy to mock, but unfortunately it seems to be a pretty accurate reflection of what mathematics means to most people. If a major newspaper were to poll its readers on which contemporary mathematicians they have heard of, I’m guessing that Martin Gardner would get far more votes than everyone else combined, possibly with Perelman and Wiles as the distant second and third (I’m not sure in which order). [Edited to add: how could I have forgotten about John Nash?]

With all due respect to Gardner and his work, I have a problem with the image of mathematics as the art of puzzle solving. Sure, mathematics involves logical arguments and so do mathematical puzzles. An appreciation of that does offer some insight into what we do. Regrettably, it can also lead to the notion that we get paid for playing with Rubik’s cube and solving crossword puzzles and newspaper-style intelligence tests. It’s the equivalent of a blind person touching an elephant’s trunk and concluding that elephants look like snakes.

In case any non-mathematicians are reading this: logical puzzles convey no sense whatsoever of how vast the subject actually is or how much work it takes to learn the craft. They can’t, for the simple reason that they’re created for entertainment. Their target audience can’t be expected to take a calculus class, never mind advanced graduate courses, before they can even understand the statement of the question. This already narrows it down to simple Euclidean geometry, basic combinatorics, possibly some manipulation of numbers, and eliminates most of mathematics as we know it. You’d never learn for example that analysis, PDE or ergodic theory even exist, let alone how much accumulated knowledge there is in each of these areas. You wouldn’t get any good picture of contemporary geometry or combinatorics, either. The puzzles you’re left with may be tricky and entertaining, but they’re at best peripheral to mainstream mathematics.

The difficulty of math puzzles is usually calibrated so that the readers would have a good shot at solving them within a short time, usually ranging from a few minutes to an hour or two. A really hard puzzle is one that takes more than a few hours. No wonder that Salander was disappointed when she couldn’t solve Fermat’s theorem within a couple of days, or that she would expect a short solution with no background required. In real-life mathematics, we don’t have a Ceiling Cat to set up problems for us and control their level of difficulty. Advisors can sometimes do that for their graduate students, to a very limited extent, but mostly we’re left stumbling in the dark, not knowing whether there even is a solution or whether we’re asking the right question in the first place. Learning to navigate this is possibly the hardest part of becoming an independent researcher.

Then there’s Dimensions of Mathematics. The very idea that mathematics should have a “bible” looks like a continued misunderstanding of the nature and scope of the subject. However, Larsson’s description is more reminiscent of any number of popular math books, except for the length.

If I had to suggest a real-life book for Larsson to use instead, it might be a collection of national or international Math Olympiad problems with solutions. It would not be a bible of anything, but it should present a challenge to someone like Salander at about the right level. Olympiad problems only require normal high school background, which Salander should be able to catch up on. (Did I mention that she had dropped out of school?) They can be very hard, immeasurably more so than logical puzzles in popular magazines, but not necessarily out of reach for an extremely smart newcomer to mathematics who’s willing to put in the time and effort.

What I would really like to nominate, though, is the Princeton Companion to Mathematics. (Sorry, Tim.) For starters, the length is about right. Unlike the fictional Dimensions, the Companion might have given Salander some idea of what research mathematics actually looks like. She might have even developed some respect for the subject and, smart as she is, stopped treating Fermat’s theorem as a minor arithmetic puzzle. Then the embarrassing episode near the end of TGWPWF could have been avoided.

In case you need a soundtrack for this post: the Bowie song Cat People is referenced near the end of The Girl Who Played With FIre (the book – I haven’t seen the movie), in a context very similar to that in Inglourious Basterds. The video has the relevant Basterds footage. There’s nothing quite like a good revenge fantasy to cheer up a girl. Enjoy.