# On kernels and stalks of sheaves.

Suppose we're given sheaves $$F,G$$ on a space $$X$$ and a morphism of sheaves (of abelian groups) $$\phi:F\to G$$.

I want to prove two things :

1. the presheaf $$\ker \phi$$, defined by $$(\ker\phi)(U):=\ker(\phi_U:FU\to GU)$$ is also a sheaf.
2. $$(\ker\phi)_p \simeq \ker(\phi_p)$$

I can do 1. by actually procing the axioms for a sheaf with the presheaf $$\ker \phi$$. But I know this should follow formally from the fact sheafification $$\tilde{\,}:Psh(X)\to Sh(X)$$ and the forgetful functor or inclusion $$i:Sh(X)\to Psh(X)$$ form a pair of adjoint functors, $$\tilde{}$$ being left adjoint to $$i$$. Because then $$i$$ preserves limits, and kernels are limits but the precise way to conclude here isn't clear, writing it down is a bit awkward. So $$\ker \phi$$ is the limit of $$F\rightrightarrows G$$ (taken in the category of presheaves?) where the arrows are given by $$\phi$$ and $$0$$. Saying $$i$$ commutes with limits, would mean $$i (\lim F\rightrightarrows G )\simeq \lim iF\rightrightarrows iG$$ but I don't know à priori that this limit is a sheaf, in fact this is what I want to prove so writing $$i(\lim...)$$ just doesn't make sense, this is I what I mean when I say the setup feels awkard.

I have a similar issue with 2. : writing down an actual map giving the isomorphism is ok, but I feel like this should formally follow from the fact that the functor $$_p$$ "stalk at $$p$$" is a filtered colimit and $$\ker$$ is a limit, these should commute. But I ran into similar issues, when writing it down.

Any help would be deeply appreciated.

