Lemma 10.130.2. Let $S$ be a finite type algebra over a field $k$. The set of primes $\mathfrak q$ such that $S_{\mathfrak q}$ is Cohen-Macaulay is open in $S$.

Proof. Let $\mathfrak q \subset S$ be a prime such that $S_{\mathfrak q}$ is Cohen-Macaulay. We have to show there exists a $g \in S$, $g \not\in \mathfrak q$ such that the ring $S_ g$ is Cohen-Macaulay. For any $g \in S$, $g \not\in \mathfrak q$ we may replace $S$ by $S_ g$ and $\mathfrak q$ by $\mathfrak qS_ g$. Combining this with Lemmas 10.115.5 and 10.116.3 we may assume that there exists a finite injective ring map $k[y_1, \ldots , y_ d] \to S$ with $d = \dim (S_{\mathfrak q}) + \text{trdeg}_ k(\kappa (\mathfrak q))$. Set $\mathfrak p = k[y_1, \ldots , y_ d] \cap \mathfrak q$. By construction we see that $\mathfrak q$ is an element of the right hand side of the displayed equality of Lemma 10.130.1. Hence it is also an element of the left hand side.

By Theorem 10.129.4 we see that for some $g \in S$, $g \not\in \mathfrak q$ the ring $S_ g$ is flat over $k[y_1, \ldots , y_ d]$. Hence by the equality of Lemma 10.130.1 again we conclude that all local rings of $S_ g$ are Cohen-Macaulay as desired. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).