On an exercise in section 4 of Chapter I from Hartshorne's Algebraic Geometry It is about exercise 4.9:

Let $X$ be a projective variety of dimension $r$ in $\mathbb{P}^n$ with $n\geq r+2$. Show that for suitable choice of $P \notin X$ and a linear $\mathbb{P}^{n-1}\subseteq \mathbb{P}^n$, the projection from $P$ to $\mathbb{P}^{n-1}$ induces birational morphism of $X$ onto its image $X' \subseteq \mathbb{P}^{n-1}$. You will need (4.8A), (4.7A) and (4.6A).

Here is my thinking:
WLOG we can suppose that $X$ is an affine variety. The idea is that after a suitible change of coordinates, we can choose the hyperplane $H$ defined by $\lbrace x_n=0 \rbrace$ and take $P=(0,\dots,0,1)$ so that the projection is defined by  $(x_1,\dots,x_n) \mapsto (x_1,\dots,x_{n-1},0)$. We want to prove that the $k$-algebra homomorphism 
\begin{align}
\frac{k[x_1,\dots,x_{n-1}]}{\mathcal{I}(X)\cap k[x_1,\dots,x_{n-1}]} & \hookrightarrow 
\frac{k[x_1,\dots,x_n]}{\mathcal{I}(X)} \\
x_i & \mapsto x_i
\end{align}
induces an isomorphism of extensions of $k$
\begin{equation}
\phi:\text{Frac} \left( \frac{k[x_1,\dots,x_n]}{\mathcal{I}(X)\cap k[x_1,\dots,x_{n-1}]} \right) \rightarrow 
\text{Frac} \left( \frac{k[x_1,\dots,x_n]}{\mathcal{I}(X)} \right)
\end{equation}
Now let $K$ be the field of rational fuctions of X. Reasoning as in Proposition 4.9, it is possible to find a trascendence base such that, after changing coordinates, it is formed by rational functions $x_1,\dots,x_r \in K$ so that $K$ is a finite separable extension of $k(x_1,\dots,x_n)$. Consider the following extensions:
\begin{equation}
k \subseteq k(x_1,\dots,x_r,x_{r+1},\dots,x_{n-2}) \subseteq k(x_1,\dots,x_r,x_{r+1},\dots,x_{n-2})[x_{n-1},x_n]=K
\end{equation}
the second one is a finite separable extension, so by (4.6A) there is a rational fuction $\alpha$ which generates K as an extension of $k(x_1,\dots,x_r,x_{r+1},\dots,x_{n-2})$. Furthermore, there exist $f_1,f_2,g_1,g_2 \in k[x_1,\dots,x_n]$ such that 
\begin{equation}
\alpha = \frac{f_1(x_1,\dots,x_{n-2})}{g_1(x_1,\dots,x_{n-2})}x_{n-1} + \frac{f_2(x_1,\dots,x_{n-2})}{g_2(x_1,\dots,x_{n-2})}x_n
\end{equation}
At this point, I would like to ask if there is some continuation in order to prove that $\phi$ is surjective. 
Thank you very much for your answers.
 A: We assume $r = n-2$ and that we have $x_1,\ldots,x_{n-2}$ algebraically independent over $k$ (selected from $X_1/X_0,\ldots, X_n/X_0$):
$$K(X) = K = k(x_1,\ldots,x_{n-2})[x_{n-1},x_n] = F[x_{n-1},x_n]$$
with $x_{n-1}, x_{n}$ algebraic and separable over $F$. 
We assume, that $x_{n-1}$ and $x_n$ are linear independent over $k$ otherwise everything would be even easier.
Consider the linear expression
$(1-t)  x_{n-1} + t  x_n = x(t)$ with $t \in k$. Let $\sigma_1,\ldots, \sigma_d:K \to \bar{F}$ be the different embeddings over $F$ of $K$ into the algebraic closure of $F$. Call $W_{ij}$ the $F$-vector space of $x \in K$ with $\sigma_i(x) = \sigma_j(x)$.
Then $x(t)$ can not lie in a single $W_{ij}$ for all $t$, because otherwise $\sigma_i$ would be equal to $\sigma_j$ on $K$. So the intersection of $W_{ij}$ with the $x(t)$ is in an affine subspace of $k$, that is in a single $t_{ij}$. Assuming that $k$ is an infinite field (true because $k$ is assumed algebraically closed), we conclude, there is a $t' \in k$, such that 
$$x(t') = (1-t') x_{n-1} + t' x_n = \alpha$$
is in no $W_{ij}$ and therefore generates $K$ algebraically over $F$.
This gives the coefficients of a linear projection:
$$(x_1,\ldots,x_n) \mapsto (x_1,\ldots,x_{n-2}, x(t'), 0)$$
