Proof of algebraic set involving dimension I need some help to understand the following proof.
Let $k$ a field and $V$ an algebraic set. I note $\mathfrak{m}_P$ the ideal generated by $X_1-a_1,\dots ,X_n-a_n$ in $k[V]=k[X_1,\dots ,X_n]/I(V)$ with $P=(a_1,\dots ,a_n)$.

Theorem.
  $\left\lbrace P\in V\mid \dim_k ~^{\mathfrak{m}_P} \big/ _{\mathfrak{m}_P^2} > \min\limits_{P\in V}\dim_k ~^{\mathfrak{m}_P} \big/ _{\mathfrak{m}_P^2}\right\rbrace$ is a algebraic subset of $V$.

I will first give you the exact proof that I am studying and then tell you what I don't understand.
Proof :
Let $f_1,\dots ,f_r$ be generators of $I(V)$. If $(0,\dots ,0)\in V$ and $\mathfrak{m}= \left< X_1,\dots , X_n \right>\subset k[X_1,\dots ,X_n]$ we want to calculate
$$\dim_k ~^{\mathfrak{m}} \big/ _{\left<\mathfrak{m}^2,I(V)\right>} = \dim_k ~^{\mathrm{Span}(X_1,\dots ,X_n)} \big/ _{\left<\overline{f_i}~;~1\leq i \leq r\right>} . $$
If 
$$f_i(X_1,\dots ,X_n) = \sum_{j=1}^n a_{i,j}X_j + \underbrace{\sum a_{i,j_1,j_2}X_{j_1}X_{j_2}}_{=0 \text{ modulo }\mathfrak{m}^2}$$
The vector subspace $\left< \overline{f_i}~;~1\leq i \leq r\right>$ is generated by $(a_{i,1},\dots ,a_{i,n})=\mathrm{grad} f_i (0,\dots ,0)$ with $1\leq i \leq r$.
$$\dim_k ~^{\mathfrak{m}_0(V)} \big/ _{\mathfrak{m}_0^2(V)} = \dim_k ~^{\mathrm{Span}(X_1,\dots ,X_n)} \big/ _{\mathrm{Span}~\mathrm{grad} f_i}  $$
We will consider $P=(t_1,\dots ,t_n)\in V$ using a translation. The coefficients $a_{i,j}=P_{i,j}(t_1,\dots ,t_n)\in k[t_1,\dots , t_n]$.
$$\dim_k ~^{\mathfrak{m}_P} \big/ _{\mathfrak{m}_P^2} = n -\text{rank}(P_{i,j}(t_1,\dots ,t_n)).$$
And $\text{rank}(P_{i,j}(t_1,\dots ,t_n))$ is not maximal is an algebraic subset.
End of the proof.
I would say that I'm not really understanding much in this. For example why considered $\mathfrak{m}$ in $k[X_1,\dots ,X_n]$ are we not supposed to work on $k[V]$ ?
Is the vector subspace $\left< \overline{f_i}~;~1\leq i \leq r\right>$ is generated by $(a_{i,1},\dots ,a_{i,n})=\mathrm{grad} f_i (0,\dots ,0)$ with $1\leq i \leq r$ in $\mathrm{Span}(X_1,\dots ,X_n)$ ?
Why the dimension $\dim_k ~^{\mathfrak{m}} \big/ _{\left<\mathfrak{m}^2,I(V)\right>}$ with $\mathfrak{m}$ ideal of $k[X_1,\dots ,X_n]$ is equal to $\dim_k ~^{\mathfrak{m}_0(V)} \big/ _{\mathfrak{m}_0^2(V)} $ with ideals of $k[V]$ ?
I will greatly appreciate if someone takes some time to give me more details of this proof. Thank you in advance.
 A: The statement is weirdly written. Let me try to say it more conceptually. Assume $X$ is irreducible, for convenience. (And also the ideal cutting out $X$ is radical.) 
In this setting, it is a (difficult) theorem that $X$ is smooth on an open set, hence "generically" the dimension of $m_p/m_p^2$ is the dimension of the variety. Hence the set described is the set of singular points on the variety - those where the dimension of the Zariski cotangent space is larger than expected. But this is exactly the set where the cokernel of the Jacobian matrix is too large in dimension, so where the rank is too small, so where a certain collection of minors vanish. This last series of observations is essentially the idea of the proof you give...
I don't really understand your complaints, but maybe doing the following computations would help:


*

*Let $f$ be a hypersurface in $A^3$. Let $df|_{p}$ be the linear part of the Taylor expansion of $f$ around $p$ (this is determined by the matrix of partial derivatives $\partial f /\partial x_i$ evaluated at $p$). This naturally defines a map from $k$ to the cotangent space of $A^3$ at p where 1 is sent to $\Sigma (\partial f / \partial x_i)(p) (x_i - p_i)$, and the cokernel of $df|_{p}$ computes the tangent space of $V(f)$ at p. For example, at the origin, taking this cokernel "mods out" from $(X_1, \ldots, X_N)$ the linear part of the Taylor series expansion of $f$ the origin in order to get the Zariski cotangent space. (Because the linear piece of $f$ is what we get after modding out by $m^2$, hence it is the relation imposed on the Zariski cotangent space of affine space to get the Zariski cotangent space of the hypersurface.)

*Generalize to $V(f_1, \ldots, f_n)$: the Zariski cotangent space will be computed by the cokernel of a matrix of derivatives instead; there is a natural basis for tangent space to affine space given by the $x_i - p_i$, hence people often identify the Jacobian matrix with the partial derivatives.

*Consider the space of all matrices of $nxn$. It is naturally an affine space. Show that the locus of matrices of rank $\leq k$ is closed. This was the case when $M$ is the matrix of "generic coefficients" $(a_{ij})$, where $a_{ij}$ where coordinates on some affine space. Generalize to the setting when $M$ has entries polynomials in $x_i$, where the $x_i$ are coordinate functions on some other affine space $A^m$: again show the same statement about rank. So, $A^m$ stratifies into a chain of closed subsets on which the rank of $M$ drops when we plug in points of $A^m$: call them $X_n \supset X_{n-1} \ldots$

*Suppose that $Y$ is a variety in $A^m$, and let $m$ be the minimal rank of $M$ on $Y$. That is, $X_{m'} \cap Y = \emptyset$ for $m' < m$, so $X_{m'}^c \supset Y$, and also $Y_m := X_m \cap Y \not = \emptyset$. Now, $Y_m$ is closed in $Y$, and is the locus where the rank of $M$ is minimal on $Y$. 

*Connect 1-4 by studying the matrix $(\partial f_i / \partial x_j)$. This will give the result you are trying to understand.


Hope it helps!
