%  Wiles' proof of Fermat's Last Theorem
%     by K. Rubin and A. Silverberg
%
%     November, 1993
%
% This file should be typeset with AMS-LaTeX.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentstyle{amsart}

\newtheorem{thm}{Theorem}[section]
\newtheorem{lem}[thm]{Lemma}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{conj}[thm]{Conjecture}
\newtheorem{flt}{Fermat's Last Theorem}
\renewcommand{\theflt}{}
\newtheorem{ts}{Taniyama-Shimura Conjecture}
\renewcommand{\thets}{}
\theoremstyle{definition}
\newtheorem{defn}{Definition}
\renewcommand{\thedefn}{}
\theoremstyle{remark}
\newtheorem{rem}{Remark}
\newtheorem{rems}{Remarks}
\newtheorem{ex}{Example}
\newtheorem{exs}{Examples}
\renewcommand{\therem}{}
\renewcommand{\therems}{}
\renewcommand{\theex}{}
\renewcommand{\theexs}{}
\newenvironment{mylist}{\begin{list}{$\bullet$}{
     \setlength{\leftmargin}{2.6 em}
     \setlength{\labelsep}{.4 em}
     \setlength{\labelwidth}{2.2 em}
     \setlength{\rightmargin}{0 em}}}{\end{list}}
\newenvironment{fermatquote}{\begin{list}{}{
     \setlength{\leftmargin}{1.5 em}
     \setlength{\rightmargin}{1.5 em}
     \setlength{\topsep}{.07 in}
     \setlength{\listparindent}{\parindent}}}{\end{list}}

\def\Q{{\bold Q}}
\def\Z{{\bold Z}}
\def\C{{\bold C}}
\def\O{{\cal O}}
\def\Of{{\cal O}_f}
\def\Ofl{{\cal O}_{f,\lambda}}
\def\D{{\cal D}}
\def\M{{\cal M}}
\def\J{{\cal J}}
\def\L{{\cal L}}
\def\cc{{\cal C}}
\def\m{{\frak m}}
\def\q{{\cal Q}}
\def\a{{\frak a}}
\def\p{{\frak p}}
\def\P{{\cal P}}
\def\psubr{{\frak p}_R}
\def\psubt{{\frak p}_\T}
\def\l{{\lambda}}
\def\g{{\gamma}}
\def\n{{\eta}}
\def\j{{\varphi}}
\def\e{{\varepsilon}}
\def\eps{{\epsilon}}
\def\wp{{\omega_p}}
\def\y{{\psi}}
\def\kd{{\theta_d}}
\def\kdi{\theta_{d_i}}
\def\H{{\frak H}}
\def\Mhat{{\hat M}}
\def\T{{\bold T}}
\def\Vn{V_n}
\def\Zp{{\bold Z}_p}
\def\Qp{{\bold Q}_p}
\def\Fp{{\bold F}_p}
\def\F{{\bold F}}
\def\Fq{{\bold F}_q}
\def\mup{{\boldsymbol \mu}_p}
\def\mn{{\boldsymbol \mu}_m}
\def\GQ{G_\Q}
\def\Gal{\mathrm{Gal}}
\def\Hom{\mathrm{Hom}}
\def\Ad{\mathrm{Ad}}
\def\det{\mathrm{det}}
\def\im{\mathrm{Im}}
\def\trace{\mathrm{trace}}
\def\ker{\mathrm{ker}}
\def\res{\mathrm{res}}
\def\invq{\mathrm{inv}_q}
\def\GL2{\mathrm{GL}_2}
\def\SL2{\mathrm{SL}_2}
\def\PGL2{\mathrm{PGL}_2}
\def\Sym2{\mathrm{Sym}^2}
\def\Frobq{\mathrm{Frob}_q}
\def\Frobmq{\mathrm{Frob}_\q}
\def\Dmin{\D_{\mathrm{min}}}
\def\isom{\; {\buildrel \sim \over \rightarrow} \;}
\def\invlim{\underleftarrow{\lim}}
\def\ABCD{\bigl(\begin{smallmatrix} a&b\\c&d \end{smallmatrix}\bigr)}
\def\fexp{\sum_{n=1}^{\infty}a_ne^{2 \pi inz}}
\def\sls{{S_\L^*}}
\def\Jqs{{J_q^*}}
\def\FLT{Fermat's Last Theorem }

\def\r{{\rho}}
\def\rb{{\bar\rho}}
\def\rhomod#1{{\rb_{E,#1}}}
\def\rhopmod#1{{\rb_{E',#1}}}
\def\rhoEp{{\r_{E,p}}}
\def\rfl{{\rho_{f,\l}}}

\def\ld{{\cal h}}
\def\rd{{\cal i}}

\def\downdiag#1#2#3#4#5{
   \begin{center}
   \begin{picture}(85,50)
   \put(5,40){\makebox(0,0){$\GQ$}}
   \put(80,40){\makebox(0,0){$\GL2(#1)$}}
   \put(80,5){\makebox(0,0){$\GL2(#2)$}}
   \put(18,40){\vector(1,0){38}}
   \put(80,30){\vector(0,-1){15}}
   \put(18,33){\vector(2,-1){41}}
   \put(37,44){\makebox(0,0)[b]{\scriptsize $[#3]$}}
   \put(36,18){\makebox(0,0)[r]{\scriptsize $[#4]$}}
   \put(83,24){\makebox(0,0)[l]{\scriptsize $#5$}}
   \end{picture}
   \end{center}}

\def\updiag#1#2#3#4#5{
   \begin{center}
   \begin{picture}(85,45)
   \put(5,5){\makebox(0,0){$\GQ$}}
   \put(80,5){\makebox(0,0){$\GL2(#2)$}}
   \put(80,40){\makebox(0,0){$\GL2(#1)$}}
   \put(18,5){\vector(1,0){40}}
   \put(80,30){\vector(0,-1){15}}
   \put(18,16){\vector(2,1){37}}
   \put(38,2){\makebox(0,0)[t]{\scriptsize $[#4]$}}
   \put(32,28){\makebox(0,0)[br]{\scriptsize $[#3]$}}
   \put(83,24){\makebox(0,0)[l]{\scriptsize $#5$}}
   \end{picture}
   \end{center}}


\hyphenation{quad-ra-tum}
\hyphenation{quad-ra-to-quad-ra-tos}

\title{Wiles' proof of Fermat's Last Theorem}
\author[K. Rubin]{K. Rubin}
\address{Department of Mathematics, Ohio State University, Columbus, Ohio 43210}
\email{rubin\char`\@math.ohio-state.edu}
\author[A. Silverberg]{A. Silverberg}
\address{Department of Mathematics, Ohio State University, Columbus, Ohio 43210}
\email{silver\char`\@math.ohio-state.edu}

\thanks{The authors thank the NSF for financial support.}

\setlength{\textwidth}{120mm}
\setlength{\textheight}{195mm}

\begin{document}

\maketitle
\baselineskip=13pt

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% intro

\section*{Introduction}  

On June 23, 1993, Andrew Wiles wrote on a blackboard, before an 
audience at the Newton Institute in Cambridge, England, that if $p$
is a prime number, $u$, $v$, and $w$ are rational numbers, and 
$u^p + v^p + w^p = 0$, then $uvw = 0$.  In other words, he announced that 
he could prove Fermat's Last Theorem.  His announcement came at the end 
of his series of three talks entitled ``Modular forms, elliptic curves, and Galois 
representations'' at the week-long workshop on 
``$p$-adic Galois representations, Iwasawa theory, and 
the Tamagawa numbers of motives''.

In the margin of his copy of the works of Diophantus, next to a problem on 
Pythagorean triples, Pierre de Fermat (1601 - 1665) wrote: 
\begin{fermatquote}
\item \hskip\listparindent 
{\em Cubem autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et 
generaliter nullam in infinitum ultra quadratum potestatem in duos ejusdem 
nominis fas est dividere: cujus rei demonstrationem mirabilem sane detexi. Hanc 
marginis exiguitas non caparet.}  

(It is impossible to separate a cube into two cubes, 
or a fourth power into two fourth powers, or in general, any power higher than the 
second into two like powers.  I have discovered a truly marvelous proof of this, 
which this margin is too narrow to contain.)
\end{fermatquote}
We restate Fermat's conjecture as follows.

\begin{flt}
If $n > 2$, then $a^n + b^n = c^n$ has no solutions in nonzero 
integers $a$, $b$, and $c$.
\end{flt}

A proof by Fermat has never been found, and the problem remained open, spurring 
number theorists to ever greater heights. For details on the history of Fermat's 
Last Theorem (last because it is the last of Fermat's questions to be 
answered) see \cite{Dickson}, \cite{Edwards}, and \cite{Ribenboim}.

What Andrew Wiles announced in Cambridge was that he could prove ``many'' 
elliptic curves  are modular, sufficiently many to imply Fermat's Last Theorem.  In 
this paper we will explain Wiles' result and its connection with Fermat's 
Last Theorem.  In \S\ref{ellipticcurves} we introduce elliptic curves and 
modularity, and give the connection 
between  Fermat's Last Theorem and the Taniyama-Shimura Conjecture on the modularity 
of elliptic curves.  
In \S\ref{overview} we describe how Wiles reduces the proof of the Taniyama-Shimura
conjecture to what we call the Modular Lifting Conjecture 
(which can be viewed as a weak form of the
Taniyama-Shimura Conjecture), by using a theorem of Langlands and Tunnell.
In \S\ref{representations}  
and \S\ref{universal} we show how the Modular Lifting Conjecture is related to
a conjecture of Mazur on deformations 
of Galois representations (Conjecture \ref{M}), and in \S\ref{proof} we describe Wiles' 
method of attack on this conjecture.  Although he does not  prove the
full Mazur Conjecture (and thus does not prove the full Taniyama-Shimura 
Conjecture), Wiles' result (Theorem \ref{BW}) implies enough of the Modular
Lifting Conjecture to prove Fermat's Last Theorem. 

Much of this report is based on notes from Wiles' lectures in Cambridge. The authors
apologize for any errors we may have introduced. We also apologize to those
whose mathematical contributions we, due to our incomplete understanding, do not
properly acknowledge.

As this paper is being completed (early November 1993), Wiles' proof is being
checked by referees. Because of the great interest in this subject and the
lack of a publicly available manuscript, we hope this report will be useful
to the mathematics community.

In order to make this survey as accessible as possible to non-specialists,
the more technical details are postponed as long as possible, some of them to
the Appendices.

The integers, rational numbers, complex numbers, and $p$-adic integers
will be denoted $\Z$, $\Q$, $\C$, and $\Z_p$, respectively. 
If $F$ is a field, then ${\bar F}$ denotes an
algebraic closure of $F$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ellipticcurves

\section{Connection between \FLT and elliptic curves}
\label{ellipticcurves}

\subsection{\FLT follows from the modularity of elliptic curves}
\label{mec}

Suppose \FLT were false.  Then there would exist nonzero 
integers $a$, $b$, $c$, and  $n > 2$, such that $a^n + b^n = c^n$.  It is
easy to see that no generality is lost by assuming that $n$ is a prime
greater than three (or greater than four million, by \cite{Buhler}; 
see \cite{Hardy-Wright} for $n = 3$ and $4$), and that
$a$ and $b$ are relatively prime.  Write down the cubic curve:
\begin{equation}
\label{ell}
	y^2 = x(x + a^n)(x - b^n).
\end{equation}

In \S\ref{E} we will see that such curves are elliptic curves, and in
\S\ref{m1} we will explain what it means for an elliptic curve to be
modular. Kenneth Ribet \cite{Ribet} proved that if $n$ is a prime greater 
than three, $a$, $b$, and $c$ are nonzero integers,
and $a^n + b^n = c^n$, then the elliptic curve $(\ref{ell})$
is not modular.

\begin{thm}[Wiles]
\label{W}
If $A$ and $B$ are distinct, non-zero, relatively prime integers, and 
$AB(A-B)$ is divisible by $16$, then the elliptic curve 
$$
y^2 = x(x + A)(x + B)
$$
is modular.
\end{thm}

Taking $A = a^n$ and $B = -b^n$ with $a$, $b$, $c$, and $n$ coming from
our hypothetical solution to a Fermat equation as above, we see that
the conditions of Theorem \ref{W} are satisfied since $n \geq 5$ and
one of $a$, $b$, and $c$ is even.  Thus Theorem \ref{W} and Ribet's result
together imply Fermat's Last Theorem!

\subsection{History}
The story of the connection between \FLT and elliptic curves begins in
1955, when Yutaka Taniyama (1927 - 1958) posed problems which may be
viewed as a weaker version of
the following conjecture (see \cite{Shimura-obit}).

\begin{ts}
Every elliptic curve over $\Q$ is modular.
\end{ts}

The conjecture in the present form was made by Goro Shimura around 1962-64, 
and has become better understood due to work of Shimura \cite{Shimura1}, 
\cite{Shimura2}, \cite{Shimura-red-book}, \cite{Shimura3}, \cite{Shimura4} 
and of Andr\'e Weil \cite{Weil} (see also \cite{Eichler}). 

Beginning in the late 1960's (\cite{H1}, \cite{H2}, \cite{H3}, 
\cite{H4}), Yves Hellegouarch 
connected Fermat equations $a^n + b^n = c^n$ with elliptic curves of the form
(1), and used results about \FLT
to prove results about elliptic curves.  The landscape changed abruptly
in 1985 when Gerhard Frey stated in a lecture at Oberwolfach that
elliptic curves arising from counterexamples to \FLT could not be modular
\cite{Frey}.  Shortly thereafter Ribet \cite{Ribet} proved this, following ideas of 
Jean-Pierre Serre \cite{Serre} (see \cite{Oesterle} for a survey). In other words,
``Taniyama-Shimura Conjecture $\Rightarrow$ Fermat's Last Theorem''.  

Thus, the stage was set. A proof of the Taniyama-Shimura Conjecture
(or enough of it to know that elliptic curves coming 
from Fermat equations are modular)
would be a proof of Fermat's Last Theorem.

\subsection{Elliptic curves}  
\label{E}

\begin{defn}
An {\em elliptic curve} over $\Q$ is a nonsingular curve defined by an
equation of the form
\begin{equation}
\label{wf}
		y^2 + a_1xy + a_3y  = x^3 + a_2x^2 + a_4x + a_6
\end{equation}
where the coefficients $a_i$ are integers.  The solution
$(\infty,\infty)$ will be viewed as a point on the elliptic curve.
\end{defn}

\begin{rems}
(i) A {\em singular point} on a curve $f(x,y) = 0$ is a point where 
both partial derivatives vanish.  A curve is {\em nonsingular} if it has no
singular points.

\noindent (ii) Two elliptic curves over $\Q$ are {\em
isomorphic} if one can be obtained from the other by changing
coordinates $x = A^2x' + B$, $y = A^3y' + Cx' + D$, with $A$, $B$, $C$,
$D \in \Q$, and dividing through by $A^6$.

\noindent (iii) Every elliptic curve over $\Q$ is isomorphic to one of the
form
$$
		y^2  = x^3 + a_2x^2 + a_4x + a_6
$$
with integers $a_i$.  A curve of this form is nonsingular if and 
only if the cubic on the right side has no repeated roots.
\end{rems}

\begin{ex}
The equation $y^2 = x(x + 3^2)(x - 4^2)$ defines an elliptic curve
over $\Q$.
\end{ex}

\subsection{Modularity}  
\label{m1}
Let $\H$ denote the complex upper half plane 
$\{z \in \C : \im(z) > 0\}$ where $\im(z)$ is the imaginary part of $z$.  
If $N$ is a positive integer, define a group of matrices
$$
\Gamma_0(N) = \bigl\{\ABCD \in SL_2(\Z) : {\text{$c$ is divisible by $N$}} \bigr\}.
$$
The group $\Gamma_0(N)$ acts on $\H$ by linear fractional transformations
$
\ABCD(z)= {{az+b} \over {cz+d}}.
$
The quotient space $\H/\Gamma_0(N)$ is a (non-compact) Riemann
surface.  It can be completed to a compact Riemann surface, denoted
$X_0(N)$, by adjoining the cusps, which are the finitely many
equivalence classes of $\Q \cup \{i\infty\}$ under the action of
$\Gamma_0(N)$ (see Chapter 1 of \cite{Shimura-red-book}).  
The complex points of an elliptic curve can also be viewed as a 
compact Riemann surface.

\begin{defn}
An elliptic curve $E$ is {\em modular} if, for some integer $N$, there
is a holomorphic map from $X_0(N)$ onto $E$.
\end{defn}

\begin{ex}
There is a (holomorphic) isomorphism from $X_0(15)$ onto the elliptic curve 
$y^2 = x(x + 3^2)(x - 4^2)$.
\end{ex}

\begin{rem}
There are many equivalent definitions of modularity (see {\S}II.4.D of 
\cite{Oesterle} and appendix of \cite{Mazur}). In some cases the equivalence
is a deep result. For Wiles' proof of Fermat's Last Theorem it suffices to
use only the definition given in \S \ref{mdeftwo} below.
\end{rem}

\subsection{Semistability}
\label{ss}

\begin{defn}
An elliptic curve over $\Q$ is {\em semistable at the prime} $q$ if it is 
isomorphic to an elliptic curve over $\Q$ 
which modulo $q$ either is nonsingular or has a singular point with
two distinct tangent directions.  An elliptic curve over $\Q$ is called 
{\em semistable} if it is semistable at every prime.
\end{defn}

\begin{ex}
The elliptic curve $y^2 = x(x + 3^2)(x - 4^2)$ is semistable because it
is isomorphic to $y^2+xy+y = x^3+x^2-10x-10$, but the elliptic 
curve $y^2 = x(x + 4^2)(x - 3^2)$ is not semistable (it is not semistable at 2).
\end{ex}

In \S\ref{fr} (Theorem \ref{BW}) we state Wiles' main result, and explain 
how it implies the following theorem.

\begin{thm}[Wiles]
\label{SS}
Every semistable elliptic curve over $\Q$ is modular.
\end{thm}

If  $A$  and  $B$  are distinct, nonzero, relatively prime integers write 
$E_{A,B}$ for the elliptic curve defined by  $y^2 = x(x+A)(x+B)$.  
Since $E_{A,B}$ and $E_{-A,-B}$ are 
isomorphic over the complex numbers (i.e., as Riemann surfaces), $E_{A,B}$ is 
modular if and only if $E_{-A,-B}$ is modular.  If further 
$AB(A-B)$ is divisible by  16, then either $E_{A,B}$ or $E_{-A,-B}$ is 
semistable (this is easy to check directly; see for example {\S}I.1
of \cite{Oesterle}), and therefore 
both are modular by Theorem \ref{SS}.  Thus Theorem \ref{SS}
implies Theorem \ref{W}, and hence Fermat's Last Theorem.

\subsection{Modular forms}  
\label{modforms}
In this paper we will work with a definition of 
modularity which uses modular forms. 

\begin{defn}
\label{mf}
If $N$ is a positive integer, a {\em modular form} $f$ of
weight $k$ for $\Gamma_0(N)$ is a holomorphic function $f : \H \to \C$ which
satisfies 
\begin{equation}
\label{transf}
f(\gamma(z)) = (cz+d)^kf(z)  {\text{~for every~}} \gamma = 
\bigl( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \bigr) 
\in \Gamma_0(N){\text{~and~}} z \in \H,
\end{equation}
and is holomorphic at the cusps (see Chapter 2 of \cite{Shimura-red-book}).  
\end{defn}

A modular form $f$ satisfies $f(z) = f(z+1)$ (apply (\ref{transf})  to
$\bigl({\begin{smallmatrix} 1&1\\0&1 \end{smallmatrix}}\bigr) \in \Gamma_0(N)$),
so it has a Fourier expansion
$f(z) = \sum_{n=0}^{\infty}a_ne^{2 \pi inz}$,  with complex numbers 
$a_n$ and with $n \geq 0$
because $f$ is holomorphic at the cusp $i\infty$.
We say $f$ is a {\em cusp form} if it vanishes at all the cusps; 
in particular for a cusp form the coefficient $a_0$ (the value at
$i\infty$) is zero.  Call a cusp form {\em normalized} if $a_1 = 1$.

 For fixed $N$ there are commuting linear operators (called {\em Hecke operators}) 
$T_m$, for integers $m \geq 1$, on the vector space of cusp forms of weight two 
for $\Gamma_0(N)$
(see Chapter 3 of \cite{Shimura-red-book}).  If $f(z) = \fexp$ then
\begin{equation}
\label{tm}
T_mf(z) = \sum_{n=1}^\infty \bigl(\sum_{{(d,N)=1}\atop {d \mid (n,m)}}
da_{{nm}/{d^2}}\bigr) e^{2\pi inz}
\end{equation}
where $(a,b)$ denotes the greatest common divisor of $a$ and $b$ and $a\mid b$
means that $a$ divides $b$. 
The {\em Hecke algebra} $T(N)$ is the ring generated by these operators.
	 
\begin{defn}
In this paper an {\em eigenform} will mean a normalized cusp form of weight two 
for some $\Gamma_0(N)$ which is an eigenfunction for all the Hecke operators.  
\end{defn}

By (\ref{tm}), if $f(z) = \fexp$ is an eigenform then $T_mf = a_mf$ for all $m$.

\subsection{Modularity, revisited}
\label{mdeftwo}
Suppose  $E$  is an elliptic curve
over  $\Q$.  If $p$ is a prime, write $\Fp$ for the finite field with
$p$ elements, and let $E(\Fp)$ denote the $\Fp$-solutions of the equation
for $E$ (including the point at infinity).  
We now give a second definition of modularity for an elliptic curve.  

\begin{defn}
\label{m2}
An elliptic curve $E$ over $\Q$ is {\em modular} if there exists an
eigenform  $\fexp$ such that for all but finitely many primes $q$,
\begin{equation}
\label{mdlr}
a_q  =  q + 1 - \#(E(\Fq)).
\end{equation}
\end{defn}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% overview

\section{An overview}
\label{overview}

The flowchart (Figure 1) shows how \FLT would follow if one knew
the Modular Lifting Conjecture (Conjecture \ref{ME} below) for the
primes $3$ and $5$. In \S\ref{mec} we discussed the upper arrow, i.e., the implication
``Taniyama-Shimura Conjecture $\Rightarrow$ Fermat's Last Theorem''. In this
section we will discuss the other implications in the flowchart. 
The implication given by the lowest arrow is straightforward 
(Proposition \ref{irredat3}), while the middle one uses an ingenious
idea of Wiles (Proposition \ref{redat3}). 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% flowchart

\thicklines

\begin{figure}[ht]
\begin{center}
\begin{picture}(305,250)

\put(120,210){\framebox(130,30){Fermat's Last Theorem}}
\put(185,185){\vector(0,1){20}}
\put(125,140){\framebox(120,40){\parbox{2in}{\begin{center} 
     Taniyama-Shimura \\ Conjecture \end{center}}}}
\put(185,115){\vector(0,1){20}}
\put(170,100){\line(1,1){15}}
\put(200,100){\line(-1,1){15}}
\put(65,70){\framebox(100,40){\parbox{2in}{\begin{center} 
     Taniyama-Shimura \\ for $\rhomod{3}$ irreducible \end{center}}}}
\put(205,70){\framebox(100,40){\parbox{2in}{\begin{center} 
     Modular Lifting \\ Conjecture for $p = 5$ \end{center}}}}
\put(120,45){\vector(0,1){20}}
\put(105,30){\line(1,1){15}}
\put(135,30){\line(-1,1){15}}
\put(0,0){\framebox(100,40){\parbox{2in}{\begin{center} 
     Tunnell-Langlands \\ Theorem \end{center}}}}
\put(140,0){\framebox(100,40){\parbox{2in}{\begin{center} 
     Modular Lifting \\ Conjecture for $p = 3$ \end{center}}}}

\end{picture}
\end{center}
\caption{Modular Lifting Conjecture $\Rightarrow$ \FLT}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The Modular Lifting Conjecture is still an open problem, even for
the primes $3$ and $5$. However, Wiles proves enough of the Modular Lifting
Conjecture so that, with some additional work, he can still obtain enough
of the Taniyama-Shimura Conjecture to prove Fermat's Last Theorem (see \S\ref{fr}).

\subsection{Modular Lifting Conjecture}
\label{mcec}
Let $\bar\Q$ denote the algebraic closure of $\Q$ in $\C$,
and let $\GQ$ be the Galois group $\Gal(\bar\Q/\Q)$.
If $p$ is a prime, write
$$
\wp : \GQ \to \Fp^\times
$$
for the character giving the action of $\GQ$ on the $p$-th roots of unity.  For 
the facts about elliptic curves stated below see \cite{Silverman}.  
If $E$ is an elliptic curve over $\Q$, and $F$ is a subfield of the complex numbers, 
there is a natural commutative group law on the set of $F$-solutions of $E$, with the 
point at infinity as the identity element.  Denote this group $E(F)$.  
If $p$ is a prime, write  $E[p]$  for the subgroup of points in $E(\bar\Q)$ of order 
dividing  $p$. Then  $E[p] \cong \Fp^2$.  The action of  $\GQ$  on  $E[p]$  
gives a continuous representation  
$$
\rhomod{p} : \GQ  \to  GL_2(\Fp)
$$
(defined up to isomorphism) such that
\begin{equation}
\label{cycl}
\det(\rhomod{p}) = \wp
\end{equation}
and for all but finitely many primes $q$,
\begin{equation}
\label{es}
\trace(\rhomod{p}(\Frobq)) \equiv q + 1 - \#(E(\Fq))  \pmod{p}.
\end{equation}
(See Appendix \ref{A1} for the definition of the Frobenius elements $\Frobq \in \GQ$ 
attached to each prime number $q$.)

If  $f(z) = \fexp$ is an
eigenform, let  $\Of$ denote the ring of integers of the number field
$\Q(a_2, a_3, \ldots)$.  

The following conjecture is in the spirit of a conjecture of Mazur (see
Conjecture \ref{M1}).

\begin{conj}[Modular Lifting Conjecture]
\label{ME}
Suppose $p$ is a prime and  $E$  is an elliptic curve over $\Q$ satisfying
\begin{mylist}
\item[\normalshape{(a)}] $\rhomod{p}$  is irreducible,
\item[\normalshape{(b)}] there are an eigenform $f(z) = \fexp$ and a 
prime ideal  $\lambda$  of $\Of$ such that 
$p \in \lambda$ and for all but finitely many primes $q$,
$$
a_q  \equiv  q + 1 - \#(E(\Fq))   \pmod{\lambda}.
$$
\end{mylist}
Then  $E$  is modular.
\end{conj}

Wiles does not prove the full Modular Lifting Conjecture, 
but proves it subject to some additional hypotheses on  $\rhomod{p}$.

The Modular Lifting Conjecture is {\em a priori} weaker than the 
Taniyama-Shimura Conjecture because 
of the extra hypotheses (a) and (b).  The more serious condition is (b); 
there is no known way to produce such a form in general.  But when  
$p = 3$  the existence of such a form follows from the theorem below of 
Tunnell \cite{Tunnell} and Langlands \cite{Langlands}.  Wiles 
then gets around condition (a) by a clever argument (described below) 
which, when  $\rhomod{3}$  is not irreducible, allows him to use  $p = 5$  instead.

\subsection{Langlands-Tunnell Theorem}
In order to state the Langlands-Tunnell Theorem, we need weight one modular
forms for a subgroup of $\Gamma_0(N)$.  Let
$$
\Gamma_1(N) = \bigl\{\ABCD \in SL_2(\Z) : c \equiv 0 \!\pmod{N},\; 
a \equiv d \equiv 1 \!\pmod{N}\bigr\}.
$$
Replacing $\Gamma_0(N)$ by $\Gamma_1(N)$ in \S \ref{modforms}, one can
define the notion of cusp forms on $\Gamma_1(N)$. See Chapter 3 of 
\cite{Shimura-red-book} for the definitions of the Hecke operators on the
space of weight one cusp forms for $\Gamma_1(N)$.

\begin{thm}[Langlands-Tunnell]
\label{LT}
Suppose  $\rho : \GQ  \to  \GL2(\C)$  is a continuous irreducible
representation whose image in  $\PGL2(\C)$  is 
a subgroup of  $S_4$ (the symmetric group on four elements),  $\tau$ is
complex conjugation, and $\det(\rho(\tau)) = -1$. Then there is a weight one   
cusp form $\sum_{n=1}^{\infty}b_ne^{2 \pi inz}$ for some $\Gamma_1(N)$, which
is an eigenfunction for all the corresponding Hecke operators, such that for 
all but finitely many primes  $q$,
\begin{equation}
\label{LTform}
b_q  =  \trace(\rho(\Frobq)).
\end{equation}
\end{thm}

The theorem as stated by Langlands \cite{Langlands} 
and by Tunnell \cite{Tunnell} produces an automorphic 
representation, rather than a cusp form.  Using the fact that 
$\det(\rho(\tau)) = -1$, standard techniques (see for example 
\cite{Gelbart}) show that this automorphic representation corresponds to a 
weight one cusp form as in Theorem \ref{LT}.

\subsection{Modular Lifting Conjecture $\Rightarrow$ Taniyama-Shimura Conjecture}

\begin{prop}
\label{irredat3}
Suppose the Modular Lifting Conjecture is true for  $p = 3$, $E$  is an 
elliptic curve, and  $\rhomod{3}$  is irreducible.  Then  $E$  is modular.
\end{prop}

\begin{pf}
It suffices to show that hypothesis (b) of the Modular Lifting Conjecture is 
satisfied with the given curve  $E$, for  $p = 3$.  
There is a  faithful representation
$$
\psi : \GL2(\F_3)  \hookrightarrow  \GL2(\Z[\sqrt{-2}])  \subset  \GL2(\C)
$$
such that for every $g \in \GL2(\F_3)$,
\begin{equation}
\label{trace}
\trace(\psi(g)) \equiv \trace(g)  \pmod{(1+\sqrt{-2})}
\end{equation}
and
\begin{equation}
\label{det}
\det(\psi(g)) \equiv \det(g)  \pmod{3}.
\end{equation}
(Explicitly, $\psi$ can be given by 
$\psi(\alpha) = \bigl(\begin{smallmatrix}-1&1\\-1&0\end{smallmatrix}\bigr)$ and 
$\psi(\beta) = \bigl(\begin{smallmatrix}\sqrt{-2}&1\\1&0\end{smallmatrix}\bigr)$
where $\alpha = \bigl(\begin{smallmatrix}-1&1\\-1&0\end{smallmatrix}\bigr)$ and 
$\beta = \bigl(\begin{smallmatrix}1&-1\\1&1\end{smallmatrix}\bigr)$ 
generate $\GL2(\F_3)$.)
Let $\rho = \psi \circ \rhomod{3}$.
If $\tau$ is complex conjugation
then it follows from (\ref{cycl}) and (\ref{det}) that $\det(\rho(\tau)) = -1$.
The image of  $\psi$  in  $\PGL2(\C)$  is a subgroup of $\PGL2(\F_3) \cong S_4$.  
Using that $\rhomod{3}$ is irreducible one can show that $\r$ is irreducible.

Let $\p$ be a prime of $\bar\Q$ containing $1+\sqrt{-2}$.
Let $g(z) = \sum_{n=1}^{\infty}b_ne^{2 \pi inz}$ be a weight one cusp form
for some $\Gamma_1(N)$ obtained by applying the Langlands-Tunnell Theorem 
(Theorem \ref{LT}) to $\rho$.  The function
$$
{\bold E}(z) = 1 + 6\sum_{n=1}^\infty \sum_{d \mid n} \chi(d)e^{2\pi inz}
\quad{\text{where}}\quad
 \chi(d) = \left\{
\begin{array}{rl}
0 & \text{if $d \equiv 0 \pmod{3}$} \\
1 & \text{if $d \equiv 1 \pmod{3}$} \\
-1 & \text{if $d \equiv 2 \pmod{3}$}
\end{array}
\right.
$$
is a weight one modular form for $\Gamma_1(3)$. The product 
$g(z){\bold E}(z) = \sum_{n=1}^{\infty}c_ne^{2 \pi inz}$
is a weight two cusp form for $\Gamma_0(N)$ with $c_n \equiv b_n \pmod{\p}$ for
all $n$.  It is now possible to find an 
eigenform $f(z) = \fexp$ on $\Gamma_0(N)$
such that $a_n  \equiv  b_n \pmod{\p}$ for every  $n$ 
(see \S 6.10 of \cite{Deligne-Serre}).
By (\ref{es}), (\ref{LTform}) and (\ref{trace}),  
$f$  satisfies (b) of the Modular Lifting Conjecture with $p = 3$ and
with $\lambda = \p \cap \Of$.
\end{pf}

\begin{prop}[Wiles]
\label{redat3}
Suppose the Modular Lifting Conjecture is true for  $p = 3$  and  $5$,  
$E$  is an elliptic curve 
over $\Q$, and  $\rhomod{3}$  is reducible.  Then  $E$  is modular.
\end{prop}

\begin{pf}
The elliptic curves over $\Q$ for which both  $\rhomod{3}$  and  
$\rhomod{5}$  are reducible are all known to be modular 
(see Appendix \ref{app1}).  
Thus we can suppose  $\rhomod{5}$  is irreducible.  It suffices to produce an 
eigenform as in (b) of the Modular Lifting Conjecture,
but this time there is no analogue of the Langlands-Tunnell
Theorem to help.  Wiles uses the Hilbert Irreducibility Theorem, applied 
to a parameter space of elliptic curves, 
to produce another elliptic curve  $E'$  over $\Q$ satisfying
\begin{mylist}
\item[(i)]  $\rhopmod{5}$  is isomorphic to  $\rhomod{5}$, and
\item[(ii)]  $\rhopmod{3}$  is irreducible.
\end{mylist}
(In fact there will be infinitely many such  $E'$; see Appendix \ref{app2}.)  
Now by Proposition \ref{irredat3},  $E'$  is modular.  Let  
$f(z) = \fexp$  be a corresponding eigenform.  Then for all 
but finitely many primes $q$,
\begin{multline*}
a_q  =  q + 1 - \#(E'(\Fq))  \equiv  \trace(\rhopmod{5}(\Frobq))  \cr
 \equiv  \trace(\rhomod{5}(\Frobq))  \equiv  q + 1 - \#(E(\Fq))  \pmod{5}
\end{multline*}
by (\ref{es}).  Thus the form  $f$  satisfies hypothesis (b) of  
the Modular Lifting Conjecture and we conclude that  $E$  is modular.
\end{pf}

Taken together Propositions \ref{irredat3} and \ref{redat3} show that 
the Modular Lifting Conjecture
for  $p = 3$  and  $5$  implies the Taniyama-Shimura Conjecture.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% representations

\section{Galois representations}
\label{representations}
The next step is to translate the Modular Lifting Conjecture into a
conjecture (Conjecture \ref{M1}) about the modularity of liftings of
Galois representations. Throughout this paper, if $A$ is a topological ring,
a representation $\rho : \GQ \to GL_2(A)$ will mean a continuous homomorphism
and $[\r]$ will denote the isomorphism class of $\r$.
If $p$ is a prime, let
$$\e_p : \GQ \to \Zp^\times$$  
be the character giving the action of $\GQ$ on $p$-power roots of unity.

\subsection{The $p$-adic representation attached to an elliptic curve}
Suppose  $E$  is an elliptic curve over  $\Q$ and $p$ is a prime number.  For 
every positive integer $n$, write  $E[p^n]$  for the 
subgroup  in  $E(\bar\Q)$ of points of order dividing $p^n$  
and  $T_p(E)$  for the inverse limit of the  $E[p^n]$ with respect to
multiplication by  $p$.  For every  $n$,  $E[p^n] \cong (\Z/p^n\Z)^2$,  
and so  $T_p(E) \cong \Zp^2$. The action of  $\GQ$ induces a representation  
$$
\rhoEp : \GQ  \to  \GL2(\Zp)
$$
such that $\det(\rhoEp) = \e_p$ and
for all but finitely many primes $q$,
\begin{equation}
\label{truees}
\trace(\rhoEp(\Frobq)) = q + 1 - \#(E(\Fq)).
\end{equation}
Composing $\rhoEp$ with the reduction map from $\Zp$ 
to $\Fp$ gives $\rhomod{p}$ of \S\ref{mcec}.

\subsection{Modular representations}
\label{mr}

If  $f$ is an eigenform and $\lambda$ is a prime ideal of $\Of$, let
$\Ofl$ denote the completion of $\Of$ at $\lambda$.

\begin{defn}
If $A$ is a ring, a  representation  $\rho : \GQ \to \GL2(A)$ is called
{\em modular} if there are an eigenform $f(z) = \fexp$, a ring $A'$ 
containing $A$, and a homomorphism  $\iota : \Of \to A'$ 
such that for all but finitely many primes  $q$,
$$
\trace(\rho(\Frobq))  =  \iota(a_q).
$$
\end{defn}

\begin{exs}
(i)  Given an eigenform $f(z) = \fexp$ and a prime ideal 
$\lambda$  of  $\Of$,  Eichler and Shimura (see \S 7.6 of 
\cite{Shimura-red-book}) constructed a representation
$$
\rfl : \GQ  \to  \GL2(\Ofl)
$$
such that $\det(\rfl) = \e_p$ (where $\lambda \cap \Z = p\Z$) and for all but 
finitely many primes $q$,
\begin{equation}
\label{fcoeffs}
\trace(\rfl(\Frobq)) = a_q.
\end{equation}
Thus $\rfl$ is modular with $\iota$ taken to be the inclusion of 
$\Of$ in $\Ofl$.

\noindent
(ii)  Suppose $p$ is a prime and $E$ is an elliptic curve over $\Q$. If
$E$ is modular, then $\rhoEp$ and $\rhomod{p}$ are modular by 
(\ref{truees}), (\ref{es}), and
(\ref{mdlr}).  Conversely, if $\rhoEp$ is modular then 
it follows from (\ref{truees}) that $E$ is modular.  This proves the
following.
\end{exs}
\begin{thm}
\label{mods}
Suppose  $E$  is an elliptic curve over $\Q$.  Then
\begin{center}  
$E$  is modular  $\Leftrightarrow$  $\rhoEp$  is modular for every  $p$ 
$\Leftrightarrow$  $\rhoEp$  is modular for one  $p$.
\end{center}
\end{thm}

\begin{rem}
In this language, the Modular Lifting Conjecture says that if $E$ is an
elliptic curve over $\Q$ and $\rhomod{p}$ is modular and irreducible,
then $\rhoEp$ is modular.
\end{rem}

\subsection{Liftings of Galois representations}
 Fix a prime $p$ and a finite field  $k$ of characteristic $p$. Recall that
${\bar k}$ denotes an algebraic closure of $k$.

Given a map $\phi : A \to B$, the induced map from $\GL2(A)$ to $\GL2(B)$ will
also be denoted $\phi$.

If $\rho : \GQ \to GL_2(A)$ is a representation and $A'$ is a ring containing
$A$, we write $\rho \otimes A'$ for the composition of $\rho$ with the 
inclusion of $GL_2(A)$ in $GL_2(A')$.

\begin{defn}
If  $\rb : \GQ \to \GL2(k)$ is a representation, we say that a representation
$\r : \GQ \to \GL2(A)$  is a {\em lifting} of  $\rb$ (to $A$) if $A$  is a 
complete noetherian local $\Zp$-algebra and there exists a homomorphism
$\iota : A \to {\bar k}$ such that the diagram
\updiag{A}{\bar k}{\r}{\rb\otimes\bar k}{\iota}
commutes.
\end{defn}

\begin{rem}
Since $[\r]$ and $[\rb]$ are isomorphism classes of
representations, the above diagram means that
$\iota \circ \r$ is isomorphic to $\rb \otimes {\bar k}$.
\end{rem}

\begin{exs}
(i) If $E$ is an elliptic curve then $\rhoEp$ is a lifting of $\rhomod{p}$.

\noindent
(ii) If $E$ is an elliptic curve, $p$ is a prime, and hypotheses (a) and
(b) of Conjecture \ref{ME} hold with an eigenform $f$ and prime ideal 
$\lambda$, then $\rfl$ is a lifting of $\rhomod{p}$.
\end{exs}

\subsection{Deformation data}
We will be interested not in all liftings of a given
$\rb$,  but rather in those satisfying
various restrictions.  See Appendix \ref{A1} for the definition of the inertia 
groups $I_q \subset \GQ$ associated to primes $q$.  
We say that a representation  $\rho$ of $\GQ$ is {\em unramified} at a 
prime  $q$  if  $\rho(I_q) = 1$.  If  $\Sigma$  is a set of 
primes we say $\r$  is 
{\em unramified outside of  $\Sigma$}  if  $\rho$  is 
unramified at every  $q \notin \Sigma$.

\begin{defn}
By {\em deformation data} we mean a pair  
$$
\D  =  (\Sigma, t)
$$
where $\Sigma$ is a finite set of primes and $t$ is one of the words 
{\em ordinary} or {\em flat}.
\end{defn}

If $A$ is a $\Z_p$-algebra, let
$\e_A : \GQ \to \Zp^\times \to A^\times$  be the composition of the
cyclotomic character $\e_p$ with the structure map.

\begin{defn}
Given deformation data $\D$, a representation 
$\rho : \GQ \to \GL2(A)$ is {\em type}-$\D$ if $A$ is a complete noetherian
local $\Z_p$-algebra, $\det(\rho) = \e_A$, $\rho$  is unramified outside of  $\Sigma$,
and $\rho$ is $t$ at $p$ (where $t \in$ \{ordinary, flat\};
see Appendix \ref{A2}).
\end{defn}

\begin{defn}
A representation  $\rb : \GQ \to GL_2(k)$  is {\em $\D$-modular} if 
there are an eigenform  $f$ and a prime ideal  $\lambda$ of $\Of$
such that $\rfl$ is a type-$\D$ lifting of $\rb$.  
\end{defn}

\begin{rems}
(i) A representation with a type-$\D$ lifting must itself be
type-$\D$. Therefore if a representation is $\D$-modular then it is both  
type-$\D$  and modular.

\noindent
(ii) Conversely, if $\rb$ is type-$\D$, modular, and satisfies (i) and (iii)
of Theorem \ref{BW} below, then $\rb$ is $\D$-modular, by work of Ribet and 
others (see \cite{Ribetreport}).  This plays an important role in Wiles' 
proof of Theorem \ref{BW}.
\end{rems}

\subsection{Mazur Conjecture}

\begin{defn}
A representation $\rb : \GQ \to \GL2(k)$  is called {\em absolutely 
irreducible} if ${\bar {\rho}} \otimes {\bar k}$ is irreducible.
\end{defn}

The following variant of a conjecture of 
Mazur (see Conjecture 18 of \cite{Mazur-Tilouine}; see also Conjecture \ref{M}
below) implies the Semistable Modular Lifting Conjecture stated below.

\begin{conj}[Mazur]
\label{M1}
Suppose $p$ is an odd prime, $k$ is a finite field of characteristic $p$,
$\D$ is deformation data, and  $\rb : \GQ \to \GL2(k)$  is an absolutely irreducible 
$\D$-modular representation.  Then every type-$\D$ lifting of $\rb$ to 
the ring of integers of a finite extension of $\Qp$ is modular.
\end{conj}

\begin{rem}
Loosely speaking, Conjecture \ref{M1} says that if $\rb$ is modular
then every lifting which ``looks modular'' is modular. 
\end{rem}

\begin{conj}[Semistable Modular Lifting Conjecture]
\label{MME}
\hfil Suppose $p$ is an odd prime and $E$ is a semistable elliptic curve over $\Q$ 
satisfying {\normalshape (a)} 
and {\normalshape (b)} of the Modular Lifting Conjecture $($Conjecture \ref{ME}$)$.  
Then $E$ is modular.
\end{conj}

\begin{prop}
\label{cccc}
Conjecture \ref{M1} implies Conjecture \ref{MME}.
\end{prop}

\begin{pf}
Suppose $p$ is an odd prime and $E$ is a semistable elliptic curve over $\Q$ 
which satisfies  (a) and (b) of 
Conjecture \ref{ME}. We will apply Conjecture \ref{M1} with $\rb = \rhomod{p}$.  
Write $\tau$  for complex conjugation.  Then  $\tau^2 = 1$,  and by
(\ref{cycl}),  $\det(\rhomod{p}(\tau)) = -1$.  Since $\rhomod{p}$ is
irreducible and $p$ is odd, a simple linear algebra argument now shows 
that $\rhomod{p}$ is absolutely irreducible.

Since $E$ satisfies (b) of Conjecture \ref{ME}, $\rhomod{p}$ is modular. Let
\begin{itemize}
\item $\Sigma = \{ p \} \cup \{{\text{primes $q$}} : {\text{$E$ has singular reduction 
modulo $q$}} \}$,
\item $t =$ {\em ordinary} if $E$ is ordinary or singular modulo $p$, \\
$t =$ {\em flat} if $E$ is supersingular modulo $p$ \\
(see \cite{Silverman} for definitions of ordinary and supersingular), 
\item $\D = (\Sigma,t)$.
\end{itemize}
Using the semistability of $E$ one can show that
$\rhoEp$ is a type-$\D$ lifting of $\rhomod{p}$ and
(by combining results of several people; see \cite{Ribetreport})
that $\rhomod{p}$ is $\D$-modular.
Conjecture \ref{M1} then says $\rhoEp$ is modular. By Theorem \ref{mods},
$E$ is modular.
\end{pf}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% universal

\section{Mazur's deformation theory}
\label{universal}
Next we reformulate Conjecture \ref{M1} as a conjecture (Conjecture \ref{M})
that the algebras which parametrize liftings and modular liftings of a
given representation are isomorphic. It is this form of Mazur's conjecture
that Wiles attacks directly.

\subsection{The universal deformation algebra $R$}
 Fix an odd prime $p$, a finite field $k$ of characteristic $p$, deformation
data $\D$, and an absolutely irreducible type-$\D$ representation
$\rb : \GQ \to \GL2(k)$. Suppose $\O$ is the ring of integers of a finite
extension of $\Qp$ with residue field $k$.

\begin{defn}
We say $\r : \GQ \to \GL2(A)$ is a {\em $(\D,\O)$-lifting} of $\rb$ if 
$\r$ is type-$\D$, $A$ is a
complete noetherian local $\O$-algebra with residue field $k$, and 
the following diagram commutes
\updiag{A}{k}{\r}{\rb}{}
where the vertical map is reduction modulo the maximal ideal of $A$.
\end{defn}

\begin{thm}[Mazur-Ramakrishna]
\label{MR}
With $p$, $k$, $\D$, $\rb$, and $\O$ as above,  there are an
$\O$-algebra  $R$  and a  $(\D,\O)$-lifting
$\r_R : \GQ  \to  \GL2(R)$
of  $\rb$, with the property that for every  $(\D,\O)$-lifting  
$\r$  of  $\rb$ to $A$  there is
a unique $\O$-algebra homomorphism  $\phi_\r : R \to A$  such that 
the diagram 
\downdiag{R}{A}{\r_R}{\r}{\phi_\r}
commutes.
\end{thm}

This theorem was proved by Mazur \cite{Mazur-def} in the
case when  $\D$  is ordinary and by Ramakrishna \cite{Ramakrishna} when  $\D$  
is flat.  Theorem \ref{MR} determines $R$ and $\r_R$ up to isomorphism.

\subsection{The universal modular deformation algebra $\T$}
\label{hecke}
 Fix an odd prime $p$, a finite field $k$ of characteristic $p$, deformation
data $\D$, and an absolutely irreducible type-$\D$ representation
$\rb : \GQ \to \GL2(k)$. Assume $\rb$ is $\D$-modular, and fix
an eigenform $f$ and a prime ideal $\l$ of $\Of$ such that
$\rfl$ is a type-$\D$ lifting of $\rb$.  Suppose in addition that $\O$ is
the ring of integers of a finite extension of $\Qp$ with residue field $k$,
$\Ofl \subseteq \O$, and the diagram
\updiag{\Ofl}{k}{\rfl}{\rb}{}
commutes, where the vertical map is the reduction map.

Under these assumptions $\rfl \otimes \O$ is a $(\D,\O)$-lifting of $\rb$,
and Wiles constructs a generalized 
Hecke algebra  $\T$ which has the following properties.
\begin{mylist}
\item[$(\T1)$]  $\T$  is a complete noetherian local $\O$-algebra with residue
field $k$.
\item[$(\T2)$]  There are an integer $N$ divisible only by primes in $\Sigma$
and a homomorphism from the Hecke algebra $T(N)$ to $\T$ such that $\T$ is
generated over  $\O$  by the images of the Hecke operators  
$T_q$ for primes $q \notin \Sigma$.  By abuse of notation we write $T_q$ also 
for its image in $\T$.
\item[$(\T3)$]  There is a $(\D,\O)$-lifting
$$
\r_\T : \GQ \to \GL2(\T)
$$
of $\rb$  with the property that
$\trace(\r_\T(\Frobq))  =  T_q$ for every prime  $q \notin \Sigma$.
\item[$(\T4)$] If  $\r$ is modular and is a $(\D,\O)$-lifting of $\rb$ to $A$, then
there is a unique $\O$-algebra homomorphism  $\psi_\r : \T \to A$  such that 
the diagram
\downdiag{\T}{A}{\r_\T}{\r}{\psi_\r}
commutes.
\end{mylist}

Since  $\r_\T$   is a $(\D,\O)$-lifting of  $\rb$,  by Theorem \ref{MR} there is a
homomorphism
$$  
\j  : R \to \T
$$
such that  $\r_\T$ is isomorphic to $\j \circ \r_R$.  By $(\T3)$,  
$\j(\trace(\r_R(\Frobq)))  =  T_q$
for every prime $q \notin \Sigma$, so it follows from $(\T2)$ that  $\j$  
is surjective.

\subsection{Mazur Conjecture, revisited}
Conjecture \ref{M1} can be reformulated in the following way.

\begin{conj}[Mazur]
\label{M}
Suppose $p$, $k$, $\D$, $\rb$, and $\O$ are as in \S\ref{hecke}.
Then the above map $\j : R \to \T$  is an isomorphism.
\end{conj}

Conjecture \ref{M} was stated in \cite{Mazur-Tilouine} (Conjecture 18) for
$\D$ ordinary, and was extended to the flat case by Wiles. 

\begin{prop}
Conjecture \ref{M} implies Conjecture \ref{M1}.
\label{imp}
\end{prop}

\begin{pf}

Suppose $\rb : \GQ  \to  \GL2(k)$ is absolutely irreducible  and $\D$-modular, 
$A$ is the ring of integers of a finite extension of $\Qp$, and
$\r$ is a type-$\D$ lifting of $\rb$ to $A$.
Taking $\O$ to be the ring of integers of a sufficiently large finite extension 
of $\Qp$, and extending $\r$ and $\rb$ to $\O$ and its residue field, 
respectively, we may assume that $\r$ is a
$(\D,\O)$-lifting of $\rb$.  Assuming Conjecture \ref{M}, let
$\psi = \phi_\r \circ \j^{-1} : \T \to A$, with $\phi_\r$ as in
Theorem \ref{MR}. By $(\T3)$ and Theorem \ref{MR}, 
$\psi(T_q) = \trace(\r(\Frobq))$ for all
but finitely many $q$.  By \S 3.5 of \cite{Shimura-red-book}, given such a 
homomorphism $\psi$ (and viewing $A$ as a subring of $\C$)
there is an eigenform  $\fexp$  where  $a_q = \psi(T_q)$ 
for all but finitely many primes $q$.  Thus $\r$ is modular.
\end{pf}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% proof

\section{Wiles' proof of part of the Mazur Conjecture}
\label{proof}
In this section we sketch the major ideas of Wiles' proof of a large
part of Conjecture \ref{M}. The first step (Theorem \ref{WW}), and the
key to Wiles' proof, is to reduce Conjecture \ref{M}
to a bound on the order of the cotangent space at a prime of $R$.
In \S\ref{selmer} we see that the corresponding tangent space is a Selmer
group, and in \S\ref{euler} we outline a general procedure due to Kolyvagin  
for bounding sizes of Selmer groups. The input for Kolyvagin's method is 
known as an Euler system. The most
difficult part of Wiles' proof (\S\ref{geometric}) is his construction of a
suitable Euler system. In \S\ref{fr}
we state Wiles' result and explain why it suffices for proving Theorem \ref{SS}.

 For \S{5} fix $p$, $k$, $\D$, $\rb$, $\O$, $f(z) = \fexp$, and $\l$ as
in \S\ref{hecke}.  

By property $(\T4)$ there is a homomorphism  
$$
\pi : \T  \to   \O
$$
such that  $\pi \circ \r_\T$ is isomorphic to  $\rfl \otimes \O$. By 
property $(\T2)$ and (\ref{fcoeffs}), $\pi$ satisfies $\pi(T_q) = a_q$
for all but finitely many $q$. 

\subsection{Key reduction} 
\label{cot} 
Generalizing a result of Mazur, 
Wiles proves the following (Gorenstein) property of $\T$.

\begin{thm}
\label{gor}
There is a (non-canonical)  $\T$-module isomorphism
$$\Hom_\O(\T, \O) \isom  \T.$$
\end{thm}

Let  $\n$  denote the ideal of  $\O$  generated by the image 
of the element $\pi \in \Hom_\O(\T, \O)$
under the composition
$$
\Hom_\O(\T, \O)   \isom   \T  {\; {\buildrel \pi \over \rightarrow} \;} \O.
$$
The ideal  $\n$  is 
well-defined independent of the choice of isomorphism in Theorem \ref{gor}.

The map $\pi$ determines distinguished prime ideals of  $\T$  and  $R$,
$$
\psubt = \ker(\pi), \qquad  \psubr = \ker(\pi \circ \j) = \j^{-1}(\psubt).
$$

\begin{thm}[Wiles]
\label{WW}
If  
$$
\#(\psubr/\psubr^2) \leq \#(\O/\n) < \infty
$$  
then  $\j : R \to \T$  is an isomorphism.
\end{thm}

The proof is entirely commutative algebra.  The surjectivity of  $\j$  shows 
that  $\#(\psubr/\psubr^2) \geq \#(\psubt/\psubt^2)$,  and Wiles proves  
$\#(\psubt/\psubt^2) \geq \#(\O/\n)$.  Thus if 
$\#(\psubr/\psubr^2) \leq \#(\O/\n)$ then
\begin{equation}
\label{equality}
	\#(\psubr/\psubr^2)  =  \#(\psubt/\psubt^2)  =  \#(\O/\n).
\end{equation}
The first equality in (\ref{equality}) shows that $\j$ induces an isomorphism
of tangent spaces. 
Wiles uses the second equality in (\ref{equality}) and Theorem \ref{gor}
to deduce that  $\T$  is a local complete 
intersection over  $\O$  (see \cite{Hartshorne} for the definition). 
Wiles then combines these two results to prove 
that  $\j$  is an isomorphism.

\subsection{Selmer groups}
\label{selmer}
In general, if  $M$  is a torsion  $\GQ$-module, a Selmer group attached to  $M$  
is a subgroup of the Galois cohomology group  $H^1(\GQ, M)$  determined by 
certain ``local conditions'' in the following way.  If  $q$  is a prime with
decomposition group  $D_q \subset \GQ$, then there is a restriction map
$$
\res_q : H^1(\GQ, M)  \to  H^1(D_q, M).
$$
 For a fixed collection of subgroups  $\J = \{J_q \subseteq H^1(D_q, M) : 
{\text{$q$ prime}}\}$ depending on the particular problem under consideration,
the corresponding Selmer group is
$$
S(M)  =  \bigcap_q \res_q^{-1}(J_q)  \subseteq  H^1(\GQ, M).
$$
Write $H^i(\Q, M)$ for $H^i(\GQ, M)$, and $H^i(\Q_q, M)$ for $H^i(D_q, M)$.  

\begin{ex}
The original examples of Selmer groups come from 
elliptic curves.  Fix an elliptic curve  $E$  and a positive integer  $m$,  
and take  $M 
= E[m]$,  the subgroup of points in  $E(\bar \Q)$  of order dividing  $m$.  
There is a natural inclusion 
\begin{equation}
\label{kummer} 
E(\Q)/mE(\Q)  \hookrightarrow  H^1(\Q, E[m])
\end{equation}
obtained by sending  $x \in E(\Q)$  to the cocycle
$\sigma  \mapsto  \sigma(y) - y$,
where  $y \in E(\bar\Q)$ is any point satisfying  $my = x$.  Similarly, for 
every prime  $q$  there is a natural inclusion
$$
E(\Q_q)/mE(\Q_q)  \hookrightarrow  H^1(\Q_q, E[m]).
$$
Define the Selmer group  $S(E[m])$  in this case by taking  
the group  $J_q$  to be the image of  $E(\Q_q)/mE(\Q_q)$  in  $H^1(\Q_q, E[m])$,
for every  $q$.  
This Selmer group is an important tool in studying the arithmetic of  $E$  
because it contains (via (\ref{kummer}))  $E(\Q)/mE(\Q)$.
\end{ex}

\medskip

Retaining the notation from the beginning of \S\ref{proof}, 
let $\m$ denote the maximal ideal of 
$\O$ and fix a positive integer  $n$.
The tangent space  $\Hom_\O(\psubr/\psubr^2, \O/\m^n)$  can be identified with 
a Selmer group as follows.   

Let  $\Vn$  be the matrix
algebra $\mathrm{M}_2(\O/\m^n)$, with  $\GQ$  acting via the adjoint 
representation $\sigma(B)  =  \rfl(\sigma)B\rfl(\sigma)^{-1}$.
There is a natural injection 
$$
s : \Hom_\O(\psubr/\psubr^2, \O/\m^n) \hookrightarrow H^1(\Q, \Vn)
$$
which is described in Appendix \ref{A3} (see also \S 1.6 of \cite{Mazur-def}).  Wiles 
defines a collection  $\J = \{J_q \subseteq H^1(\Q_q, \Vn)\}$ depending on $\D$. 
Let $S_\D(\Vn)$ denote the associated Selmer group.   
Wiles proves that $s$ induces an isomorphism
$$
\Hom_\O(\psubr/\psubr^2, \O/\m^n)  \isom  S_\D(\Vn).
$$

\subsection{Euler systems}
\label{euler}
We have now reduced the proof of Mazur's conjecture to bounding the size of the 
Selmer groups  $S_\D(\Vn)$.  About five years ago Kolyvagin \cite{Kolyvagin}, 
building on ideas of his own and of Thaine \cite{Thaine}, introduced a 
revolutionary new method for bounding the size of a Selmer group.  This new 
machinery, which is crucial for Wiles' proof, is what we now describe.
	
Suppose  $M$  is a  $\GQ$-module of odd exponent  $m$  and  $\J = \{J_q \subseteq 
H^1(\Q_q, M)\}$  is a system of subgroups with associated Selmer group  
$S(M)$  as in \S\ref{selmer}.  
Let  $\Mhat = \Hom(M, \mn)$, where $\mn$ is the 
group of $m$-th roots of unity.  For every prime $q$, the cup product gives 
a nondegenerate Tate pairing
$$
\ld\;\,,\;\,\rd_q : H^1(\Q_q, M) \times H^1(\Q_q, \Mhat)  \to  H^2(\Q_q, \mn) 
\isom \Z/m\Z
$$
(see Chapters VI and VII of \cite{Cassels-Frohlich}).
If  $c \in H^1(\Q, M)$ and $d \in H^1(\Q, \Mhat)$, then
\begin{equation}
\label{reclaw}
\sum_q \ld\res_q(c),\res_q(d)\rd_q  =  0.
\end{equation}

Suppose that  $\L$  is a finite set of primes.  Let  $\sls \subseteq H^1(\Q, 
\Mhat)$ be the Selmer group given by the local conditions  $\J^* = \{\Jqs 
\subseteq H^1(\Q_q, \Mhat)\}$,  where  
\begin{equation*}
\Jqs = 
\begin{cases}
\text{the orthogonal complement of  $J_q$ under $\ld\;\,,\;\,\rd_q$} &
\text{if $q \notin \L$} \\
H^1(\Q_q, \Mhat) & \text{if $q \in \L$.}
\end{cases}
\end{equation*}
If  $d \in H^1(\Q, \Mhat)$  define
$$
\kd : \prod_{q \in \L} J_q \to \Z/m\Z
$$
by
$$
\kd((c_q))  =  \sum_{q \in \L} \ld c_q,\res_q(d)\rd_q.
$$
Write  $\res_\L : H^1(\Q, M) \to \prod_{q \in \L} H^1(\Q_q, M)$  for the 
product of the restriction maps. By (\ref{reclaw}) and the definition of 
$\Jqs$,
if $d \in \sls$ then  $\res_\L(S(M)) \subseteq \ker(\kd)$.
If in addition $\res_\L$  is injective on $S(M)$ then
$$
\#(S(M)) \leq \#\bigl(\bigcap_{d \in \sls} \ker(\kd)\bigr).  
$$

The difficulty is to produce enough cohomology classes in $\sls$ to show
that the right side of the above inequality is small.  Following
Kolyvagin, an Euler system is a compatible collection of classes 
$\kappa(\L) \in \sls$ for a
large (infinite) collection of sets of primes $\L$. Loosely speaking,
compatible means that if $\ell \notin \L$, then $\kappa(\L \cup \{\ell\})$ is
related to $\res_\ell(\kappa(\L))$.  Once an Euler system is given, Kolyvagin has 
an inductive procedure for choosing a set $\L$ such that
\begin{mylist}
\item $res_\L$  is injective on $S(M)$,
\item $\bigcap_{\P \subseteq \L} \ker(\theta_{\kappa(\P)})$ can be computed 
in terms of $\kappa(\emptyset)$.
\end{mylist}
(Note that if $\P \subseteq \L$ then 
$S_\P^* \subseteq \sls$ so $\kappa(\P) \in \sls$.)

 For several important Selmer groups (including the one defined by Wiles) 
it is possible to construct Euler systems for which Kolyvagin's procedure
produces a set $\L$ actually giving an equality
$$
\#(S(M)) = \#\bigl(\bigcap_{\P \subseteq \L} \ker(\theta_{\kappa(\P)})\bigr).
$$

There are several examples in the literature where this kind of argument is 
worked out in some detail.  For the simplest case, where the Selmer group in 
question is the ideal class group of a real abelian number field 
and the $\kappa(\L)$ are constructed from cyclotomic units, see 
\cite{Rubin-Appendix}.  For other cases involving ideal class groups and Selmer 
groups of elliptic curves, see \cite{Kolyvagin}, \cite{Rubin-Main-Conj}, 
\cite{Rubin-Gauss-Sums}, \cite{Gross}. 

\subsection{Wiles' geometric Euler system}
\label{geometric}  The task now is to construct an 
Euler system of cohomology classes with which to 
\marginpar{\begin{center} \scriptsize{\em Unfortunately, \\ 
space considerations \\ (and our incomplete \\ understanding) make \\ it 
impossible to \\ give the details \\ of Wiles' truly \\ marvelous \\ construction.}
\end{center}}
bound  $\#(S_\D(\Vn))$  using 
Kolyvagin's method.  This is the most technically difficult part
of Wiles' proof.

The first step in the construction is due to Flach \cite{Flach}.  He constructed 
classes  $\kappa(\L) \in \sls$  for sets  $\L$  consisting of just one prime.  This 
allows one to bound the exponent of  $S_\D(\Vn)$,  but not its order.

Every Euler system starts with some explicit, concrete objects.  Earlier 
examples of Euler systems come from cyclotomic or elliptic units, Gauss sums, or 
Heegner points on elliptic curves.  Wiles (following Flach) constructs his 
cohomology classes from modular units, i.e., meromorphic functions on modular 
curves which are holomorphic and nonzero away from the cusps.  More precisely,  
$\kappa(\L)$   comes from an explicit function on the modular curve  $X_1(L, N)$,  the 
curve obtained by taking the quotient space of the upper half plane by the 
action of the group
$$
\Gamma_1(L, N)  =  \{
\bigl( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \bigr) 
\in \SL2(\Z) : c \equiv 0  \pmod{LN},  \quad
a \equiv d \equiv 1  \pmod{L}\},
$$
and adjoining the cusps, where  $L = \prod_{\ell \in \L}\ell$  and where  $N$  
is the $N$ of $(\T2)$ of \S \ref{hecke}.  The construction and study of the
classes $\kappa(\L)$ rely heavily on results of Faltings \cite{Faltings1}, 
\cite{Faltings2} and others.


\subsection{Final result}
\label{fr}
In the end, Wiles is only able to construct an Euler system and prove the 
desired inequality under some extra hypotheses.  Since for ease of exposition
we defined modularity of representations in terms of $\Gamma_0(N)$ instead of
$\Gamma_1(N)$, the theorem stated below is weaker than that stated by
Wiles, but has the same applications to elliptic curves.

Recall that $\wp$ is the character giving the action of $\GQ$ on $\mup$.
If $\rb$ is a representation of $\GQ$ on a vector space $V$, $\Sym2(\rb)$
denotes the representation on the symmetric square of $V$ induced by $\rb$.

\begin{thm}[Wiles]
\label{BW}
Suppose $p$, $k$, $\D$, $\rb$, and $\O$ are as in \S\ref{hecke} and $\rb$
satisfies the following additional conditions:
\begin{mylist}
\item[{\normalshape (i)}]  $\det(\rb) = \wp$,
\item[{\normalshape (ii)}]	$\Sym2(\rb)$  is absolutely irreducible,
\item[{\normalshape (iii)}] if  $\rb$   
is ramified at  $q$  and  $q \neq p$  then the restriction of  
$\rb$ to $D_q$ is reducible,
\item[{\normalshape (iv)}]	if  $p$ is $3$  or  $5$  then for some prime  
$q$,  $p$ divides $\#(\rb(I_q))$.
\end{mylist}
Then $\j : R \to \T$  is an isomorphism.
\end{thm}

Since Wiles does not prove the full Mazur Conjecture (Conjecture \ref{M}) for  
$p = 3$  and  $5$,  we need to reexamine the arguments of \S\ref{overview} to see 
which elliptic curves $E$ can be proved modular using Theorem \ref{BW} applied 
to  $\rhomod{3}$  and  $\rhomod{5}$.

By (\ref{cycl}), hypothesis (i) of Theorem \ref{BW} is satisfied for 
every $\rhomod{p}$.  Hypothesis (ii) will be satisfied if the image of  
$\rhomod{p}$  is sufficiently large in  $\GL2(\Fp)$  (for example, if  
$\rhomod{p}$  is surjective).  For $p = 3$ and $p = 5$, if $\rhomod{p}$
satisfies hypothesis (iv) and is irreducible then it satisfies hypothesis (ii).

If $E$ is semistable, $p$ is an odd prime, and $\rhomod{p}$ is irreducible and
modular, then $\rhomod{p}$ is $\D$-modular
for some $\D$ (see the proof of Proposition \ref{cccc}) and $\rhomod{p}$ satisfies
(iii) and (iv) (use Tate curves; see \S14, Appendix C of \cite{Silverman}).
Therefore by Propositions \ref{imp} and \ref{cccc}, Theorem \ref{BW} implies
that the Semistable Modular Lifting Conjecture (Conjecture \ref{MME}) holds
for $p = 3$ and for $p = 5$.

Using the Langlands-Tunnell Theorem (Theorem \ref{LT}), the same arguments that proved 
Propositions \ref{irredat3} and \ref{redat3} can now be used to prove 
that every semistable elliptic curve over $\Q$ is modular
(Theorem \ref{SS}).  But now the elliptic curve $E'$ satisfying (i) and (ii)
of the proof of Proposition \ref{redat3} should also be chosen $5$-adically
close to $E$ so that it will be semistable.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% appendix

\appendix
\section{Galois groups and Frobenius elements}
\label{A1}
Write  $\GQ = \Gal(\bar\Q/\Q)$.  If  $q$ is a prime number and 
$\q$ is a prime ideal dividing  $q$  in the ring of integers of  
$\bar\Q$, there is a filtration
$$
\GQ  \supset  D_\q  \supset  I_\q
$$
where the decomposition group $D_\q$ and the inertia group $I_\q$ are
defined by
\begin{align*}
D_\q  &=  \{\sigma \in \GQ : \sigma\q = \q\}      \\
I_\q  &=  \{\sigma \in \D_\q : \sigma x \equiv x \pmod{\q}   \text{~for 
all algebraic integers~}  x \}.
\end{align*}
There are natural identifications
$$
	D_\q  \cong  \Gal(\bar{\Q}_q/\Q_q),  \qquad   D_\q/I_\q  \cong  
\Gal(\bar{\F}_q/\F_q),
$$
and  $\Frobmq \in D_\q/I_\q$ denotes the inverse image of the 
canonical generator  $x \mapsto x^q$  of  $\Gal(\bar{\F}_q/\F_q)$.  
If  $\q'$  is another prime ideal above  $q$,  then  $\q' = 
\sigma\q$  for some  $\sigma \in \GQ$  and
$$
	D_{\q'}  =  \sigma D_\q \sigma^{-1}, \qquad  I_{\q'}  =  \sigma 
I_\q\sigma^{-1},  
\qquad \mathrm{Frob}_{\q'}  =  \sigma \Frobmq \sigma^{-1}.
$$
Since we will care about these objects only up to conjugation, 
we will write  $D_q$ and $I_q$.
We will write $\Frobq \in \GQ$ for any representative of a $\Frobmq$.  
If  $\r$ is a representation of  $\GQ$ which is 
unramified at  $q$ then $\trace(\r(\Frobq))$ and $\det(\r(\Frobq))$ 
are well-defined independent of any choices. 

\section{Some details on the proof of Proposition \ref{redat3}}
\subsection{}
\label{app1}
The modular curve $X_0(15)$ can be viewed as a curve defined over $\Q$ in
such a way that the non-cusp rational points correspond to 
isomorphism classes (over $\C$)
of pairs $(E',\cc)$ where $E'$ is an elliptic curve over $\Q$ and 
$\cc \subset E(\bar\Q)$ is a subgroup of order $15$ stable under $\GQ$.
An equation for $X_0(15)$ is  $y^2 = x(x + 3^2)(x - 4^2)$, the elliptic curve
discussed in \S\ref{ellipticcurves}. There are eight rational points on $X_0(15)$,
four of which are cusps. There are four modular elliptic curves, 
corresponding to a modular form for $\Gamma_0(50)$ (see p. 86 of \cite{antwerp}), 
which lie in the four distinct $\C$-isomorphism classes that correspond to the
non-cusp rational points on $X_0(15)$.

Therefore every elliptic curve over $\Q$ with a $\GQ$-stable subgroup of
order $15$ is modular.  Equivalently, if $E$ is an elliptic curve over
$\Q$ and both $\rhomod{3}$ and $\rhomod{5}$ are reducible, then $E$ is
modular.

\subsection{}
\label{app2}
 Fix an elliptic curve $E$ over $\Q$.  We will show that there are infinitely 
many elliptic curves $E'$ over $\Q$ such that
\begin{mylist}
\item[(i)]  $\rhopmod{5}$  is isomorphic to  $\rhomod{5}$, and
\item[(ii)]  $\rhopmod{3}$  is irreducible.
\end{mylist}
 
Let
$$\Gamma(5) = \{\ABCD \in \SL2(\Z) : \ABCD \equiv 
\bigl(\begin{smallmatrix} 1&0 \\ 0&1 \end{smallmatrix}\bigr)
 \pmod{5}\}.$$
Let $X$ be the twist of the classical modular curve $X(5)$ (see
\cite{Shimura-red-book}) by the cocycle induced by $\rhomod{5}$, and let
$S$ be the set of cusps of $X$. Then $X$ is a curve defined over $\Q$
which has the following properties.
\begin{mylist}
\item The rational points on $X-S$ correspond to isomorphism classes of pairs 
$(E',\phi)$ where $E'$ is an elliptic curve over $\Q$ and 
$\phi : E[5] \to E'[5]$ is a $\GQ$-module isomorphism.
\item As a complex manifold $X-S$ is four copies of $\H/\Gamma(5)$, 
so each component of $X$ has genus zero.
\end{mylist}
A curve of genus zero has infinitely many rational points if it has
any.  Since $X$ has a rational point corresponding to $(E,\text{identity})$,
one of the components $X^0$ of $X$ is a curve defined over $\Q$ which
has infinitely many rational points.  We want to show that infinitely many 
of these points correspond 
to elliptic curves $E'$ with $\rhopmod{3}$ irreducible.

There is another modular curve $\hat X$ defined over $\Q$, with a finite 
set $\hat S$ of cusps, which has the following properties.
\begin{mylist}
\item The rational points on ${\hat X}-{\hat S}$ correspond to 
isomorphism classes of triples 
$(E',\phi, \cc)$ where $E'$ is an elliptic curve over $\Q$, 
$\phi : E[5] \to E'[5]$ is a $\GQ$-module isomorphism, and $\cc \subset E'[3]$
is a $\GQ$-stable subgroup of order $3$.
\item As a complex manifold ${\hat X}-{\hat S}$ is four copies of
$\H/(\Gamma(5) \cap \Gamma_0(3))$.
\item The map that forgets the subgroup $\cc$ induces a  
surjective morphism $\theta : {\hat X} \to X$ defined over $\Q$ and of degree 
$[\Gamma(5) : \Gamma(5) \cap \Gamma_0(3)] = 4$.
\end{mylist}

Let ${\hat X}^0$ be the component of ${\hat X}$ which maps to $X^0$.
The function field of $X^0$ is $\Q(t)$, and the function field of ${\hat X}^0$
is $\Q(t)[x]/f(t,x)$ where $f(t,x) \in \Q(t)[x]$ is irreducible and has 
degree $4$ in $x$.  By the Hilbert
Irreducibility Theorem, there are infinitely many values $t' \in \Q$ for 
which $f(t', x)$ is irreducible in $\Q[x]$.  Each such $t'$ corresponds 
to a rational point of $X^0$ which is not the image of a rational point
of ${\hat X}^0$.
In other words, there are infinitely many elliptic curves $E'$ over $\Q$
such that
\begin{mylist}
\item[(i)]  $E'[5] \cong E[5]$ as $\GQ$-modules, and
\item[(ii)]  $E'[3]$ has no subgroup of order $3$ stable under $\GQ$.
\end{mylist}
These are precisely the desired conditions on $E'$.

\section{Representation types}
\label{A2}
Suppose $A$ is a complete noetherian local $\Z_p$-algebra and 
$\rho : \GQ \to \GL2(A)$ is a representation. Write $\rho\mid_{D_p}$ for 
the restriction of $\rho$ to the decomposition group $D_p$.
We say  $\rho$ is

\begin{mylist}
\item {\em ordinary} at $p$ if
$\rho\mid_{D_p}$ is (after a change of basis, if necessary) 
of the form  $\bigl( \begin{smallmatrix} * & * \\ 0 & \chi 
\end{smallmatrix} \bigr)$
where $\chi$ is unramified and the  * are functions from $D_p$ to $A$.
\item {\em flat} at $p$ if $\rho$ is not ordinary, and
for every ideal  $\a$  of finite index in  $A$,  the reduction of
$\rho\mid_{D_p}$ modulo $\a$  is 
the representation associated to the ${\bar \Q}_p$-points of a finite flat group 
scheme over $\Zp$.
\end{mylist}

\section{Selmer groups}
\label{A3}
With notation as in \S\ref{proof} (see especially \S\ref{selmer}), define  
$$
\O_n = \O[\eps]/(\eps^2, \m^n)
$$
where $\eps$ is an indeterminate.  Then  $v  \mapsto  1 + \eps v$ defines 
an isomorphism
\begin{equation}
\label{map}
\Vn  \isom  \{\delta \in \GL2(\O_n) : \delta \equiv 1 \pmod{\eps}\}.
\end{equation}

 For every $\alpha \in \Hom_\O(\psubr/\psubr^2, \O/\m^n)$ there is a 
unique $\O$-algebra homomorphism  $\y_\alpha : R \to \O_n$  whose
restriction to $\psubr$ is $\eps \alpha$.
Composing with the representation $\r_R$ of Theorem \ref{MR} gives a
$(\D,\O)$-lifting $\r_\alpha = \y_\alpha \circ \r_R$  of $\rb$ to $\O_n$.
(In particular $\r_0$ denotes the $(\D,\O)$-lifting obtained when $\alpha = 0$.)
Define a one-cocycle  $c_\alpha$  on  $\GQ$  by
$$
c_\alpha(g)  =  \r_\alpha(g)\r_0(g)^{-1}.
$$
Since  $\r_\alpha \equiv \r_0 \pmod{\eps}$, using (\ref{map}) we can view  
$c_\alpha \in H^1(\Q, \Vn)$.  This defines a homomorphism
$$
s : \Hom_\O(\psubr/\psubr^2, \O/\m^n) \to H^1(\Q, \Vn)
$$
and it is not difficult to see that $s$ is injective.  The fact 
that  $\r_0$ and $\r_\alpha$  are type-$\D$ gives information 
about the restrictions  $\res_q(c_\alpha)$  for various primes  $q$, 
and using this information Wiles defines a Selmer group  $S_\D(\Vn) 
\subset H^1(\Q, \Vn)$ and verifies that $s$ is an isomorphism 
onto  $S_\D(\Vn)$.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% bibl

\begin{thebibliography}{99}

\bibitem{antwerp} Birch, B., Kuyk, W., eds., Modular functions of one variable
IV, vol. 476, Springer-Verlag, New York (1975) 74--144.
\bibitem{Buhler} Buhler, J., Crandall, R., Ernvall, R., Mets\"ankyl\"a, T., 
{\em Irregular Primes and Cyclotomic Invariants to Four Million},
Math. Comp. 61 (1993) 151-153.
\bibitem{Cassels-Frohlich} Cassels, J.W.S., Frohlich, A., Algebraic
number theory, Academic Press, London (1967).
\bibitem{Deligne-Serre} Deligne, P., Serre, J-P., {\em Formes modulaires
de poids $1$}, Ann. Sci. Ec. Norm. Sup. {\bf 7} (1974) 507--530.
\bibitem{Dickson} Dickson, L. E., History of the theory of numbers (Vol. II),
Chelsea Publ. Co., New York (1971).
\bibitem{Edwards} Edwards, H. M., Fermat's Last Theorem. A genetic introduction
to algebraic number theory. Springer-Verlag, New York (1977).
\bibitem{Eichler} Eichler, M., {\em Quatern\"are quadratische Formen und die
Riemannsche Vermutung f\"ur die Kongruenzzetafunktion}, Arch. Math. {\bf 5} 
(1954) 355--366.
\bibitem{Faltings1} Faltings, G., {\em $p$-adic Hodge theory}, J. of the A. M. S.
{\bf 1} (1988) 255--299.
\bibitem{Faltings2} Faltings, G., {\em Crystalline cohomology and $p$-adic
Galois representations}, in Algebraic analysis, geometry and number theory.
Proceedings of the JAMI Inaugural Conference, J. I. Igusa, ed., Johns Hopkins 
University Press, Baltimore (1989) 25--80.
\bibitem{Flach} Flach, M., {\em A finiteness theorem for the symmetric square
of an elliptic curve}, Invent. math. {\bf 109} (1992) 307--327.
\bibitem{Frey} Frey, G., {\em Links between solutions of $A-B=C$ and
elliptic curves}, in Number theory, Ulm 1987, Proceedings, Lecture Notes 
in Math. {\bf 1380}, Springer-Verlag, New York (1989) 31--62.
\bibitem{Gelbart} Gelbart, S., Automorphic forms on adele groups, Ann. of
Math. Studies {\bf 83}, Princeton University Press, Princeton (1975).
\bibitem{Gross} Gross, B., {\em Kolyvagin's work on modular elliptic curves}, in
L-functions and arithmetic, London Math. Soc. Lecture Notes {\bf 153}
(1991) 235--256.
\bibitem{Hardy-Wright} Hardy, G. H., Wright, E. M., An introduction to the theory
of numbers, Fourth edition, Oxford University Press, London (1971). 
\bibitem{Hartshorne} Hartshorne, R., Algebraic geometry, Springer-Verlag, New York
(1977).
\bibitem{H1} Hellegouarch, Y., {\em \'Etude des points d'ordre fini des vari\'et\'es
de dimension un d\'efinies sur un anneau principal}, J. Reine Angew. Math. {\bf 244}
(1970) 20--36. 
\bibitem{H2} Hellegouarch, Y., {\em Points d'ordre fini des vari\'et\'es
de dimension un}, in Colloque de Th\'eorie des Nombres (Univ. Bordeaux, Bordeaux,
1969), Bull. Soc. Math. France, M\'em. {\bf 25}, Soc. Math. France,
Paris (1971)  107--112.
\bibitem{H3} Hellegouarch, Y., {\em Points d'ordre fini sur les courbes elliptiques},
C. R. Acad. Sci. Paris S\'er. A-B {\bf 273} (1971) A540--A543.
\bibitem{H4} Hellegouarch, Y., {\em Points d'ordre $2p^h$ sur les courbes elliptiques},
Acta. Arith. {\bf 26} (1974/75) 253--263.
\bibitem{Kolyvagin} Kolyvagin, V. A., {\em Euler systems}, in The 
Grothendieck Festschrift (Vol. II), P. Cartier, et. al., eds., 
Birkh\"auser, Boston (1990) 435--483.
\bibitem{Langlands} Langlands, R., Base change for $\mathrm{GL}(2)$, Ann. of 
Math. Studies {\bf 96}, Princeton University Press, Princeton (1980).
\bibitem{Mazur-def} Mazur, B., {\em Deforming Galois representations}, in 
Galois groups over $\Q$, Y. Ihara, K. Ribet, J-P. Serre, eds.,  
MSRI publications {\bf 16}, Springer-Verlag, New York (1989) 385--437.
\bibitem{Mazur} Mazur, B., {\em Number theory as gadfly}, Amer. Math.
Monthly {\bf 98} (1991) 593--610.
\bibitem{Mazur-Tilouine} Mazur, B., Tilouine, J., {\em Repr\'esentations
galoisiennes, diff\'erentielles de K\"ahler et ``conjectures principales''},
Publ. Math. IHES {\bf 71} (1990) 65--103.
\bibitem{Oesterle} Oesterl\'e, J., {\em Nouvelles approches du
  ``th\'eor\`eme'' de Fermat}, S\'eminaire Bourbaki $\rm n^o$ 694
    (1987--88), Ast\'erisque {\bf 161--162} (1988) 165--186.
\bibitem{Ramakrishna} Ramakrishna, R., {\em On a variation of Mazur's deformation
functor}, Compositio Math. {\bf 87} (1993) 269-286.
\bibitem{Ribenboim} Ribenboim, P., 13 lectures on Fermat's Last Theorem,
Springer-Verlag, New York (1979).
\bibitem{Ribet} Ribet, K., {\em On modular representations of
   $\Gal(\bar\Q/\Q)$ arising from modular forms}, Invent. math. {\bf 100}
(1990) 431--476. 
\bibitem{Ribetreport} Ribet, K. {\em Report on mod $\ell$ representations
of $\Gal(\bar\Q/\Q)$}, preprint.
\bibitem{Rubin-Appendix} Rubin, K., The main conjecture. Appendix to: 
Cyclotomic fields I and II, S. Lang, Graduate Texts in Math. {\bf 121}, 
Springer-Verlag, New York (1990) 397--419.
\bibitem{Rubin-Gauss-Sums} Rubin, K., {\em Kolyvagin's system of Gauss sums}, in
Arithmetic algebraic geometry, G. van der Geer, F. Oort, and J. Steenbrink, eds.,
Progress in Math. {\bf 89}, Birkh\"auser, Boston (1991) 309--324.
\bibitem{Rubin-Main-Conj} Rubin, K., {\em The ``main conjectures'' of Iwasawa 
theory for imaginary quadratic fields}, Invent. math. {\bf 103} (1991) 25--68.
\bibitem{Serre} Serre, J-P., {\em Sur les repr\'esentations modulaires de degr\'e  
   2 de $\Gal(\bar\Q/\Q)$}, Duke Math. J. {\bf 54} (1987) 179--230.
\bibitem{Shimura1} Shimura, G., {\em Correspondances modulaires et les fonctions
$\zeta$ de courbes alg\'ebriques}, J. Math. Soc. Japan {\bf 10} (1958) 1--28.
\bibitem{Shimura2} Shimura, G., {\em Construction of class fields and zeta functions
of algebraic curves}, Ann. of Math. {\bf 85} (1967) 58--159.
\bibitem{Shimura-red-book} Shimura, G., Introduction to the arithmetic theory of 
automorphic functions, Princeton Univ. Press, Princeton (1971).
\bibitem{Shimura3} Shimura, G., {\em On elliptic curves with complex
multiplication as factors of the Jacobians of modular function fields},
Nagoya Math. J. {\bf 43} (1971) 199--208.
\bibitem{Shimura4} Shimura, G., {\em On the factors of the jacobian variety
of a modular function field}, J. Math. Soc. Japan {\bf 25} (1973) 523--544.
\bibitem{Shimura-obit} Shimura, G., {\em Yutaka Taniyama and his time. Very 
personal recollections}, Bull. London Math. Soc. {\bf 21} (1989) 186--196.
\bibitem{Silverman} Silverman, J., The arithmetic of elliptic curves,
   Graduate Texts in Math. {\bf 106}, Springer-Verlag, New York (1986).
\bibitem{Thaine} Thaine, F., {\em On the ideal class groups of real abelian
number fields}, Ann. of Math. {\bf 128} (1988) 1--18.
\bibitem{Tunnell} Tunnell, J., {\em Artin's conjecture for representations
of octahedral type}, Bull. A.M.S. {\bf 5} (1981) 173--175.
\bibitem{Weil} Weil, A., {\em \"Uber die Bestimmung Dirichletscher Reihen 
durch Funktionalgleichungen}, Math. Ann. {\bf 168} (1967) 149--156.
\end{thebibliography}

\end{document}