Local trivialization for cotangent space of algebraic variety I'm trying to understand why around any non-singular point in an $n$-dimensional variety we can find $n$ regular functions $\{f_i\}$ such that $\{df_i\}$ generate the cotangent space at every point in the neighborhood. 
Given a basis for $T_p^{\ast}V$, I know that Nakayama's lemma tells us that there exist
$n$ functions $\{f_i\}$ such that $\{df_i\}$ is the basis we started out with. What's not clear is why these differentials of these $n$ functions also generate the cotangent space in a neighborhood of $p$. Is the property of $\{f_i\}$ generating a basis an open property, i.e. given by the non-vanishing of some polynomials? If not, how does one show this?
I'd appreciate any help on this problem. Thanks!
 A: I found an answer here, in the proof of lemma 1.6. I'll sketch out a proof here as well if the link ever dies.
Without loss of generality, we can assume $X$ is an affine non-singular variety after
passing to an affine open neighborhood. Our first claim is that we can do this in a 
manner such that the first $i$ coordinate functions $t_i$ when restricted to some open set $U$ around $p$ are the functions $f_i$. This can be seen by extending the collection $\{f_i\}$ to a generating set of $\mathcal{O}_X$.
That means the collection of the differentials $\{dt_i\}$ generate the cotangent space
at each point. But at $p$, the differentials $df_i$ also generate the cotangent space
at $p$. That means at $p$, the change of basis matrix from $dt_i$ to $df_i$ which is given by $\left( \frac{\partial f_i}{\partial t_i} \right)$ is invertible, i.e. its
determinant is non-zero, but that's an open condition, which means its determinant
is non-zero in a neighborhood, and in that neighborhood $\{df_i\}$ spans the cotangent
space.
