# 6 – Algebraic integers, unique factorisation, and Fermat’s last theorem

(This is part of my series on algebraic number theory.)

The foundations of what is now algebraic number theory were devised in the late 19th century in various attempts to prove Fermat’s last theorem, which states that the equation
$x^n+y^n = z^n$
has no solution in positive integers when $n > 2$. This post will give the first part of an attempted proof by Lamé in 1847, using unique factorisation in certain subrings of number fields.

Fermat himself had proved the theorem for $n=4$, and of course the validity of the theorem for $n$ implies its validity for all multiples of $n$ (by contraposition, if we have a solution $x^{kn} + y^{kn}= z^{kn}$, then we have a solution $(x^k)^n + (y^k)^n = (z^k)^n$). Thus it is sufficient to prove it for all odd primes $p$.

6.1 Algebraic integers

Just like the field $\mathbf{Q}$ contains the ring $\mathbf{Z}$ of integers, every number field $\mathbf{Q}(\omega)$ contains its own ring of integers. This ring consists of all the elements of $\mathbf{Q}(\omega)$ which are roots of some monic polynomial with coefficients in $\mathbf{Z}$. Those elements are called the algebraic integers of $\mathbf{Q}(\omega)$. Note that we did not require that this polynomial be irreducible, however it is true that every algebraic integer is the root of some monic irreducible polynomial with coefficients in $\mathbf{Z}$. (Equivalently, the algebraic integers of $\mathbf{Q}(\omega)$ are precisely the elements whose minimal polynomial over $\mathbf{Q}$ has integer coefficients.)

Examples:

• $i$ is an algebraic integer in the field $\mathbf{Q}(i)$, since it is a root of $x^2+1$.
• $\sqrt{2}$ is an algebraic integer in the field $\mathbf{Q}(\sqrt{2})$ since it is a root of $x^2-2$.
• $\frac{1}{2}\sqrt{2}$ is not an algebraic integer, since its minimal polynomial over $\mathbf{Q}$ is $x^2-\frac{1}{2}$, which does not have integer coefficients.

The algebraic integers in any number field form a ring, which is naturally an integral domain since it is a subring of $\mathbf{C}$. The question we will be interested in is whether it is a UFD.

Again, the structure of this ring is hard to determine in general, but the case we will be most interested in is a lot simpler. Let $\mathbf{Q}(\omega)$ be the $n$th cyclotomic field. Its elements are of the form
$a_0 + a_1\omega + \dots + a_{k-1}\omega^{k-1},$
where $k$ is the degree of $\omega$ over $\mathbf{Q}$. Then the ring of algebraic integers of $\mathbf{Q}(\omega)$ consists precisely of those elements of $\mathbf{Q}(\omega)$ where all the coefficients $a_i$ are in $\mathbf{Z}$. This ring is then denoted $\mathbf{Z}[\omega]$.

We will be interested in the ring of integers of the $p$th cyclotomic field for an odd prime $p$, whose elements are then of the form
$c_0 + c_1\zeta_p + \dots + c_{p-2}\zeta_p^{p-2}.$
(Recall that $\zeta_p$ denotes a primitive $p$th root of unity.)

Example:

• The ring of algebraic integers of the $4$th cyclotomic field $\mathbf{Q}(i)$ is the ring $\mathbf{Z}[i]$ of Gaussian integers, complex numbers $a+bi$ where both $a$ and $b$ are integers.

6.2 Factoring Fermat’s equation

The idea is to factor the left-hand side of $x^p+y^p = z^p$. For example if $p=2$, $x^2+y^2$ cannot be factored in $\mathbf{Z}$, but can be factored in the ring $\mathbf{Z}[i]$, as $(x+yi)(x-yi)$. Let now $p$ be an odd prime and for notational simplicity let $\omega = \zeta_p$. $x^p+y^p$ can be factored in $\mathbf{Z}[\omega]$ as
$(x+y)(x+y\omega)(x+y\omega^2)\cdots(x+y\omega^{p-1}).$
To do this, we notice that since $\Phi_p = X^{p-1} + \dots + X + 1$ is of degree $p-1$, it has exactly $p-1$ roots in $\mathbf{C}$. We claim that those roots are precisely the numbers $\omega^k$ for $1 \le k < p$. Firstly, we have $\Phi_p = \frac{X^p-1}{X-1}$, and so the roots of $\Phi_p$ are exactly the roots of $X^p-1$ (i.e., the numbers $x$ such that $x^p = 1$), except $1$.

