Measuring a presheaf's failure to be a sheaf?

This answer is inspired by the Embedding Calculus (aka Manifold Calculus) of Weiss and Goodwillie. This is a framework for studying certain presheaves on manifolds. The idea is that sheafification of a presheaf is analogous to the linearization of a function. From this point of view, sheafification is just the first in a sequence of approximation - for each $n$ there is the universal approximation of degree $n$. What I am doing below is describe the difference between the quadratic and the linear approximation, which one may think of as the principal part of the difference between a presheaf and its sheafification. I am not sure if this approach is useful in the context of algebraic geometry, or for the applications that you have in mind. But let me put it out here, FWIIW.

Let ${\mathcal F}$ be a presheaf on $X$. Suppose $x$ and $y$ are two points in $X$ that can be separated by disjoint open sets. Let us define the "bi-stalk" of $\mathcal F$ at $(x,y)$ as ${\mathcal F}_{(x,y)}=$colim$_{U,V} \mathcal F(U\cup V)$, where $(U, V)$ range over pairs of disjoint neighborhoods of $x$ and $y$. There is a natural homomorphism from the bi-stalk to the product of stalks ${\mathcal F}_{(x,y)}\to {\mathcal F}_{x}\times {\mathcal F}_{y}$. If $\mathcal F$ is a sheaf then this homomorphism is an isomorphism. So you have a homomorphism for each such pair that measures the failure of $\mathcal F$ to be a sheaf.

Here is a perhaps slightly more sophisticated version of this idea. We can use $\mathcal F$ to define some new presheaves on $X\times X$. We will define them on basic sets of the form $U\times V$. There is an evident diagram of presheaves

$$\begin{array}{ccc} {\mathcal F}(U \cup V) & \to & {\mathcal F}(U)\\ \downarrow & & \downarrow \\ {\mathcal F}(V) & \to & {\mathcal F}(U\cap V) \end{array}$$

If $\mathcal F$ is a sheaf then this is a pullback square for every $U, V$. Define $\mathcal F_2$ to be the total homotopy fiber of this square homotopy fiber of the homomorphism from the initial corner to the pullback of the rest. We may want to think of $\mathcal F_2$ as a presheaf of chain complexes on $X\times X$. The cohomology of the associated sheaf is an invariant that measures the deviation of $\mathcal F$ from being a sheaf (roughly speaking - see next paragraph). If this invariant vanishes, one can construct similar invariants of higher order by looking at higher "cross-effects" of $\mathcal F$.

In fact, the restriction of $\mathcal F_2$ to the diagonal is trivial, we really want to consider cohomology relative to the diagonal. Also, there is a $\Sigma_2$ symmetry to this set-up, and we probably want to consider equivariant cohomology.


Let $\mathcal{F}$ be a presheaf on $X$, and suppose $\mathcal{U}=\{U_i\}$ is an open cover of $X$. The Cech complex is the cochain complex whose degree $n$ piece is the direct sum of sections of $\mathcal{F}$ on the $(n+1)$-fold intersections of sets in $\mathcal{U}$. The ordinary Cech complex is supported in degrees $n\geq 0$, but the same definition works for $n=-1$: there is only one $0$-fold intersection, and it is all of $X$. So we get an extended complex supported in degrees $\geq -1$, that starts $$ 0\to \mathcal{F}(X)\to \bigoplus_{i} \mathcal{F}(U_i)\to\bigoplus_{i<j}\mathcal{F}(U_i\cap U_j)\to\ldots $$ For this complex, $H^{-1}$ is the set of global section of $\mathcal{F}$ that restrict to $0$ on each of the open sets in $\mathcal{U}$, and $H^0$ is the set of sections on the open sets of $\mathcal{U}$ agreeing on the overlaps, modulo those coming from a global section. So $H^{-1}$ measures a failure of sections to be determined by local data, and $H^0$ measures a failure of gluing. Both $H^{-1}$ and $H^0$ vanish when $\mathcal{F}$ is a sheaf, so these cohomology groups give a measure of the failure of $\mathcal{F}$ to be a sheaf.