## T^1 functors and Ext^1 in deformation theory

Why are the first-order deformations of a scheme $X$ over a field $k$ given by $Ext^1_{\mathcal O_X}(\Omega_X,\mathcal O_X)$, where here I mean the Ext group?

Furthermore, for an integral affine scheme $Spec B$ of finite type over algebraically closed $k$, why is $T^1(B/k,M)\cong Ext^1(\Omega_{B/k},M)$ for any torsion-free $B$-module $M$?

Writing $B=A/I$, where $A=k[x_1,...,x_n]$, we get an exact sequence, $0\rightarrow Hom(\Omega_{B/k},M)\rightarrow Hom(\Omega_{A/k}\otimes B,M)\rightarrow Hom(I/I^2,M)\rightarrow T^1(B/k,M)\rightarrow 0$. Since the $T^i$ functors commute with localization, we can localize to a principal open set, say $D(f)$, contained inside the dense open nonsingular locus of $Spec B$. But there the conormal exact sequence $I/I^2\rightarrow \Omega_{A/k}\otimes B\rightarrow \Omega_{B/k}\rightarrow 0$ is left exact as well, and the corresponding exact sequence for the $T^i$ functors is precisely the same long exact sequence obtained by applying $Hom(--,M)$ to the now left exact conormal sequence. Thus $T^1(B/k,M)= Ext^1(\Omega_{B/k},M)$ over $D(f)$. So my real question is why does this imply the result before localization? I suspect it has something to do with $M$ being torsion-free, but I'm not sure how to finish the argument.

These seem to be basic facts in Deformation theory, but I can't find a proof of them.

Thanks

-
 This is explained in Hartshorne's book on deformation theory. – J.C. Ottem Jun 28 at 15:36 @J.C. Ottem: The second part is in fact an exercise there, but I'm asking how to finish it. I just don't know how to get the unlocalized claim from what I've explained so far. As for the first question, do you know on what page it's explained? From another exercise there, I know that the global deformation functor T^1 fits in the same spot in a 4-term exact sequence (see p. 42, exercise 5.8) as Ext^1(\Omega,O_X) does in the s.e.s. coming from the local-to-global spectral sequence. But does this necessarily mean they're isomorphic? A priori the maps might be different. Let me know, thanks – HNuer Jun 28 at 16:14