I'm reading Vakil's note about differential sheaf. Let $\pi:X\rightarrow Y$ be a morphism of schemes. He defines $d:\mathcal O_{X}\rightarrow \Omega_{X/Y}$ as follow.
Let $pr_1:X\times_YX\rightarrow X$ and $pr_2:X\times_YX\rightarrow X$ be projections. Then $d$ on open set $U$ is defined by $df = pr_2^*f - pr_1^*f$.
My question:
I don't understand this definition. I think if $f\in\mathcal O_X(U)$, then $pr_1^*f$ is an element of $\mathcal O_{X\times_YX}(U\times_YX)$. But why $df = pr_2^*f - pr_1^*f$ gives an element in $\Omega_{X/Y}(U)$?
How to see $d$ coincides with the Kahler differential module on affine open set? This is one of his exercises.
I try to compute $\Omega_{X/Y}(U)$ for $U = Spec(A)$. Here is my attempt: $\Omega_{X/Y}(U) = \Delta^*(\mathcal I/\mathcal I^2)(Spec(A)) = (I/I^2)\otimes_{A\otimes A}A$ from the definition of pullback where $I^\sim = \mathcal I$. But it seems like the correct thing is $\Omega_{X/Y}(U) = I/I^2$. What's wrong with my computation?


Let me first address question 3.
There is a small error in your calculation.* Generally, given a closed embedding $i: Z \to W$ defined by a quasicoherent ideal sheaf $\mathcal{I}_Z$, the conormal bundle $\mathcal{N}^\vee_{Z/W}$ is given by $i^* \mathcal{I}_Z \cong \mathcal{I}_Z/(\mathcal{I}_Z)^2$. (Here, I've used the identity $i^* \mathcal{M} \cong \mathcal{M}/\mathcal{I_Z}\mathcal{M}$ as modules over $\mathcal{O}_Z \cong \mathcal{O}_W/\mathcal{I}_Z$, where $\mathcal{M}$ is a module over $\mathcal{O}_W$.) So in particular, $\Omega_{X/Y} = \Delta^* \mathcal{I}_\Delta = \mathcal{I}_\Delta/(\mathcal{I}_\Delta)^2$.** In the case of an affine open $U=\operatorname{Spec} A \subseteq X$ and affine open $V =\operatorname{Spec} B \subseteq Y$ with $f(U)\subseteq V$, we have $U \times_V U \subseteq X\times_Y X$ affine open and $U \to U\times_V U$ a closed embedding. Then $\mathcal{I}_\Delta(U\times_V U)$ is the kernel of the multiplication map $A\otimes_B A \to A$, and it is generated by elements $f \otimes 1 -1\otimes f$ where $f \in A$. Then elements of $\Omega_{X/Y}(U)$ will be of the form $f \otimes 1 -1\otimes f \bmod (\mathcal{I}_\Delta)^2$.For your question 1, there are a couple of implicit restrictions going on. In the setting you describe, we actually restrict $\mathrm{pr}_1^* f$ to $U\times_Y U$, and similarly for $\mathrm{pr}_2^* f$. Then $\mathrm{pr}_2^* f -\mathrm{pr}_1^* f$ is an element of $\mathcal{O}_{X\times_Y X}(U \times_Y U)$ which vanishes on the diagonal. In other words, it is an element of $\mathcal{I}_\Delta(U\times_V U)$. In terms of affine open patches, (with $U$ and $V$ as above), we get that this element is $f\otimes 1 - 1\otimes f$. (Or possibly we get the negative of this, depending on whether or not I've mixed up $\mathrm{pr}_1$ and $\mathrm{pr}_2$.) We see then that $\mathrm{pr}_2^* f -\mathrm{pr}_1^* f \bmod (\mathcal{I}_\Delta)^2$ is an element of $\mathcal{I}_\Delta/(\mathcal{I}_\Delta)^2$.
For your second question, one can use the description $\mathcal{I}_\Delta(U) = \operatorname{ker}(A\otimes_B A \to A)$ to check that $(\mathcal{I}_\Delta/(\mathcal{I}_\Delta)^2)(U)$ has the same universal property as $\Omega_{A/B}$. (Here, I'm using the fact that quasicoherent sheaves on an affine scheme are exactly modules over the corresponding ring.) Try it out and let me know if I can clarify anything :)
* I'm sorry, there's actually not an error in your calculation. In fact, we have $i^* \mathcal{I}_Z \cong \mathcal{I}_Z/(\mathcal{I}_Z)^2 \cong i^*(\mathcal{I}_Z/(\mathcal{I}_Z)^2)$ for any closed embedding $i: Z\to W$.
** To define the sheaf $\mathcal{I}_\Delta$, we choose a factorization $X \to W \to X\times_Y X$ of the diagonal embedding into a closed embedding followed by an open embedding. Then $\mathcal{I}_\Delta$ is the quasicoherent ideal sheaf of $\mathcal{O}_W$ corresponding to $X \to W$.