Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
9525 lines (8662 sloc) 341 KB
\input{preamble}
% OK, start here.
%
\begin{document}
\title{Cohomology on Sites}
\maketitle
\phantomsection
\label{section-phantom}
\tableofcontents
\section{Introduction}
\label{section-introduction}
\noindent
In this document we work out some topics on cohomology of sheaves.
We work out what happens for sheaves on sites,
although often we will simply duplicate the discussion,
the constructions, and the proofs from the topological
case in the case.
Basic references are \cite{SGA4}, \cite{Godement} and \cite{Iversen}.
\section{Topics}
\label{section-topics}
\noindent
Here are some topics that should be discussed in this chapter,
and have not yet been written.
\begin{enumerate}
\item Cohomology of a sheaf of modules on a site is the same
as the cohomology of the underlying abelian sheaf.
\item Hypercohomology on a site.
\item Ext-groups.
\item Ext sheaves.
\item Tor functors.
\item Higher direct images for a morphism of sites.
\item Derived pullback for morphisms between ringed sites.
\item Cup-product.
\item Group cohomology.
\item Comparison of group cohomology and cohomology on $\mathcal{T}_G$.
\item {\v C}ech cohomology on sites.
\item {\v C}ech to cohomology spectral sequence on sites.
\item Leray Spectral sequence for a morphism between ringed sites.
\item Etc, etc, etc.
\end{enumerate}
\section{Cohomology of sheaves}
\label{section-cohomology-sheaves}
\noindent
Let $\mathcal{C}$ be a site, see
Sites, Definition \ref{sites-definition-site}.
Let $\mathcal{F}$ be a abelian sheaf on $\mathcal{C}$.
We know that the category of abelian sheaves on $\mathcal{C}$
has enough injectives, see
Injectives, Theorem \ref{injectives-theorem-sheaves-injectives}.
Hence we can choose an injective resolution
$\mathcal{F}[0] \to \mathcal{I}^\bullet$.
For any object $U$ of the site $\mathcal{C}$ we define
\begin{equation}
\label{equation-cohomology-object-site}
H^i(U, \mathcal{F}) = H^i(\Gamma(U, \mathcal{I}^\bullet))
\end{equation}
to be the {\it $i$th cohomology group of the abelian sheaf
$\mathcal{F}$ over the object $U$}. In other words, these are the
right derived functors of the functor $\mathcal{F} \mapsto \mathcal{F}(U)$.
The family of functors $H^i(U, -)$ forms a universal $\delta$-functor
$\textit{Ab}(\mathcal{C}) \to \textit{Ab}$.
\medskip\noindent
It sometimes happens that
the site $\mathcal{C}$ does not have a final object. In this
case we define the {\it global sections} of a presheaf
of sets $\mathcal{F}$ over $\mathcal{C}$ to be the set
\begin{equation}
\label{equation-global-sections}
\Gamma(\mathcal{C}, \mathcal{F}) =
\Mor_{\textit{PSh}(\mathcal{C})}(e, \mathcal{F})
\end{equation}
where $e$ is a final object in the category of presheaves on $\mathcal{C}$.
In this case, given an abelian sheaf $\mathcal{F}$ on $\mathcal{C}$,
we define the {\it $i$th cohomology group of $\mathcal{F}$ on $\mathcal{C}$}
as follows
\begin{equation}
\label{equation-cohomology}
H^i(\mathcal{C}, \mathcal{F}) = H^i(\Gamma(\mathcal{C}, \mathcal{I}^\bullet))
\end{equation}
in other words, it is the $i$th right derived functor of the
global sections functor.
The family of functors $H^i(\mathcal{C}, -)$ forms a universal $\delta$-functor
$\textit{Ab}(\mathcal{C}) \to \textit{Ab}$.
\medskip\noindent
Let $f : \Sh(\mathcal{C}) \to \Sh(\mathcal{D})$ be a morphism of topoi, see
Sites, Definition \ref{sites-definition-topos}.
With $\mathcal{F}[0] \to \mathcal{I}^\bullet$ as above
we define
\begin{equation}
\label{equation-higher-direct-image}
R^if_*\mathcal{F} = H^i(f_*\mathcal{I}^\bullet)
\end{equation}
to be the {\it $i$th higher direct image of $\mathcal{F}$}.
These are the right derived functors of $f_*$.
The family of functors $R^if_*$ forms a universal $\delta$-functor
from $\textit{Ab}(\mathcal{C}) \to \textit{Ab}(\mathcal{D})$.
\medskip\noindent
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site, see
Modules on Sites, Definition \ref{sites-modules-definition-ringed-site}.
Let $\mathcal{F}$ be an $\mathcal{O}$-module.
We know that the category of $\mathcal{O}$-modules
has enough injectives, see
Injectives, Theorem \ref{injectives-theorem-sheaves-modules-injectives}.
Hence we can choose an injective resolution
$\mathcal{F}[0] \to \mathcal{I}^\bullet$.
For any object $U$ of the site $\mathcal{C}$ we define
\begin{equation}
\label{equation-cohomology-object-site-modules}
H^i(U, \mathcal{F}) = H^i(\Gamma(U, \mathcal{I}^\bullet))
\end{equation}
to be the {\it the $i$th cohomology group of $\mathcal{F}$ over $U$}.
The family of functors $H^i(U, -)$ forms a universal $\delta$-functor
$\textit{Mod}(\mathcal{O}) \to \text{Mod}_{\mathcal{O}(U)}$. Similarly
\begin{equation}
\label{equation-cohomology-modules}
H^i(\mathcal{C}, \mathcal{F}) = H^i(\Gamma(\mathcal{C}, \mathcal{I}^\bullet))
\end{equation}
it the {\it $i$th cohomology group of $\mathcal{F}$ on $\mathcal{C}$}.
The family of functors $H^i(\mathcal{C}, -)$ forms a universal
$\delta$-functor
$\textit{Mod}(\mathcal{C}) \to \text{Mod}_{\Gamma(\mathcal{C}, \mathcal{O})}$.
\medskip\noindent
Let $f : (\Sh(\mathcal{C}), \mathcal{O}) \to (\Sh(\mathcal{D}), \mathcal{O}')$
be a morphism of ringed topoi, see
Modules on Sites, Definition \ref{sites-modules-definition-ringed-topos}.
With $\mathcal{F}[0] \to \mathcal{I}^\bullet$ as above
we define
\begin{equation}
\label{equation-higher-direct-image-modules}
R^if_*\mathcal{F} = H^i(f_*\mathcal{I}^\bullet)
\end{equation}
to be the {\it $i$th higher direct image of $\mathcal{F}$}.
These are the right derived functors of $f_*$.
The family of functors $R^if_*$ forms a universal $\delta$-functor
from $\textit{Mod}(\mathcal{O}) \to \textit{Mod}(\mathcal{O}')$.
\section{Derived functors}
\label{section-derived-functors}
\noindent
We briefly explain an approach to right derived functors using resolution
functors. Namely, suppose that $(\mathcal{C}, \mathcal{O})$ is a ringed site.
In this chapter we will write
$$
K(\mathcal{O}) = K(\textit{Mod}(\mathcal{O}))
\quad
\text{and}
\quad
D(\mathcal{O}) = D(\textit{Mod}(\mathcal{O}))
$$
and similarly for the bounded versions for the triangulated categories
introduced in
Derived Categories, Definition \ref{derived-definition-complexes-notation} and
Definition \ref{derived-definition-unbounded-derived-category}.
By
Derived Categories, Remark \ref{derived-remark-big-abelian-category}
there exists a resolution functor
$$
j = j_{(\mathcal{C}, \mathcal{O})} :
K^{+}(\textit{Mod}(\mathcal{O}))
\longrightarrow
K^{+}(\mathcal{I})
$$
where $\mathcal{I}$ is the strictly full additive subcategory of
$\textit{Mod}(\mathcal{O})$ which consists of injective $\mathcal{O}$-modules.
For any left exact functor $F : \textit{Mod}(\mathcal{O}) \to \mathcal{B}$
into any abelian category $\mathcal{B}$ we will denote $RF$ the
right derived functor of
Derived Categories, Section \ref{derived-section-right-derived-functor}
constructed using the resolution functor $j$ just described:
\begin{equation}
\label{equation-RF}
RF = F \circ j' : D^{+}(\mathcal{O}) \longrightarrow D^{+}(\mathcal{B})
\end{equation}
see
Derived Categories, Lemma \ref{derived-lemma-right-derived-functor}
for notation. Note that we may think of $RF$ as defined on
$\textit{Mod}(\mathcal{O})$, $\text{Comp}^{+}(\textit{Mod}(\mathcal{O}))$, or
$K^{+}(\mathcal{O})$ depending on the situation. According to
Derived Categories, Definition \ref{derived-definition-higher-derived-functors}
we obtain the $i$the right derived functor
\begin{equation}
\label{equation-RFi}
R^iF = H^i \circ RF : \textit{Mod}(\mathcal{O}) \longrightarrow \mathcal{B}
\end{equation}
so that $R^0F = F$ and $\{R^iF, \delta\}_{i \geq 0}$ is universal
$\delta$-functor, see
Derived Categories, Lemma \ref{derived-lemma-higher-derived-functors}.
\medskip\noindent
Here are two special cases of this construction. Given a ring $R$ we write
$K(R) = K(\text{Mod}_R)$ and $D(R) = D(\text{Mod}_R)$ and similarly for the
bounded versions. For any object $U$ of $\mathcal{C}$ have a left exact functor
$
\Gamma(U, -) :
\textit{Mod}(\mathcal{O})
\longrightarrow
\text{Mod}_{\mathcal{O}(U)}
$
which gives rise to
$$
R\Gamma(U, -) :
D^{+}(\mathcal{O})
\longrightarrow
D^{+}(\mathcal{O}(U))
$$
by the discussion above. Note that $H^i(U, -) = R^i\Gamma(U, -)$
is compatible with (\ref{equation-cohomology-object-site-modules}) above.
We similarly have
$$
R\Gamma(\mathcal{C}, -) :
D^{+}(\mathcal{O})
\longrightarrow
D^{+}(\Gamma(\mathcal{C}, \mathcal{O}))
$$
compatible with (\ref{equation-cohomology-modules}). If
$f : (\Sh(\mathcal{C}), \mathcal{O}) \to (\Sh(\mathcal{D}), \mathcal{O}')$
is a morphism of ringed topoi then we get a left exact functor
$f_* : \textit{Mod}(\mathcal{O}) \to \textit{Mod}(\mathcal{O}')$
which gives rise to {\it derived pushforward}
$$
Rf_* : D^{+}(\mathcal{O}) \to D^+(\mathcal{O}')
$$
The $i$th cohomology sheaf of $Rf_*\mathcal{F}^\bullet$ is denoted
$R^if_*\mathcal{F}^\bullet$ and called the $i$th {\it higher direct image}
in accordance with (\ref{equation-higher-direct-image-modules}).
The displayed functors above are exact functor
of derived categories.
\section{First cohomology and torsors}
\label{section-h1-torsors}
\begin{definition}
\label{definition-torsor}
Let $\mathcal{C}$ be a site.
Let $\mathcal{G}$ be a sheaf of (possibly non-commutative)
groups on $\mathcal{C}$.
A {\it pseudo torsor}, or more precisely a
{\it pseudo $\mathcal{G}$-torsor}, is a sheaf
of sets $\mathcal{F}$ on $\mathcal{C}$ endowed with an action
$\mathcal{G} \times \mathcal{F} \to \mathcal{F}$ such that
\begin{enumerate}
\item whenever $\mathcal{F}(U)$ is nonempty the action
$\mathcal{G}(U) \times \mathcal{F}(U) \to \mathcal{F}(U)$
is simply transitive.
\end{enumerate}
A {\it morphism of pseudo $\mathcal{G}$-torsors}
$\mathcal{F} \to \mathcal{F}'$
is simply a morphism of sheaves of sets compatible with the
$\mathcal{G}$-actions.
A {\it torsor}, or more precisely a
{\it $\mathcal{G}$-torsor}, is a pseudo $G$-torsor such that
in addition
\begin{enumerate}
\item[(2)] for every $U \in \Ob(\mathcal{C})$
there exists a covering $\{U_i \to U\}_{i \in I}$ of $U$
such that $\mathcal{F}(U_i)$ is nonempty for all $i \in I$.
\end{enumerate}
A {\it morphism of $G$-torsors} is simply a morphism of
pseudo $G$-torsors.
The {\it trivial $\mathcal{G}$-torsor}
is the sheaf $\mathcal{G}$ endowed with the obvious left
$\mathcal{G}$-action.
\end{definition}
\noindent
It is clear that a morphism of torsors is automatically an isomorphism.
\begin{lemma}
\label{lemma-trivial-torsor}
Let $\mathcal{C}$ be a site.
Let $\mathcal{G}$ be a sheaf of (possibly non-commutative)
groups on $\mathcal{C}$.
A $\mathcal{G}$-torsor $\mathcal{F}$ is trivial if and only if
$\Gamma(\mathcal{C}, \mathcal{F}) \not = \emptyset$.
\end{lemma}
\begin{proof}
Omitted.
\end{proof}
\begin{lemma}
\label{lemma-torsors-h1}
Let $\mathcal{C}$ be a site.
Let $\mathcal{H}$ be an abelian sheaf on $\mathcal{C}$.
There is a canonical bijection between the set of isomorphism
classes of $\mathcal{H}$-torsors and $H^1(\mathcal{C}, \mathcal{H})$.
\end{lemma}
\begin{proof}
Let $\mathcal{F}$ be a $\mathcal{H}$-torsor.
Consider the free abelian sheaf $\mathbf{Z}[\mathcal{F}]$
on $\mathcal{F}$. It is the sheafification of the rule
which associates to $U \in \Ob(\mathcal{C})$ the collection of finite
formal sums $\sum n_i[s_i]$ with $n_i \in \mathbf{Z}$
and $s_i \in \mathcal{F}(U)$. There is a natural map
$$
\sigma : \mathbf{Z}[\mathcal{F}] \longrightarrow \underline{\mathbf{Z}}
$$
which to a local section $\sum n_i[s_i]$ associates $\sum n_i$.
The kernel of $\sigma$ is generated by sections of the form
$[s] - [s']$. There is a canonical map
$a : \Ker(\sigma) \to \mathcal{H}$
which maps $[s] - [s'] \mapsto h$ where $h$ is the local section of
$\mathcal{H}$ such that $h \cdot s = s'$. Consider the pushout diagram
$$
\xymatrix{
0 \ar[r] &
\Ker(\sigma) \ar[r] \ar[d]^a &
\mathbf{Z}[\mathcal{F}] \ar[r] \ar[d] &
\underline{\mathbf{Z}} \ar[r] \ar[d] &
0 \\
0 \ar[r] &
\mathcal{H} \ar[r] &
\mathcal{E} \ar[r] &
\underline{\mathbf{Z}} \ar[r] &
0
}
$$
Here $\mathcal{E}$ is the extension obtained by pushout.
From the long exact cohomology sequence associated to the lower
short exact sequence we obtain an element
$\xi = \xi_\mathcal{F} \in H^1(\mathcal{C}, \mathcal{H})$
by applying the boundary operator to
$1 \in H^0(\mathcal{C}, \underline{\mathbf{Z}})$.
\medskip\noindent
Conversely, given $\xi \in H^1(\mathcal{C}, \mathcal{H})$ we can associate to
$\xi$ a torsor as follows. Choose an embedding $\mathcal{H} \to \mathcal{I}$
of $\mathcal{H}$ into an injective abelian sheaf $\mathcal{I}$. We set
$\mathcal{Q} = \mathcal{I}/\mathcal{H}$ so that we have a short exact
sequence
$$
\xymatrix{
0 \ar[r] &
\mathcal{H} \ar[r] &
\mathcal{I} \ar[r] &
\mathcal{Q} \ar[r] &
0
}
$$
The element $\xi$ is the image of a global section
$q \in H^0(\mathcal{C}, \mathcal{Q})$
because $H^1(\mathcal{C}, \mathcal{I}) = 0$ (see
Derived Categories, Lemma \ref{derived-lemma-higher-derived-functors}).
Let $\mathcal{F} \subset \mathcal{I}$ be the subsheaf (of sets) of sections
that map to $q$ in the sheaf $\mathcal{Q}$. It is easy to verify that
$\mathcal{F}$ is a $\mathcal{H}$-torsor.
\medskip\noindent
We omit the verification that the two constructions given
above are mutually inverse.
\end{proof}
\section{First cohomology and extensions}
\label{section-h1-extensions}
\begin{lemma}
\label{lemma-h1-extensions}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{F}$ be a sheaf of $\mathcal{O}$-modules on $\mathcal{C}$.
There is a canonical bijection
$$
\text{Ext}^1_{\textit{Mod}(\mathcal{O})}(\mathcal{O}, \mathcal{F})
\longrightarrow
H^1(\mathcal{C}, \mathcal{F})
$$
which associates to the extension
$$
0 \to \mathcal{F} \to \mathcal{E} \to \mathcal{O} \to 0
$$
the image of $1 \in \Gamma(\mathcal{C}, \mathcal{O})$ in
$H^1(\mathcal{C}, \mathcal{F})$.
\end{lemma}
\begin{proof}
Let us construct the inverse of the map given in the lemma.
Let $\xi \in H^1(\mathcal{C}, \mathcal{F})$.
Choose an injection $\mathcal{F} \subset \mathcal{I}$ with
$\mathcal{I}$ injective in $\textit{Mod}(\mathcal{O})$.
Set $\mathcal{Q} = \mathcal{I}/\mathcal{F}$.
By the long exact sequence of cohomology, we see that
$\xi$ is the image of of a section
$\tilde \xi \in \Gamma(\mathcal{C}, \mathcal{Q}) =
\Hom_\mathcal{O}(\mathcal{O}, \mathcal{Q})$.
Now, we just form the pullback
$$
\xymatrix{
0 \ar[r] &
\mathcal{F} \ar[r] \ar@{=}[d] &
\mathcal{E} \ar[r] \ar[d] &
\mathcal{O} \ar[r] \ar[d]^{\tilde \xi} &
0 \\
0 \ar[r] &
\mathcal{F} \ar[r] &
\mathcal{I} \ar[r] &
\mathcal{Q} \ar[r] &
0
}
$$
see Homology, Section \ref{homology-section-extensions}.
\end{proof}
\noindent
The following lemma will be superseded by the more general
Lemma \ref{lemma-cohomology-modules-abelian-agree}.
\begin{lemma}
\label{lemma-h1-mod-ab-agree}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{F}$ be a sheaf of $\mathcal{O}$-modules on $\mathcal{C}$.
Let $\mathcal{F}_{ab}$ denote the underlying sheaf of abelian
groups. Then there is a functorial isomorphism
$$
H^1(\mathcal{C}, \mathcal{F}_{ab})
=
H^1(\mathcal{C}, \mathcal{F})
$$
where the left hand side is cohomology computed in
$\textit{Ab}(\mathcal{C})$ and the right hand side
is cohomology computed in $\textit{Mod}(\mathcal{O})$.
\end{lemma}
\begin{proof}
Let $\underline{\mathbf{Z}}$ denote the constant sheaf
$\mathbf{Z}$. As
$\textit{Ab}(\mathcal{C}) = \textit{Mod}(\underline{\mathbf{Z}})$
we may apply
Lemma \ref{lemma-h1-extensions}
twice, and it follows that we have to show
$$
\text{Ext}^1_{\textit{Mod}(\mathcal{O})}(\mathcal{O}, \mathcal{F})
=
\text{Ext}^1_{\textit{Mod}(\underline{\mathbf{Z}})}(
\underline{\mathbf{Z}}, \mathcal{F}_{ab}).
$$
Suppose that $0 \to \mathcal{F} \to \mathcal{E} \to \mathcal{O} \to 0$
is an extension in $\textit{Mod}(\mathcal{O})$. Then we can use
the obvious map of abelian sheaves
$1 : \underline{\mathbf{Z}} \to \mathcal{O}$
and pullback to obtain an extension $\mathcal{E}_{ab}$, like so:
$$
\xymatrix{
0 \ar[r] &
\mathcal{F}_{ab} \ar[r] \ar@{=}[d] &
\mathcal{E}_{ab} \ar[r] \ar[d] &
\underline{\mathbf{Z}} \ar[r] \ar[d]^{1} &
0 \\
0 \ar[r] &
\mathcal{F} \ar[r] &
\mathcal{E} \ar[r] &
\mathcal{O} \ar[r] &
0
}
$$
The converse is a little more fun. Suppose that
$0 \to \mathcal{F}_{ab} \to \mathcal{E}_{ab} \to \underline{\mathbf{Z}} \to 0$
is an extension in $\textit{Mod}(\underline{\mathbf{Z}})$.
Since $\underline{\mathbf{Z}}$ is a flat $\underline{\mathbf{Z}}$-module
we see that the sequence
$$
0 \to \mathcal{F}_{ab} \otimes_{\underline{\mathbf{Z}}} \mathcal{O}
\to \mathcal{E}_{ab} \otimes_{\underline{\mathbf{Z}}} \mathcal{O}
\to \underline{\mathbf{Z}} \otimes_{\underline{\mathbf{Z}}} \mathcal{O}
\to 0
$$
is exact, see
Modules on Sites, Lemma \ref{sites-modules-lemma-flat-tor-zero}.
Of course
$\underline{\mathbf{Z}} \otimes_{\underline{\mathbf{Z}}} \mathcal{O}
= \mathcal{O}$.
Hence we can form the pushout via the ($\mathcal{O}$-linear) multiplication map
$\mu : \mathcal{F} \otimes_{\underline{\mathbf{Z}}} \mathcal{O}
\to \mathcal{F}$ to get an extension of $\mathcal{O}$ by
$\mathcal{F}$, like this
$$
\xymatrix{
0 \ar[r] &
\mathcal{F}_{ab} \otimes_{\underline{\mathbf{Z}}} \mathcal{O}
\ar[r] \ar[d]^\mu &
\mathcal{E}_{ab} \otimes_{\underline{\mathbf{Z}}} \mathcal{O}
\ar[r] \ar[d] &
\mathcal{O} \ar[r] \ar@{=}[d] &
0 \\
0 \ar[r] &
\mathcal{F} \ar[r] &
\mathcal{E} \ar[r] &
\mathcal{O} \ar[r] &
0
}
$$
which is the desired extension. We omit the verification that these
constructions are mutually inverse.
\end{proof}
\section{First cohomology and invertible sheaves}
\label{section-invertible-sheaves}
\noindent
The Picard group of a ringed site is defined in
Modules on Sites, Section \ref{sites-modules-section-invertible}.
\begin{lemma}
\label{lemma-h1-invertible}
Let $(\mathcal{C}, \mathcal{O})$ be a locally ringed site.
There is a canonical isomorphism
$$
H^1(\mathcal{C}, \mathcal{O}^*) = \text{Pic}(\mathcal{O}).
$$
of abelian groups.
\end{lemma}
\begin{proof}
Let $\mathcal{L}$ be an invertible $\mathcal{O}$-module.
Consider the presheaf $\mathcal{L}^*$ defined by the rule
$$
U \longmapsto \{s \in \mathcal{L}(U)
\text{ such that } \mathcal{O}_U \xrightarrow{s \cdot -} \mathcal{L}_U
\text{ is an isomorphism}\}
$$
This presheaf satisfies the sheaf condition. Moreover, if
$f \in \mathcal{O}^*(U)$ and $s \in \mathcal{L}^*(U)$, then clearly
$fs \in \mathcal{L}^*(U)$. By the same token, if $s, s' \in \mathcal{L}^*(U)$
then there exists a unique $f \in \mathcal{O}^*(U)$ such that
$fs = s'$. Moreover, the sheaf $\mathcal{L}^*$ has sections locally
by Modules on Sites, Lemma
\ref{sites-modules-lemma-invertible-is-locally-free-rank-1}.
In other words we
see that $\mathcal{L}^*$ is a $\mathcal{O}^*$-torsor. Thus we get
a map
$$
\begin{matrix}
\text{set of invertible sheaves on }(\mathcal{C}, \mathcal{O}) \\
\text{ up to isomorphism}
\end{matrix}
\longrightarrow
\begin{matrix}
\text{set of }\mathcal{O}^*\text{-torsors} \\
\text{ up to isomorphism}
\end{matrix}
$$
We omit the verification that this is a homomorphism of abelian groups.
By
Lemma \ref{lemma-torsors-h1}
the right hand side is canonically
bijective to $H^1(\mathcal{C}, \mathcal{O}^*)$.
Thus we have to show this map is injective and surjective.
\medskip\noindent
Injective. If the torsor $\mathcal{L}^*$ is trivial, this means by
Lemma \ref{lemma-trivial-torsor}
that $\mathcal{L}^*$ has a global section.
Hence this means exactly that $\mathcal{L} \cong \mathcal{O}$ is
the neutral element in $\text{Pic}(\mathcal{O})$.
\medskip\noindent
Surjective. Let $\mathcal{F}$ be an $\mathcal{O}^*$-torsor.
Consider the presheaf of sets
$$
\mathcal{L}_1 : U \longmapsto
(\mathcal{F}(U) \times \mathcal{O}(U))/\mathcal{O}^*(U)
$$
where the action of $f \in \mathcal{O}^*(U)$ on
$(s, g)$ is $(fs, f^{-1}g)$. Then $\mathcal{L}_1$ is a presheaf
of $\mathcal{O}$-modules by setting
$(s, g) + (s', g') = (s, g + (s'/s)g')$ where $s'/s$ is the local
section $f$ of $\mathcal{O}^*$ such that $fs = s'$, and
$h(s, g) = (s, hg)$ for $h$ a local section of $\mathcal{O}$.
We omit the verification that the sheafification
$\mathcal{L} = \mathcal{L}_1^\#$ is an invertible $\mathcal{O}$-module
whose associated $\mathcal{O}^*$-torsor $\mathcal{L}^*$ is isomorphic
to $\mathcal{F}$.
\end{proof}
\section{Locality of cohomology}
\label{section-locality}
\noindent
The following lemma says there is no ambiguity in defining the cohomology
of a sheaf $\mathcal{F}$ over an object of the site.
\begin{lemma}
\label{lemma-cohomology-of-open}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $U$ be an object of $\mathcal{C}$.
\begin{enumerate}
\item If $\mathcal{I}$ is an injective $\mathcal{O}$-module
then $\mathcal{I}|_U$ is an injective $\mathcal{O}_U$-module.
\item For any sheaf of $\mathcal{O}$-modules $\mathcal{F}$ we have
$H^p(U, \mathcal{F}) = H^p(\mathcal{C}/U, \mathcal{F}|_U)$.
\end{enumerate}
\end{lemma}
\begin{proof}
Recall that the functor $j_U^{-1}$ of restriction to $U$ is a right adjoint
to the functor $j_{U!}$ of extension by $0$, see
Modules on Sites, Section
\ref{sites-modules-section-localize}.
Moreover, $j_{U!}$ is exact. Hence (1) follows from
Homology, Lemma \ref{homology-lemma-adjoint-preserve-injectives}.
\medskip\noindent
By definition $H^p(U, \mathcal{F}) = H^p(\mathcal{I}^\bullet(U))$
where $\mathcal{F} \to \mathcal{I}^\bullet$ is an injective resolution
in $\textit{Mod}(\mathcal{O})$.
By the above we see that $\mathcal{F}|_U \to \mathcal{I}^\bullet|_U$
is an injective resolution in $\textit{Mod}(\mathcal{O}_U)$.
Hence $H^p(U, \mathcal{F}|_U)$ is equal to
$H^p(\mathcal{I}^\bullet|_U(U))$.
Of course $\mathcal{F}(U) = \mathcal{F}|_U(U)$ for
any sheaf $\mathcal{F}$ on $\mathcal{C}$.
Hence the equality in (2).
\end{proof}
\noindent
The following lemma will be use to see what happens if we change a
partial universe, or to compare cohomology of the small and big \'etale
sites.
\begin{lemma}
\label{lemma-cohomology-bigger-site}
Let $\mathcal{C}$ and $\mathcal{D}$ be sites.
Let $u : \mathcal{C} \to \mathcal{D}$ be a functor.
Assume $u$ satisfies the hypotheses of
Sites, Lemma \ref{sites-lemma-bigger-site}.
Let $g : \Sh(\mathcal{C}) \to \Sh(\mathcal{D})$
be the associated morphism of topoi.
For any abelian sheaf $\mathcal{F}$ on $\mathcal{D}$ we have
isomorphisms
$$
R\Gamma(\mathcal{C}, g^{-1}\mathcal{F}) = R\Gamma(\mathcal{D}, \mathcal{F}),
$$
in particular
$H^p(\mathcal{C}, g^{-1}\mathcal{F}) = H^p(\mathcal{D}, \mathcal{F})$
and for any $U \in \Ob(\mathcal{C})$ we have isomorphisms
$$
R\Gamma(U, g^{-1}\mathcal{F}) = R\Gamma(u(U), \mathcal{F}),
$$
in particular
$H^p(U, g^{-1}\mathcal{F}) = H^p(u(U), \mathcal{F})$. All of these
isomorphisms are functorial in $\mathcal{F}$.
\end{lemma}
\begin{proof}
Since it is clear that
$\Gamma(\mathcal{C}, g^{-1}\mathcal{F}) = \Gamma(\mathcal{D}, \mathcal{F})$
by hypothesis (e), it suffices to show that $g^{-1}$ transforms injective
abelian sheaves into injective abelian sheaves. As usual we use
Homology, Lemma \ref{homology-lemma-adjoint-preserve-injectives}
to see this. The left adjoint to $g^{-1}$ is $g_! = f^{-1}$ with the
notation of
Sites, Lemma \ref{sites-lemma-bigger-site}
which is an exact functor. Hence the lemma does indeed apply.
\end{proof}
\noindent
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{F}$ be a sheaf of $\mathcal{O}$-modules.
Let $\varphi : U \to V$ be a morphism of $\mathcal{O}$.
Then there is a canonical {\it restriction mapping}
\begin{equation}
\label{equation-restriction-mapping}
H^n(V, \mathcal{F})
\longrightarrow
H^n(U, \mathcal{F}), \quad
\xi \longmapsto \xi|_U
\end{equation}
functorial in $\mathcal{F}$. Namely, choose any injective
resolution $\mathcal{F} \to \mathcal{I}^\bullet$. The restriction
mappings of the sheaves $\mathcal{I}^p$ give a morphism of complexes
$$
\Gamma(V, \mathcal{I}^\bullet)
\longrightarrow
\Gamma(U, \mathcal{I}^\bullet)
$$
The LHS is a complex representing $R\Gamma(V, \mathcal{F})$
and the RHS is a complex representing $R\Gamma(U, \mathcal{F})$.
We get the map on cohomology groups by applying the functor $H^n$.
As indicated we will use the notation $\xi \mapsto \xi|_U$ to denote this map.
Thus the rule $U \mapsto H^n(U, \mathcal{F})$ is a presheaf of
$\mathcal{O}$-modules. This presheaf is customarily denoted
$\underline{H}^n(\mathcal{F})$. We will give another interpretation
of this presheaf in Lemma \ref{lemma-include}.
\medskip\noindent
The following lemma says that it is possible to kill higher cohomology
classes by going to a covering.
\begin{lemma}
\label{lemma-kill-cohomology-class-on-covering}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{F}$ be a sheaf of $\mathcal{O}$-modules.
Let $U$ be an object of $\mathcal{C}$.
Let $n > 0$ and let $\xi \in H^n(U, \mathcal{F})$.
Then there exists a covering $\{U_i \to U\}$ of $\mathcal{C}$
such that $\xi|_{U_i} = 0$ for all $i \in I$.
\end{lemma}
\begin{proof}
Let $\mathcal{F} \to \mathcal{I}^\bullet$ be an injective resolution.
Then
$$
H^n(U, \mathcal{F}) =
\frac{\Ker(\mathcal{I}^n(U) \to \mathcal{I}^{n + 1}(U))}
{\Im(\mathcal{I}^{n - 1}(U) \to \mathcal{I}^n(U))}.
$$
Pick an element $\tilde \xi \in \mathcal{I}^n(U)$ representing the
cohomology class in the presentation above. Since $\mathcal{I}^\bullet$
is an injective resolution of $\mathcal{F}$ and $n > 0$ we see that
the complex $\mathcal{I}^\bullet$ is exact in degree $n$. Hence
$\Im(\mathcal{I}^{n - 1} \to \mathcal{I}^n) =
\Ker(\mathcal{I}^n \to \mathcal{I}^{n + 1})$ as sheaves.
Since $\tilde \xi$ is a section of the kernel sheaf over $U$
we conclude there exists a covering $\{U_i \to U\}$ of the site
such that $\tilde \xi|_{U_i}$ is the image under $d$ of a section
$\xi_i \in \mathcal{I}^{n - 1}(U_i)$. By our definition of the
restriction $\xi|_{U_i}$ as corresponding to the class of
$\tilde \xi|_{U_i}$ we conclude.
\end{proof}
\begin{lemma}
\label{lemma-higher-direct-images}
Let $f : (\mathcal{C}, \mathcal{O}_\mathcal{C}) \to
(\mathcal{D}, \mathcal{O}_\mathcal{D})$ be a morphism of ringed sites
corresponding to the continuous functor $u : \mathcal{D} \to \mathcal{C}$.
For any $\mathcal{F} \in \Ob(\textit{Mod}(\mathcal{O}_\mathcal{C}))$
the sheaf $R^if_*\mathcal{F}$ is the sheaf associated to the
presheaf
$$
V \longmapsto H^i(u(V), \mathcal{F})
$$
\end{lemma}
\begin{proof}
Let $\mathcal{F} \to \mathcal{I}^\bullet$ be an injective resolution.
Then $R^if_*\mathcal{F}$ is by definition the $i$th cohomology sheaf
of the complex
$$
f_*\mathcal{I}^0 \to f_*\mathcal{I}^1 \to f_*\mathcal{I}^2 \to \ldots
$$
By definition of the abelian category structure on
$\mathcal{O}_\mathcal{D}$-modules
this cohomology sheaf is the sheaf associated to the presheaf
$$
V
\longmapsto
\frac{\Ker(f_*\mathcal{I}^i(V) \to f_*\mathcal{I}^{i + 1}(V))}
{\Im(f_*\mathcal{I}^{i - 1}(V) \to f_*\mathcal{I}^i(V))}
$$
and this is obviously equal to
$$
\frac{\Ker(\mathcal{I}^i(u(V)) \to \mathcal{I}^{i + 1}(u(V)))}
{\Im(\mathcal{I}^{i - 1}(u(V)) \to \mathcal{I}^i(u(V)))}
$$
which is equal to $H^i(u(V), \mathcal{F})$
and we win.
\end{proof}
\section{The {\v C}ech complex and {\v C}ech cohomology}
\label{section-cech}
\noindent
Let $\mathcal{C}$ be a category. Let $\mathcal{U} = \{U_i \to U\}_{i \in I}$
be a family of morphisms with fixed target, see
Sites, Definition \ref{sites-definition-family-morphisms-fixed-target}.
Assume that all fibre products $U_{i_0} \times_U \ldots \times_U U_{i_p}$
exist in $\mathcal{C}$. Let $\mathcal{F}$ be an abelian presheaf on
$\mathcal{C}$. Set
$$
\check{\mathcal{C}}^p(\mathcal{U}, \mathcal{F})
=
\prod\nolimits_{(i_0, \ldots, i_p) \in I^{p + 1}}
\mathcal{F}(U_{i_0} \times_U \ldots \times_U U_{i_p}).
$$
This is an abelian group. For
$s \in \check{\mathcal{C}}^p(\mathcal{U}, \mathcal{F})$ we denote
$s_{i_0\ldots i_p}$ its value in the factor
$\mathcal{F}(U_{i_0} \times_U \ldots \times_U U_{i_p})$.
We define
$$
d : \check{\mathcal{C}}^p(\mathcal{U}, \mathcal{F})
\longrightarrow
\check{\mathcal{C}}^{p + 1}(\mathcal{U}, \mathcal{F})
$$
by the formula
\begin{equation}
\label{equation-d-cech}
d(s)_{i_0\ldots i_{p + 1}} =
\sum\nolimits_{j = 0}^{p + 1}
(-1)^j s_{i_0\ldots \hat i_j \ldots i_p}
|_{U_{i_0} \times_U \ldots \times_U U_{i_{p + 1}}}
\end{equation}
where the restriction is via the projection map
$$
U_{i_0} \times_U \ldots \times_U U_{i_{p + 1}} \longrightarrow
U_{i_0} \times_U \ldots \times_U \widehat{U_{i_j}} \times_U
\ldots \times_U U_{i_{p + 1}}.
$$
It is straightforward to see that $d \circ d = 0$. In other words
$\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})$ is a complex.
\begin{definition}
\label{definition-cech-complex}
Let $\mathcal{C}$ be a category. Let $\mathcal{U} = \{U_i \to U\}_{i \in I}$
be a family of morphisms with fixed target such that all fibre products
$U_{i_0} \times_U \ldots \times_U U_{i_p}$ exist in $\mathcal{C}$.
Let $\mathcal{F}$ be an abelian presheaf on $\mathcal{C}$.
The complex $\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})$
is the {\it {\v C}ech complex} associated to $\mathcal{F}$ and the
family $\mathcal{U}$. Its cohomology groups
$H^i(\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}))$ are
called the {\it {\v C}ech cohomology groups} of $\mathcal{F}$ with respect
to $\mathcal{U}$. They are denoted $\check H^i(\mathcal{U}, \mathcal{F})$.
\end{definition}
\noindent
We observe that any covering $\{U_i \to U\}$ of a site $\mathcal{C}$
is a family of morphisms with fixed target to which the definition applies.
\begin{lemma}
\label{lemma-cech-h0}
Let $\mathcal{C}$ be a site.
Let $\mathcal{F}$ be an abelian presheaf on $\mathcal{C}$.
The following are equivalent
\begin{enumerate}
\item $\mathcal{F}$ is an abelian sheaf on $\mathcal{C}$ and
\item for every covering $\mathcal{U} = \{U_i \to U\}_{i \in I}$
of the site $\mathcal{C}$ the natural map
$$
\mathcal{F}(U) \to \check{H}^0(\mathcal{U}, \mathcal{F})
$$
(see Sites, Section \ref{sites-section-sheafification}) is bijective.
\end{enumerate}
\end{lemma}
\begin{proof}
This is true since the sheaf condition is exactly that
$\mathcal{F}(U) \to \check{H}^0(\mathcal{U}, \mathcal{F})$
is bijective for every covering of $\mathcal{C}$.
\end{proof}
\noindent
Let $\mathcal{C}$ be a category. Let $\mathcal{U} = \{U_i \to U\}_{i\in I}$
be a family of morphisms of $\mathcal{C}$ with fixed target such that
all fibre products $U_{i_0} \times_U \ldots \times_U U_{i_p}$ exist in
$\mathcal{C}$. Let $\mathcal{V} = \{V_j \to V\}_{j\in J}$ be another.
Let $f : U \to V$, $\alpha : I \to J$ and $f_i : U_i \to V_{\alpha(i)}$
be a morphism of families of morphisms with fixed target, see
Sites, Section \ref{sites-section-refinements}.
In this case we get a map of {\v C}ech complexes
\begin{equation}
\label{equation-map-cech-complexes}
\varphi : \check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{F})
\longrightarrow
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\end{equation}
which in degree $p$ is given by
$$
\varphi(s)_{i_0 \ldots i_p} =
(f_{i_0} \times \ldots \times f_{i_p})^*s_{\alpha(i_0) \ldots \alpha(i_p)}
$$
\section{{\v C}ech cohomology as a functor on presheaves}
\label{section-cech-functor}
\noindent
Warning: In this section we work exclusively with abelian presheaves
on a category. The results are completely wrong in the
setting of sheaves and categories of sheaves!
\medskip\noindent
Let $\mathcal{C}$ be a category. Let $\mathcal{U} = \{U_i \to U\}_{i \in I}$
be a family of morphisms with fixed target such that all fibre products
$U_{i_0} \times_U \ldots \times_U U_{i_p}$ exist in $\mathcal{C}$.
Let $\mathcal{F}$ be an abelian presheaf on $\mathcal{C}$.
The construction
$$
\mathcal{F} \longmapsto \check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
$$
is functorial in $\mathcal{F}$. In fact, it is a functor
\begin{equation}
\label{equation-cech-functor}
\check{\mathcal{C}}^\bullet(\mathcal{U}, -) :
\textit{PAb}(\mathcal{C})
\longrightarrow
\text{Comp}^{+}(\textit{Ab})
\end{equation}
see
Derived Categories, Definition \ref{derived-definition-complexes-notation}
for notation. Recall that the category of bounded below complexes
in an abelian category is an abelian category, see
Homology, Lemma \ref{homology-lemma-cat-cochain-abelian}.
\begin{lemma}
\label{lemma-cech-exact-presheaves}
The functor given by Equation (\ref{equation-cech-functor})
is an exact functor (see Homology, Lemma \ref{homology-lemma-exact-functor}).
\end{lemma}
\begin{proof}
For any object $W$ of $\mathcal{C}$ the functor
$\mathcal{F} \mapsto \mathcal{F}(W)$ is an additive exact functor
from $\textit{PAb}(\mathcal{C})$ to $\textit{Ab}$.
The terms $\check{\mathcal{C}}^p(\mathcal{U}, \mathcal{F})$
of the complex are products of these exact functors and hence exact.
Moreover a sequence of complexes is exact if and only if the sequence
of terms in a given degree is exact. Hence the lemma follows.
\end{proof}
\begin{lemma}
\label{lemma-cech-cohomology-delta-functor-presheaves}
Let $\mathcal{C}$ be a category.
Let $\mathcal{U} = \{U_i \to U\}_{i \in I}$ be a family of morphisms
with fixed target such that all fibre products
$U_{i_0} \times_U \ldots \times_U U_{i_p}$ exist in $\mathcal{C}$.
The functors $\mathcal{F} \mapsto \check{H}^n(\mathcal{U}, \mathcal{F})$
form a $\delta$-functor from the abelian category $\textit{PAb}(\mathcal{C})$
to the category of $\mathbf{Z}$-modules (see
Homology, Definition \ref{homology-definition-cohomological-delta-functor}).
\end{lemma}
\begin{proof}
By
Lemma \ref{lemma-cech-exact-presheaves}
a short exact sequence of abelian presheaves
$0 \to \mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3 \to 0$
is turned into a short exact sequence of complexes of
$\mathbf{Z}$-modules. Hence we can use
Homology, Lemma \ref{homology-lemma-long-exact-sequence-cochain}
to get the boundary maps
$\delta_{\mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3} :
\check{H}^n(\mathcal{U}, \mathcal{F}_3) \to
\check{H}^{n + 1}(\mathcal{U}, \mathcal{F}_1)$
and a corresponding long exact sequence. We omit the verification
that these maps are compatible with maps between short exact
sequences of presheaves.
\end{proof}
\begin{lemma}
\label{lemma-cech-map-into}
Let $\mathcal{C}$ be a category. Let $\mathcal{U} = \{U_i \to U\}_{i \in I}$
be a family of morphisms with fixed target such that all fibre products
$U_{i_0} \times_U \ldots \times_U U_{i_p}$ exist in $\mathcal{C}$.
Consider the chain complex $\mathbf{Z}_{\mathcal{U}, \bullet}$
of abelian presheaves
$$
\ldots
\to
\bigoplus_{i_0i_1i_2} \mathbf{Z}_{U_{i_0} \times_U U_{i_1} \times_U U_{i_2}}
\to
\bigoplus_{i_0i_1} \mathbf{Z}_{U_{i_0} \times_U U_{i_1}}
\to
\bigoplus_{i_0} \mathbf{Z}_{U_{i_0}}
\to 0 \to \ldots
$$
where the last nonzero term is placed in degree $0$
and where the map
$$
\mathbf{Z}_{U_{i_0} \times_U \ldots \times_u U_{i_{p + 1}}}
\longrightarrow
\mathbf{Z}_{U_{i_0} \times_U
\ldots \widehat{U_{i_j}} \ldots \times_U U_{i_{p + 1}}}
$$
is given by $(-1)^j$ times the canonical map.
Then there is an isomorphism
$$
\Hom_{\textit{PAb}(\mathcal{C})}(\mathbf{Z}_{{U}, \bullet}, \mathcal{F})
=
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
$$
functorial in $\mathcal{F} \in \Ob(\textit{PAb}(\mathcal{C}))$.
\end{lemma}
\begin{proof}
This is a tautology based on the fact that
\begin{align*}
\Hom_{\textit{PAb}(\mathcal{C})}(
\bigoplus_{i_0 \ldots i_p}
\mathbf{Z}_{U_{i_0} \times_U \ldots \times_U U_{i_p}},
\mathcal{F})
& =
\prod_{i_0 \ldots i_p}
\Hom_{\textit{PAb}(\mathcal{C})}(
\mathbf{Z}_{U_{i_0} \times_U \ldots \times_U U_{i_p}},
\mathcal{F}) \\
& =
\prod_{i_0 \ldots i_p}
\mathcal{F}(U_{i_0} \times_U \ldots \times_U U_{i_p})
\end{align*}
see Modules on Sites, Lemma \ref{sites-modules-lemma-obvious-adjointness}.
\end{proof}
\begin{lemma}
\label{lemma-homology-complex}
Let $\mathcal{C}$ be a category. Let
$\mathcal{U} = \{f_i : U_i \to U\}_{i \in I}$ be a family of morphisms
with fixed target such that all fibre products
$U_{i_0} \times_U \ldots \times_U U_{i_p}$ exist in $\mathcal{C}$.
The chain complex $\mathbf{Z}_{\mathcal{U}, \bullet}$ of presheaves
of Lemma \ref{lemma-cech-map-into} above is exact in positive
degrees, i.e., the homology presheaves
$H_i(\mathbf{Z}_{\mathcal{U}, \bullet})$ are zero for $i > 0$.
\end{lemma}
\begin{proof}
Let $V$ be an object of $\mathcal{C}$. We have to show that the chain complex
of abelian groups $\mathbf{Z}_{\mathcal{U}, \bullet}(V)$ is exact in
degrees $> 0$. This is the complex
$$
\xymatrix{
\ldots \ar[d] \\
\bigoplus_{i_0i_1i_2}
\mathbf{Z}[
\Mor_\mathcal{C}(V, U_{i_0} \times_U U_{i_1} \times_U U_{i_2})
]
\ar[d] \\
\bigoplus_{i_0i_1}
\mathbf{Z}[
\Mor_\mathcal{C}(V, U_{i_0} \times_U U_{i_1})
]
\ar[d] \\
\bigoplus_{i_0}
\mathbf{Z}[
\Mor_\mathcal{C}(V, U_{i_0})
] \ar[d] \\
0
}
$$
For any morphism $\varphi : V \to U$ denote
$\Mor_\varphi(V, U_i) = \{\varphi_i : V \to U_i \mid
f_i \circ \varphi_i = \varphi\}$. We will use a similar notation
for $\Mor_\varphi(V, U_{i_0} \times_U \ldots \times_U U_{i_p})$.
Note that composing with the various projection maps between the
fibred products $U_{i_0} \times_U \ldots \times_U U_{i_p}$ preserves
these morphism sets. Hence we see that the complex above
is the same as the complex
$$
\xymatrix{
\ldots \ar[d] \\
\bigoplus_\varphi
\bigoplus_{i_0i_1i_2}
\mathbf{Z}[
\Mor_\varphi(V, U_{i_0} \times_U U_{i_1} \times_U U_{i_2})
]
\ar[d] \\
\bigoplus_\varphi
\bigoplus_{i_0i_1}
\mathbf{Z}[
\Mor_\varphi(V, U_{i_0} \times_U U_{i_1})
]
\ar[d] \\
\bigoplus_\varphi
\bigoplus_{i_0}
\mathbf{Z}[
\Mor_\varphi(V, U_{i_0})
] \ar[d] \\
0
}
$$
Next, we make the remark that we have
$$
\Mor_\varphi(V, U_{i_0} \times_U \ldots \times_U U_{i_p})
=
\Mor_\varphi(V, U_{i_0}) \times \ldots
\times \Mor_\varphi(V, U_{i_p})
$$
Using this and the fact that $\mathbf{Z}[A] \oplus \mathbf{Z}[B] =
\mathbf{Z}[A \amalg B]$ we see that the complex becomes
$$
\xymatrix{
\ldots \ar[d] \\
\bigoplus_\varphi
\mathbf{Z}\left[
\coprod_{i_0i_1i_2}
\Mor_\varphi(V, U_{i_0}) \times \Mor_\varphi(V, U_{i_2})
\right]
\ar[d] \\
\bigoplus_\varphi
\mathbf{Z}\left[
\coprod_{i_0i_1}
\Mor_\varphi(V, U_{i_0}) \times \Mor_\varphi(V, U_{i_1})
\right]
\ar[d] \\
\bigoplus_\varphi
\mathbf{Z}\left[
\coprod_{i_0}
\Mor_\varphi(V, U_{i_0})
\right] \ar[d] \\
0
}
$$
Finally, on setting $S_\varphi = \coprod_{i \in I} \Mor_\varphi(V, U_i)$
we see that we get
$$
\bigoplus\nolimits_\varphi \left(\ldots \to
\mathbf{Z}[S_\varphi \times S_\varphi \times S_\varphi] \to
\mathbf{Z}[S_\varphi \times S_\varphi] \to
\mathbf{Z}[S_\varphi] \to 0 \to \ldots
\right)
$$
Thus we have simplified our task. Namely, it suffices to show that
for any nonempty set $S$ the (extended) complex of free abelian groups
$$
\ldots \to
\mathbf{Z}[S \times S \times S] \to
\mathbf{Z}[S \times S] \to
\mathbf{Z}[S] \xrightarrow{\Sigma} \mathbf{Z} \to 0 \to \ldots
$$
is exact in all degrees. To see this fix an element $s \in S$, and
use the homotopy
$$
n_{(s_0, \ldots, s_p)} \longmapsto n_{(s, s_0, \ldots, s_p)}
$$
with obvious notations.
\end{proof}
\begin{lemma}
\label{lemma-complex-tensored-still-exact}
\begin{slogan}
The integral presheaf {\v C}ech complex is a flat resolution of the
constant presheaf of integers.
\end{slogan}
Let $\mathcal{C}$ be a category. Let
$\mathcal{U} = \{f_i : U_i \to U\}_{i \in I}$ be a family of morphisms
with fixed target such that all fibre products
$U_{i_0} \times_U \ldots \times_U U_{i_p}$ exist in $\mathcal{C}$.
Let $\mathcal{O}$ be a presheaf of rings on $\mathcal{C}$.
The chain complex
$$
\mathbf{Z}_{\mathcal{U}, \bullet}
\otimes_{p, \mathbf{Z}}
\mathcal{O}
$$
is exact in positive degrees. Here $\mathbf{Z}_{\mathcal{U}, \bullet}$
is the cochain complex of Lemma \ref{lemma-cech-map-into}, and
the tensor product is over the constant presheaf of rings
with value $\mathbf{Z}$.
\end{lemma}
\begin{proof}
Let $V$ be an object of $\mathcal{C}$.
In the proof of Lemma \ref{lemma-homology-complex} we saw that
$\mathbf{Z}_{\mathcal{U}, \bullet}(V)$ is isomorphic as a complex
to a direct sum of complexes which are homotopic to $\mathbf{Z}$
placed in degree zero. Hence also
$\mathbf{Z}_{\mathcal{U}, \bullet}(V) \otimes_\mathbf{Z} \mathcal{O}(V)$
is isomorphic as a complex to a direct sum of complexes which are homotopic
to $\mathcal{O}(V)$ placed in degree zero.
Or you can use
Modules on Sites, Lemma \ref{sites-modules-lemma-flat-resolution-of-flat},
which applies since the presheaves $\mathbf{Z}_{\mathcal{U}, i}$ are flat,
and the proof of Lemma \ref{lemma-homology-complex} shows that
$H_0(\mathbf{Z}_{\mathcal{U}, \bullet})$ is a flat presheaf also.
\end{proof}
\begin{lemma}
\label{lemma-cech-cohomology-derived-presheaves}
Let $\mathcal{C}$ be a category. Let
$\mathcal{U} = \{f_i : U_i \to U\}_{i \in I}$ be a family of morphisms
with fixed target such that all fibre products
$U_{i_0} \times_U \ldots \times_U U_{i_p}$ exist in $\mathcal{C}$.
The {\v C}ech cohomology functors $\check{H}^p(\mathcal{U}, -)$
are canonically isomorphic as a $\delta$-functor to
the right derived functors of the functor
$$
\check{H}^0(\mathcal{U}, -) :
\textit{PAb}(\mathcal{C})
\longrightarrow
\textit{Ab}.
$$
Moreover, there is a functorial quasi-isomorphism
$$
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\longrightarrow
R\check{H}^0(\mathcal{U}, \mathcal{F})
$$
where the right hand side indicates the derived functor
$$
R\check{H}^0(\mathcal{U}, -) :
D^{+}(\textit{PAb}(\mathcal{C}))
\longrightarrow
D^{+}(\mathbf{Z})
$$
of the left exact functor $\check{H}^0(\mathcal{U}, -)$.
\end{lemma}
\begin{proof}
Note that the category of abelian presheaves has enough injectives, see
Injectives, Proposition \ref{injectives-proposition-presheaves-injectives}.
Note that $\check{H}^0(\mathcal{U}, -)$ is a left exact functor
from the category of abelian presheaves
to the category of $\mathbf{Z}$-modules.
Hence the derived functor and the right derived functor exist, see
Derived Categories, Section \ref{derived-section-right-derived-functor}.
\medskip\noindent
Let $\mathcal{I}$ be a injective abelian presheaf.
In this case the functor
$\Hom_{\textit{PAb}(\mathcal{C})}(-, \mathcal{I})$
is exact on $\textit{PAb}(\mathcal{C})$. By
Lemma \ref{lemma-cech-map-into} we have
$$
\Hom_{\textit{PAb}(\mathcal{C})}(
\mathbf{Z}_{\mathcal{U}, \bullet}, \mathcal{I})
=
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{I}).
$$
By Lemma \ref{lemma-homology-complex} we have that
$\mathbf{Z}_{\mathcal{U}, \bullet}$ is exact in positive degrees.
Hence by the exactness of Hom into $\mathcal{I}$ mentioned above we see
that $\check{H}^i(\mathcal{U}, \mathcal{I}) = 0$ for all
$i > 0$. Thus the $\delta$-functor $(\check{H}^n, \delta)$
(see Lemma \ref{lemma-cech-cohomology-delta-functor-presheaves})
satisfies the assumptions of
Homology, Lemma \ref{homology-lemma-efface-implies-universal},
and hence is a universal $\delta$-functor.
\medskip\noindent
By
Derived Categories, Lemma \ref{derived-lemma-higher-derived-functors}
also the sequence $R^i\check{H}^0(\mathcal{U}, -)$
forms a universal $\delta$-functor. By the uniqueness of universal
$\delta$-functors, see
Homology, Lemma \ref{homology-lemma-uniqueness-universal-delta-functor}
we conclude that
$R^i\check{H}^0(\mathcal{U}, -) = \check{H}^i(\mathcal{U}, -)$.
This is enough for most applications
and the reader is suggested to skip the rest of the proof.
\medskip\noindent
Let $\mathcal{F}$ be any abelian presheaf on $\mathcal{C}$.
Choose an injective resolution $\mathcal{F} \to \mathcal{I}^\bullet$
in the category $\textit{PAb}(\mathcal{C})$.
Consider the double complex $A^{\bullet, \bullet}$ with terms
$$
A^{p, q} =
\check{\mathcal{C}}^p(\mathcal{U}, \mathcal{I}^q).
$$
Consider the simple complex $sA^\bullet$ associated to this double
complex. There is a map of complexes
$$
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\longrightarrow
sA^\bullet
$$
coming from the maps
$\check{\mathcal{C}}^p(\mathcal{U}, \mathcal{F})
\to A^{p, 0} = \check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{I}^0)$
and there is a map of complexes
$$
\check{H}^0(\mathcal{U}, \mathcal{I}^\bullet)
\longrightarrow
sA^\bullet
$$
coming from the maps
$\check{H}^0(\mathcal{U}, \mathcal{I}^q) \to
A^{0, q} = \check{\mathcal{C}}^0(\mathcal{U}, \mathcal{I}^q)$.
Both of these maps are quasi-isomorphisms by an application of
Homology, Lemma \ref{homology-lemma-double-complex-gives-resolution}.
Namely, the columns of the double complex are exact in positive degrees
because the {\v C}ech complex as a functor is exact
(Lemma \ref{lemma-cech-exact-presheaves})
and the rows of the double complex are exact in positive degrees
since as we just saw the higher {\v C}ech cohomology groups of the injective
presheaves $\mathcal{I}^q$ are zero.
Since quasi-isomorphisms become invertible
in $D^{+}(\mathbf{Z})$ this gives the last displayed morphism
of the lemma. We omit the verification that this morphism is
functorial.
\end{proof}
\section{{\v C}ech cohomology and cohomology}
\label{section-cech-cohomology-cohomology}
\noindent
The relationship between cohomology and {\v C}ech cohomology comes from the fact
that the {\v C}ech cohomology of an injective abelian sheaf is zero. To see this
we note that an injective abelian sheaf is an injective abelian presheaf and
then we apply results in {\v C}ech cohomology in the preceding section.
\begin{lemma}
\label{lemma-injective-abelian-sheaf-injective-presheaf}
Let $\mathcal{C}$ be a site. An injective abelian sheaf is also injective as an
object in the category $\textit{PAb}(\mathcal{C})$.
\end{lemma}
\begin{proof}
Apply Homology, Lemma \ref{homology-lemma-adjoint-preserve-injectives}
to the categories $\mathcal{A} = \textit{Ab}(\mathcal{C})$,
$\mathcal{B} = \textit{PAb}(\mathcal{C})$, the inclusion functor
and sheafification. (See
Modules on Sites, Section \ref{sites-modules-section-abelian-sheaves} to see
that all assumptions of the lemma are satisfied.)
\end{proof}
\begin{lemma}
\label{lemma-injective-trivial-cech}
Let $\mathcal{C}$ be a site.
Let $\mathcal{U} = \{U_i \to U\}_{i \in I}$ be a covering of $\mathcal{C}$.
Let $\mathcal{I}$ be an injective abelian sheaf, i.e., an injective
object of $\textit{Ab}(\mathcal{C})$.
Then
$$
\check{H}^p(\mathcal{U}, \mathcal{I}) =
\left\{
\begin{matrix}
\mathcal{I}(U) & \text{if} & p = 0 \\
0 & \text{if} & p > 0
\end{matrix}
\right.
$$
\end{lemma}
\begin{proof}
By Lemma \ref{lemma-injective-abelian-sheaf-injective-presheaf}
we see that $\mathcal{I}$ is an injective object in
$\textit{PAb}(\mathcal{C})$.
Hence we can apply Lemma \ref{lemma-cech-cohomology-derived-presheaves}
(or its proof) to see the vanishing of higher {\v C}ech cohomology group.
For the zeroth see Lemma \ref{lemma-cech-h0}.
\end{proof}
\begin{lemma}
\label{lemma-cech-cohomology}
Let $\mathcal{C}$ be a site.
Let $\mathcal{U} = \{U_i \to U\}_{i \in I}$ be a covering of $\mathcal{C}$.
There is a transformation
$$
\check{\mathcal{C}}^\bullet(\mathcal{U}, -)
\longrightarrow
R\Gamma(U, -)
$$
of functors
$\textit{Ab}(\mathcal{C}) \to D^{+}(\mathbf{Z})$.
In particular this gives a transformation of functors
$\check{H}^p(U, \mathcal{F}) \to H^p(U, \mathcal{F})$ for
$\mathcal{F}$ ranging over $\textit{Ab}(\mathcal{C})$.
\end{lemma}
\begin{proof}
Let $\mathcal{F}$ be an abelian sheaf. Choose an injective resolution
$\mathcal{F} \to \mathcal{I}^\bullet$. Consider the double complex
$A^{\bullet, \bullet}$ with terms
$A^{p, q} = \check{\mathcal{C}}^p(\mathcal{U}, \mathcal{I}^q)$.
Moreover, consider the associated simple complex
$sA^\bullet$, see
Homology, Definition \ref{homology-definition-associated-simple-complex}.
There is a map of complexes
$$
\alpha :
\Gamma(U, \mathcal{I}^\bullet)
\longrightarrow
sA^\bullet
$$
coming from the maps
$\mathcal{I}^q(U) \to \check{H}^0(\mathcal{U}, \mathcal{I}^q)$
and a map of complexes
$$
\beta :
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})
\longrightarrow
sA^\bullet
$$
coming from the map $\mathcal{F} \to \mathcal{I}^0$.
We can apply
Homology, Lemma \ref{homology-lemma-double-complex-gives-resolution}
to see that $\alpha$ is a quasi-isomorphism.
Namely, Lemma \ref{lemma-injective-trivial-cech} implies that
the $q$th row of the double complex $A^{\bullet, \bullet}$ is a
resolution of $\Gamma(U, \mathcal{I}^q)$.
Hence $\alpha$ becomes invertible in $D^{+}(\mathbf{Z})$ and
the transformation of the lemma is the composition of $\beta$
followed by the inverse of $\alpha$. We omit the verification
that this is functorial.
\end{proof}
\begin{lemma}
\label{lemma-cech-h1}
Let $\mathcal{C}$ be a site. Let $\mathcal{G}$ be an abelian sheaf
on $\mathcal{C}$. Let $\mathcal{U} = \{U_i \to U\}_{i \in I}$ be a
covering of $\mathcal{C}$. The map
$$
\check{H}^1(\mathcal{U}, \mathcal{G})
\longrightarrow
H^1(U, \mathcal{G})
$$
is injective and identifies $\check{H}^1(\mathcal{U}, \mathcal{G})$ via
the bijection of Lemma \ref{lemma-torsors-h1}
with the set of isomorphism classes of $\mathcal{G}|_U$-torsors
which restrict to trivial torsors over each $U_i$.
\end{lemma}
\begin{proof}
To see this we construct an inverse map. Namely, let $\mathcal{F}$ be a
$\mathcal{G}|_U$-torsor on $\mathcal{C}/U$ whose restriction to
$\mathcal{C}/U_i$ is trivial. By Lemma \ref{lemma-trivial-torsor}
this means there
exists a section $s_i \in \mathcal{F}(U_i)$. On $U_{i_0} \times_U U_{i_1}$
there is a unique section $s_{i_0i_1}$ of $\mathcal{G}$ such that
$s_{i_0i_1} \cdot s_{i_0}|_{U_{i_0} \times_U U_{i_1}} =
s_{i_1}|_{U_{i_0} \times_U U_{i_1}}$. An easy computation shows
that $s_{i_0i_1}$ is a {\v C}ech cocycle and that its class is well
defined (i.e., does not depend on the choice of the sections $s_i$).
The inverse maps the isomorphism class of $\mathcal{F}$ to the cohomology
class of the cocycle $(s_{i_0i_1})$.
We omit the verification that this map is indeed an inverse.
\end{proof}
\begin{lemma}
\label{lemma-include}
Let $\mathcal{C}$ be a site.
Consider the functor
$i : \textit{Ab}(\mathcal{C}) \to \textit{PAb}(\mathcal{C})$.
It is a left exact functor with right derived functors given by
$$
R^pi(\mathcal{F}) = \underline{H}^p(\mathcal{F}) :
U \longmapsto H^p(U, \mathcal{F})
$$
see discussion in Section \ref{section-locality}.
\end{lemma}
\begin{proof}
It is clear that $i$ is left exact.
Choose an injective resolution $\mathcal{F} \to \mathcal{I}^\bullet$.
By definition $R^pi$ is the $p$th cohomology {\it presheaf}
of the complex $\mathcal{I}^\bullet$. In other words, the
sections of $R^pi(\mathcal{F})$ over an object $U$ of $\mathcal{C}$
are given by
$$
\frac{\Ker(\mathcal{I}^n(U) \to \mathcal{I}^{n + 1}(U))}
{\Im(\mathcal{I}^{n - 1}(U) \to \mathcal{I}^n(U))}.
$$
which is the definition of $H^p(U, \mathcal{F})$.
\end{proof}
\begin{lemma}
\label{lemma-cech-spectral-sequence}
Let $\mathcal{C}$ be a site. Let $\mathcal{U} = \{U_i \to U\}_{i \in I}$
be a covering of $\mathcal{C}$. For any abelian sheaf $\mathcal{F}$ there
is a spectral sequence $(E_r, d_r)_{r \geq 0}$ with
$$
E_2^{p, q} = \check{H}^p(\mathcal{U}, \underline{H}^q(\mathcal{F}))
$$
converging to $H^{p + q}(U, \mathcal{F})$.
This spectral sequence is functorial in $\mathcal{F}$.
\end{lemma}
\begin{proof}
This is a Grothendieck spectral sequence (see
Derived Categories, Lemma \ref{derived-lemma-grothendieck-spectral-sequence})
for the functors
$$
i : \textit{Ab}(\mathcal{C}) \to \textit{PAb}(\mathcal{C})
\quad\text{and}\quad
\check{H}^0(\mathcal{U}, - ) : \textit{PAb}(\mathcal{C})
\to \textit{Ab}.
$$
Namely, we have $\check{H}^0(\mathcal{U}, i(\mathcal{F})) = \mathcal{F}(U)$
by Lemma \ref{lemma-cech-h0}. We have that $i(\mathcal{I})$ is
{\v C}ech acyclic by Lemma \ref{lemma-injective-trivial-cech}. And we
have that $\check{H}^p(\mathcal{U}, -) = R^p\check{H}^0(\mathcal{U}, -)$
as functors on $\textit{PAb}(\mathcal{C})$
by Lemma \ref{lemma-cech-cohomology-derived-presheaves}.
Putting everything together gives the lemma.
\end{proof}
\begin{lemma}
\label{lemma-cech-spectral-sequence-application}
Let $\mathcal{C}$ be a site.
Let $\mathcal{U} = \{U_i \to U\}_{i \in I}$ be a covering.
Let $\mathcal{F} \in \Ob(\textit{Ab}(\mathcal{C}))$.
Assume that $H^i(U_{i_0} \times_U \ldots \times_U U_{i_p}, \mathcal{F}) = 0$
for all $i > 0$, all $p \geq 0$ and all $i_0, \ldots, i_p \in I$.
Then $\check{H}^p(\mathcal{U}, \mathcal{F}) = H^p(U, \mathcal{F})$.
\end{lemma}
\begin{proof}
We will use the spectral sequence of
Lemma \ref{lemma-cech-spectral-sequence}.
The assumptions mean that $E_2^{p, q} = 0$ for all $(p, q)$ with
$q \not = 0$. Hence the spectral sequence degenerates at $E_2$
and the result follows.
\end{proof}
\begin{lemma}
\label{lemma-ses-cech-h1}
Let $\mathcal{C}$ be a site.
Let
$$
0 \to \mathcal{F} \to \mathcal{G} \to \mathcal{H} \to 0
$$
be a short exact sequence of abelian sheaves on $\mathcal{C}$.
Let $U$ be an object of $\mathcal{C}$. If there exists a cofinal system
of coverings $\mathcal{U}$ of $U$ such that
$\check{H}^1(\mathcal{U}, \mathcal{F}) = 0$,
then the map $\mathcal{G}(U) \to \mathcal{H}(U)$ is
surjective.
\end{lemma}
\begin{proof}
Take an element $s \in \mathcal{H}(U)$. Choose a covering
$\mathcal{U} = \{U_i \to U\}_{i \in I}$ such that
(a) $\check{H}^1(\mathcal{U}, \mathcal{F}) = 0$ and (b)
$s|_{U_i}$ is the image of a section $s_i \in \mathcal{G}(U_i)$.
Since we can certainly find a covering such that (b) holds
it follows from the assumptions of the lemma that we can find
a covering such that (a) and (b) both hold.
Consider the sections
$$
s_{i_0i_1} =
s_{i_1}|_{U_{i_0} \times_U U_{i_1}} - s_{i_0}|_{U_{i_0} \times_U U_{i_1}}.
$$
Since $s_i$ lifts $s$ we see that
$s_{i_0i_1} \in \mathcal{F}(U_{i_0} \times_U U_{i_1})$.
By the vanishing of $\check{H}^1(\mathcal{U}, \mathcal{F})$ we can
find sections $t_i \in \mathcal{F}(U_i)$ such that
$$
s_{i_0i_1} =
t_{i_1}|_{U_{i_0} \times_U U_{i_1}} - t_{i_0}|_{U_{i_0} \times_U U_{i_1}}.
$$
Then clearly the sections $s_i - t_i$ satisfy the sheaf condition
and glue to a section of $\mathcal{G}$ over $U$ which maps to $s$.
Hence we win.
\end{proof}
\begin{lemma}
\label{lemma-cech-vanish-collection}
(Variant of Cohomology, Lemma \ref{cohomology-lemma-cech-vanish}.)
Let $\mathcal{C}$ be a site. Let $\text{Cov}_\mathcal{C}$ be the set
of coverings of $\mathcal{C}$ (see
Sites, Definition \ref{sites-definition-site}). Let
$\mathcal{B} \subset \Ob(\mathcal{C})$, and
$\text{Cov} \subset \text{Cov}_\mathcal{C}$
be subsets. Let $\mathcal{F}$ be an abelian sheaf on $\mathcal{C}$.
Assume that
\begin{enumerate}
\item For every $\mathcal{U} \in \text{Cov}$,
$\mathcal{U} = \{U_i \to U\}_{i \in I}$ we have
$U, U_i \in \mathcal{B}$ and every
$U_{i_0} \times_U \ldots \times_U U_{i_p} \in \mathcal{B}$.
\item For every $U \in \mathcal{B}$ the coverings of $U$
occurring in $\text{Cov}$ is a cofinal system of coverings of $U$.
\item For every $\mathcal{U} \in \text{Cov}$ we have
$\check{H}^p(\mathcal{U}, \mathcal{F}) = 0$ for all $p > 0$.
\end{enumerate}
Then $H^p(U, \mathcal{F}) = 0$ for all $p > 0$ and any $U \in \mathcal{B}$.
\end{lemma}
\begin{proof}
Let $\mathcal{F}$ and $\text{Cov}$ be as in the lemma.
We will indicate this by saying ``$\mathcal{F}$ has vanishing higher
{\v C}ech cohomology for any $\mathcal{U} \in \text{Cov}$''.
Choose an embedding $\mathcal{F} \to \mathcal{I}$ into an
injective abelian sheaf.
By Lemma \ref{lemma-injective-trivial-cech} $\mathcal{I}$
has vanishing higher {\v C}ech cohomology for any $\mathcal{U} \in \text{Cov}$.
Let $\mathcal{Q} = \mathcal{I}/\mathcal{F}$
so that we have a short exact sequence
$$
0 \to \mathcal{F} \to \mathcal{I} \to \mathcal{Q} \to 0.
$$
By Lemma \ref{lemma-ses-cech-h1} and our assumption (2)
this sequence gives rise to an exact sequence
$$
0 \to \mathcal{F}(U) \to \mathcal{I}(U) \to \mathcal{Q}(U) \to 0.
$$
for every $U \in \mathcal{B}$. Hence for any $\mathcal{U} \in \text{Cov}$
we get a short exact sequence of {\v C}ech complexes
$$
0 \to
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}) \to
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{I}) \to
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{Q}) \to 0
$$
since each term in the {\v C}ech complex is made up out of a product of
values over elements of $\mathcal{B}$ by assumption (1).
In particular we have a long exact sequence of {\v C}ech cohomology
groups for any covering $\mathcal{U} \in \text{Cov}$.
This implies that $\mathcal{Q}$ is also an abelian sheaf
with vanishing higher {\v C}ech cohomology for all
$\mathcal{U} \in \text{Cov}$.
\medskip\noindent
Next, we look at the long exact cohomology sequence
$$
\xymatrix{
0 \ar[r] &
H^0(U, \mathcal{F}) \ar[r] &
H^0(U, \mathcal{I}) \ar[r] &
H^0(U, \mathcal{Q}) \ar[lld] \\
&
H^1(U, \mathcal{F}) \ar[r] &
H^1(U, \mathcal{I}) \ar[r] &
H^1(U, \mathcal{Q}) \ar[lld] \\
&
\ldots & \ldots & \ldots \\
}
$$
for any $U \in \mathcal{B}$. Since $\mathcal{I}$ is injective we
have $H^n(U, \mathcal{I}) = 0$ for $n > 0$ (see
Derived Categories, Lemma \ref{derived-lemma-higher-derived-functors}).
By the above we see that $H^0(U, \mathcal{I}) \to H^0(U, \mathcal{Q})$
is surjective and hence $H^1(U, \mathcal{F}) = 0$.
Since $\mathcal{F}$ was an arbitrary abelian sheaf with
vanishing higher {\v C}ech cohomology for all $\mathcal{U} \in \text{Cov}$
we conclude that also $H^1(U, \mathcal{Q}) = 0$ since $\mathcal{Q}$ is
another of these sheaves (see above). By the long exact sequence this in
turn implies that $H^2(U, \mathcal{F}) = 0$. And so on and so forth.
\end{proof}
\section{Second cohomology and gerbes}
\label{section-gerbes}
\noindent
Let $p : \mathcal{S} \to \mathcal{C}$ be a gerbe over a site
all of whose automorphism groups are commutative. In this situation
the first and second cohomology groups of the sheaf of automorphisms
(Stacks, Lemma \ref{stacks-lemma-gerbe-abelian-auts})
controls the existence of objects.
\medskip\noindent
The following lemma will be made obsolete by a more complete
discussion of this relationship we will add in the future.
\begin{lemma}
\label{lemma-existence}
Let $\mathcal{C}$ be a site. Let $p : \mathcal{S} \to \mathcal{C}$
be a gerbe over a site whose automorphism sheaves are abelian.
Let $\mathcal{G}$ be the sheaf of abelian groups constructed
in (Stacks, Lemma \ref{stacks-lemma-gerbe-abelian-auts}).
Let $U$ be an object of $\mathcal{C}$ such that
\begin{enumerate}
\item there exists a cofinal system of coverings $\{U_i \to U\}$
of $U$ in $\mathcal{C}$ such that $H^1(U_i, \mathcal{G}) = 0$ and
$H^1(U_i \times_U U_j, \mathcal{G}) = 0$
for all $i, j$, and
\item $H^2(U, \mathcal{G}) = 0$.
\end{enumerate}
Then there exists an object of $\mathcal{S}$ lying over $U$.
\end{lemma}
\begin{proof}
By Stacks, Definition \ref{stacks-definition-gerbe}
there exists a covering $\mathcal{U} = \{U_i \to U\}$
and $x_i$ in $\mathcal{S}$ lying over $U_i$.
Write $U_{ij} = U_i \times_U U_j$. By (1) after refining the covering
we may assume that $H^1(U_i, \mathcal{G}) = 0$ and
$H^1(U_{ij}, \mathcal{G}) = 0$.
Consider the sheaf
$$
\mathcal{F}_{ij} =
\mathit{Isom}(x_i|_{U_{ij}}, x_j|_{U_{ij}})
$$
on $\mathcal{C}/U_{ij}$. Since
$\mathcal{G}|_{U_{ij}} = \mathit{Aut}(x_i|_{U_{ij}})$ we see that there
is an action
$$
\mathcal{G}|_{U_{ij}} \times \mathcal{F}_{ij} \to \mathcal{F}_{ij}
$$
by precomposition. It is clear that $\mathcal{F}_{ij}$ is a
pseudo $\mathcal{G}|_{U_{ij}}$-torsor and in fact a torsor because
any two objects of a gerbe are locally isomorphic.
By our choice of the covering and by
Lemma \ref{lemma-torsors-h1}
these torsors are trivial (and hence have global sections by
Lemma \ref{lemma-trivial-torsor}).
In other words, we can choose isomorphisms
$$
\varphi_{ij} : x_i|_{U_{ij}} \longrightarrow x_j|_{U_{ij}}
$$
To find an object $x$ over $U$ we are going to massage our choice
of these $\varphi_{ij}$ to get a descent datum (which is necessarily
effective as $p : \mathcal{S} \to \mathcal{C}$ is a stack).
Namely, the obstruction to being a descent datum is that the cocycle
condition may not hold. Namely, set $U_{ijk} = U_i \times_U U_j \times_U U_k$.
Then we can consider
$$
g_{ijk} = \varphi_{ik}^{-1}|_{U_{ijk}} \circ \varphi_{jk}|_{U_{ijk}} \circ
\varphi_{ij}|_{U_{ijk}}
$$
which is an automorphism of $x_i$ over $U_{ijk}$. Thus we may and do
consider $g_{ijk}$ as a section of $\mathcal{G}$ over $U_{ijk}$.
A computation (omitted) shows that $(g_{i_0i_1i_2})$ is a $2$-cocycle
in the {\v C}ech complex ${\check C}^\bullet(\mathcal{U}, \mathcal{G})$
of $\mathcal{G}$ with respect to the covering $\mathcal{U}$.
By the spectral sequence of
Lemma \ref{lemma-cech-spectral-sequence}
and since $H^1(U_i, \mathcal{G}) = 0$ for all $i$
we see that ${\check H}^2(\mathcal{U}, \mathcal{G}) \to H^2(U, \mathcal{G})$
is injective. Hence $(g_{i_0i_1i_2})$ is a coboundary
by our assumption that $H^2(U, \mathcal{G}) = 0$.
Thus we can find sections $g_{ij} \in \mathcal{G}(U_{ij})$ such that
$g_{ik}^{-1}|_{U_{ijk}} g_{jk}|_{U_{ijk}} g_{ij}|_{U_{ijk}} = g_{ijk}$
for all $i, j, k$.
After replacing $\varphi_{ij}$ by $\varphi_{ij}g_{ij}^{-1}$
we see that $\varphi_{ij}$ gives a descent datum on the objects
$x_i$ over $U_i$ and the proof is complete.
\end{proof}
\section{Cohomology of modules}
\label{section-cohomology-modules}
\noindent
Everything that was said for cohomology of abelian sheaves
goes for cohomology of modules, since the two agree.
\begin{lemma}
\label{lemma-injective-module-injective-presheaf}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
An injective sheaf of modules is also injective as an
object in the category $\textit{PMod}(\mathcal{O})$.
\end{lemma}
\begin{proof}
Apply Homology, Lemma \ref{homology-lemma-adjoint-preserve-injectives}
to the categories $\mathcal{A} = \textit{Mod}(\mathcal{O})$,
$\mathcal{B} = \textit{PMod}(\mathcal{O})$, the inclusion functor
and sheafification. (See
Modules on Sites,
Section \ref{sites-modules-section-sheafification-presheaves-modules}
to see that all assumptions of the lemma are satisfied.)
\end{proof}
\begin{lemma}
\label{lemma-include-modules}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Consider the functor
$i : \textit{Mod}(\mathcal{C}) \to \textit{PMod}(\mathcal{C})$.
It is a left exact functor with right derived functors given by
$$
R^pi(\mathcal{F}) = \underline{H}^p(\mathcal{F}) :
U \longmapsto H^p(U, \mathcal{F})
$$
see discussion in
Section \ref{section-locality}.
\end{lemma}
\begin{proof}
It is clear that $i$ is left exact.
Choose an injective resolution $\mathcal{F} \to \mathcal{I}^\bullet$
in $\textit{Mod}(\mathcal{O})$.
By definition $R^pi$ is the $p$th cohomology {\it presheaf}
of the complex $\mathcal{I}^\bullet$. In other words, the
sections of $R^pi(\mathcal{F})$ over an object $U$ of $\mathcal{C}$
are given by
$$
\frac{\Ker(\mathcal{I}^n(U) \to \mathcal{I}^{n + 1}(U))}
{\Im(\mathcal{I}^{n - 1}(U) \to \mathcal{I}^n(U))}.
$$
which is the definition of $H^p(U, \mathcal{F})$.
\end{proof}
\begin{lemma}
\label{lemma-injective-module-trivial-cech}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{U} = \{U_i \to U\}_{i \in I}$ be a covering of $\mathcal{C}$.
Let $\mathcal{I}$ be an injective $\mathcal{O}$-module, i.e., an injective
object of $\textit{Mod}(\mathcal{O})$. Then
$$
\check{H}^p(\mathcal{U}, \mathcal{I}) =
\left\{
\begin{matrix}
\mathcal{I}(U) & \text{if} & p = 0 \\
0 & \text{if} & p > 0
\end{matrix}
\right.
$$
\end{lemma}
\begin{proof}
Lemma \ref{lemma-cech-map-into} gives the first equality in the following
sequence of equalities
\begin{align*}
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{I})
& =
\Mor_{\textit{PAb}(\mathcal{C})}(
\mathbf{Z}_{\mathcal{U}, \bullet}, \mathcal{I}) \\
& =
\Mor_{\textit{PMod}(\mathbf{Z})}(
\mathbf{Z}_{\mathcal{U}, \bullet}, \mathcal{I}) \\
& =
\Mor_{\textit{PMod}(\mathcal{O})}(
\mathbf{Z}_{\mathcal{U}, \bullet} \otimes_{p, \mathbf{Z}} \mathcal{O},
\mathcal{I})
\end{align*}
The third equality by
Modules on Sites,
Lemma \ref{sites-modules-lemma-adjointness-tensor-restrict-presheaves}.
By Lemma \ref{lemma-injective-module-injective-presheaf}
we see that $\mathcal{I}$ is an injective object in
$\textit{PMod}(\mathcal{O})$.
Hence $\Hom_{\textit{PMod}(\mathcal{O})}(-, \mathcal{I})$
is an exact functor. By
Lemma \ref{lemma-complex-tensored-still-exact} we see the vanishing of
higher {\v C}ech cohomology groups.
For the zeroth see Lemma \ref{lemma-cech-h0}.
\end{proof}
\begin{lemma}
\label{lemma-cohomology-modules-abelian-agree}
Let $\mathcal{C}$ be a site.
Let $\mathcal{O}$ be a sheaf of rings on $\mathcal{C}$.
Let $\mathcal{F}$ be an $\mathcal{O}$-module, and denote
$\mathcal{F}_{ab}$ the underlying sheaf of abelian groups.
Then we have
$$
H^i(\mathcal{C}, \mathcal{F}_{ab})
=
H^i(\mathcal{C}, \mathcal{F})
$$
and for any object $U$ of $\mathcal{C}$ we also have
$$
H^i(U, \mathcal{F}_{ab})
=
H^i(U, \mathcal{F}).
$$
Here the left hand side is cohomology computed in
$\textit{Ab}(\mathcal{C})$ and the right hand side
is cohomology computed in $\textit{Mod}(\mathcal{O})$.
\end{lemma}
\begin{proof}
By
Derived Categories, Lemma \ref{derived-lemma-higher-derived-functors}
the $\delta$-functor $(\mathcal{F} \mapsto H^p(U, \mathcal{F}))_{p \geq 0}$
is universal. The functor
$\textit{Mod}(\mathcal{O}) \to \textit{Ab}(\mathcal{C})$,
$\mathcal{F} \mapsto \mathcal{F}_{ab}$ is exact. Hence
$(\mathcal{F} \mapsto H^p(U, \mathcal{F}_{ab}))_{p \geq 0}$
is a $\delta$-functor also. Suppose we show that
$(\mathcal{F} \mapsto H^p(U, \mathcal{F}_{ab}))_{p \geq 0}$
is also universal. This will imply the second statement of the lemma
by uniqueness of universal $\delta$-functors, see
Homology, Lemma \ref{homology-lemma-uniqueness-universal-delta-functor}.
Since $\textit{Mod}(\mathcal{O})$ has enough injectives,
it suffices to show that $H^i(U, \mathcal{I}_{ab}) = 0$
for any injective object $\mathcal{I}$ in $\textit{Mod}(\mathcal{O})$, see
Homology, Lemma \ref{homology-lemma-efface-implies-universal}.
\medskip\noindent
Let $\mathcal{I}$ be an injective object of $\textit{Mod}(\mathcal{O})$.
Apply Lemma \ref{lemma-cech-vanish-collection}
with $\mathcal{F} = \mathcal{I}$, $\mathcal{B} = \mathcal{C}$
and $\text{Cov} = \text{Cov}_\mathcal{C}$.
Assumption (3) of that lemma holds by
Lemma \ref{lemma-injective-module-trivial-cech}.
Hence we see that $H^i(U, \mathcal{I}_{ab}) = 0$
for every object $U$ of $\mathcal{C}$.
\medskip\noindent
If $\mathcal{C}$ has a final
object then this also implies the first equality. If not, then
according to Sites, Lemma \ref{sites-lemma-topos-good-site} we see that
the ringed topos $(\Sh(\mathcal{C}), \mathcal{O})$ is equivalent to a
ringed topos where the underlying site does have a final object.
Hence the lemma follows.
\end{proof}
\begin{lemma}
\label{lemma-cohomology-products}
Let $\mathcal{C}$ be a site. Let $I$ be a set. For $i \in I$ let
$\mathcal{F}_i$ be an abelian sheaf on $\mathcal{C}$. Let
$U \in \Ob(\mathcal{C})$. The canonical map
$$
H^p(U, \prod\nolimits_{i \in I} \mathcal{F}_i)
\longrightarrow
\prod\nolimits_{i \in I} H^p(U, \mathcal{F}_i)
$$
is an isomorphism for $p = 0$ and injective for $p = 1$.
\end{lemma}
\begin{proof}
The statement for $p = 0$ is true because the product of sheaves
is equal to the product of the underlying presheaves, see
Sites, Lemma \ref{sites-lemma-limit-sheaf}.
Proof for $p = 1$. Set $\mathcal{F} = \prod \mathcal{F}_i$.
Let $\xi \in H^1(U, \mathcal{F})$ map to zero in
$\prod H^1(U, \mathcal{F}_i)$. By locality of cohomology, see
Lemma \ref{lemma-kill-cohomology-class-on-covering},
there exists a covering $\mathcal{U} = \{U_j \to U\}$ such that
$\xi|_{U_j} = 0$ for all $j$. By Lemma \ref{lemma-cech-h1} this means
$\xi$ comes from an element
$\check \xi \in \check H^1(\mathcal{U}, \mathcal{F})$.
Since the maps
$\check H^1(\mathcal{U}, \mathcal{F}_i) \to H^1(U, \mathcal{F}_i)$
are injective for all $i$ (by Lemma \ref{lemma-cech-h1}), and since
the image of $\xi$ is zero in $\prod H^1(U, \mathcal{F}_i)$ we see
that the image
$\check \xi_i = 0$ in $\check H^1(\mathcal{U}, \mathcal{F}_i)$.
However, since $\mathcal{F} = \prod \mathcal{F}_i$ we see that
$\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})$ is the
product of the complexes
$\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}_i)$,
hence by
Homology, Lemma \ref{homology-lemma-product-abelian-groups-exact}
we conclude that $\check \xi = 0$ as desired.
\end{proof}
\begin{lemma}
\label{lemma-restriction-along-monomorphism-surjective}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site. Let $a : U' \to U$ be a
monomorphism in $\mathcal{C}$. Then for any injective $\mathcal{O}$-module
$\mathcal{I}$ the restriction mapping $\mathcal{I}(U) \to \mathcal{I}(U')$
is surjective.
\end{lemma}
\begin{proof}
Let $j : \mathcal{C}/U \to \mathcal{C}$ and
$j' : \mathcal{C}/U' \to \mathcal{C}$ be the localization morphisms
(Modules on Sites, Section \ref{sites-modules-section-localize}).
Since $j_!$ is a left adjoint to restriction we see that
for any sheaf $\mathcal{F}$ of $\mathcal{O}$-modules
$$
\Hom_\mathcal{O}(j_!\mathcal{O}_U, \mathcal{F})
=
\Hom_{\mathcal{O}_U}(\mathcal{O}_U, \mathcal{F}|_U)
=
\mathcal{F}(U)
$$
Similarly, the sheaf $j'_!\mathcal{O}_{U'}$ represents the
functor $\mathcal{F} \mapsto \mathcal{F}(U')$.
Moreover below we describe a canonical map of $\mathcal{O}$-modules
$$
j'_!\mathcal{O}_{U'} \longrightarrow j_!\mathcal{O}_U
$$
which corresponds to the restriction mapping
$\mathcal{F}(U) \to \mathcal{F}(U')$ via Yoneda's lemma
(Categories, Lemma \ref{categories-lemma-yoneda}).
It suffices to prove the displayed map of modules is injective, see
Homology, Lemma \ref{homology-lemma-characterize-injectives}.
\medskip\noindent
To construct our map it suffices to construct a map between the
presheaves which assign to an object $V$ of $\mathcal{C}$ the
$\mathcal{O}(V)$-module
$$
\bigoplus\nolimits_{\varphi' \in \Mor_\mathcal{C}(V, U')} \mathcal{O}(V)
\quad\text{and}\quad
\bigoplus\nolimits_{\varphi \in \Mor_\mathcal{C}(V, U)} \mathcal{O}(V)
$$
see Modules on Sites, Lemma \ref{sites-modules-lemma-extension-by-zero}.
We take the map which maps the summand corresponding to $\varphi'$
to the summand corresponding to $\varphi = a \circ \varphi'$
by the identity map on $\mathcal{O}(V)$. As $a$ is a monomorphism,
this map is injective. As sheafification is exact, the result
follows.
\end{proof}
\section{Limp sheaves}
\label{section-limp}
\noindent
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $K$ be a sheaf of sets on $\mathcal{C}$ (we intentionally use a
roman capital here to distinguish from abelian sheaves).
Given an abelian sheaf $\mathcal{F}$ we denote
$\mathcal{F}(K) = \Mor_{\Sh(\mathcal{C})}(K, \mathcal{F})$.
The functor $\mathcal{F} \mapsto \mathcal{F}(K)$ is a left exact functor
$\textit{Mod}(\mathcal{O}) \to \textit{Ab}$ hence we have its
right derived functors. We will denote these $H^p(K, \mathcal{F})$
so that $H^0(K, \mathcal{F}) = \mathcal{F}(K)$.
\medskip\noindent
We mention two special cases. The first is the case where
$K = h_U^\#$ for some object $U$ of $\mathcal{C}$. In this case
$H^p(K, \mathcal{F}) = H^p(U, \mathcal{F})$, because
$\Mor_{\Sh(\mathcal{C})}(h_U^\#, \mathcal{F}) = \mathcal{F}(U)$, see
Sites, Section \ref{sites-section-representable-sheaves}.
The second is the case $\mathcal{O} = \mathbf{Z}$ (the constant
sheaf). In this case the cohomology groups are functors
$H^p(K, - ) : \textit{Ab}(\mathcal{C}) \to \textit{Ab}$.
Here is the analogue of
Lemma \ref{lemma-cohomology-modules-abelian-agree}.
\begin{lemma}
\label{lemma-compute-cohomology-on-sheaf-sets}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $K$ be a sheaf of sets on $\mathcal{C}$.
Let $\mathcal{F}$ be an $\mathcal{O}$-module and denote
$\mathcal{F}_{ab}$ the underlying sheaf of abelian groups.
Then $H^p(K, \mathcal{F}) = H^p(K, \mathcal{F}_{ab})$.
\end{lemma}
\begin{proof}
Note that both $H^p(K, \mathcal{F})$ and $H^p(K, \mathcal{F}_{ab})$
depend only on the topos, not on the underlying site. Hence by
Sites, Lemma \ref{sites-lemma-topos-good-site}
we may replace $\mathcal{C}$ by a ``larger'' site such
that $K = h_U$ for some object $U$ of $\mathcal{C}$.
In this case the result follows from
Lemma \ref{lemma-cohomology-modules-abelian-agree}.
\end{proof}
\begin{lemma}
\label{lemma-cech-to-cohomology-sheaf-sets}
Let $\mathcal{C}$ be a site. Let $K' \to K$ be a surjective
map of sheaves of sets on $\mathcal{C}$. Set
$K'_p = K' \times_K \ldots \times_K K'$ ($p + 1$-factors).
For every abelian sheaf $\mathcal{F}$ there is a spectral sequence
with $E_1^{p, q} = H^q(K'_p, \mathcal{F})$ converging to
$H^{p + q}(K, \mathcal{F})$.
\end{lemma}
\begin{proof}
After replacing $\mathcal{C}$ by a ``larger'' site as in
Sites, Lemma \ref{sites-lemma-topos-good-site}
we may assume that $K, K'$ are objects of $\mathcal{C}$ and that
$\mathcal{U} = \{K' \to K\}$ is a covering. Then we have the {\v C}ech
to cohomology spectral sequence of Lemma \ref{lemma-cech-spectral-sequence}
whose $E_1$ page is as indicated in the statement of the lemma.
\end{proof}
\begin{lemma}
\label{lemma-cohomology-on-sheaf-sets}
Let $\mathcal{C}$ be a site. Let $K$ be a sheaf of sets on $\mathcal{C}$.
Consider the morphism of topoi
$j : \Sh(\mathcal{C}/K) \to \Sh(\mathcal{C})$, see
Sites, Lemma \ref{sites-lemma-localize-topos-site}.
Then $j^{-1}$ preserves injectives and
$H^p(K, \mathcal{F}) = H^p(\mathcal{C}/K, j^{-1}\mathcal{F})$
for any abelian sheaf $\mathcal{F}$ on $\mathcal{C}$.
\end{lemma}
\begin{proof}
By
Sites, Lemmas \ref{sites-lemma-localize-topos} and
\ref{sites-lemma-localize-topos-site}
the morphism of topoi $j$ is
equivalent to a localization. Hence this follows from
Lemma \ref{lemma-cohomology-of-open}.
\end{proof}
\noindent
Keeping in mind Lemma \ref{lemma-compute-cohomology-on-sheaf-sets}
we see that the following definition is the ``correct one'' also
for sheaves of modules on ringed sites.
\begin{definition}
\label{definition-limp}
Let $\mathcal{C}$ be a site.
We say an abelian sheaf $\mathcal{F}$ is
{\it limp}\footnote{This is probably nonstandard notation.
In \cite[V, Definition 4.1]{SGA4} this property is dubbed ``flasque'', but
we cannot use this because it would clash with our definition
of flasque sheaves on topological spaces. Please email
\href{mailto:stacks.project@gmail.com}{stacks.project@gmail.com}
if you have a better suggestion.}
if for every sheaf of sets $K$ we have $H^p(K, \mathcal{F}) = 0$
for all $p \geq 1$.
\end{definition}
\noindent
It is clear that being limp is an intrinsic property, i.e.,
preserved under equivalences of topoi.
A limp sheaf has vanishing higher cohomology on all objects of the site,
but in general the condition of being limp is strictly stronger.
Here is a characterization of limp sheaves which is sometimes useful.
\begin{lemma}
\label{lemma-characterize-limp}
Let $\mathcal{C}$ be a site. Let $\mathcal{F}$ be an abelian sheaf. If
\begin{enumerate}
\item $H^p(U, \mathcal{F}) = 0$ for $p> 0$ and $U \in \Ob(\mathcal{C})$, and
\item for every surjection $K' \to K$ of sheaves of sets the
extended {\v C}ech complex
$$
0 \to H^0(K, \mathcal{F}) \to H^0(K', \mathcal{F}) \to
H^0(K' \times_K K', \mathcal{F}) \to \ldots
$$
is exact,
\end{enumerate}
then $\mathcal{F}$ is limp (and the converse holds too).
\end{lemma}
\begin{proof}
By assumption (1) we have $H^p(h_U^\#, g^{-1}\mathcal{I}) = 0$ for all
$p > 0$ and all objects $U$ of $\mathcal{C}$. Note that if
$K = \coprod K_i$ is a coproduct of sheaves of sets on $\mathcal{C}$
then $H^p(K, g^{-1}\mathcal{I}) = \prod H^p(K_i, g^{-1}\mathcal{I})$.
For any sheaf of sets $K$ there exists a surjection
$$
K' = \coprod h_{U_i}^\# \longrightarrow K
$$
see Sites, Lemma \ref{sites-lemma-sheaf-coequalizer-representable}.
Thus we conclude that: (*) for every sheaf of sets $K$ there exists a
surjection $K' \to K$ of sheaves of sets such that $H^p(K', \mathcal{F}) = 0$
for $p > 0$. We claim that (*) and condition (2) imply that $\mathcal{F}$
is limp. Note that conditions (*) and (2) only depend on $\mathcal{F}$ as an
object of the topos $\Sh(\mathcal{C})$ and not on the underlying site.
(We will not use property (1) in the rest of the proof.)
\medskip\noindent
We are going to prove by induction on $n \geq 0$ that (*) and (2)
imply the following induction hypothesis $IH_n$:
$H^p(K, \mathcal{F}) = 0$ for all $0 < p \leq n$ and
all sheaves of sets $K$. Note that $IH_0$ holds. Assume $IH_n$. Pick
a sheaf of sets $K$. Pick a surjection $K' \to K$ such that
$H^p(K', \mathcal{F}) = 0$ for all $p > 0$. We have a
spectral sequence with
$$
E_1^{p, q} = H^q(K'_p, \mathcal{F})
$$
covering to $H^{p + q}(K, \mathcal{F})$, see
Lemma \ref{lemma-cech-to-cohomology-sheaf-sets}.
By $IH_n$ we see that $E_1^{p, q} = 0$ for $0 < q \leq n$ and by
assumption (2) we see that $E_2^{p, 0} = 0$ for $p > 0$. Finally, we have
$E_1^{0, q} = 0$ for $q > 0$ because $H^q(K', \mathcal{F}) = 0$ by
choice of $K'$. Hence we conclude that $H^{n + 1}(K, \mathcal{F}) = 0$
because all the terms $E_2^{p, q}$ with $p + q = n + 1$ are zero.
\end{proof}
\section{The Leray spectral sequence}
\label{section-leray}
\noindent
The key to proving the existence of the Leray spectral sequence is
the following lemma.
\begin{lemma}
\label{lemma-direct-image-injective-sheaf}
Let $f : (\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C}) \to
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})$ be a morphism of ringed topoi.
Then for any injective object $\mathcal{I}$ in
$\textit{Mod}(\mathcal{O}_\mathcal{C})$
the pushforward $f_*\mathcal{I}$ is limp.
\end{lemma}
\begin{proof}
Let $K$ be a sheaf of sets on $\mathcal{D}$.
By
Modules on Sites, Lemma
\ref{sites-modules-lemma-morphism-ringed-topoi-comes-from-morphism-ringed-sites}
we may replace $\mathcal{C}$, $\mathcal{D}$ by ``larger'' sites such
that $f$ comes from a morphism of ringed sites induced by a continuous
functor $u : \mathcal{D} \to \mathcal{C}$ such that
$K = h_V$ for some object $V$ of $\mathcal{D}$.
\medskip\noindent
Thus we have to show that $H^q(V, f_*\mathcal{I})$ is zero
for $q > 0$ and all objects $V$ of $\mathcal{D}$ when $f$ is given
by a morphism of ringed sites. Let $\mathcal{V} = \{V_j \to V\}$
be any covering of $\mathcal{D}$. Since $u$ is continuous we see that
$\mathcal{U} = \{u(V_j) \to u(V)\}$ is a covering of $\mathcal{C}$.
Then we have an equality of {\v C}ech complexes
$$
\check{\mathcal{C}}^\bullet(\mathcal{V}, f_*\mathcal{I})
=
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{I})
$$
by the definition of $f_*$. By
Lemma \ref{lemma-injective-module-trivial-cech}
we see that the cohomology of this complex is zero in positive degrees.
We win by
Lemma \ref{lemma-cech-vanish-collection}.
\end{proof}
\noindent
For flat morphisms the functor $f_*$ preserves injective modules.
In particular the functor
$f_* : \textit{Ab}(\mathcal{C}) \to \textit{Ab}(\mathcal{D})$ always
transforms injective
abelian sheaves into injective abelian sheaves.
\begin{lemma}
\label{lemma-pushforward-injective-flat}
Let $f : (\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C}) \to
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})$ be a morphism of ringed topoi.
If $f$ is flat, then $f_*\mathcal{I}$ is an injective
$\mathcal{O}_\mathcal{D}$-module
for any injective $\mathcal{O}_\mathcal{C}$-module $\mathcal{I}$.
\end{lemma}
\begin{proof}
In this case the functor $f^*$ is exact, see
Modules on Sites, Lemma \ref{sites-modules-lemma-flat-pullback-exact}.
Hence the result follows from
Homology, Lemma \ref{homology-lemma-adjoint-preserve-injectives}.
\end{proof}
\begin{lemma}
\label{lemma-limp-acyclic}
Let $(\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C})$ be a ringed topos.
A limp sheaf is right acyclic for the following functors:
\begin{enumerate}
\item the functor $H^0(U, -)$ for any object $U$ of $\mathcal{C}$,
\item the functor $\mathcal{F} \mapsto \mathcal{F}(K)$ for any
presheaf of sets $K$,
\item the functor $\Gamma(\mathcal{C}, -)$ of global sections,
\item the functor $f_*$ for any morphism
$f : (\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C}) \to
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})$ of ringed topoi.
\end{enumerate}
\end{lemma}
\begin{proof}
Part (2) is the definition of a limp sheaf.
Part (1) is a consequence of (2) as pointed out in the discussion following the
definition of limp sheaves.
Part (3) is a special case of (2) where $K = e$ is the final object
of $\Sh(\mathcal{C})$.
\medskip\noindent
To prove (4) we may assume, by
Modules on Sites, Lemma
\ref{sites-modules-lemma-morphism-ringed-topoi-comes-from-morphism-ringed-sites}
that $f$ is given by a morphism of sites. In this case we see that
$R^if_*$, $i > 0$ of a limp sheaf are zero by the description of
higher direct images in
Lemma \ref{lemma-higher-direct-images}.
\end{proof}
\begin{remark}
\label{remark-before-Leray}
As a consequence of the results above we find that
Derived Categories, Lemma \ref{derived-lemma-compose-derived-functors}
applies to a number of situations. For example, given a
morphism $f : (\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C}) \to
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})$ of ringed topoi we have
$$
R\Gamma(\mathcal{D}, Rf_*\mathcal{F}) = R\Gamma(\mathcal{C}, \mathcal{F})
$$
for any sheaf of $\mathcal{O}_\mathcal{C}$-modules $\mathcal{F}$.
Namely, for an injective $\mathcal{O}_\mathcal{X}$-module $\mathcal{I}$
the $\mathcal{O}_\mathcal{D}$-module $f_*\mathcal{I}$ is limp by
Lemma \ref{lemma-direct-image-injective-sheaf}
and a limp sheaf is acyclic for $\Gamma(\mathcal{D}, -)$ by
Lemma \ref{lemma-limp-acyclic}.
\end{remark}
\begin{lemma}[Leray spectral sequence]
\label{lemma-Leray}
Let $f : (\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C}) \to
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})$ be a morphism of ringed topoi.
Let $\mathcal{F}^\bullet$ be a bounded below complex of
$\mathcal{O}_\mathcal{C}$-modules. There is a spectral sequence
$$
E_2^{p, q} = H^p(\mathcal{D}, R^qf_*(\mathcal{F}^\bullet))
$$
converging to $H^{p + q}(\mathcal{C}, \mathcal{F}^\bullet)$.
\end{lemma}
\begin{proof}
This is just the Grothendieck spectral sequence
Derived Categories, Lemma \ref{derived-lemma-grothendieck-spectral-sequence}
coming from the composition of functors
$\Gamma(\mathcal{C}, -) = \Gamma(\mathcal{D}, -) \circ f_*$.
To see that the assumptions of
Derived Categories, Lemma \ref{derived-lemma-grothendieck-spectral-sequence}
are satisfied, see
Lemmas \ref{lemma-direct-image-injective-sheaf} and
\ref{lemma-limp-acyclic}.
\end{proof}
\begin{lemma}
\label{lemma-apply-Leray}
Let $f : (\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C}) \to
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})$ be a morphism of ringed topoi.
Let $\mathcal{F}$ be an $\mathcal{O}_\mathcal{C}$-module.
\begin{enumerate}
\item If $R^qf_*\mathcal{F} = 0$ for $q > 0$, then
$H^p(\mathcal{C}, \mathcal{F}) = H^p(\mathcal{D}, f_*\mathcal{F})$ for all $p$.
\item If $H^p(\mathcal{D}, R^qf_*\mathcal{F}) = 0$ for all $q$ and $p > 0$,
then $H^q(\mathcal{C}, \mathcal{F}) = H^0(\mathcal{D}, R^qf_*\mathcal{F})$
for all $q$.
\end{enumerate}
\end{lemma}
\begin{proof}
These are two simple conditions that force the Leray spectral sequence to
converge. You can also prove these facts directly (without using the
spectral sequence) which is a good exercise in cohomology of sheaves.
\end{proof}
\begin{lemma}[Relative Leray spectral sequence]
\label{lemma-relative-Leray}
Let
$f : (\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C}) \to
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})$
and
$g : (\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D}) \to
(\Sh(\mathcal{E}), \mathcal{O}_\mathcal{E})$
be morphisms of ringed topoi.
Let $\mathcal{F}$ be an $\mathcal{O}_\mathcal{C}$-module.
There is a spectral sequence with
$$
E_2^{p, q} = R^pg_*(R^qf_*\mathcal{F})
$$
converging to $R^{p + q}(g \circ f)_*\mathcal{F}$.
This spectral sequence is functorial in $\mathcal{F}$, and there
is a version for bounded below complexes of $\mathcal{O}_\mathcal{C}$-modules.
\end{lemma}
\begin{proof}
This is a Grothendieck spectral sequence for composition of functors, see
Derived Categories, Lemma \ref{derived-lemma-grothendieck-spectral-sequence}
and
Lemmas \ref{lemma-direct-image-injective-sheaf} and
\ref{lemma-limp-acyclic}.
\end{proof}
\section{The base change map}
\label{section-base-change-map}
\noindent
In this section we construct the base change map in some cases;
the general case is treated in Remark \ref{remark-base-change}.
The discussion in this section avoids using
derived pullback by restricting to the case of a base change
by a flat morphism of ringed sites.
Before we state the result, let us discuss flat pullback on the derived
category. Suppose
$g : (\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C})
\to (\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})$
is a flat morphism of ringed topoi. By
Modules on Sites, Lemma \ref{sites-modules-lemma-flat-pullback-exact}
the functor $g^* : \textit{Mod}(\mathcal{O}_\mathcal{D}) \to
\textit{Mod}(\mathcal{O}_\mathcal{C})$ is exact.
Hence it has a derived functor
$$
g^* : D(\mathcal{O}_\mathcal{D}) \to D(\mathcal{O}_\mathcal{C})
$$
which is computed by simply pulling back an representative of a given
object in $D(\mathcal{O}_\mathcal{D})$, see
Derived Categories, Lemma \ref{derived-lemma-right-derived-exact-functor}.
It preserved the bounded (above, below) subcategories.
Hence as indicated we indicate this functor by $g^*$ rather than $Lg^*$.
\begin{lemma}
\label{lemma-base-change-map-flat-case}
Let
$$
\xymatrix{
(\Sh(\mathcal{C}'), \mathcal{O}_{\mathcal{C}'})
\ar[r]_{g'} \ar[d]_{f'} &
(\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C}) \ar[d]^f \\
(\Sh(\mathcal{D}'), \mathcal{O}_{\mathcal{D}'})
\ar[r]^g &
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})
}
$$
be a commutative diagram of ringed topoi.
Let $\mathcal{F}^\bullet$ be a bounded below complex of
$\mathcal{O}_\mathcal{C}$-modules.
Assume both $g$ and $g'$ are flat.
Then there exists a canonical base change map
$$
g^*Rf_*\mathcal{F}^\bullet
\longrightarrow
R(f')_*(g')^*\mathcal{F}^\bullet
$$
in $D^{+}(\mathcal{O}_{\mathcal{D}'})$.
\end{lemma}
\begin{proof}
Choose injective resolutions $\mathcal{F}^\bullet \to \mathcal{I}^\bullet$
and $(g')^*\mathcal{F}^\bullet \to \mathcal{J}^\bullet$.
By Lemma \ref{lemma-pushforward-injective-flat} we see that
$(g')_*\mathcal{J}^\bullet$ is a complex of injectives representing
$R(g')_*(g')^*\mathcal{F}^\bullet$. Hence by
Derived Categories, Lemmas \ref{derived-lemma-morphisms-lift}
and \ref{derived-lemma-morphisms-equal-up-to-homotopy}
the arrow $\beta$ in the diagram
$$
\xymatrix{
(g')_*(g')^*\mathcal{F}^\bullet \ar[r] &
(g')_*\mathcal{J}^\bullet \\
\mathcal{F}^\bullet \ar[u]^{adjunction} \ar[r] &
\mathcal{I}^\bullet \ar[u]_\beta
}
$$
exists and is unique up to homotopy.
Pushing down to $\mathcal{D}$ we get
$$
f_*\beta :
f_*\mathcal{I}^\bullet
\longrightarrow
f_*(g')_*\mathcal{J}^\bullet
=
g_*(f')_*\mathcal{J}^\bullet
$$
By adjunction of $g^*$ and $g_*$ we get a map of complexes
$g^*f_*\mathcal{I}^\bullet \to (f')_*\mathcal{J}^\bullet$.
Note that this map is unique up to homotopy since the only
choice in the whole process was the choice of the map $\beta$
and everything was done on the level of complexes.
\end{proof}
\section{Cohomology and colimits}
\label{section-limits}
\noindent
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{I} \to \textit{Mod}(\mathcal{O})$, $i \mapsto \mathcal{F}_i$
be a diagram over the index category $\mathcal{I}$, see
Categories, Section \ref{categories-section-limits}.
For each $i$ there is a canonical map
$\mathcal{F}_i \to \colim_i \mathcal{F}_i$ which induces
a map on cohomology. Hence we get a canonical map
$$
\colim_i H^p(U, \mathcal{F}_i)
\longrightarrow
H^p(U, \colim_i \mathcal{F}_i)
$$
for every $p \geq 0$ and every object $U$ of $\mathcal{C}$.
These maps are in general not isomorphisms, even for $p = 0$.
\medskip\noindent
The following lemma is the analogue of
Sites, Lemma \ref{sites-lemma-directed-colimits-sections}
for cohomology.
\begin{lemma}
\label{lemma-colim-works-over-collection}
Let $\mathcal{C}$ be a site. Let $\text{Cov}_\mathcal{C}$ be the set
of coverings of $\mathcal{C}$ (see
Sites, Definition \ref{sites-definition-site}). Let
$\mathcal{B} \subset \Ob(\mathcal{C})$, and
$\text{Cov} \subset \text{Cov}_\mathcal{C}$
be subsets. Assume that
\begin{enumerate}
\item For every $\mathcal{U} \in \text{Cov}$ we have
$\mathcal{U} = \{U_i \to U\}_{i \in I}$ with $I$ finite,
$U, U_i \in \mathcal{B}$ and every
$U_{i_0} \times_U \ldots \times_U U_{i_p} \in \mathcal{B}$.
\item For every $U \in \mathcal{B}$ the coverings of $U$
occurring in $\text{Cov}$ is a cofinal system of coverings of $U$.
\end{enumerate}
Then the map
$$
\colim_i H^p(U, \mathcal{F}_i)
\longrightarrow
H^p(U, \colim_i \mathcal{F}_i)
$$
is an isomorphism for every $p \geq 0$, every $U \in \mathcal{B}$, and
every filtered diagram $\mathcal{I} \to \textit{Ab}(\mathcal{C})$.
\end{lemma}
\begin{proof}
To prove the lemma we will argue by induction on $p$.
Note that we require in (1) the coverings $\mathcal{U} \in \text{Cov}$
to be finite, so that all the elements of $\mathcal{B}$ are quasi-compact.
Hence (2) and (1) imply that any $U \in \mathcal{B}$ satisfies the hypothesis
of Sites, Lemma \ref{sites-lemma-directed-colimits-sections} (4).
Thus we see that the result holds for $p = 0$.
Now we assume the lemma holds for $p$ and prove it for $p + 1$.
\medskip\noindent
Choose a filtered diagram
$\mathcal{F} : \mathcal{I} \to \textit{Ab}(\mathcal{C})$,
$i \mapsto \mathcal{F}_i$.
Since $\textit{Ab}(\mathcal{C})$ has functorial injective embeddings, see
Injectives, Theorem \ref{injectives-theorem-sheaves-injectives},
we can find a morphism of filtered diagrams
$\mathcal{F} \to \mathcal{I}$
such that each $\mathcal{F}_i \to \mathcal{I}_i$ is an injective map of
abelian sheaves into an injective abelian sheaf. Denote $\mathcal{Q}_i$
the cokernel so that we have short exact sequences
$$
0 \to
\mathcal{F}_i \to
\mathcal{I}_i \to
\mathcal{Q}_i \to 0.
$$
Since colimits of sheaves are the sheafification of colimits on the level
of presheaves, since sheafification is exact, and since filtered
colimits of abelian groups are exact
(see Algebra, Lemma \ref{algebra-lemma-directed-colimit-exact}),
we see the sequence
$$
0 \to
\colim_i \mathcal{F}_i \to
\colim_i \mathcal{I}_i \to
\colim_i \mathcal{Q}_i \to 0.
$$
is also a short exact sequence. We claim that
$H^q(U, \colim_i \mathcal{I}_i) = 0$ for all $U \in \mathcal{B}$
and all $q \geq 1$. Accepting this claim
for the moment consider the diagram
$$
\xymatrix{
\colim_i H^p(U, \mathcal{I}_i) \ar[d] \ar[r] &
\colim_i H^p(U, \mathcal{Q}_i) \ar[d] \ar[r] &
\colim_i H^{p + 1}(U, \mathcal{F}_i) \ar[d] \ar[r] &
0 \ar[d] \\
H^p(U, \colim_i \mathcal{I}_i) \ar[r] &
H^p(U, \colim_i \mathcal{Q}_i) \ar[r] &
H^{p + 1}(U, \colim_i \mathcal{F}_i) \ar[r] &
0
}
$$
The zero at the lower right corner comes from the claim and the
zero at the upper right corner comes from the fact that the sheaves
$\mathcal{I}_i$ are injective.
The top row is exact by an application of
Algebra, Lemma \ref{algebra-lemma-directed-colimit-exact}.
Hence by the snake lemma we deduce the
result for $p + 1$.
\medskip\noindent
It remains to show that the claim is true. We will use
Lemma \ref{lemma-cech-vanish-collection}.
By the result for $p = 0$ we see that for $\mathcal{U} \in \text{Cov}$
we have
$$
\check{\mathcal{C}}^\bullet(\mathcal{U}, \colim_i \mathcal{I}_i)
=
\colim_i \check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{I}_i)
$$
because all the $U_{j_0} \times_U \ldots \times_U U_{j_p}$
are in $\mathcal{B}$. By
Lemma \ref{lemma-injective-trivial-cech}
each of the complexes in the colimit of {\v C}ech complexes is
acyclic in degree $\geq 1$. Hence by
Algebra, Lemma \ref{algebra-lemma-directed-colimit-exact}
we see that also the {\v C}ech complex
$\check{\mathcal{C}}^\bullet(\mathcal{U}, \colim_i \mathcal{I}_i)$
is acyclic in degrees $\geq 1$. In other words we see that
$\check{H}^p(\mathcal{U}, \colim_i \mathcal{I}_i) = 0$
for all $p \geq 1$. Thus the assumptions of
Lemma \ref{lemma-cech-vanish-collection}.
are satisfied and the claim follows.
\end{proof}
\noindent
Let $\mathcal{C}$ be a limit of sites $\mathcal{C}_i$ as in
Sites, Situation \ref{sites-situation-inverse-limit-sites} and
Lemmas \ref{sites-lemma-colimit-sites},
\ref{sites-lemma-compute-pullback-to-limit}, and
\ref{sites-lemma-colimit}.
In particular, all coverings
in $\mathcal{C}$ and $\mathcal{C}_i$ have finite index sets.
Moreover, assume given
\begin{enumerate}
\item an abelian sheaf $\mathcal{F}_i$ on $\mathcal{C}_i$ for all
$i \in \Ob(\mathcal{I})$,
\item for $a : j \to i$ a map
$\varphi_a : f_a^{-1}\mathcal{F}_i \to \mathcal{F}_j$
of abelian sheaves on $\mathcal{C}_j$
\end{enumerate}
such that $\varphi_c = \varphi_b \circ f_b^{-1}\varphi_a$
whenever $c = a \circ b$.
\begin{lemma}
\label{lemma-colimit}
In the situation discussed above set
$\mathcal{F} = \colim f_i^{-1}\mathcal{F}_i$.
Let $i \in \Ob(\mathcal{I})$, $X_i \in \text{Ob}(\mathcal{C}_i)$. Then
$$
\colim_{a : j \to i} H^p(u_a(X_i), \mathcal{F}_j) =
H^p(u_i(X_i), \mathcal{F})
$$
for all $p \geq 0$.
\end{lemma}
\begin{proof}
The case $p = 0$ is Sites, Lemma \ref{sites-lemma-colimit}.
\medskip\noindent
In this paragraph we show that we can find a map of systems
$(\gamma_i) : (\mathcal{F}_i, \varphi_a) \to (\mathcal{G}_i, \psi_a)$
with $\mathcal{G}_i$ an injective abelian sheaf and $\gamma_i$ injective.
For each $i$ we pick an injection $\mathcal{F}_i \to \mathcal{I}_i$
where $\mathcal{I}_i$ is an injective abelian sheaf on $\mathcal{C}_i$.
Then we can consider the family of maps
$$
\gamma_i :
\mathcal{F}_i
\longrightarrow
\prod\nolimits_{b : k \to i} f_{b, *}\mathcal{I}_k = \mathcal{G}_i
$$
where the component maps are the maps adjoint to the maps
$f_b^{-1}\mathcal{F}_i \to \mathcal{F}_k \to \mathcal{I}_k$.
For $a : j \to i$ in $\mathcal{I}$ there is a canonical map
$$
\psi_a : f_a^{-1}\mathcal{G}_i \to \mathcal{G}_j
$$
whose components are the canonical maps
$f_b^{-1}f_{a \circ b, *}\mathcal{I}_k \to f_{b, *}\mathcal{I}_k$
for $b : k \to j$. Thus we find an injection
$\{\gamma_i\} : \{\mathcal{F}_i, \varphi_a) \to (\mathcal{G}_i, \psi_a)$
of systems of abelian sheaves. Note that $\mathcal{G}_i$ is an injective
sheaf of abelian groups on $\mathcal{C}_i$, see
Lemma \ref{lemma-pushforward-injective-flat} and
Homology, Lemma \ref{homology-lemma-product-injectives}.
This finishes the construction.
\medskip\noindent
Arguing exactly as in the proof of
Lemma \ref{lemma-colim-works-over-collection}
we see that it suffices to prove that
$H^p(X, \colim f_i^{-1}\mathcal{G}_i) = 0$ for $p > 0$.
\medskip\noindent
Set $\mathcal{G} = \colim f_i^{-1}\mathcal{G}_i$.
To show vanishing of cohomology of $\mathcal{G}$ on every object
of $\mathcal{C}$ we show that the {\v C}ech cohomology of $\mathcal{G}$
for any covering $\mathcal{U}$ of $\mathcal{C}$ is zero
(Lemma \ref{lemma-cech-vanish-collection}).
The covering $\mathcal{U}$ comes from a covering
$\mathcal{U}_i$ of $\mathcal{C}_i$ for some $i$. We have
$$
\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{G}) =
\colim_{a : j \to i}
\check{\mathcal{C}}^\bullet(u_a(\mathcal{U}_i), \mathcal{G}_j)
$$
by the case $p = 0$. The right hand side is acyclic in positive degrees
as a filtered colimit of acyclic complexes by
Lemma \ref{lemma-injective-trivial-cech}. See
Algebra, Lemma \ref{algebra-lemma-directed-colimit-exact}.
\end{proof}
\section{Flat resolutions}
\label{section-flat}
\noindent
In this section we redo the arguments of
Cohomology, Section \ref{cohomology-section-flat}
in the setting of ringed sites and ringed topoi.
\begin{lemma}
\label{lemma-derived-tor-exact}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{G}^\bullet$ be a complex of $\mathcal{O}$-modules.
The functor
$$
K(\textit{Mod}(\mathcal{O}))
\longrightarrow
K(\textit{Mod}(\mathcal{O})),
\quad
\mathcal{F}^\bullet \longmapsto
\text{Tot}(\mathcal{F}^\bullet \otimes_\mathcal{O} \mathcal{G}^\bullet)
$$
is an exact functor of triangulated categories.
\end{lemma}
\begin{proof}
Omitted. Hint: See
More on Algebra, Lemmas \ref{more-algebra-lemma-derived-tor-homotopy} and
\ref{more-algebra-lemma-derived-tor-exact}.
\end{proof}
\begin{definition}
\label{definition-K-flat}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
A complex $\mathcal{K}^\bullet$ of $\mathcal{O}$-modules is
called {\it K-flat} if for every acyclic complex $\mathcal{F}^\bullet$
of $\mathcal{O}$-modules the complex
$$
\text{Tot}(\mathcal{F}^\bullet \otimes_\mathcal{O} \mathcal{K}^\bullet)
$$
is acyclic.
\end{definition}
\begin{lemma}
\label{lemma-K-flat-quasi-isomorphism}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{K}^\bullet$ be a K-flat complex.
Then the functor
$$
K(\textit{Mod}(\mathcal{O}))
\longrightarrow
K(\textit{Mod}(\mathcal{O})), \quad
\mathcal{F}^\bullet
\longmapsto
\text{Tot}(\mathcal{F}^\bullet \otimes_\mathcal{O} \mathcal{K}^\bullet)
$$
transforms quasi-isomorphisms into quasi-isomorphisms.
\end{lemma}
\begin{proof}
Follows from
Lemma \ref{lemma-derived-tor-exact}
and the fact that quasi-isomorphisms are characterized by having
acyclic cones.
\end{proof}
\begin{lemma}
\label{lemma-tensor-product-K-flat}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
If $\mathcal{K}^\bullet$, $\mathcal{L}^\bullet$ are K-flat complexes
of $\mathcal{O}$-modules, then
$\text{Tot}(\mathcal{K}^\bullet \otimes_\mathcal{O} \mathcal{L}^\bullet)$
is a K-flat complex of $\mathcal{O}$-modules.
\end{lemma}
\begin{proof}
Follows from the isomorphism
$$
\text{Tot}(\mathcal{M}^\bullet \otimes_\mathcal{O}
\text{Tot}(\mathcal{K}^\bullet \otimes_\mathcal{O} \mathcal{L}^\bullet))
=
\text{Tot}(\text{Tot}(\mathcal{M}^\bullet \otimes_\mathcal{O}
\mathcal{K}^\bullet) \otimes_\mathcal{O} \mathcal{L}^\bullet)
$$
and the definition.
\end{proof}
\begin{lemma}
\label{lemma-K-flat-two-out-of-three}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $(\mathcal{K}_1^\bullet, \mathcal{K}_2^\bullet, \mathcal{K}_3^\bullet)$
be a distinguished triangle in $K(\textit{Mod}(\mathcal{O}))$.
If two out of three of $\mathcal{K}_i^\bullet$ are K-flat, so is the third.
\end{lemma}
\begin{proof}
Follows from
Lemma \ref{lemma-derived-tor-exact}
and the fact that in a distinguished triangle in
$K(\textit{Mod}(\mathcal{O}))$
if two out of three are acyclic, so is the third.
\end{proof}
\begin{lemma}
\label{lemma-bounded-flat-K-flat}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site. A bounded above complex
of flat $\mathcal{O}$-modules is K-flat.
\end{lemma}
\begin{proof}
Let $\mathcal{K}^\bullet$ be a bounded above complex of flat
$\mathcal{O}$-modules. Let $\mathcal{L}^\bullet$ be an acyclic complex
of $\mathcal{O}$-modules. Note that
$\mathcal{L}^\bullet = \colim_m \tau_{\leq m}\mathcal{L}^\bullet$
where we take termwise colimits. Hence also
$$
\text{Tot}(\mathcal{K}^\bullet \otimes_\mathcal{O} \mathcal{L}^\bullet)
=
\colim_m \text{Tot}(
\mathcal{K}^\bullet \otimes_\mathcal{O} \tau_{\leq m}\mathcal{L}^\bullet)
$$
termwise. Hence to prove the complex on the left is acyclic it suffices
to show each of the complexes on the right is acyclic. Since
$\tau_{\leq m}\mathcal{L}^\bullet$ is acyclic this reduces us to the
case where $\mathcal{L}^\bullet$ is bounded above.
In this case the spectral sequence of
Homology, Lemma \ref{homology-lemma-first-quadrant-ss}
has
$$
{}'E_1^{p, q} = H^p(\mathcal{L}^\bullet \otimes_R \mathcal{K}^q)
$$
which is zero as $\mathcal{K}^q$ is flat and $\mathcal{L}^\bullet$ acyclic.
Hence we win.
\end{proof}
\begin{lemma}
\label{lemma-colimit-K-flat}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{K}_1^\bullet \to \mathcal{K}_2^\bullet \to \ldots$
be a system of K-flat complexes.
Then $\colim_i \mathcal{K}_i^\bullet$ is K-flat.
\end{lemma}
\begin{proof}
Because we are taking termwise colimits it is clear that
$$
\colim_i \text{Tot}(
\mathcal{F}^\bullet \otimes_\mathcal{O} \mathcal{K}_i^\bullet)
=
\text{Tot}(\mathcal{F}^\bullet \otimes_\mathcal{O}
\colim_i \mathcal{K}_i^\bullet)
$$
Hence the lemma follows from the fact that filtered colimits are
exact.
\end{proof}
\begin{lemma}
\label{lemma-resolution-by-direct-sums-extensions-by-zero}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
For any complex $\mathcal{G}^\bullet$ of $\mathcal{O}$-modules
there exists a commutative diagram of complexes of $\mathcal{O}$-modules
$$
\xymatrix{
\mathcal{K}_1^\bullet \ar[d] \ar[r] &
\mathcal{K}_2^\bullet \ar[d] \ar[r] & \ldots \\
\tau_{\leq 1}\mathcal{G}^\bullet \ar[r] &
\tau_{\leq 2}\mathcal{G}^\bullet \ar[r] & \ldots
}
$$
with the following properties: (1) the vertical arrows are quasi-isomorphisms,
(2) each $\mathcal{K}_n^\bullet$ is a bounded above complex whose terms
are direct sums of $\mathcal{O}$-modules of the form $j_{U!}\mathcal{O}_U$, and
(3) the maps $\mathcal{K}_n^\bullet \to \mathcal{K}_{n + 1}^\bullet$ are
termwise split injections whose cokernels are direct sums of
$\mathcal{O}$-modules of the form $j_{U!}\mathcal{O}_U$. Moreover, the map
$\colim \mathcal{K}_n^\bullet \to \mathcal{G}^\bullet$ is a quasi-isomorphism.
\end{lemma}
\begin{proof}
The existence of the diagram and properties (1), (2), (3) follows immediately
from
Modules on Sites, Lemma \ref{sites-modules-lemma-module-quotient-flat}
and
Derived Categories, Lemma \ref{derived-lemma-special-direct-system}.
The induced map
$\colim \mathcal{K}_n^\bullet \to \mathcal{G}^\bullet$
is a quasi-isomorphism because filtered colimits are exact.
\end{proof}
\begin{lemma}
\label{lemma-K-flat-resolution}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
For any complex $\mathcal{G}^\bullet$ of $\mathcal{O}$-modules
there exists a $K$-flat complex
$\mathcal{K}^\bullet$ and a quasi-isomorphism
$\mathcal{K}^\bullet \to \mathcal{G}^\bullet$.
\end{lemma}
\begin{proof}
Choose a diagram as in
Lemma \ref{lemma-resolution-by-direct-sums-extensions-by-zero}.
Each complex $\mathcal{K}_n^\bullet$ is a bounded
above complex of flat modules, see
Modules on Sites, Lemma \ref{sites-modules-lemma-j-shriek-flat}.
Hence $\mathcal{K}_n^\bullet$ is K-flat by
Lemma \ref{lemma-bounded-flat-K-flat}.
The induced map
$\colim \mathcal{K}_n^\bullet \to \mathcal{G}^\bullet$
is a quasi-isomorphism by construction. Since
$\colim \mathcal{K}_n^\bullet$ is K-flat by
Lemma \ref{lemma-colimit-K-flat}
we win.
\end{proof}
\begin{lemma}
\label{lemma-derived-tor-quasi-isomorphism-other-side}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site. Let
$\alpha : \mathcal{P}^\bullet \to \mathcal{Q}^\bullet$ be a
quasi-isomorphism of K-flat complexes of $\mathcal{O}$-modules.
For every complex $\mathcal{F}^\bullet$ of $\mathcal{O}$-modules
the induced map
$$
\text{Tot}(\text{id}_{\mathcal{F}^\bullet} \otimes \alpha) :
\text{Tot}(\mathcal{F}^\bullet \otimes_\mathcal{O} \mathcal{P}^\bullet)
\longrightarrow
\text{Tot}(\mathcal{F}^\bullet \otimes_\mathcal{O} \mathcal{Q}^\bullet)
$$
is a quasi-isomorphism.
\end{lemma}
\begin{proof}
Choose a quasi-isomorphism $\mathcal{K}^\bullet \to \mathcal{F}^\bullet$
with $\mathcal{K}^\bullet$ a K-flat complex, see
Lemma \ref{lemma-K-flat-resolution}.
Consider the commutative diagram
$$
\xymatrix{
\text{Tot}(\mathcal{K}^\bullet
\otimes_\mathcal{O} \mathcal{P}^\bullet) \ar[r] \ar[d] &
\text{Tot}(\mathcal{K}^\bullet
\otimes_\mathcal{O} \mathcal{Q}^\bullet) \ar[d] \\
\text{Tot}(\mathcal{F}^\bullet
\otimes_\mathcal{O} \mathcal{P}^\bullet) \ar[r] &
\text{Tot}(\mathcal{F}^\bullet
\otimes_\mathcal{O} \mathcal{Q}^\bullet)
}
$$
The result follows as by
Lemma \ref{lemma-K-flat-quasi-isomorphism}
the vertical arrows and the top horizontal arrow are quasi-isomorphisms.
\end{proof}
\noindent
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{F}^\bullet$ be an object of $D(\mathcal{O})$.
Choose a K-flat resolution $\mathcal{K}^\bullet \to \mathcal{F}^\bullet$, see
Lemma \ref{lemma-K-flat-resolution}.
By
Lemma \ref{lemma-derived-tor-exact}
we obtain an exact functor of triangulated categories
$$
K(\mathcal{O})
\longrightarrow
K(\mathcal{O}),
\quad
\mathcal{G}^\bullet
\longmapsto
\text{Tot}(\mathcal{G}^\bullet \otimes_\mathcal{O} \mathcal{K}^\bullet)
$$
By
Lemma \ref{lemma-K-flat-quasi-isomorphism}
this functor induces a functor
$D(\mathcal{O}) \to D(\mathcal{O})$ simply because
$D(\mathcal{O})$ is the localization of $K(\mathcal{O})$
at quasi-isomorphisms. By
Lemma \ref{lemma-derived-tor-quasi-isomorphism-other-side}
the resulting functor (up to isomorphism)
does not depend on the choice of the K-flat resolution.
\begin{definition}
\label{definition-derived-tor}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{F}^\bullet$ be an object of $D(\mathcal{O})$.
The {\it derived tensor product}
$$
- \otimes_\mathcal{O}^{\mathbf{L}} \mathcal{F}^\bullet :
D(\mathcal{O})
\longrightarrow
D(\mathcal{O})
$$
is the exact functor of triangulated categories described above.
\end{definition}
\noindent
It is clear from our explicit constructions that
there is a canonical isomorphism
$$
\mathcal{F}^\bullet \otimes_\mathcal{O}^{\mathbf{L}} \mathcal{G}^\bullet
\cong
\mathcal{G}^\bullet \otimes_\mathcal{O}^{\mathbf{L}} \mathcal{F}^\bullet
$$
for $\mathcal{G}^\bullet$ and $\mathcal{F}^\bullet$ in $D(\mathcal{O})$.
Hence when we write
$\mathcal{F}^\bullet \otimes_\mathcal{O}^{\mathbf{L}} \mathcal{G}^\bullet$
we will usually be agnostic about which variable we are using to
define the derived tensor product with.
\begin{definition}
\label{definition-tor}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{F}$, $\mathcal{G}$ be $\mathcal{O}$-modules.
The {\it Tor}'s of $\mathcal{F}$ and $\mathcal{G}$ are defined by
the formula
$$
\text{Tor}_p^\mathcal{O}(\mathcal{F}, \mathcal{G}) =
H^{-p}(\mathcal{F} \otimes_\mathcal{O}^\mathbf{L} \mathcal{G})
$$
with derived tensor product as defined above.
\end{definition}
\noindent
This definition implies that for every short exact sequence
of $\mathcal{O}$-modules
$0 \to \mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3 \to 0$
we have a long exact cohomology sequence
$$
\xymatrix{
\mathcal{F}_1 \otimes_\mathcal{O} \mathcal{G} \ar[r] &
\mathcal{F}_2 \otimes_\mathcal{O} \mathcal{G} \ar[r] &
\mathcal{F}_3 \otimes_\mathcal{O} \mathcal{G} \ar[r] & 0 \\
\text{Tor}_1^\mathcal{O}(\mathcal{F}_1, \mathcal{G}) \ar[r] &
\text{Tor}_1^\mathcal{O}(\mathcal{F}_2, \mathcal{G}) \ar[r] &
\text{Tor}_1^\mathcal{O}(\mathcal{F}_3, \mathcal{G}) \ar[ull]
}
$$
for every $\mathcal{O}$-module $\mathcal{G}$. This will be called
the long exact sequence of $\text{Tor}$ associated to the situation.
\begin{lemma}
\label{lemma-flat-tor-zero}
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
Let $\mathcal{F}$ be an $\mathcal{O}$-module.
The following are equivalent
\begin{enumerate}
\item $\mathcal{F}$ is a flat $\mathcal{O}$-module, and
\item $\text{Tor}_1^\mathcal{O}(\mathcal{F}, \mathcal{G}) = 0$
for every $\mathcal{O}$-module $\mathcal{G}$.
\end{enumerate}
\end{lemma}
\begin{proof}
If $\mathcal{F}$ is flat, then $\mathcal{F} \otimes_\mathcal{O} -$
is an exact functor and the satellites vanish. Conversely assume (2)
holds. Then if $\mathcal{G} \to \mathcal{H}$ is injective with cokernel
$\mathcal{Q}$, the long exact sequence of $\text{Tor}$ shows that
the kernel of
$\mathcal{F} \otimes_\mathcal{O} \mathcal{G} \to
\mathcal{F} \otimes_\mathcal{O} \mathcal{H}$
is a quotient of
$\text{Tor}_1^\mathcal{O}(\mathcal{F}, \mathcal{Q})$
which is zero by assumption. Hence $\mathcal{F}$ is flat.
\end{proof}
\section{Derived pullback}
\label{section-derived-pullback}
\noindent
Let
$f : (\Sh(\mathcal{C}), \mathcal{O}) \to
(\Sh(\mathcal{C}'), \mathcal{O}')$
be a morphism of ringed topoi. We can use K-flat resolutions to define
a derived pullback functor
$$
Lf^* : D(\mathcal{O}') \to D(\mathcal{O})
$$
\begin{lemma}
\label{lemma-pullback-K-flat}
Let $(\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C})$ be a ringed topos.
For any complex of $\mathcal{O}_\mathcal{C}$-modules $\mathcal{G}^\bullet$
there exists a quasi-isomorphism $\mathcal{K}^\bullet \to \mathcal{G}^\bullet$
such that $f^*\mathcal{K}^\bullet$ is a K-flat complex of
$\mathcal{O}_\mathcal{D}$-modules for any morphism
$f : (\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D}) \to
(\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C})$ of ringed topoi.
\end{lemma}
\begin{proof}
In the proof of
Lemma \ref{lemma-K-flat-resolution}
we find a quasi-isomorphism
$\mathcal{K}^\bullet = \colim_i \mathcal{K}_i^\bullet \to
\mathcal{G}^\bullet$
where each $\mathcal{K}_i^\bullet$ is a bounded above complex of
flat $\mathcal{O}_\mathcal{C}$-modules. Let
$f : (\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D}) \to
(\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C})$ be a morphism
of ringed topoi. By
Modules on Sites, Lemma \ref{sites-modules-lemma-pullback-flat}
we see that $f^*\mathcal{F}_i^\bullet$ is a bounded above complex
of flat $\mathcal{O}_\mathcal{D}$-modules. Hence
$f^*\mathcal{K}^\bullet = \colim_i f^*\mathcal{K}_i^\bullet$
is K-flat by
Lemmas \ref{lemma-bounded-flat-K-flat} and \ref{lemma-colimit-K-flat}.
\end{proof}
\begin{remark}
\label{remark-pullback-K-flat}
It is straightforward to show that the pullback of a K-flat complex
is K-flat for a morphism of ringed topoi with enough points; this slightly
improves the result of
Lemma \ref{lemma-pullback-K-flat}.
However, in applications it seems rather that the explicit form of the K-flat
complexes constructed in
Lemma \ref{lemma-K-flat-resolution}
is what is useful (as in the proof above) and not the plain fact that they
are K-flat. Note for example that the terms of the complex constructed
are each direct sums of modules of the form $j_{U!}\mathcal{O}_U$, see
Lemma \ref{lemma-resolution-by-direct-sums-extensions-by-zero}.
\end{remark}
\begin{lemma}
\label{lemma-derived-base-change}
Let
$f : (\Sh(\mathcal{C}), \mathcal{O}) \to
(\Sh(\mathcal{C}'), \mathcal{O}')$
be a morphism of ringed topoi.
There exists an exact functor
$$
Lf^* : D(\mathcal{O}') \longrightarrow D(\mathcal{O})
$$
of triangulated categories so that
$Lf^*\mathcal{K}^\bullet = f^*\mathcal{K}^\bullet$ for any complex as in
Lemma \ref{lemma-pullback-K-flat} and
in particular for any bounded above complex of flat $\mathcal{O}'$-modules.
\end{lemma}
\begin{proof}
To see this we use the general theory developed in
Derived Categories, Section \ref{derived-section-derived-functors}.
Set $\mathcal{D} = K(\mathcal{O}')$ and $\mathcal{D}' = D(\mathcal{O})$.
Let us write $F : \mathcal{D} \to \mathcal{D}'$ the exact functor
of triangulated categories defined by the rule
$F(\mathcal{G}^\bullet) = f^*\mathcal{G}^\bullet$.
We let $S$ be the set of quasi-isomorphisms in
$\mathcal{D} = K(\mathcal{O}')$.
This gives a situation as in
Derived Categories, Situation \ref{derived-situation-derived-functor}
so that
Derived Categories, Definition
\ref{derived-definition-right-derived-functor-defined}
applies. We claim that $LF$ is everywhere defined.
This follows from
Derived Categories, Lemma \ref{derived-lemma-find-existence-computes}
with $\mathcal{P} \subset \Ob(\mathcal{D})$ the collection
of complexes $\mathcal{K}^\bullet$ as in
Lemma \ref{lemma-pullback-K-flat}. Namely, (1) follows from
Lemma \ref{lemma-pullback-K-flat}
and to see (2) we have to show that for a quasi-isomorphism
$\mathcal{K}_1^\bullet \to \mathcal{K}_2^\bullet$ between
elements of $\mathcal{P}$ the map
$f^*\mathcal{K}_1^\bullet \to f^*\mathcal{K}_2^\bullet$ is a
quasi-isomorphism. To see this write this as
$$
f^{-1}\mathcal{K}_1^\bullet \otimes_{f^{-1}\mathcal{O}'} \mathcal{O}
\longrightarrow
f^{-1}\mathcal{K}_2^\bullet \otimes_{f^{-1}\mathcal{O}'} \mathcal{O}
$$
The functor $f^{-1}$ is exact, hence the map
$f^{-1}\mathcal{K}_1^\bullet \to f^{-1}\mathcal{K}_2^\bullet$ is a
quasi-isomorphism. The complexes
$f^{-1}\mathcal{K}_1^\bullet$ and $f^{-1}\mathcal{K}_2^\bullet$
are K-flat complexes of $f^{-1}\mathcal{O}'$-modules by our choice of
$\mathcal{P}$ because we can consider the morphism of ringed topoi
$(\Sh(\mathcal{C}), f^{-1}\mathcal{O}') \to
(\Sh(\mathcal{C}'), \mathcal{O}')$. Hence
Lemma \ref{lemma-derived-tor-quasi-isomorphism-other-side}
guarantees that the displayed map is a quasi-isomorphism.
Thus we obtain a derived functor
$$
LF :
D(\mathcal{O}') = S^{-1}\mathcal{D}
\longrightarrow
\mathcal{D}' = D(\mathcal{O})
$$
see
Derived Categories, Equation (\ref{derived-equation-everywhere}).
Finally,
Derived Categories, Lemma \ref{derived-lemma-find-existence-computes}
also guarantees that
$LF(\mathcal{K}^\bullet) = F(\mathcal{K}^\bullet) = f^*\mathcal{K}^\bullet$
when $\mathcal{K}^\bullet$ is in $\mathcal{P}$.
Since the proof of
Lemma \ref{lemma-pullback-K-flat}
shows that bounded above complexes of flat modules are in $\mathcal{P}$
we win.
\end{proof}
\begin{lemma}
\label{lemma-derived-pullback-composition}
Consider morphisms of ringed topoi
$f : (\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C}) \to
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})$
and
$g : (\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D}) \to
(\Sh(\mathcal{E}), \mathcal{O}_\mathcal{E})$.
Then $Lf^* \circ Lg^* = L(g \circ f)^*$ as functors
$D(\mathcal{O}_\mathcal{E}) \to D(\mathcal{O}_\mathcal{C})$.
\end{lemma}
\begin{proof}
Let $E$ be an object of $D(\mathcal{O}_\mathcal{E})$.
By construction $Lg^*E$ is computed by choosing a complex
$\mathcal{K}^\bullet$ as in Lemma \ref{lemma-pullback-K-flat}
representing $E$ and setting $Lg^*E = g^*\mathcal{K}^\bullet$.
By transitivity of pullback functors the complex $g^*\mathcal{K}^\bullet$
pulled back by any morphism of ringed topoi
$(\Sh(\mathcal{C}'), \mathcal{O}') \to
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})$
is K-flat. Hence $g^*\mathcal{K}^\bullet$ is a complex as in
Lemma \ref{lemma-pullback-K-flat} representing $Lg^*E$.
We conclude $Lf^*Lg^*E$ is given by
$f^*g^*\mathcal{K}^\bullet = (g \circ f)^*\mathcal{K}^\bullet$
which also represents $L(g \circ f)^*E$.
\end{proof}
\begin{lemma}
\label{lemma-pullback-tensor-product}
Let $f : (\Sh(\mathcal{C}), \mathcal{O}) \to (\Sh(\mathcal{D}), \mathcal{O}')$
be a morphism of ringed topoi.
There is a canonical bifunctorial isomorphism
$$
Lf^*(
\mathcal{F}^\bullet \otimes_{\mathcal{O}'}^{\mathbf{L}} \mathcal{G}^\bullet
) =
Lf^*\mathcal{F}^\bullet
\otimes_{\mathcal{O}}^{\mathbf{L}}
Lf^*\mathcal{G}^\bullet
$$
for $\mathcal{F}^\bullet, \mathcal{G}^\bullet \in \Ob(D(\mathcal{O}'))$.
\end{lemma}
\begin{proof}
By Lemma \ref{lemma-pullback-K-flat} we may assume that $\mathcal{F}^\bullet$
and $\mathcal{G}^\bullet$ are K-flat complexes of $\mathcal{O}'$-modules
such that $f^*\mathcal{F}^\bullet$ and $f^*\mathcal{G}^\bullet$
are K-flat complexes of $\mathcal{O}$-modules. In this case
$\mathcal{F}^\bullet \otimes_{\mathcal{O}'}^{\mathbf{L}} \mathcal{G}^\bullet$
is just the total complex associated to the double complex
$\mathcal{F}^\bullet \otimes_{\mathcal{O}'} \mathcal{G}^\bullet$. By
Lemma \ref{lemma-tensor-product-K-flat}
$\text{Tot}(\mathcal{F}^\bullet \otimes_{\mathcal{O}'} \mathcal{G}^\bullet)$
is K-flat also. Hence the isomorphism of the lemma comes from the
isomorphism
$$
\text{Tot}(f^*\mathcal{F}^\bullet \otimes_{\mathcal{O}}
f^*\mathcal{G}^\bullet)
\longrightarrow
f^*\text{Tot}(\mathcal{F}^\bullet \otimes_{\mathcal{O}'} \mathcal{G}^\bullet)
$$
whose constituents are the isomorphisms
$f^*\mathcal{F}^p \otimes_{\mathcal{O}} f^*\mathcal{G}^q \to
f^*(\mathcal{F}^p \otimes_{\mathcal{O}'} \mathcal{G}^q)$ of
Modules on Sites, Lemma \ref{sites-modules-lemma-tensor-product-pullback}.
\end{proof}
\begin{lemma}
\label{lemma-variant-derived-pullback}
Let $f : (\Sh(\mathcal{C}), \mathcal{O}) \to (\Sh(\mathcal{C}'), \mathcal{O}')$
be a morphism of ringed topoi. There is a canonical bifunctorial
isomorphism
$$
\mathcal{F}^\bullet
\otimes_\mathcal{O}^{\mathbf{L}}
Lf^*\mathcal{G}^\bullet
=
\mathcal{F}^\bullet
\otimes_{f^{-1}\mathcal{O}_Y}^{\mathbf{L}}
f^{-1}\mathcal{G}^\bullet
$$
for $\mathcal{F}^\bullet$ in $D(\mathcal{O})$ and
$\mathcal{G}^\bullet$ in $D(\mathcal{O}')$.
\end{lemma}
\begin{proof}
Let $\mathcal{F}$ be an $\mathcal{O}$-module and let $\mathcal{G}$
be an $\mathcal{O}'$-module. Then
$\mathcal{F} \otimes_{\mathcal{O}} f^*\mathcal{G} =
\mathcal{F} \otimes_{f^{-1}\mathcal{O}'} f^{-1}\mathcal{G}$
because
$f^*\mathcal{G} =
\mathcal{O} \otimes_{f^{-1}\mathcal{O}'} f^{-1}\mathcal{G}$.
The lemma follows from this and the definitions.
\end{proof}
\section{Cohomology of unbounded complexes}
\label{section-unbounded}
\noindent
Let $(\mathcal{C}, \mathcal{O})$ be a ringed site.
The category $\textit{Mod}(\mathcal{O})$ is a Grothendieck
abelian category: it has all colimits,
filtered colimits are exact, and it has a generator, namely
$$
\bigoplus\nolimits_{U \in \Ob(\mathcal{C})} j_{U!}\mathcal{O}_U,
$$
see Modules on Sites, Section \ref{sites-modules-section-kernels} and
Lemmas \ref{sites-modules-lemma-j-shriek-flat} and
\ref{sites-modules-lemma-module-quotient-flat}.
By
Injectives, Theorem
\ref{injectives-theorem-K-injective-embedding-grothendieck}
for every complex $\mathcal{F}^\bullet$ of $\mathcal{O}$-modules
there exists an injective quasi-isomorphism
$\mathcal{F}^\bullet \to \mathcal{I}^\bullet$ to a K-injective complex
of $\mathcal{O}$-modules. Hence we can define
$$
R\Gamma(\mathcal{C}, \mathcal{F}^\bullet) =
\Gamma(\mathcal{C}, \mathcal{I}^\bullet)
$$
and similarly for any left exact functor, see
Derived Categories, Lemma \ref{derived-lemma-enough-K-injectives-implies}.
For any morphism of
ringed topoi
$f : (\Sh(\mathcal{C}), \mathcal{O}) \to (\Sh(\mathcal{D}), \mathcal{O}')$
we obtain
$$
Rf_* : D(\mathcal{O}) \longrightarrow D(\mathcal{O}')
$$
on the unbounded derived categories.
\begin{lemma}
\label{lemma-adjoint}
Let $f : (\Sh(\mathcal{C}), \mathcal{O}) \to (\Sh(\mathcal{D}), \mathcal{O}')$
be a morphism of ringed topoi.
The functor $Rf_*$ defined above and
the functor $Lf^*$ defined in
Lemma \ref{lemma-derived-base-change} are adjoint:
$$
\Hom_{D(\mathcal{O})}(Lf^*\mathcal{G}^\bullet, \mathcal{F}^\bullet)
=
\Hom_{D(\mathcal{O}')}(\mathcal{G}^\bullet, Rf_*\mathcal{F}^\bullet)
$$
bifunctorially in $\mathcal{F}^\bullet \in \Ob(D(\mathcal{O}))$ and
$\mathcal{G}^\bullet \in \Ob(D(\mathcal{O}'))$.
\end{lemma}
\begin{proof}
This follows formally from the fact that $Rf_*$ and $Lf^*$ exist, see
Derived Categories, Lemma \ref{derived-lemma-derived-adjoint-functors}.
\end{proof}
\begin{lemma}
\label{lemma-derived-pushforward-composition}
Let
$f : (\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C}) \to
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})$
and
$g : (\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D}) \to
(\Sh(\mathcal{E}), \mathcal{O}_\mathcal{E})$
be morphisms of ringed topoi.
Then $Rg_* \circ Rf_* = R(g \circ f)_*$ as functors
$D(\mathcal{O}_\mathcal{C}) \to D(\mathcal{O}_\mathcal{E})$.
\end{lemma}
\begin{proof}
By Lemma \ref{lemma-adjoint} we see that $Rg_* \circ Rf_*$
is adjoint to $Lf^* \circ Lg^*$. We have
$Lf^* \circ Lg^* = L(g \circ f)^*$ by
Lemma \ref{lemma-derived-pullback-composition}
and hence by
uniqueness of adjoint functors we have $Rg_* \circ Rf_* = R(g \circ f)_*$.
\end{proof}
\begin{remark}
\label{remark-base-change}
The construction of unbounded derived functor $Lf^*$ and $Rf_*$
allows one to construct the base change map in full generality.
Namely, suppose that
$$
\xymatrix{
(\Sh(\mathcal{C}'), \mathcal{O}_{\mathcal{C}'})
\ar[r]_{g'} \ar[d]_{f'} &
(\Sh(\mathcal{C}), \mathcal{O}_\mathcal{C}) \ar[d]^f \\
(\Sh(\mathcal{D}'), \mathcal{O}_{\mathcal{D}'})
\ar[r]^g &
(\Sh(\mathcal{D}), \mathcal{O}_\mathcal{D})
}
$$
is a commutative diagram of ringed topoi. Let $K$ be an object of
$D(\mathcal{O}_\mathcal{C})$.
Then there exists a canonical base change map
$$
Lg^*Rf_*K \longrightarrow R(f')_*L(g')^*K
$$
in $D(\mathcal{O}_{\mathcal{D}'})$. Namely, this map is adjoint to a map
$L(f')^*Lg^*Rf_*K \to L(g')^*K$.
Since $L(f')^* \circ Lg^* = L(g')^* \circ Lf^*$ we see this is the same
as a map $L(g')^*Lf^*Rf_*K \to L(g')^*K$
which we can take to be $L(g')^*$ of the adjunction map
$Lf^*Rf_*K \to K$.
\end{remark}
\begin{remark}
\label{remark-cup-product}
Let $f : (