I know this is probably a simple problem but I have got myself stuck trying to prove this fact myself. I'd be very grateful if anyone could clear this up for me.
Let $V$ be an affine variety in $\mathbb{A}^n$ (say, over an algebraically closed field $K$) and suppose $P = (0,\dots, 0)\in V$ is the origin of affine space. I am trying to prove there's an isomorphism between the "abstract" Zariski tangent space $T_P (V) = (\mathfrak{m}_P/\mathfrak{m}_P^2)^*$ and the "naive" vector space
$$W = \left\{(\alpha_1, \dots, \alpha_n): \sum_{i=1}^n \alpha_i \frac{\partial f}{\partial x_i} (P)=0, \quad \forall f\in I(V)\right\}$$
I've shown there's an injection $\phi: W\to T_P (V)$ as follows: for $Q = (\alpha_1, \dots, \alpha_n)\in W$ we get a linear functional $\phi_Q : \mathfrak{m}_P/\mathfrak{m}_P^2 \to K$ via
$$\phi(Q) = \phi_Q = \sum_{i=1}^n \alpha_i \frac{\partial}{\partial x_i}\lvert_P$$
which corresponds to taking a "weighted total derivative" of an equivalence class of a function $r\in \mathfrak{m}_P$ modulo $\mathfrak{m}_P^2$ i.e.
$$\phi_Q (\bar{r}) = \sum_{i=1}^n \alpha_i \frac{\partial r}{\partial x_i} (P)$$
where $\bar{r}$ denotes the image of $r$ in the quotient. This is indeed a linear functional on $\mathfrak{m}_P/\mathfrak{m}_P^2$. Moreover the mapping $\phi$ is an injective $K$-linear map $W\to T_P (V)$. What I'm struggling to do is show surjectivity of this map. Every element $g\in T_P (V)$ can be written as
$$ g = \sum_{i=1}^n \alpha_i g_i$$
where $g_i (\bar{x_j}) = \delta_{i j}$ is one of the dual basis vectors. What isn't clear to me is that the coefficients $\alpha_i$ come from some $Q = (\alpha_1, \dots, \alpha_n)\in W$ i.e. that
$$\sum_{i=1}^n g(\bar{x_i}) \frac{\partial f}{\partial x_i} (P) = 0, \quad \forall f\in I(V)$$
Can anyone explain why this map is surjective?
Edit: I mistakenly forgot to include the condition that the linear combination sums to zero in the definition of the "naive" tangent space in the original post, which caused some confusion. This has been amended above.