[proofplan]
We argue by contradiction. From a nontrivial primitive solution $a^p+b^p=c^p$ we attach the Frey elliptic curve $E_{a,b,p}$ and cite the Frey-Ribet local calculation, which supplies semistability, irreducibility of the residual representation, and the precise lowered residual conductor. If $E_{a,b,p}$ were modular, [Ribet's level-lowering theorem](/page/Ribet%27s%20Level-Lowering%20Theorem) would remove the odd primes forced by the primitive Fermat solution and produce a weight-$2$ newform of level $2$. Since the dimension formula for modular curves gives no weight-$2$ cusp forms of level $2$, this contradiction proves that the Frey curve is not modular.
[/proofplan]
[step:Attach the Frey curve to the primitive solution]
Let $a,b,c \in \mathbb{Z}$ be nonzero pairwise coprime integers satisfying
\begin{align*}
a^p+b^p=c^p,
\end{align*}
where $p$ is an odd prime. Define the associated Frey curve $E_{a,b,p}$ over $\mathbb{Q}$ by the Weierstrass equation
\begin{align*}
E_{a,b,p}: y^2=x(x-a^p)(x+b^p).
\end{align*}
This is an elliptic curve because its three roots $0$, $a^p$, and $-b^p$ are distinct: if two of them coincided, then one of $a,b,c$ would be zero, contradicting nontriviality.
The discriminant of this Weierstrass model is
\begin{align*}
\Delta(E_{a,b,p})=16a^{2p}b^{2p}c^{2p}.
\end{align*}
Indeed, for a cubic with roots $0$, $a^p$, and $-b^p$, the cubic discriminant is
\begin{align*}
(0-a^p)^2(0+b^p)^2(a^p+b^p)^2=a^{2p}b^{2p}c^{2p},
\end{align*}
and the discriminant of the equation $y^2=$ cubic is $16$ times the cubic discriminant.
[/step]
[step:Record the Frey-Ribet arithmetic input for the residual representation]
Let $\overline{\mathbb{Q}}$ denote a fixed [algebraic closure](/page/Algebraic%20Closure) of $\mathbb{Q}$, and let
\begin{align*}
G_{\mathbb{Q}} := \operatorname{Gal}(\overline{\mathbb{Q}}/\mathbb{Q})
\end{align*}
be the absolute [Galois group](/page/Galois%20Group) of $\mathbb{Q}$. Let $\mathbb{F}_p$ denote the finite field with $p$ elements. For the elliptic curve $E=E_{a,b,p}$, let $E[p]$ denote its $p$-torsion subgroup over $\overline{\mathbb{Q}}$; after choosing an $\mathbb{F}_p$-basis of the two-dimensional [vector space](/page/Vector%20Space) $E[p]$, the Galois action gives the residual representation
\begin{align*}
\rho_{E,p}: G_{\mathbb{Q}} &\to \operatorname{GL}(E[p]) \cong \operatorname{GL}_2(\mathbb{F}_p),
\end{align*}
where $\operatorname{GL}(E[p])$ is the group of $\mathbb{F}_p$-linear automorphisms of $E[p]$ and $\operatorname{GL}_2(\mathbb{F}_p)$ is the group of invertible $2 \times 2$ matrices over $\mathbb{F}_p$.
We use the Frey-Ribet local calculation for primitive Fermat triples: because $a$, $b$, and $c$ are pairwise coprime, the curve $E$ is semistable, every odd prime $\ell$ dividing $abc$ is a prime of multiplicative reduction, the exponent of $\ell$ in the minimal discriminant of $E$ is divisible by $p$, the representation $\rho_{E,p}$ is irreducible, and the residual conductor after deleting the Ribet-removable odd primes is exactly $2$. Here the residual conductor means the Artin conductor of $\rho_{E,p}$ after the primes at which level lowering applies have been removed; it is not the same object as the conductor of the elliptic curve $E$ before level lowering. The prime $2$ remains because the Frey curve has unavoidable bad reduction at $2$ in this construction.
Thus the deep arithmetic input supplies exactly the hypotheses needed later: irreducibility of $\rho_{E,p}$, semistable multiplicative reduction at each odd prime dividing $abc$, $p$-divisibility of the corresponding minimal-discriminant exponents, and lowered residual conductor $2$.
[guided]
We isolate the arithmetic input because it is not a formal consequence of the displayed discriminant alone. Let $\overline{\mathbb{Q}}$ be a fixed algebraic closure of $\mathbb{Q}$, and define
\begin{align*}
G_{\mathbb{Q}} := \operatorname{Gal}(\overline{\mathbb{Q}}/\mathbb{Q}).
\end{align*}
Let $\mathbb{F}_p$ be the finite field with $p$ elements. The subgroup $E[p] \subset E(\overline{\mathbb{Q}})$ of $p$-torsion points is a two-dimensional vector space over $\mathbb{F}_p$. Choosing an $\mathbb{F}_p$-basis identifies its automorphism group with $\operatorname{GL}_2(\mathbb{F}_p)$, the group of invertible $2 \times 2$ matrices over $\mathbb{F}_p$, and the Galois action on torsion points defines
\begin{align*}
\rho_{E,p}: G_{\mathbb{Q}} &\to \operatorname{GL}(E[p]) \cong \operatorname{GL}_2(\mathbb{F}_p).
\end{align*}
This is the residual representation attached to $E$ modulo $p$.
The needed Frey-curve arithmetic is the Frey-Ribet local calculation for a primitive solution $a^p+b^p=c^p$. The pairwise coprimality of $a$, $b$, and $c$ enters here: it prevents an odd prime from dividing two of $a$, $b$, and $c$ simultaneously, so the local reduction type and minimal-discriminant exponent at each odd prime dividing $abc$ have the special semistable form used in level lowering. The calculation gives five facts: $E$ is semistable; each odd prime $\ell \mid abc$ is a prime of multiplicative reduction; the exponent of $\ell$ in the minimal discriminant of $E$ is divisible by $p$; $\rho_{E,p}$ is irreducible; and, after the Ribet-removable odd primes are deleted, the residual Artin conductor is $2$.
This last conductor statement must be read carefully. The conductor of the elliptic curve before level lowering contains the bad odd primes dividing $abc$ as well as the contribution at $2$. The residual conductor relevant to Ribet's theorem is the conductor of the mod-$p$ representation after the primes satisfying the level-lowering local criterion have been removed. For this Frey curve, all such odd primes are removed and the contribution at $2$ remains, so the lowered residual conductor is exactly $2$.
[/guided]
[/step]
[step:Assume modularity and apply Ribet's theorem with the verified residual conductor]
Assume, for contradiction, that $E_{a,b,p}$ is modular. A newform here means a normalized cuspidal Hecke eigenform new at its level. Modularity of $E$ gives a weight-$2$ newform $f$ of level equal to the conductor of $E$ such that the mod-$p$ Galois representation attached to $f$ is isomorphic to $\rho_{E,p}$.
We apply [Ribet's level-lowering theorem](/page/Ribet%27s%20Level-Lowering%20Theorem) to the irreducible residual representation $\rho_{E,p}$. The hypotheses are exactly those recorded in the previous step: $\rho_{E,p}$ arises from a modular weight-$2$ form by the assumed modularity of $E$; it is irreducible; at every odd prime $\ell \mid abc$ the Frey curve is semistable with multiplicative reduction and the minimal-discriminant exponent is divisible by $p$; and the remaining residual conductor, including the local condition at $p$ and the possible small-prime case $p=3$, is the Frey-Ribet conductor $2$. Therefore Ribet's theorem produces a weight-$2$ newform $g$ of level $2$ whose attached mod-$p$ Galois representation is isomorphic to $\rho_{E,p}$.
[guided]
Assume that $E_{a,b,p}$ is modular. By modularity of an elliptic curve over $\mathbb{Q}$, the Galois representations attached to $E$ agree with those attached to a weight-$2$ modular form of level equal to the conductor of $E$. Passing to $p$-torsion gives a residual mod-$p$ representation, so there is a weight-$2$ newform $f$ whose attached residual representation is isomorphic to $\rho_{E,p}$. A newform means a normalized cuspidal Hecke eigenform that is new at its level.
We now apply [Ribet's level-lowering theorem](/page/Ribet%27s%20Level-Lowering%20Theorem). The theorem applies to irreducible residual representations arising from modular forms and lowers the level by deleting primes satisfying its local ramification criterion. We verify these hypotheses in this situation. First, $\rho_{E,p}$ is modular because it comes from the modular elliptic curve $E$ under the contradiction hypothesis. Second, $\rho_{E,p}$ is irreducible by the Frey-Ribet arithmetic input. Third, for each odd prime $\ell$ dividing $abc$, the same input gives semistable multiplicative reduction at $\ell$ and divisibility by $p$ of the exponent of $\ell$ in the minimal discriminant. This is the local condition that makes $\ell$ removable from the residual level. Fourth, the local condition at $p$ and the exceptional small-prime issue when $p=3$ are included in the Frey-Ribet conductor calculation, whose conclusion is that the lowered residual conductor is $2$.
After Ribet's theorem deletes all removable odd primes dividing $abc$, no odd prime remains in the lowered conductor, and the contribution at $2$ remains. Hence the theorem produces a weight-$2$ newform $g$ of level $2$ whose attached mod-$p$ Galois representation is isomorphic to $\rho_{E,p}$.
[/guided]
[/step]
[step:Use the vanishing of weight-$2$ cusp forms of level $2$]
Let $\Gamma_0(2) \subset \operatorname{SL}_2(\mathbb{Z})$ denote the congruence subgroup of matrices whose lower-left entry is divisible by $2$, and let $S_2(\Gamma_0(2))$ denote the complex vector space of weight-$2$ cusp forms for $\Gamma_0(2)$. By the dimension formula for modular forms, equivalently by the fact that the modular curve $X_0(2)$ has genus $0$, one has
\begin{align*}
\dim_{\mathbb{C}} S_2(\Gamma_0(2))=0.
\end{align*}
Therefore there are no weight-$2$ newforms of level $2$. This contradicts the existence of the newform $g$ obtained by level lowering.
Hence the assumption that $E_{a,b,p}$ is modular is false. Therefore the associated Frey curve is not modular.
[/step]