Tangent space of a point of an affine variety

Let $k$ be a field. Let $f_1,\dots f_r$ be polynomials in $k[x_1,\dots,x_n]$. Let $V$ be an affine variety in $k^n$ defined by $f_1,\dots f_r$, i.e. $V = \{p \in k^n| f_i(p) = 0$ for all $i\}$. Let $p = (a_1,\dots,a_n)$ be a point of $V$. Let $L_i$ be the hyperplane defined by $\sum_k \frac{\partial f_i}{\partial x_k}(p)(x_k- a_k) = 0$. Let $T_p = \bigcap_i L_i$.

Let $g_1,\dots g_s$ be polynomials in $k[x_1,\dots,x_n]$. Suppose $V = \{p \in k^n| g_i(p) = 0$ for all $i\}$. Let $L_i'$ be the hyperplane defined by $\sum_k \frac{\partial g_i}{\partial x_k}(p)(x_k - a_k) = 0$. Let $T_p' = \bigcap_i L_i'$.

Is $T_p = T_p'$? If this is not the case, what if $k$ is algebraically closed?

-
If I read this right, then no this is not true (depending on your definition of variety). Let $n=2$ and $k=\mathbb{C}, r=1, f_1=x, g_1=x^3, p=(0,0)$. Then $T_p = 1(0,0)(x-0) = x$ but $T_p' = 3x^2(0,0)(x-0) = 0$. So $T_p' \neq T_p$. –  Derek Allums Nov 18 '12 at 22:43
@unit3000-21 I think you are right. So the tangent space should be defined by generators of $I(V)$, where $I(V)$ is the set of polynomials which vanish on $V$. –  Makoto Kato Nov 18 '12 at 23:08
@MakotoKato: the space $T_p$ you defined is the tangent space at $p$ to the affine scheme associated to $k[x_1, \dots, x_n]/(f_1, \dots, f_r)$ –  user18119 Nov 18 '12 at 23:13
@QiL Right. Thanks. –  Makoto Kato Nov 18 '12 at 23:17

This is a nice question which permits to illustrate the superiority of schemes over classical varieties.

Every ideal $I\subset k[x_1,...,x_n]$ yields a subscheme $V(I)\subset \mathbb A^n_k$ and this yields is a perfect bijective correspondence between ideals of $k[x_1,...,x_n]$ and closed subschemes of $\mathbb A^n_k$.
Consider for example the ideals $I=(x,y),J=(y,x^2), K= (x^2,y^2) \subset k[x,y]$.
They correspond to three schemes $V(I), V(J), V(K)\subset \mathbb A^2_k$ which are different although their underlying set is the same singleton set $\lbrace (0,0) \rbrace$.
The best proof that they are different is that their tangent spaces at their single point are the different subvectorspaces of $k^2$ equal respectively to zero, the $x$-axis $y=0$ and the whole space $k^2$.

Classically one would be baffled because one would have to say that $I,J,K$ define the same subvariety of $\mathbb A^2_k$ but that the ideals $J$ and $K$ don't allow to define the tangent space.
The way out would have been to declare that the correct ideal of a subvariety $V$ is the ideal $i(V)$ of polynomials vanishing on the variety $V$, which corresponds (by the Nullstellensatz) in the case of an algebraically closed field to $V(\sqrt I)$ where $I$ is any ideal for which $V(I)=V$ set-theoretically .

The scheme point of view is clearer, more refined and perfectly solves the conundrum posed in the question about the tangent space of a variety defined by two different sets of polynomials $f_1,\dots f_r$ and $g_1,\dots g_s$: we do not have $T_p=T'_p$ in general because we do not have $V(f_1,\dots f_r)=V(g_1,\dots g_s)$ scheme-theoretically

-
"The best proof that they are different is that their tangent spaces at their single point are the different subvectorspaces of k2 equal respectively to zero, the x-axis y=0 and the whole space k2." This is nice. –  Makoto Kato Nov 19 '12 at 21:18