I’m trying to understand a step in this answer (all the other steps are pretty clear to me). I decided to post this as a new question instead of as a comment because the author has been inactive for years.
Let $X$ be a scheme, $U$ an affine open piece of $X$ containing a point $x \in X$, $U \cong \operatorname{Spec}(A)$, with $x$ corresponding to the prime ideal $\mathfrak{p} \in \operatorname{Spec} A$. Consider the localization map $\phi: A\rightarrow A_{\mathfrak{p}}$. This is the part I don’t follow, which is needed to check that we can apply the universal property of localization:
Now suppose $f \in A/P$. Then the image of $\phi$ lies inside the distinguished open affine piece $D(f)$.
I’m not sure if they meant $f\in A \setminus \mathfrak{p}$ instead of $f\in A/ \mathfrak{p}$, but I don’t understand the claim either way. Why does the image of $\phi: A\rightarrow A_{\mathfrak{p}}$ lie inside $D(f)=\{\mathfrak{q} \in \operatorname {Spec} A \text{ }|\text{ } f\notin \mathfrak{q}\}(=\operatorname{Spec}A_f)$? We're comparing a set of elements of the ring and a set of ideals here, right...?
Here's a corrected version:
This isn't too hard to see: since $f\notin A\setminus P$, the element $f$ is invertible in $A_P$, so the map $A\to A_P$ factors through the localization $A\to A_f$ by the universal property of localization. Now Spec of the localization map $A\to A_f$ is the open immersion of $D(f)$ in $\operatorname{Spec} A$.
I've fixed this in the link with an edit.