Some thoughts on AI and mathematics

I am, with some regrets, back on Twitter. One of the things I’ve been doing on Twitter is having hot takes about AI and mathematics, which seem relatively popular. Recently I was asked to write one of them up, so I thought I might take the time to write down some of my broader thoughts on the subject.

Here they are, in no particular order.

How I feel about all of this

Some of this is scary as hell - I definitely felt the world drop out from under me when Alpoge and Claude proved the Riemann Hypothesis. Despite the huge changes in my profession, this is probably the first thing that has really made me go “Oh shit, the singularity just started” as more than about 30% serious.

I am also very sympathetic to mathematicians who are freaking out about this. If you’re an experienced mathematician, you just got outclassed by someone willing to throw (depending on how you count) millions to billions of dollars at directly obsoleting your career. If you’re a new or upcoming mathematician, is yours a career that will even continue to be relevant? I think many of the takes coming from individual mathematicians, including ones I respect a great deal, about this are very bad, and I hope they feel embarrassed about them later, but I get where they’re coming from.

Now, all that being said… This is so fucking cool, you guys. It’s not like Christmas come early, it’s like an entire decade of Christmasses all at once.

Let me tell you a bit about where I’m coming from.

I was almost a mathematician. I did an undergraduate, including a masters, in mathematics, and always assumed I would go into academia afterwards. After a bad fourth year, I decided to take some time out in industry and come back to a PhD later. Everyone told me that I wouldn’t come back. I was convinced they were wrong. They weren’t.

I think there is an alternate history where I went into mathematics instead. I would have done OK. I was never going to be a fields medallist, but I feel reasonably confident that if I’d got my shit together then I could have managed a perfectly reasonable career as a mid-tier research mathematician.

I also think that this history is clearly better for me. I do quite well as a software developer, have made some moderately big improvements to the world through my work, and generally benefit enough from being able to augment my thinking and executive function that working in software fits my brain very well.

But… I don’t know, I still miss mathematics. There’s something about mathematical understanding and discovery that is really hard to substitute for. Every time I get to do some sort of mathematics, it makes me happy, and some part of me really feels like the highest possible human experience is contributing to the sum total of humanity’s understanding of the mathematical universe.

I think there are a lot of people like me, who really want to be mathematicians, but we didn’t or couldn’t hack it, so we went into software instead, but feel like something is missing as a result.

And then this combination of Lean and LLMs came along and holy shit we can do research-level mathematics now, using the skills we’ve spent our career actually getting good at. Managing mathematics like a software project is incredible, especially one in the AI software era making this level of formalisation viable.

Now, obviously, if all we do is type “Prove Riemann Hypothesis make no mistakes” followed by “I believe in you, keep going” a lot then that’s not really doing research-level mathematics. I don’t think it’s necessarily doing anything wrong, especially if we’re asking questions because we care about the answers rather than because we want the credit, but if we don’t even understand the question we’re asking, this seems like pointless clout chasing and I don’t approve. Ideally we’d understand the answer too of course, certainly if we’re really doing this for the love of the craft rather than practical reasons.

But is it really doing mathematics?

Yes.

Look, mathematics reinvents itself on the regular. Every century or so we completely reinvent what it means to do mathematics. A century or so ago we got the whole formalisation program, which changed a huge amount of what we think about as doing mathematics, before that we got rigorisation, calculus, algebraic notation. Every time this happens, you get a literal Kuhnian paradigm shift in what it means to do mathematics and it becomes hard to even understand a lot of what happened before as mathematics.

We also had a mini version of this exact problem: If you go back fifty to a hundred years, everyone is really really into calculating sums and integrals. There’s a whole cottage industry of this, and people were really excited about it. Nobody does this any more, because computers got good enough at it. I’m a little sad about this because I really enjoy these problems. I have not one, but two different editions of Gradshteyn and Ryzhik, a book that only engineers and physicists really care about these days. These days, I think most mathematicians are in fact delighted not to have to care about this.

This is a big scary shakeup which is very stressful to go through, and we’re having another one right now so no wonder everyone is stressed, but I think the things to bear in mind are:

  1. Every time this has happened, there has been a continuous throughline from what mathematics was to what mathematics is. Often we stop caring about some of the things we used to care about, either because they were basically solved or because we stopped thinking they were problems, but by and large we build on the old mathematics and preserve its most important core. The Riemann Hypothesis predates the last big shakeup after all.
  2. Mathematics continues as a human activity, and often a much richer one than what came before.

We’ve got a lot of exciting mathematics up and coming, and it’s going to be really cool to find out what it is.

Changing costs and benefits

I think the big change that is causing everything to look very scary is that it used to be the case that it was easier to ask interesting questions than it was to answer them, and recently answering mathematical questions got vastly easier, while asking interesting mathematical questions didn’t get much easier.

