In EGA IV, Sec. 16, Grothendieck defines the sheaf of principal parts as follows: Let $f:X\rightarrow S$ be a morphism of schemes and $\Delta:X\rightarrow X\times\_S X$ the diagonal morphism associated to $f$. $\Delta$ is an immersion, so the corresponding morphism $\Delta^{-1}\mathcal{O}\_{X\times\_S X}\rightarrow\mathcal{O}\_X$ is surjective. Let $\mathcal{I}$ denote its kernel and define the sheaves of principal parts as


$$\mathcal{P}\_{X/S}^n:=\Delta^{-1}( \mathcal{O}\_{X\times\_S X}) / \mathcal{I}^{n+1}$$


In their book on Crystalline cohomology, Berthelot and Ogus define the sheaf of principal parts $\mathcal{P}^n\_{X/S}$ as 


$$(\mathcal{O}\_X\otimes\_{f^{-1}\mathcal{O}\_S}\mathcal{O}\_X)/\mathbf{I}^{n+1},$$
where $\mathbf{I}$ is the kernel of the multiplication map from the tensor product to $\mathcal{O}\_X$.


My question is probably simple, but I don't know how to see it:
Why are those definitions equivalent if $X$ and $S$ are not affine and $n>0$? 


I've not seen the second definition anywhere else, although it seems somewhat nicer than the first one...



