TITLE: Control ramification in Noether Normalization
QUESTION [10 upvotes]: Let $X$ be an irreducible affine variety (integral, reduced scheme of finite type over an algebraically closed field $\Bbbk$ of characteristic zero) of dimension $n$. The well-known Noether Normalization Lemma states that there is a finite morphism $\pi:X\to\mathbb A_\Bbbk^n$. 
Assume now that I have an irreducible codimension one subvariety $Y\subseteq X$. 
Edit: Also assume that the generic point of $Y$ is a regular point of $X$. Even more, you may assume that the generic point of $Y$ is in the normal locus of $X$ or even in the nonsingular locus of $X$. In fact, in cases that interest me, $Y$ is completely contained in the nonsingular locus of $X$.
I think it should be possible to choose a Noether Normalization as above with the property that $Y$ is not in the ramification locus, i.e. there is some $p\in\pi(Y)$ with $|\pi^{-1}(p)|=\deg(\pi)$. In other words: I want to choose $\pi$ such that it is unramified at the generic point of $Y$.
The question is: Can I do this? Assuming that I can: Do you know a proof or a reference for this statement? Even under additional assumptions, an affirmative answer would be very much appreciated.  
Thanks a lot.
Edit: I realize now, after soberly considering Cantlog's comments, that I do indeed wish that $\deg\pi|_Y=\deg\pi$ holds in my situation, with $\pi$ unramified at the generic point of $Y$. This can also be expressed as the requirement that the inertia index of $\pi$ at the generic point of $Y$ is equal to $\deg\pi$. Clearly, this is not possible in general, but it will be possible in some cases. If you can name sufficient conditions for such a Normalization to exist, I would be very grateful.

REPLY [4 votes]: Let $y_0\in Y$ be a point in the smooth locus of $X$. We are going to construct a finite morphism $\pi: X\to \mathbb A^n_k$ unramified (thus étale) at $y_0$. As the ramification locus is closed, this will imply that $\pi$ is unramified at the generic point of $Y$. From now on we can merely forget $Y$. I will suppose $k$ is perfect and infinite to avoid complications.
Let $\overline{X}$ be a projective closure of $X$, write $\overline{X}=\mathrm{Proj}(B)$ for some homogeneous $k$-algebra $B$, and write $\overline{X}\setminus X=V_+(f_0)$. By homogeneous prime avoidance, there exists a homogeneous element $f_1\in B$ of degree $1$ such that 

$y_0\in V_+(f_1)$; 
$V_+(f_1)$ does not contain any irreducible component of $V_+(f_0)$; 
$V_+(f_1)$ does not contain the tangent space of $X$ at $y_0$ (that is $(f_1)_{y_0}\notin {\mathfrak m}^2(1)_{y_0}$, where $\mathfrak m$ is the sheaf of ideals defining $y_0$ in $X$). 

Condition (2) implies that $V_+(f_0)\cap V_+(f_1)$ has dimension $n-2$. Condition (3) insures that $V_+(f_1)$ is smooth at $y_0$. Next we take a homogeneous element $f_2$ of degree $1$ such that 

$y_0\in V_+(f_2)$; 
$V_+(f_2)$ does not contain any irreducible component of $V_+(f_0)\cap V_+(f_1)$ (in particular it doesn't contain any irreducible component of $V_+(f_1)$); 
$V_+(f_2)$ does not contain the tangent space of $V_+(f_1)$ at $y_0$.

We repeat this operation to find homogeous elements $f_1, \dots, f_n$ of degree $1$ such that 

$V_+(f_1)\cap \cdots \cap V_+(f_n)$ has dimension $0$ and is smooth at $y_0$; 
$V_+(f_0)\cap \cdots \cap V_+(f_n)=\emptyset$.

Now consider the morphism 
$$ \pi : \overline{X}\to \mathbb P^n_k=\mathrm{Proj}(k[T_0,\cdots, T_n]), \quad x\mapsto (f_0(x),..., f_n(x)).$$
We have $\pi^{-1}((1,0,..., 0))=V_+(f_1)\cap \cdots \cap V_+(f_n)$ (as schemes) is finite and smooth at $y_0$, so $\pi$ is unramified at $y_0$. Moreover $\pi^{-1}(\mathbb A^n_k)=D_+(f_0)=X$ if $\mathbb A^n_k$ corresponds to $T_0\ne 0$ in $\mathbb P^n_k$. 
It remains to see that $\pi$ is finite. This is e.g. Lemma 3 in Kedlaya, "More étale covers...", J. Alg. Geo. (2005). For completeness, let me give the arguments here. Let $z\in \mathbb P^n_k$. Then $z\in D_+(T_i)$ for some $i\le n$. We have $\pi^{-1}(z)$ proper over $k(z)$ because $\pi$ is proper, and affine because it is contained in the affine variety $D_+(f_i)$. So it is finite. This implies that $\pi$ is quasi-finite and proper, hence finite. 
If $X$ is smooth, one can construct the $f_i$ so that $V_+(f_1)\cap \cdots V_+(f_n)$ is smooth. Then $\pi$ is unramified above $\pi(y_0)$. If we can  manage to have $Y\supseteq V_+(f_1)\cap\cdots V_+(f_n)$, then $\pi|_Y$ has same degree as $\pi$. This is possible if $Y$ is also smooth and is defined by a single element $f_1$.