Let $Y$ be a scheme of finite type over an algebraically closed field $k$. Show that the function $\phi(y) = dim_k(m_y/{m_y}^2)$ is upper semicontinuous on the set of closed point of $Y$ (i.e. for any point $y$, there exists an open neighborhood $U$, such that for any $x \in U, \phi(y) \geq \phi(x)$ ).
I have two thoughts about this problem:
1) If $y$ is a smooth point, then using the property that singular set is closed, one can show semicontinuity. So the difficulty comes from the singular point.
2) I would like to using semicontinuity theorem of cohomology of fibers, but I don't know how to construct the corresponding coherent sheaf.