\documentclass[12pt]{article}
\usepackage{fullpage, amsfonts, amsmath, amssymb, amsthm, stmaryrd}
\usepackage[all]{xy}

\def\CC{\mathbb{C}}
\def\QQ{\mathbb{Q}}
\def\RR{\mathbb{R}}
\def\ZZ{\mathbb{Z}}

\def\calC{\mathcal{C}}
\def\calD{\mathcal{D}}
\def\calF{\mathcal{F}}
\def\calG{\mathcal{G}}
\def\calI{\mathcal{I}}
\def\calO{\mathcal{O}}

\def\gothm{\mathfrak{m}}
\def\gothp{\mathfrak{p}}
\def\gothq{\mathfrak{q}}

\newtheorem{theorem}{Theorem}
\newtheorem*{lemma}{Lemma}
\newtheorem*{cor}{Corollary}
\newtheorem*{prop}{Proposition}
\theoremstyle{definition}
\newtheorem*{axiom*}{Axiom}
\newtheorem*{hypo}{Hypothesis}

% Categories

\DeclareMathOperator{\Ab}{\underline{Ab}}
\DeclareMathOperator{\Grp}{\underline{Grp}}
\DeclareMathOperator{\LRS}{\underline{LocRingSp}}
\DeclareMathOperator{\Mod}{\underline{Mod}}
\DeclareMathOperator{\Set}{\underline{Set}}
\DeclareMathOperator{\Sh}{\underline{Sh}}
\DeclareMathOperator{\Ring}{\underline{Ring}}
\DeclareMathOperator{\Top}{\underline{Top}}
\DeclareMathOperator{\TopGp}{\underline{TopGp}}
\DeclareMathOperator{\TopRing}{\underline{TopRing}}

\DeclareMathOperator{\coker}{coker}
\DeclareMathOperator{\Frac}{Frac}
\DeclareMathOperator{\id}{id}
\DeclareMathOperator{\image}{im}
\DeclareMathOperator{\Hom}{Hom}
\DeclareMathOperator{\Mor}{Hom}
\DeclareMathOperator{\Obj}{Obj}
\DeclareMathOperator{\Res}{Res}
\DeclareMathOperator{\Spec}{Spec}
\DeclareMathOperator{\SSpec}{\mathbf{Spec}}


\begin{document}


\begin{center}
\textbf{
18.726: Algebraic Geometry (K.S. Kedlaya, MIT, Spring 2009) \\
Sheaves of modules (updated 27 Feb 09)
}
\end{center}

Having discussed sheaves of sets, abelian groups, and rings, we
now consider sheaves of modules over a locally ringed space,
with an emphasis on the situation for schemes.
We'll then use what we know to talk about closed immersions
and separated morphisms. (Many more properties of morphisms to follow
in the next lectures!)
References: Hartshorne II.4, II.5; EGA I 0.4, I 0.5, I 1.1.

\section{Sheaves of modules}

Let $(X, \calO_X)$ be a ringed space. A \emph{sheaf of $\calO_X$-modules}
is a sheaf of sets $\calF$ such that for each $U \subseteq X$
open, the  group of sections $\calF(U)$ is equipped with a
structure of a $\calO_X(U)$-module, in a fashion compatible with restriction.
We sometimes call such a thing simply an $\calO_X$-module.
A \emph{morphism} of two $\calO_X$-modules $\calF \to \calG$ is 
a morphism of sheaves which gives a $\calO_X(U)$-module
homomorphism $\calF(U) \to \calG(U)$ for each $U \subseteq X$ open.

Fun fact: for $\calF$ a sheaf of $\calO_X$-modules,
there is a natural bijection between
\[
\Hom(\calO_X, \calF) \to \calF(X).
\]

If $\calF$ is a sheaf of $\calO_X$-modules, then for each $x \in X$,
the stalk $\calF_x$ inherits a structure of a $\calO_{X,x}$-module.
Using that, we can 
talk about submodules, quotient modules, kernels, cokernels,
images, and the like; in fact, these agree with the corresponding notions
in the category of sheaves of abelian groups.

An $\calO_X$-module is \emph{free} if it is isomorphic to
a direct sum $\calO_X^I$ of copies of $\calO_X$. This property cannot
be checked locally; if $\calO_X$ is only locally isomorphic to a free
$\calO_X$-module, we say it is \emph{locally free}. More on locally
free sheaves later.

