TITLE: $K[x_1, x_2,\dots ]$ is a UFD
QUESTION [12 upvotes]: I wonder about how to conclude that $R=K[x_1, x_2,\dots ]$ is a UFD for $K$ a field. 

If $f\in R$ then $f$ is a polynomial in only finitely many variables, how do I prove that any factorization of $f$ in $R$ only have factors in these indeterminates, i.e. takes place in the UFD $K[x_1, x_2,\dots , x_n]$ for some $n$? 
Somebody argued that $f$ can not have one unique factorization in $K[x_1, x_2,\dots, x_n]$ and another in $K[x_1, x_2,\dots, x_n, \dots, x_m]$ I don't understand this. Do all primes in $K[x_1, x_2,\dots, x_n]$ necessarily stay prime in $R=K[x_1, x_2,\dots ]$? How do we know that the irreducible/prime elements in $K[x_1, x_2,\dots, x_n]$ stays irreducible in $R=K[x_1, x_2,\dots ]$?

REPLY [8 votes]: They key idea is that each successive polynomial ring extension $\,D\subset D[x]\,$ is factorization inert, i.e. the ring extension introduces no new factorizations, i.e. if $\, 0\ne d\ \in D\,$ factors in $\,D[x]\,$ as $\,d = ab\,$ for $\, a,b\in D[x]\,$ then $\,a,b\in D.\,$ From this one easily deduces that the requisite factorization properties extend to the ascending union $\,K[x_1,x_2,\cdots\,],$ and the same ideas work for arbitrary inert extensions.
Remark $\ $ Paul Cohn introduced the idea of inert extensions when studying Bezout rings. Cohn proved that every gcd domain can be inertly embedded in a Bezout domain, and every UFD can be inertly embedded in a PID. There are a few variations on the notion of  inertness that prove useful when studying the relationship between factorizations in base and extension rings, e.g. a weaker form where $\, d = ab\,\Rightarrow\, au, b/u\in D,\,$ for some unit $\,u\,$ in the extension ring.