\section{Derived Functors (notes by Michael Zhao)}
Let $F : \mathcal{A} \rightarrow \mathcal{B}$ be a functor between abelian
categories. We will always implicitly assume $F$ is also additive. Then $F$ induces a functor
$F : C(\mathcal{A}) \rightarrow C(\mathcal{B})$. Since $F$ is is additive, it
further induces a functor $F: \mathcal{K}(\mathcal{A}) \rightarrow \mathcal{K}
(\mathcal{B})$. How can we construct a functor $D(A) \rightarrow D(B)$? The na\"{i}ve 
construction would be to try term-by-term application of $F$. However, for $F(f)$ to be a quasi-isomorphism for
all quasi-isomorphisms $f$, $F$ would have to be exact.

We would like to be able to have a derived functor $D(A) \rightarrow D(B)$ for
non-exact
functors, e.g. \[
\mathrm{Hom}_\mathcal{A}(X, -): \mathcal{A} \rightarrow \Ab,
\] where $\Ab$ is the category of abelian groups. So we will generalize to left
or right-exact functors. Let's assume that $F$ is left-exact. We want to
construct a derived functor $RF : D^+\A \rightarrow
D^+\B$, which satisfies the
\begin{defn}\label{der-func}
A \textbf{derived functor} of $F: \A \rightarrow \B$ is a pair $(RF: D^+\A
\rightarrow D^+B, s)$, where $RF$ is \textbf{exact} (i.e. takes distinguished
triangles to distinguished triangles and commutes with the shift $[1]$) and $s$
is a natural transformation $s: Q \circ K^+ F \rightarrow RF \circ Q$ (where $Q:
K^+\A \rightarrow D^+\A$), which is \textbf{initial} among all such pairs, i.e.
for all pairs $(G: D^+\A \rightarrow D^+\B, t : Q \circ K^+ F \rightarrow G \circ
Q)$, there is a unique natural transformation $\eta: RF \rightarrow G$ such that
for all $X \in K^+\A$, the following diagram commutes.
\[
\begin{tikzcd}[row sep=2.5em]
 & RF \circ Q(X) \arrow{dr}{\eta} \\
Q \circ K^+F(X) \arrow{ur}{s_X} \arrow{rr}{t_X} && G \circ Q(X)
\end{tikzcd}
\]
\end{defn}

\subsection{Construction of Derived Functors} How to construct derived functors?

\begin{defn}
A class of objects $\mathcal{R}$ in $\A$ is \textbf{adapted to $F$} if
\begin{enumerate}[1)]
\item $\mathcal{R}$ is closed under finite direct sums
\item If $X \in C^+(\mathcal{R})$ is acyclic, then $F(X)$ is acyclic.
\item For all $X \in \mathrm{ob}(\A)$, there exists a monomorphism $X
\xhookrightarrow{} I$ for some $I \in \mathcal{R}$
\end{enumerate}
The typical example is if $\A$ has enough injectives. Then $\mathcal{R}$ can be
the class of injective objects (Clearly, 1 and 3 hold. For 2, if $I \in
K^+\mathcal{I}$ is acyclic, then $I$ is isomorphic in $K^+\mathcal{I}$ to 0).
\end{defn}

As with our recent arguments with injectives, for any such $\mathcal{R}$, we get
an equivalence of categories $K^+(\mathcal{R})[S^{-1}] \iso D^+\A$, where $K^+(\mathcal{R})[S^
{-1}]$ denotes the localization of $K^+(\mathcal{R})$ with respect to the class $S$ of quasi-isomorphisms.

Then we can construct $RF$ as follows. Consider the composite \[
K^+(\mathcal{R}) \rightarrow K^+\A \xrightarrow[]{\text{$K^+F$}} K^+\B
\xrightarrow[]{\text{$Q$}} D^+\B,
\] which takes quasi-isomorphisms to isomorphisms in $D^+\B$. By the universal
property of localization, this defines a map $K^+(\mathcal{R})[S^{-1}] \rightarrow
D^+\B$. By choosing an inverse to the equivalence of categories in the previous
paragraph, we have a functor $D^+\A \rightarrow D^+\B$, and $RF$ is defined to be
this functor. (In sum, the construction is to take $\mathcal
{R}$-resolutions and apply $F$ term by term.)

