Algebraic varieties that are isomorphic after a base change Let $k$ be a field, $\overline{k}$ its algebraic closure. Suppose $X$ is an algebraic variety over $\overline{k}$. This means that $X$ is a scheme with a finite covering by open affine varieties over $\overline{k}$. The definition i'm using for an affine variety is that it is isomorphic to $SpecA$ for $A$ finitely generated over $\overline{k}$.
I am trying to prove that there exists a finite extension $k'$ of $k$, and an algebraic variety $Y$ over $k'$ such that the base change $Y_{\overline{k}}$ is isomorphic to $X$.
I have managed to prove this for the case that $X$ is affine, since then $X \cong Spec(\overline{k}[x_1, ..., x_n]/I)$ for some finitely generated ideal $I$. If $I$ is generated by $f_1, ..., f_r$, we can simply add their coefficients to $k$ to get $k'$, and define $Y := Spec(k'[x_1, ...,x_n]/I')$, with $I'$ generated by $f_1, ..., f_r$ over $k'$.
I am having some trouble passing to the general case $X = X_1 \cup ... \cup X_l$ a finite union of affine varieties. For simplicity I am trying to prove first for $X = X_1 \cup X_2$, and suppose $X_1 = Spec(\overline{k}[x_1, ..., x_n]/I_1), X_2 = Spec(\overline{k}[y_1, ..., y_m]/I_2)$.
What i've done so far:
Denote $X_1 \cap X_2$ by $D(J_1)$ when viewed as an open subvariety of $X_1$, and $D(J_2)$ when viewed as an open subvariety of $X_2$. I know that the intersection of open affine varieties is affine, hence $D(J_1), D(J_2)$ are affine.
It is then possible to define $k'$ by adding to $k$ all the coefficients of the generators of $I_1, I_2, J_1, J_2$, and as above define $Y_1, Y_2$, and even $D(J'_1) \subset Y_1$, $D(J'_2) \subset Y_2$ with $D(J'_1)_{\overline{k}} = D(J_1) \cong D(J_2) = D(J'_2)_{\overline{k}}$.
However, in order to glue $Y_1$ and $Y_2$ together, I need to prove that $D(J'_1) \cong D(J'_2)$, and this is where I am rather stuck. I am not even sure how to construct an "induced" morphism between them.
So my question is - How to construct $Y$? Am I in the right direction? Is there another appealing way to tackle this?
Thanks very much in advance.
 A: Let $L/K$ be a field extension, let $X$ be an $L$-scheme of finite type. I claim that there is a finitely generated extension $K \subseteq K'$ in $L$ and a $K'$-scheme $X'$ of finite type such that $X' \otimes_{K'} L \cong X$. Let us say that $X'$ is a model of $X$ over $K'$.
If $X$ is affine, this is easy: The coordinate ring is $L[x_1,\dotsc,x_n]/(f_1,\dotsc,f_r)$ for some polynomials $f_i$. Let $K'$ be the subfield generated by all their coefficients. Then the spectrum of $K'[x_1,\dotsc,x_n]/(f_1,\dotsc,f_r)$ is a possible choice of $X'$.
For the general case we need a Lemma: If $X,Y$ are $K$-schemes of finite type and $X \otimes_{K} L \to Y \otimes_{K} L$ is a morphism, then there is a finitely generated extension $K \subseteq K'$ in $L$ and a morphism $X \otimes_{K} K' \to Y \otimes_{K} K'$ which induces the given one (after applying $\otimes_{K'} L$). This morphism is unique and is called a model over $K'$. If $X \otimes_K L \to Y \otimes_K L$ is an open immersion, then $X \otimes_{K} K' \to Y \otimes_{K} K'$ is also an open immersion.
Assuming that the Lemma holds, cover our $L$-scheme $X$ by finitely many affine $L$-schemes $X_i$. By the affine case, they  have models over some finitely generated extension of $K$. Since there are only finitely many, we find a single extension $K'$ which works for all of them. Using the Lemma, after enlarging $K'$ we also find models of the open immersions $X_i \cap X_j \to X_i$ over $K'$. Using the Lemma again and enlarging $K'$, the canonical isomorphism $X_i \cap X_j \cong X_j \cap X_i$ lifts to an isomorphism of the models over $K'$. The cocycle condition is satisfied because of the uniqueness statement in the Lemma. Now we have a gluing datum over $K'$ and obtain a $K'$-scheme $X'$ of finite type. By construction, we have $X' \otimes_{K'} L \cong X$.
Now let me sketch the proof of the Lemma.  By uniqueness, we may obviously reduce to the case that $X,Y$ are affine. Say $X$ is the spectrum of $K[x_1,\dotsc,x_n]/(f_1,\dotsc,f_r)$ and $Y$ is the spectrum of $K[y_1,\dotsc,y_m]/(g_1,\dotsc,g_s)$. Then we have an $L$-algebra homomorphism $L[y_1,\dotsc,y_m]/(g_1,\dotsc,g_s) \to L[x_1,\dotsc,x_n]/(f_1,\dotsc,f_r)$. The images of the $y_i$ are polynomials in $x_1,\dotsc,x_n$ over $L$, hence lie in a finitely generated extension of $K$ inside $L$. The relation that the images of the $g_i$ lie in the ideal generated by $f_1,\dotsc,f_r$ is witnessed by finitely many polynomials. Adding their coefficients we obtain a finitely generated extension $K \subseteq K'$ in $L$ and by construction a homomorphism of $K'$-algebras $K'[y_1,\dotsc,y_m]/(g_1,\dotsc,g_s) \to K'[x_1,\dotsc,x_n]/(f_1,\dotsc,f_r)$ which lifts the given one over $L$. It is unique since $K' \to L$ is faithfully flat. This also shows that the property of being an "open immersion" descends from $L$ to $K'$. In fact it is well-known that open immersions satisfy fpqc descent. For field extensions there are more direct arguments, of course, but I'll leave this to the reader.
