# graph of the compostion of morphisms category-theoretically

My question is about a certain category-theoretic statement really but since I came to it trying to prove something about non-reduced schemes, I'll state it in this language.

Let $M$ be a scheme (over some base scheme that fix once and forget), and let $p_1, p_2$ be projections on first and second factors of $M \times M$. A closed subscheme $Z \subset M \times M$ is called a graph of a morphism $f: M \to M$ if $p_1$ restricted to $Z$ is an isomorphism with $M$ and $f=p_2 \circ p_1^{-1}$.

Let $\Gamma(f), \Gamma(g)$ be graphs of morphisms $f,g: M \to M$. Consider the fibre product $X = \Gamma(f) \times_{p_2, M, p_1} \Gamma(g)$. There are three morphisms from $X$ to $M$: the projection on $\Gamma(f)$ composed with $p_1$, the structure morphism to $M$, and the projection on $\Gamma(g)$ composed with $p_2$. Therefore a morphism to $M \times M \times M$ is induced. Let $Y$ be the image under this morhpism and let $Z$ be the image of the projection $M \times M \times M \to M \times M$ to first and third coordinate. (suppose all morphisms proper, and understand by image the scheme-theoretic image, i.e. the smallest closed subscheme through which the morphism factors).

Claim: $Z$ is the graph of $g\circ f$.

Now, set-theoretically this statement would be obvious (because it can be checked at on points, precisely). I have been trying to prove this statament for non-reduced schemes and have had hard time understanding what category-theoretic properties of morphisms I need in the proof. Although the detailed proof might be a tedious exercise, I would be grateful if someone indicated the key proof points.

Thanks!

-
What do you mean by image? –  Martin Brandenburg Feb 11 '14 at 14:50
oh, I should have remarked that all morphisms are proper and image is the minimal closed subcheme through which a morphism factors. –  Dima Sustretov Feb 11 '14 at 14:52

The context in which to understand results of this form is composition of spans in a category $C$ with pullbacks. In such a category, a span is a diagram of the form $X \leftarrow F \to Y$, which you can think of as generalized relations or, in the context of algebraic geometry, as generalized correspondences. In particular a span should be interpreted as a morphism from $X$ to $Y$ in a category of spans, generalizing composition of relations. Composition of spans is given by pullback as follows: a span from $X$ to $Y$ and a span from $Y$ to $Z$ arrange themselves into a diagram of the form

$$X \leftarrow F \to Y \leftarrow G \to Z$$

and the composite span is the pullback $F \times_Y G$ equipped with the projections to $X$ and $Z$.

Spans form a (bi)category $\text{Span}(C)$ into which $C$ embeds as follows: if $f : X \to Y$ is an ordinary morphism, we can associate to it the span $X \xleftarrow{\text{id}} X \xrightarrow{f} Y$, and composition of these spans is compatible with composition of arrows (up to equivalence of spans); this is essentially the statement you want. Moreover, if $X \leftarrow F \to Y$ is an arbitrary span then, by the universal property of products, $F$ is equipped with a map $F \to X \times Y$, not necessarily a monomorphism in any sense; this is the "graph" of $F$.

So in this context, the statement to be proved is the following: given a diagram of the form

$$X \xleftarrow{\text{id}} X \xrightarrow{f} Y \xleftarrow{\text{id}} Y \xrightarrow{g} Z$$

the composition / pullback $X \times_Y Y$ is just $X$, equipped with the identity projection to $X$ and the composite projection $g \circ f$ to $Z$. Verifying this is straightforward since the pullback is along an identity morphism.

I don't recommend messing around with images and closed subschemes; keep track of the entire morphism $F \to X \times Y$ instead and the categorical part of the story simplifies considerably.

-
Dear Qiaochu, thanks a lot for this answer. I am afraid for me the fact that in a span $X \leftarrow F \to Y$ the "graph" $F$ embeds into $X \times Y$ is crucial. In this case you need to use the push forward in the definition of the composition of graphs and that's what causes confusion in the proof (at least for me), I think. (Actually, not so much confusion, I think I have an idea now about using some kind of projection formula, I am figuring out the details.) –  Dima Sustretov Feb 12 '14 at 13:28