Steps in defining $\mathscr O_{Spec R}$ I'm trying to understand the definition of $\mathscr O_{Spec R}$ from a larger perspective. Here's what steps I was told about (I might be misinterpreting something). I'll write $\mathscr F$ for $\mathscr O_{Spec R}$.
(1) Define the presheaf on the base by $F(D(f))=R_f$
(2) Prove that this is a sheaf
(3) Define the stalks  by $F_P=R_P$
(4) For an open set $U$, define $\mathscr F(U)=\{(s_P\in R_P)_{P\in U}: s_P \text{ are compatible}\}$ (in our case, compatible means $\forall P\in U\ \exists f\in R\text{ s.t. } P\in D(f)\subset U \ \text{ and } \exists\ a/f^n\in \mathscr F(D(f))=R_f \text{ with } s_Q=(a/f^n)_Q \text{ for all } Q\in D(f)$)
(5) Prove that $\mathscr F(U)$ is isomorphic to $F(U)$
Here are my questions:

*

*Regarding (3), Vakil's Theorem 2.5.1 says that $F_P$ should be $colim F(D(f))$, if I understand correctly. So is it the case that $colim F(D(f))=R_P$? If so, what is the definition of the colimit map $R_f\to R_P$? If $P\in D(f)$, then $f\notin P$ and I guess this map can be defined as $a/f^n\mapsto a/f^n$, but do we know that $P\in D(f)$? This confusion may be coming from not fully understanding the notation $colim F(D(f))$ -- it is the colimit of which diagram $E:I\to \text{Ring}$? What is $I$?
Update: Is it true that $I$ depends on $P$, and $I=I_P$ contains (as objects) elements $f\in R$ such that $f\notin P$? And the coprojection maps are, I suppose the maps described here?


* (Continuation of the above question.) Suppose $D(f_j)\subset D(f_i)$. What is the map $R_{f_i}=F(D(f_i))\to F(D(f_j))=R_{f_j}$? My naive guess would be $a/(f_i)^n\mapsto a/(f_j)^n$, but how is the fact $D(f_j)\subset D(f_i)$ used? Vakil says that $F(D(f_j))$ is a further localization of $F(D(f_i))$, but I'm not sure if I understand this -- these rings, by definition are $R_{f_j}$ and $R_{f_i}$, and we only know that if $f_j\notin P$, then $f_i\notin P$, I don't see how this makes $F(D(f_j))$ a further localization of $F(D(f_i))$ (there's no reference to $P$ in, say, $F(D(f_j))=R_{f_j}$). This question is answered here (although I still don't understand why it is a "further" localization).


*Is (5) just a particular case of Vakil's theorem 2.5.1? For any sheaf on the base $F$, $\mathscr F(U)$ is isomorphic to $ F(U)$. (Also I suppose the fact that our $\mathscr F$ is a sheaf is a consequence of the same theorem.)
 A: For your first question, I think it is easier to understand it using the concrete description of filtered colimits given in Vakil's exercise 1.4.C.
The diagram does depend on $P$. To make the connection, we treat the presheaf on a base $F$ as a contravariant functor $D \to \operatorname{Ring}$, where $D$ is the category of distinguished open sets containing $P$ (with morphisms given by inclusion). The induced functor $D^{\text{Op}} \to \text{Ring}$ will be our diagram in Ring.
We note that $D^{\text{Op}}$ is filtered. After all, if $U_1$ and $U_2$ are open sets containing $P$, then $U_1 \cap U_2 \subseteq U_1$ and $U_1 \cap U_2 \subseteq U_2$ so that there are 'morphisms' $U_1 \to U_1 \cap U_2$ and $U_2 \to U_1 \cap U_2$. The second condition follows similarly.
As such, we can consider $F_P$ as ordered pairs $[D(f), s]$ for distinguished neighborhood $P \in D(f)$ and $s \in F(D(f)).= R_f$ under the equivalence relation $[D(f), s] \sim [D(g), t]$ if there is some neighborhood $D(h) \subseteq D(f) \cap D(g)$ of $P$ where $s|_{D(h)} = t|_{D(h)}$.
With this description, we define a surjective homomorphism $F_P \to R_P$ given by $[D(f), s] \mapsto s$. This makes sense since $f \notin P $ by the definition of $D(f)$ and the fact that $s \in R_f$.
To show that this is an isomorphism, suppose $[D(f), s] \mapsto 0$. Then $s = t/f^n \in R_f$ is $0$ in $R_P$. Since $t/f^n = 0/1$ in $R_P$, there is a $g \notin P$ so that $$g(f^n * 0 - t * 1) = - gt = 0.$$ We then claim that $s|_{D(fg)} = \frac{tg^n}{(fg)^n} = 0$ in $F(D(fg)) = R_{fg}$. This follows from the above equation by multiplying each side by $g^{n - 1}$ to obtain $$(fg)^n * 0 - (tg^n) * 1 = - g^{n - 1}(gt) = 0.$$
This proves that $F_P \cong R_P$.
For your last question, I think the rest does indeed follow from the theorem 2.5.1 cited, and the fact that $\mathscr{F}_P \cong F_P$ follows quickly from the definition of a base.
