I'm doing the first part of the following exercise in Miles Reid's Undergraduate Commutative Algebra:
Exercise 0.18: Prove the cases $n=3$ and $n=4$ of Fermat's last theorem.
I'm assuming I should prove it using the Eisenstein integers $\Bbb Z[\omega]$, where $\omega^2+\omega+1=0$, since the previous exercise asked me to prove that $\Bbb Z[\omega]$ is a UFD. I would like to know if my proof is correct. Here we go:
Let $$z^3=x^3+y^3\tag{1}$$ where $x,y,z\in\Bbb Z^+$ have no common factor. Eq. $(1)$ may be factored as $$z^3=(x+y)(x+\omega y)(x+\omega^2 y)\tag{2}$$
Notice also that we have the relations $$\begin{align}x+y&=x+y\\x+\omega y&=(x+y)-(1-\omega)y\\x+\omega^2 y&=(x+y)-(1+\omega)(1-\omega)y\end{align}\tag{3}$$
Therefore if there exists a prime $\pi\in\Bbb Z[\omega]$ that divides any two of the three factors, we must have $\pi\mid 1-\omega$. We cannot have $\pi\mid y$, since this would lead to $\pi\mid x,z$, which again would lead to $N(\pi)\mid x,y,z$.
The element $1-\omega$ is itself a prime, since $N(1-\omega)=3$ is a prime, therefore we may assume $\pi=1-\omega$.
If $1-\omega$ divides every factor then we may write
$$\begin{align}x+y&=u_1(1-\omega)\alpha^3\\x+\omega y&=u_2(1-\omega)\beta^3\\x+\omega^2y&=u_3(1-\omega)\gamma^3\end{align}\tag{4}$$
With $\alpha,\beta,\gamma$ having no common factor. Taking norms we get $(x+y)^2=3N(\alpha)^3$, therefore $3\mid N(\alpha)$, and so $9\mid x+y$. Let $k$ be the highest power such that $3^k\mid x+y$, $k\geq 2$. We can then write
$$\begin{align}(x+y)^3&\equiv_{3^{3k}} 0\\x^3+3xy(x+y)+y^3&\equiv_{3^{3k}} 0\\xy(x+y)&\equiv_{3^{3k-1}} 0\end{align}\tag{5}$$
Therefore either $3\mid x$ or $3\mid y$. This implies that $3\mid x,y,z$. Contradiction.
Therefore all three factors are relatively prime, and we may write
$$x+y=u_1\alpha^3\\x+\omega y=u_2\beta^3\\x+\omega^2 y= u_3\gamma^3\tag{6}$$
Notice that since $(x+y)+\omega (x+\omega y)+\omega^2(x+\omega^2 y)=0$, we also have $$u_1\alpha^3+\omega u_2\beta^3+\omega^2 u_3\gamma^3=0\tag{7}$$
Now, reduce eq. $(7)$ modulo $(1-\omega)^2$. We're then working over the ring $\Bbb Z[\omega]/(1-\omega)^2$. Since $(1-\omega)^2=(3)$, we have $$\Bbb Z[\omega]/(1-\omega)^2\cong\Bbb Z_3[\omega]\cong\Bbb Z_9\tag{8}$$
In this ring we observe:
A unit $u\in\Bbb Z[\omega]$ is still a unit $\Bbb Z[\omega]/(1-\omega)^2$
Proof: We prove a stronger result. Let $R$ be any ring with multiplicative identity $1\in R$, and $I\subseteq R$ any ideal of $R$. Let $\phi$ be the canonical map $$\phi: R\twoheadrightarrow R/I$$
Suppose $u\in R^\times$ is a unit. Then $1=\phi(1)=\phi(uu^{-1})=\phi(u)\phi(u^{-1})$, so the image of $u$, $\phi(u)$, is a unit in $R/I$.
Suppose $u\in\Bbb Z_9$ is a unit. Then $u^3=\pm 1$.
Proof: Either note that for every unit $u\in\Bbb Z_9$ we have $$u^{\phi(9)}-1\equiv_9 u^6-1\equiv_9 (u^3-1)(u^3+1)\equiv_9 0$$ so it's impossible for both factors to be divisible by $3$, since that would imply $(u^3+1)-(u^3-1)\equiv_3 0$. Or make a table of all the units in $\Bbb Z_9$ and calculate the corresponding cubes:
$$\begin{array} {|r|r|}\hline u & 1 & 2 & 4 & 5 & 7 & 8 \\ \hline u^3 & 1 & -1 & 1 & -1 & 1 & -1\\\hline\end{array}$$
We can now conclude:
Notice in eq. $(6)$ that $\alpha,\beta,\gamma\not\in (1-\omega)$, so they must be units in $\Bbb Z[\omega]/(1-\omega)^2$. Eq. $(7)$ now reduces to the sum of three terms who with value $\pm 1$ modulo $9$ $$(-1)^a+(-1)^b+(-1)^c\equiv_9 0$$ This is impossible.