Algebraic Geometry Smoothness I was reading Chapeter 10 in Gathmann notes about Tangent space and I came across this question.
Let $\boldsymbol X $ be irreducible, 1-dimensional variety and let $\boldsymbol a $$\in$ $\boldsymbol X $.
Prove that $\boldsymbol X $ is smooth at  $\boldsymbol a$ if and only if the maximal ideal of the ring $ \mathcal O_{x,a} $ is a principal ideal.
for direction $\implies$ I assumed that X is smooth at a, which implies that $T_aX$=Codima{a}= 1 since $\boldsymbol X $ is irreducible.
We know that $T_aX$ is the vector space dual $M/M^2$ which is isomorphic to $\ S^{-1}M/(S^{-1}M)^2$. In particular $T_aX$ is isompophic to $I_a/I_a^2$, where $I_a$ is the maximal ideal of $ \mathcal O_{x,a} $
so we have that 1= dim ($I_a/I_a^2$)
from this I assume that I should deduce that $I_a$ is principle. I think that I should use Nakayama's lemma, but I am not sure how I do so.
Do you have any hints please ? I assume also that this proof can be iff, so there is no need to prove the other direction, right?
Thanks very much!
 A: As you said: $X$ is regular in $a$ if and only if $\dim_{\mathcal O_{X,a}/I_{X,a}}(I_{X,a}/I_{X,a}^2)=\dim \mathcal O_{X,a}$, that is $\mathcal O_{X,a}$ is a regular local ring.
Assume that $X$ is regular at $a$. Then $\mathcal O_{X,a}$ is a regular local ring and thus (by some commutative algebra) an integral domain. Consider an arbitrary prime ideal $P$ of $\mathcal O_{X,a}$ of codimension $1$. Every prime lies within a maximal one -- and there is only one. Hence $P\subseteq I_{X,a}$. But as $I_{X,a}$ has codimension $0$ we have $P\subsetneq I_{X,a}$. Now if $P\ne 0$ then $0\subsetneq P\subsetneq I_{X,a}$ would be a chain of prime ideals (as $\mathcal O_{X,a}$ is integral) of length $2$, contradicting $\dim \mathcal O_{X,a}=1$. Thus $P=0$ and $P$ is principal (generated by $0$). Thus every prime of $\mathcal O_{X,a}$ of codimension $1$ is principal. Then by proposition 2.37 the ring $\mathcal O_{X,a}$ is a UFD. But a $1$-dimensional UFD is a PID. In particular $I_{X,a}$ is principal. This finishes one direction.
Let's now assume that $I_{X,a}$ is principal. I assume we can easily show that $\dim_K I_{X,a}/I_{X,a}^2 = 1$ where $K=\mathcal O_{X,a}/I_{X,a}$. Then $\dim \mathcal O_{X,a} = \dim_K I_{X,a}/I_{X,a}^2$ so $\mathcal O_{X,a}$ is regular. Maybe try this for yourself, I am out of time at the moment ;D
