Recovering a sheaf from base of topology Exercise 2.5A in Vakil's notes suggests that one can recover information about a sheaf $\mathcal{F}$ with just the information of what the sheaf gives on a base of topology $(\mathcal{F}(B_i), res_{B_i,B_j})$
My guess about how this works is the following:
To know any section $s \in \mathcal{F}(U)$ over an open $U$ is the same as knowing the stalk at every point in $p \in U$. So if we can determine $s_p$ for each $p$, we are done.
Now since stalks contain only local information, we can think of $s_p = (U, s) = (B_i, s|_{B_i})$ for some $B_i$. We have the latter, since we have the information about the sheaf on the base of topology, and so we are done.
This is what I had initially, but I ran into the following issues:

*

*I'm using the information of $s$ (specifically, its restriction to $B_i$) to determine $s$, so the reasoning there seems circular.


*I'm wary of taking stalks under different indexing sets. i.e. Is taking the stalk of $s$ and the direct limit over all open sets containing $p$ the same as taking the stalk of $s$ and the direct limit over all basis element sets containing $p$?
Regarding the first, issue, my best guess as to how to fix how I'm looking at this is to take the approach that to construct the sections in $\mathcal{F}(B_i \cup B_j)$, we need to see which germs in the stalks at points in the union are compatible. i.e. find $(s_p)_{p \in B_ij}$ such that for every $p$, there is a basis element $B$ containing $p$ in the union and a section $t \in \mathcal{F}(B)$ such that for each $q \in B$, we have $s_q = t_q$. If we can do this, then glue the compatible germs together to get a section $s$ on any union of base sets.
So my questions are as follows:
a) Is this latter approach correct? Would this be the most complete way to see what Vakil is trying to get at with this exercise? If so, could one point to a relatively simple example to see how this would work in practice.
b) Is my concern in issue 2) above well founded or am I missing something there?
 A: It's actually not necessary to use stalks at all. A sheaf is just a functor $P \in Sets^{\mathcal{O}_x^{op}}$ such that for all open covers $\bigcup\limits_{i \in I} U_i = U$, the diagram $P(U) \to \prod\limits_{k \in I} P(U_k) \rightrightarrows \prod\limits_{i \in I} \prod\limits_{j \in I} P(U_i \cap U_j)$ (with obvious arrows) is an equalizer.
Given a basis $B$, write $B_U = \{V \in B | V \subseteq U\}$. Then if $P$ is a sheaf, the following diagram must be an equalizer: $P(U) \to \prod\limits_{V \in B_U} P(V) \rightrightarrows \prod\limits_{Q \in B_U} \prod\limits_{R \in B_Q} P(R)$ (with obvious arrows). This follows from the definition of a sheaf and a bit of diagram chasing.
So now define a new functor $P'$. We define $P'(U)$ to be the (canonical) equalizer $P'(U) \to \prod\limits_{V \in B_U} P(V) \rightrightarrows \prod\limits_{Q \in B_U} \prod\limits_{R \in B_Q} P(R)$. Given that $T \subseteq U$, one can define a map $P'(U) \to P'(T)$ by taking the map $P'(U) \to \prod\limits_{V \in B_U} P(V) \to \prod\limits_{V \in B_T} P(V)$ and showing this map must factor through the equalizer $P'(T)$. From here, you must establish functoriality - this is pretty straightforward.
Finally, clearly each $P'(U)$ is isomorphic to $P(U)$ in a canonical way since both are equalizers of the same diagram. This isomorphism is natural.
So we have constructed a sheaf isomorphic to $P$ only using the restriction of $P$ to the basis.
Note that this result immediately generalizes to sheaves on a complete Heyting algebra (that is, a locale), since we only use the Heyting algebra structure of $\mathcal{O}_X$ and not any other properties of spaces. It also generalises to sheaves on an arbitrary site.
