Nagata's Criterion on Factoriality Proof Explanation I was reading about Nagata's Criterion. I have two questions, 
(i) How is the multiplicatively closed subset generated by prime elements defined?
My thoughts: Let $S$ be the set of generating prime elements. I assume the definition is: the intersection of all multiplicatively closed subgroup containing $S$ - this is defined, as the set of non units is multiplicatively closed. 
(ii) In the 2nd paragraph, how did we obtain (the equality, and the statement)

$S^{-1}A/xS^{-1}A = S^{-1}(A/(x))$ is a domain or zero. 

why does this imply 

$x$ maps to a unit or prime.

 A: This is not a standard notation, but let's denote the set of prime elements of an integral domain by $P_A$, so you can define the set $$S=\Bigl\{\prod_{i\in \Bbb N}x_i:x_i\in A^{\times}\cup X,\; X\subset P_A\Bigr\}.$$
Then $S$ is a set whose elements are (finite) products of units and  primes and we say that $S$ is a multiplicatively closed subset generated by primes.
For a concrete example, let's take $A=\Bbb{Z}$ and $X=\{2,3\}$, in this case we have $$S=\{\pm 2^a\cdot 3^b\},$$ because $\Bbb{Z}^{\times}=\{\pm 1\}$. Analogously, we can take $X$ to be the set of prime numbers of the form $4k+1$ or $4k+3$, etc.

$S^{-1}A/xS^{-1}A = S^{-1}(A/(x))$ is a domain or zero.

This really should be an isomorphism and moreover in the RHS it should be $\bar{S}$, where $\bar{S}=\{\bar{s}: s\in S\}$ such that the classes are taken mod $(x)$.
To get the isomorphism we can define $S^{-1}A/xS^{-1}A\rightarrow \bar{S}^{-1}(A/(x))$ given by $r/s+xS^{-1}A\mapsto \bar{r}/\bar{s}$ for all $r\in A$ and $s\in S$. I leave it to you to prove that the above map is indeed an isomorphism.
Now, as $x$ is prime, then $A/(x)$ is an integral domain, hence $\bar{S}^{-1}(A/(x))$ is either an integral domain or the zero ring, so by the isomorphism we get that $S^{-1}A/xS^{-1}A$ is either an integral domain or the zero ring.
If $S^{-1}A/xS^{-1}A$ in an integral domain, then $xS^{-1}A$ is a prime ideal, but this is also a principal ideal, so its generator $x$ must be a prime element.
Otherwise, if $S^{-1}A/xS^{-1}A$ is the zero ring, then $xS^{-1}A$ is the whole ring, so $x$ must be an unit.

I personally don't like how Nagata's criterion is presented in the Stack Project, because I think the results (1) and (2) should be presented as independent lemmas prior to the main result:  $A$ is a UFD if and only if every element of $A$ has a factorization into irreducibles and $S^{-1}A$ is a UFD.
I prefer the exposition that is given in P. L. Clark' notes on factorization in integral domains. Nagata's criterion is theorem 62 in the above notes, or alternatively, you can check the notes on commutative algebra by the same author where this result is theorem 15.39.
Finally, it's good to have a look at the original statement that was given by Nagata, so I recommend you to check his paper where his criterion is stated in lemma 2.
