$K[x_1, x_2,\dots ]$ is a UFD 
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 ]$?
 A: 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.
A: Note that $K[x_1,x_2,\dots]=\bigcup_{n\in \Bbb N}K[x_1,x_2,\dots,x_n]$. 
I'm going to denote these rings in the union by $R_n$ to save typing time.
To see that an irreducible $p$ of $R_n$ is irreducible in $R_m$ for $m\geq n$, suppose you have an equation $p=ab$ where $a,b\in R_m$. By evaluating $x_1,\dots, x_n$ all at 1, the variables in $p$ disappear, and you get an equation $\lambda=\overline{ab}\in K[x_{n+1}\dots, x_m]$ where $\lambda\in K$. This is a contradiction unless $a$ and $b$ already fell in $R_n$ in the first place, so that they had no variables above $x_n$. But you already know that in $R_n$, one of $a$ or $b$ must be a unit, so $p$ is irreducible in $R_m$ as well. So between the rings, primes stay prime and irreducibles stay irreducible.
This allows you to conclude that an element has a prime factorization in the first place.
Then you can argue that any two factorizations of a single element into primes must consist of elements in a common $K[x_1,\dots, x_m]$, which will force the factorizations to be equivalent.
