Let $X \subset \mathbb{C}^n$ be a smooth complex affine variety of dimension $m$. Let
$$I\_X \subset \mathbb{C}[z\_1, \ldots, z\_n]$$
be its ideal. Note that it is not always possible to find a set of generators
$$I\_X = \langle g\_1, \ldots, g\_r \rangle$$
such that $r = n - m$ is the codimension. In general, we only have $r \ge n - m$. But can we do this locally? That is:


**Question.** *Can we cover $X$ by distinguished open sets $X\_f$ such that by viewing $X\_f$ as an affine variety in $\mathbb{C}^{n + 1}$, its ideal is generated by $n + 1 - m$ elements?*


If not, is there a result of that flavour that I'm missing?



Locally, the minimal number of ideal generators is the codimension
I am just writing an answer to correct my mistake!


This is true for smooth subvarieties, roughly by the Jacobian criterion. For each closed point, the rank of the Jacobian matrix at that point equals the codimension $m$. So if you choose $m$ defining relations whose partial derivative vectors give $m$ linearly independent rows in the Jacobian matrix (or columns, depending how you write things), then those $m$ relations locally define $X\_f$.


My comment above was answering a different question: this is not true if you allow $X$ to be singular. There are "topological" consequences of being a set-theoretic local complete intersection, e.g., the connectedness theorem of Hartshorne. This prevents certain singular varieties from being set-theoretic complete intersections (notice, this connectedness theorem does not prevent curves in $3$-space from being set-theoretic complete intersections, and it is open whether all curves in $3$-space are set-theoretic complete intersections).


