Hartshorne ex III.10.2 on smooth morphisms I need some help with the following exercise:
Let $f:X\rightarrow Y$ be a flat proper morphism between varieties over $k$, where variety means separated, finite type, integral, and $k$ not necessarily algebraically closed. Suppose that for some $y \in Y$ that $X_{y} \rightarrow k(y)$ is smooth. According to the definition of smooth given in that section, this just means for all $x$ in $X_{y}$, $n=dim_{k(x)}(\Omega_{X_{y}/k(y)}\otimes k(x))$ where $n=dim X - dim Y$. Show that there is an open subset $U$ of $Y$ such that $f^{-1}U\rightarrow U$ is smooth. 
My idea: It's easy to show that $dim_{k(x)}(\Omega_{X_{y}/k(y)}\otimes k(x)) = dim_{k(x)}(\Omega_{X/Y}\otimes k(x))$. This means that for each $x$ in $f^{-1}(y)$, there is a neighborhood $U_{x}$ such that $dim_{k(z)}(\Omega_{X/Y}\otimes k(z))\leq n$ for all $z\in U_{x}$. Somehow we need to find a (possibly smaller) neighborhood for which the reverse inequality holds. 
If $y$ were a closed point, so that $p:X_{y}\hookrightarrow X$ is a closed immersion, then since $X_{y}$ is quasi-compact we can take a finite number of $U_{x_{i}}$ to cover $p(X_{y})$. Then $U=\cap_{i=1}^{n} f(U_{x_{i}})$ is an open subset of $Y$ containing $y$, since $f$ is flat hence open. Then the claim is that this $U$ works. Don't know about the case where $y$ isn't a closed point. also, don't see how proper comes into play. 
This feels dlose to right to me, but who knows. Actually, if it helps to keep the assumption that $y$ is closed, then keep it since this is the only case which interests me anyways. 
 A: Let X be a locally noetherian scheme, and F a coherent sheaf on X. Then the free locus of F is an open subset of X and the function $x\mapsto \textrm{Rank}F_{x}$ is locally constant on the free locus.
This can be shown by reducing to the affine case X=Spec(A). If M is a finitely generated A-module and $\mathfrak{p}\subset A$ a prime ideal, such that $M_{\mathfrak{p}}$ is free over $A_{\mathfrak{p}}$ with basis $\frac{x_{1}}{1},\ldots,\frac{x_{n}}{1}$, then the morphism $f:A^{n}\to M$ sending the standard basis to $x_{i}$ is an isomorphism at $\mathfrak{p}$. Since the kernel and cokernel of this morphism have closed support in Spec(A), f is an isomorphism on an open set containing $\mathfrak{p}$.
Now you can apply this to $\Omega_{X/Y}$.
Edit: Smoothness is an open property on Y:
Let $U\subset X$ be the smooth locus of f (this is an open set, as shown above).
Then the singular locus $Sing(f)=X\backslash U$ is closed. Since f is proper it is a closed map. So $Y\backslash f(Sing(f))$ is open.
You'll find theorems of this type in EGA IV.