\begin{lem}[Exercise]
$RF$ is exact and satisfies the universal property in definition \ref{der-func}.
\end{lem}

A reason not to always take $\mathcal{R}$ to be the class of injective objects is
given by the

\begin{lem}[Grothendieck-Leray ``spectral sequence'']
Given left-exact functors $\A \xrightarrow[]{\text{$F$}} \B \xrightarrow[]
{\text{$G$}} \mathcal{C}$ and $\mathcal{R}_F, \mathcal{R}_G$ classes of
objects adapted to $F, G$ respectively, such that $F(\mathcal{R}_F) \subseteq \mathcal
{R}_G$, there is a natural isomorphism of functors $R(G \circ F) \longiso RG
\circ RF$.
\end{lem}
\begin{proof}
There is always a map $R(G \circ F) \rightarrow RG \circ RF$. Via the universal
property of $R(G \circ F)$, we have an isomorphism \[
\Hom(R(G \circ F), RG \circ RF) \longiso \Hom(Q \circ K^+(G \circ F), (RG \circ
RF) \circ Q),
\] which sends, for all pairs $(RG \circ RF, t)$, $\Hom(R(G \circ F), RF \circ
RG) \ni \eta \mapsto t \in \Hom(Q \circ K^+(G \circ F), (G \circ F) \circ Q)$,
where $\eta, t, s$ are as in the diagram in definition \ref{der-func}. However,
the right-hand side is non-empty, as it contains \[
Q \circ K^+G \circ K^+F \xrightarrow[]{\text{$s_G \circ K^+F$}} RG \circ Q \circ
K^+ F \xrightarrow[]{\text{$RG \circ s_F$}} RG \circ RF \circ Q.
\]

Now, in the setting of the lemma, $\mathcal{R}_F$ is adapted to $G \circ F$, so $R(G
\circ F)$ is computed by
\begin{enumerate}[(i)]
\item resolve by $K^+\mathcal{R}_F$.
\item apply $K^+(G \circ F) = K^+G \circ K^+F$; the left-hand side computes $R(G \circ F)$, while the right-hand side computes $RG \circ RF$.
\end{enumerate}
\end{proof}

\begin{defn}
For a derived functor $RF: D^+\A \rightarrow D^+\B$, write $R^iF$ for the
functor $H^i \circ RF : D^+\A \rightarrow \B$.
\end{defn}

\begin{exmpl}
Suppose $\A$ is abelian with enough injectives, and let $X$ be an object of $\A$.
Then we have the left-exact functor $Y \mapsto \Hom_\A(X, Y)$. Then we get the
derived functor $\mathrm{RHom}(X, -): D^+\A \rightarrow D^+(\Ab)$. Then we have
the
\begin{lem}
There is an isomorphism of functors $\mathrm{Ext}^i_{\A}(X, -) \longiso R^i\Hom
(X, -)$.
\end{lem}
\end{exmpl}

We will actually give a more general construction, similar to this one, which
allows for $X \in D\A$. Define a functor \[
\Hom^\bullet_\A( \ , \ ): C(\A)^{\mathrm{op}} \times C^+(\A) \rightarrow C(\Ab)
\] by \[
\Hom^n_\A(X, Y) = \prod_{i \in \ints} \Hom_{\A}(X^i, Y^{i + n}),
\] with \[
d^n( (f^i : X^i \rightarrow Y^{i + n})_{i \in \ints}) = d_Y \circ f^i + (-1)^{n
+ 1} f^{i + 1} \circ d_X,
\] which is a map from $X^i \rightarrow Y^{i + n + 1}$. (Check that $d^2 = 0$.)