One new operation is the tensor product, but it requires some care. 
If $\calF, \calG$ are two
$\calO_X$-modules, the presheaf
\[
U \mapsto \calF(U) \otimes_{\calO_X} \calG(U)
\]
may not be a sheaf. Form its sheafification, and call that
$\calF \otimes_{\calO_X} \calG$; it has the expected arrow-theoretic
behavior. (I might forget the $\calO_X$ sometimes when it is not ambiguous.)

\section{Direct and inverse image}

If $f: (X, \calO_X) \to (Y, \calO_Y)$ is a morphism of ringed spaces,
and $\calF$ is a $\calO_X$-module, then
$f_* \calF$ may naturally be viewed as a $f_* \calO_X$-module.
Using the map $f^\sharp: \calO_Y \to f_* \calO_X$, we may
also give $f_* \calF$ the structure of an $\calO_Y$-module.
We call this again the \emph{direct image} of $\calF$.

On the other hand, if $\calG$ is a sheaf of $\calO_Y$-modules,
then $f^{-1} \calG$ is an $f^{-1} \calO_Y$-module. Adjointness
turns $f^\sharp$ into a homomorphism $f^{-1} \calO_Y \to \calO_X$,
so we can form the tensor product
\[
\calG \otimes_{f^{-1} \calO_Y} \calO_X
\]
and get a $\calO_X$-module. We notate this $f^* \calG$ and call it the
\emph{(module-theoretic) inverse image} of $\calG$ under $f$.

Again, $f^*$ and $f_*$ are adjoint in the obvious fashion. Statement 
and proof left to the reader.   

\section{Quasicoherent sheaves of modules}

Since thinking about affine schemes is supposed to be equivalent to
thinking about rings (after all, the two categories are equivalent!),
we would like our thinking about sheaves of modules on affine schemes
to be equivalent to thinking about modules over rings. We even
know what the functors realizing this equivalence should be: 
on an affine scheme $X = \Spec(R)$,
we should go from $R$-modules to $\calO_X$-modules via $M \mapsto
\tilde{M}$ (which we already proved is a sheaf!), and back via
$\calF \mapsto \Gamma(X, \calF)$.

While it is clear that the composition one way is naturally isomorphic
to the identity functor on $R$-modules, the other way fails because
there are ``too many'' $\calO_X$-modules. For instance, for $R = k[x]$
with $k$ an algebraically closed field, we can make an $\calO_X$-module
$\calF$ by declaring
\[
\calF(U) = \begin{cases} 0 & (0) \notin U \\
k[x] & (0) \in U
\end{cases}
\]
and putting in the obvious restriction maps. This sheaf has the
same global sections as $\calO_X$ itself but is clearly not the same!

The fix for this is a bit heavy-handed: we simply declare that we only
want sheaves which locally come from a module over a ring. For schemes,
it is clear what this means: we want $\calF$ to have the property that
for each $x \in X$, there is an open affine neighborhood $U = \Spec(A)$
of $x$ in $X$ such that $\calF|_U = \tilde{M}$ for some
$A$-module $M$. For locally ringed spaces, we must be a bit more
careful: we want $\calF$ to locally be given as the cokernel of some
module homomorphism $\calO_X^I |_U \to \calO_X^J|_U$ between free 
$\calO_X$-modules.

It still remains to check that this gives what we expect for affine schemes.
I call this the \emph{third fundamental theorem of affine schemes}.
\begin{theorem}
Let $\calF$ be a quasicoherent sheaf of $\calO_X$-modules 
for $X = \Spec(R)$, and put $M = \Gamma(X, \calF)$. Then the natural
homomorphism $\tilde{M} \cong \calF$ of $\calO_X$-modules is in fact an 
isomorphism. In other words, the category of quasicoherent $\calO_X$-modules
on $\Spec(R)$ is equivalent to the category of modules on $R$.
\end{theorem}

\begin{proof}
The claim is equivalent to the fact that for each prime ideal $\gothp$ of $R$,
the natural map $M_\gothp \cong \tilde{M}_{\gothp} 
\to \calF_\gothp$ is a bijection.
Since $\calF$ is quasicompact, we can find a distinguished open
$D(f)$ of $X$ on which $\calF \cong \tilde{N}$ for some $R_f$-module $N$.
The map $\tilde{M} \to \calF$ induces a map
$\tilde{M_f} \cong \tilde{M}|_{D(f)} \to \calF|_{D(f)} \cong \tilde{N}$.
Taking global sections gives a homomorphism $M_f \cong N$ of $R_f$-modules.

