Direct limit of localizations of a ring at elements not in a prime ideal For a prime ideal $P$ of a commutative ring $A$, consider the direct limit of the family of localizations $A_f$ indexed by the set $A \setminus P$ with partial order $\le$ such that $f \le g$ iff $V(f) \subseteq V(g)$.  (We have for such $f \le g$ a natural homomorphism $A_f \to A_g$.)  I want to show that this direct limit, $\varinjlim_{f \not\in P} A_f$, is isomorphic to the localization $A_P$ of $A$ at $P$.  For this I consider the homomorphism $\phi$ that maps an equivalence class $[(f, a/f^n)] \mapsto a/f^n$.  (I denote elements of the disjoint union $\sqcup_{f \not\in P} A_f$ by tuples $(f, a/f^n)$.)  Surjectivity is clear, because for any $a/s \in A_P$ with $s \not\in P$, we have the class $[(s, a/s)] \in \varinjlim_{f \not\in P} A_f$ whose image is $a/s$.  For injectivity, suppose we have a class $[(f, a/f^n)]$ whose image $a/f^n = 0/1 \in A_P$.  Then there exists $t \notin P$ such that $ta = 0$.  We want to show that $[(f, a/f^n)]] = [(f, 0/1)]$, which I believe is equivalent to finding a $g \notin P$ such that $V(f) \subseteq V(g)$ and $g^ka = 0$ for some $k \in \mathbb{N}$.  Well, $t$ seems to almost work, but I couldn’t prove that $V(f) \subseteq V(t)$, so maybe we need a different $g$?  Or am I using the wrong map entirely?

If $a/f^n \in A_f$ is mapped to $0$ in $A_p,$ then there is a $g \not \in p,$ s.t. $ga=0,$ therefore, $a/f^n=0 \in A_{gf}.$ Hence the injectivity. 