For 1., there is indeed a general approach: given a category $$\mathcal{C}$$ and a (full) reflective subcategory $$\mathcal{D}$$ of it (i.e. the inclusion $$i\colon \mathcal{D}\to\mathcal{C}$$ is fully faithful and a right adjoint functor), it holds that $$\mathcal{D}$$ is complete if $$\mathcal{C}$$ is, and limits in $$\mathcal{D}$$ are computed in $$\mathcal{C}$$ (and will then automatically lie in $$\mathcal{D}$$). For a proof, see e.g. here. This shows that all presheaf limits of sheaves are actually sheaves and compute the sheaf limits.
You can argue the same with a bit less general nonsense, using that limits commute with limits. I will spell out this in extra detail, so I'm sorry if it is overly formal. We need to show that the presheaf kernel $$\mathrm{ker}\,\varphi$$ of $$\varphi\colon F\to G$$ satisifies the sheaf condition. The sheaf condition of a sheaf $$H$$ reads that $$H(U)\to \prod_{i\in I} H(U_i)\rightrightarrows\prod_{i,j\in I}H(U_i\times_U U_j)$$ is an equalizer diagram for any open cover $$U=\bigcup_{i\in I} U_i$$. Call this cover $$\mathcal{U}$$, and call the diagram $$\mathrm{D}_\mathcal{U}(H)$$, which is a functor $$\mathcal{I}\to\mathsf{Ab}$$, where $$\mathcal{I}$$ is the category $$0\to1\rightrightarrows2$$ The morphism $$\varphi$$ induces a natural transformation $$\varphi_*\colon\mathrm{D}_\mathcal{U}(F)\to\mathrm{D}_\mathcal{U}(G)$$ and we get even a diagram $$\mathrm{D}_\mathcal{U}(\mathrm{ker}\,\varphi)\to\mathrm{D}_\mathcal{U}(F)\rightrightarrows\mathrm{D}_\mathcal{U}(G)$$ where on the right the top arrow is $$\varphi_*$$ and the bottom arrow is the zero morphism. We can consider this latter diagram as a certain functor $$A\colon\mathcal{I}\times\mathcal{I}\to\mathsf{Ab}$$. Here, we consider for instance $$A(0,\bullet)$$ to be the diagram $$\mathrm{D}_\mathcal{U}(\mathrm{ker}\,\varphi)$$, so the first copy of $$\mathcal{I}$$ encodes the ''horizontal'' arrows in the diagram above, while the second copy of $$\mathcal{I}$$ encodes the sheaf condition diagrams hidden inside $$\mathrm{D}_\mathcal{U}(-)$$.
Let $$\mathcal{I}_{\geq 1}$$ be the category $$1\rightrightarrows 2,$$ and write $$A_j=\mathrm{lim}_{\mathcal{I}_{\geq 1}\times\{j\}} A_{\bullet,j}$$ for $$j\in \mathcal{I}_{\geq 1}$$ and $$_{j}{A}=\mathrm{lim}_{\{j\}\times\mathcal{I}_{\geq 1}} A_{j,\bullet}$$ for $$j\in \mathcal{I}_{\geq 1}$$. This defines two functors $$A_\bullet\colon\mathcal{I}_{\geq 1}\to\mathsf{Ab}$$ and $$_\bullet A\colon\mathcal{I}_{\geq 1}\to\mathsf{Ab}$$. To say that limits commute with limits is to say that $$\mathrm{lim}_{\mathcal{I}_{\geq 1}}\, A_\bullet\cong\mathrm{lim}_{\mathcal{I}_{\geq 1}}\, {_\bullet} A$$.
We know that $$_1 A\cong F(U)$$ and $$_2 A\cong G(U)$$ as $$F$$ and $$G$$ are sheaves, so $$\mathrm{lim}_{\mathcal{I}_{\geq 1}} {_\bullet} A\cong(\mathrm{ker}\,\varphi)(U)$$. We also know that $$A_j\cong A(0,j)$$ for $$j\geq 1$$ because kernels are, well, kernels. The statement that $$\mathrm{lim}_{\mathcal{I}_{\geq 1}} A_\bullet\cong\mathrm{lim}_{\mathcal{I}_{\geq 1}} {_\bullet} A\cong(\mathrm{ker}\,\varphi)(U)$$ is therefore exactly the statement that $$(\mathrm{ker}\,\varphi)(U)\to \prod_{i\in I} (\mathrm{ker}\,\varphi)(U_i)\rightrightarrows\prod_{i,j\in I}(\mathrm{ker}\,\varphi)(U_i\times_U U_j)$$ is an equalizer diagram, and this shows that $$\mathrm{ker}\,\varphi$$ is a sheaf.
The argument that $$(\mathrm{ker}\,\varphi)_p\cong (\mathrm{ker}\,\varphi_p)$$ is analogous, and we will be quicker about it. This time we write $$\mathcal{J}$$ for the category with opens around $$p$$ as objects, and maps $$U\to V$$ are inclusions. Given a presheaf of abelian groups $$H$$ on $$X$$, we have $$H_p=\mathrm{colim}_{U\in\mathcal{J}^\mathrm{op}} H(U)$$. Write $$\mathrm{C}_p(H)\colon\mathcal{J}^\mathrm{op}\to\mathsf{Ab}$$ for this diagram $$\mathcal{J}^\mathcal{op}\to\mathsf{Ab}, U\mapsto H(U)$$ that we take the colimit over, and recall our notation $$\mathcal{I}$$ from above. We have a diagram $$C_p(\mathrm{ker}\,\varphi)\to C_p(F)\rightrightarrows C_p(G)$$ where one of the right arrows is induced by $$\varphi$$ and the other is the zero map. Write $$A\colon\mathcal{I}\times\mathcal{J}^\mathrm{op}\to\mathsf{Ab}$$ for this latter diagram. That filtered colimits commute with finite limits gives us that $$(\mathrm{ker}\,\varphi)_p\cong\mathrm{colim}_{j\in\mathcal{J}^\mathrm{op}}\,(\mathrm{ker}\,\varphi)(j)\cong\mathrm{colim}_{j\in\mathcal{J}^\mathrm{op}}\,\mathrm{lim}_{i\in \mathcal{I}_{\geq 1}}\, A(i,j)\cong \mathrm{lim}_{i\in \mathcal{I}_{\geq 1}}\,\mathrm{colim}_{j\in\mathcal{J}^\mathrm{op}}\, A(i,j)\cong\mathrm{ker}(F_p\rightrightarrows G_p)\cong \mathrm{ker}\,\varphi_p,$$ and this finishes the proof.