We check injectivity of $M_f \to N$.
Suppose $m/f^h \in M_f$ maps to zero in $N$.
For each prime ideal $\gothq$ of $R$, we can find a distinguished 
open neighborhood $D(g)$ of $\gothq$ in $X$ such that $\calF|_{D(g)}
\cong \tilde{P}$ for some $R_g$-module $P$. 
Now $P_f \cong N_g \cong M_{fg}$ as $R_{fg}$-modules since they all
give rise to the same sheaf. Hence the image of $m/f^h$
in $P_f$ is zero, so the image of $m$ in $P = \Gamma(D(g), \calF)$
is killed by some power of $f$.
We conclude that for some nonnegative integer
$j$, $f^j m$ restricts to the zero section
of $\calF$ on $D(g)$. Since this holds for each $\gothq$, and
we only need finitely many $D(g)$ to cover $X$ (since $X$ is quasicompact),
there exists a nonnegative integer $j$ such that $f^j m = 0$ in
$\Gamma(X, \calF) = M$. Hence $m/f^h$ represents the zero element in $M_f$.

We check surjectivity of $M_f \to N$.
Let $n \in N$ be any class.
Cover $X$ with finitely many $D(g_i)$ on each of which 
$\calF|_{D(g_i)}$ is represented by a module $P_i$ over $R_{g_i}$.
Then $\calF_{D(fg_i)}$ is represented by $(P_i)_{g_i}$.
Hence for some $j$, $f^j n$ is the restriction to 
$D(fg_i)$ of a section $s_i$ of $\calF$ over $D(g_i)$.
We may enlarge $j$ so that it works for all $i$; then
$s_i - s_j$ represents the zero section of $\calF$ over $D(f g_i g_j)$.
By the previous paragraph, we can find some $k$ such that
$f^k (s_i - s_j)$ is the zero section of $\calF$ over $D(g_i g_j)$.
Ergo, for some very large $j$, the $f^j n$ give sections $s_i$ of $\calF$
over $D(g_i)$ which glue to give a section of $\calF$ on $X$ itself.

We now have $M_f \cong N$, so $M_\gothp \cong N_\gothp \cong \calF_\gothp$.
Since $\gothp \in X$ was arbitrary, this proves $\tilde{M} \cong \calF$.
\end{proof}

\section{Relative Spec, ideal sheaves, and closed immersions}

Let $X$ be a scheme, and let $\calF$ be a quasicoherent sheaf of
$\calO_X$-modules which also carries an $\calO_X$-algebra structure
(or for short, a \emph{quasicoherent $\calO_X$-algebra}).
Then for each open affine subscheme $U$ of $X$, we can form the scheme
$\Spec \Gamma(U, \calF)$, and these glue. We thus obtain a scheme
$Y = \SSpec \calF$ which comes with a morphism $Y \to X$. This is called the
\emph{relative spectrum} of $\calF$.

One important class of examples of relative spectra are closed immersions.
(For more examples, see exercises.)
An \emph{ideal sheaf} on a locally ringed space $X$ is a quasicoherent
subsheaf of $\calO_X$. For $\calI$ an ideal sheaf, the quotient
$\calO_X/\calI$ is a quasicoherent $\calO_X$-algebra. Let
$Z$ be its relative Spec; any map arising as such a map $f: Z \to X$
is called a \emph{closed immersion}.

Let us see why this name is fitting in the case of schemes. Say
$X = \Spec R$. Then an ideal sheaf corresponds to an ideal $I$ of $R$,
and $Z = \Spec (R/I)$. (Notice that this means that any closed immersion
is an affine and  finite morphism!) The points of $Z$ are in bijection with the
points $\gothp \in X$ where the stalks $R_\gothp$ and $I_\gothp$
differ, which is precisely the vanishing set $V(I)$. But there can
be many different closed immersions with the same underlying set! For 
instance, in $\Spec k[x,y]$, the ideals $(x)$ and $(x^2)$
define the same closed set but not the same closed immersion.

