# Is the sheaf of differentials of a smooth morphism locally free?

I have gotten myself confused about the definition of a smooth morphism of schemes. Let $$f: X \rightarrow Y$$ be a finite type morphism of noetherian schemes. My working definition for $$f$$ smooth at a point $$x \in X$$ with $$y = f(x)$$ is as follows:

1) $$f$$ is flat at $$x$$;

2) $$\Omega_{X/Y}$$ is locally free of rank $$d$$ equal to the krull dimension of $$\mathcal{O}_{X, x} \otimes_{\mathcal{O}_{Y, y}} \kappa(y)$$.

To be more specific say this is smooth of relative dimension $$d$$. Then I say $$f$$ is smooth if it is smooth at $$x$$ for all $$x \in X$$. This seems to agree with most sources I have seen. But in Hartshorne, smoothness is defined for morphisms of finite type $$k$$-schemes (at a point $$x$$) as follows:

1) $$f$$ is flat at $$x$$;

2) The fiber of $$\Omega_{X/Y}$$ at $$x$$ has dimension $$d$$, that is, $$\dim_{\kappa(x)}(\Omega_{X/Y, x} \otimes_{\mathcal{O}_{X, x}} \kappa(x)) = d$$.

But this latter definition doesn't seem to say anything whatsoever about $$\Omega_{X/Y}$$ being locally free. The only thing we seem to be able to conclude from Hartshorne's definition is that, by Nakayama, $$\Omega_{X/Y}$$ is generated by $$d$$ sections in a neighbourhood of $$x$$. But that doesn't at all imply that it is free in a neighbourhood of $$x$$.

I have heard some people claim that Hartshorne's definition is less general. But this seems to be showing the exact opposite: Hartshorne's definition seems far more general because it doesn't even require the sheaf of differentials to be locally free. Indeed Hartshorne seems to infer that being integral is required for his definition to yield local freeness.

So what am I missing here? Does the stalk of the sheaf of differentials have to be free at $$x$$ in order for a morphism to be smooth at $$x$$? Or does it simply have to be generated by at most $$d$$ sections?

These definitions are actually equivalent. One direction is clear, and the other takes a little work. The proof is essentially as follows: first one shows that the second part of Hartshorne's definition is equivalent to the fiber over $$\kappa(y)$$ being smooth, and then one finishes by arguing that flatness + all fibers over $$\kappa(y)$$ smooth implies $$X\to Y$$ smooth. The full argument may be seen at Stacks 01V9 - specifically, the bit you want is the combination of (3)+(4) implies (2) implies (1). If you only care about integral schemes, this proof is easier and is in fact mentioned by Hartshorne as lemma II.8.9 in the example immediately following the given definition.