A key property of $\Hom_\A^\bullet$ is that it computes $\Hom_{K(\A)}$: \[
Z^0(\Hom_\A^\bullet(X, Y)) = \{(f^i : X^i \rightarrow Y^i) \ | \ d_Y f = f d_X\}
= \Hom_{C(\A)}(X, Y),
\] and \[
B^0(\Hom_\A^\bullet(X, Y)) = \{(g_i : X^i \rightarrow Y^i)_{i \in \ints} \ | \
\exists f_i : X^i \rightarrow Y^{i - 1}, g = d_Yf + fd_X\},
\] which is the set of null-homotopic chain maps. Then $H^0(\Hom_\A^\bullet(X,
Y)) = \Hom_{K(\A)}(X, Y)$.

\begin{prop}
There exists a bifunctor $\RHom : D(\A)^\mathrm{op} \times D^+(\A) \rightarrow D
(\Ab)$ extending the previously defined $\RHom: \A^{\mathrm{op}} \times D^+(\A)
\rightarrow D(\Ab)$, given by \[
\RHom(X, Y) := \Hom^\bullet(X, I),
\] for a given quasi-isomorphism $Y \qiso I$, where $I$ is a complex of
injectives. Moreover, for any $X, Y$, \[
H^i(\RHom(X, Y)) = \Hom_{D(\A)}(X, Y[i]).
\]
\end{prop}
\begin{proof}
We need to check that $\RHom$ is well-defined and functorial. Note that for any
$Y \xrightarrow[]{\text{$f$}} Z$ (in $C^+(\A)$) and injective resolutions $\alpha
: Y \qiso I$, $\Psi: Z \qiso J$, there exists a unique $f'$ in $K(\A)$ such that the
following diagram commutes in $K(\A)$ (not in $C(\A)$!).
\[
\begin{tikzcd}
Y \arrow{d}{\alpha} \arrow{r}{f}
& Z \arrow{d}{\Psi} \\
I \arrow[dotted]{r}{f'}
& J
\end{tikzcd}
\]
To see this, apply $\Hom_{K(\A)}(-, J)$ to the distinguished triangle \[
Y \xrightarrow[]{\text{$\alpha$}} I \rightarrow C(\alpha) \rightarrow Y[1].
\] Note that $C(\alpha)$ is acyclic, and we showed that $\Hom_{K^+(\A)}(M, N) =
0$ if $M$ is acyclic and $N$ is a complex of injectives. Thus we have a bijection \[
\Hom_{K(\A)}(I, J) \longiso \Hom_{K(\A)}(Y, J),
\] 

The desired $f' \colon I \to J$ is then the preimage of $\Psi \circ f$ under this isomorphism. By post-composition with $f'$ we get the map $\RHom(X, Y) \to \RHom(X, Z)$.

\begin{ex}
If you change $f'$ by something null-homotopic, then the induced map \[
\Hom^\bullet(X, I) \rightarrow \Hom^{\bullet}(X, J)
\] changes by something null-homotopic.
\end{ex}

Now we check that this extends the previous $\RHom : \A^\mathrm{op} \times D^+(\A) \rightarrow D
(\Ab)$. Previously, for $X \in \A, Y \in D^+(\A)$ and $\alpha: Y \qiso I$ an
injective resolution, we had $\RHom(X, Y)_{\mathrm{old}} = \Hom_\A(X, I^\bullet).$ On the other hand, the version just defined is 
\[
\RHom(X, Y)_{\mathrm{new}} = \Hom^\bullet(X, I),
\] which equals \[
\prod_{i \in \ints} \Hom(X^i, I^{i + n}) = \Hom(X, I^n),
\] in degree $n$. There is an obvious quasi-isomorphism between these two versions of $\RHom$.

Finally, we show that 
\begin{align}\label{critical}
H^0(\RHom(X, Y)) = \Hom_{D(\A)}(X, Y).
\end{align}
Let $\alpha: Y
\qiso I$ be an injective resolution. By definition, \[
H^0(\RHom(X, Y)) = H^0(\Hom^\bullet(X, I)) = \Hom_{K(\A)}(X, I) = \Hom_{D(\A)}
(X, I) \iso \Hom_{D(\A)}(X, Y),
\] where the second to last equality follows relies on $I$ being a complex of injectives (Lemma \ref{maptoinj}).

