\documentclass[10pt]{amsart}

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{amsthm} 
%\usepackage{mathrsfs}
\usepackage{eucal}
\usepackage{url}
\usepackage[all]{xy}

\newdir{ >}{{}*!/-6pt/@{>}}
\newdir{>> }{{}*!/-6pt/@{>>}}

\usepackage{geometry}
\geometry{paperwidth=8.5in}
\geometry{paperheight=11in}
\geometry{top=1in}
\geometry{bottom=1in}
\geometry{left=1in}
\geometry{right=1in}

\newcommand{\cA}{\mathcal{A}}
\newcommand{\cB}{\mathcal{B}}
\newcommand{\cC}{\mathcal{C}}
%\newcommand{\cD}{\mathcal{D}}
\newcommand{\cE}{\mathcal{E}}
\newcommand{\cF}{\mathcal{F}}
\newcommand{\cG}{\mathcal{G}}
\newcommand{\cH}{\mathcal{H}}
\newcommand{\cI}{\mathcal{I}}
\newcommand{\cJ}{\mathcal{J}}
\newcommand{\cK}{\mathcal{K}}
%\newcommand{\cL}{\mathcal{L}}
\newcommand{\cM}{\mathcal{M}}
\newcommand{\cN}{\mathcal{N}}
\newcommand{\cO}{\mathcal{O}}
\newcommand{\cP}{\mathcal{P}}
\newcommand{\cQ}{\mathcal{Q}}
%\newcommand{\cR}{\mathcal{R}}
\newcommand{\cS}{\mathcal{S}}
\newcommand{\cT}{\mathcal{T}}
\newcommand{\cU}{\mathcal{U}}
\newcommand{\cV}{\mathcal{V}}
\newcommand{\cW}{\mathcal{W}}
\newcommand{\cX}{\mathcal{X}}
\newcommand{\cY}{\mathcal{Y}}
\newcommand{\cZ}{\mathcal{Z}}

\newcommand{\sA}{\mathscr{A}}
\newcommand{\sB}{\mathscr{B}}
\newcommand{\sC}{\mathscr{C}}
\newcommand{\sD}{\mathscr{D}}
\newcommand{\sE}{\mathscr{E}}
\newcommand{\sF}{\mathscr{F}}
\newcommand{\sG}{\mathscr{G}}
\newcommand{\sH}{\mathscr{H}}
\newcommand{\sI}{\mathscr{I}}
\newcommand{\sJ}{\mathscr{J}}
\newcommand{\sK}{\mathscr{K}}
\newcommand{\sL}{\mathscr{L}}
\newcommand{\sM}{\mathscr{M}}
\newcommand{\sN}{\mathscr{N}}
\newcommand{\sO}{\mathcal{O}}
\newcommand{\sP}{\mathscr{P}}
\newcommand{\sQ}{\mathscr{Q}}
\newcommand{\sR}{\mathscr{R}}
\newcommand{\sS}{\mathscr{S}}
\newcommand{\sT}{\mathscr{T}}
\newcommand{\sU}{\mathscr{U}}
\newcommand{\sV}{\mathscr{V}}
\newcommand{\sW}{\mathscr{W}}
\newcommand{\sX}{\mathscr{X}}
\newcommand{\sY}{\mathscr{Y}}
\newcommand{\sZ}{\mathscr{Z}}

\newcommand{\A}{\mathscr{A}}
\newcommand{\B}{\mathscr{B}}
\newcommand{\C}{\mathscr{C}}
\newcommand{\D}{\mathscr{D}}
\newcommand{\E}{\mathscr{E}}
\newcommand{\F}{\mathscr{F}}
\newcommand{\G}{\mathscr{G}}
%\renewcommand{\H}{\mathscr{H}}
\newcommand{\I}{\mathscr{I}}
\newcommand{\J}{\mathscr{J}}
\newcommand{\K}{\mathscr{K}}
\renewcommand{\L}{\mathscr{L}}
\newcommand{\M}{\mathscr{M}}
\newcommand{\N}{\mathfrak{N}}
\renewcommand{\O}{\mathscr{O}}
\renewcommand{\P}{\mathscr{P}}
\newcommand{\Q}{\mathscr{Q}}
\newcommand{\R}{\mathscr{R}}
%\renewcommand{\S}{\mathscr{S}}
\newcommand{\T}{\mathrm{T}}
\newcommand{\U}{\mathscr{U}}
\newcommand{\V}{\mathscr{V}}
\newcommand{\W}{\mathscr{W}}
\newcommand{\X}{\mathscr{X}}
\newcommand{\Y}{\mathscr{Y}}
\newcommand{\Z}{\mathscr{Z}}

\newcommand{\bA}{\mathbb{A}}
\newcommand{\bB}{\mathbb{B}}
\newcommand{\bC}{\mathbb{C}}
\newcommand{\bD}{\mathbb{D}}
\newcommand{\bE}{\mathbb{E}}
\newcommand{\bF}{\mathbb{F}}
\newcommand{\bG}{\mathbb{G}}
\newcommand{\bH}{\mathbb{H}}
\newcommand{\bI}{\mathbb{I}}
\newcommand{\bJ}{\mathbb{J}}
\newcommand{\bK}{\mathbb{K}}
\newcommand{\bL}{\mathbb{L}}
\newcommand{\bM}{\mathbb{M}}
\newcommand{\bN}{\mathbb{N}}
\newcommand{\bO}{\mathbb{O}}
\newcommand{\bP}{\mathbb{P}}
\newcommand{\bQ}{\mathbb{Q}}
\newcommand{\bR}{\mathbb{R}}
\newcommand{\bS}{\mathbb{S}}
\newcommand{\bT}{\mathbb{T}}
\newcommand{\bU}{\mathbb{U}}
\newcommand{\bV}{\mathbb{V}}
\newcommand{\bW}{\mathbb{W}}
\newcommand{\bX}{\mathbb{X}}
\newcommand{\bY}{\mathbb{Y}}
\newcommand{\bZ}{\mathbb{Z}}

\renewcommand{\AA}{\mathbb{A}}
\newcommand{\BB}{\mathbb{B}}
\newcommand{\CC}{\mathbb{C}}
\newcommand{\DD}{\mathbb{D}}
\newcommand{\EE}{\mathbb{E}}
\newcommand{\FF}{\mathbb{F}}
\newcommand{\GG}{\mathbb{G}}
\newcommand{\HH}{\mathbb{H}}
\newcommand{\II}{\mathbb{I}}
\newcommand{\JJ}{\mathbb{J}}
\newcommand{\KK}{\mathbb{K}}
\newcommand{\LL}{\mathbb{L}}
\newcommand{\MM}{\mathbb{M}}
\newcommand{\NN}{\mathbb{N}}
\newcommand{\OO}{\mathbb{O}}
\newcommand{\PP}{\mathbb{P}}
\newcommand{\QQ}{\mathbb{Q}}
\newcommand{\RR}{\mathbb{R}}
\renewcommand{\SS}{\mathbb{S}}
\newcommand{\TT}{\mathbb{T}}
\newcommand{\UU}{\mathbb{U}}
\newcommand{\VV}{\mathbb{V}}
\newcommand{\WW}{\mathbb{W}}
\newcommand{\XX}{\mathbb{X}}
\newcommand{\YY}{\mathbb{Y}}
\newcommand{\ZZ}{\mathbb{Z}}

\newcommand{\fA}{\mathfrak{a}}
\newcommand{\fB}{\mathfrak{b}}
\newcommand{\fC}{\mathfrak{c}}
\newcommand{\fD}{\mathfrak{d}}
\newcommand{\fE}{\mathfrak{e}}
\newcommand{\fF}{\mathfrak{f}}
\newcommand{\fG}{\mathfrak{g}}
\newcommand{\fH}{\mathfrak{h}}
\newcommand{\fI}{\mathfrak{i}}
\newcommand{\fJ}{\mathfrak{j}}
\newcommand{\fK}{\mathfrak{k}}
\newcommand{\fL}{\mathfrak{l}}
\newcommand{\fM}{\mathfrak{m}}
\newcommand{\fN}{\mathfrak{n}}
\newcommand{\fO}{\mathfrak{o}}
\newcommand{\fP}{\mathfrak{p}}
\newcommand{\fQ}{\mathfrak{q}}
\newcommand{\fR}{\mathfrak{r}}
\newcommand{\fS}{\mathfrak{s}}
\newcommand{\fT}{\mathfrak{t}}
\newcommand{\fU}{\mathfrak{u}}
\newcommand{\fV}{\mathfrak{v}}
\newcommand{\fW}{\mathfrak{w}}
\newcommand{\fX}{\mathfrak{x}}
\newcommand{\fY}{\mathfrak{y}}
\newcommand{\fZ}{\mathfrak{z}}


\newcommand{\AAA}{\mathfrak{A}}
\newcommand{\CCC}{\mathfrak{C}}
\newcommand{\DDD}{\mathfrak{D}}
\newcommand{\EEE}{\mathfrak{E}}
\newcommand{\FFF}{\mathfrak{F}}
\newcommand{\GGG}{\mathfrak{G}}
\newcommand{\HHH}{\mathfrak{H}}
\newcommand{\III}{\mathfrak{I}}
\newcommand{\JJJ}{\mathfrak{J}}
\newcommand{\KKK}{\mathfrak{K}}
\newcommand{\LLL}{\mathfrak{L}}
\newcommand{\MMM}{\mathfrak{M}}
\newcommand{\NNN}{\mathfrak{N}}
\newcommand{\OOO}{\mathfrak{O}}
\newcommand{\PPP}{\mathfrak{P}}
\newcommand{\QQQ}{\mathfrak{Q}}
\newcommand{\RRR}{\mathfrak{R}}
\newcommand{\SSS}{\mathfrak{S}}
\newcommand{\TTT}{\mathfrak{T}}
\newcommand{\UUU}{\mathfrak{U}}
\newcommand{\VVV}{\mathfrak{V}}
\newcommand{\WWW}{\mathfrak{W}}
\newcommand{\XXX}{\mathfrak{X}}
\newcommand{\YYY}{\mathfrak{Y}}
\newcommand{\ZZZ}{\mathfrak{Z}}

\newcommand{\al}{\alpha}
\newcommand{\be}{\beta}
\newcommand{\ga}{\gamma}
\newcommand{\de}{\delta}
\newcommand{\pa}{\partial}   %pretend its Greek
\newcommand{\epz}{\varepsilon}
\newcommand{\ph}{\phi}
\renewcommand{\phi}{\varphi}
\newcommand{\phz}{\varphi}
\newcommand{\et}{\eta}
\newcommand{\io}{\iota}
\newcommand{\ka}{\kappa}
\newcommand{\la}{\lambda}
\newcommand{\tha}{\theta}
\newcommand{\thz}{\vartheta}
\newcommand{\rh}{\rho}
\newcommand{\si}{\sigma}
\newcommand{\ta}{\tau}
\newcommand{\ch}{\chi}
\newcommand{\ps}{\psi}
\newcommand{\ze}{\zeta}
\newcommand{\om}{\omega}

