Dominant Morphism on Affine Varieties Let $X,Y\in \mathbb{A}^{n}_{k}$ affine varieties, I know that a morphism $f:X\rightarrow Y$ is dominant iff the correspondent morphism $\phi:k[Y]\rightarrow k[Y]$ is injective. How can I show from here that $\dim X$ is the largest number $n$ such that exists a dominant morphism $X\rightarrow \mathbb{A}_{k}^{n}$? 
 A: Let be $X\subseteq \mathbb{A}^n$ an affine variety.
Let be $C=\{r\in\mathbb{N}:\exists\hspace{0.1cm} X\longrightarrow \mathbb{A}^r \hspace{0.1cm}dominant \hspace{0.1cm}morphism\}$. 
We are going to show dim(X)=sup(C).


*

*We are goint to see $dim(X)\geq r$ $\forall$ $r\in C$:


Let be $r\in C$, then $\exists$ $X \longrightarrow \mathbb{A}^r$ dominant morphism, then $\exists$ $\mathbb{K}(X_1,...,X_r) \longrightarrow K(X)$ an inyective homomorphism of fields, or equivalently, $K(X)/\mathbb{K}(X_1,...,X_r)$ is an extension of fields.
So we have a tower of fields $\mathbb{K}\subset\mathbb{K}(X_1,...,X_r)\subset K(X)$, then:
$$trdeg(K(X)/\mathbb{K}) = trdeg(K(X)/\mathbb{K}(X_1,...,X_r)) + trdeg(\mathbb{K}(X_1,...,X_r)/\mathbb{K})=trdeg(K(X)/\mathbb{K}(X_1,...,X_r)) + r$$
Now we compute dim(X):
$$dim(X) = dim(A(X)) = trdeg(q.f(A(X))/\mathbb{K})=$$
$$=trdeg(K(X)/\mathbb{K})=trdeg(K(X)/\mathbb{K}(X_1,...,X_r)) + r\Rightarrow dim(X)\geq r$$


*We are going to see $dim(X)\leq sup(C):=m$.


We suppose $dim(X)>m$ and find a contradiction:
We know the identity map $X\longrightarrow \mathbb{A}^n$ is a dominant morphism, so n>m would be a contradiction.
So it is sufficient to show n>m:
$X$ is a variety, then X is irreducible, then I(X) is a prime ideal, then
$$dim(\mathbb{K}[X_1,...,X_n]/I(X)) = dim(\mathbb{K}[X_1,...,X_n]) -ht(I(X)) = n-ht(I(X))$$
So:
$$ m<dim(X) = dim(A(X)) = n-ht(I(X)) \Rightarrow n>m+ht(I(X)) \Rightarrow n>m$$