\end{proof}

\section{Sheaf Cohomology (notes by Michael Zhao)} Everything we discuss will have an analog in \'etale
topology, but we will work in the setting of classical topology where everything is more down-to-earth. Our main aim is to develop the formalism of the ``six operations'' between derived categories of sheaves on topological spaces. 

Let $X$ be a topological space. Let $R$ be a commutative ring. Let $\Sh_R(X)$ denote the category of sheaves of
$R$-modules. We may also leave $R$ implicit, and just write $\Sh(X)$. Let $D(X)
:= D(\Sh(X))$ denote the derived category of $\Sh(X)$, and likewise for its
bounded variants. We are interested in the induced maps on or between $D(X)$ by
maps of topological spaces.

\begin{exmpl}[Direct and Inverse Image]
Let $f: X \rightarrow Y$ be a map of topological spaces. Let $\mathcal{F} \in
\Sh(X)$. Define $f_* \mathcal{F} \in \Sh(Y)$ by $f_* \mathcal{F}(U) := \mathcal
{F}(f^{-1}(U))$. This provides a functor $f_* : \Sh(X) \rightarrow \Sh(Y)$.

Define, for $\mathcal{G} \in \Sh(Y)$, $f^{-1}\mathcal{G} \in \Sh(X)$ as the
sheafification of the presheaf \[
(f^{-1} \mathcal{G})^\# (V) = \lim_{U \supset
f(V)} \mathcal{G}(U).
\]
\end{exmpl}

\textbf{Reminder}. Sheafification and the forgetful functor which takes a sheaf
and returns the underlying presheaf are left and right adjoints, respectively.

\begin{lem}[Exercise]
$f^{-1}$ is left adjoint to $f_*$ for all $f: X \rightarrow Y$.
\end{lem}

Whenever we have $F$ right adjoint to $G$, there are natural transformations
\begin{align*}
\mathbbm{1} & \xrightarrow[]{\text{$\epsilon$}} F \circ G \\
G \circ F & \xrightarrow[]{\text{$\eta$}} \mathbbm{1},
\end{align*}
which are respectively called the unit and counit of the adjunction.

\begin{ex}
For $f^{-1}$ and $f_*$, write down $\epsilon, \eta$.
\end{ex}

\begin{lem}[Exercise]
\hfill
\begin{enumerate}[(1)]
\item All left-adjoints are right-exact.
\item All right-adjoints are left-exact.
\item $f^{-1}$ is exact.
\item $f_*$ preserves injectives, since it has an exact left-adjoint.
\end{enumerate}
\end{lem}

Since $f^{-1}$ is exact, we get an induced functor $f^{-1} : D(Y) \rightarrow D
(X)$ by the na\"ive definition. Since $f_*$ is left-exact and $\Sh(X)$ has enough
injectives, get $Rf_*: D^+(X) \rightarrow D^+(Y)$.

\begin{cor}
\hfill
\begin{enumerate}[(1)]
\item There exists an adjunction isomorphism $\RHom(f^{-1}K, L) \iso \RHom(K,
Rf_* L)$ for $K \in D^+(Y), L \in D^+(X)$.
\item Apply $H^0$ to (1) to get the adjunction \[
\Hom_{D^+(X)}(f^{-1}K, L) \iso \Hom_{D^+(Y)}(K, Rf_* L).
\] 
\end{enumerate}
\end{cor}
\begin{rmk}
This is the first adjoint pair of the six operations.
\end{rmk}
\begin{proof}
(2) comes from the formula (\ref{critical}) applied to part (1) of the corollary,
so we just need to show (1). Let $L \qiso I$ be an injective resolution. Then
$Rf_* L = f_* I$ and \[
\RHom(K, f_* I) = \Hom^\bullet(K, f_* I) = \Hom^\bullet(f^{-1} K, I) = \RHom(f^
{-1} K, I) = \RHom(f^{-1}K, L).
\]
\end{proof}

