Show $R \setminus S$ is a union of prime ideals

I’m stuck on the following question:

Let $R$ be a commutative ring with $1$, and $S \subseteq R$ a saturated multiplicative set (that is, $1 \in S$ and $x, y \in S$ if and only if $xy \in S$). Show that $R \setminus S$ is a union of prime ideals.

Here’s my attempt so far. If $a \in R \setminus S$, then the ideal $Ra$ does not intersect $S$, because if $ra$ were in $S$ for some $r \in R$, then $a$ would have to be in $S$. Thus, it follows by Zorn’s lemma that there exist ideals $I$ of $R$ which are maximal with respect to the property that $I \cap S = \emptyset$.

Let $I$ be any such ideal. If I can show that $I$ is prime, the conclusion will follow. Let $xy \in I$. I want to show that $x$ or $y$ is in $I$. Suppose $x \not\in I$. Then $I + Rx$ intersects $S$, so there exists $s \in S, a \in I, r \in R$ such that $s = a + rx$. Then $sy = ay + rxy \in I$, so $sy$, and hence $y$, cannot be in $S$.

Similarly if $y$ is not in $I$, then $x \not\in S$. So we are reduced to proving the following is impossible: $xy \in I$, $x$ and $y$ are not in $S$, but they aren’t in $I$ either.

Solutions Collecting From Web of "Show $R \setminus S$ is a union of prime ideals"

Show that if such $x,y$ exist, then $I$ is not maximal w.r.t. $I\cap S=\emptyset.$

Incidentally, you should adjust your maximality condition slightly to say that for each $a\in R\setminus S,$ there is an ideal $I$ with $a\in I$ such that $I$ is maximal w.r.t. $I\cap S=\emptyset.$ (Do you see why this adjustment is necessary?)

You need to show that if $x,y \notin I$, then $xy \notin I$. Consider the product $(I + (x))(I + (y)) \subseteq I + (xy)$.

Edit: Further details… (Spoiler alert.) See the original question for what $I$ is and why we need to show that $I$ is prime. Suppose to the contrary that $xy \in I$ for some $x,y \notin I$. Then $(I + (x))(I + (y)) = I^2 + xI + yI + (xy) \subseteq I$. Since $I + (x)$ and $I + (y)$ properly contain $I$, they must each contain an element of $S$, and hence their product contains an element of $S$. (Here we use the fact that $S$ is multiplicatively closed.) Thus $I$ contains an element of $S$, a contradiction.