This isn’t intrinsically a problem, except that we tied mathematical status to answering questions, because it was the best proxy we had for mathematical understanding.

As a result, we’ve got two big things happening at once:

  1. We’re essentially “strip mining” a previous surplus of open interesting questions.
  2. This is totally destroying the old incentive structure.

This probably feels like the end of the world, because it removes what feels like a central part of “doing mathematics”, but I think it pretty rapidly hits a new equilibrium when we run out of most of the existing backlog of open problems and we’re reliant on people actually metabolising enough of the mathematical output to start asking new questions.

Could LLMs automate the process of asking interesting questions too? Yup, definitely. Not, I think, the entirety of it though, and as long as there are human mathematicians interested in mathematics, we’ll keep exporing and keep asking new questions, and that will continue to be a defining part of the field.

New ways of doing mathematics

Obviously it’s the bits where the LLMs are competing on the existing playing field of big open problems that are making all the headlines, and that’s reasonable enough, but I think there are a number of other exciting things that are a bit understated at the moment and are worth making a much bigger deal of.

The first is: Holy shit, we can just formalise things now!

It’s a dirty not-very-secret that a decent chunk of published mathematics is just false. Rarely anything super important, often in fixable ways, but for example I’ve as recently as last week run into a false result in a published paper that several other papers had subsequently built on.

The ability to formalise a mathematical result in Lean somewhat automatically is kinda incredible for catching this problem. Even without the Lean, LLMs are really good at catching errors in published proofs.

One additional upside of this is that a social problem in mathematics is now just solved. It’s something of an ongoing problem that a mathematician who is credible enough that they can’t be dismissed publishes a proof that nobody understands and everybody thinks is probably wrong, but nobody can quite be bothered to put in the effort to show that it’s wrong. For example, Enflo’s proof of the invariant subspace conjecture for Hilbert spaces has been in this state for a few years. It is, as expected, wrong.

I don’t think we’re going to be moving to a world where human mathematicians start with a Lean formalisation any time soon. I think thinking in Lean first is something of an unnatural thing to do. But I do think we’re moving to a world where, thanks to LLMs, it becomes reasonable to expect for every published paper to be formalised, and this is a world in which we get to have substantially more confidence in our mathematics.

New types of mathematics to do

When I initially was told about it, I thought the Equational Theories project was cute. It looks at all laws that magmas can satisfy (involving at most 4 operations), and then proves or refutes every single implication between these. This requires proving 22,028,942 theorems. Nobody, in fact, cares about this problem in and of itself, but it’s neat that you can do it.

But as time as time passed and as LLMs got better, the implications of this started to sink in for me, which is that now we can do this for everything.

For example, earlier an LLM working for me proved that Normal Hausdorff sigma-compact totally disconnected spaces are zero-dimensional. Oh boy, fields medal here I come!

This is, obviously, not actually a very exciting result. It’s not even a very useful result. It is, however, a result that helped a lot in one very specific way: It cleared out a bunch of possible rows from the table of possible assignments of topological spaces.

This is part of a project I’ve started in a similar space to equational theories. You can have a browse around, though at the time of this writing it’s in a bit of a rough shape and a lot of the prose is badly structured.

This is part of a longstanding interest I have in Steen and Seebach’s “Counterexamples in topology”, which is a wonderfully weird little book with a zoo of topological spaces. There are a few other “Counterexamples in…” books that followed it, but really none of them are as iconic as Steen and Seebach. I think partly because topology is Like That, so it’s a very well suited subject to write this book about, and partly because it was obviously a labour of love. pi-base is a later web-based project that acts as a follow-on to this work, and is similarly excellent.

Anyway, it occurred to me the other day that this was an exceptionally well suited problem domain to this sort of equational theories style approach. You’ve got a finite set of properties of interest, and you can just… enumerate all possible assignments of them, and try to find which ones are satisfied.

So now I’ve been getting LLMs to go through this and, both through their own work and studying the existing literature, try to complete the set of spaces and theory. pi-base has 245 properties, and the ultimate goal of this project is that we should be able to know exactly which assignments of those 245 properties. After all, it’s only 245 properties, how many assignments could there possibly be? 1,179,534,787,416,790?

The result will, obviously, be huge. It’s already at about 9MB of lean code and barely scratching the surface.

The result will, also obviously, be mostly boring. If you look at the current list of theorems then most of them are trivial, and many of the rest are tedious enough to put you to sleep.

But there sure are some interesting nuggets in there, and my hope is that this turns into a really interesting and useful resource to go digging in to find actually interesting stuff.

For example, it’s another good place to do a literature check. Because we’re drawing on, and necessarily formalising, the existing literature on this subject, we necessarily find errors. In 1971, in “A topological view of P-spaces”, Misra claimed the construction of a Hausdorff connected P-space, but their construction proves to be wrong, and in fact Misra’s space is totally disconnected. Fortunately, this can be repaired. As far as I can tell, nobody has ever noticed this, and the error has gone unremarked in the literature for over 50 years.

