Theorem 1 (Wiles). For $a, b, c$ nonzero integers and $n \gt 2$, we have $a^n + b^n \neq c^n$.
Here is a sketch of the argument. The case $n = 4$ was handled by Fermat and $n = 3$ was handled by Euler. So we only need to worry about $n = \ell$ an odd prime greater than $3$. We can assume that $a, b, c$ are relatively prime, and we can assume that $b$ is even, $a$ and $c$ odd. We can assume that $a \equiv -1 \bmod{4}$ because we can replace everything by its negative.
Frey’s remarkable trick was to look at the elliptic curve $$ E \colon y^2 = x (x-a^\ell) (x + b^\ell). $$ This has bad reduction at $p$ if and only $p$ divides $a^\ell b^\ell (a^\ell + b^\ell)$, if and only if $p$ divides $abc$. Its $j$-invariant is $$ j = \frac{2^8 (a^{2\ell} + b^{2\ell} + a^\ell b^\ell)}{(abc)^{2\ell}}. $$ From this we see that all the bad reductions are multiplicative reductions, and in fact they are semistable reductions; if $p$ odd divides $a$ then $$ y^2 = x^2 (x+b^\ell) $$ and similarly for $p$ dividing $b$ or $c$. For $p = 2$, we have to be a bit careful and make a change of coordinates $x = 4X$ and $y = 8Y + 4X$ to get $$ Y^2 + XY = X^3 + \frac{1}{4} (b^\ell - (1 + a^\ell)) X^2 - \frac{a^\ell b^\ell}{16} X. $$ In both cases $a \equiv -1 \pmod{8}$ or $a \equiv 3 \pmod{8}$ we have a single double point.
So by Tate’s theory, for $p \mid abc$ we can describe $$ E(\bar{\mathbb{Q}}_ p) = (\bar{\mathbb{Q}}_ p^\times / q^\mathbb{Z}) \otimes \delta $$ for some character $\delta \colon G_{\mathbb{Q}_ p} \to \lbrace \pm 1 \rbrace$. We can compute $q$ using $$ j = q^{-1} + 744 + \sum_{n=1}^\infty c_n q^n $$ where $c_n \in \mathbb{Z}$ and $q \in p\mathbb{Z}_ p$. So $v_p(j) = v_p(q^{-1})$. From this we compute that $$ v_p(q) \equiv 0 \pmod{2\ell} \text{ for odd } p, \quad v_2(q) \equiv -8 \pmod{2\ell}. $$
We now consider the $\ell$-torsion points $$ \bar{r}_ {E,\ell} \colon G_\mathbb{Q} \to \mathrm{GL}_ 2(\mathbb{Z}/\ell\mathbb{Z}). $$ This is unramified at $p$ when $p \nmid \ell abc$. If $\ell \nmid abc$, we still have $E$ unramified over $\ell$ and then have either $$ \bar{r}_ {E,\ell} \vert_{G_{\mathbb{Q}_ \ell}} = \operatorname{Ind}_ {G_{\mathbb{Q}_ {\ell^2}}}^{G_{\mathbb{Q}_ \ell}} \bar{\theta}, \quad \bar{\theta} \colon G_{\mathbb{Q}_ {\ell^2}}^\mathrm{ab} \to \mathbb{F}_ {\ell^2}^\times $$ in the supersingular case and $$ \bar{r}_ {E,\ell} \vert_{G_{\mathbb{Q}_ \ell}} = \begin{pmatrix} \bar{\chi}^{-1} \bar{\epsilon}_ \ell & \ast \br 0 & \bar{\chi} \end{pmatrix} $$ in the ordinary case, where $\epsilon_\ell$ is the cyclotomic character and $\bar{\chi}$ is an unramified character. In this case, the restriction to the inertia is $$ \bar{r}_ {E,\ell} \vert_{G_{\mathbb{Q}_ \ell^\mathrm{unr}}} = \begin{pmatrix} \bar{\epsilon}_ \ell & b \br 0 & 1 \end{pmatrix}, \quad b \in Z^1(I_{\mathbb{Q}_ \ell}, \mathbb{F}_ \ell(\bar{\epsilon}_ \ell)). $$ Here, the class $[b]$ lies in $$ [b] \in H^1(I_{\mathbb{Q}_ \ell}, \mathbb{F}_ \ell(\bar{\epsilon}_ \ell)) \cong \mathbb{Q}_ \ell^\mathrm{unr} / (\mathbb{Q}_ \ell^{\mathrm{unr} \times})^\ell, $$ and it further lies in $\mathcal{O}_ {\mathbb{Q}_ \ell^\mathrm{unr}}^\times / (\mathcal{O}_ {\mathbb{Q}_ \ell^\mathrm{unr}}^\times)^\ell$ because the elliptic curve is unramified. Moreover, $[b]$ up to $\mathbb{F}_ \ell^\times$ is independent of the choice of basis.
When $p \mid abc$, then we have $$ E[\ell](\bar{\mathbb{Q}}_ p) = (\bar{\mathbb{Q}}_ p^\times / q^\mathbb{Z}) [\ell] \otimes \delta $$ for $\delta$ unramified with $\delta^2 = 1$. Choosing the basis $\zeta_\ell$ and $q^{1/\ell}$ we see that $$ \bar{r}_ {E,\ell} \vert_{G_{\mathbb{Q}_ p}} = \begin{pmatrix} \bar{\epsilon}_ \ell & b \br 0 & 1 \end{pmatrix} \otimes \delta, $$ where the class $[b]$ corresponds to $$ q \in (\mathbb{Q}_ p^\times / (\mathbb{Q}_ p^\times)^\ell) / \mathbb{F}_ \ell^\times. $$ If $p$ is not $2, \ell$, then $q$ is congruent to a unit modulo $\ell$th powers because $\ell$ divides $v_p(q)$. Therefore this is an unramified representation. If $p = 2$ this is ramified, and the ramification index is $\ell$, i.e., $I_2$ surjects onto $\lbrace (\begin{smallmatrix} 1 & \mathbb{F}_ \ell \br 0 & 1 \end{smallmatrix}) \rbrace$. In the case when $p = \ell$ then $[b]$ corresponds to an element of $\mathbb{Z}_ \ell^\times$.
Proposition 2. The Galois representation $\bar{r}_ {E,\ell} \colon G_\mathbb{Q} \to \mathrm{GL}_ 2(\mathbb{Z}/\ell\mathbb{Z})$ is unramified away from $2\ell$. Moreover, we have $$ \bar{r}_ {E,\ell} \colon I_2 \to \biggl\lbrace \begin{pmatrix} 1 & \mathbb{F}_ \ell \br 0 & 1 \end{pmatrix} \biggr\rbrace $$ and moreover $$ \bar{r}_ {E,\ell} \vert_{I_\ell} = \operatorname{Ind}_ {G_{\mathbb{Q}_ {\ell^2}}}^{G_{\mathbb{Q}_ \ell}} \bar{\theta} \text{ or } \begin{pmatrix} \bar{\chi}^{-1} \bar{\epsilon}_ \ell & b \br 0 & \bar{\chi} \end{pmatrix} $$ where $\bar{\chi}$ is unramified and $b$ corresponds to an element of $\mathcal{O}_ {\mathbb{Q}_ \ell^\mathrm{unr}}^\times / (\mathcal{O}_ {\mathbb{Q}_ \ell^\mathrm{unr}}^\times)^\ell$. (Such representations are called peu ramifiée.)
Proof.
This is what we have shown from the above discussion.
From the following two theorems, we will get a contradiction and thus a proof of Fermat’s last theorem. The first is the main theorem of this course, while the second is a theorem of Mazur.
Theorem 3. For $\ell \ge 3$, any such $\bar{r}$ is reducible.
Theorem 4 (Mazur). If $\ell \gt 3$ and $\lvert E\lbrack 2 \rbrack(\mathbb{Q}) \rvert = 4$ for some elliptic curve $E/\mathbb{Q}$, then $\bar{r}_ {E,\ell}$ is irreducible.