%! TeX root: ./main.tex

\begin{Lemma} \label{lem:subdiag-colim}
  Let $A\colon I \to \cC$ be a diagram in a category $\cC$,
  and let $B\colon J \to \cC$ be another diagram factoring through $A$.
  \[
    \begin{tikzcd}
      I \ar[r, "A"] & \cC \\
      J \ar[u, "\alpha"] \ar[ru, "B"'] 
    \end{tikzcd}
  \]
  Then the factoring $\alpha$ induces a map on the colimits, if they exist.
  \[
    \colim_{j \in J} B(j) \longrightarrow \colim_{i \in I} A(i) 
  \]
\end{Lemma}
\begin{proof}
  Consider any co-cone $Z \in C$ over $A$ in $\cC$.
  We can write such a co-cone as a natural transformation
  $\eta$ from $A$ to the composition $I \to * \to \cC$,
  where $*$ is the discrete single object category,
  $* \to \cC$ selects the object $Z$,
  and $I \to *$ of course takes all objects to the single object.
  \[
    \begin{tikzcd}
      * \ar[rd, "Z"] \\
      I \ar[u] \ar[r, "A"'] & \cC
    \end{tikzcd}
  \]
  Note that the components of such a transformation are $\func{\eta_i}{A(i)}{Z}$,
  satisfying, for each $i \to j$ in $I$,
  \[
    \begin{tikzcd}
      A(i) \ar[r, "\eta_i"] \ar[d] & Z \ar[d, equals] \\
      A(j) \ar[r, "\eta_j"] & Z
    \end{tikzcd}
  \]
  This is precisely the definition of a co-cone.
  However, we can then take the composition $\nu = \eta * id_{\alpha}$,
  which naturally describes $Z$ as a co-cone over $B$.
  \[
    \begin{tikzcd}
      & * \ar[rd, "Z"] \\
      J \ar[r, "\alpha"'] \ar[ru] & I \ar[u] \ar[r, "A"'] & \cC
    \end{tikzcd}
  \]
  Thus, if $Z$ is any co-cone over $A$,
  and the colimit over $B$ exists,
  then there is a unique map from said colimit to $Z$ by universality.

  Taking $Z$ to be the co-cone over $A$ proves the lemma.
\end{proof}
\begin{Lemma} \label{lem:colim-composition}
  Let $A, B: I \to \cC$ be two diagrams in a category $\cC$,
  and let $\eta \colon A \implies B$ be a natural transformation between them.
  Then $\eta$ induces a map on the colimits, if they exist.
  \[
    \colim_{i \in I} B(i) \longrightarrow \colim_{i \in I} A(i) 
  \]
\end{Lemma}
\begin{proof}
  Let $Z$ be any co-cone over the diagram $B$,
  written as a natural transformation as in the previous lemma.
  \[
    \begin{tikzcd}[row sep=large]
      & * \ar[rd, "Z"] \\
      I \ar[ru]
      \ar[rr, bend left, "A"{anchor=center, fill=white, name=A}]
      \ar[rr, bend right, "B"'{name=B}]
      \ar[from=B.north-|A, shorten=4pt, to=A, Rightarrow, "\eta"]
      \ar[from=A, ur, Rightarrow, shorten=2pt, "\varepsilon"]
      & & C\\
    \end{tikzcd}
  \]
  The composition $\varepsilon \circ \eta$ then describes $Z$
  as a co-cone over the diagram $B$.
  If we choose $Z$ to be the colimit over $A$,
  and assume the colimit of $B$ also exists,
  then we get the map desired by the lemma.
\end{proof}

\begin{qanda}
  \question
    Let $\cO_X$ be the pre-sheaf of smooth real-valued functions on $X = \bR^n$.
    For any $p \in \bR^n$,
    show that $\cO_p$, defined as a ring of germs of smooth functions,
    is a local ring with maximal ideal $\fkm_p$,
    the ideal of germs vanishing at $p$.
  \answer
    Let $\sigma \in \cO_p$ be some germ over $p$,
    represented by a smooth function $\func{f}{U}{\bR}$ with $U \ni p$ open,
    and $f$ not vanishing at $p$.
    (Henceforth we will denote this by $\sigma = [f]_p$.)

    Then since $f$ is smooth and non-vanishing at $p$,
    there is some open nbd $V \subseteq U$ of $p$ supporting $f$.
    Note that $[f|_V]_p = [f]_p$, by definition of germ equivalence.
    Thus, we can define $g \in \cO_V$ by $g(x) = f^{-1}(x)$,
    and this is well defined.

    Finally, consider the germ $[g]_p \in \cO_p$.
    Since $g \cdot f|_V = 1$, we have $[f]_p \cdot [g]_p = 1 \in \cO_p$.

    Thus every germ over $p$ that does not vanish at $p$ is invertible,
    and $\fkm_p$ is the unique maximal ideal as desired.

  % Question 2.2.A
  \question
    Let $(X, \cTop_X)$ be a topological space,
    with $\cTop_X$ considered as the poset category of open sets of $X$.
    Show that a presheaf of sets over $X$ is precisely a contravariant functor
    from $\cTop_X$ to $\Set$
  \answer
    The data of a functor $\func{\cF}{\cTop_X^{op}}{\Set}$
    is a set $\cF(U)$ associated to each open set $U \in \cTop_X$,
    and a function $\cF_{V,U}\colon \cF(V) \to \cF(U)$
    for each inclusion $U \subseteq V$.
    This is precisely the same data as a pre-sheaf $\cF$ of sets over $(X, \cTop_X)$.

    For this data to form a functor is to require the identity $U \subseteq U$
    to map to the identity function,
    and to require the composition $U \subseteq V \subseteq W$
    to map to $\cF_{W, U} = \cF{V, U} \circ \cF{W, V}$.
    Again, these are precisely the same conditions required for $\cF$ to form a presheaf.

  % Question 2.2.B
  \question 
    Show that the following are pre-sheaves on $\cC$, but not sheaves.
    \begin{enumerate}
      \item Bounded functions.
      \item Holomorphic functions admitting a holomorphic square root.
    \end{enumerate}
  \answer
    \begin{enumerate}
      \item Define $\cF\colon \cTop_\bC^{op} \to \Set$ by sending each complex open set 
        $U \subseteq \cC$ to the set of bounded functions on $U$.
        The restriction maps $\cF_{V,U}\colon \cF(V) \to \cF(U)$ are true restrictions
        $f \mapsto f|_U$.
        Function restriction respects composition, i.e. $\big(f|_V\big)|_U = f|_U$,
        hence $\cF$ defined in this way is a functor, and thus a pre-sheaf.

        To see that it is not a sheaf,
        note that an unbounded function may be bounded over every set in some open cover.
        (Perhaps bounded functions never form a sheaf on a non-compact space?)

        For example, the norm function over $\cC$ is bounded on restriction to any open cover
        of $\bC$ by bounded opens, but is not bounded over all of $\cC$.
      \item Now define $\cF\colon \cTop_\bC^{op} \to \Set$
        by sending each complex open $U$ to
        the set of holomorphic functions with holomorphic square root.
        Again, send each inclusion $U \subseteq V$ to the true restriction map.
        Since being holomorphic is a local property, it is preserved by restriction to
        open subsets, and thus this is well-defined.
        (Also note that the restriction of a square root will be a square root for the restriction.)

        However, we may consider the identity map $z \mapsto z$.
        This does not have a holomorphic square root (or even a continuous square root),
        however, over any open set that does not contain a chosen ray from the origin,
        the restriction of $z$ has a square root (a chosen branch cut).
        Thus, we can cover $\cC$ with open sets where the restriction of $z$
        has a homolorphic square root, but we cannot glue those sections together.

        Thus, this does not form a sheaf over $\cC$.
    \end{enumerate}
  
  % Question 2.2.C
  \question
    Interpret the identity and gluing axioms of a sheaf $\cF$
    as saying that $\cF(\cup_{i \in I} U_i)$ is a certain limit.
  \answer
    Consider a sheaf of sets $\cF$ over some space $X$.
    Let $U$ be open in $X$, with some open cover $\{U_i\}_{i \in I}$
    for some indexing set $I$.

    Then, consider the power set $\cP(I)$ as a poset category by inclusion,
    with $J \to J'$ when $J \subseteq J'$.
    Consider the diagram of sets $D_i\colon \cP(I) \to \Set$
    sending each subset of indices $J$ to $\cF\big(\bigcap_{j \in J} U_j\big)$,
    and each inclusion $J \to J'$ to the restriction map.
    \[
      \begin{tikzcd}
        J \ar[d] & \cF\big(\bigcap_{j \in J} U_j\big) \ar[d] \\
        J' & \cF\big(\bigcap_{j \in J'} U_j \big)
      \end{tikzcd}
    \]
    The bottom of this diagram then looks like
    \[
      \begin{tikzcd}
        \cF(U_i) \ar[rd] & & \cF(U_j) \ar[ld] \ar[rd] & & \cF(U_k) \ar[ld] \\
                         & \cF(U_i \cap U_j) \ar[rd] & & \cF(U_j \cap U_k) \ar[ld] \\
                         & & \cF(U_i \cap U_j \cap U_k) & &
      \end{tikzcd}
    \]
    We claim that $\cF(U)$ is the limit in $\Set$ over this diagram.

    The cone is given by the restriction maps $\cF(U) \to \cF(U_J)$ for each $J \subseteq I$.
    By the definition of a pre-sheaf, these commute with the diagram functions,
    which are all also restriction maps.

    To see that this is the universal cone, consider another cone $\phi_i\colon Z \to \cF(U_i)$.
    \[
      \begin{tikzcd}
        & & \color{orange} Z \ar[lldd, orange] \ar[dd, bend right, orange] \ar[rrdd, orange] \\
        & & \cF(U) \ar[lld] \ar[d] \ar[rrd] & & \\
        \cF(U_i) \ar[rd] & & \cF(U_j) \ar[ld] \ar[rd] & & \cF(U_k) \ar[ld] \\
                         & \cF(U_i \cap U_j) & & \cF(U_j \cap U_k)
      \end{tikzcd}
    \]
    For each $z \in Z$, denote $z_i = \phi_i(z)$.
    Then since these sections agree on restriction, $z_i |_{U_i \cap U_j} = z_j |_{U_i \cap U_j}$
    for each $i, j \in I$,
    gluing induces some section $\phi(z) \in \cF(U)$ such that for all $i \in I$, $\phi(z)|_{U_i} = z_i$.

    Define $\phi\colon Z \to \cF(U)$ by $z \mapsto \phi(z)$ as so.
    Finally, an application of identity shows that this is unique,
    since if $\varphi\colon Z \to \cF(U)$ is any other map commuting with the restriction maps,
    then $\varphi(z)|_{U_i} = \phi(z)|_{U_i}$ for all $i \in I$, and hence $\varphi = \phi$.

  % Exercise 2.2.D
  \question
    \begin{enumerate}
      \item Verify that smooth functions, continuous functions, real-analytic functions,
        and real-valued functions on a manifold or on $\bR^n$ form a shead.
      \item Show that real-valued continuous functions on open sets of a topological space
        form a sheaf.
    \end{enumerate}
  \answer
    ...
    Seems boring.

    Yeah, the pre-sheaves are given by the states sets.
    Restriction is given by true restriction.
    All of the properties are local in the sense that they both
    respect restriction, and may be determined by checking them on any cover.
    Real functions always glue together uniquely from their restrictions
    since they are determined pointwise.

  % Exercise 2.2.E
  \question
    Let $S$ be any set, and
    let $\cF(U)$ be the set of maps $U \to S$ which are locally constant.
    Show this is a sheaf.

    Equivalently, let $\cF(U)$ be the maps $U \to S$ which are continuous
    when $S$ is endowed with the discrete topology
    so that every subset is continuous.
  \answer
    We take the following definition of locally constant.
    \[
      \cF(U) = \{\func{f}{U}{S} \mid \forall p \in S, f^{-1}(p) \in \cTop_X \}
    \]
    Since this assigns to each open set a family of functions on it,
    with the restriction maps being the standard restriction maps of functions,
    the pre-sheaf structure and identity are both trivial.

    To observe identity, consider some cover $U_i \hookrightarrow U$,
    then take sections $f, g \colon U \to S$ such that $f_i = g_i$ for all $i \in I$
    (where $f_i \ceq f|_{U_i}$ and $g_i \ceq g|_{U_i}$).
    Then for any $x \in U$, $x \in U_i$ for some $i$, and $f(x) = f_i(x) = g_i(x) = g(x)$.

    To show gluing, take some family $f_i \in \cF(U_i)$ such that
    they agree on intersections, that is,
    \[
      \cndall i, j \in I, f_i|_{U_i \cap U_j} = f_j|_{U_i \cap U_j}.
    \]
    Since these are functions on $U_i$ which agree on intersections, they glue together
    into a function on $U$.
    \[
      f\colon U \to S, \qquad x \mapsto f_i(x) \qqtext{where} x \in U_i.
    \]
    It remains to show that this is locally constant.
    Take any $p \in S$.
    Then 
    \begin{align*}
      f^{-1}(p) &= \{x \in U \mid f(x) = p\} \\
                &= \{x \in U \mid \forall i \in I, p \in U_i \implies f_i(x) = p\} \\
                &= \bigcup_{i \in I} f_i^{-1}(p)
    \end{align*}
    Which is a union of open sets since each $f_i$ is locally constant.
    Thus, $f$ is locally constant, and the compatible $f_i$ sections glue together.

    Thus, the locally constant functions form a sheaf.

  % Exercise 2.2.F
  \question
    Let $X, Y$ be any topological spaces.
    Show that continuous maps to $Y$ forms a sheaf of sets on $X$.
  \answer
    Again, the pre-sheaf structure is immediate
    because we are assigning to each $U$, a family of functions on $U$,
    with the standard restriction maps.

    Identity is also immediate, by the same reason as the previous exercise.

    Gluing is almost immediate since continuity is determined locally.
    Let $U_i \hookrightarrow U$ be an open cover of some open $U \subseteq X$.
    Then let $f_i \in \cF(U_i)$ be continuous functions to $Y$ agreeing on intersections
    in the usual way.
    Define $f\colon U \to Y$ as in the previous question,
    with $f(x) = f_i(x)$ for $i \in I$ such that $x \in U_i$.
    Well defined since the functions agree on intersections.

    Then $f$ is continuous since for each $x \in U$, it has a neighbourhood $U_i$
    where it is continuous.
    Explicitly, if $V \subseteq Y$ is open, then
    $f^{-1}(V) = \bigcup_{i \in I} f_i^{-1}(V)$
    which is open by assumption.

  % Exercise 2.2.G
  \question
    Let $X, Y$ be topological spaces.
    \begin{enumerate}
      \item Let $\mu\colon Y \to X$ be continuous.
        Show that section of $\mu$ form a sheaf.
        Explicitly, to each $U$ open in $X$,
        assign the family of continuous maps $\func{s}{U}{Y}$
        such that the following commutes.
        \[
          \begin{tikzcd}
            U \ar[r, "s"] \ar[rr, bend right, "id|_U"'] & Y \ar[r, "\mu"] & X
          \end{tikzcd}
        \]
      \item If $Y$ additionally has the structure of a topological group,
        show that the continuous maps to $Y$ form a sheaf of groups.
    \end{enumerate}
  \answer
  \begin{enumerate}
    \item We first confirm that restriction is well defined.
      Take some section $s\colon U \to Y$, and some open subset $U' \hookrightarrow U$.
      Then $s|_{U'}$ is defined by precomposing $s$ with the inclusion.
        \[
          \begin{tikzcd}
            U \ar[r, "s"] \ar[rr, bend left, "id|_U"] & Y \ar[r, "\mu"] & X \\
            U' \ar[u] \ar[ru, "s|_{U'}"']
          \end{tikzcd}
        \]
      Thus $\mu \circ s|_{U'} = (id|_U)|_{U'} = id|_{U'}$.
      This shows that restriction of sections of $\mu$ is well defined,
      and thus sections of $\mu$ do form a pre-sheaf.

      Identity is as usual trivial since we are working with functions, determined pointwise.

      For gluing, take a family $s_i\colon U_i \to Y$ which agree on intersections,
      and then define $\func{s}{U}{Y}$ to be the unique function
      agreeing with the $s_i$ on restriction. Then we have
      \[
        \begin{tikzcd}[row sep = small]
          & U_i \cap U_j \ar[ld] \ar[rd] & \\
          U_i \ar[dd, "s_i"'] \ar[rd] & & U_j \ar[ld] \ar[dd, "s_j"] \\
                              & U \ar[ld, "s"] \ar[rd, "s"'] & \\
          Y \ar[d, "\mu"'] & & Y \ar[d, "\mu"] \\
          X \ar[rr, equal] & & X
        \end{tikzcd}
      \]
      It remains to show that $s$ is a section.
      Take any $x \in U$, then $x \in U_i$ for some $i \in I$,
      and $\mu \circ s (x) = \mu \circ s_i (x) = x$.
      Thus, yes, the compatible $s_i$ glue together into a section $s$,
      and we have shown that sections of $\mu$ form a sheaf
    \item Now assume that $Y$ is a topological group.
      That is, that it has a continuous multiplication operation $\func{\times}{Y \times Y}{Y}$,
      and the inverse $\func{(-)^{-1}}{Y}{Y}$ is also continuous.
      We have already shown that continuous maps to $Y$ form a group.
      It remains to show that the sets of sections form a group structure,
      and that restriction is a group homomorphism.

      To see the first, take two sections $f,g \colon U \to Y$.
      Since these are continuous maps, there is an induced map $(f, g) \colon U \to Y \times Y$.
      We may then post-compose this with multiplication to get $f\times g \colon U \to Y \times Y \to Y$.
      \[
        \begin{tikzcd}
          & & Y \\
          U \ar[rru, bend left, "f"] \ar[rrd, bend right,  "g"] \ar[r, dashed, "{(f, g)}"] & Y \times Y \ar[ru] \ar[rd] \ar[rr, "\times"] & & Y \\
                                     & & Y
        \end{tikzcd}
      \]
      Similarly, we may define an inverse function (under this operation) as
      \[
        \begin{tikzcd}
          U \ar[r, "f"] \ar[rr, bend right, "\bar{f}"'] & Y \ar[r, "(-)^{-1}"] & Y\\
        \end{tikzcd}
      \]
      Of course, these are just applying the operation and inverse point-wise,
      but these constructions make it clear that $f \times g$ and $\bar{f}$ are well-defined
      continuous maps.

      To see that restriction is a group homomorphism, note that it is the same as precomposing the first diagram above with the relevant inclusion.
      \[
        \begin{tikzcd}
          & & & Y \\
          U' \ar[r] \ar[rrru, bend left, "f|_{U'}"] \ar[rrrd, bend right, "g|_{U'}"']
          & U \ar[rru, bend left, "f"'] \ar[rrd, bend right,  "g"] \ar[r, dashed, "{(f, g)}"]
          & Y \times Y \ar[ru] \ar[rd] \ar[rr, "\times"] & & Y \\
          &                            & & Y
        \end{tikzcd}
      \]
      By universal property of the product, we have $(f, g)|_{U'} = (f|_{U'}, g|_{U'})$,
      and thus $f|_{U'} \times g|_{U'} = (f \times g)|_{U'}$.

      Thus $\Hom(-, Y)$ forms a sheaf of groups on $X$ as desired.
  \end{enumerate}

  % Question 2.2.H
  \question
    Let $\func{\pi}{X}{Y}$ be a continuous map.
    Assume $\cF$ is a pre-sheaf on $X$.
    Then define a new pre-sheaf $\pi_*\cF$ on $Y$,
    called the pushforward of $\cF$ by $\pi$,
    by $\pi_*\cF(V) = \cF(\pi^{-1}(V))$, for open $V$ in $Y$.

    Show that $\pi_* \cF$ is a pre-sheaf,
    and show it is a sheaf when $\cF$ is.
  \answer
    Note that since $\pi$ is a continuous map,
    $\pi^{-1}$ defines an inclusion preserving map from open sets of $Y$ to open sets of $X$.
    That is, $\pi^{-1}$ is a functor $\cTop_Y \to \cTop_X$.
    $\pi_*\cF$ is precisely the composition of $\cF$ with (the dual of) this functor.
    \[
      \begin{tikzcd}
        \cTop_Y^{op} \ar[r, "\pi^{-1}_{op}"] \ar[rr, bend right, "\pi_*\cF"'] & \cTop_X^{op} \ar[r, "\cF"] &  \Set
      \end{tikzcd}
    \]
    Thus, by the contravariant functor description, $\pi_*\cF$ is a pre-sheaf.

    Now, assume that $\cF$ is furthermore a sheaf.
    We shall show that $\pi_*\cF$ is also a sheaf.
    Take some open $V$ in $Y$, and some cover $V_i \hookrightarrow V$ as usual.
    
    To show identity, take $f, g \in \pi_*\cF(V) = \cF(\pi^{-1}(V))$,
    such that 
    \[
      (\pi_*\cF)_{V, V_i}(f) = \cF_{\pi^{-1}(V), \pi^{-1}(V_i)}(f)
      = \cF_{\pi^{-1}(V), \pi^{-1}(V_i)}(g)
      = (\pi_*\cF)_{V, V_i}(g) .
    \]
    Then by identity of $\cF$, we have $f = g$ as sections over $\pi^{-1}(V)$,
    and then hence as sections over $V$.

    To show gluing, take $f_i \in \cF(\pi^{-1}(V_i))$,
    agreeing when restricted to $V_i \cap V_j$. That is,
    \[
      \cF_{\pi^{-1}(V_i), \pi^{-1}(V_i \cap V_j)}(f_i)
      = (\pi_*\cF)_{V_i, V_i \cap V_j}(f_i) 
      = (\pi_*\cF)_{V_i, V_i \cap V_j}(g_i) 
      = \cF_{\pi^{-1}(V_i), \pi^{-1}(V_i \cap V_j)}(f_i).
    \]
    Noting that since $\{V_i\}$ is a cover of $V$,
    then $\{\pi^{-1}(V_i)\}$ is a cover of $\pi^{-1}(V)$,
    and $\pi^{-1}(V_i \cap V_j) = \pi^{-1}(V_i) \cap \pi^{-1}(V_j)$,
    then gluing in $\cF$ yields a section $f \in \cF(\pi^{-1}(V)) = \pi_*\cF(V)$.

    This, if $\cF$ is a sheaf on $X$,
    then the pushforward of $\cF$ over any continuous map $X \to Y$
    is also a sheaf on $Y$, as desired.

  % Question 2.2.I
  \question
    Let $\func{\pi}{X}{Y}$ be a continuous map of spaces,
    and $\cF$ be a sheaf on $X$.
    if $\pi(p) = q$ for some $p \in X$,
    describe the natural morphism $(\pi_*\cF)_q \to \cF_p$.
  \answer
    We first define the map explicitly.
    Take some germ $[f]_q$ in $(\pi_*\cF)_q$,
    with $f \in (\pi_*\cF)(V)$ a section over some open $V \ni q$.
    Then by the definition of the sections in the pushforward sheaf,
    $f \in (\pi_*\cF)(V) = \cF(\pi^{-1}(V))$,
    thus $f$ is also an element of the set of sections of $\cF$ over the open nbd
    $\pi^{-1}(V)$ of $p$. Thus, we can define
    $[f]_p \in \cF_p$, the germ of $f$ over $p$.
    The induced map on stalks may then be expressed simply as $[f]_q \mapsto [f]_p$.

    Alternatively, we can induce the map using the universal property of the stalks.
    \[
      \begin{tikzcd}
        \cTop_{Y}^{op}|_{q} \ar[r, "\pi^{-1}_q"] \ar[d] & \cTop_{X}^{op}|_{p} \ar[d] \\
        \cTop_{Y}^{op} \ar[r, "\pi^{-1}"] & \cTop_{X}^{op} \ar[r, "\cF"] & \Set
      \end{tikzcd}
    \]
    Here $\cTop_Y^{op}|_q$ denotes the full subcategory of $\cTop_Y^{op}$
    consisting of open sets containing $q$, and analagously for $\cTop_X^{op}|_p$.

    The stalk $\cF_p$ is then the colimit over the diagram
    $\cTop^{op}_X|_p \to \cTop^{op}_X \to \Set$,
    and the stalk $(\pi_*\cF)_q$ is the colimit over the diagram
    $\cTop_Y^{op}|_q \to \cTop_Y^{op} \to \cTop_X^{op} \to \Set$.

    Lemma \ref{lem:subdiag-colim} then induces the desired map by universal property of colimit.

  % Question 2.2.J
  \question
    If $(X, \cO_X)$ is a ringed space,
    and $\cF$ is an $\cO_X$-module, describe how for each $p \in X$,
    $\cF_p$ is an $\cO_{X, p}$-module.
  \answer
    We shall describe the action explicitly.
    Let $p \in X$, and consider $\cF_p$.
    We already know this retains the structure of an abelian group,
    since the category of abelian groups has colimits.
    To define the action of $\cO_{X, p}$,
    let $[f]_p \in \cO_{X, p}$ and $[a]_p \in \cF_p$
    where $f$ and $a$ are sections of their respective sheaves
    over some shared neighbourhood $U \ni p$ (restricting if necessary).

    Then define $[f]_p \cdot [a]_p$ to be $[f\cdot a]_p$
    using the action of $\cO_X(U)$ on $\cF(U)$.
    To see that this is well defined, let $[f]_p = [f']_p$ and $[a]_p = [a']_p$
    where $f', a'$ are defined over another neighbourhood $V$ of $p$.

    Since they determine the same germ, there are some $W_1, W_2$ around $p$
    where $f|_{W_1} = f'|_{W_2}$ and $a|_{W_1} = a'_{W_2}$.
    Defining $W = W_1 \cap W_2$, we can finally put everything into the same neighbourhood,
    so that $f|_W = f'|_W$ and $a|_W = a'|_W$.

    Then the compatibility condition for the $\cO_X$-module $\cF$ says that
    $(f \cdot a)|_W = f|_W \cdot a|_W = f'_W \cdot a'|_W = (f' \cdot a')|_W$.
    Thus $[f \cdot a]_p = [f'\cdot a']_p$, and this definition of action on stalks
    is well defined.

    Finally, note that all the axioms of module action may be determined with 
    a finite number of elements, and we may thus check them
    by taking representatives on some shared neighbourhood of $p$,
    where the axioms hold by the definition of an $\cO_X$-module.

  % Question 2.3.A
  \question
    Let $\phi\colon \cF \to \cG$ be a morphism of pre-sheaves on $X$,
    and let $p \in X$.
    Then describe the induced morphism of stalks $\phi_p\colon \cF_p \to \cG_p$.

    This defines the \emph{stalkification functor at $p$}
    $\Sets_X \to \Sets$, where $\Sets_X$ is the category of
    sheaves of sets over $X$.
  \answer
    This follows immediately from Lemma \ref{lem:colim-composition},
    since $\phi$ induces a natural transformation between the stalk diagrams
    for $\cF_p$ and $\cG_p$.

  % Question 2.3.B
  \question
    Let $\pi\colon X \to Y$ be a continuous map of topological spaces.
    Show that the pushforward induces a functor
    $\pi_*\colon \Sets_X \to \Sets_Y$.
  \answer
  Recall that $\pi_*\cF$ is pre-composition with $\pi^{-1}_{op}$.
  Then we can describe the desired functor as
  \[
    \begin{tikzcd}
      \cF \ar[d, Rightarrow, "\eta"] \ar[r, mapsto] &
      \pi_*\cF = \cF \circ \pi^{-1}_{op} \ar[d, Rightarrow, "\eta \circ id_{\pi^{-1}_{op}}"] \\
      \cG \ar[r, mapsto] & \pi_*\cG = \cG \circ \pi^{-1}_{op}
    \end{tikzcd}
  \]
  That is, on objects it acts as pre-composition by $\pi^{-1}_{op}$,
  and on morphisms it acts as pre-composition by (the natural transformation) $id_{\pi^{-1}_{op}}$

  % Question 2.3.C
  \question
    Let $\cF$ and $\cG$ be two sheaves over $X$.
    Define a pre-sheaf of sets $\cHom(\cF, \cG)$
    by lettings the set of sections over each open $U$ be
    \[
      \cHom(\cF, \cG)(U) \ceq \Mor(\cF|_U, \cG|_U).
    \]
    Show that this is a sheaf of set on $X$.
  \answer
    We first observe that for any $U$ open in $X$,
    the sections of $\cHom(\cF, \cG)$ over $U$ are defined to be the set 
    of natural transformations $\eta$ in the diagram below.
    The restriction of a section $\eta$ to some open $V \subseteq U$
    is then a composition of $\eta$ with the (identity transformation on the) inclusion
    of $\cTop_V^{op} \to \cTop_U^{op}$
    \[
      \begin{tikzcd}
        & & \cTop_X^{op} \ar[rd, "\cF"] & \\
        \cTop_V^{op} \ar[r] & \cTop_U^{op} \ar[ru] \ar[rd] & & \Set \\
        &  & \cTop_X^{op} \ar[ru, "\cG"'] \ar[uu, Rightarrow, shorten=5pt, "\eta"] & 
      \end{tikzcd}
    \]
    Pre-composition is functorial,
    and so $\cHom(\cF, \cG)$ does form a presheaf of sets.

    Next, we need to show that it is also a sheaf.
    We first consider identity, in the usual way.
    Let $U$ be open in $X$, and take an open cover $U = \bigcup_{i \in I} U_i$.
    Let $\eta, \varepsilon\colon \cF|_U \Rightarrow \cG_U$,
    such that $\eta|_{U_i} = \varepsilon|_{U_i}$ for all $i \in I$.
    We claim that $\eta = \varepsilon$.
    To see this, take any open $V \subseteq U$,
    and define the cover $V_i = V \cap U_i$ of $V$. Then:
    \[
      \eta_{V_i} = (\eta|_{U_i})_{V_i} = (\varepsilon|_{U_i})_{V_i} = \varepsilon_{V_i}.
    \]
    We have the following diagram.
    \[
      \begin{tikzcd}
        \cF|_U(V) \ar[r, "\eta_V"] \ar[d] & \cG|_U(V) \ar[d] \\
        \cF|_U(V_i) \ar[r, "\eta_{V_i}", "\varepsilon_{V_i}"'] & \cG|_U(V_i) \\
        \cF|_U(V) \ar[u] \ar[r, "\varepsilon_{V}"] & \cG|_U(V) \ar[u]
      \end{tikzcd}
    \]
    Here the vertical maps are restriction maps, and both squares commute.
    Chasing any section $f \in \cF|_U(V)$, we see that
    \[
      (\eta_V(f))|_{V_i} = \eta_{V_i}(f|_{V_i}) = \varepsilon_{V_i}(f|_{V_i}) = (\varepsilon_V(f))|_{V_i}.
    \]
    Since $V_i$ forms a cover of $V$, identity in the sheaf $\cG$ then tells us $\eta_V = \varepsilon_V$.
    Since $V$ was arbitrary, this means that $\eta = \varepsilon$ as desired.

    Finally, we demonstrate gluing.
    Let $U_i$ form a cover of $U$ as above,
    and let $\eta^i\colon \cF|_{U_i} \Rightarrow \cG|_{U_i}$ in $\cHom(\cF, \cG)(U_i)$,
    such that they agree when restricted to intersections, that is,
    \[
      \forall W \subseteq U_i \cap U_j, \qquad 
      \eta^i_W = \big(\eta^i|_{U_i \cap U_j}\big)_W = \big(\eta^j|_{U_i \cap U_j}\big)_W
      = \eta^j_W.
    \]
    Take any $V$ open in $U$, and as before define the cover $V_i = V \cap U_i$ of $V$.
    We define a gluing $\eta\colon \cF|_U \Rightarrow \cG|_U$
    by defining it on the arbitrary component $V$.
    \[
      \begin{tikzcd}
        \cF(V) \ar[r, dashed, "\eta_V"] \ar[d] & \cG(V) \ar[d] \\
        \cF(V_i) \ar[r, "\eta^i_{V_i}"] \ar[d] & \cG(V_i) \ar[d] \\
        \cF(V_i \cap V_j) \ar[r, "\eta^i_{V_i \cap V_j}", "\eta^j_{V_i \cap V_j}"'] & \cG(V_i \cap V_j)
      \end{tikzcd}
    \]
    Taking any section $f \in \cF(V) = \cF|_{U}(V)$,
    define $g_i = \eta^i_{V_i}(f|_{V_i}) \in \cG(V_i)$.
    Then
    \[
      g_i|_{V_i \cap V_j} = 
      \eta^i_{V_i}(f|_{V_i}) |_{V_i \cap V_j} 
      = \eta^i_{V_i \cap V_j}(f|_{V_i \cap V_j}) 
      = \eta^j_{V_i \cap V_j}(f|_{V_i \cap V_j})
      = \eta^j_{V_j}(f|_{V_j}) | _{V_i \cap V_j}
      = g_j |_{V_i \cap V_j}.
    \]
    Thus $\{g_i\}_{i\in I}$ is a family of sections of $\cG$ over $V_i$
    which agree upon restriction to intersections.
    Since $\cG$ was assumed a sheaf, it satisfies gluing,
    and there is thus some $g \in \cG(V)$ such that $g|_{V_i} = g_i$.

    We define $\eta_V(f) = g$.

    Thus, $\cHom(\cF, \cG)$ is a presheaf satisfying both identity and gluing, and is thus a sheaf,
    as desired.




\end{qanda}