Another interesting thing that came out of it is the theorem that any continuous map from a connected and locally connected space into a biconnected Hausdorff space is constant. It’s probably not very important (it’s mainly useful for ruling out certain spaces being path connected), and it’s probably a known folklore result, but it’s not something I’d run into before.

In terms of super exciting results, that’s about as good as it gets so far. There are also a bunch of cute things like Biconnected spaces that are not T₀ are completely normal (because this almost entirely characterises the space, as it can have at most three points), but the nature of the program is such that most of the theorems it establishes will not be very interesting, and the construction of spaces is probably more interesting than the theory.

It’s also found some interesting new spaces. For example, the Complete Erdős dispersion space consists of adding a dispersion point to the the Erdős space.

All of this is currently hard to find, because the site is a bit of a disorganised mess where we’re generating a dataset before we’re generating tools to understand it with. I think that’s going to be a big part of the next big thing in mathematics: Ultimately, a human has to understand the result or it’s not really doing mathematics any more, but I think computers can do a lot to help us get there, and one of them is going to be building up tools for studying these huge slightly posthuman mathematical objects we’re going to find ourselves routinely encountering.

I think it’s going to be extremely exciting to be a part of.


  1. Yes, I’m back on Twitter. Those of us who joined in the beforetimes are grandfathered in. New users get the X experience. Sorry guys, it’s much worse. Not that the Twitter experience is good either.

    ↩︎
  2. Spoiler: I think the answer is yes. More on this later.

    ↩︎
  3. It is perhaps a personal vice that I am much more sympathetic to the mathematicians when they have absolute dogshit takes about AI coming for their jobs than I am to the artists when they do the same. I’m actually more sympathetic to the artists’ plight, because I think AI image generation is mostly a bad thing and also that their jobs are more at risk and their lives are typically already more precarious. But then I read the things they say about it and it is very hard to be sympathetic to them personally.

    ↩︎
  4. Short version: I basically was able to coast through my undergrad degree up to that point, only starting to struggle a bit in my third year, and then when things got Actually Hard in the fourth year, scheduling also screwed me over so I had a real shortage of courses I was actually interested in and had never really learned good work habits prior to that point. Whole thing resulted in something of an emotional spiral and I got a good but not great result in the end, but it left me wrecked.

    ↩︎
  5. Maybe even better than that! But probably not.

    ↩︎
  6. Unfortunately, doing mathematical exercises from textbooks does not satisfy this. There’s probably some whole complicated set of psychology around this, probably partly ego driven and partl ythat textbook exercises are dull as shit. But I’d rather do cryptic sudoku than textbook exercises.

    ↩︎
  7. Descriptive, not normative claim.

    ↩︎
  8. Though they are again a bit Sudoku

    ↩︎
  9. I’m even in the errata! For a problem I found by hand even! I am so smug about this and definitely not mentioning this book just for an excuse to mention this fact.

    ↩︎
  10. You can see some of the legacy of this in naming. Irrational and imaginary numbers were once upon a time genuinely controversial. Now everyone just accepts them as normal.

    ↩︎
  11. I’m somewhat agnostic as to whether all of the big name open problems fall. My bet is that Collatz lasts a while and P = NP falls in the next year or two for example, but I think we lose a lot the long tail of relatively easy problems, and what are left are either well out of the reach of LLM-assisted mathematics or lack any real cache to solve.

    ↩︎
  12. I in fact have an LLM partially automating that as we speak, over a very narrow domain that not many other people are going to care about.

    ↩︎
  13. I emailed the authors of the result, but haven’t heard back.

    ↩︎
  14. It’s all LLM written prose at present of course. I do plan to clean up a lot of the main prose, but right now I’m focused on the mathematical content.

    ↩︎
  15. “Don’t be ridiculous, David, that’s an exponential number of properties, you can’t possibly enumerate all \(2^61\) assignments of the properties from Steen and Seebach!!”. Au contraire

    ↩︎
  16. This is the number of assignments consistent with all the theorems I know of about these properties today. I expect the true number to be much lower, and also that many of the possible assignments can be eliminated in bulk through families of constructions.

    ↩︎
  17. No, I didn’t know what a P-space was before this either.

    ↩︎
  18. Of course this is mostly because it is a minor result and there probably aren’t more than a dozen people who would have remarked on it.

    ↩︎
  19. One cool mathematical development this year that I didn’t even find space to mention before is that LLMs are great mathematical tutors even while kinda sucking at mathematical exposition. I more or less understand set theoretic Forcing now! I haven’t used it enough to be actually good at it, so I hesitate to say I really understand it, but I now basically get it and feel like I could use it if I needed it, and that’s incredible.

    ↩︎