# A finite type morphism between regular schemes and closed immersions.

I am working through the following problem in Qing Liu's book on Algebraic Geometry, 6.2.6 a), which reads:

Let $X \rightarrow Y$ be a morphism of finite type of locally noetherian regular schemes. Let $y \in Y$ and let $x \in X_y$ be a closed point such that $k(x)$ is separable over $k(y)$. Show that in a neighborhood of $x$, there exists a closed immersion $$i : X \rightarrow Z$$ such that $Z$ is smooth of relative dimension $\dim \mathcal{O}_{X,x}$ over Y.

I am not sure how to do this. I have tried the following approach, but I don't seem to get it to work so I would appreciate any hint (or solution) .

We start by assuming X and Y affine. So write $Y = \operatorname{Spec} B$ and $X = \operatorname{Spec} B[t_1, \ldots, t_n]/I$. Now, by regularity, I is generated by $n-\dim X$ elements $f_i$ such that $f_{m+1}$ is regular in $B[t_1, \ldots, t_n]/(f_1 , \ldots, f_m)$. Let us set $Z_0 = \operatorname{Spec} B[t_1, \ldots, t_n]$. If all the fibers of $Z_0 \rightarrow Y$ are equidimensional of dimension $\dim \mathcal{O}_{X,x}$ we are done (I think?). Further, $Z_0 \rightarrow Y$ is flat, so the fiber dimension is constant, call it $m$. So let us assume that $m > \dim \mathcal{O}_{X,x}$. Then, by taking $f_1$ my hope is that we get a scheme of lower fiber dimension, which satisfies all our desired properties, but I can't seem to prove this properly!

I am very thankful for help.

-