Beware that algebraic geometers have the habit of calling the source
of a closed immersion a \emph{closed subscheme} of $X$ even though
it's not really a subscheme of $X$ in any precise sense. But this
isn't \emph{so} misleading because the map $Z \to X$ is indeed
a monomorphism. And there is something comforting in the thought that
(looking at our previous example) the $x,y$-plane ``contains`` a doubled
line defined by $x^2 = 0$, which in turn ``contains'' the undoubled line
defined by $x=0$.

Finally, note that if $f: Z \to X$ is a closed immersion,
the defining ideal sheaf can
be recovered as the kernel of $f^\sharp: \calO_X \to f_* \calO_Z$.
In fact, following Hartshorne, you may
define a closed immersion as a map of schemes
$f:Z \to X$ which induces a homeomorphism of $Z$ with a closed subset
of $X$, such that $f^\sharp: \calO_X \to f_* \calO_Z$ is surjective.
This has the advantage that it is clear that the property of being 
a closed immersion is local on the target (though you can check it the
other way too, since the ideal sheaf is uniquely determined).


\section{Separated schemes and morphisms}

We are now ready to introduce the analogue of the Hausdorff property for
schemes. However, it is more natural to introduce it for 
morphisms of schemes.

A morphism $f: Y \to X$ is \emph{separated} if the \emph{diagonal morphism}
$\Delta: Y \to Y \times_X Y$ is a closed immersion. Since the formation
of $\Delta$, and the property of it being a closed immersion, 
are local on the target, so is the notion of being separated.

For instance, if $X = \Spec k$ for $k$ a field, and $Y$ consists of
two copies of $\Spec k[x]$ glued along $\Spec k[x,x^{-1}]$,
then $Y \times_X Y$ is the affine plane with \emph{two} copies
of each axis, and \emph{four} copies of the origin. The image of $\Delta$
contains two copies of the origin, but its closure
contains all four. Hence $Y \to X$ is not separated.

\begin{lemma}
A morphism $f: Y \to X$ is separated if and only if the image of the diagonal
$\Delta: Y \to Y \times_X Y$ is a closed subset of $Y \times_X Y$.
\end{lemma}
\begin{proof}
See Hartshorne, Corollary II.4.2. It relies on another useful (but easy)
fact: any \emph{affine} morphism is separated.
\end{proof}

We say a scheme itself is \emph{separated} 
if its unique morphism to $\Spec(\ZZ)$
is separated. This means that by fiat $\Spec(\ZZ)$ is itself separated,
but this seems reasonable enough, especially in light of the following.
\begin{theorem}
Let $X$ be a separated scheme. Then the intersection of any two open
affine subschemes of $X$ is again affine.
\end{theorem}
\begin{proof}
Exercise. (Beware that the converse is false.
The nonseparated example above
also satisfies this condition.)
\end{proof}

There is a valuative criterion for separatedness, but it is hardly ever
useful (because it involves arbitrary valuation rings, which can
be rather nasty); see Hartshorne Theorem II.4.3.

\section{Separatedness and base change}

\begin{theorem}
Separatedness is stable under base change.
\end{theorem}
\begin{proof}
Let $f: Y \to X$ be a separated morphism, and let $Z \to X$ be an
arbitrary morphism. We are supposed to check that the diagonal
\[
Y \times_X Z \to (Y \times_X Z) \times_Z (Y \times_X Z)
\]
is a closed immersion. On the other hand, since closed immersions are stable 
under base change, we already know that
\[
Y \times_X Z \to (Y \times_X Y) \times_X Z
\]
is a closed immersion. It thus suffices to identify the two right sides
in a way commuting with the arrows.

The way to see this is to 
use the functor of points: given $W \to X$, we must identify the maps
into the two right hand sides in a natural way.
The maps to $ (Y \times_X Y) \times_X Z$
give pairs of maps $W \to Y \times_X Y$ and $W \to Z$ which agree on $X$,
then (by splitting the first fibre product) gives triples of maps $W \to Y$, 
$W \to Y$, and $W \to Z$ which all agree on $X$.

The maps to $(Y \times_X Z) \times_Z (Y \times_X Z)$
similarly give pairs of maps $W \to (Y \times_X Z)$, $W \to Y \times_X Z$
which agree on $Z$. Splitting again, we get quadruples
$W \to Y$, $W \to Z$, $W \to Y$, $W \to Z$ which agree on $X$, but
moreover the two maps $W \to Z$ must be the \emph{same map}.
We thus identify with the previous description.
 
\end{proof}

\end{document}