Secondly, all numbers of the form $\omega^k$ for $1 \le k < p$ are roots of $\Phi_p$ since we have $(\omega^k)^p = (\omega^p)^k = 1^k = 1,$ and $\omega^k \ne 1$ since $k < p$ (and $p$ is the smallest positive integer such that $\omega^p = 1$). Finally, all numbers of the form $\omega^k$ for $1 \le k < p$ are distinct. By contradiction, suppose we have $\omega^i = \omega^j$, and say without loss of generality that $i < j$. Then we have $\omega^{j-i} = \frac{\omega^j}{\omega^i} = 1,$ and since $1 \le j-i < p$ we obtain a contradiction since $p$ is the smallest positive integer such that $\omega^p = 1$. Thus the $\omega^k$ with $1 \le k < p$ are $p-1$ distinct roots of $\Phi_p$. Since $\Phi_p$ is of degree $p-1$ it can have at most $p-1$ roots and we see that the $\omega^k$ are all the roots of $\Phi_p$. This means that $\Phi_p$ can be factored in $\Phi_p = (X-\omega)(X-\omega^2)\cdots(X-\omega^{p-1}),$ and adding a factor $(X-1)$ we obtain $X^p-1 = (X-1)\Phi_p = (X-1)(X-\omega)\cdots(X-\omega^{p-1}).$ If now we let $X = -x/y$ this becomes $-\left(\frac{x^p}{y^p}+1\right) = -\left(\frac{x}{y}+1\right)\left(\frac{x}{y}+\omega\right)\cdots\left(\frac{x}{y}+\omega^{p-1}\right),$ and multiplying both sides by $-y^p$ $x^p+y^p = (x+y)(x+y\omega)\cdots(x+y\omega^{p-1}),$ so our original problem, an additive problem in the ring $\mathbf{Z}$, has been reduced to a multiplicative problem in the ring $\mathbf{Z}[\omega]$: find non-zero integers $x,y,z$ such that $(x+y)(x+y\omega)\cdots(x+y\omega^{p-1}) = z^p.$ 6.3 Solving by unique factorisation

Let’s assume now that $\mathbf{Z}[\omega]$ is a unique factorisation domain. This means it has some elements, which we call primes, such that every element factors uniquely (up to order and unit factors) in a product of primes. We also assume for simplicity that $p$ divides neither of $x,y,z$. (Otherwise it must divide exactly one of them; it is still possible to prove the result in that case but the proof is more difficult.)

Now, we have on the one hand
$X^p – 1 = (X-1)(X-\omega)\cdots(X-\omega^{p-1}),$
whence
$\frac{X^p – 1}{X-1} = (X-\omega)(X-\omega^2)\cdots(X-\omega^{p-1}).$
On the other hand,
$\frac{X^p-1}{X-1} = X^{p-1} + X^{p-2} + \dots + X + 1,$
and so
$(X-\omega)\cdots(X-\omega^{p-1}) = X^{p-1} + \dots + X + 1,$
and finally letting $X = 1$ we obtain
$(1-\omega)(1-\omega^2)\cdots(1-\omega^{p-1}) = p.$

Let $\pi$ be a prime divisor of $x+y\omega$ in $\mathbf{Z}[\omega]$. Looking back to the equation at the end of 6.2 it is clear that $\pi$ divides $z^p$ also, and so that $\pi$ divides $z$. We wish to show that $\pi$ divides none of the other factors of the left-hand side of the equation. Suppose it does, say $\pi$ divides $x+y\omega^k$, with $k \ne 1$. Then $\pi$ divides
$x+y\omega-x-y\omega^k = y\omega(1-\omega^{k-1}) = \omega(y-y\omega^{k-1}).$
$\omega$ is a unit, so we can cancel it and obtain that $\pi$ divides $y-y\omega^{k-1}$. Since $k \ne 1$, looking at the factorisation of $p$ above we see that $1-\omega^{k-1}$ divides $p$, and so multiplying by $y$ we see that $y-y\omega^{k-1}$ divides $yp$. Thus finally $\pi$ divides $yp$, so $\pi$ divides both $z$ and $yp$. Since (in $\mathbf{Z}$) $z$ and $y$ are relatively prime and $p$ is prime and does not divide $z$, $z$ and $yp$ are relatively prime. Thus there exist integers $a,b$ such that $az+byp = 1$. Thus we obtain that $\pi$ divides $1$, which is a contradiction since $\pi$ is a prime, not a unit.

This is where unique factorisation comes into play. Certainly, the number of times $\pi$ divides $z^p$ is a multiple of $p$ (it is $p$ times the number of times $\pi$ divides $z$). So there are $kp$ factors $\pi$ in the factorisation of $z^p$ into primes, and so the same is true for the factorisation of the left-hand side of the equation above. Since $x+y\omega$ is the only factor that $\pi$ divides, it follows that there are also $kp$ factors $\pi$ in the factorisation of $x+y\omega$. The same is true for all prime factors of $x+y\omega$, and so we see that we have $x+y\omega = u\alpha^p$ for some $\alpha \in \mathbf{Z}[\omega]$ and $u$ a unit.

We will not go further in the proof at this point. The important idea is that the existence of an element $\alpha$ of $\mathbf{Z}[\omega]$ such that $x+y\omega = u\alpha^p$ is all that is needed to establish Fermat’s last theorem, and unique factorisation in $\mathbf{Z}[\omega]$ is used only to show this, and no more afterwards. This means that if $\mathbf{Z}[\zeta_p]$ is a unique factorisation domain for all odd primes $p$, then Fermat’s last theorem is proved. As you know, Fermat’s last theorem was proved by Wiles in 1994, not by Lamé in 1847. This means that there must exist some odd prime $p$ for which we know that $\mathbf{Z}[\zeta_p]$ is not a unique factorisation domain (or at least, for which it has not been proven to be one). Indeed, Kummer showed in 1844 (in an article published in an obscure journal and of which Lamé was thus probably unaware) that unique factorisation fails for $p = 23$, and it is now known that unique factorisation fails for all primes larger than $19$.

Kummer subsequently found another way to establish $x+y\zeta_p = u\alpha^p$ without unique factorisation in $\mathbf{Z}[\zeta_p]$ using the correct generalisation of unique factorisation in arbitrary algebraic integer rings. Kummer’s proof works for a class of primes called regular primes, which is larger than the class of primes for which Lamé’s proof works, but unfortunately still does not contain all primes.