Lemma 10.125.7. Let $R$ be a ring. Let $S$, $S'$ be of finite presentation over $R$. Let $\mathfrak q \subset S$ and $\mathfrak q' \subset S'$ be primes. If $S_{\mathfrak q} \cong S'_{\mathfrak q'}$ as $R$-algebras, then there exist $g \in S$, $g \not\in \mathfrak q$ and $g' \in S'$, $g' \not\in \mathfrak q'$ such that $S_ g \cong S'_{g'}$ as $R$-algebras.

Proof. Let $\psi : S_{\mathfrak q} \to S'_{\mathfrak q'}$ be the isomorphism of the hypothesis of the lemma. Write $S = R[x_1, \ldots , x_ n]/(f_1, \ldots , f_ r)$ and $S' = R[y_1, \ldots , y_ m]/J$. For each $i = 1, \ldots , n$ choose a fraction $h_ i/g_ i$ with $h_ i, g_ i \in R[y_1, \ldots , y_ m]$ and $g_ i \bmod J$ not in $\mathfrak q'$ which represents the image of $x_ i$ under $\psi$. After replacing $S'$ by $S'_{g_1 \ldots g_ n}$ and $R[y_1, \ldots , y_ m, y_{m + 1}]$ (mapping $y_{m + 1}$ to $1/(g_1\ldots g_ n)$) we may assume that $\psi (x_ i)$ is the image of some $h_ i \in R[y_1, \ldots , y_ m]$. Consider the elements $f_ j(h_1, \ldots , h_ n) \in R[y_1, \ldots , y_ m]$. Since $\psi$ kills each $f_ j$ we see that there exists a $g \in R[y_1, \ldots , y_ m]$, $g \bmod J \not\in \mathfrak q'$ such that $g f_ j(h_1, \ldots , h_ n) \in J$ for each $j = 1, \ldots , r$. After replacing $S'$ by $S'_ g$ and $R[y_1, \ldots , y_ m, y_{m + 1}]$ as before we may assume that $f_ j(h_1, \ldots , h_ n) \in J$. Thus we obtain a ring map $S \to S'$, $x_ i \mapsto h_ i$ which induces $\psi$ on local rings. By Lemma 10.6.2 the map $S \to S'$ is of finite presentation. By Lemma 10.125.6 we may assume that $S' = S \times C$. Thus localizing $S'$ at the idempotent corresponding to the factor $C$ we obtain the result. $\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).