# Second exact sequence for closed embedding of nonsingular varieties.

This is part of Theorem 8.17 in Hartshorne's Algebraic geometry.

Let $X$ be a nonsingular variety over $k$. Let $Y$ be a closed nonsingular subvariety of $X$. Show that the second exact sequence $$0\to {\mathscr{I}}/{\mathscr{I}^2}\xrightarrow{\delta} \Omega_{X/k}\otimes \mathcal{O}_Y\xrightarrow{\phi} \Omega_{Y/k}\to 0$$ is exact.

I want to show the injectivity of the first map.

The proof in Hartshorne's book is as follows:

Let $n=\dim X$, $q=\dim Y$ Since $Y$ is nonsingular, $\Omega_{Y/k}$ is locally free of rank $q$, the image of $\delta$ is a locally free sheaf of rank $r=n-q$. Since the question is local, we may assume $X$ is affine, and $\mathrm{im}\delta,\Omega_{X/k}\otimes \mathcal{O}_Y$ and $\Omega_{Y/k}$ are all free. In particular, we can choose $x_1,\dots , x_r\in \mathscr{I}$ s.t. the image of $\delta$ is generated by $dx_1,\dots ,dx_m$. Let $\mathscr{I'}$ be the ideal sheaf generated by $x_1,\dots , x_r$. Then he tries to show that

1) The sequence $$0\to {\mathscr{I'}}/{\mathscr{I'}^2}\xrightarrow{\delta'} \Omega_{X/k}\otimes \mathcal{O}_{Y'}\xrightarrow{\phi'} \Omega_{Y'/k}\to 0$$ is exact. And $\Omega_{Y'/k}$ is locally free of rank $q$.

2)$\mathscr{I'}=\mathscr{I}$.

I know how to derive 2) once we have 1). But I can't understand the argument for 1). In the book, it is said that the image of $\delta'$ is locally free of rank $r$, why is this true?

Also, given that the image of $\delta'$ is locally free, why $\Omega_{Y'/k}$ is locally free as well? I know in general, quotient of a locally free sheaf by a locally free subsheaf may not be locally free, by the following examples on $\mathbb{A}^1$: $$0\to \widetilde{k[x]}\xrightarrow{\cdot x} \widetilde{k[x]} \to \widetilde{k} \to 0$$.

Any help or hints are appreciated. Thank you in advance.