On limits, schemes and Spec functor
I have several related questions:
Do there exist colimits in the category of schemes? If not, do there exist just direct limits? Do there exist limits? If not, do there exist just inverse limits? With more generality and summarizing, with which generality there exist limits and colimits in Schemes?
Then, if I have a colimit of rings, its Spec is a limit in the category of affine schemes. Is it so in the category of all schemes? If not, whith which generality, that is, what kinds of colimits does Spec transform to limits?
And does Spec transform limits into colimits? If not, whith which generality, that is, what kinds of limits does Spec transform to colimits?
Solution 1:
1) Of course there is the important gluing lemma for schemes which says that certain pushouts along open immersions exist. But the category of schemes has not all colimits, see MO/9961.
2) The category of schemes has not all limits, see MO/9134 and MO/65506.
3) In contrast to 1) and 2), the category of locally ringed spaces (as well as the category of ringed spaces) has all limits and all colimits. See the paper by Gilliam on localization of ringed spaces, as well as Prop. I.1.6. in Groupes algebriques by Demazure-Gabriel.
4) $\mathrm{Spec} : \mathsf{CRing}^{\mathrm{op}} \to \mathsf{Sch}$ is right adjoint to the functor of global sections, therefore it preserves all limits. In particular, limits of affine schemes always exist, and their coordinate ring is just the colimit of the coordinate rings. For example, the limit of $\dotsc \to \mathbb{A}^2_k \to \mathbb{A}^1_k \to \mathbb{A}^0_k$ is $\mathbb{A}^{\infty}_k = \mathrm{Spec}(k[x_1,x_2,\dotsc])$.
5) More generally, for an arbitrary base scheme $S$, the functor $\mathrm{Spec} : \mathsf{qcAlg}(S)^{\mathrm{op}} \to \mathsf{Sch}/S$, which sends a quasi-coherent algebra on $S$ to its relative spectrum, is left adjoint to the functor which sends $p : T \to S$ to $p_* \mathcal{O}_T$, and induces an anti-equivalence of categories between quasi-coherent algebras on $S$ and the category of affine $S$-schemes. Hence, limits of affine $S$-schemes exist in the category of all $S$-schemes, are affine, and correspond to the colimit of the corresponding quasi-coherent algebras. This is quite useful and used often in conjunction with the Noetherian Approximation Theorem: If $S$ is noetherian, every quasi-compact quasi-separated $S$-scheme is a directed limit of noetherian $S$-schemes with affine transition morphisms. These directed limits are preserved by the forgetful functor to topological spaces. Details can be found in EGA.
6) $\mathrm{Spec}$ does not preserve colimits, i.e. the spectrum of a limit of rings is not the colimit of the spectra of the rings. For example, $\mathrm{Spec}\left(\prod_{i \in I} \mathbb{F}_2\right)$ can be identified with the space of ultrafilters on $I$, and only the small part of principal ultrafilters on $I$ constitutes $\coprod_{i \in I} \mathrm{Spec}(\mathbb{F}_2)$.
7) Some colimits are preserved: The initial object, and more generally finite coproducts. Also, if $A \to C$ is a surjective ring homomorphism, and $B \to C$ is an arbitrary ring homomorphism, then $\mathrm{Spec}(A \times_C B)=\mathrm{Spec}(A) \cup_{\mathrm{Spec}(C)} \mathrm{Spec}(B)$, and the forgetful functor to ringed spaces preserves this pushout. More generally, when $Z \to X$ and $Z' \to X$ are closed immersions, then the pushout $Z \cup_X Z'$ exists, and it is preserved by the forgetful functor to ringed spaces. See Schwedes paper on glueing schemes.