I went to see *The Man Who Knew Infinity* yesterday. I have nothing much to say about the movie as a movie that wasn’t already said in Scott Aaronson‘s review, except that I learned a few fun facts during the Q&A session with writer/director Matthew Brown afterwards. Namely, it’s a little surprising the movie was able to get high-profile stars like Dev Patel and Jeremy Irons on board given that it was made on a relatively low budget. Apparently, Dev Patel signed on because he really wanted to popularize the story of Ramanujan, and Jeremy Irons signed on because he was hooked after being given a copy of Hardy’s *A Mathematician’s Apology*.

(Disclaimer: this blog does not endorse any of the opinions Hardy expresses in the Apology, e.g. the one about mathematics being a young man’s game, the one about pure math being better than applied math, or the one about exposition being an unfit activity for a real mathematician. The opinion of this blog is that the Apology should be read mostly for insight into Hardy’s psychology rather than for guidance about how to do mathematics.)

Anyway, since this is a movie about Ramanujan, let’s talk about some of the math that appears in the movie. It’s what he would have wanted, probably.

**Elliptic integrals**

There’s a moment in the movie where a Cambridge professor writes on the board (if memory serves) the complete elliptic integral of the first kind

and goads Ramanujan into stepping up to the board, presumably with the intent to embarrass him, whereupon Ramanujan immediately writes down the Taylor series expansion of the integral as a function of . In the movie it’s a bit unclear whether this meant he worked out the answer off the top of his head or knew it already, but my inclination is to assume the latter based on the fact that this integral appears in Carr’s *Synopsis*, which Ramanujan famously studied in India.

In any case, how might we go about finding this Taylor series? A natural strategy is to first compute the Taylor series of the integrand, then integrate it term-by-term, especially if, in the spirit of Ramanujan, we’re willing to play fast and loose with issues like where the Taylor series converges and whether we can exchange infinite sums and integrals here. Using the general form of the binomial theorem, the integrand expands to

where

which simplifies to

.

It follows that we have

so we’re left with computing the integral of . This is straightforward to compute using Euler’s formula, which gives

.

Using a second application of the binomial theorem, the term is

.

Since we know the answer is real, we can ignore the imaginary part of this integral and focus on its real part. The integral of the real part

vanishes unless by symmetry considerations, so is the only relevant term and we get

where the integral is just . This gives the final answer

which Ramanujan wrote as

.

**Ramanujan’s prime number theorem**

Ramanujan claimed, in his letters to Hardy, that he had found a more or less exact formula for the prime counting function (the number of primes less than or equal to ). Upon closer inspection by Hardy and Littlewood, this formula was later shown to be incorrect. This is part of the ongoing tension in the movie between mathematical intuition, as exemplified by Ramanujan, and mathematical rigor, as exemplified by Hardy; Hardy emphasizes that situations like this are why intuition is not enough and Ramanujan needs rigor as well. But the movie never explains what, exactly, Ramanujan’s error was. So what was it?

**Edit, 5/9/16:** In fact Hardy writes about this error in *The Indian Mathematician Ramanujan* (beginning on page 150), as I learned from Alison Miller in the comments. It’s well worth reading everything Hardy has to say, but on the subject of in particular, he writes

Ramanujan’s theory of primes was vitiated by his ignorance of the theory of functions of a complex variable. It was (so to say) what the theory might be if the Zeta-function had no complex zeros. His method depended upon a wholesale use of divergent series… That his proofs should have been invalid was only to be expected. But the mistakes went deeper than that, and many of the actual results were false. He had obtained the dominant terms of the classical formulae, although by invalid methods; but none of them are such close approximations as he supposed.

So, it sounds like what happened is that Ramanujan found a version of the explicit formulas relating to the zeroes of the Riemann zeta function. However, he believed, incorrectly, that the zeta function had no complex zeroes, and so didn’t include the terms in the explicit formulas having to do with those zeroes; this simplifies the formulas but at the cost of introducing errors which Ramanujan did not do enough computations to notice. Hardy once said elsewhere of Ramanujan that he

had indeed but the vaguest idea of what a function of a complex variable was was

and says here, more specifically, that he

knew nothing at all about the theory of analytic functions

so this is perhaps unsurprising.

**Black holes**

At some point in the movie there is some text claiming that Ramanujan’s work is now being applied to understand black holes. It’s easy for such claims to be overblown: for example, when Grothendieck died, some articles claimed that his work had applications to subjects like cryptography, robotics, and genetics. These claims come from a combination of two claims:

- Grothendieck’s work had a big impact on algebraic geometry.
- Algebraic geometry is applied to cryptography, robotics, and genetics.

However, as far as I can tell, Grothendieck’s work in particular has no direct relevance to cryptography, robotics, or genetics, although I’d be happy to see evidence to the contrary.

But this black hole claim seems to check out, sort of. I believe it refers to Ramanujan’s work on mock modular forms, which he studied in the last year of his life, after leaving England and before he died (not shown in the movie). Ramanujan described various examples of such functions, but a general theory, including a general definition, was missing until surprisingly recently, when Zwegers showed in 2002 that they were related to harmonic Maass forms.

The connection to black holes comes from Dabholkar, Murthy, and Zagier, who showed that certain mock modular forms arise as generating functions of BPS states in certain supersymmetric string theories, which are relevant to the study of black holes from the perspective of quantum gravity. This ties Ramanujan’s mock modular forms to a rich interaction between physics and mathematics involving the AdS/CFT correspondence, also known as the holographic principle, and variants of Monstrous moonshine such as umbral moonshine.

