Lemma 10.151.4. Let $R \to S$ be a ring map. If $R \to S$ is unramified, then there exists an idempotent $e \in S \otimes _ R S$ such that $S \otimes _ R S \to S$ is isomorphic to $S \otimes _ R S \to (S \otimes _ R S)_ e$.

Proof. Let $J = \mathop{\mathrm{Ker}}(S \otimes _ R S \to S)$. By assumption $J/J^2 = 0$, see Lemma 10.131.13. Since $S$ is of finite type over $R$ we see that $J$ is finitely generated, namely by $x_ i \otimes 1 - 1 \otimes x_ i$, where $x_ i$ generate $S$ over $R$. We win by Lemma 10.21.5. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).