TITLE: Examples/other references for EGA 0.4.5.4
QUESTION [10 upvotes]: Proposition 0.4.5.4 in EGA appears to be a general representability theorem. It reads:

Suppose $F$ is a contravariant functor from the category of locally ringed spaces over $S$ to the category of sets. Suppose given representable sub-functors $F_i$ of $F$, such that the morphisms $F_i \to F$ are representable by open immersions. Suppose furthermore that if $Hom(-, X) \to F$ is a morphism and the functors $F_i \times_F Hom(-,X)$ are representable by $Hom(-,X_i)$, the family $X_i$ forms an open covering of $X$. (That $X_i \to X$ is an open immersion follows from the definitions.)  Finally, suppose that if $U$ ranges over the open subsets of a locally ringed space $X$, the functor $U \to F(U)$ is a sheaf.   Then, $F$ is representable.

I haven't yet been able to grok the proof, but it appears to be some sort of extended gluing construction. This result appears to be used in proving that fibered products exist in the category of schemes. However, it's fairly easy to directly construct fibered products by gluing open affines.
Are there examples where this result actually makes the life of algebraic geometers easier?  Also, I'd appreciate any links to examples (outside of EGA) where this result is used.

REPLY [2 votes]: Actually the result is used all the time in the basics of algebraic geometry. It provides the formalization of the principle of gluing constructions.
For example if want to show that fibered products $X \times_S Y$, first do it for affine schemes $X,Y,S$ using the adjunction between $\operatorname{Spec}$ and global sections. Now, if $S$ is arbitrary, the functor $\operatorname{Sch}/S \to \operatorname{Set}, Z \mapsto \operatorname{Hom}_S(Z,X) \times \operatorname{Hom}_S(Z,Y)$ is a sheaf and locally representable on $S$, thus representable. Thus $X \times_S Y$ exists. Now if also $X$ is arbitrary, consider the functor $\operatorname{Sch}/X \to \operatorname{Set}, Z \mapsto \operatorname{Hom}_S(Z',Y)$, where $Z' = Z \to X \to S$. This is a sheaf and locally representable on $X$, thus representable, which shows that $X \times_S Y$ exists. The usual "ad hoc" proofs for the existence of the fibered product actually just reprove the general representabilty result in the special case.
Here is another example: If $A$ is a quasi-coherent sheaf of algebras on a scheme $X$, it is possible to construct the $X$-scheme $Spec(A)$. It is very laborious to check all the details of the gluing construction, well-definedness etc. when you just want to glue the $U$-schemes $\operatorname{Spec}(A(U))$, $U \subseteq X$ affine, together. But instead, you could just consider the functor
$$\operatorname{Sch}/X \to \operatorname{Set}, (t : Z \to X) \mapsto \operatorname{Hom}_{\mathcal{O}_X-\operatorname{Alg}}(A,t_* \mathcal{O}_Z)$$
and show that it is a sheaf (obvious) and locally on $X$ representable (usual adjunction with spectrum of a ring), so it is representable by an $X$-scheme $\operatorname{Spec}(A)$ for which you also directly have a universal property. Again I want to emphasize: You get into a big mess when you want to construct this without using functors or universal properties. These rather abstract notions are very useful also in concrete situations, because they make you able to fix your ideas and make every construction fit together nicely. When you get more accustomed to these techniques, you stop thinking of specific functors, but you think in a "functorial way" and recognize, for example, why gluing constructions work.