\newcommand{\legendre}{\overwithdelims()}
\newcommand{\mat}[4]{\ensuremath{{#1\,\,#2}\choose{#3\,\,#4}}}
\newcommand{\matmu}[4]{\ensuremath{{#1\,\,#2}\choose{#3\,\,\,\,\,\,#4}}}
\newcommand{\matmd}[4]{\ensuremath{{#1\,\,\,\,\,\,#2}\choose{#3\,\,#4}}}
\newcommand{\on}{\operatorname}
\newcommand{\ra}{\rightarrow}
\newcommand{\nin}{\noindent}
\newcommand{\nsg}{\vartriangleleft}
\newcommand{\Pol}{\operatorname{Pol}}
\newcommand{\gr}{\operatorname{gr}}
\newcommand{\Sol}{\operatorname{Sol}}
\newcommand{\GL}{\operatorname{GL}}
\DeclareMathOperator{\Av}{Av}
\newcommand{\Frac}{\operatorname{Frac}}
\newcommand{\PGL}{\operatorname{PGL}}
\newcommand{\SL}{\operatorname{SL}}
\newcommand{\PSL}{\operatorname{PSL}}
\renewcommand{\Re}{\operatorname{Re}}
\renewcommand{\Im}{\operatorname{Im}}
\newcommand{\Lie}{\operatorname{Lie}}
\newcommand{\im}{\operatorname{im}}
\newcommand{\rk}{\operatorname{rk}}
\newcommand{\nullity}{\operatorname{null}}
\newcommand{\Hom}{\operatorname{Hom}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\Span}{\operatorname{Span}}
\newcommand{\Perm}{\operatorname{Perm}}
\newcommand{\lcm}{\operatorname{lcm}}
\newcommand{\ord}{\operatorname{ord}}
\newcommand{\can}{\operatorname{can}}
\newcommand{\Frob}{\operatorname{Frob}}
\newcommand{\Ext}{\operatorname{Ext}}
\newcommand{\Tor}{\operatorname{Tor}}
\newcommand{\Tr}{\operatorname{Tr}}
\newcommand{\Sing}{\operatorname{Sing}}
\newcommand{\rank}{\operatorname{rank}}
\renewcommand{\(}{\left(}
\renewcommand{\)}{\right)}
\renewcommand{\bar}{\overline}
\renewcommand{\hat}{\widehat}
\renewcommand{\tilde}{\widetilde}
\newcommand{\End}{\operatorname{End}}
\newcommand{\Mod}{\operatorname{Mod}}

{\theoremstyle{theorem}\newtheorem*{thm}{Theorem}}
{\theoremstyle{definition}\newtheorem*{claim}{Claim}}
{\theoremstyle{definition}\newtheorem*{cor}{Corollary}}
{\theoremstyle{definition}\newtheorem*{prop}{Proposition}}
{\theoremstyle{definition}\newtheorem*{lem}{Lemma}}
{\theoremstyle{definition}\newtheorem*{rem}{Remark}}
{\theoremstyle{definition}\newtheorem*{defn}{Definition}}
{\theoremstyle{definition}\newtheorem*{ex}{Example}}
\newcommand{\Proof}{\noindent {\bf \nin Proof.\ }}
\newcommand{\Claim}{\noindent {\bf Claim.\ }}
\newcommand{\Rem}{\noindent {\bf Remark.\ }}
\newcommand{\Lem}{\noindent {\bf Lemma.\ }}
\newcommand{\Prop}{\noindent {\bf Proposition.\ }}
\newcommand{\Cor}{\noindent {\bf Corollary.\ }}
\newcommand{\Def}{\noindent {\bf Definition.\ }}
\newcommand{\Thm}{\noindent {\bf Theorem.\ }}
\newcommand{\dirlim}{\varinjlim}
\newcommand{\invlim}{\varprojlim}
\renewcommand{\d}{\operatorname{d}}
\newcommand{\PSU}{\operatorname{PSU}}
\newcommand{\actson}{\curvearrowright}

\newcommand{\Ab}{\mathfrak{Ab}}
\DeclareMathOperator{\Ad}{Ad}
\DeclareMathOperator{\ad}{ad}
\DeclareMathOperator{\sgn}{sgn}
\DeclareMathOperator{\Alt}{Alt}
\DeclareMathOperator{\curl}{curl}
\DeclareMathOperator{\grad}{grad}
\DeclareMathOperator{\Aut}{Aut}
\DeclareMathOperator{\id}{\mathbf{1}}
\DeclareMathOperator{\ind}{ind}
\DeclareMathOperator{\Ind}{Ind}
\DeclareMathOperator{\Res}{Res}
\DeclareMathOperator{\Gal}{Gal}
\DeclareMathOperator{\Div}{Div}
%\DeclareMathOperator{\graph}{graph}
\DeclareMathOperator{\Inf}{Inf}
\DeclareMathOperator{\Sym}{Sym}
\DeclareMathOperator{\Ann}{Ann}
\DeclareMathOperator{\Reg}{Reg}
\newcommand{\sm}{\mathrm{sm}}

\DeclareMathOperator{\supp}{supp}
\renewcommand{\div}{\operatorname{div}}
\renewcommand{\mod}{\operatorname{mod}}
\DeclareMathOperator{\Norm}{N}
\newcommand{\Spec}{\operatorname{Spec}}

 \newcommand{\Specm}{\operatorname{Specm}}
\newcommand{\Pic}{\operatorname{Pic}}
\newcommand{\Max}{\operatorname{Max}}
\newcommand{\chr}{\operatorname{char}}
\newcommand{\Bil}{\operatorname{Bil}}
\newcommand{\Stab}{\operatorname{Stab}}
\newcommand{\ann}{\operatorname{ann}}
\newcommand{\coker}{\operatorname{coker}}
\newcommand{\blank}{\vspace{5mm}}
\newcommand{\Blank}{\vspace{5cm}}
\newcommand{\m}{\backslash}
\newcommand{\into}{\hookrightarrow}
\newcommand{\Tot}{\operatorname{Tot}}
\newcommand{\infrom}{\hookleftarrow}
\newcommand{\onto}{\twoheadrightarrow }
\newcommand{\onfrom}{\twoheadleftarrow }
\renewcommand{\H}{\mathrm{H}}
\newcommand{\dtimes}{\displaystyle\mathop{\times}}
\newcommand{\h}{\mathfrak{h}}
\newcommand{\n}{\mathfrak{n}}
\renewcommand{\b}{\mathfrak{b}}
\newcommand{\p}{\mathfrak{p}}
\renewcommand{\m}{\mathfrak{m}}
%\newcommand{\Specm}{\operatorname{Specm}}
\newcommand{\q}{\mathfrak{q}}
\renewcommand{\a}{\mathfrak{a}}
\newcommand{\red}{\mathrm{red}}
\newcommand{\xycof}{\ar@{^{(}->}}
\newcommand{\xyfib}{\ar@{->> }}
\newcommand{\Der}{\operatorname{Der}}
\newcommand{\flags}{\operatorname{Fl}}
\newcommand{\g}{\mathfrak{g}}
\newcommand{\gl}{\mathfrak{gl}}
\renewcommand{\sl}{\mathfrak{sl}}
\renewcommand{\O}{\mathrm{O}}
\newcommand{\SO}{\mathrm{SO}}
\renewcommand{\U}{\mathrm{U}}
\newcommand{\SU}{\mathrm{SU}}
\newcommand{\so}{\mathfrak{so}}
\renewcommand{\u}{\mathfrak{u}}
\newcommand{\su}{\mathfrak{su}}
\renewcommand{\sp}{\mathfrak{sp}}
\newcommand{\Sp}{\mathrm{Sp}}
\newcommand{\z}{\mathfrak{z}}
\newcommand{\Gr}{\mathrm{Gr}}
\newcommand{\intHom}{{\underline\Hom}}
\newcommand{\sHom}{\mathcal{H}om}
\newcommand{\sEnd}{\mathcal{E}nd}
\newcommand{\MatCoeff}{\operatorname{MatCoeff}}
\newcommand{\intEnd}{{\underline\End}}
\newcommand{\mm}{\mathbf{m}}

\begin{document}

\raggedbottom

\title{Notes from Modularity Lifting Seminar at Stanford, 2009-2010}
\author{Sam Lichtenstein}

\maketitle

\section*{Lecture 1: Overview by Brian}

\subsection*{0. Why Study Galois Representations?}

Here we discuss the link between analytic $L$-functions and $L$-functions attached to varieties.

Let $F$ be a number field and $X$ a smooth projective variety over $F$.

Define the \textbf{partial Euler product}
\[\zeta^*_X(s)=\prod_{v\text{ good place of }F} \zeta(X\mod v,q_v^{-s}),\qquad \Re s \gg_{\dim X}0.\]
Here $X\mod v$ denotes the smooth projective variety over $k(v) \simeq \FF_{q_v}$ obtained by
reduction of a smooth proper model of $X$ over the valuation ring of $F_v$.

\begin{ex}
Let $X$ be an elliptic curve over $F$.
Then 
\[\zeta^*_E(s)=\prod_{E\text{ has good reduction at }v}\frac{1-a_vq_v^{-s}+q_v^{1-2s}}{(1-q_v^{-s})(1-q_v^{1-s})}=\zeta^*F(s)\zeta^*_F(s-1)L^*(E,s)^{-1},\qquad a_v=q_v+1-\#E(k(v)).\]
\end{ex}

We would like to do the following.
\begin{enumerate}
\item Fill in the ``bad'' factors to obtain an $L$-function with a good functional equation, analytic continuation, etc.
\item Relate $\zeta_X^*$ to arithmetic properties of $X$. (E.g., Birch-Swinnerton-Dyer conjecture, etc.)
\end{enumerate}
A clue for (1) comes from \textbf{Artin representations}:
\[\xymatrix{G_F=\Gal(\bar F/F)\ar[rr]^\rho\ar[rd]&&\GL(W)=\text{f.d. v.s./}\CC\\
&\Gal(F'/F)=\text{Gal. gp. of finite Gal. extn.}\xycof[ru]&}\]
Note that $F'/F$ is unramified at all but finitely many places.
We define the \textbf{Artin $L$-function} of $\rho$ to be
\[L(s,\rho)=\prod_v\det([1-\rho(\Frob_v)q_v^{-s}]|_{W^{I_v}})^{-1},\qquad W^{I_v}=\text{subspace of $W$ fixed by inertia at $v$}.\]
Grothendieck gave a related description of $\zeta_X^*$ using \textit{continuous} $p$-adic representations 
\[G_F\to \GL(\H^i_{\text{\'et},c}(X_{\bar F},\QQ_p))=:\GL(W^i).\]
These are unramified almost everywhere, including at all good places away from $p$.
Here the $i$th cohomology group $W^i$ above vanishes for $i>2\dim X$.
Grothendieck proved that if we remove the contribution of $p$-adic places to $\zeta^{\ast}_X(s)$ then 
\[\zeta_X^*(s)=\prod_i L^*(s,W^i)^{(-1)^i},\]
where $L^*(s,W^i)$ is like the Artin $L$-function without the ``bad'' factors and the $p$-adic places:
\[L^*(s,W^i)=\prod_{\text{good }v\nmid p}\det([1-\Frob_vq_v^{-s}]|_{W^i})^{-1}.\]
\textbf{Note:} The expression for $L^*(s,W^i)$ requires some care, since $q_v^{-s}$ is a \textit{complex number} acting on a \textit{$p$-adic} vector space. What has to be proved is that the characteristic
polynomial for the action of $\Frob_v$ on $W^i$ has rational coefficients (and is independent of $p$),
so evaluation using $q_v^{-s}$ makes sense (and the Riemann Hypothesis ensures absolute convergence
of the product in a suitable right half-plane depending only in $\dim X$). 

We conclude from all this that it is a good idea to study $L$-functions of reasonable $p$-adic representations.  Representation theory can often be used to fill in the bad factors later. 

\textbf{Eternal dangerous bend:} The case of $v|p$ is tricky!  The complication is that
``unramifiedness'' is not the right notion corresponding to ``good reduction'' for
$p$-adic representations of Galois groups of $p$-adic fields.  

\subsection*{1. Modular Galois representations and modularity lifting theorems}
\subsubsection*{Definitions}
\begin{defn}A \textbf{$p$-adic representation} of $G_F$ is a continuous linear representation $\rho: G_F\to \GL(W)$, where $W$ is a finite dimensional vector space over a $p$-adic field $K$ (i.e. a finite extension $K/\QQ_p$) and $\rho$ is unramified at almost all places $v$ of $F$.
\end{defn}
\begin{ex}
The repsentation $V_p(E)=T_p(E)\otimes_{\ZZ_p}\QQ_p$ arising from the Tate module of
an elliptic curve $E$ over $F$ is historically the first really interesting example.
\end{ex}
\begin{ex}
\'Etale cohomology, with compact support: $W^i=\H^i_{\text{\'et},c}(X_{\bar F},\QQ_p)$
for any separated $F$-scheme $X$ of finite type.  (Note that this is unramified
at all but finitely many places, even if $X$ is not smooth.  The proof rests
on properties of constructible $\ell$-adic sheaves.)  \end{ex}
\begin{rem}
In the definition of a $p$-adic representation
it is  \textit{equivalent} to take the coefficient field to be $\bar \QQ_p$, because of the following fact: any compact subgroup of $\GL_n(\bar\QQ_p)$ is contained in $\GL_n(K)$ for a finite extension $K/\QQ_p$. The proof of this uses the Baire Category Theorem. [Warning! It is \textit{false} if we consider $\CC_p$ instead of $\bar\QQ_p$!] So we \textit{could} do everything over $\bar\QQ_p$, but we will find it
more convenient to take the coefficient field $K$ to be locally compact.
\end{rem}
\begin{defn}A \textbf{$\mod p$ representation} of $G_F$ is a continuous representation $\bar\rho:G_F\to\GL(\bar W)$, where $\bar W$ is a finite dimensional vector space over a finite extension $k/\FF_p$. Note that $\GL(\bar W)$ is thus a discrete topological group, so the continuity condition entails that $\bar\rho$ factors through a finite Galois group $\Gal(F'/F)$.
\end{defn}
\begin{ex}
The $p$-torsion of an elliptic curve: $E[p](\bar F)\otimes_{\FF_p} \FF_{p^r}$.
\end{ex}
\begin{ex}
\'Etale cohomology: $\H^i_{\text{\'et},c}(X_{\bar F},\ZZ/p\ZZ)$.
\end{ex}
\begin{rem}
It is ``equivalent'' to take the coefficient field to be $\bar \FF_p$. 
\end{rem}
\subsubsection*{Reduction of Galois representations}
\begin{prop} Any $p$-adic representation $\rho:G_F\to\GL_K(W)$
has a $G_F$-stable $\cO_K$-lattice $\Lambda\subset W$; i.e. $\rho$ induces a map
$\bar\rho:G_F\to\GL_{\cO_K}\Lambda\approx \GL_n(\cO_K)\onto \GL_n(k)$ where $k=\cO_K/\m$.\qed
\end{prop}
(Here by a \textbf{lattice} we mean a finitely generated $\cO_K$-submodule of $W$ such that $K\otimes_{\cO_K}\Lambda=W$.)
It is not hard to see that the characteristic polynomial of $\bar\rho$ is independent of the choice of lattice $\Lambda$.
\begin{thm}[Cor. of Brauer-Nesbit Theorem]
Let $\bar\rho^{ss}=\bigoplus\{\text{Jordan-Holder factors of $\bar\rho$}\}$.
Then $\bar\rho^{ss}$ has the same characteristic polynomial as $\bar\rho$, and is determined up to isomorphism by its characteristic polynomial, and is therefore independent of the choice of $\Lambda$.
\end{thm}
In light of the theorem, we shall henceforce call $\bar\rho^{ss}$ ``the'' reduction of $\rho$. Here are a bunch of things to watch out for:
\begin{enumerate}
\item $\bar\rho^{ss}$ is often denoted $\bar\rho$, even though it is certainly not just the ``reduction mod $p$'' of $\rho$ in general. 
\item $\bar\rho^{ss}$ may be unramified at some places where $\rho$ is ramifield.
For example, if $\rho(I_v)\subset 1+\m\cdot\mathrm{Mat}_n\cO_K$, then the inertia at $v$ simply ``disappears'' mod $v$.
\item If $\bar\rho^{ss}$ is irreducible, then in fact the only stable lattices in $W$ were of the form $\pi^i\Lambda$, where $\pi$ is a uniformizer for $K$
and $i\in\ZZ$.
\item Irreducibility is \textit{not} the same as \textit{absolute} irreducibility = irreducibility over $\bar k$.
\item $\rho$ might be absolutely irreducible over $K$, yet $\bar\rho^{ss}$ could be not only reducible, but even completely trivial! (Hence completely reducible...)
\end{enumerate}
Exercise: If $\rho$ is reducible then any Jordan-Holder filtration of $\rho$ induces a similar filtration for $\bar\rho^{ss}$.
So the last warning above is ``one-directional''.
\subsubsection*{Modular Galois representations}

Let $f\in S_k(\Gamma_1(N),\chi)$ be a Hecke eigenform of weight $k\geq 1$. Let $K_f\subset \CC$ be the field generated over $\QQ$ by all the Fourier coefficients $a_\ell(f)$ of $f$ for primes $\ell\nmid N$.
Then $K_f$ is a number field containing the values of the Nebentypus $\chi$.
Let $\lambda$ be a place of $K_f$ lying over $p$.

\begin{thm}[Deligne, Deligne-Serre, Ribet] 
There exists a unique continuous irreducible $p$-adic representaion
\[\rho_{f,\lambda}:G_\QQ\to \GL_2(K_{f,\lambda})\]
unramified at all $\ell\nmid Np$, such that for all such $\ell$ we have
\[\text{sum of eigenvalues of $\Frob_\ell$}=\Tr(\rho_{f,\lambda}\Frob_\ell)=a_\ell(f)[=T(\ell)\text{-eigenvalue of }f]\]
and
\[
\det\circ \rho_{f,\lambda}=\chi\cdot \epsilon_p^{k-1}\]
where $\epsilon_p:G_\QQ\to \ZZ_p^\times\subset \cO_{K_f,\lambda}^\times$ is the $p$-adic cyclotomic character.\end{thm}
In particular, for $\ell\nmid Np$, the characteristic polynomial of $\rho_{f,\lambda}(\Frob_\ell)$
is
\[t^2-a_\ell(f)t+\chi(\ell)\ell^{k-1}\in K_f[t]\subset K_{f,\lambda}[t],\]
a non-obvious integrality property.  Note that this polynomial is independent of $\lambda$. 
\begin{rem}
 The independence of $\lambda$ and the precise control on the unramified primes implies that 
 the collection $\{\rho_{f,\lambda}\}_{\lambda}$ is a ``compatible'' family of of representations, with respect to $K_f$-characteristic polynomials, just like $\{V_pE\}_p$ is a ``compatible'' family of representions with respect to $\QQ$-characteristic polynomials. Cf. Serre's book {\em Abelian $\ell$-adic representations}. 
 \end{rem}
Let us look at the partial Artin $L$-functions
\[L^*(s,\rho_{f,\lambda})=\prod_{\ell\nmid Np}\det\(1-\rho_{f,\lambda}(\Frob_\ell)\cdot \ell^{-s}\)^{-1}
=\prod_{\ell\nmid Np}\frac{1}{1-a_\ell(f)\ell^{-s}+\chi(\ell)\ell^{k-1-2s}}=:L^*(s,f).\]
\begin{rem}
Note that for a complex conjugation $c$, 
$\det\rho_{f,\lambda}(c)=\chi(-1)\epsilon_p^{k-1}=(-1)^k(-1)^{k-1}=-1$, so all the representations produced by the theorem above are \textit{odd}!
\end{rem}
Now consider the (semisimplified) reduction $\bar\rho_{f,\lambda}:G_\QQ\to\GL_2(k_{f,\lambda})$, which is continuous and semisimple,
but might be reducible. In general, we say a mod-$p$ representation $\bar\rho$ \textbf{is modular} if it is isomorphic over $\bar\FF_p$ to some $\bar\rho_{f,\lambda}$. 

Just \textit{suppose} $\bar\rho_{f,\lambda}$ happens to be absolutely irreducible.
By the last remark, it, too, is odd. Serre's conjecture is concerned with when mod-$p$ representations with such properties are in fact modular.

Note that $\bar\rho_{f,\lambda}$ does not determine $k$ or $N$. There could be congruences 
``$g\equiv f$'' modulo $\lambda$ for some eigenform $g\in S_{k'}(\Gamma_1(N'),\chi')$
(with the congruence taken in the sense of Fourier coefficients, say, relative to a $p$-adic
place of $\overline{\QQ}$ over $\lambda$ on $K_f$ and some chosen $p$-adic place of
$K_g$).  This would imply that $\bar\rho_{f,\lambda}=\bar\rho_{g,\lambda}$.
This is actually abusive notation, since to obtain such a comparison, we might need to extend scalars
on the residue fields of these reductions.
\subsubsection*{Wiles's insight}
The prototype of a \textbf{modularity lifting theorem} is the following.
\begin{thm}[Not really a theorem]
Given any $p$-adic representation 
$\rho:G_\QQ\to \GL_2(\bar\QQ_p)$ such that
$\bar\rho$ is irreducible and modular over $\bar\FF_p$, and $\rho$ is ``nice'' (at
$p$, in the sense of $p$-adic Hodge theory!) then $\rho$ is modular.
\end{thm}
In this seminar, we'll focus on those $\rho$ such that
\[\rho|_{D_p}\approx \(\begin{smallmatrix}\psi_1&*\\0&\psi_2\end{smallmatrix}\)\]
where $D_p$ is the decomposition group at $p$, $\psi_2$ is an unramified character, and $\psi_1$ is $\epsilon_p^{k-1}$ times an unramified character.
These representations are ``essentially like the ones that come from elliptic curves
with good ordinary reduction at $p$''.
\subsection*{3. Applications of the method}
\begin{itemize}
\item Serre's conjecture.
\item Sato-Tate.
\item Gross-Zagier, Heegner points, Kolyvagin (need to provide a finite map $X_0(N_E)\to E$ over $\QQ$, which is done via Faltings' theorem and the ``modularity'' of $V_\ell(E)$). 
\item FLT. (Modularity of the Galois rep. attached to the Frey curve.)
\end{itemize}
\pagebreak
\section*{Lecture 2: Akshay on Serre's Conjecture, Etc.}
Fix embeddings $\bar \QQ\into \CC$ and $\bar \QQ\into \bar \QQ_p$, and let $k$ denote a finite subfield
of the residue field of $\bar\QQ_p$. 
\subsection*{1. Serre's conjecture}
Here's the conjecture:\\

Let $\bar\rho:G_\QQ\to \GL_2(\bar\FF_p)$ be irreducible and odd. 
Then there exists a newform $f$ whose Galois representation $\rho_f:G_\QQ\to \GL_2(\bar\QQ_p)$ satisfies $\bar\rho_f\cong \bar\rho$. (Here $\bar\rho_f$ always means semisimplication!) Moreover $f$ is of level $N(\bar\rho)$ and weight $k(\bar\rho)$ to be discussed below.

\begin{rem}
Apropos of reduction mod $p$: If $V$ is a $\QQ_p$-vector space and $G\subset \GL(V)$ is a compact subgroup, then there exists a $G$-fixed lattice in $V$ for the following reason. Pick any lattice $L\subset V$. Then the $G$-stabilizer of $L$ is open and of finite index. So $\Lambda=\sum_{g\in G}gL\subset V$ is 
also a lattice, and it is definitely $G$-stable.  The same works with coefficients in any finite
extension of $\QQ_p$, or even in $\bar\QQ_p$ (since we saw last time that in this latter case
the image is contained in $\GL_n(K)$ for some subfield $K$ of finite degree over $\QQ_p$.  
\end{rem}
\subsubsection*{The level $N(\bar\rho)$}
Serre conjectured that $N(\bar\rho)=$ Artin conductor of $\bar\rho$, which has the following properties.
\begin{itemize}
\item $(p,N(\bar\rho))=1$.
\item For $\ell\neq p$, the $\ell$-adic valuation
$\ord_\ell N(\bar\rho)$ depends only on $\bar\rho|_{I_\ell}$, and is given by
\[\ord_\ell N(\bar\rho)=\sum_{j\geq 0}\frac{1}{[G_0:G_j]}\dim(V/V^{G_j})\]
Here, we set $K=\bar\QQ^{\ker\bar\rho}$ to be the the field cut out by $\bar\rho$,
and $G_j$ to be image under $\bar\rho$ of the lower-numbered ramification filtration at $\ell$ of $\Gal(K/\QQ)$. In other words, if $w$ is a place of $K$ over $\ell$, then 
\[G_j=\bar\rho\{\sigma\in I_\ell\mid \ord_w(\sigma x-x)>j,\forall x\in \cO_{K,w}\}.\]
The filtration goes
\[G_0=\bar\rho(I_\ell)\supset G_1\supset G_2\supset \cdots\]
The first step is of index prime to $\ell$, while the latter groups are all $\ell$-groups.
If $K$ is tamely ramified or unramified at $\ell$, then $\ord_\ell N(\bar\rho)=\dim(V/V^{I_\ell})$.
The Hasse--Arf theorem ensures that the proposed formula for the
$\ell$-adic ordinal above is actually an integer. 
\end{itemize}
\subsubsection*{The weight $k(\bar\rho)$}
\begin{thm}[Deligne]
Suppose $f$ is a newform of weight $<p$ and level prime to $p$
$($so $\chi_f$ is unramified at $p$$)$.
Suppose $f$ is \textbf{ordinary} at $p$, meaning $a_p(f)\in \bar\ZZ_p^\times$.
Then $\bar\rho_f$ has a unique 1-dimensional \textbf{unramified} quotient; i.e. 
\[\bar\rho_f|_{D_p}\sim \(\begin{smallmatrix}\alpha\omega^{k-1}&*\\0&\beta\end{smallmatrix}\)\]
for \textbf{unramified} characters $\alpha,\beta:D_p\to \bar\FF_p^\times$
and $\omega$ the mod-$p$ cyclotomic character.
\end{thm}
It follows that
\[\bar\rho_f|_{I_p}\sim\(\begin{smallmatrix}\omega^{k-1}&*\\0&1\end{smallmatrix}\).\]
This can be seen concretely
in the case of elliptic curves $E$ with ordinary reduction:
for $\rho_f=V_\ell(E)$ the ``connected-\'etale sequence''
\[\mathcal{E}[p^n]^0\to \mathcal{E}[p^n]\to \mathcal{E}[p^n]/\mathcal{E}[p^n]^0\]
associated to the $p^n$-torsion on the N\'eron model $\mathcal{E}$ 
has last quotient is unramified. Now take limits on generic fibers to deduce the theorem in this case. 

Serre conjectured that 
\[k(\bar\rho):=\begin{cases}1+pa+b&\text{``most of the time''}\\
1+pa+b+p-1&\text{...}\end{cases}\]
is the minimal weight at prime-to-$p$ level.
Here $a\leq b$ are integers to be defined below. In the ordinary, low ($<p$) weight case, $a=0,b=k-1$.

We need to detour into the structure of $I=I_p\subset G_\QQ$.
By definition $I_w\nsg I\onto I_t$, where $I_w$, the wild ramification group, is the largest pro-$p$ subgroup.
\begin{prop} $I_t\cong \Hom(\QQ/\ZZ,\bar\FF_p^\times)=\varprojlim_r \FF^\times_{p^r}=\prod_{\ell\neq p}\ZZ_\ell(1)$.\qed\end{prop}
Think: $\hat \ZZ$ minus the $p$-part. The Tate-twisting notation records how the canonical
Frobenius element in $D_p/I_p$ acts on the abelian quotient
$I_t$ of $I_p$. The map from left to right is
$g\mapsto g(\theta_r)/\theta_r$ where $\theta_r^{p-1}=p$.
The action of $\Frob_p\in D_p/I_p$ is by raising to the $p$th power on the right side.
The composite quotient map
$$\psi_r:I_t \twoheadrightarrow \FF_{p^r}^{\times}$$
is called the {\em level-$r$ fundamental character}, though the more canonical collection
is its $p$-powers (thereby being ``independent of the choice of $\bar \FF_p$''). 

We can deduce that
\[(\bar\rho|_{I_p})^{\rm{ss}}\cong\(\begin{smallmatrix}\chi_1&0\\0&\chi_2\end{smallmatrix}\).\]
To see this, note that $\bar\rho$ is assumed irreducible.
On one hand $I_w$ is pro-$p$, so by a counting argument it must fix a nontrivial subspace when acting on a vector space over a finite field of characeristic $p$.
On the other hand $I_p/I_w$ is abelian, so it has no irreducible 2-dimensional representations. Hence $\bar\rho_{I_p}$ is not itself irreducible; i.e. it is upper triangular, so its semisimplification splits as a direct sum of characters.

Now since $\bar\rho|_{I_p}$ extends to a representation of $D_p$, the pair $\{\chi_1,\chi_2\}$ must be preserved under the Frobenius action of $D_p/I_p$.
In other words, we have
\[\begin{cases}\chi_1^p=\chi_1\\\chi_2^p=\chi_2\end{cases} \qquad\text{or}\qquad \begin{cases}\chi_1^p=\chi_2&\chi_1^{p^2}=\chi_1\\
\chi_2^p=\chi_1&\chi_2^{p^2}=\chi_1\end{cases}\]
In the first case, each, $\chi_i$ factors through $I_t\to\FF_p^\times$.
In the second case, each $\chi_i$ factors through $I_t\to \FF_{p^2}^\times$.

So in the first case we can write $\chi_1=\omega^a,\chi_2=\omega^b$ for $0\leq a\leq b$,
where $\omega:I_t\to \varprojlim \FF_{p^r}^\times\onto \FF_p^\times$
is the mod-$p$ cyclotomic character.
In the second case we can likewise write $\chi_1=\psi^{a+pb}$, $\chi_2=\psi^{pa+b}$
where $\psi:I_t\to \FF_{p^2}^\times$ is the level-2 fundamental character.
These are the $a,b$ in Serre's conjecture.

\subsubsection*{The exceptional case $k(\bar\rho)=1+pa+b+p-1$}
Now we address where this case comes from (but without precisely defining it).  
Consider the special cases
\[\bar\rho|_{I_p}\sim\(\begin{smallmatrix}\omega^2&*\\0&1\end{smallmatrix}\)\]
and 
\[\bar\rho|_{I_p}\sim\(\begin{smallmatrix}\omega&*\\0&1\end{smallmatrix}\).\]
In the first case the guess is $k(\bar\rho)=3$.
In the second case the ``standard'' guess ($a=0,b=1$) is $k(\bar\rho)=2$.
But a naive combinatorial estimate says that the number of representations
of the second type is roughly twice as much
as the number of the first type.
On the other hand these are certainly fewer modular forms of weight $2$ than of weight $3$. The ``corrected'' guess of $p+1$ for the second case when $a = 0$ and $b=1$ 
could provide the necessary extra modular representations.

Note:  $\bar\rho|_{D_p}$ ``comes from'' a finite flat group scheme over $\ZZ_p$
if it arises in weight 2; this property depends only on the restriction to inertia,
and it can be characterized in purely Galois-theoretic terms.  This leads to a special
case in Serre's conjecture related to the case $k(\bar\rho) = 2$. 

\subsubsection*{Emerton on Serre's conjecture} Matt Emerton has a version of ``$\mod p$ local Langlands'' which gives the following picture.
There is a natural action of $\GL_2(\AA_f)$ (with $\AA_f$ the finite adeles)
on 
\[\Hom_{G_\QQ}(\bar\rho,\varinjlim_N\H^1(X(N),\bar\FF_p))\cong \bigotimes_q'\pi_q(\bar\rho),\]
where the right side is a ``factorization'' into local ``mod $p$ automorphic'' representations.
Here $\pi_q(\bar\rho)$ is finite length but not necessarily irreducible, and depends only on
 $\bar\rho|_{D_q}$.
Supose $\bar\rho=\bar\rho_f$ for $f\in S^{\rm{new}}_k(N)$.
Then in fact
\[\bar\rho\into \H^1(X(N),\Sym^{k-2}\bar\FF_p^2).\]
Here $\Sym^{k-2}\bar\FF_p^2$ is viewed as a local system on $X(N)$ as the Tate module of the ``universal elliptic curve'' (up to some subtleties at the cusps). 
The right side is almost the same as [\textit{need to clarify appearance of $\GL_2(\ZZ/p\ZZ)$-invariants
below}]
\[(\H^1(X(N(\rho)),\bar\FF_p)\otimes \Sym^{k-2}\bar\FF_p^2)^{\GL_2(\ZZ/p\ZZ)}
=((\bigotimes'\pi_q(\bar\rho))^{k(Np)}\otimes \Sym^{k-2}\bar\FF_p^2)^{\GL_2(\ZZ/p\ZZ)}\neq 0\]
[\textit{This needs to be extended a bit more to explain the relation with 
``independence'' of the $N$ and the $k$ in Serre's conjecture.}]

\subsection*{2. Hecke algebras}
Let $V=S_2(\Gamma_0(N))$ for $N$ squarefree.
Let $\TT\subset \End(V)$ be the $\ZZ$-subalgebra generated by all Hecke operators $T(p),p\nmid N$ and $U_p,p|N$.
(Recall that $U_p:\sum a_n q^n\mapsto \sum a_{np}q^n$.)

\textbf{Fact}: $\TT$ is finite over $\ZZ$.
\begin{proof}
One approach is to show that $\TT$ preserves a lattice in $V$, by using
the arithmetic theory of modular curves (with models over $\ZZ$).  
An alternative which is easier to carry out rigorously and involves just topological/analytic 
tools is to embed $V$ into $\H^1(X_0(N),\CC)$ and extend the $\TT$-action to this space and prove 
it preserves the lattice of integral cohomology (which can also be studied in terms of group
cohomology).
This will be addressed in all weights $\ge 2$ in Baran's later lecture.
\end{proof} 


\textbf{Fact}: The natural map from $\TT_\CC:=\TT\otimes_\ZZ\CC$ onto
the subalgebra $\CC[T(p),U_p\mid p\in \ZZ] \subset \End(V)$ is an isomorphism; that is,
$\TT_{\CC}$ acts faithfully on $V$.  
This will also be proved in Baran's lecture (in any weight at least 2). 

\textbf{Fact}: $V$ is a free $\TT_\CC$ module of rank 1.
\begin{proof}
It is enough to construct a cyclic vector $f$; i.e.,  $T\mapsto Tf$ gives a surjection $\TT_\CC\onto V$. (It is automatically then injective since $\TT$ acts faithfully on $V$.)  
By multiplicity 1, we have $V=\bigoplus_{\text{newforms }f_i}V_i$ where $V_i$ is the generalized Hecke eigenspace corresponding to $f_i$.
It suffices to check the existence of a cyclic vector for each $V_i$, due to the Chinese Remainder
Theorem for coprime maximal ideals of $\TT_{\CC}$ (which corresponding to eigenforms).
The existence of a cyclic vector for each $V_i$ can be done explicitly. 
\end{proof}
By the last fact, $\H^1(X_0(N),\CC) \cong V\oplus\bar V$
is free of rank 2 over $\TT_\CC$.
Consequently $\H^1(X_0(N),\bar\QQ_p)$ is free of rank 2 over $\TT_{\bar\QQ_p}$.
The latter is $\TT_{\bar\QQ_p}$-linearly isomorphic
 to $\H^1_{\text{\'et}}(X_0(N)_{\bar\QQ},\bar\QQ_p)$, which also has a $G_\QQ$-action
 (that is Hecke equivariant, due to an alternative way to define the Hecke action via
 correspondences between modular curves over $\QQ$). So we obtain a 
 ``modular'' Galois representation: 
\[\xymatrix{G_\QQ\ar[r]\ar@{-->}[rd]_{\exists ?}&\GL_2\TT_{\bar\QQ_p}\\
&\GL_2(\text{`integral'})\xycof[u]}\]
We'd like to produce a $G_\QQ$-stable $\TT_{\bar\ZZ_p}$-lattice inside our rank 2 $\TT_{\bar\QQ_p}$ module.  This approach gets involved with delicate commutative algebra properties of
integral Hecke algebras (Gorenstein condition, etc.), and in more general settings it is simpler
to bypass such subtleties at the outset.  So we will use a slicker method with wider applicability which
avoids making such a Hecke lattice.  
\begin{ex}
Consider level $N=33$. Then $\dim(S_2)=3$.
The cusp forms in question come from two elliptic curves.
The first $y^2+y=x^3\pm x^2$ has conductor $11$, 
giving rise to $$f=q\prod_n(1-q^n)^2(1-q^{11n})^2=q-2q^2-q^3+2q^4+q^5\pm 2q^6$$ 
of level 11, hence $f'(z):=f(3z)$ is level 33.
The second $y^2+xy=x^3+x^2-11x$ gives rise to $g=q+q^2+q^3-q^4-2q^5\pm 2q^6$ in level 33. Observe that $f\equiv g$ mod $3$, which is no accident.
Indeed, the Hecke algebra $\TT$ acting on the lattice $\ZZ f\oplus \ZZ f'\oplus \ZZ g$ in $S_2$ 
is generated over $\ZZ$ by $U_3$, which acts by 
\[g\mapsto -g, f'\mapsto f, f\mapsto -f-3f'.\]
From this we can find
\[\TT\cong \ZZ[x]/(x+1)(x^2+x+3).\]
So $\Spec \TT$ lying over $\Spec \ZZ$ has two irreducible components, 
$$\Spec \ZZ=\Spec \ZZ[x]/(x+1),\,\,\,
\Spec \ZZ[x]/(x^2+x+3),$$ which happen to meet at the fiber over $(3)\in \Spec \ZZ$.
(This is precisely the reason for the congruence observed earlier, as we will see in a moment.) 
The fiber in question consists of a single maximal ideal $\m\in \Spec \TT$,
the kernel of $$\TT\stackrel{\text{act on }\ZZ f}{\to}\ZZ\onto \FF_3.$$
If we consider the completed localization $\TT_\m$ then we claim that after a suitable conjugation, 
$G_\QQ\to \GL_2(\TT_{\bar\QQ_3})$ factors through $\GL_2(\TT_\m)$.  Once this is done, then
using the two specializations $\TT_\m \rightarrow \ZZ_3$ corresponding to the two elliptic curves
then recovers the 3-adic Tate modules of these elliptic curves as deformations of
a common mod-3 residual representation.

But how to make the representation land in $\GL_2(\TT_\m)$? Consider the 3-adic eigenforms associated
to minimal primes of $\TT$ below $\m$, of which there are 2 and so actually the ones from the elliptic
curves above (for a unique prime over 3 in the quadratic field associated to the second component
of $\TT$). This gives representations from $G_\QQ$ into $\GL_2(\ZZ_3)$ which are conjugate modulo
$3$.  One checks that these mod-3 representations are irreducible, and hence absolutely irreducible
(due to oddness).
Thus, the {\em local} fiber product ring 
$$R = \ZZ_3 \times_{\FF_3} \ZZ_3 = \{(a,b) \in \ZZ_3 \times \ZZ_3\,|\,a \equiv b \bmod 3\}$$
contains $S = \TT_\m$ and we get a representation
$G_\QQ \rightarrow \GL_2(R)$ upon fixing an isomorphism of the mod-3 reductions. 
Note that the traces in $R$ at Frobenius elements away from 3 and 11 all lie in $S$,
since $T_{\ell} \in \TT$ ``is'' the trace (as can be checked modulo each minimal prime of the reduced 
$\TT_{\QQ_3}$).   This is the key to descending the representation into $\GL_2(S)$, as we explain next.

\end{ex}
\subsection*{3. Descent for Galois representations}
Let $R$ be a complete local ring with maximal ideal $\m_R$.
Let $\rho:G_\QQ\to\GL_n(R)$ be residually absolutely irreducible
and continuous. Suppose further more that $\rho$ is odd. 
Let $S$ be a complete local subring of $R$ with local inclusion map, so 
$\m_S=\m_R\cap S$ and we get an induced isomorphism of residue fields $S/\m_S\cong R/\m_R$.
Assume that $\tr\rho(g)\in S$ for all $g\in G_\QQ$.
\begin{thm} If  $n = 2$ and the residue characteristic is not $2$ then 
some $\GL_2(R)$-conjugate of $\rho$ is valued in $\GL_2(S)$. 
\end{thm}
\begin{proof}
The argument is elementary, and apparently due to Wiles. By oddness, we can assume $\(\begin{smallmatrix}1&0\\0&-1\end{smallmatrix}\)\in\im\rho$.
For any $\(\begin{smallmatrix}a&b\\c&d\end{smallmatrix}\)\in\im\rho$, the trace
$2a=\tr(\(\begin{smallmatrix}a&b\\c&d\end{smallmatrix}\)+\(\begin{smallmatrix}a&b\\c&d\end{smallmatrix}\)\(\begin{smallmatrix}1&0\\0&-1\end{smallmatrix}\))$ lies in $S$, so $a\in S$. Similarly one finds $d\in S$.
By residual irreducibility there is $g\in G_\QQ$ with 
$\rho(g)\sim\(\begin{smallmatrix}*&u\\*&*\end{smallmatrix}\)$
where $u$ is an $R$-unit.
Conjugate by $\(\begin{smallmatrix}u&0\\0&1\end{smallmatrix}\)$, and we find that $\rho(g)\sim\(\begin{smallmatrix}*&1\\ \ast &*\end{smallmatrix}\)$ for some $g$.
Messing around with this and the previous idea, one can conclude that $b,c\in S$ as well.
\end{proof}

Note that the preceding argument did not use the completeness of $S$.  Now we use it.
[{\em Where do we ever use completeness of $R$ or $S$ below?}] 
Taking $S$ and $R$ as above, and imposing no hypotheses on $n$ or the residue characteristic, we have:

\begin{thm}
Assume $\rho:G \to\GL_n(R)$ is residually absolutely irreducible, where $G$ is any group at all.
Then some $\GL_n(R)$-conjugate of $\rho$ is valued in $\GL_n(S)$. 
\end{thm}
\begin{proof}
By Jacobson Density and the residual absolute irreducibility of $\rho$, there exist 
$$x_1,\ldots, x_{n^2}\in \rho(G)\subset M_n(R)$$ such that $\bar x_i$
span $M_n(k)$, where $k=R/\m_R$ is the residue field. It follows that the $x_i$'s themselves freely span $M_n(R)$. (Relate them to a basis by a matrix; the reduction of that matrix mod $\m_R$ is invertible over 
$k$, so it must be invertible over $R$ itself.)

Let $B$ be the $S$-submodule of $M_n(R)$ freely spanned over $S$ by the $x_i$. It is free of rank $n^2$.
The claim is that $B$ is in fact an $S$-algebra containing $\rho(G)$.
To see this, take $y\in \rho(G)$. We can write $y=\sum a_ix_i$ for $a_i\in R$.
For each $1\leq j \leq n^2$, the trace $\tr(yx_j)$ is equal to $\sum_i a_i\tr(x_ix_j)$.
Consider the matrix $$(\tr(x_ix_j))\in M_{n^2}S.$$ 

Due to non-degeneracy of the trace pairing for matrix algebras over a field,
a matrix of traces of products of basis elements for a matrix algebra over a field is invertible. So the reduction of this matrix mod $\m_R$ (the same as its reduction mod $\m_S$) is invertible.
Hence it is invertible itself, so 
the $a_i$ are in $S$ and hence $y\in B$. Thus, $\rho(G)\subset B$.
In particular $1\in B$. 
It's not hard to check $B$ is closed under multiplication, so it's a finite $S$-algebra that is free of rank $n^2$ and contains
$M_n(S)$. 

If $k'$ denotes the residue field of $S$, then since the map 
$M_n(S) \rightarrow M_n(R)$ induces the injective map
$M_n(k') \rightarrow M_n(k)$ modulo maximal ideals we
conclude that the inclusion $M_n(S) \rightarrow B$ induces an injective map
$M_n(k') \rightarrow B \otimes_S k'$.  But $B\otimes_S k'$ has rank $n^2$, so
$M_n(S) \rightarrow B$ is a map between finite free $S$-modules of rank $n^2$
and induces an isomorphism modulo $\m_S$.  Thus, it is an equality. 
\end{proof}
\subsection*{4. Universal deformation ring}
As before let $k$ be a finite field and $\bar\rho:G\to \GL_n(k)$ an absolutely irreducible representation
of a profinite group $G$. A \textbf{lifting} of $\bar\rho$ over a complete local Noetherian ring $A$ with residue field $k$ is a representations $\rho:G\to \GL_n(A)$ equipped with
an isomorphism $\rho\otimes_Ak\cong\bar\rho$. We will be especially
interested in the case when $G = G_{\QQ,S}$, the Galois group of the largest extension of $\QQ$ unramified outside of a fixed finite set of places $S$, or when $G$ is the Galois
group of a local (especially $p$-adic) field.  These groups satisfy a certain finiteness
property $\Phi_p$: their open subgroups have only finitely many index-$p$ open subgroups. 
\begin{claim}
Assume that $G$ satisfies $\Phi_p$.  
There exists a complete local noetherian ring $R_{\bar\rho}$ and a deformation 
$\rho_{\rm^{{\rm{univ}}}}:G_{\QQ,S}\to \GL_n(R_{\bar\rho})$ such that for any deformation $(\rho_A,A)$ there exists a unique ring map $R_{\bar\rho}\to A$ such that $\rho_A$ factors through $\rho_{\rm^{{\rm{univ}}}}$, up to 
residually trivial conjugation.
(Here the map $\GL_n(R_{\bar\rho})\to \GL_n)(A)$ is induced by the map $R_{\bar\rho}\to A$.)
\end{claim}

The proof of this will be explained next time by Mok.
%Idea for a proof: (1) Construct a very big deformation $(\tilde R_{\bar\rho},\tilde\rho)$ such that for all $(\rho_A,A)$ there exists a map $\tilde R_{\bar\rho}\to A$ such that $\rho_A$ factors through $\tilde\rho$. One could do this with, say, a huge product, although we need $\tilde R_{\bar\rho}$ to be complete....
%(2) Descend to the ring of traces $R_{\bar\rho}$ for $\tilde\rho$. Now the ring should be universal as desired.

\begin{ex}
Let  $G$ be a finite group of order
not divisible by $p$ and consider
$G\stackrel{\bar\rho}{\to}\GL_n(k)$ where the characteristic of $k$ is $p$.
Then $R_{\bar\rho}=W(k)$, the ring of Witt vectors for $k$. This will follow from
the vanishing of $p$-torsion group cohomology for $G$ and the computation of
the ``reduced'' cotangent space to the deformation ring as in Mok's talk next time. 
\end{ex}
\begin{ex}
Suppose $\bar\rho:G_{\QQ,S}\to\GL_2(k)$ is odd, and $\H^2(G_\QQ, \Ad^0({\bar\rho}))=0$.
Then $R_{\bar\rho}=W(k)[\![X_1,X_2,X_3]\!]$. So generically, one expects the universal deformation ring to be 3-dimensional over $W(k)$. 
\end{ex}
\subsection*{5. Hecke algebras again}
Let $\bar\rho:G_{\QQ,S}\to\GL_2(k)$ be absolutely irreducible.
Pick a level $N$.
Let $f_1,\ldots, f_m$ be all the newforms of weight $2$ and level dividing $N$,
such that $\bar\rho_f\sim \bar\rho\otimes_k\bar\FF_p$; we assume this set of $f_i$'s
is non-empty!  
Let $f_i$ have coefficients contained in $K_i$, a number field
with maximal order $\cO_i$, and let $\cO_{i,\lambda}$ be the completion of $\cO_i$ in $\bar\QQ_p$.

Let $\TT$ be the $W(k)$-subalgebra of $\prod \cO_i$ spanned by the images of all the $T(\ell)$ with $(\ell, Np)=1$.

We have a map $\TT\to \cO_{i,\lambda}\to\bar\FF_p$
sending $T(\ell)$ to $\tr\rho(\Frob_\ell)$, independent of $i$.
Call the kernel $\m\subset \TT$, and let $\TT_\m$ be the completed localization.
Thus, the representation $$\prod\rho_{f_i}:G_{\QQ,S}\to\GL_2(\prod\cO_{i,\lambda})$$ admits
a conjugate valued in $\GL_2(\TT_m)$, by using the same kind of argument carried out earlier
with the elliptic curves of levels 11 and 33. 
Note that the residue field of $\TT_\m$ is equal to $k$.

By universality of $R_{\bar\rho}$ we obtain a local $W(k)$-algebra map $R_{\bar\rho}\onto \TT_\m$
satisfying $\tr\rho\Frob_\ell\mapsto T(\ell)$, so this map is surjective. 
An \textbf{$R=\TT$ theorem} says that this map identifies $\TT_\m$ with a certain quotient of $R_{\bar\rho}$ determined by local data.  (In practice one needs some more flexibility, such as
to include a Hecke operator at $p$, or to impose determinant conditions, to invert $p$ before
claiming to have an isomorphism, etc.) 
\pagebreak
\section*{Lecture 3. Mok on Deformations}
Let $G$ be a profinite group
and $\bar\rho:G\to\GL_n(k)$ a representation defined over a finite field $k$ of characteristic $p$.
Let $\Lambda$ be a complete discrete valuation ring with residue field $k$, e.g. $\Lambda=W(k)$.
Let $\cC_\Lambda$ be the category of artinian local $\Lambda$-algebras with residue field $k$, and local morphisms.
Let $\hat\cC_\Lambda$ be the category of complete Noetherian local $\Lambda$-algebras with residue field $k$, i.e. the pro-category of $\cC_\Lambda$.
\subsection*{1. Deformation functors}
Define ${\rm{Def}}(\bar\rho):\hat\cC_\Lambda\to {\rm{Sets}}$ by
\[{\rm{Def}}(\bar\rho)(A)=\{(\rho,M,\iota)\}/\sim \]
where $M$ is a free $A$-module of rank $n$, $\rho:G\to\GL_A(M)$ is a continuous 
representation, $\iota:\rho\otimes_Ak\cong \bar\rho$ is an isomorphism, and two
such triples are equivalent when the representations are isomorphic in a manner which
respects the $\iota$'s. 
Define the \textbf{framed} deformation functor ${\rm{Def}}^\square(\bar\rho)$ by
\[{\rm{Def}}^\square(\bar\rho)(A)=\{(\rho,M,\iota,\beta)/\sim\]
where $\beta$ is a basis for $M$ lifting the standard basis for $k^n$ under $\iota$.  
Morally, ${\rm{Def}}^\square$ is the set of liftings of $\bar\rho$ into $\GL_n(A)$. 

There is a forgetful functor ${\rm{Def}}^\square\to {\rm{Def}}$.

Equivalent definitions are
$${\rm{Def}}^\square(\bar\rho)(A)=\{\rho:G\to \GL_nA\,|\,\rho \bmod \mathfrak{m}_A = \bar\rho\},$$
$${\rm{Def}}(\bar\rho)(A)={\rm{Def}}^\square(\bar\rho)(A)/(\text{conjugation by }\Gamma_n(A):=
\ker(\GL_n(A)\to \GL_n(k))).$$

Note: it is easy to see that ${\rm{Def}}^\square(\bar\rho)(A)=\varprojlim_i{\rm{Def}}^\square(\bar\rho)(A/\m_A^i)$.
It is also true (but requires an argument) that ${\rm{Def}}(\bar\rho)(A)=\varprojlim_i{\rm{Def}}(\bar\rho)(A/\m_A^i)$.
In other words ``we can compute these functors on the level of artinian quotients'', so we just need to consider them on the category $\cC_\Lambda$. 

\subsection*{2. $p$-finiteness}
We cannot hope to represent ${\rm{Def}}(\bar\rho)$ or ${\rm{Def}}^\square(\bar\rho)$ in $\hat\cC_\Lambda$ (which only contains Noetherian rings) unless $G$ is ``not too big''.
\begin{defn}We say $G$ \textbf{satisfies the $p$-finiteness condition} if for every open subgroup $H\subset G$ of finite index, there are only finitely many continuous group homomorphisms
 $H\to\ZZ/p\ZZ$ (i.e., only finitely many open subgroups of index $p$). 
(This holds if and only if for any such $H$, the maximal pro-$p$ quotient of $H$ is topologically finitely generated.) \end{defn}

We are interested in two cases.
\begin{enumerate}
\item $G=G_K$ for a local field $K$ finite over $\QQ_\ell$ (allowing $\ell = p$!). 
\item $G=G_{K,S}$ for a number field $K$ and $S$ a finite set of ramified primes.
\end{enumerate}

In case (1), $H = G_{K'}$ for a finite extension $K'/K$, and the $p$-finiteness condition follows
from the fact that the local field $K'$ of characteristic 0 
has only finitely many extensions of any given degree
(such as degree $p$).  For (2), $H$ corresponds to some finite extension $K'/K$ unramified
outside of $S$, so the index-$p$ open subgroups of $H$ correspond to certain degree-$p$
extensions of $K'$ unramified away from the places of $K'$ over $S$.  
Thus, the $p$-finiteness follows from the \textbf{Hermite-Minkowski theorem},
which says that only finitely many extensions of $K$ of bounded degree unramified outside $S$.

Returning to the general situation, assume $G$ satisfies $p$-finiteness.
By \textit{Schlessinger's criterion}, we will eventually see that ${\rm{Def}}^\square(\bar\rho)$ is always representable in $\hat\cC_\Lambda$, so there exists a universal framed deformation ring $R^\square_{\bar\rho}\in \hat\cC_\Lambda$ and a universal framed deformation $\rho^\square_{\bar\rho}$ satisfying the natural universality property.
We will also see that ${\rm{Def}}(\bar\rho)$ is itself representable 
by a universal deformation ring $(R_{\bar\rho},\rho_{\rm^{{\rm{univ}}}})$, at least when $\End_G(\bar\rho)=k$.
This will be the case if $\bar\rho$ is absolutely irreducible,
and also if $n=2$ and $\bar\rho$ is a non-split extension of distinct characters.

\subsection*{3. Zariski tangent space to the deformation functors}
Let $k[\epsilon]$ denote the ring of dual numbers of $k$.
The \textbf{tangent space} to a functor $F:\hat\cC_\Lambda\to Sets$ is $F(k[\epsilon])=:t_F$.
Initially this is just a set; the hypotheses of Schlessinger's criterion give it a natural structure of
$k$-vector space (compatibly with natural transformations in $F$).   

Let $V\in {\rm{Def}}(\bar\rho)(k[\epsilon])=t_{{\rm{Def}}(\bar\rho)}$. Then by definition
there is given a specified isomorphism $V/\epsilon V\cong \bar\rho$, so we obtain an exact sequence
\[0\to\epsilon V\to V\to\bar\rho\to 0.\]
But it is easy to see that $\epsilon V$ is naturally $k[G]$-isomorphic to $\bar\rho$ as well.
Hence we see
\[t_{{\rm{Def}}(\bar \rho)}=\Ext^1_{k[G]}(\bar\rho,\bar\rho)=\H^1(G,\Ad(\bar\rho));\]
this respects the $k$-linear structure on  both sides.

More explicitly, given $\rho\in {\rm{Def}}^\square(\bar\rho)(k[\epsilon])$ we can write
$\rho(g)=\bar\rho(g)+\epsilon\Phi(g)\bar\rho(g)$
for $\Phi(g)\in \Ad(\bar\rho)$.
One can compute that the condition that $\rho$ is a group homomorphism is the 1-cocycle condition on $\Phi$.
So $t_{{\rm{Def}}^\square(\bar\rho)}=Z^1(G,\Ad(\bar\rho))$.
Similarly one checks that two framed deformations are conjugate under
$\Gamma_0(k[\epsilon])=I_n+\epsilon M_n(k)$ 
if and only if their associated cocycles differ by a $1$-coboundary.
We conclude that $t_{{\rm{Def}}(\bar\rho)}=\H^1(G,\Ad(\bar\rho))$,
and $$\dim_kB^1(G,\Ad(\bar\rho))=\dim \Ad(\bar\rho)-\dim \H^0(G,\Ad(\bar\rho))$$ 
is the \textbf{number of framed variables}.
The $p$-finiteness hypothesis says precisely that $\dim Z^1,\dim \H^1<\infty$.
If moreover $\End_G(\bar\rho)=k$ then $h^0(G,\Ad(\bar\rho))=1$,
and we are in the representable situation. The forgetful functor ${\rm{Def}}^\square(\bar\rho)\to {\rm{Def}}(\bar\rho)$ induces a map $R_{\bar\rho}\to R^\square_{\bar\rho}$, which turns out to be formally smooth, and thus realizes $R^\square_{\bar\rho}$ as a ring of formal power series (in some number $d$ of variables) over $R_{\bar\rho}$.
The number $d$ is precisely the number of framed variables, which in this case is $n^2-1$. 

Concretely, what is going on is that if $\bar\rho$ has only scalar endomorphism
(so likewise for any lifting of $\bar\rho$) and we consider the universal deformation
$R_{\bar\rho}$ then to ``universally'' specify a basis which residually lifts the identity 
is precisely to applying conjugation by a residually trivial matrix which is unique up to a unit scaling
factor.  And we can eliminate the unit scaling ambiguity by demanding
(as we always may in a unique way) that the upper left matrix entry is not merely a unit
but is equal to 1. Thus, the framing amounts to specifying a ``point'' of 
the formal $R_{\bar\rho}$-group of ${\rm{PGL}}_n$ at the identity, which thereby proves 
the asserted description of the universal framed deformation ring in these cases as 
a formal power series ring over $R_{\bar\rho}$ in $n^2 - 1$ variables.
To be explicit, over 
$$R^\square(\bar\rho) = R(\bar\rho)[\![Y_{i,j}]\!]_{1 \le i, j \le n, (i,j) \ne (1,1)}$$
the universal framed deformation is the lifting 
$\bar\rho_{\rm^{{\rm{univ}}}}$ equipped with the basis obtained
from the standard one by applying the invertible matrix
$1_n + (Y_{i,j})$ where $Y_{1,1} := 0$.

It must be stressed that we will later need to work with cases in which
$\bar\rho$ is {\em trivial} (of dimension 2), so $R_{\bar\rho}$ does not generally exist.
This is why the framed deformation ring is useful. 

\subsection*{3. References}
\begin{itemize}
\item Mazur's articles in ``Galois groups over $\QQ$'' and ``Modular Forms and Fermat's Last Theorem''.
\item Kisin's notes from CMI summer school in Hawaii.
\end{itemize}
\subsection*{4. More on Zariski tangent spaces to deformation functors}
From now on fix $G$ to be either $G_K$ for local $K$ or $G_{K,S}$ for a number field $K$.
Fix $\bar\rho:G\to\GL_n(k)$ and suppose the characteristic of the finite field $k$ is $p$.
If $F$ is a deformation functor represented by $R\in \hat\cC_\Lambda$, recall that
\[F(A)=\Hom_{\Lambda\text{\rm{-alg}}}(R,A),\qquad t_F=F(k[\epsilon])=\Hom_{\Lambda\text{\rm{-alg}}}(R,k[\epsilon])=\Hom_{\Lambda\text{\rm{-alg}}}(R/(\m^2_R+\m_\Lambda R),k[\epsilon]).\]
The last equality is because the $\Lambda$-algebra maps are \textit{local} morphisms, so in particular they send $\m_R$ to $\epsilon k[\epsilon]$, and hence $\m_R^2$ to zero.
But by general nonsense we have
\[R/(\m_R^2+\m_\Lambda R)=k\oplus \frac{\m_R}{\m_R^2+\m_\Lambda R},\]
where the second summand is square zero.
Thus we see
\[t_F=\Hom_k(\frac{\m_R}{\m_R^2+\m_\Lambda R},k)=t_R^*,\]
where for $A\in \hat \cC_\Lambda$ we define the \textbf{reduced Zariski cotangent space of $A$} to be
\[t_A^*=\frac{\m_A}{\m_A^2+\m_\Lambda R}.\]
\textit{Exercise.} Fix a map $A\stackrel{f}{\to}B$ in $\hat \cC_\Lambda$.
Then $f$ is surjective if and only if $t^*_f:t_A^*\to t_B^*$ is surjective.
[Use completeness... it's a Nakayamal's lemma sort of thing.]

A corollary of the Exercise is that if $d=\dim_k t_F=\dim_k t_R^*$
then we can pick a $k$-basis $x_1,\ldots, x_d$ of $t_R^*$,
lift it to a collection $\tilde x_i\in \m_R\subset R$,
and then the map $\Lambda[\![X_1,\ldots, X_d]\!]\to R$ sending $X_i$ to $\tilde x_i$
will be surjective.
\textit{A priori} bounds for the number of generators in the kernel
(and hence on the dimension of $R$) 
can be obtained by estimating certain $\H^2$s in the cohomology of $G$, which will be discussed later.
These dimension bounds are sometimes useful, but usually not strong enough to 
give good control on $R$. 

%\subsection*{5. Formal smoothness of  ${\rm{Def}}^\square(\bar\rho)\to {\rm{Def}}(\bar\rho)$}
%Suppose $\End_G(\bar\rho)=k$. Then ${\rm{Def}}(\bar\rho)$, resp. ${\rm{Def}}^\square(\bar\rho)$,
%is represented by $R(\bar\rho)$, resp. $R^\square(\bar\rho)$.
%We would like to study $R$, and hopefully $R^\square$ is easier to get our hands on, and it would be nice if we could show that $R\to R^\square$ (which, recall, was induced from the forgetful map ${\rm{Def}}^\square\to {\rm{Def}}$) is a formally smooth algebra of relative dimension $n^2-1$.

%One can do this by verifying Grothendieck's criterion, but it also possible to do it directly. The idea is to show that the map ${\rm{Def}}^\square\to {\rm{Def}}$ is \textbf{relatively representable}. By definition, a morphism of functors $f:F\to F'$
%from $\hat \cC_\Lambda$ to sets
%is relatively representable if for all $A\in \hat \cC_\Lambda$,
%the fiber product of functors $h_A\dtimes_{F'}F$ is representable.
%(The fiber product of Set-valued functors is formed ``level-wise'', in Sets.)
%Here $h_A$ is the covariant Yoneda functor $\Hom_{\Lambda\text{\rm{-alg}}}(A,\bullet)$ corresponding to $A$. What does this mean explicitly, in our case? 
%\begin{claim}
%There exists a collection of data (unique up to unique isomorphism), consisting of a morphism $A\to A^\square$ in $\hat \cC_\Lambda$, a deformation $\rho_A^\square:G\to \GL_n A^\square$ of $\rho_A$ (i.e. $\rho_A^\square\cong \rho_A\otimes_A A^\square$), and a basis $\beta^\square$ for $\rho_A^\square$, which are universal in the following sense. Fix any morphism $A\to B$ in $\hat\cC_\Lambda$ and any $(\rho_B,\beta_B)\in {\rm{Def}}^\square(\bar\rho)(B)$ [so $\rho_B$ is a deformation of $\bar\rho$
%and $\beta_B$ is a basis for $\rho_B$ which reduces to the standard basis for $k^n$], such that the diagram
%\[\xymatrix{{\rm{Def}}^\square(\bar\rho)\ar[d]&h_B\ar[l]_{(\rho_B,\beta_B)}\ar[d]\\
%{\rm{Def}}(\bar\rho)&h_A\ar[l]^{\rho_A}}\]
%commutes. Here we have used the fact that $A\to B$ induces a natural transformation $h_B\to h_A$ by precomposition, and that by Yoneda's lemma,
%$\mathrm{Mor}(h_B,{\rm{Def}}^\square(\bar\rho))$ and $\mathrm{Mor}(h_A,{\rm{Def}}(\bar\rho))$
%can be identified with ${\rm{Def}}^\square(\bar\rho)(B)$ and ${\rm{Def}}(\bar\rho)(A)$, respectively, so that the elements $(\rho_B,\beta_B)$ and $\rho_A$ give rise to the indicated natural transformations. \textit{Then} there exists a unique morphism $A^\square\to B$ in $\hat\cC_\Lambda$ such that $\beta_B$ and $\rho_B$ is obtained by base change $\bullet \otimes_{A^\square}B$ from $\beta^\square$ and $\rho_{A}^\square$, respectively, so that there is a unique dotted arrow in the diagram
%\[\xymatrix{&&h_B\ar@/_/[lld]_{(\rho_B,\beta_B)}\ar@{-->}[ld]_{\exists!}\ar[ldd]\\
%{\rm{Def}}^\square(\bar\rho)\ar[d]&h_{A^\square}\ar[l]_{(\rho_A^\square,\beta^\square)}\ar[d]&\\
%{\rm{Def}}(\bar\rho)&h_A\ar[l]^{\rho_A}&}\]
%making the whole diagram commute.
%\end{claim}
%To see why the claim is true, we will construct $A^\square$ and $\beta^\square$ explicitly. (Note that $\beta^\square$ also depends on $A$, although I have suppressed that from the notation.) The construction will make the formal smoothness of ${\rm{Def}}^\square\to {\rm{Def}}$ apparent [\textit{since we'll see in some sense I don't fully comprehend, that the ``relative representing object'' is the functor sending $A\mapsto$ a power series ring over $A$ in $n^2-1$ variables --S.L.}].

%We have assumed that $\End_G(\bar\rho)=k$.
%By Nakayama's lemma [\textit{it would be good to fill in the details of this argument -- S.L.}] it follows that $\End_G(\rho_B)=B$ and hence $\Aut_G(\rho_B)=B^\times$. Fix any basis $\beta_A$ of $\rho_A$ that reduces to the standard basis of $\bar\rho$.
%Recall that ${\rm{Def}}^\square(\bar\rho)(B)=\{(\rho_B,\beta_B)\}/\cong$, where $\beta_B$ reduces to the standard basis of $\bar\rho$, and modding out by isomorphisms means that we consider such pairs up to conjugation by $\Gamma_n(B)=\ker(\GL_nB\to \GL_nk)$. This group clearly acts transitively on the set of all such pairs, so if we mod out by the $G$-automorphisms $B^\times$ of a fixed $\rho_B$, we see that ${\rm{Def}}^\square(\bar\rho)(B)$ is a principal homogeneous $T_B$-set
%(a.k.a. a $T_B$\textbf{-torsor}), where
%\[T_B=\Gamma_n(B)/B^\times=\ker\(\PGL_nB\to \PGL_nk\).\]
%So to find $A^\square, \beta^\square$, we should look at the coordinate ring of $\PGL_n$ at the identity $I_n$. The homogenous coordinate ring of $\PGL_n$ is generated by $X_{ij}$ for $1\leq i,j\leq n$. Now pick affine coordinates $X_{ij}/X_{11}=\delta_{ij}+Y_{ij}$ for $1\leq i,j\leq n, (i,j)\neq (1,1)$
%[note that $\Gamma_nB$ lands on the identity on $\GL_nk$, so its diagonal entries are certainly nonzero, so we can divide by $X_{11}$ to obtain affine coordinates] where the $Y_{ij}$ coordinates are understood to be in the maximal ideal of the ring we are making. Hence define
%\[A^\square=A[[\{Y_{ij}\}_{1\leq i,j\leq n, (i,j)\neq (1,1)}]\!],\]
%a power series ring in $n^2-1$ variables.
%For the universal basis, if $\beta_A$ is the vectors $v_1,\ldots, v_n$
%then take
%$\beta^\square=(v_1,\ldots, v_n)[\delta_{ij}+Y_{ij}]$, in the sense of matrix multiplication.

\subsection*{5. Examples}
\subsubsection*{A local case}
Let $K/\QQ_\ell$ be local with $\ell\neq p$ and $G=G_K$.
Let $\bar\rho$ be the trivial representation of dimension $n$.
Then in particular $\End_G\bar\rho\supsetneq k$, so only the framed deformation functor is representable.
In this case we can actually construct $R^\square(\bar\rho)$ by hand.
If $\rho:G\to \GL_nA$ is a deformation of the trivial representation $\bar\rho$,
then $G$ lands in the kernel $\Gamma_nA\subset \GL_nA$.
Now $\Gamma_nA=I_n+M_n(\m_A)$, explicitly, which is a pro-$p$ group
isomorphism to the additive group $M_n(A)$. In particular $\rho$ factors throug h the maximal pro-$p$ quotient of $G$.

In particular $\rho|_{I_K}$ factors through the $p$-part of the tame quotient $I_K^{\rm{tame}}=
I_K/I_K^{\rm{wild}}$ of the inertia $I_K$ of $K$.
The picture to keep in mind is the tower of field extensions
\[K\into K^{\rm{unr}}\into K^{\rm{tame}}\into \bar K.\]
Now from the structure of local fields we know that the $p$-part of $I_K^{\rm{tame}}$
is
\[I_{K}^{{\rm{tame}},(p)}=\ZZ_p(1).\]
Here the twist means that if $\sigma\in I_K^{{\rm{tame}},(p)}$
then $\Frob_K\sigma \Frob_K^{-1}=\sigma^q$
where $q=\ell^r=\#(\cO_K/\m_K)$.
Fix a lift $f\in G$ of $\Frob_K$
and $\tau$ a topological generator of $I_K^{{\rm{tame}},(p)}$.
What we can conclude is that a lift $\rho$ to any $A$ is specified by the images of $f$ and $\tau$, subject to the relation
\[\rho(f)\rho(\tau)=\rho(\tau)^q\rho(f).\]
So we can take 
\[R^\square(\bar\rho)=\Lambda[\![\{f_{ij},\tau_{ij}\}_{1\leq i,j\leq n}]\!]/I\]
where the ideal of relations $I$ is generated by the ones given by the matrix equations
\[[I_n+(f_{ij})][I_n+(\tau_{ij})]=[I_n+(\tau_{ij})]^q[I_n+(f_{ij})].\]
\subsubsection*{A global case} For a global case we'll consider \textit{characters} of $G=G_{K,S}$.
Note that we have a wonderful fact in this case. The Teichm\"uller lift $[\cdot]:k\to W(k)$ is a multiplicative section of $W(k)\to k$. This allows us to twist any character $\bar\rho$ by 
the Teichm\"uller lift $[\bar\rho^{-1}]$ of its reciprocal.  
to conclude that $R(\bar\rho)=R(\id)$ where $\id:G\to k^\times$ is the trivial character.
In other words, the universal deformation of a character $\bar\rho$ is just a twist
of the universal deformation of the trivial character (using the same coefficient ring).

Arguing just like in the local case, it follows that any lift $\rho$ to $A$ of the trivial mod $p$ character $\bar\rho$, must factor through the maximal pro-$p$ quotient $G_{K,S}^{{\rm{ab}},(p)}$ of 
the abelianization of $G_{K,S}$.

Let us specialize now to the case $K=\QQ$ [the case of a general number field is similar, but requires class field theory]. Assume $p\in S$, since otherwise stuff is boring.
By the Kronecker-Weber theorem we know that $G_{\QQ,S}^{\rm{ab}}=\prod_{\ell\in S}\ZZ_\ell^\times$,
which implies that the maximal pro-$p$ quotient is
\[G_{\QQ,S}^{{\rm{ab}},(p)}=\prod_{\ell\in S, \ell\equiv 1(p)}(\FF_\ell^\times)^{(p)}\times(1+p\ZZ_p).\]
So we can, in this case, simply take $R=\Lambda[\![G_{\QQ,S}^{{\rm{ab}},(p)}]\!]$ to be the formal group algebra over $\Lambda$.
From the description of $G_{\QQ,S}^{{\rm{ab}},(p)}$ we can be very explicit:
\[R=\frac{\Lambda[\![\{X_\ell\}_{\ell\in S, \ell\equiv 1(p)},T]\!]}{(\{((X_\ell+1)^{p^{\ord_p(\ell-1)}}-1)\}_{\ell\in S,\ell\equiv 1(p)})}\]
In particular if $S=\{p,\infty\}$ then $R\cong\Lambda[\![T]\!]$.

For a general number field $K$ this relates to the \textit{Leopoldt conjecture}
which says that $\rk_{\ZZ_p}(G_{K,S}^{{\rm{ab}},(p)})=1+r_2$, where $r_2$ is the number of conjugate pairs of complex embeddings of $K$.

\subsection*{6. Local and Global}
We can relate the two examples from the last subsection in the following manner, which will
be extremely important later in one of Kisin's key improvements of Wiles' method.  
Let $G=G_{K,S}$, $\bar\rho:G_{K,S}\to \GL_n(k)$ a fixed residual representations,
and $\Sigma$ a finite set of primes.
For each $v\in \Sigma$ we have
\[\bar\rho|_{G_v}:G_{K_v}=G_v\into G_K\onto G_{K,S}\stackrel{\bar\rho}{\to}\GL_n(k).\]
We have local framed deformation rings $R^\square_v:=R^\square(\bar\rho|_{G_v})$.
Define a variation of the global framed deformation functor by
\[{\rm{Def}}^{\square,\Sigma}(\bar\rho)(A)=\{(\rho_A,\{\beta_v\}_{v\in\Sigma})\}/\sim;\]
here, $\rho_A$ is a deformation of $\bar\rho$ and $\beta_v$ is a basis for $\rho_A|_{G_v}$ which reduces to the standard basis for $\bar\rho$.
Then in fact ${\rm{Def}}^{\square,\Sigma}(\bar\rho)$ is also representable, by a ring $R^{\square,\Sigma}_{K,S}$. For each $v\in \Sigma$ we have a forgetful map
\[{\rm{Def}}^{\square,\Sigma}(\bar\rho)\to {\rm{Def}}(\bar\rho|_{G_v})\]
and hence on the revel of representing objects, an algebra
\[R_v^\square \to R_{K,S}^{\square,\Sigma}.\]
In concrete terms, this is saying that if we form the universal deformation of
$\bar\rho$ equipped with a framing along $\Sigma$ and then forget
the framing away from $v$ and restrict to $G_v$, the resulting framed deformation of
$\bar\rho|_{G_v}$ 
with coefficients in $R_{K,S}^{\square,\Sigma}$ is uniquely obtained by specializing
the universal framed deformation of $\bar\rho|_{G_v}$ along
a unique local $\Lambda$-algebra homomorphism $R_v^{\square} \rightarrow R_{K,S}^{\square,\Sigma}$.

Hence, by the universal property of completed tensor products (to be discussed
in Samit's talk rather generally) we get an important map
\[\hat\bigotimes_{\Lambda}R^\square_v\to R^{\square,\Sigma}_{K,S}\]
in $\widehat{\mathcal{C}}_{\Lambda}$.  
(Note that we have to take the completion of the algebraic tensor product, which is not itself a complete ring. For example, $\Lambda[\![x]\!] \otimes_{\Lambda} \Lambda[\![y]\!]$ is a gigantic non-noetherian ring,
but the corresponding completed tensor product is $\Lambda[\![x,y]\!]$.)  
This is a rather interesting extra algebra structure on the global
framed deformation ring, much richer than its mere $\Lambda$-algebra structure; of course,
this all has perfectly good analogues without the framings, assuming that $\bar\rho$ and its
local restrictions at each $v \in \Sigma$ have only scalar endomorphisms.  

This idea of viewing
a global deformation ring as an algebra over a (completed) tensor product of local
deformation rings is the key to
Kisin's method for ``patching'' deformation rings in settings going far beyond the original Taylor-Wiles
method (where only the $\Lambda$-algebra structure was used).
\section*{Lecture 4. Brian on Characteristic Zero points of Deformation Rings}
\subsection*{1. Some observations}
Fix $\bar\rho:G_{\QQ,S}\to \GL_2(k)$ absolutely irreducible, and let $\rho:G_{\QQ,S}\to \GL_2(R)$ be the universal deformation. We're interested in the map $R\to \TT_\m$ for some Hecke algebra defined in terms of $\bar\rho$. Note that the Hecke algebra is
1-dimensional, and even finite free over $\ZZ_p$. The universal deformation ring $R$, however, often has dimension $>1$ and nonzero $p$-torsion. In other words, the surjection $R\onto \TT_\m$ is not even close to being an isomorphism in general.

\begin{ex}
Consider $X_0(49)$ which is an elliptic curve. [Cf. Nigel Boston's papers on explicit deformation rings for the details of this example.] Let $\bar\rho$ the representation from the $3$-torsion of $E$, and let $S=\{3,7,\infty\}$. Boston computed the universal deformation as
\[\rho:G_{\QQ,S}\to \GL_2\(\frac{\ZZ_3[\![x_1,x_2,x_3]\!]}{(1+x_1)^3-1}\).\]
Just by looking at the ring on the right side, it's clear that its dimension is at least 2. (This example doesn't illustrate the phenomenon of $p$-torsion, but oh well...)
\end{ex}
Morally, the reason for the higher dimension of 
$R$ is that we are not imposing any local conditions at all for the places in $S$.

A key observation is that even when we succeed in proving a modularity lifting theorem, we don't know until we're done that $R$ is $\ZZ_p$-finite and flat. In other words, even when in fact $R$ turns out to be nice, we have very little grasp of why it is nice without proving an $R=\TT$ theorem.

However, this is really not so bad.  For example, if we could show that $R[1/p]\cong \TT_m[1/p]$, that's totally fine. After all, we're trying to study deformations of $\bar\rho$ over $p$-adic integer rings, which are $p$-torsion free and reduced, so we rig the Hecke algebra to have the same properties. In other words, \textbf{we only care about the ``$p$-adic points'' of $R$} so we can just as well study the structure of $R[1/p]/\text{nilpotents}$. And via Kisin's methods, it turns out that a thorough understanding of the ``structure'' of this ring is attainable in interesting cases and
is exactly what is needed for modularity lifting theorems. Things we would like to know:
\begin{itemize}
\item Characterize in some moduli-theoretic manner the connected components of its spectrum
(e.g., so we can detect when two $p$-adic points lie on the same component). 
\item Dimension.
\item Singularities, i.e. the extent to which an appropriately defined notion of smoothness fails to hold.
\end{itemize}
For the last point, it is just as good in practice to pass to a formally smooth $R$-algebra
(such as a power series ring over $R$). So we can consider the framed deformation ring.

\begin{rem}
A key point is that $R[1/p]$ is \textbf{very} far from being a local ring.
For example, say $R=\ZZ_p[\![x]\!]$ (which is a rough prototype of the sort of ring that arises). Then 
$$R[1/p]=\ZZ_p[\![x]\!][1/p]=\{f\in \QQ_p[\![x]\!]\mid\text{denominators are \textit{bounded} powers of $p$}\}\subsetneq \QQ_p[\![x]\!].$$ 
This ring has lots of $\QQ_p$-algebra maps $\ZZ_p[\![x]\!][1/p]\onto \cO_K[1/p]$
for finite extensions $K/\QQ_p$, sending $x$ into $\m_K$.
Hence it has lots of maximal ideals.
\end{rem}
\subsection*{2. Digression on Jacobson rings}
\begin{defn}A \textbf{Jacobson ring} is a Noetherian ring $A$ such that any $\p\in \Spec A$ is the intersection of the maximal ideals containing $\p$.\end{defn}

Clearly a quotient of a Jacobson ring is Jacobson.  Less evident, but in the exercises of Atiyah-MacDonald,
is that a finitely generated algebra over a Jacobson ring is Jacobson.  Note that any field is Jacobson,
as is any Dedekind domain with {\em infinitely many} primes (but not a dvr, nor a local ring
which is not 0-dimensional!).  In particular, a general localization of a Jacobson ring is
certainly not Jacobson, though localization at a single element is (since it is a finitely generated algebra).

A consequence of the definition is that if $X_0=\text{MaxSpec}(A)\stackrel{j}{\into}\Spec A=X$, then $j$ is a dense \textit{quasihomeomorphism}, which means that $U_0=X_0\cap U\leftrightarrow U$ is a bijection between the collections of open sets in $X_0$ and $X$.
Jacobson rings abstract the nice properties enjoyed by algebras of finite type over a field.

\begin{claim} If $R$ is a quotient of a formal power series ring
over a complete dvr $A$ with uniforizer $\pi$ then
$R[1/\pi]$ is Jacobson, and for all maximal ideals $\m\subset R[1/\pi]$,
the quotient $R[1/\pi]/\m$ is finite over the fraction field $K = A[1/\pi]$ of $A$.
Moreover, every $K$-algebra map from $R[1/\pi]$ to a finite extension 
$K'$ of $K$ carries $R$ into the valuation ring $A'$ of $K'$, with the map 
$R \to A'$ actually a local map.
\end{claim}

Note it is elementary that every $K$-algebra map from $R[1/\pi]$ to a finite extension
$K'$ of $K$ has kernel that is maximal:  the kernel $P$ is at least a prime ideal, and $R[1/\pi]/P$ is an intermediate ring between the field $K$ and the field $K'$ of finite degree over $K$, so it is a domain of finite dimension over a field (namely $K$) and hence is itself a field.  Hence, $P$ is maximal.

Also, everything in the Claim can be deduced from facts in rigid geometry concerning 
$K$-affinoid algebras, by using the approach in deJong's IHES paper {\em Crystalline Dieudonn\'e
theory via formal and rigid geometry}.  For convenience, we give
a direct proof using commutative algebra, avoiding rigid geometry 
(but inspired by it for some of the arguments).

The proof of the Claim is somewhat long (and was omitted in the lecture). 

\begin{proof}
To prove the claim, first note that if the claim holds for $R$ then it holds for any quotient of $R$.
Hence, it suffices to treat the case when $R = A[\![x_1,\dots,x_n]\!]$ is a formal power series ring over $A$.
We first check the more concrete second part of the Claim: for finite $K'/K$, any $K$-algebra map 
$R[1/\pi] \to K'$ carries $R$ into the valuation ring $A'$ of $K'$ with $R \to A'$
 moreover a local map.  In other words, we are studying $A$-algebra maps 
 $R \to K'$.  This can be uniquely ``promoted" to an $A'$-algebra map
$$A' \otimes_A R \to K',$$
and we can pass the tensor product through the ``formal power series" formation since 
$A'$ is a finite free $A$-module.  In other words, we can rename $A'$ as $A$ to reduce to the case 
$K' = K$.  So we claim that any $A$-algebra map $R \to K$ must be ``evaluation" at an 
$n$-tuple in the maximal ideal of $A$.
If we can show it carries each $x_i$ to some $a_i$ in the maximal ideal of 
$A$ then the map kills $x_i - a_i$ for all $i$.  By completeness of 
$R$ it would be legal to make a ``change of variables" renaming $x_i - a_i$ as $x_i$ to reduce to the case when the map kills all $x_i$'s.  Since the quotient of $R$ by the ideal generated by the 
$x_i$'s is identified with $A$, after inverting $\pi$ we get $K$ (as a $K$-algebra!), 
so we'd have proved what we want.

Let's now show that indeed each $x_i$ is carried to some $a_i$ in the maximal ideal of $A$.   By composing the given $A$-algebra map $R \to K$ with the natural inclusion 
$A[\![x_i]\!] \to R$ we are reduced to the case $n=1$.   That is, we wish to prove that any 
$A$-algebra map $A[\![x]\!] \to K$ must carry $x$ to an element $a$ in the maximal ideal of $A$.   
This map must kill some nonzero $f \in A[\![x]\!]$, as $A[\![x]\!][1/\pi]$ has infinite 
$K$-dimension as a vector space, and we can write $f = \pi^e f_0$ for some 
$e \ge 0$ and some $f_0$ not divisible by $\pi$.  Thus, $f_0$ also dies in $K$, so by renaming it as 
$f$ we arrange that $f$ has some coefficient not divisible by $\pi$.  This coefficient must occur in positive degree, as otherwise $f$ would be a unit, which is absurd (as it is in the kernel of a map to a field).  Now by the formal Weierstrass Preparation Theorem (in one variable --see Lang's {\it Algebra}), 
if $d > 0$ is the least degree of a coefficient of $f$ not divisible by $\pi$ then $f$ is a unit multiple of a ``distinguished" polynomial:  a monic polynomial in $x$ of degree $d$ over $A$ with all lower-degree coefficients divisible by $\pi$.  Scaling away the unit, we can assume that 
$f$ is a monic polynomial of degree $d > 0$ with all lower-degree coefficients divisible by 
$\pi$.  Hence, $A[\![x]\!]/(f) = A[x]/(f)$ by long-division of formal power series (thanks to completeness of 
$A$!).  Our map of interest therefore ``is" an $A$-algebra map
$$A[x]/(f) \to K$$
and so it carries $x$ to an element $a$ of $K$ that is a root of $f$.  Since $f$ is monic over $A$, we see 
$a \in A$.  Since $f$ has all lower-degree coefficients in the maximal ideal, necessarily 
$a$ is in the maximal ideal too.  That completes the proof of the second part of the Claim.


Now it remains to show the first part of the Claim:  $R$ is Jacobson, and if $M$ is a maximal ideal of 
$R[1/\pi]$ then $R[1/\pi]/M$ is of finite degree over $A[1/\pi] = K$. We argue by induction on the number 
$n$ of variables (motivated by the method of proof of the analytic Weierstrass Preparation theorem over 
$\CC$ or non-archimedean fields), the case $n=0$ being trivial.  Also, it is harmless 
(even for the Jacobson property)
to make a finite extension on $K$ if we wish. We will use this later, to deal with a technical problem when the residue field 
$k$ is finite (which is of course the case of most interest to us).

Assume $n > 0$, and consider a nonzero $f \in R = A[\![x_1,\dots,x_n]\!]$ contained
in some chosen nonzero prime or maximal ideal; clearly $f$ can be scaled by 
$\pi$-powers so it is not divisible by $\pi$.
We want to get to the situation in which $f$ involves a monomial term that is just a power of a single variable.  Pick a monomial of least total degree appearing in $f$ with coefficient in $A^{\times}$.  
(Such a term exists, since $f$ is not divisible by $\pi$.) This least total degree $d$ must be positive (as otherwise $f(0) \in A^{\times}$, so $f \in R^{\times}$, a contradiction).  By relabeling, we may suppose 
$x_1$ appears in this monomial.  If $n = 1$, this term is an 
$A^{\times}$-multiple of a power of $x_1$, so we're happy.  Now assume $n > 1$ and consider the {\it homogeneous} change of variables which replaces $x_i$ with $x_i + c_i x_1$ for all 
$i > 1$ (and leaves $x_1$ alone), with $c_i \in A$ to be determined in a moment.  
Each degree-$d$ monomial
$$a_I x_1^{i_1} \cdots x_n^{i_n}$$
in $f$ (before the change of variable) with total degree $d$ contributes
$$a_I c_2^{i_2} \cdots c_n^{i_n} x_1^d$$
to the $x_1^d$ term after the change of variable (with $i_1 = d - (i_2 + \dots + i_n)$).  All other monomials can only contribute to $x_1^d$ with coefficient in maximal ideal of $A$.  Thus, these other terms can be ignored for the purpose of seeing if we get $x_1^d$ to appear with
an $A^{\times}$-coefficient after the change of variables.

To summarize (when $n > 1$), whatever $c_i$'s we choose in $A$, we get after change of variable that $x_1^d$ appears with coefficient $h(c)$ for
some polynomial $h$ in $n-1$ variables over $A$ that has
{\it some} coefficient in $A^{\times}$ (since $i_1$ is determined by $i_2, \dots,i_n$).  Thus, 
$h$ has nonzero reduction as a polynomial over the residue field $k$ of 
$A$, so as long as this reduction is nonzero at some point in 
$k^{n-1}$ we can choose the $c$'s to lift that into $A^{n-1}$ to get the coefficient of 
$x_1^d$ to be in $A^{\times}$.  If $k$ is infinite, no problem.  If $k$ is finite (case of most interest!), for some finite extension $k'$ of $k$ we can find the required point in $k'^{n-1}$, so go back and replace 
$A$ with the corresponding unramified extension (and the chosen prime with each of
the ones over it after scalar extension) to do the job.

The upshot is that after a suitable change of variables (and possible replacement of 
$A$ with a finite extension in case $k$ is finite), we can assume that $f$ contains some 
$x_1^d$ with an $A^{\times}$-coefficient. Thus, if we view $f$ in
$$R = (A[\![x_2,\dots,x_n]\!])[\![x_1]\!]$$
then it satisfies the hypotheses of the general Weierstrass Preparation (with complete coefficient ring) as in Lang's {\it Algebra}.  This implies that $f$ is a unit multiple of a {\it monic} polynomial in 
$x_1$ whose lower-degree coefficients are in the maximal ideal of 
$R' = A[\![x_2,\dots,x_n]\!]$ (which means $A$ if $n=1$).
We can therefore scale away the unit so that $f$ is such a ``distinguished" polynomial, and then do long division in $R'[\![x_1]\!]$ due to completeness of $R'$ to infer that
$$R/(f) = R'[\![x_1]\!]/(f) = R'[x_1]/(f).$$
This is a finite free $R'$-module!  

We may now draw two consequences.  First, if $P$ is a prime ideal of $R[1/\pi]$ containing $f$
then $R[1/\pi]/P$ is module-finite over the ring $R'[1/\pi]$ which is Jacobson by induction, so
$R[1/\pi]/P$ is Jacobson.  Hence, $P$ is the intersection of all maximals over it, whence
we have proved that $R[1/\pi]$ is Jacobson.  Second, for a maximal ideal $M$ of $R[1/\pi]$
containing $f$, the ring map $R'[1/\pi] \to R[1/\pi]/M$ is module-finite so its prime ideal kernel is actually maximal.  That is, we get a {\it maximal} ideal $M'$ of $R'[1/\pi]$ such that 
$R'[1/\pi]/M' \to R[1/\pi]/M$ is of finite degree.  By induction, 
$R'[1/\pi]/M'$ is of finite degree over $K$, so we are done.
\end{proof}


\subsection*{3. Visualizing $R[1/p]$}
Let $R=A[\![x_1,\ldots, x_n]\!]/(f_1,\ldots, f_m)$ and $K$ be in the last subsection.
Observe that $\Hom_{{\rm{loc.}}A{\rm{-alg}}}(R,A')=\Hom_{\mathrm{Frac}(A){\rm{-alg}}}
(R[1/\pi],A'[1/\pi]=\mathrm{Frac}(A'))$ for any finite dvr extension $A'$ of $A$. This suggests the following geometric perspective on the ring $R[1/\pi]$: it corresponds to the locus of geometric points
$(x_i)$ with coordinates in $\bar{\mathrm{Frac}(A)}$ 
lying in the open polydisk $\{|x_1|,\ldots,|x_n|<1\}$
at which the convergent power series $f_1,\ldots, f_m$ all vanish.
To make this viewpoint precise, one must regard the spaces in question as \textbf{rigid analytic spaces}.

\subsection*{4. Final thought}
We'll see that for Galois deformation rings $R$, the
completions of $R[1/p]$ at maximal ideals are deformation rings for \textit{characteristic zero} representations corresponding to the maximal ideals in question. This is very interesting, since $R$ itself was entirely about deforming $\mod p$ things! 

\subsection*{5. Back to examples of explicit universal deformation rings}
Caveat: These sorts of examples are kind of ``useless''.
The reference for N. Boston's examples is \textit{Inv. Math.} \textbf{103} (1991).
\subsubsection*{Example 1 [loc. cit., Prop. 8.1.]} Let $E:y^2=x(x^2-8x+8)$, an elliptic curve with complex multiplication by $\QQ(\sqrt{-2})$. Let $\bar\rho$
be the representation on the 3-torsion:
\[G_{\QQ,\{2?,3,5,\infty\}}\to \GL_2(\FF_3).\]
In general we know that there is some surjection $\ZZ_3[\![T_1,\ldots, T_d]\!]\onto R(\bar\rho)$ where we know the smallest $d$ is (by NAK) $d=\dim \m_R/(\m_R^2,3)$,
and $\m_R/(\m_R^2,3)=\H^1(G_{\QQ,\{2?,3,5,\infty\}},\Ad(\bar\rho))$.
Here the adjoint module is $\Ad(\bar\rho)=\End_{\FF_3}(\bar\rho)$ with $G_{\QQ,\{2?,3,5,\infty\}}$ acting by conjugation via $\bar\rho$.
In this particular case one can compute that $d=5$, so 
\[R(\bar\rho)=\ZZ_3[\![T_1,\ldots, T_5]\!]/I\]
where the ideal of relations has the form 
\[I=\delta\cdot (f,g)\]
for 
\[f=8u^4-8u^2+1,g=8e^3-4u,\qquad u=(1+T_4T_5)^{1/2}\]
and $\delta$ (which may involve all the $T_i$s) is obtained by choosing a certain presentation of a pro-$3$ group (coming from a wild inertia group, perhaps for the splitting field of $\bar \rho$?), and setting $\delta=\det(\rho^{{\rm^{{\rm{univ}}}}}(y)-1)$
where $y$ is a particular generator in said presentation. 
Consequently one can write down some ``explicit'' deformations of $\bar\rho$ by looking for solutions to the relations above in a $\ZZ_3$-algebra...

\subsubsection*{Example 2 [Boston-Ullom]} Let $E=X_0(49)$
and $\bar\rho=\bar\rho_{E,3}$ the representation on the 3-torsion:
\[G_{\QQ,\{3,7,\infty\}}\to \GL_2(\FF_3).\] 
In this case the universal deformation ring is particularly simple:
\[R\cong \ZZ_3[\![T_1,\ldots, T_4]\!]/((1+T_4)^3-1).\]
We have
$(1+T_4)^3-1=T_4(T_4^2+3T_4+3)$. The quadratic factor is irreducible over $\QQ_3$, but not over $\QQ_3(\sqrt{-3})$. So, loosely speaking, $\Spec R$ has two 
irreducible components but three ``geometric'' irreducible components: $T_4=0$
and $T_4$ equal to either of the conjugate roots of the quadratic factor.
For example, to recover the $3$-adic Tate module of $E$ one considers the map $R\to \ZZ_3$
given by mapping all $T_i$s to 0. This is a sort of ``canonical'' $\ZZ_3$-point of $\Spec R$.
Since the quadratic factor of the relation is $\QQ_3$-irreducible, so that quadratic field
cannot be $\QQ_3$-embedded into $\QQ_3$, {\it every} $\ZZ_3$-point
lies in the $T_4=0$ component.  

The lesson to take from this seems to be that it can be hard to detect components, or more generally aspects of the geometry, of $\Spec R$, when only looking at $p$-adic points over
a small field like $\QQ_p$; we have to expect to work with points in many finite extensions in order
to effectively probe the geometry.
All this is by way of motivation for our interest in characteristic zero points of deformation rings, and (for example) our willingness to throw out all possible nastiness at $p$ by studying $R[1/p]$ instead of $R$ itself.
\subsection*{6. Back to Characteristic $0$}
Now let $\Lambda$ be a $p$-adic dvr with fraction field $K$
and residue field $k$.
Let $R=\Lambda[\![X_n,\ldots, X_n]\!]/I$ be the universal deformation ring of a residual representation $\bar\rho:\Gamma\to \GL_N(k)$, for a profinite group $\Gamma$ satisfying the requisite $p$-finiteness conditions (e.g. $G_K$ for local $K$ or $G_{K,S}$ for a number field $K$).

\begin{rem} 
We have seen above that for any maximal ideal $\m\subset R[1/p]$, the residue field $R[1/p]/\m$ is of finite degree over $k$.
The intuition for this fact is that these closed points of $\Spec R[1/p]$ correspond to Galois orbits over $K$ of $\bar K$-solutions to $I=0$ in the open unit $n$-polydisk. (The case $n=1$ is a consequence of the Weierstrass Preparation Lemma. 
One \textit{can} relate the geometry of $\Spec R[1/p]$ to the geometry of the aforementioned ``rigid analytic space'' $I=0$.
For example, if $R[1/p]$ is connected (no nontrivial idempotents) then $I=0$ is connected in the sense of rigid geometry. One can also match up the dimensions of the components. The input for this equivalence is the (self-contained!) \S7 of de Jong's IHES paper {\em Crystalline Dieudonn\'e theory $\dots$}, but we
won't use it.
\end{rem}

We also saw above that any
$K$-algebra map $R[1/p]\to K'$ for a finite extension $K'/K$ is actually given by sending all the $X_i$s to elements $x_i\in\m_{K'}\subset \cO_{K'}\subset K'$. In other words, $R\subset R[1/p]$ actually lands in $\cO_{K'}$!

Now fix a $K$-algebra map $x:R[1/p]\onto K'$ into a finite extension of $K$. (``Contemplate a $p$-adic point of $\Spec R$''.) Let
\[\rho_x:\Gamma\stackrel{\rho^{{\rm^{{\rm{univ}}}}}}{\to}\GL_N(R)\to \GL_N(R[1/p])\to \GL_N(K')\]
be the specialized representation.
(In the Boston-Ullom example above, when we take $x:R[1/3]\to \QQ_3$ to be the map sending all the $T_i$s to zero, then $\rho_x$ is the $3$-adic Tate module of $X_0(49)$.)

\textbf{Goal: Understand the dimension $\dim R[1/p]_{\m_x}=\dim R[1/p]^\wedge_{\m_x}$.} (Here $(\cdot)^\wedge$ denotes completion.)

For instance, is this complete local ring regular? Perhaps even a power series ring over $K'$? If so, then its dimension is $\dim \m_x/\m_x^2$.
\begin{thm}
Let $\rho_x^{{\rm^{{\rm{univ}}}}}:\Gamma\to \GL_N(R[1/p]_{\m_x}^\wedge)$ be induced from 
$\rho^{{\rm^{{\rm{univ}}}}}$ by the natural map $R\to R[1/p]_{\m_x}^\wedge$. Then the diagram
\[\xymatrix{\Gamma\ar[r]^-{\rho_x^{{\rm^{{\rm{univ}}}}}}\ar[rd]_{{\rm{cont}}}^{\rho_x}&\GL_N(R[1/p]_{\m_x}^\wedge)\ar[d]\\
&\GL_N(K')}\]
commutes, and in fact $\rho_x^{{\rm^{{\rm{univ}}}}}$ is the universal for continuous deformations of $\rho_x$. 

More precisely, if one considers the category $\hat\cC$ of complete local noetherian $K'$-algebras with residue field $K'$,
and the functor on the category $\cC$ of artinian quotients of objects in $\hat \cC$ which picks out those deformations of $\rho_x$ which are continuous for the $p$-adic topology on such artinian quotients, regarded as finite-dimensional $K'$-vector spaces, then $R[1/p]^\wedge_{\m_x}$ is the representing object.
\end{thm}
\begin{rem}
If $A$ is a complete local Noetherian $F$-algebra and the characteristic of $F$ is zero, and $A/\m=F'$ is a finite extension of $F$,
then there exists a unique $F$-algebra lift $F'\into A$. Why? By completeness we have Hensel's lemma and by characteristic zero we have $F'/F$ separable. So we can find solutions in $A$ to the defining polynomial of $F'$ over $F$.
\end{rem}
\subsubsection*{Why do we care about the theorem?}
\begin{enumerate}
\item The deformation ring $R[1/p]^\wedge_{\m_x}$
is isomorphic to $K'[\![T_1,\ldots, T_n]\!]$
if and only if $R[1/p]_{\m_x}^\wedge$ is regular (by the Cohen structure theorem), and the power series
description is precisely the condition that the corresponding 
deformation functor for $\rho_x$ is formally smooth (i.e., no obstruction to lifting artinian points in
characteristic 0).  This holds precisely when $\H^2(\Gamma,\Ad(\rho_x))=0$.  So that is interesting:
a computation in Galois cohomology in characteristic 0 can tell us information about the structure
of $R[1/p]$ at closed points.  
\item $(\m_x/\m_x^2)^\vee\cong \H^1_{{\rm{cont}}}(\Gamma,\Ad(\rho_x))$, by the continuity condition we imposed on the deformations in the theorem.
\end{enumerate}
Combining (1) and (2), we can check regularity of $R[1/p]$
at a closed point and in such cases then even compute $\dim_x R[1/p]$ 
by doing computations in (continuous) Galois cohomology with $p$-adic coefficients!
\subsection*{7. Proof of theorem}
\subsubsection*{Step 1: Reduce to the case $K'=K$}
Here is the trick. Set $\Lambda'=\cO_{K'}$. 
Note that $\Lambda'\otimes_\Lambda R$ is local because $(\Lambda'\otimes_\Lambda R)/\m_R=\Lambda'\otimes_\Lambda k = k'$ is a field.
The $\Lambda'$-algebra $\Lambda'\otimes_\Lambda R$ is the universal deformation ring of $\bar\rho\otimes_k k'$ (where $k'$ is the residue field of $K'$) when using $\Lambda'$-coefficients;
this behavior of deformation ring with respect
to finite extension of the coefficients will be proved in Samit's talk. Consider the diagram
\[\xymatrix{K'\otimes_K R[1/p]\ar[r]^{\qquad x'}\ar@{=}[d]&K'\\
(\Lambda'\otimes_\Lambda R)[1/p]&\\
\Lambda'\otimes_\Lambda R\ar[u]\ar[r]&\Lambda'\ar[uu]}\]

\textit{Exercise}: $(\Lambda'\otimes_\Lambda R)[1/p]_{\m_{x'}}^\wedge\cong R[1/p]_{\m_x}^{\wedge}$ as $K'$-algebras.

So we can rename $\Lambda'$ as $\Lambda$, completing the reduction.

\subsubsection*{Step 2:} Observe that since $\bar\rho$ is absolutely irreducible, so is $\rho_x$. Consequently any deformation of $\rho_x$ has only scalar endomorphisms.

\subsubsection*{Step 3:} Consider any deformation
\[\xymatrix{\Gamma\ar[r]^-\theta\ar[rd]_{\rho_x}&\GL_N(A)\ar[d]\\
&\GL_N(K)}\]
where $A$ is a finite local $K$-algebra with residue field $K$.
We would like to show that there exists a unique $K$-map $R[1/p]_{\m_x}^{\wedge}\to A$ which takes $\rho_x^{{\rm^{{\rm{univ}}}}}$ to $\theta$, up to conjugation.
Why is this sufficient? Because if so, then there would be lifts of $\rho_x$
to $\GL_N(A)$, one coming from $\rho_x^{{\rm^{{\rm{univ}}}}}$ and the other being $\theta$,
which are $\GL_N(A)$-conjugate to one another by some matrix $M$.
Upon reduction to $\GL_N(K)$, the matrix $\bar M$ would centralize $\rho_x$.
So by Step 2, $\bar M$ must be a scalar endomorphism $c\in K^\times$.
Consequently we can replace $M$ by $c^{-1}M$ to conclude that
the two lifts are conjugate to one another by a matrix which is residually trivial. The latter is precisely what we need to prove that $\rho_x^{{\rm^{{\rm{univ}}}}}$ is universal.
(Note that if we used framed deformations throughout then this little step wouldn't be needed.
It is important because in later applications we will certainly want to apply the Theorem to
cases for which $\bar\rho$ is not absolutely irreducible.  The reader can check that the proof
of the Theorem works in the framed setting once the preceding little step is bypassed.)

The map we need is the same as making a local $K$-algebra map 
\[R[1/p]_{\m_x}\to A\]
with the same property with respect to $\theta$,
since $A$ is a complete $K$-algebra. 
(Note that this ``uncompletion'' step is only possible since we already did Step 1! We originally completed $R[1/p]_{\m_x}$, which is a $K$-algebra and generally not a $K'$-algebra.) The latter is the same as a
 $K$-algebra map $R[1/p]\to A$
such that $R[1/p]\to A\to K$ is the original point $x$,
which takes $\rho^{{\rm^{{\rm{univ}}}}}$ to $\theta$.
(``It's all a game in trying to get back to $R$''.)
In other words, we wanted a dotted map in the diagram
\[\xymatrix{R\ar[r]\ar[d]_{\exists! \tilde x}&R[1/p]\ar[rd]_x\ar@{-->}[r]^{\exists!?}&A\ar[d]\\
\Lambda\ar[rr]&&K}\]
(The existence of $\tilde x$ is by one of the propositions from \S6.)
But $R[1/p]$ is just a localization of $R$
and $A$ is a $\Lambda[1/p]$-algebra (it is a $K$-algebra!),
so in fact the existence of a unique dotted map above
is equivalent to the existence of a unique dotted map $\alpha$ in the diagram
\[\xymatrix{R\ar[d]_{\tilde x}\ar@{-->}[r]_\alpha^{\exists!?}&A\ar[d]\\
\Lambda\ar[r]&K}\]
such that $\alpha$ takes $\rho^{{\rm^{{\rm{univ}}}}}$ to $\theta$.
Now unfortunately $A$ is not in the category $\hat\cC_\Lambda$ [typically it is something like $K[t]/(t^7)$], so
$\theta$ is not quite a deformation of $\bar\rho$, so we cannot appeal directly
to the universal property of $(R,\rho^{{\rm^{{\rm{univ}}}}})$. Instead we need to mess around a bit.

Here's the point. $A=K\oplus \m_A$ and $\m_A$ is a finite-dimensional $K$-vector space which is nilpotent. 
\begin{claim}$\m_A=\dirlim I$ where the limit is taken over
$\Lambda$-finite multiplicatively stable $\Lambda$-modules $I$.
\end{claim}
(Idea of the proof: take products and products and more products. By nilpotence and finite-dimensionality
of $\m_A$ over $K$, you don't have to keep going forever. Then take the $\Lambda$-span
of finite collections of such products to get the desired $I$'s.) 

Write $\Lambda_I$ for $\Lambda\oplus I$.

\textit{Lemma/Exercise}: Any $\Lambda$-algebra map $R\to A$ lands in some $\Lambda_I$. (Hint:
choose $I$ containing the images of all the $X$'s.)

So it's enough to show two things.
\begin{enumerate}
\item For some $I$ we have a map $R\to \Lambda_I$
giving a deformation $\theta_I$ of 
the ``integral lattice'' version $\rho_{\tilde x}$ of $\rho_x$.
The image of $\Gamma$ under $\rho^{\rm^{{\rm{univ}}}}$ is topologically finitely generated
(since $\GL_N(R)$ is essentially pro-$p$ and $\Gamma$ satisfies the $p$-finiteness condition), so 
then there exists \textit{some} $I_0$
such that $\theta$ factors through $\GL_N(\Lambda_{I_0})$, giving a map $\theta_{I_0}:\Gamma\to \GL_N(\Lambda_{I_0})$.
\item The map from (1) is unique. 
\end{enumerate}
Indeed, by then comparing any two $I$ and $I'$ with a common one, we'd get the desired existence
and {\it uniqueness} at the level of coefficients in $A$. 

To prove (1), note that $\Lambda_I\in \hat\cC_\Lambda$ and $\theta_I$ deforms $\rho_{\tilde x}$, and hence $\bar\rho$. Here is the picture:
\[\xymatrix{\rho^{{\rm^{{\rm{univ}}}}}\ar@{-->}[rr]^{\exists}\ar@{..>}[rd]&&\theta_I\ar@{..>}[ld]\\
&\rho_{\tilde x}\ar@{..>}[d]&\\
&\bar\rho&}\]
The induced map $R\to \Lambda_I$ respects the map to $\Lambda$ coming from the fact that $\rho_{\tilde x}$ deforms $\bar\rho$, because if not, then we would have
another map $R\to \Lambda_I\to \Lambda$, which contradicts the universal property of $R$.

To prove (2) just use the uniqueness from the universal property of $(R,\rho^{{\rm^{{\rm{univ}}}}})$ for deforms on $\hat\cC_\Lambda$.

\section{Samit on Dimensions of Deformation Rings}

This lecture is about getting bounds for the dimension
of deformation rings, by bounding the number of generators and relations. 
The reference for this lecture is Kisin's article in CDM,
or stuff from his Hawaii notes.

\subsection{Local setup and statement}
Let $K/\QQ_p$ be finite, $\cO=\cO_K,\pi$ a uniformizer, $k=\cO/(\pi)$,
$\Gamma$ a profinite group satisfying the $p$-finiteness condition ``$\Phi_p$'', and 
$\bar\rho:\Gamma\to \GL_n(k)$ a mod $\pi$ representation.  We consider
deformations to complete local noetherian $\cO$-algebras with residue field $k$. 
The framed deformation ring $R^\square_{\bar\rho}$ always exists, so 
we have a universal representation 
$$\Gamma\stackrel{\rho^{\square}_{{\rm{univ}}}}{\to}\GL_n(R^\square_{\bar\rho}).$$
Assuming $\End_\Gamma\bar\rho=k$, 
we also know $R_{\bar\rho}$ exists,
and we then get a universal deformation
$$\Gamma\stackrel{\rho^{{\rm{univ}}}}{\to}\GL_n(R_{\bar\rho}).$$
Recall that
$$D^\square_{\bar\rho}(k[\epsilon])=\Hom_k(\m_{R^\square}/(\m_{R^\square}^2,\pi),k)
\cong Z^1(\Gamma,\ad\bar\rho)$$
and $D_{\bar\rho}(k[\epsilon])=\H^1(\Gamma,\ad\bar\rho)$
as $k$-vector spaces.

\begin{thm}\label{samit1}
Let $r=\dim_k Z^1(\Gamma,\ad\bar\rho)$.
Then there exists an $\cO$-algebra isomorphism
$$\cO[\![x_1,\ldots, x_r]\!]/(f_1,\ldots, f_s)\cong R^\square_{\bar\rho}$$
where $s=\dim_k\H^2(\Gamma,\ad\bar\rho)$.
\end{thm}
\begin{cor}
\begin{itemize}
\item[(i)]$\dim R^\square_{\bar\rho}\geq 1+n^2-\chi(\Gamma,\ad\bar\rho)
= 1+n^2-h^0(\ad\bar\rho)+h^1(\ad\bar\rho)-h^2(\ad\bar\rho)$.
\item[(ii)]$\dim R_{\bar\rho}\geq 2-\chi(\Gamma,\ad\bar\rho)$.
\end{itemize}
\end{cor}
\begin{proof}[Proof of corollary]
From $\cO$ we get a contribution of $1$.
hence we get
$\dim R^\square_{\bar\rho}\geq 1+\dim Z^1-h^2$.
Now (i) follows formally noting that $\dim Z^0 = \dim C^0=n^2$.
(Use $h^1=\dim Z^1-\dim B^1$
and $\dim B^1=\dim C^0-\dim Z^0
=\dim C^0- h^0$.)
Then (ii) is immediate using the fact that $R_{\bar\rho}^\square$
is basically a $\PGL_n$-bundle over
$R_{\bar\rho}$.
\end{proof}

\subsection{Proof of Theorem \ref{samit1}}
Using completeness [exercise]
we can choose a surjection $$\phi:\cO[\![x]\!]:=\cO[\![x_1,\ldots, x_r]\!]\onto R^\square_{\bar\rho}.$$ 
(Send the $x_i$'s to elements which reduce to a basis for the tangent space
$Z^1(\Gamma,\ad\bar\rho)$ of the framed deformation ring.) 
The problem is to show that the minimal number of generators of
the kernel  $\JJ=\ker\phi\subset\cO[\![x]\!]$ is at most $s$.
Let $\mm=\m_\cO[\![x]\!]\subset\cO[\![x]\!]$ be the maximal ideal $(\pi, x_1,\ldots, x_r)$.
It would suffice to construct 
a linear injection $(\JJ/\mm\JJ)^{\ast} \into \H^2(\Gamma,\ad\bar\rho)$.
There is a subtle technical problem in an attempt to construct such an injection.  We explain the problem,
and then the fix to get around it.  

For each $\gamma\in \Gamma$ choose a set-theoretic lift $\tilde\rho(\gamma)\in\GL_n(\cO[\![x]\!]/\mm\JJ)$
of $\rho^\square(\gamma)\in\GL_n(\cO[\![x]\!]/\JJ)=\GL_n(R^\square)$.
We need to make this choice so that $\widetilde{\rho}$ is a {\em continuous} function
of $\gamma$.  It is not clear if the map 
$$\cO[\![x]\!]/\mm\JJ \onto \cO[\![x]\!]/\JJ$$
admits a continuous section as topological spaces, so it is not clear how
to find a continuous $\widetilde{\rho}$.  To handle this problem, we now prove:

Claim:  For $r > 0$, let $\JJ_r = (\JJ+\mm^r)/\mm^r \in \cO[\![x]\!]/\mm^r$ and let $\mm_r = \mm/\mm^r$.  For $r \gg 0$, the natural map
$\JJ/\mm\JJ \to \JJ_r/\mm_r \JJ_r$
is an isomorphism.

\begin{proof} The map is surjective, and for injectivity we have to show that $\JJ \cap (\mm \JJ + \mm^r) = \mm\JJ$ for large $r$.  Certainly $\mm\JJ$ lies in the intersection for all $r$, so since $\JJ/\mm\JJ$ has finite length we see that the intersection stabilizes at some intermediate ideal for $r \gg 0$.  This stabilizing ideal must then be the total intersection.  But by Artin-Rees applied to $\mm\JJ$ as a finite $\cO[\![x]\!]$-module, the intersection of all $(\mm\JJ+\mm^r)$'s is $\mm\JJ$.  
\end{proof}

By the Claim, to prove the desired result about minimal number of generators of $\JJ$, we can replace 
$\cO[\![x]\!]$ and $R^{\square} := R_{\bar\rho}^{\square}$ with their quotients by $r$th power of maximal ideal for some large $r$.  The quotient of $R^{\square}$ by $r$th power of its maximal ideal is universal in the category of complete local noetherian $\cO$-algebras whose maximal ideal has vanishing $r$th power (exercise!).   So working within this full subcategory of local $\cO$-algebras, we can still exploit universal mapping properties.  But we gain the advantage that now our rings are of finite length as $\cO/\pi^r$-modules, so in particular they're all discrete with their max-adic topology and hence the Galois representations which arise have open kernel.  We can therefore find the required continuous section, 
working throughout with local rings whose maximal ideal has a fixed but large order of nilpotence.

So we now proceed in such a modified setting (so the definition of $\JJ$ changes accordingly, but
the Claim shows that this does not affect $\JJ/\mm \JJ$, which is to say the minimal number of generators
of $\JJ$).  In particular, in the new setting we will construct a $k$-linear injection of
$\JJ/\m \JJ$ into $\H^2(\Gamma, \ad \bar\rho)$, thereby finishing the proof. 

For $f\in (\JJ/\mm\JJ)^{\ast}$.
let $$\rho_f(\gamma,\delta)=f(\tilde\rho(\gamma\delta)\tilde\rho(\delta)^{-1}\tilde\rho(\gamma)^{-1}-\id),$$
where we apply the map $f$ ``entry-wise'' to the given
matrix in ${\rm{Mat}}_{n\times n}(\JJ/\mm\JJ)$.
That is, the map $\phi_f$ has the form
$$\Gamma^2\to {\rm{Mat}}_{n\times n}(\JJ/\mm\JJ)\stackrel{f}{\to}
{\rm{Mat}}_{n\times n}(k).$$

Now we observe the following facts.
\begin{enumerate}
\item $\phi_f\in Z^2(\Gamma,\ad\bar\rho)$.
\item $[\phi_f]\in\H^2(\Gamma,\ad\bar\rho)$ is independent of the choice of lift $\tilde\rho$.
\item $f\mapsto [\phi_f]$ is $k$-linear.
\item $f\mapsto [\phi_f]$ is injective,
but more precisely we have
$[\phi_f]=0\Leftrightarrow$ we can choose $\tilde\rho$ to
be a homomorphism ``mod $\JJ_f$''
where $\JJ_f=\ker(\JJ\to \JJ/\mm\JJ\stackrel{f}{\to} k)
\Leftrightarrow f=0
\Leftrightarrow \JJ_f=\JJ$.
\end{enumerate}
Note that (4) provides the desired linear injection, and hence proves the theorem; (1)-(3) are 
necessary to make sense of (4).

Let us prove the facts above.
\begin{enumerate}
\item This is a formal computation, which goes as follows.
Note that we can identify ${\rm{Mat}}_{n\times n}(\JJ/\mm\JJ)$ under addition
with $(\id +{\rm{Mat}}_{n\times n}(\JJ/\mm\JJ))$ under multiplication,
since $\JJ\subset \mm$. Using this identification, we have
\[\d\phi_f(\gamma,\delta,\epsilon)=\gamma\phi_f(\delta,\epsilon)
-\phi_f(\gamma\delta,\epsilon)+\phi_f(\gamma,\delta\epsilon)-\phi_f(\gamma,\delta)\in 
{\rm{Mat}}_{n\times n}(k).\]
If we want to prove this is zero, it's enough to check ``upstairs'' in ${\rm{Mat}}_{n\times n}(\JJ/\mm\JJ)$, i.e. before applying $f$.
Thus we really want to check that
\begin{multline*}
(\tilde\rho(\gamma)\tilde\rho(\delta\epsilon)\tilde\rho(\epsilon)^{-1}\tilde\rho(\delta)^{-1}\tilde\rho(\gamma)^{-1})\times
(\tilde\rho(\gamma\delta)\tilde\rho(\epsilon)\tilde\rho(\gamma\delta\epsilon)^{-1})\\
\times
(\tilde\rho(\gamma\delta\epsilon)\tilde\rho(\delta\epsilon)^{-1}\tilde\rho(\gamma)^{-1})
\times(\tilde\rho(\gamma)\tilde\rho(\delta)\tilde\rho(\gamma\delta)^{-1})\stackrel{?}{=}\id.\end{multline*}
The trick is to insert the bracketed term (which is 1) below:
\begin{multline*}
\tilde\rho(\gamma)\tilde\rho(\delta\epsilon)\tilde\rho(\epsilon)^{-1}\tilde\rho(\delta)^{-1}\tilde\rho(\gamma)^{-1}
\tilde\rho(\gamma\delta)\overbrace{\tilde\rho(\delta)^{-1}\tilde\rho(\delta)}^{insert}\tilde\rho(\epsilon)\tilde\rho(\gamma\delta\epsilon)^{-1}\\
\times
\tilde\rho(\gamma\delta\epsilon)\tilde\rho(\delta\epsilon)^{-1}\tilde\rho(\gamma)^{-1}
\times(\tilde\rho(\gamma)\tilde\rho(\delta)\tilde\rho(\gamma\delta)^{-1})\stackrel{?}{=}\id.\end{multline*}
Now observe that the bracketed terms below reduce to $0$ in ${\rm{Mat}}_{n\times n}(k)$
and hence can be commuted with one another (!):
\begin{multline*}
\tilde\rho(\gamma)\overbrace{\tilde\rho(\delta\epsilon)\tilde\rho(\epsilon)^{-1}\tilde\rho(\delta)^{-1}}^{I}\overbrace{\tilde\rho(\gamma)^{-1}
\tilde\rho(\gamma\delta)\tilde\rho(\delta)^{-1}}^{II}\tilde\rho(\delta)\tilde\rho(\epsilon)\tilde\rho(\gamma\delta\epsilon)^{-1}\\
\times
\tilde\rho(\gamma\delta\epsilon)\tilde\rho(\delta\epsilon)^{-1}\tilde\rho(\gamma)^{-1}
\times(\tilde\rho(\gamma)\tilde\rho(\delta)\tilde\rho(\gamma\delta)^{-1})\stackrel{?}{=}\id.\end{multline*}
After swapping $I$ and $II$ one sees that in fact everything cancels magically.
(Is there is a ``conceptual'' proof of (1)?) 

\item This is similar to (1). First write $\tilde\rho^{{\rm{new}}}(\gamma)=a(\gamma)\tilde\rho(\gamma)$ for some
$$a:\Gamma\to \id + {\rm{Mat}}_{n\times n}(\JJ/\mm\JJ).$$
The idea is to show formally that $a(\gamma)$
(which is of course a {\em continuous} $1$-cocycle on $\Gamma$)
changes $\phi_f$ by $\d a$.
This is done with a similar ``insert $\id$ cleverly and commute stuff'' trick
as in (1).\\

\item OK.\\

\item The last equivalence in (4) is clear. 
For the other two equivalences, the implications
``$\Leftarrow$'' are OK.
The implication that $[\phi_f]=0$ implies 
we can choose $\tilde\rho$ to be a homomorphism mod $\JJ_f$ 
follows from the previous calculation [omitted]
that $\tilde\rho\rightsquigarrow a\cdot \tilde\rho$
changes $\phi$ by $\d a$. In particular, if $\phi$ is already a coboundary,
then by changing the choice of lift we can make $\phi=0$,
which is the same as saying our lift is a homomorphism mod $\JJ_f$.
So the crux of the matter is the second ``$\Rightarrow$''. 

Here's the situation. We have a diagram
\[\xymatrix{\Gamma\ar[rrr]^{\rho^{\square}_{{\rm{univ}}}}\ar[rd]_{\tilde\rho}&&&\GL_n(\cO[\![x]\!]/\JJ)=\GL_n(R^\square)\ar[rd]\\
&\GL_n(\cO[\![x]\!]/\mm\JJ)\ar[rru]\ar[rr]_{f_*}&&\GL_n(\cO[\![x]\!]/\JJ_f)\ar[u]_{can}\ar[r]&\GL_n(k)}\]
We'd like to prove that $\cO[\![x]\!]/\JJ_f\to \cO[\![x]\!]/\JJ$ is an isomorphism.
By the universality of $R^\square$
we get the map $$\cO[\![x]\!]/\JJ\stackrel{\exists!}{\to}\cO[\![x]\!]/\JJ_f\stackrel{{\rm{can}}}{\to}\cO[\![x]\!]/\JJ$$
and again by universality the composition is the identity.
Now it would be enough to check that  $\JJ\subset \JJ_f$.
Note that the image of $x_i$ in $\cO[\![x]\!]/\JJ$ maps
to $x_i+a_i\in \cO[\![x]\!]/\JJ_f$ where $a_i$ is some element of $\JJ$.
It will suffice to show that  if $g(x_1,\ldots, x_n)\in \JJ$
then $g$ maps to $g$ itself in $\cO[\![x]\!]/\JJ_f$.

First we claim that $\JJ\subset (\mm^2,\pi)$
[recall that $\JJ=\ker(\cO[\![x]\!]\onto R^\square)$].  
Indeed, if $g\in \JJ$ then $g=g_0+\sum g_ix_i + O(\mm^2)$.
Moreover $g_0\in (\pi)$
and each $g_i$ lies in $(\pi)$
since the $x_i$'s map to a {\it basis} of $\mm/(\mm^2,\pi)$.
Thus $g\in (\mm^2,\pi)$.
Consequently, it's enough to show what we want for
$g\in (\mm^2,\pi)$. [This will be important later on!]

But if $g\in (\mm^2,\pi)$
then under $\cO[\![x]\!]/\JJ\to \cO[\![x]\!]/\JJ_f$ 
we still have
$$g=g_0+\sum g_i x_i + O(\mm^2)
\mapsto g_0+\sum g_i(x_i+a_i)+ O(\mm^2),$$ 
and the observation
is that when we subtract off
$g$ from this
we get
$\sum g_i a_i$ in the $O(\mm)$ term,
which [by inspection]
is in $\mm \JJ\subset \JJ_f$.
Similarly one sees that the higher order terms
vanish mod $\JJ_f$. \end{enumerate}
This concludes the proof of (4), hence the claim, hence the theorem.

\subsection{Completed tensor products}
\begin{ex}
Let $R$ be a Noetherian ring, and consider $R[x]\otimes_R R[y]\cong R[x,y]$.
However $R[\![x]\!]\otimes_R R[\![y]\!]$ is something weird, being
just a part of $R[\![x,y]\!]$. 
It's easy to see that it does at least inject into $R[\![x,y]\!]$.
The idea is that $M\otimes R^I\into M^I$ for any free $R$-module $R^I$
(here $I$ is an arbitrary index set) but
this map fails to be an isomorphism. 

To check the injectivity,
note that it's OK for $M$ finite free,
which allows one to deduce it for $M$ finitely presented,
and then pass to a direct limit to conclude the general case.
Applying this to $I=\ZZ$ and $M=R[\![x]\!]$ gives what we want in our case.
But to see that our map $R[\![x]\!]\otimes R[\![y]\!]\into R[\![x,y]\!]$
is not surjective, observe that $\sum x^n y^n$ is not in the image!
\end{ex}
\begin{defn}
Let $\cO$ be a complete Noetherian local ring
and $R,S$ complete Noetherian local $\cO$-algebras
(meaning the structure maps are local morphisms).
Assume at least one of the residue field extensions
$\cO/\m_\cO\subset R/\m_R$
and $\cO/\m_{\cO}\subset S/\m_S$
is finite.
Then set $\m\nsg R\otimes_\cO S$ to be the ideal generated
by $$\m_R\otimes_\cO S + R\otimes_\cO \m_S.$$ 
[Note: $(R\otimes_\cO S)/\m\cong \Bbbk_R \otimes_{\Bbbk_\cO}\Bbbk_S$ is not necessarily a field, or 
even a local ring, but it is artinian.]
Now define the completed tensor product
$R\hat{\otimes}_\cO S$ to be the $\m$-adic completion of $R\otimes_\cO S$.
\end{defn}

\subsubsection*{Universal property}
$R\hat{\otimes}_\cO S$ is the coproduct
in the category
of complete semilocal Noetherian $\cO$-algebras
and continuous maps.
It is thus the universal (i.e. initial) complete semilocal Noetherian $\cO$-algebra
equipped with continuous $\cO$-algebra maps
from $R$ and $S$.
\begin{ex}
We have $\cO[\![x]\!]\hat{\otimes}_\cO \cO'[\![y]\!]\cong \cO'[\![x,y]\!]$
when $\cO'$ is any complete Noetherian local $\cO$-algebra.
We also have $$(\cO[\![x_1,\ldots, x_r]\!]/\JJ)\hat{\otimes}_\cO(\cO'[\![y_1,\ldots, y_s]\!]/\JJ')\cong \cO'[\![x_1,\ldots, x_r,y_1,\ldots, y_s]\!]/(\JJ,\JJ')$$ in this setup.
\end{ex}

\subsection{Global setup and statement}
Let $F$ be a number field,
and $p$ a prime.
Let $S$ be a finite set of places of $F$
containing $\{v|p\}$.
Fix an algebraic closure $\bar F/F$
and let $F_S\subset \bar F$
be the maximal extension unramified outside $S$.
Let $G_{F,S}=\Gal(F_S/F)$.
Let $\Sigma\subset S$ be any subset of places [for now; later we'll impose conditions].

For $v\in \Sigma$, fix algebraic closures $\bar F_v/F_v$
and choose embeddings $\bar F\into \bar F_v$,
or, what is the same thing, choices of decomposition group
$\Gal(\bar F_v/F_v)=G_v\subset G_{F,S}$.
Now let $K/\QQ_p$ be a finite extension, and 
$\cO$, $\pi$, and $k$ be as above.
Fix a character $\psi:G_{F,S}\to \cO^\times$.

Let $V_k$ be a finite dimensional continuous representation
of $G_{F,S}$ over $k$
such that $\det V_k = \psi\mod \pi$.

Since we're fixing $\det = \psi$ in this subsection, we'll be dealing (from now on in this talk)
with $\ad^0 V_k$ rather than $\ad V_k$. [More on this later.]
A caution is in order: if $p|\dim V_k$ then $\ad^0 V_k$ is not a direct
summand of $\ad V_k$.
Usually the scalars in $\ad V_k$ give
a splitting, but when $p|\dim V_k$
the scalars actually sit inside $\ad^0 V_k$.
Hence we shall assume from now on that $p\nmid \dim V_k$.

For each $v\in \Sigma$ fix a basis $\beta_v$ of $V_k$.
We're going to consider deformation functors (and the representing rings)
with determinant conditions.
Set $D^{\square,\psi}_v$
to be the functor of framed deformations of $V_k|_{G_v}$ with the basis $\beta_v$,
with fixed determinant $\psi \mod \pi$,
and let $R^{\square,\psi}_v$ be the ring (pro-)representing it.
This always exists.
Likewise let $D^{\square,\psi}_{F,S}$ be the functor of
deformations $V_A$ of $V_k$ with determinant $\psi\mod \pi$,
equipped with an $A$-basis $\tilde\beta_v$ of $V_A$
lifting $\beta_v$ for each $v\in \Sigma$. 
Let $R^{\square,\psi}_{F,S}$ be the ring representing it.
Again, this always exists.

We have analogous respective unframed counterparts $R^\psi_v$ and $R^\psi_{F,S}$
under the usual condition that $V_k$ has only scalar endomorphisms
as a representation space for $G_v$ and $G_{F,S}$ respectively.  

Now \textit{define} $R_\Sigma^{\square,\psi}=\hat\bigotimes_{v\in\Sigma} R_v^{\square,\psi}$ [completed tensor product over $\cO$].
Since each $R_v^{\square,\psi}$ has the same residue field, in this case the completed tensor product actually \textit{is} local! Let $\m^\square_\psi$ be its maximal ideal.
Analogously define $R^\psi_\Sigma$ and $\m_\Sigma$.
Denote the maximal ideal of the local ring $R^{\square,\psi}_{F,S}$ by $\m^{\square}_{F,S}$
and likewise that of $R^\psi_{F,S}$ by $\m_{F,S}$.

There is a natural $R_\Sigma^\psi$-algebra
structure on $R^\psi_{F,S}$
via the universal property of $\hat\otimes_\cO$.
Indeed, for each $v\in \Sigma$, 
by restricting the universal deformation
of $V_k$ valued in $R^{\psi}_{F,S}$
to $G_v\subset G_{F,S}$ 
the universal property of $R^\psi_v$
induces a canonical local $\cO$-algebra morphism
$R^\psi_v\to R^\psi_{F,S}$.  We then use
the universal property of completed tensor products. 


\begin{thm}\label{samit2}
For $i\geq 1$ let $h^i_\Sigma$ $($resp. $c^i_\Sigma$$)$
denote the $k$-dimension of the kernel $($resp. cokernel$)$ 
of the map
\[\theta_i:\H^i(G_{F,S},\ad^0 V_k)\to\prod_{v\in\Sigma}\H^i(G_v,\ad^0 V_k).\]
Then we have an isomorphism
of $R^\psi_\Sigma$-algebras
\[R^\psi_{F,S}\cong R^\psi_\Sigma[\![x_1,\ldots, x_r]\!]/(f_1,\ldots, f_{r+s})\]
where $r=h^1_\Sigma$
and $s=c^1_\Sigma+h^2_\Sigma-h^1_\Sigma$.
\end{thm}

To get the desired presentation, as in the proof of Theorem \ref{samit1}, first 
consider a surjection $$\BB:=R^\psi_\Sigma[\![x_1,\ldots, x_r]\!]\onto R^\psi_{F,S}$$
where
$r=\dim_k \coker(\m_\Sigma/(\m_\Sigma^2,\pi)\to\m_{F,S}/(\m_{F,S}^2,\pi))$; 
this surjectivity uses completeness.  
Dualizing, we have
\[r=\dim_k\ker(\Hom_k(\m_{F,S}/(\m_{F,S}^2,\pi),k)\to\Hom_k(\m_\Sigma/(\m_\Sigma^2,\pi),k)).\]
Using the computation from Mok's lecture, this is
\[\dim_k\ker\theta_1=h^1_\Sigma.\]
The key point that makes these computations work is that 
the completed tensor product
represents the product of the functors represented
by the $R^\psi_v$, which is most easily checked by computing on artinian points
(for which the completed tensor product collapses to an ordinary tensor product).
That then brings us down to the elementary fact that the tangent space of the product of functors
is the product of the tangent spaces.

Denote by $\mm$ the maximal ideal of $\BB$, 
and by $\JJ$ the kernel $\ker(\BB\onto R^\psi_{F,S})$.
Now comes a delicate technical point.  
Like in the proof of Theorem \ref{samit1}, we can set-theoretically lift $\rho:G_{F,S}\to \GL_n(R^\psi_{F,S})$
to $\tilde\rho:G_{F,S}\to \GL_n(\BB/\mm\JJ)$, not necessarily a homomorphism, and 
there arises the problem of finding a continuous such $\tilde\rho$.
We seek a better method than the trick as earlier with finite residue fields 
because we wish to later apply the same technique 
to future situations involving characteristic-0 deformation theory, for which the
residue field is a $p$-adic field and not a finite field.  The reader who prefers to ignore this problem
should skip the next section. 

\subsection{Continuity nonsense} 
To explain the difficulty and its solution, let us first formulate a general situation.
Consider a surjective map $R' \onto R$ between complete local noetherian rings with kernel $\JJ$ 
killed by $\m_{R'}$, and assume that we are in one of two cases:

Case 1:  residue field $k$ is finite of characteristic $p$, so $R$ and $R'$ are given the usual max-adic topologies that are profinite.  These topologies are the inverse limits of the 
discrete topologies on artinian quotients.

 Case 2 (to come up later!): residue field $k$ is a $p$-adic field and $R$ and $R'$ are $\QQ_p$-algebras, whence uniquely $k$-algebras in a compatible way (by Hensel).  Their artinian quotients are then 
 finite-dimensional as $k$-vector spaces, and so are naturally topologized as such (making them 
 topological $k$-algebras, with transition maps that are quotient maps, as for any $k$-linear surjections between $k$-vector spaces of finite dimension).  Give $R$ and $R'$ the inverse limit
 of those topologies (which induce the natural $k$-linear topologies back on the finite-dimensional artinian quotients). 

In both cases, let $\rho:G \to \GL_n(R)$ be a continuous representation.  
We seek to make an obstruction class in a ``continuous'' $\H^2(G,\ad\rho)$ (over $k$) for measuring 
whether or not $\rho$ can be lifted to a {\it continuous} representation into $\GL_n(R')$.
The problem is to determine if $\rho$ has a continuous set-theoretic lifting 
(moreover with with a fixed determinant if we wish to study deformations with a fixed 
determinant, assuming that $p$ doesn't divide $n$).

We saw earlier how to handle Case 1 when $R$ is {\it artinian}, by a trick. That trick rested on 
$\rho$ at artinian level factoring through a {\it finite} quotient of $G$.  Such an argument
has no chance of applying when $k$ is a $p$-adic field in interesting cases, and we're sure going to 
need that later when studying generic fibers of deformation rings and proving smoothness by 
proving vanishing of a $p$-adic $\H^2$. So we need an improvement of the method from artinian Case 1
which addresses the following two points:  

 (i) what to do when $k$ is $p$-adic,

 (ii) how to incorporate additional things like working with a fixed determinant. 

 Actually, (ii) will be very simple once we see how to deal with (i), as we will see below.   This is important because in practice we want to deal with more general constraints than just ``fixed determinant" 
 and so we want a general method which works for any ``reasonable property", not just something ad hoc for the property of fixed determinant.

 To deal with (i) (and along the way, (ii)), we will use a variant on fix from artinian Case 1.  That 
 argument allows us to reduce to deal with the case when $R$ and $R'$ are artinian, but we need to show in that {\it artinian setting} we can make a continuous set-theoretic lifting without the crutch of ``factoring through finite quotient of $G$" (which is available for finite $k$ but not $p$-adic $k$).    
 
 First conjugate so the reduction $\rho_0:G\to \GL_n(k)$ lands in $\GL_n(\cO_k)$.  
 Then by using the method from Brian's talk on $p$-adic points of deformation rings, 
 we can find a finite flat local $\cO_k$-algebra $\cO_k$-lattice $A$ inside of $R$ with residue field 
 equal to that of $\cO_k$ and containing the compact $\rho(G)$, and then we can find a similar such 
 $A'$ in $R'$ mapping onto $A$.  We'd like to lift
$$\rho:G\to \GL_n(A)$$
 to $\GL_n(A')$ set-theoretically in a continuous way.  Note that 
$\GL_n(A') \to \GL_n(A)$ is surjective.

 The point is that $\GL_n(A)$ and $\GL_n(A')$ are respectively open in $\GL_n(R)$ and $\GL_n(R')$ with subspace topologies that arise from the ones on $A$ inside $R$ and $A'$ inside $R'$ which are their natural topologies as finite free $\cO_k$-modules.  This makes them {\it profinite}, 
 much as $\GL_n(R)$ and $\GL_n(R')$ were in the case of finite $k$.
So we have reduced ourselves to the following situation, in which we will use an argument
suggested by Lurie that also gives another approach for handling the case of finite $k$ as well.

 Let $H' \to H$ be a continuous surjective map of profinite groups, and $\rho:G\to H$ a continuous homomorphism. We claim that there is 
 a continuous set-theoretic lifting $G \to H'$ of $\rho$ that also respects properties like ``fixed $\det$" in the case of intended applications.  To see this, let $F \onto G$ be a surjection from a 
 ``free profinite group".  The composite map
$$F\onto G \to H$$
 can be lifted continuously to $F \to H'$ even as a homomorphism by individually lifting from $H$ to $H'$ the images of each member of the ``generating set" for the free profinite $F$.  Those individual lifts can be rigged to have a desired $\det$, or whatever other ``reasonable homomorphic property" can be checked pointwise through a surjection, and so such a property is inherited by the map $F \to H'$.  But what about $G \to H'$?
 If we can find a continuous set-theoretic section of $F\onto G$ then composing that section with $F \to H'$ will give the required $G \to H'$.  So our continuity problems will be settled once 
 we prove the following fact.

 Claim:  If $f: G'\to G$ is a continuous homomorphism between profinite groups then it has a continuous section (as topological spaces).

\begin{proof} For closed normal subgroups $N' \nsg G'$ and $N := f(N') =$ closed normal in $G$, consider continuous sections $s:G/N \to G'/N'$ to the induced quotient map $G'/N' \to G/N$ arising from $f$.  For example, such an $s$ exists if $N' = G'$ (so $N = G$).  If $(N',s)$ and $(M',t)$ are two such pairs with $N'$ containing $M'$, say $(M',t) \ge (N',s)$ if
$$ t:G/M \to G'/M'\qquad   and \qquad s:G/N \to G'/N'$$
 are compatible via the projections $G/M \onto G/N$ and $G'/M' \onto G'/N'$.

 I claim that the criterion for Zorn's Lemma is satisfied.  Let $\{(N'_i,s_i)\}$ be a chain of such pairs, and let $N' = \bigcap N'_i$.   Then the natural map
$$G'/N' \to \varprojlim G'/N'_i$$
 is surjective (since an inverse limit of surjections $G'/N'\to G'/N'_i$ between compact Hausdorff spaces), yet also injective and thus a homeomorphism.  Likewise, for $N := \bigcap N_i $ 
 the map $G/N \to \varprojlim G/N_i$ a homeomorphism, and I claim that $N = f(N')$.  Indeed, if $x$ is in $N$ then $f^{-1}(x)$ meets each $N'_i$ in a non-empty closed set, and these satisfy the finite intersection property since $\{N'_i\}$ is a chain ordered by inclusion, so $f^{-1}(x)$ contains a point in the intersection $N'$ of all $N'_i$.  That says $x$ is in $f(N')$ as desired.  (The inclusion of $f(N')$ inside of $N$ is clear.)

 It follows that the compatible continuous sections $s_i:G_i/N_i\to  G'_i/N'_i$ induced upon passing to the projective limit  define a continuous section
$$ s:G/N \to G'/N',$$
 so $(N',s')$ is an upper bound on the chain $\{(N'_i,s_i)\}$.

 Now we apply Zorn's Lemma to get a maximal element $(N',s)$.  This is a continuous section $s:G/N \to G'/N'$ where $N = f(N')$.  I claim $N' = \{1\}$, so we will be done.  If not, then since $N' \cap U'$ for open normal subgroups $U'$ in $G'$ define a base of opens in $N'$ around $1$ (as $N'$ gets its profinite topology as subspace topology from $G'$), there must exist such $U'$ so that $N' \cap U'$ is a proper subgroup of $N'$.  Replacing $G'$ with $G'/(N' \cap U')$ and $G$ with quotient by image of $N' \cap U'$ in $G$ brings us to the case where $N$ is finite and {\it non-trivial} 
 yet $(N',s)$ retains the maximality property (no continuous section using a proper [closed] subgroup of $N'$ normal in $G'$).  We seek a contradiction.

 Since $N'$ and $N$ are finite, the quotient maps $q':G'\onto G'/N'$ and $
q:G \onto G/N$ are covering spaces with finite constant degree $> 0$.
By total disconnectedness, these covering spaces admit sections.  Composing $s$ with a section to $q'$ gives a continuous section $G/N \to G'$ to
$$ G' \stackrel{f}{\to} G \stackrel{q}{\to} G/N.$$

 Composing such a section with $q$ gives  a continuous map $t:G \to G'$ so that $f(t(g)) = g \mod N$, so by profiniteness of $G$ and finiteness of $N$ we get an open normal subgroup $U$ in $G$ such that for each representative $g_i$ of $G/U$ there exists $n_i \in N$ such that $f(t(g_i u)) = n_i g_i u$ for all $u \in U$.  But $n_i = f(n'_i)$, so replacing $t$ on $g_i U$ with $(n'_i)^{-1} t$ for each $i$ gives a new $t$ so that $f(t(g_i u)) = g_i u$ for all $u \in U$ and all $i$, which is to say $ft = \id_G$.  This exhibits a continuous section $t$ to $f$, contradicting that $N$ was arranged to be nontrivial and maximal with respect to the preceding Zorn's Lemma construction.   Hence, in fact $N$ above is $\{1\}$ so we are done.
 \end{proof}
 
 \subsection{Proof of Theorem \ref{samit2}}  
 Returning to the situation of interest, we now have a continuous $\tilde\rho$ that can 
even be arranged to satisfy $\det\tilde\rho\equiv\psi\mod\mm\JJ$. 
Still following the argument from the proof of Theorem \ref{samit1},
define for $f\in \Hom_k(\JJ/\mm\JJ,k)$
the continuous 2-cocycle $\phi_f$ as before, and observe that this time
the determinant condition entails
that $[\phi_f]\in \H^2(G_{F,S},\ad^0 V_k)$.
The proof of the well-definedness of $[\phi_f]$ is as before.
Also we still have the equivalence that 
$[\phi_f]=0$ if and only if $\tilde\rho$ can be chosen to be a homomorphism $\mod\ker f$.

Now for the restriction of $\rho$ to each $G_v$, we know we can find a continuous lift,
namely coming from the universal representation $\rho_v$ at $v$:
$$G_v\stackrel{\rho_v}{\to} \GL_n(R^\psi_v)\to \GL_n(R^\psi_\Sigma)\to \GL_n(\BB)$$
where the other maps are the obvious ones.
Hence the class $[\phi_f]|_{G_v}\in \H^2(G_v,\ad^0V_k)$ is always trivial.
In other words, we have a $k$-linear map
$\Hom_k(\JJ/\mm\JJ,k)\stackrel{\Phi}{\to}\ker\theta_2$
satisfying $f\mapsto [\phi_f]$;
the target has dimension $h^2_\Sigma$ by definition.
Therefore [easy exercise] it suffices
to show that $\dim_k \ker\Phi\leq c^1_\Sigma$.
(All we need is the inequality, because
we can always throw in extra trivial ``relations'' $f_i=0$ into the denominator
of $R^\psi_{F,S}$.) 

Let $I=\ker(\m_\Sigma/(\m_\Sigma^2,\pi)\to\m_{F,S}/(\m_{F,S}^2,\pi))$.
Then $\Hom_k(I,k)\cong \coker(\theta_1)$.
So it is enough to construct a linear injection $\ker\Phi\into \Hom_k(I,k)$.

Step 1: Observe that $I=\ker(\mm/(\mm^2,\pi)\to\m_{F,S}/(\m_{F,S}^2,\pi))$
because we chose the $x_i$'s to map onto a basis of $\coker(\m_\Sigma/(\m_\Sigma^2,\pi)\to\m_{F,S}/(\m_{F,S}^2,\pi))$.
(In other words, none of the extra stuff in $\mm$ dies when we map to $\m_{F,S}$.) 

Step 2: We next claim that $\JJ/\mm\JJ$ surjects onto $I$.
To prove this, first note that the map $\JJ/\mm\JJ\to \mm/(\mm^2,\pi)$
comes from 
tensoring
$$0\to \JJ\to \mm\to \m_{F,S}\to 0$$ 
over $\BB$
with $\BB/\mm$ 
and then reducing mod $\pi$.
We need to show that this map is surjective
onto $I$.
Fix $x\in I\subset \mm/(\mm^2,\pi)$.
We know $$\JJ/\mm\JJ \onto \ker(\mm/\mm^2\to \m_{F,S}/\m_{F,S}^2).$$ 
We can lift $x$
to $\tilde x\in \mm/\mm^2$.
Since $x$ maps to zero in $\m_{F,S}/(\m_{F,S}^2,\pi)$,
$\tilde x$ maps to $\pi r\mod \m_{F,S}^2$
for some $r\in R_{F,S}^\psi$.
But now we can just choose
some $\tilde r\in \BB$ mapping to $r\in R_{F,S}^\psi$
(i.e. mod $\JJ$).
Now replace $\tilde{x}$ with $\tilde{x} - (\pi \tilde{r} \bmod \m^2)$ so
that $\tilde{x}$ has vanishing image in $\m_{F,S}/\m_{F,S}^2$.  That says
$\tilde{x}$ is in the image of $\JJ/\m \JJ$ in $\m/\m^2$, so 
$x$ is hit by $\JJ/\m\JJ$ as desired. 

Step 3: By Step 2 we get $\Hom_k(I,k)\into\Hom_k(\JJ/\mm\JJ,k)\supset \ker\Phi$.
So we need to show that $\ker\Phi\subset \Hom_k(I,k)$.
In other words, if $[\phi_f]=0$
then we claim that $f:\JJ/\mm\JJ\to k$
should factor through $I$,
or equivalently
vanish on $K=\ker(\JJ/\mm\JJ\onto I)$.
Or equivalently, we need to show that 
$K=\JJ\cap(\mm^2,\pi)\subset \JJ_f=\ker f$.
But in fact this is really what we showed at the
end of the proof of Theorem \ref{samit1}
when we showed property (4)
of $\Phi$.

\subsection{The framed case}
Let $$\eta:\m^\square_\Sigma/((\m^\square_\Sigma)^2,\pi)\to\m^\square_{F,S}/((\m^\square_{F,S})^2,\pi).$$
Then $$R^{\square,\psi}_{F,S}\cong R^{\square,\psi}_\Sigma[\![x_1,\ldots, x_{r^\square}]\!]/(f_1,\ldots, f_{r^\square+s^\square}),$$ 
where
$r^\square=\dim_k\coker\eta$
and $r^\square+ s^\square=h^2_\Sigma+\dim_k\ker\eta$.

The proof is the same as in the unframed case, just with extra squares floating around all over the place.
But now our $\H$'s have turned into $Z$'s
(that is, elements of the tangent space which were cohomology classes are now cocycles)
so it's better to phrase the result as above.

\subsection{Formulas for $r$'s and $s$'s}
\begin{thm}Suppose that $\{v|p\}\subset\Sigma$,
that $\{v|\infty\}\subset S$,
and that $S-\Sigma$ contains at least one finite prime.
Then $($with notation as above$)$ 
$$s=\sum_{v|\infty, v\not\in \Sigma}\dim_k(\ad^0 V_k)^{G_v}.$$
\end{thm}
\begin{rem}
We also have $r^\square\geq \#\Sigma-1,r^\square\stackrel{?}{=}r+\#\Sigma-1,
s^\square=s-\#\Sigma+1$.
\end{rem}

\begin{proof}
Let $Y=\ad^0 V_k$ and $X=Y^\vee(1)$.
(In the notation of Rebecca's talk, $X=Y'$; 
it is written as a ``twisted Pontrjagin dual'' here because instead of being $\Hom$
into $\QQ/\ZZ$ (trivial $G$-module)
the target is given the action of the cyclotomic character.) 
Recall the end of the Poitou-Tate exact sequence (from Rebecca's talk)
\[\H^2(G_{F,S},Y)\to\prod_{v\in S}\H^2(G_v,Y)\to \H^0(G_{F,S},X)^\vee\to 0.\]
Split the product into two pieces:
\[\prod_{v\in S}\H^2(G_v,Y)=\prod_{v\in \Sigma}\H^2(G_v,Y)\times\prod_{v\in S-\Sigma}\H^2(G_v,Y).\]
The claim is that as long as the second factor is nonzero 
(which it is by hypothesis), it surjects onto $\H^0(G_{F,S},X)^\vee$.
Indeed, trivially $\H^0(G_{F,S},X)\into \H^0(G_v,X)$
since restricting to the decomposition group gives more invariants.
Dually, we have $\H^0(G_v,X)^\vee\onto\H^0(G_{F,S},X)^\vee$.
But by the Tate pairing, $\H^0(G_v,X)^\vee\cong \H^2(G_v,Y)$.
On each factor, the last map in the Tate-Poitou sequence is none other
than the composition $\H^2(G_v,Y)\cong \H^0(G_v,X)^\vee\onto\H^0(G_{F,S},X)^\vee$. Thus the claim is true.

Now we do a little diagram chase.
We have
\[\H^2(G_{F,S},Y)\to \prod_{v\in \Sigma}\H^2(G_v,Y)\times\prod_{v\in S-\Sigma}\H^2(G_v,Y)\to \H^2(G_{F,S},X)^\vee\to 0.\]
The claim is that $\H^2(G_{F,S},Y)\onto \prod_{v\in \Sigma}\H^2(G_v,Y)$.
Indeed, given $(a_v)_\Sigma\in \prod_{v\in \Sigma}\H^2(G_v,Y)$,
suppose its image in $\H^2(G_{F,S},X)^\vee$ is
$\gamma$.
Since $\prod_{v\in S-\Sigma}\H^2(G_v,Y)\onto\H^2(G_{F,S},X)^\vee$,
we can find $$(b_v)_{S-\Sigma}\in \prod_{v\in S-\Sigma}\H^2(G_v,Y)$$
such that the image of $(b_v)_{S-\Sigma}$
in $\H^2(G_{F,S},X)^\vee$
is $-\gamma$.
Then $$(a_v)_\Sigma\times(b_v)_{S-\Sigma}\in
\ker(\prod_S\H^2(G_v,Y)\onto \H^2(G_{F,S},X)^\vee),$$ 
whence this tuple is in the image
of $\H^2(G_{F,S},Y)$.
Projecting onto the $\prod_{v\in \Sigma}$ factor proves the claim.
But the surjectivity of $\H^2(G_{F,S},Y)\onto\prod_{v\in \Sigma}\H^2(G_v,Y)$
says precisely that $c^2_\Sigma=\dim \coker\theta_2=0$.

Consequently we have $h^2_\Sigma=h^2(G_{F,S},Y)-\sum_{v\in \Sigma} h^2(G_v,Y)$.
So by the formulas at the end of Theorem \ref{samit2}, 
$$s=-h^1_\Sigma+c^1_\Sigma+h^2_\Sigma
=-h^1(G_{F,S},Y)
+\sum_{v\in \Sigma}h^2(G_v,Y)
+h^2(G_{F,S},Y)
-\sum_{v\in \Sigma}h^2(G_v,Y).$$

Now recall that we have assumed throughout
that $\End_{G_{F,S}}V_k
=(\ad V_k)^{G_{F,S}}=k$
(since we need this to make sure the unframed
deformation ring even exists!).
In particular,
$(\ad^0 V_k)^{G_{F,S}}=0$.
That is, $h^0(G_{F,S},Y)=h^0(G_v,Y)=0$.
So we can add $h^0(G_{F,S},Y)-\sum_{v\in \Sigma}h^0(G_v,Y)$
to $s$ and nothing changes.
But now we recognize from the equation above
that in fact $s=\chi(G_{F,S},Y)-\sum_{v\in\Sigma}\chi(G_v,Y)$.

We now invoke the Tate global Euler characteristic formula.
[Reference: Milne, \textit{Arithmetic Duality Theorems} Ch. I, Thm. 5.1.]
We conclude that
\[\chi(G_{F,S},Y)=\sum_{v|\infty}h^0(G_v,Y)-[F:\QQ]\dim_k Y.\]
We also have
for $v<\infty, v\nmid p$,
that $\chi(G_v,Y)=0$.
For $v<\infty, v|p$, we have $\chi(G_v,Y)=-[F_v:\QQ_p]\dim_k Y$.
For $v|\infty$, we have $\chi(G_v,Y)=h^0(G_v,Y)$.
One sees that in $s=\chi(G_{F,S},Y)-\sum_{v\in\Sigma}\chi(G_v,Y)$,
the degree contributions all cancel out,
so there are no non-archimedean terms.
Of the archimedean places, all those in $\Sigma$ cancel as well,
and we are left with the statement of the theorem.
\end{proof}

\end{document} 


 
