TITLE: Why is factorization in the localization of a UFD actually unique?
QUESTION [8 upvotes]: I was reading Arturo Magidin's answer here, which states that the localization of a UFD over a multiplicative subset not containing $0$ is still a UFD. It makes sense that a factorization into units and irreducibles exists, but I don't see uniqueness.
He says it follows by cross multiplying and using the claims. Ok, I let $a/s\in S^{-1}D$. I can factor it into irreducibles
$$
\frac{a}{s}=\frac{p_1}{s_1}\cdots\frac{p_n}{s_n}=\frac{q_1}{t_1}\cdots\frac{q_m}{t_m}.
$$
If I crossmultiply I get different types of terms all over the place and don't know what to compare?

REPLY [2 votes]: It suffices to show primes $\,p\,$ in $D\,$ that do  not map to units in $\,E = S^{-1}D\,$ remain prime in $E.$  
But that is easy to prove. $ $ Suppose $\ \dfrac{p}u {\biggm|} \dfrac{a}s\dfrac{b}t.\ $ Then $\ \dfrac{p}u \dfrac{c}v\, =\, \dfrac{a}s\dfrac{b}t\ \,$ so $\,\ pcst\, =\, abuv$.
Since $\,p\,$ is prime in $D,\,$ we infer $\,p\,$ divides one of $\,a,b,u,v.\,$ But if $\,p\mid u\,$ or $\,p\mid v\,$ in $D\,$ then that remains true in $E\,$ so, being a factor of a unit in $E,\,$ we infer $\,p\,$ is a unit in $E,\,$ contra hypothesis. Thus $\,p\mid a\,$ or $\,p\mid b\,$ in $D,\,$ so also in $E,\,$ so $\,p/u\mid a/s\,$ or $\,p/u\mid b/t,\,$ hence $\,p\,$ remains prime in $E.$