Upper semicontinuity of $dim_k(m_y/{m_y}^2)$ 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.
 A: Since the question is local you may assume that $Y=Spec(A)\subset \mathbb A^N_k $, where $A=k[X_1,...,X_N]/(f_1,...,f_m)$.
In other words $Y$ is the fiber of $0$ for the morphism $f=(f_1,...,f_m):\mathbb A^N_k \to \mathbb A^m_k$ .
As in good old calculus we have  a Jacobian matrix  with value for each closed $x\in Y$ : 
   $$J(x)= (Jac (f))(x)  =(\frac{\partial f_i }{\partial x_j}(x))  \quad (i=1,...,m \;; j=1,...,N)             $$
The number you are interested in is exactly the nullity of that matrix:
$$ \phi(x)=dim(T_x(Y))=dim_k( ker\:J(x))=m-rank (J(x))               $$
The conclusion follows : if $\phi(y)=d$, then   some $(m-d)\times (m-d)$ minor of $J(y)$ is $\neq 0$.
It will remain $\neq0$ for all $x$ in a neighbourhood of $y$ and thus in that neighbourhood we will
have $rank (J(x))\geq m-d$ so that $\phi(x)=m-rank (J(x))\leq d$ as desired.   
Note that neither (non)-singularity nor cohomology are evoked. 
A: I think you can apply semicontinuity to sheaf of differentials.
But I don't see why affine line over C is a counterexample to andreas's question.
