Algebraic varieties being geometrically irreducible I have trouble comprehending the so-called notion of being geometrically irreducible. More specific, I was doing an exercise in Hartshorne, Algebraic Geometry, First Properties of Schemes, exercise $3.15$.
Briefly, let $k$ be a field and $X$ a scheme over $k$. Then $X$ is said to be geometrically irreducible if $X_{k'} = X \times_{k} k'$ (by the abuse of notation, I write $k$ to mean $\mathrm{Spec}(k)$). The exercise asks readers to show that the following three conditions are equivalent provided $X$ is a scheme of finite type over $k$:

*

*$X \times_k \overline{k}$ is irreducible, where $\overline{k}$ is the algebraic closure of $k$.

*$X \times_k k^{sep}$ is irreducible, where $k^{sep}$ is the separable closure of $k$.

*$X$ is geometrically irreducible.

Note that the third implies the first one trivially, the first one implies the second because the property of being surjective is preserved under base change.
The solutions which are available online seem to be so terse and vague, therefore I have had to search for several sources, including Vakil's note FOA (section $9.5$) and QingLiu, Algebraic Geometry and Arithmetic Curves (section $3.2.2$). The two core lemmas in QingLiu are

Let $X$ be an algebraic variety over $k$, $K/k$ an algebraic extension of fields. Then for every reduced closed subvariety $W$ of $X \times_k K$, there exists a finite subextension $K'/k$ of $K/k$, and a unique reduced closed subvariety $Z$ of $X \times_k K'$ such that $W = Z \times_k K$.


Let $X$ be an algebraic variety over $k$, $K/k$ an algebraic extension. If $K/k$ is purely inseparable, then the projection $X \times_k K \to X$ is a homeomorphism.

I understand their proofs, but can not deduce the general case (an arbitrary extension $K/k$ instead of just being purely inseparable or algebraic). I think my problem is I do not truly understand the roles of two extensions $\overline{k}/k,k^{sep}/k$ here. Any suggestion would be greatly appreciate.
 A: For the first part, it's an important fact in itself that $X_{\overline{k}} \rightarrow X_{k^{sep}}$ is a homeomorphism.
To do that, it's not an issue to reduce to the case of affine $X$, and thus you want to show that for any $k$-algebra $A$, we have a natural correspondance between the spectra of $A \otimes \overline{k}$ and $A \otimes k^{sep}$. To do that, the main ingredient is to note that for each $x \in A \otimes \overline{k}$, in prime characteristic $p > 0$, there is an integer $n \geq 0$ such that $x^{p^n} \in A \otimes k^{sep}$. (It's not entirely obvious how to go on after that, but it's not very difficult).
Now, we want to explain why, if $X_{\overline{k}}$ is irreducible, then for any extension $k'/k$, $X_{k'}$ is irreducible.
First, we can assume $k$ is algebraically closed. Indeed, let $K$ be an algebraic closure of $k'$, so that we have a map $\overline{k} \rightarrow K$ (respecting $k' \cap \overline{k}$). Now $K/\overline{k}$ is a field extension, and $X_{\overline{k}}$ is irreducible. If $X_K$ is indeed irreducible, then, as $X_K \rightarrow X_{k'}$ is surjective, it follows that $X_{k'}$ will be irreducible.
So assume that $k$ is an algebraically closed field and $X$ is an irreducible scheme over $k$. Let $K/k$ be a field extension, we want to show that $X_{K}$ is irreducible. It's enough to show it when $X$ is affine (because the affine subsets of a general irreducible $X$ are dense and irreducible, and their base changes will be irreducible, and will pairwise intersect, which forces $X_K$ to be irreducible by topology), and we can furthermore assume $X$ is reduced (so $X$ is the spectrum of an integral $k$-algebra $A$), and we will show that if $K/k$ is an extension, $A\otimes K$ is an integral domain.
Let $K/k$ be an extension and let $a,b \in A \otimes K$ have a null product. There is a finitely generated (and integral) $k$-subalgebra $B \subset K$ such that $a,b$ are in the image of the monomorphism (flatness) $A \otimes_k B \rightarrow A \otimes K$, so we want to show that, in $A \otimes B$, $a$ or $b$ must be zero when their product is zero.
Now, take a $k$-basis $e_i$ of $A$, and let $a_i,b_i$ be the coordinates of $a,b$ in the $B$-basis $e_i \otimes 1$. Then, $(a_i)_i,(b_i)_i$ are almost null sequences of elements of $B$. Assume that there are some nonzero $a_i,b_j$. Then $a_ib_j \in B$ is nonzero (and $B$ is a finitely generated $k$-algebra), hence is not contained in some maximal ideal $\mu$ by the Nullstellensatz. Consider the reduction map mod $\mu$: $A \otimes B \rightarrow A$ (as $k$ is algebraically closed): then the images of neither $a$ nor $b$ are zero, but their product is, so $A$ isn't an integral domain, so we have a contradiction, which shows that $A \otimes K$ is a domain and we are done.
