Andrew Wiles is a mathematical legend. He is particularly famous for proving Fermat's last theorem, a problem that had been taunting mathematicians for centuries. In this interview, Wiles tells us what it was like proving such an important result, and what it's like to do maths in general.

This article is based on the press conference given by Andrew Wiles at the Heidelberg Laureate Forum in September 2016. Plus would like to thank the HLF for providing this opportunity, all the press involved for their fascinating questions, and Andrew Wiles for his thoughtful answers!

What did it feel like proving Fermat's last theorem after searching for a proof for so long?

It's just fantastic. This is what we live for, these moments that create illumination and excitement. It's actually hard to settle down and do anything – [you're] living on cloud nine for a day or two. It was a little difficult at first to go back to the normal working life. I think it was hard to go back to normal problems.

Do you think your proof of Fermat's last theorem was the beginning of something, rather than the end of something?

Well, it was both. So it was a finishing point for that particular classical romantic problem and that was the problem that drove me to mathematics and brought me to mathematics as a child, so it was an end of that childhood romantic view of mathematics.

What it began was it opened a little door to the Langland's programme, and a new way of trying to get at results in the Langland's programme. Opening that door, [has allowed] a lot of people to go through and develop it, and that's what I've been trying to do too.

Why did you work on the proof in secret?

I didn't actually start by being secret. I did tell one or two people and realised I couldn't tell anyone else: it was not relaxing. They wanted to know all the time what I was up to and was I making progress and so on. I'm completely sure that people working on the Riemann hypothesis [another famous unproved problem], and I'm sure there are some, are not telling the whole world that's what they're doing. Because if you have an idea, you just want to work it out. And of course most of the time, you don't have an idea...

Was the experience of sharing the proof for the first time (in a series of lectures in Cambridge), comparable to the discovery of the proof?

No, discovering was the most exciting thing. There was a tiny sense of you giving it away. This has been a private battle. And it's been this friend I'd had, [one] I've had mixed feelings about, [who'd] treated me badly sometimes. (Laughter) But in passing it onto the world there was a tiny feeling of regret as well.

You speak to an unusually wide audience for a research mathematician. What themes do you emphasise when talking to a broader public?

I think many people have been put off mathematics as young people. But actually what you find with children is they really enjoy it before they've had some adverse experience. A bad experience [is] probably because you were taught or you were in an environment where people were afraid of it. But the natural state I found in most children [is that] they find it very exciting. Children are born curious, exploring the outside world. I'm trying to explain to them [that] for people who carry on, [doing maths is] really an enjoyable experience – it's very exciting.

Now what you have to handle when you start doing mathematics as an older child or as an adult is accepting this state of being stuck. People don't get used to that. Some people find this very stressful. Even people who are very good at mathematics sometimes find this hard to get used to and they feel that's where they're failing. But it isn't: it's part of the process and you have to accept [and] learn to enjoy that process. Yes, you don't understand [something at the moment] but you have faith that over time you will understand — you have to go through this.

It's like training in sport. If you want to run fast, you have to train. Anything where you're trying to do something new, you have to go through this difficult period. It's not something to be frightened of. Everybody goes through it.

What I fight against most in some sense, [when talking to the public,] is the kind of message, for example as put out by the film Good Will Hunting, that there is something you're born with and either you have it or you don't. That's really not the experience of mathematicians. We all find it difficult, it's not that we're any different from someone who struggles with maths problems in third grade. It's really the same process. We're just prepared to handle that struggle on a much larger scale and we've built up resistance to those setbacks.

Yes, some people are brighter than others but I really believe that most people can really get to quite a good level in mathematics if they're prepared to deal with these more psychological issues of how to handle the situation of being stuck.

What do you do when you get stuck?

The process of research mathematics seems to me [to be] that you absorb everything about the problem, you think about it a great deal, all the techniques that you use for these things. Usually [the problem still] needs something else – so yes, you get stuck.

Then you have to stop, let your mind relax a bit and then come back to it. Somehow your subconscious is making connections and you start again, maybe the next afternoon, the next day, the next week even and sometimes it just comes back. Sometimes I put something down for a few months, I come back and it's obvious. I can't explain why. But you have to have the faith that that will come back.

The way some people handle this is they work on several things at once and then they switch from one to another as they get stuck. I can't do that. I get manic about it. Once I'm stuck on a problem I just can't think about anything else. It's more difficult. So I just take a little time off and then come back to it.

I really think it's bad to have too good a memory if you want to be a mathematician. You need a slightly bad memory because you need to forget the way you approached [a problem] the previous time because it's a bit like evolution, DNA. You need to make a little mistake in the way you did it before so that you do something slightly different and then that's what actually enables you to get round [the problem].

So if you remembered all the failed attempts before, you wouldn't try them again. But because I have a slightly bad memory I'll probably try essentially the same thing again and then I realise I was just missing this one little thing I needed to do.

When you take time off - what is your day like?

I like to go and visit aesthetically beautiful places near Oxford. I mean Oxford [is a] beautiful place anyway, with plenty of places to go and beautiful grounds at Blenheim House nearby, designed by Capability Brown.

There are beautiful areas and just to go and walk in these landscapes which have been created centuries ago by these people who really devoted their lives to that, I find that very relaxing, for example.

How important is creativity in mathematics?

Well, creativity is what it's all about. I think outside there are different reactions to mathematics, one is [that the] general public think "Isn't it all known already?", or that it's somehow machine-like.

But no, it's extremely creative. We're coming up with some completely unexpected patterns, either in our reasoning or in the results. Yes, to communicate it to others we have to make it very formal and very logical. But we don't create it that way, we don't think that way. We're not automatons. We have developed a kind of feel for how it should fit together and we're trying to feel, "Well, this is important, I haven't used this, I want to try and think of some new way of interpreting this so that I can put it into the equation," and so on.

We think of ourselves as very creative. I think that's sometimes a little frustrating for mathematicians because we're thinking in terms of beauty and creativity and so on, and of course the outside world thinks of us as much more like a computer. It's not how we think of ourselves at all.

It could be a little like music. In some sense, music, you can just write it out in terms of numbers. I mean, they're just notes. It's up, down, up, down, put a rhythm in. It could be written out completely digitally, and it is. But you listen to Bach or Beethoven, that's not a series of numbers, there's something else there. It's the same with us. There's something very, very creative that we get very passionate about.

Do you get a sense when things are starting to harmonise, to head in the right direction?

Yes, absolutely. When you get it, it's like the difference between dreaming and being awake. When you get it wrong it's often this little feeling at the back of your mind that it hasn't [been] simplified enough. But when you get it right then you feel, "Ah, that's what it's all about.”

Do you think maths is discovered or invented?

To tell you the truth, I don't think I know a mathematician who doesn't think that it's discovered. So we're all on one side, I think. In some sense perhaps the proofs are created because they're more fallible and there are many options, but certainly in terms of the actual things we find we just think of it as discovered.

A mathematical landscape Image © Simon Beck.

Is that a necessary illusion? As a mathematician, to do this work, do you need to believe you've discovered it, not invented it?

I wouldn't like to say it's modesty but somehow you find this thing and suddenly you see the beauty of this landscape and you just feel it's been there all along. You don't feel it wasn't there before you saw it, it's like your eyes are opened and you see it.

Who created this landscape?

Well, mathematicians are not that philosophical. (Laughter) We're artists, we just enjoy it and we leave it. There are philosophers and people at the more philosophical end of mathematics, there are some who do worry about that kind of thing, but we're not Bertrand Russells. We really aren't. (Laughter) We actually want to do [the maths]. We're the working artists.