(That means, the image of the diagonal map ) is closed in . In other words, is closed if and only if there exists an ideal sheaf of such that induces an isomorphism of schemes.
Then it is easy to see that gives the defining equation of the diagonal .
For the general affine morphism case, let be a scheme which is affine over . Then we have . We may then see the situation locally and reduce the problem to the first case.
The diagonal is isomorphic to , and is therefore closed.
Now, let us prove the lemma. Since is separated over , we have a closed immersion
By taking a base extension, we obtain a closed immersion
Then is identified with the composition of closed immersions
is a closed immersion. Now may be identified with a pullback of the morphism above