hcju/stacksqa huggingface dataset:
Assume $k \subset K$ is separable. By Lemma \ref{lemma-limit-argument} we may assume that $S$ is of finite type over $k$ and $K$ is finitely generated over $k$. Then $S$ embeds into a finite product of fields, namely its total ring of fractions (see Lemmas \ref{lemma-minimal-prime-reduced-ring} and \ref{lemma-total-ring-fractions-no-embedded-points}). Hence we may actually assume that $S$ is a domain. We choose $x_1, \ldots, x_{r + 1} \in K$ as in Lemma \ref{lemma-generating-finitely-generated-separable-field-extensions}. Let $P \in k(x_1, \ldots, x_r)[T]$ be the minimal polynomial of $x_{r + 1}$. It is a separable polynomial. It is easy to see that $k[x_1, \ldots, x_r] \otimes_k S = S[x_1, \ldots, x_r]$ is a domain. This implies $k(x_1, \ldots, x_r) \otimes_k S$ is a domain as it is a localization of $S[x_1, \ldots, x_r]$. The ring extension $k(x_1, \ldots, x_r) \otimes_k S \subset K \otimes_k S$ is generated by a single element $x_{r + 1}$ with a single equation, namely $P$. Hence $K \otimes_k S$ embeds into $F[T]/(P)$ where $F$ is the fraction field of $k(x_1, \ldots, x_r) \otimes_k S$. Since $P$ is separable this is a finite product of fields and we win. \medskip\noindent At this point we do not yet know that a separably generated field extension is separable, so we have to prove the lemma in this case also. To do this suppose that $\{x_i\}_{i \in I}$ is a separating transcendence basis for $K$ over $k$. For any finite set of elements $\lambda_j \in K$ there exists a finite subset $T \subset I$ such that $k(\{x_i\}_{i\in T}) \subset k(\{x_i\}_{i \in T} \cup \{\lambda_j\})$ is finite separable. Hence we see that $K$ is a directed colimit of finitely generated and separably generated extensions of $k$. Thus the argument of the preceding paragraph applies to this case as well.
Since $S$ is reduced the map $S \to \prod_{\mathfrak p\text{ minimal}} S_{\mathfrak p}$ is injective, see Lemma \ref{lemma-reduced-ring-sub-product-fields}. If $k \subset K$ is a field extension, then the maps $$ S \otimes_k K \to (\prod S_\mathfrak p) \otimes_k K \to \prod S_\mathfrak p \otimes_k K $$ are injective: the first as $k \to K$ is flat and the second by inspection because $K$ is a free $k$-module. As $S_\mathfrak p$ is geometrically reduced the ring on the right is reduced. Thus we see that $S \otimes_k K$ is reduced as a subring of a reduced ring.
First assume $k'/k$ is finite separable. Then $k' = k(\alpha)$, see Fields, Lemma \ref{fields-lemma-primitive-element}. Let $P \in k[x]$ be the minimal polynomial of $\alpha$ over $k$. Then $P$ is an irreducible, separable, monic polynomial, see Fields, Section \ref{fields-section-separable-extensions}. Then $k'[x]/(P) \to k' \otimes_k k'$, $\sum \alpha_i x^i \mapsto \alpha_i \otimes \alpha^i$ is an isomorphism. We can factor $P = (x - \alpha) Q$ in $k'[x]$ and since $P$ is separable we see that $Q(\alpha) \not = 0$. Then it is clear that the multiplicative set $S'$ generated by $Q$ in $k'[x]/(P)$ works, i.e., that $k' = (S')^{-1}(k'[x]/(P))$. By transport of structure the image $S$ of $S'$ in $k' \otimes_k k'$ works. \medskip\noindent In the general case we write $k' = \bigcup k_i$ as the union of its finite subfield extensions over $k$. For each $i$ there is a multiplicative subset $S_i \subset k_i \otimes_k k_i$ such that $k_i = S_i^{-1}(k_i \otimes_k k_i)$. Then $S = \bigcup S_i \subset k' \otimes_k k'$ works.
Assume $A$ is geometrically reduced over $k'$. Let $K/k$ be a field extension. Then $K \otimes_k k'$ is a reduced ring by Lemma \ref{lemma-separable-extension-preserves-reducedness}. Hence by Lemma \ref{lemma-geometrically-reduced-any-reduced-base-change} we find that $K \otimes_k A = (K \otimes_k k') \otimes_{k'} A$ is reduced. \medskip\noindent Assume $A$ is geometrically reduced over $k$. Let $K/k'$ be a field extension. Then $$ K \otimes_{k'} A = (K \otimes_k A) \otimes_{(k' \otimes_k k')} k' $$ Since $k' \otimes_k k' \to k'$ is a localization by Lemma \ref{lemma-separable-algebraic-diagonal}, we see that $K \otimes_{k'} A$ is a localization of a reduced algebra, hence reduced.
The implication (1) $\Rightarrow$ (3) follows from Lemma \ref{lemma-separable-extension-preserves-reducedness}. The implication (3) $\Rightarrow$ (2) is immediate. \medskip\noindent Assume (2). Let $k \subset L \subset K$ be a subextension such that $L$ is a finitely generated field extension of $k$. We have to show that we can find a separating transcendence basis of $L$. The assumption implies that $L \otimes_k k^{1/p}$ is reduced. Let $x_1, \ldots, x_r$ be a transcendence basis of $L$ over $k$ such that the degree of inseparability of the finite extension $k(x_1, \ldots, x_r) \subset L$ is minimal. If $L$ is separable over $k(x_1, \ldots, x_r)$ then we win. Assume this is not the case to get a contradiction. Then there exists an element $\alpha \in L$ which is not separable over $k(x_1, \ldots, x_r)$. Let $P(T) \in k(x_1, \ldots, x_r)[T]$ be the minimal polynomial of $\alpha$ over $k(x_1, \ldots, x_r)$. After replacing $\alpha$ by $f \alpha$ for some nonzero $f \in k[x_1, \ldots, x_r]$ we may and do assume that $P$ lies in $k[x_1, \ldots, x_r, T]$. Because $\alpha$ is not separable $P$ is a polynomial in $T^p$, see Fields, Lemma \ref{fields-lemma-irreducible-polynomials}. Let $dp$ be the degree of $P$ as a polynomial in $T$. Since $P$ is the minimal polynomial of $\alpha$ the monomials $$ x_1^{e_1} \ldots x_r^{e_r} \alpha^e $$ for $e < dp$ are linearly independent over $k$ in $L$. We claim that the element $\partial P/\partial x_i \in k[x_1, \ldots, x_r, T]$ is not zero for at least one $i$. Namely, if this was not the case, then $P$ is actually a polynomial in $x_1^p, \ldots, x_r^p, T^p$. In that case we can consider $P^{1/p} \in k^{1/p}[x_1, \ldots, x_r, T]$. This would map to $P^{1/p}(x_1, \ldots, x_r, \alpha)$ which is a nilpotent element of $k^{1/p} \otimes_k L$ and hence zero. On the other hand, $P^{1/p}(x_1, \ldots, x_r, \alpha)$ is a $k^{1/p}$-linear combination the monomials listed above, hence nonzero in $k^{1/p} \otimes_k L$. This is a contradiction which proves our claim. \medskip\noindent Thus, after renumbering, we may assume that $\partial P/\partial x_1$ is not zero. As $P$ is an irreducible polynomial in $T$ over $k(x_1, \ldots, x_r)$ it is irreducible as a polynomial in $x_1, \ldots, x_r, T$, hence by Gauss's lemma it is irreducible as a polynomial in $x_1$ over $k(x_2, \ldots, x_r, T)$. Since the transcendence degree of $L$ is $r$ we see that $x_2, \ldots, x_r, \alpha$ are algebraically independent. Hence $P(X, x_2, \ldots, x_r, \alpha) \in k(x_2, \ldots, x_r, \alpha)[X]$ is irreducible. It follows that $x_1$ is separably algebraic over $k(x_2, \ldots, x_r, \alpha)$. This means that the degree of inseparability of the finite extension $k(x_2, \ldots, x_r, \alpha) \subset L$ is less than the degree of inseparability of the finite extension $k(x_1, \ldots, x_r) \subset L$, which is a contradiction.
Note that any finite purely inseparable extension $k \subset k'$ embeds in $k^{perf}$. Moreover, $k^{1/p}$ embeds into $k^{perf}$ which embeds into $\overline{k}$. Thus it is clear that (5) $\Rightarrow$ (4) $\Rightarrow$ (3) $\Rightarrow$ (2) and that (3) $\Rightarrow$ (1). \medskip\noindent We prove that (1) $\Rightarrow$ (5). Assume $k' \otimes_k S$ is reduced for every finite purely inseparable extension $k'$ of $k$. Let $k \subset K$ be an extension of fields. We have to show that $K \otimes_k S$ is reduced. By Lemma \ref{lemma-limit-argument} we reduce to the case where $k \subset K$ is a finitely generated field extension. Choose a diagram $$ \xymatrix{ K \ar[r] & K' \\ k \ar[u] \ar[r] & k' \ar[u] } $$ as in Lemma \ref{lemma-make-separably-generated}. By assumption $k' \otimes_k S$ is reduced. By Lemma \ref{lemma-separable-extension-preserves-reducedness} it follows that $K' \otimes_k S$ is reduced. Hence we conclude that $K \otimes_k S$ is reduced as desired. \medskip\noindent Finally we prove that (2) $\Rightarrow$ (5). Assume $k^{1/p} \otimes_k S$ is reduced. Then $S$ is reduced. Moreover, for each localization $S_{\mathfrak p}$ at a minimal prime $\mathfrak p$, the ring $k^{1/p}\otimes_k S_{\mathfrak p}$ is a localization of $k^{1/p} \otimes_k S$ hence is reduced. But $S_{\mathfrak p}$ is a field by Lemma \ref{lemma-minimal-prime-reduced-ring}, hence $S_{\mathfrak p}$ is geometrically reduced by Lemma \ref{lemma-characterize-separable-field-extensions}. It follows from Lemma \ref{lemma-generic-points-geometrically-reduced} that $S$ is geometrically reduced.
The characteristic zero case is clear. Assume the characteristic of $k$ is $p > 0$. If $k$ is perfect, then all the field extensions where we adjoin a $p$th root of an element of $k$ have to be trivial, hence every element of $k$ has a $p$th root. Conversely if every element has a $p$th root, then $k = k^{1/p}$ and every field extension of $k$ is separable by Lemma \ref{lemma-characterize-separable-field-extensions}.
By Lemma \ref{lemma-make-separably-generated} we can find such a diagram with $k' \subset K'$ separably generated. By Lemma \ref{lemma-separably-generated-separable} this implies that $K'$ is separable over $k'$. The compositum $k'K$ is a subextension of $k' \subset K'$ and hence $k' \subset k'K$ is separable by Lemma \ref{lemma-subextensions-are-separable}. The ring $(k' \otimes_k K)_{red}$ is a domain as for some $n \gg 0$ the map $x \mapsto x^{p^n}$ maps it into $K$. Hence it is a field by Lemma \ref{lemma-integral-over-field}. Thus $(k' \otimes_k K)_{red} \to K'$ maps it isomorphically onto $k'K$.
By Lemma \ref{lemma-spec-closed} the map $\Spec(S) \to \Spec(R)$ is a homeomorphism onto the closed subset $V(\Ker(\varphi))$. Of course $V(\Ker(\varphi)) = \Spec(R)$ because every prime ideal of $R$ contains every nilpotent element of $R$. This also implies the statement on residue fields. By right exactness of tensor product we see that $\Ker(\varphi)R'$ is the kernel of the surjective map $R' \to R' \otimes_R S$. Hence the final statement by Lemma \ref{lemma-locally-nilpotent}.
Observe that each of the possibilities listed in (2) satisfies (1). Thus we assume $k'/k$ satisfies (1) and we prove that we are in one of the cases of (2). Discarding the case $k = k'$ we may assume $k' \not = k$. It is clear that $k'/k$ is algebraic. Hence we may assume that $k'/k$ is a nontrivial finite extension. Let $k \subset k'_{sep} \subset k'$ be the separable subextension found in Fields, Lemma \ref{fields-lemma-separable-first}. We have to show that $k = k'_{sep}$ or that $k$ is an algebraic over $\mathbf{F}_p$. Thus we may assume that $k'/k$ is a nontrivial finite separable extension and we have to show $k$ is algebraic over $\mathbf{F}_p$. \medskip\noindent Pick $x \in k'$, $x \not \in k$. Pick $n, m > 0$ such that $x^n \in k$ and $(x + 1)^m \in k$. Let $\overline{k}$ be an algebraic closure of $k$. We can choose embeddings $\sigma, \tau : k' \to \overline{k}$ with $\sigma(x) \not = \tau(x)$. This follows from the discussion in Fields, Section \ref{fields-section-separable-extensions} (more precisely, after replacing $k'$ by the $k$-extension generated by $x$ it follows from Fields, Lemma \ref{fields-lemma-count-embeddings}). Then we see that $\sigma(x) = \zeta \tau(x)$ for some $n$th root of unity $\zeta$ in $\overline{k}$. Similarly, we see that $\sigma(x + 1) = \zeta' \tau(x + 1)$ for some $m$th root of unity $\zeta' \in \overline{k}$. Since $\sigma(x + 1) \not = \tau(x + 1)$ we see $\zeta' \not = 1$. Then $$ \zeta' (\tau(x) + 1) = \zeta' \tau(x + 1) = \sigma(x + 1) = \sigma(x) + 1 = \zeta \tau(x) + 1 $$ implies that $$ \tau(x) (\zeta' - \zeta) = 1 - \zeta' $$ hence $\zeta' \not = \zeta$ and $$ \tau(x) = (1 - \zeta')/(\zeta' - \zeta) $$ Hence every element of $k'$ which is not in $k$ is algebraic over the prime subfield. Since $k'$ is generated over the prime subfield by the elements of $k'$ which are not in $k$, we conclude that $k'$ (and hence $k$) is algebraic over the prime subfield. \medskip\noindent Finally, if the characteristic of $k$ is $0$, the above leads to a contradiction as follows (we encourage the reader to find their own proof). For every rational number $y$ we similarly get a root of unity $\zeta_y$ such that $\sigma(x + y) = \zeta_y\tau(x + y)$. Then we find $$ \zeta \tau(x) + y = \zeta_y(\tau(x) + y) $$ and by our formula for $\tau(x)$ above we conclude $\zeta_y \in \mathbf{Q}(\zeta, \zeta')$. Since the number field $\mathbf{Q}(\zeta, \zeta')$ contains only a finite number of roots of unity we find two distinct rational numbers $y, y'$ with $\zeta_y = \zeta_{y'}$. Then we conclude that $$ y - y' = \sigma(x + y) - \sigma(x + y') = \zeta_y(\tau(x + y)) - \zeta_{y'}\tau(x + y') = \zeta_y(y - y') $$ which implies $\zeta_y = 1$ a contradiction.
Assume (1) and (2). Let $\mathfrak q, \mathfrak q'$ be primes of $S$ lying over the same prime ideal $\mathfrak p$ of $R$. Suppose $x \in S$ with $x \in \mathfrak q$, $x \not \in \mathfrak q'$. Then $x^n \in \mathfrak q$ and $x^n \not \in \mathfrak q'$ for all $n > 0$. If $x^n = \varphi(y)$ with $y \in R$ for some $n > 0$ then $$ x^n \in \mathfrak q \Rightarrow y \in \mathfrak p \Rightarrow x^n \in \mathfrak q' $$ which is a contradiction. Hence there does not exist an $x$ as above and we conclude that $\mathfrak q = \mathfrak q'$, i.e., the map on spectra is injective. By assumption (2) the kernel $I = \Ker(\varphi)$ is contained in every prime, hence $\Spec(R) = \Spec(R/I)$ as topological spaces. As the induced map $R/I \to S$ is integral by assumption (1) Lemma \ref{lemma-integral-overring-surjective} shows that $\Spec(S) \to \Spec(R/I)$ is surjective. Combining the above we see that $\Spec(S) \to \Spec(R)$ is bijective. If $x \in S$ is arbitrary, and we pick $y \in R$ such that $\varphi(y) = x^n$ for some $n > 0$, then we see that the open $D(x) \subset \Spec(S)$ corresponds to the open $D(y) \subset \Spec(R)$ via the bijection above. Hence we see that the map $\Spec(S) \to \Spec(R)$ is a homeomorphism. \medskip\noindent To see the statement on residue fields, let $\mathfrak q \subset S$ be a prime lying over a prime ideal $\mathfrak p \subset R$. Let $x \in \kappa(\mathfrak q)$. If we think of $\kappa(\mathfrak q)$ as the residue field of the local ring $S_\mathfrak q$, then we see that $x$ is the image of some $y/z \in S_\mathfrak q$ with $y \in S$, $z \in S$, $z \not \in \mathfrak q$. Choose $n, m > 0$ such that $y^n, z^m$ are in the image of $\varphi$. Then $x^{nm}$ is the residue of $(y/z)^{nm} = (y^n)^m/(z^m)^n$ which is in the image of $R_\mathfrak p \to S_\mathfrak q$. Hence $x^{nm}$ is in the image of $\kappa(\mathfrak p) \to \kappa(\mathfrak q)$.
Assume (a) and (b). The map on spectra is closed as $S$ is integral over $R$, see Lemmas \ref{lemma-going-up-closed} and \ref{lemma-integral-going-up}. The image is dense by Lemma \ref{lemma-image-dense-generic-points}. Thus $\Spec(S) \to \Spec(R)$ is surjective. If $\mathfrak q \subset S$ is a prime lying over $\mathfrak p \subset R$ then the field extension $\kappa(\mathfrak q)/\kappa(\mathfrak p)$ is generated by elements $\alpha \in \kappa(\mathfrak q)$ whose square and cube are in $\kappa(\mathfrak p)$. Thus clearly $\alpha \in \kappa(\mathfrak p)$ and we find that $\kappa(\mathfrak q) = \kappa(\mathfrak p)$. If $\mathfrak q, \mathfrak q'$ were two distinct primes lying over $\mathfrak p$, then at least one of the generators $x$ of $S$ as in (a) would have distinct images in $\kappa(\mathfrak q) = \kappa(\mathfrak p)$ and $\kappa(\mathfrak q') = \kappa(\mathfrak p)$. This would contradict the fact that both $x^2$ and $x^3$ do have the same image. This proves that $\Spec(S) \to \Spec(R)$ is injective hence a homeomorphism (by what was already shown). \medskip\noindent Since $\varphi$ induces a homeomorphism on spectra, it is in particular surjective on spectra which is a property preserved under any base change, see Lemma \ref{lemma-surjective-spec-radical-ideal}. Therefore for any $R \to R'$ the kernel of the ring map $R' \to R' \otimes_R S$ consists of nilpotent elements, see Lemma \ref{lemma-image-dense-generic-points}, in other words (b) holds for $R' \to R' \otimes_R S$. It is clear that (a) is preserved under base change.
Assume (a) and (b). Note that (b) is equivalent to condition (2) of Lemma \ref{lemma-powers}. Let $T \subset S$ be the set of elements $x \in S$ such that there exists an integer $n > 0$ such that $x^{p^n} , p^n x \in \varphi(R)$. We claim that $T = S$. This will prove that condition (1) of Lemma \ref{lemma-powers} holds and hence $\varphi$ induces a homeomorphism on spectra. By assumption (a) it suffices to show that $T \subset S$ is an $R$-sub algebra. If $x \in T$ and $y \in R$, then it is clear that $yx \in T$. Suppose $x, y \in T$ and $n, m > 0$ such that $x^{p^n}, y^{p^m}, p^n x, p^m y \in \varphi(R)$. Then $(xy)^{p^{n + m}}, p^{n + m}xy \in \varphi(R)$ hence $xy \in T$. We have $x + y \in T$ by Lemma \ref{lemma-help-with-powers} and the claim is proved. \medskip\noindent Since $\varphi$ induces a homeomorphism on spectra, it is in particular surjective on spectra which is a property preserved under any base change, see Lemma \ref{lemma-surjective-spec-radical-ideal}. Therefore for any $R \to R'$ the kernel of the ring map $R' \to R' \otimes_R S$ consists of nilpotent elements, see Lemma \ref{lemma-image-dense-generic-points}, in other words (b) holds for $R' \to R' \otimes_R S$. It is clear that (a) is preserved under base change. Finally, the condition on residue fields follows from (a) as generators for $S$ as an $R$-algebra map to generators for the residue field extensions.
Set $S' = R' \otimes_R S$ so that we have a commutative diagram of continuous maps of spectra of rings $$ \xymatrix{ \Spec(S') \ar[r] \ar[d] & \Spec(S) \ar[d] \\ \Spec(R') \ar[r] & \Spec(R) } $$ Let $\mathfrak p' \subset R'$ be a prime ideal lying over $\mathfrak p \subset R$. If there is no prime ideal of $S$ lying over $\mathfrak p$, then there is no prime ideal of $S'$ lying over $\mathfrak p'$. Otherwise, by Remark \ref{remark-fundamental-diagram} there is a unique prime ideal $\mathfrak r$ of $F = S \otimes_R \kappa(\mathfrak p)$ whose residue field is purely inseparable over $\kappa(\mathfrak p)$. Consider the ring maps $$ \kappa(\mathfrak p) \to F \to \kappa(\mathfrak r) $$ By Lemma \ref{lemma-minimal-prime-reduced-ring} the ideal $\mathfrak r \subset F$ is locally nilpotent, hence we may apply Lemma \ref{lemma-surjective-locally-nilpotent-kernel} to the ring map $F \to \kappa(\mathfrak r)$. We may apply Lemma \ref{lemma-p-ring-map} to the ring map $\kappa(\mathfrak p) \to \kappa(\mathfrak r)$. Hence the composition and the second arrow in the maps $$ \kappa(\mathfrak p') \to \kappa(\mathfrak p') \otimes_{\kappa(\mathfrak p)} F \to \kappa(\mathfrak p') \otimes_{\kappa(\mathfrak p)} \kappa(\mathfrak r) $$ induces bijections on spectra and purely inseparable residue field extensions. This implies the same thing for the first map. Since $$ \kappa(\mathfrak p') \otimes_{\kappa(\mathfrak p)} F = \kappa(\mathfrak p') \otimes_{\kappa(\mathfrak p)} \kappa(\mathfrak p) \otimes_R S = \kappa(\mathfrak p') \otimes_R S = \kappa(\mathfrak p') \otimes_{R'} R' \otimes_R S $$ we conclude by the discussion in Remark \ref{remark-fundamental-diagram}.
We may replace $R$ by $R/\Ker(\varphi)$, see Lemma \ref{lemma-surjective-locally-nilpotent-kernel}. Assumption (2) implies $S$ is generated over $R$ by elements which are integral over $R$. Hence $R \subset S$ is integral (Lemma \ref{lemma-integral-closure-is-ring}). In particular $\Spec(S) \to \Spec(R)$ is surjective and closed (Lemmas \ref{lemma-integral-overring-surjective}, \ref{lemma-going-up-closed}, and \ref{lemma-integral-going-up}). \medskip\noindent Let $x \in S$ be one of the generators in (2), i.e., there exists an $n > 0$ be such that $(T - x)^n \in R[T]$. Let $\mathfrak p \subset R$ be a prime. The $\kappa(\mathfrak p) \otimes_R S$ ring is nonzero by the above and Lemma \ref{lemma-in-image}. If the characteristic of $\kappa(\mathfrak p)$ is zero then we see that $nx \in R$ implies $1 \otimes x$ is in the image of $\kappa(\mathfrak p) \to \kappa(\mathfrak p) \otimes_R S$. Hence $\kappa(\mathfrak p) \to \kappa(\mathfrak p) \otimes_R S$ is an isomorphism. If the characteristic of $\kappa(\mathfrak p)$ is $p > 0$, then write $n = p^k m$ with $m$ prime to $p$. In $\kappa(\mathfrak p) \otimes_R S[T]$ we have $$ (T - 1 \otimes x)^n = ((T - 1 \otimes x)^{p^k})^m = (T^{p^k} - 1 \otimes x^{p^k})^m $$ and we see that $mx^{p^k} \in R$. This implies that $1 \otimes x^{p^k}$ is in the image of $\kappa(\mathfrak p) \to \kappa(\mathfrak p) \otimes_R S$. Hence Lemma \ref{lemma-p-ring-map} applies to $\kappa(\mathfrak p) \to \kappa(\mathfrak p) \otimes_R S$. In both cases we conclude that $\kappa(\mathfrak p) \otimes_R S$ has a unique prime ideal with residue field purely inseparable over $\kappa(\mathfrak p)$. By Remark \ref{remark-fundamental-diagram} we conclude that $\varphi$ is bijective on spectra. \medskip\noindent The statement on base change is immediate.
Let $k \subset \overline{k}$ be a perfect closure, see Definition \ref{definition-perfection}. By assumption $\overline{k}$ is algebraically closed. The ring maps $R \to R \otimes_k \overline{k}$ and $S \to S \otimes_k \overline{k}$ and $R \otimes_k S \to (R \otimes_k S) \otimes_k \overline{k} = (R \otimes_k \overline{k}) \otimes_{\overline{k}} (S \otimes_k \overline{k})$ satisfy the assumptions of Lemma \ref{lemma-p-ring-map}. Hence we may assume $k$ is algebraically closed. \medskip\noindent We may replace $R$ and $S$ by their reductions. Hence we may assume that $R$ and $S$ are domains. By Lemma \ref{lemma-perfect-reduced} we see that $R \otimes_k S$ is reduced. Hence its spectrum is reducible if and only if it contains a nonzero zerodivisor. By Lemma \ref{lemma-limit-argument} we reduce to the case where $R$ and $S$ are domains of finite type over $k$ algebraically closed. \medskip\noindent Note that the ring map $R \to R \otimes_k S$ is of finite presentation and flat. Moreover, for every maximal ideal $\mathfrak m$ of $R$ we have $(R \otimes_k S) \otimes_R R/\mathfrak m \cong S$ because $k \cong R/\mathfrak m$ by the Hilbert Nullstellensatz Theorem \ref{theorem-nullstellensatz}. Moreover, the set of maximal ideals is dense in the spectrum of $R$ since $\Spec(R)$ is Jacobson, see Lemma \ref{lemma-finite-type-field-Jacobson}. Hence we see that Lemma \ref{lemma-flat-fibres-irreducible} applies to the ring map $R \to R \otimes_k S$ and we conclude that the spectrum of $R \otimes_k S$ is irreducible as desired.