(Picture from the Simpsons episode “Treehouse of Horror VI” where Homer enters the world of 3D.

Try entering the numbers in your hand calculator)

The statement of the perhaps most famous mathematics problem over the past few centuries should not have slipped past many people with some interest in mathematics.

I am of course talking about Fermat’s Last Theorem (FLT) which was finally resolved by Andrew Wiles in 1995 in what is considered one of the most remarkable mathematical achievements of modern day.

FLT is one of those problems whose statement is so often understood by anybody on the street, but is very difficult to prove. The amount of machinery that lies behind Wiles proof is astonishing (more so in algebraic geometry than pure number theory).

As a reminder I will state FLT and then begin discussing the contents of this post.

**Fermat’s Last Theorem:**

Let .Then there exists no s.t .

In this post I wanted to treat a related question.

Is FLT true over finite fields of characteristic p?

That is, can we refute the existence of non-trivial integer solutions to if we work where is a prime number?

The answer is No.

You can probably immediately spot counterexamples such as .

More remarkably however, given there exists non-trivial solutions to for every prime sufficiently large.

Schur came up with this result while trying to prove FLT.

This result probably gives some idea as to why FLT was so hard to prove since it shows one cannot simply consider congruences like one often does when working with other types of Diophantine equations.

Another interesting fact about this result is that it can be proved using both Fourier Analysis and Ramsey Theory. This may seem rather surprising since Ramsey Theory is combinatorics (a field dealing with countable discrete structures) whereas Fourier Analysis revolves around function approximation using continuous trigonometric functions, and both are used here to prove a number theoretic result. This shows just how differently mathematics problems can be approached if one can find a suitable phrasing in whichever language is being used.

I would like to focus on the latter proof using Ramsey Theory.

So what is Ramsey Theory?

The slogan for Ramsey Theory is basically that any sufficiently large structure, no matter how disordered, contains some element of order. For graph structures one usually likes to look at edge colourings and say something about specific subgraphs where all edges are of the same colour.

Let’s make an important definition to make this more precise:

**Definition (Ramsey Number):**

A graph on vertices is **complete** (denoted ) if every pair of vertices is connected by a unique edge.

Let denote the smallest number such that for any red/blue edge-colouring of there exists either a monochromatic red subgraph or a monochromatic blue subgraph .

The numbers are called **Ramsey Numbers**.

We may also define **Generalized Ramsey Numbers** as the smallest number such that any of contains at least one monochromatic subgraph of colour for some

I have omitted one crucial detail: How do we know is well-defined?

This is exactly what **Ramsey’s Theorem** asserts, that this number exists in the first place.

The proof is not actually very difficult, one proceeds by proving an upper bound on . One can then show well-definedness of the generalized Ramsey number by proving the recursive inequality and using the well-definedness of as part of an inductive argument.

I will however omit the details of the proof and move on to the main result of this post.

Before we get there we need an intermediate theorem which seemingly has little to do with our goal:

**Proof:**

A k-colouring of is the same as a function .

Take .

Then by Ramsey’s Theorem we are guaranteed that any k-colouring of contains a monochromatic triangle.

Define a k-colouring on the edges of by .

The existence of a monochromatic triangle in then means s.t

W.l.o.g assume and put .

Then as desired where .

**Main Theorem:**

Let .

Then there exists a prime s.t for every prime

has a non-trivial integer solution i.e a solution where

**Proof:**

The proof depends on a key fact which is much easier to understand if you know some Group Theory.

The fact is that every integer in can be written as some (multiplicative) power of a fixed integer in the same set .

[in other words is a cyclic group]

To informally look at this another way (without directly using notions from Group Theory), define .

The reason we want to be a prime instead of just any integer is that we need to make sure we have no zero divisors i.e we need to ensure there exists no non-zero s.t .

One of the reasons for this is that we would like to make the definition below:

Define an equivalence relation on by:

for some .

(You can check this is well defined for prime)

The so called equivalence classes are defined as for some representatives

A standard fact from set theory tells us that equivalence classes on a set form a partition

.

After all, every integer in must belong to some equivalence class and you can check that they do not intersect.

Now we can start colouring the set .

Define the colouring by iff .

By Schur’s Theorem s.t s.t with .

In other words we can find non-trivial s.t for some so that for some and

Since and are co-prime we may divide away to get .

**Exercise 1( R(3,3) -Easy ):**

Prove that .

Hint: Think of the pigeonhole principle for the upper bound

(I was actually asked to prove this myself in one of my undergraduate admissions interviews, though it was stated differently in terms of friends and strangers instead of as a Ramsey Number)

**Exercise 2( R(3,3,3) -Hard ):**

Prove that .

(Note: Proving this was one of the questions in a past IMO competition, again stated very differently).

This proof of FLT mod p seems to be incorrect. If n does not divide p-1, then the resulting equivalence classes are singletons. In fact, k (the number of equivalence classes) depends on p, and that’s a problem. It can be fixed by taking p sufficiently large and congruent to 1 mod n (and Dirichlet’s theorem assures us that there are infinitely many such primes).

Never mind — it’s not that the equivalence classes are singletons, but that there is only one equivalence class. My mistake.