A more famous example of this relationship comes from Monstrous moonshine itself, as follows. Perhaps the most famous non-mock modular form is the j-invariant, whose Fourier expansion begins

.

The story of Monstrous moonshine begins with McKay’s famous 1978 observation that the coefficients of can be written as sums of the dimensions of the irreducible representations of the Monster group; for example, the dimension of its smallest nontrivial irreducible representation is , and . Frenkel, Lepowsky, and Meurman later showed that this is because the j-invariant is the generating function for the dimensions of the graded pieces of a vertex operator algebra on which the Monster acts, and which describes a certain conformal field theory related to the Leech lattice.

Here the relationship to black holes comes from Witten (via John Baez), who suggested that the Monster conformal field theory might have something to do with 3d (really 2+1d; 2 space, 1 time) quantum gravity, and hence with 3d black holes, via the holographic principle. A tantalizing piece of numerical evidence for this conjecture comes from calculations of black hole entropy. The lightest black hole in one version of the theory has states, and so its entropy is

whereas a semiclassical approximation to this entropy, using the Bekenstein-Hawking formula, gives

.

These aren’t supposed to agree exactly because there are quantum corrections to the semiclassical approximation. There is a parameter that can be varied in the theory, and as the agreement between the quantum and semiclassical answers becomes exact. This is proven using a known asymptotic for the coefficients of the j-invariant, namely that

.

It’s very curious to think that this might be related to black hole entropy.

Incidentally, the proof of this result (with good error terms) relies on the Hardy-Littlewood circle method, which was pioneered by Hardy and Ramanujan in the work on the asymptotics of the partition function. This is a major part of the movie which we’ll defer discussion of to a second post.

on May 31, 2016 at 12:23 am |月旦 IV | Fight with Infinity[…] 看过电影后，袁翘楚写了2篇很有意思的文章： The man who knew elliptic integrals, prime number theorems, and black holes The man who knew partition asymptotics […]

on May 27, 2016 at 8:43 am |S. CarnahanWhile some of Witten’s conjectures and suggestions in that paper were too optimistic, there definitely seems to be substantial content that can be extracted after a little adjustment. See e.g., the last section in https://arxiv.org/abs/0907.4529 for slightly more up-to-date developments. There wasn’t any physical reason to expect exceptional symmetry in all of the extremal CFTs, and that bit was just wishful thinking. The smallest case happened to be (subject to a still-open uniqueness conjecture) limited to only one isomorphism class that happened to have monster symmetry.

on May 20, 2016 at 5:49 pm |The man who knew partition asymptotics | Annoying Precision[…] « The man who knew elliptic integrals, prime number theorems, and black holes […]

on May 9, 2016 at 12:58 pm |Alison MillerThank you for the nice exposition!

Do you know why, in the movie scene where he plays squash with Littlewood, Hardy was talking about Ramanujan giving meaning to the negative values of the gamma function? (I would have expected to hear about the negative values of zeta, instead…)

Hardy agreed with you about Ramanujan and analytic number theory: see the text of Hardy’s first lecture on Ramanujan at the Harvard tercentenary.

Actually, I recommend that anyone interested in the movie take a look at that lecture, to read what Hardy actually had to say about Ramanujan. A large chunk of it is accessible to a general audience, and in fact, the opening will be familiar to anyone who’s seen the movie. I’m lukewarm on

A Mathematician’s Apology, but I found this piece engaging and fascinating. A sample:on May 9, 2016 at 5:14 pm |Qiaochu YuanAh, thank you very much for that link! I was trying to track down a copy of this earlier and failed. To be clear, when I said “as far as I can tell” I meant “as far as I can tell through googling,” as opposed to “as far as I can tell by directly scrutinizing Ramanujan’s work myself”; I’ll edit to clarify that.

And unfortunately, I don’t know what the remark about the Gamma function is about.

on May 9, 2016 at 5:33 pm |Alison MillerSee also Hardy’s introduction to Ramanujan’s collected papers , which is the source of all of Hardy’s self-quotations in the speech.

on May 9, 2016 at 5:33 pm |Qiaochu YuanFantastic. Thanks again!

on May 9, 2016 at 5:53 pm |Alison MillerAnd giving it another look, I see that Ramanujan’s first letter (on page xxiii) answers my question about the negative values of the gamma function. I was partly confused because I was thinking this meant values at negative integers, where gamma has poles.

But actually he was talking about s negative and non-integral; he asserted that the standard gamma integral should still be defined for those s, and have value Gamma(s).

on May 8, 2016 at 7:42 pm |Kannappan SampathNice post! As for the proof of the asymptotic formula for the Fourier coefficients of j-function, one can derive it by more “elementary” means if you grant yourself some familiarity with Zagier’s work on Singular moduli. We do this in a joint work with Prof. Ram Murty: http://www.mast.queensu.ca/~murty/Murty-Sampath.pdf.

on May 8, 2016 at 6:33 pm |John BaezNice! The current consensus seems to be that Witten’s conjecture concerning 2+1 quantum gravity is not quite right: further checks didn’t work out. Gerald Hoehn wrote:

on May 9, 2016 at 9:16 am |Qiaochu YuanThat’s unfortunate. Do you know if there are any other prospects for the asymptotics of the coefficients of the j-invariant to be given some kind of conceptual meaning?