\subsection{Internal Hom} We can enrich these adjuctions using the \textbf
{internal hom} on $\Sh(X)$, which is a functor \[
\iHom: \Sh(X)^\mathrm{op} \times \Sh(X) \rightarrow \Sh(X),
\] given by \[
\iHom(\mathcal{F}, \mathcal{G})(U) = \Hom_{\Sh(U)}(\restr{\mathcal{F}}{U},
\restr{\mathcal{G}}{U}) \in \Ab.
\] (Check that $\iHom(\mathcal{F}, \mathcal{G}))$ is a sheaf.) Then $\iHom(\F,
-)$ is a left-exact functor $\Sh(X) \rightarrow \Sh(X)$, so we get its derived
functor \[
R\iHom(\F, -) : D^+(X) \rightarrow D^+(X).
\] As with our extension of $\RHom$ from $\A^\mathrm{op} \times D^+(\A)
\rightarrow D(\Ab)$ to $D(\A) \times D^+(\A) \rightarrow D(\Ab)$, we can extend
$R\iHom$ to a bifunctor $R\iHom : D(X)^\mathrm{op} \times D^+(X) \rightarrow D
(X)$. As before, define $\iHom^\bullet(K, L)$ by \[
\iHom^n(K, L) = \prod_{i \in \ints} \iHom(K^i, L^{i + n}),
\] and proceed as with $\RHom$.

\begin{thm}[Formula for Global Sections Derived Functor]
For all $K \in D^-(X)$, $L \in D^+(X)$, there are
natural isomorphisms \[
R\Gamma(R\iHom(K, L)) \longiso \RHom(K, L),
\]
where $R\Gamma : D^+(X) \rightarrow D^+(\Ab)$ is the derived functor of global
sections $\Gamma: \Sh(X) \rightarrow \Ab$ (alternatively, $R\Gamma = R\pi_*$ for
the terminal map $\pi : X \rightarrow *$).
\end{thm}

\begin{proof}
Let $L \qiso I$ be an injective resolution. Then $R\iHom(K, L) = \iHom^\bullet
(K, I)$. Note that this complex is bounded below. The terms of $\iHom^\bullet(K, I)$ need not be injective, but they still
belong to a class of sheaves adapted to $\Gamma$, namely the flasque sheaves.

\begin{defn}
$\F \in \Sh(X)$ is \textbf{flasque} or \textbf{flabby} if for all opens $U
\supset V$, $\F(U) \twoheadrightarrow \F(V)$.
\end{defn}

\begin{lem}\label{flasque}
\hfill
\begin{enumerate}[(1)]
\item The class of flasque sheaves is adapted to the left-exact functor $\Gamma$.
\item For any $\F$ and for an injective $I \in \Sh(X)$, $\iHom(\F, I)$ is
flasque.
\item Injective sheaves are flasque.
\end{enumerate}
\end{lem}
Granted this lemma, we then have \[
R\Gamma(R\iHom(K, L)) = \Gamma(X, \iHom^\bullet(K, I)) = \Hom^\bullet(K, I) =
\RHom(K, L).
\]
(Given the lemma, this is the spectral sequence for composite derived functors.)
\end{proof}

\begin{rmk}[On (1) of Lemma \ref{flasque}]
Need to know that
\begin{enumerate}[(a)]
\item Flasque sheaves are stable under direct sums.
\item Every sheaf injects into a flasque one: given $\F \in \Sh(X)$, form $J \in
\Sh(X)$ with $J(U) = \prod_{x \in U} \F_x$. Then $\F \xhookrightarrow{} J$ and
$J$ is flasque.
\item $\Gamma(X, N)$ is acyclic for $N \in C^+(\text{flasque sheaves})$. The main
point is to show that if there is the short exact sequence \[
0 \rightarrow \F \rightarrow \mathcal{G} \rightarrow \mathcal{H} \rightarrow 0
\] with $\F$ flasque, then $\mathcal{G}(X) \twoheadrightarrow \mathcal{H}(X)$.
\end{enumerate}
\end{rmk}