Sheaves of Principal parts
The statement holds in general if $f : X \to S$ is a morphism of locally ringed spaces. The fibred product of locally ringed spaces can be constructed explicitly without gluing constructions, and also restricts to the fibred product of schemes. See [this article](http://maddin.110mb.com/pdf/faserprodukte.pdf) (german; shall I translate it?) for details. I will make use of the explicit description given there. Also I use stalks all over the place. Probably this is not the most elegant proof, but it works.


First we construct a homomorphism $\mathcal{O}\_X \otimes\_{f^{-1} \mathcal{O}\_S} \mathcal{O}\_X \to \Delta^{-1} \mathcal{O}\_{X \times\_S X}$. For that we compute the stalks at some point $x \in X$ lying over $s \in S$:


$(\mathcal{O}\_X \otimes\_{f^{-1} \mathcal{O}\_S} \mathcal{O}\_X)\_x = \mathcal{O}\_{X,x} \otimes\_{\mathcal{O}\_{S,s}} \mathcal{O}\_{X,x},$


$(\Delta^{-1} \mathcal{O}\_{X \times\_S X})\_x = \mathcal{O}\_{X \times\_S X,\Delta(x)} = (\mathcal{O}\_{X,x} \otimes\_{\mathcal{O}\_{S,s}} \mathcal{O}\_{X,x})\_{\mathfrak{q}}$,


where $\mathfrak{q}$ is the kernel of the canonical homomorphism


$\mathcal{O}\_{X,x} \otimes\_{\mathcal{O}\_{S,s}} \mathcal{O}\_{X,x} \to \kappa(x), a \otimes b \mapsto \overline{ab}.$


Thus we get, at least, homomorphisms between the stalks (namely localizations). In order to get sheaf homomorphisms out of them, the following easy lemma is useful:


(\*) Let $F,G$ be sheaves on a topological space $X$ and for every $x \in X$ let $s\_x : F\_x \to G\_x$ be a homomorphism. Suppose that they fit together in the sense that for every open $U$, every section $f \in F(U)$ and every $x \in U$ there is some open neighborhood $x \in W \subseteq U$ and some section $g \in G(W)$ such that $s\_y$ maps $f\_y$ to $g\_y$ for all $y \in W$. Then there is a sheaf homomorphism $s : F \to G$ inducing $s$.


This can be applied in the above situation: Every section in a neighborhood of $x$ in $\mathcal{O}\_X \otimes\_{f^{-1} \mathcal{O}\_S} \mathcal{O}\_X$ induced by an element in $\mathcal{O}\_X(U) \otimes\_{\mathcal{O}\_S(V)} \mathcal{O}\_X(U)$ for some neighborhoods $U$ of $x$ and $V$ of $s$ such that $U \subseteq f^{-1}(V)$. This yields a section in $\mathcal{O}\_{X \times\_S X}$ on the basic-open subset $\Omega(U,U,V;1)=U \times\_V U$ and thus a section of $\Delta^{-1} \mathcal{O}\_{X \times\_S X}$ on $U$. It is easily seen, that this construction yields the natural map on the stalks.


Thus we have a homomorphism $\alpha : \mathcal{O}\_X \otimes\_{f^{-1} \mathcal{O}\_S} \mathcal{O}\_X \to \Delta^{-1} \mathcal{O}\_{X \times\_S X}$. Now let $J$ be the kernel of the multiplication map $\mathcal{O}\_X \otimes\_{f^{-1} \mathcal{O}\_S} \mathcal{O}\_X \to \mathcal{O}\_X$ and $I$ be the kernel of the homomorphism $\Delta^\# : \Delta^{-1} \mathcal{O}\_{X \times\_S X} \to \mathcal{O}\_X$. Then for every $n \geq 1$ our $\alpha$ restricts to a homomorphism


$(\mathcal{O}\_X \otimes\_{f^{-1} \mathcal{O}\_S} \mathcal{O}\_X)/J^n \to (\Delta^{-1} \mathcal{O}\_{X \times\_S X})/I^n,$


which is given at $x \in X$ by the natural map


$(\mathcal{O}\_{X,x} \otimes\_{\mathcal{O}\_{S,s}} \mathcal{O}\_{X,x}) / \mathfrak{p}^n \to ((\mathcal{O}\_{X,x} \otimes\_{\mathcal{O}\_{S,s}} \mathcal{O}\_{X,x}) / \mathfrak{p}^n)\_{\mathfrak{q}}$,


where $\mathfrak{p} \subseteq \mathfrak{q}$ is the kernel of the multiplication map $\mathcal{O}\_{X,x} \otimes\_{\mathcal{O}\_{S,s}} \mathcal{O}\_{X,x} \to \mathcal{O}\_{X,x}$.


We want to show that this map is an isomorphism, i.e. that the localization at $\mathfrak{q}$ is not needed. For that it is enough to show that every element in $\mathcal{O}\_{X,x} \otimes\_{\mathcal{O}\_{S,s}} \mathcal{O}\_{X,x}$, whose image in $\mathcal{O}\_{X,x}$ is invertible, is invertible modulo $\mathfrak{p}^n$. Or in other words: Preimages of units are units with respect to the projection


$(\mathcal{O}\_{X,x} \otimes\_{\mathcal{O}\_{S,s}} \mathcal{O}\_{X,x}) / \mathfrak{p}^n \to (\mathcal{O}\_{X,x} \otimes\_{\mathcal{O}\_{S,s}} \mathcal{O}\_{X,x}) / \mathfrak{p}^1 \cong \mathcal{O}\_{X,x}$.


However, this follows from the observation that the kernel $\mathfrak{p}^1 / \mathfrak{p}^n$ is nilpotent; cf. also [this question](https://mathoverflow.net/questions/31495/when-does-a-ring-surjection-imply-a-surjection-of-the-group-of-units/32919#32919).


I'm sure that there is also a proof which avoids stalks at all.


EDIT: So here is a direct construction of the homomorphism $\mathcal{O}\_X \otimes\_{f^{-1} \mathcal{O}\_S} \mathcal{O}\_X \to \Delta^{-1} \mathcal{O}\_{X \times\_S X}$:


Let $p\_1,p\_2$ be the projections $X \times\_S X \to X$. Then we have for $i=1,2$ the homomorphism


$\mathcal{O}\_X \to {p\_i}\_\* \mathcal{O}\_{X \times\_S X} \to {p\_i}\_\* \Delta\_\* \Delta^{-1} \mathcal{O}\_{X \times\_S X} = (p\_i \Delta)\_\* \Delta^{-1} \mathcal{O}\_{X \times\_S X} = \Delta^{-1} \mathcal{O}\_{X \times\_S X}$,


and they commute over $f^{-1} \mathcal{O}\_S$. Thus we get the desired homomorphism. But I think stalks are convenient when we want to show that this is an isomorphism when modding out the ideals.


