TITLE: Do disjoint unions and fiber products commute?
QUESTION [11 upvotes]: Do disjoint unions and fiber products commute?
In other words, is the following statement true?
Statement: Let $C$ be a category with (infinite) coproducts and fiber products. Let {$U_{i}$} be a family of objects in $C$, and denote the coproduct of them by $U = \coprod_{i}U_{i}$. Moreover, let $U_{i} \to X$ and $Y\to X$ be morphisms in $C$, and $U\to X$ be the morphism induced by the universality of coproduct. Then, $U\times_{X}Y \cong \coprod_{i}(U_{i}\times_{X}Y)$.
If $C$ is the category of schemes, this statement will be true. This is because fiber products of schemes are constructed locally at first, and glued together.
However, I could not prove this by using universality (i.e. in categorical settings).
My questions are:

Is the above statement true? If so, then how can one prove it?

If the statement is false, what kind of counter example exists?

If the statement is false, then, please change the statement replacing "coproducts" by "disjoint unions". Is the NEW statement true?


Here, disjoint union of $U_{i}$'s means coproduct $U=\coprod_{i}U_{i}$ satisfying that the fiber products $U_{i}\times_{U}U_{j}$ are the strict initial object if $i \neq j$. Here, strict initial object means initial object $\phi$ such that for any object $X$, the set of morphisms $Hom(X, \phi)$ is the empty set if $X$ is not isomorphic to $\phi$. (This is the generalization of empty set in the category of sets or schemes.)
Later
Counterexamples for the first statement exist (e.g. the category of pointed sets or the opposite of the category of sets).
However, those are not for the refined statement in my question 3.
Does anybody have ideas for it?

REPLY [9 votes]: The more general question is whether pullbacks and colimits commute. This is true if the category $\mathcal C$ is locally cartesian closed, i.e. every slice category $\mathcal C /c$ of objects over a given object $c$ of $\mathcal C$ is cartesian closed. For then pullback has a right adjoint. 
These ideas are of interest in the topological case, though even if $\mathcal C$ is a convenient category of spaces, the categories $\mathcal C/c$ are not always cartesian closed. 
Nonetheless, the use of such categories was initiated by R. Thom and continued by Peter Booth, see for example:
Booth, Peter I.
A unified treatment of some basic problems in homotopy theory.
Bull. Amer. Math. Soc. 79 (1973), 331–336. 
and his related papers: these ideas were also taken up by Ioan James under the term "Fibrewise topology", see 
Crabb, Michael; James, Ioan; 
Fibrewise homotopy theory. 
Springer Monographs in Mathematics. Springer-Verlag London, Ltd., London, 1998. 
There is a paper 
Johnstone, P. T.
On a topological topos.
Proc. London Math. Soc. (3) 38 (1979), no. 2, 237–271. 
giving a locally cartesian closed category, in fact a topos,  with sequential spaces as a reflective subcategory, but this has not yet been used in algebraic opology, to my knowledge. 
August 19, 2014 A doctoral thesis in this area,  "Topos Theoretic Methods in General Topology" by Hamed Harasani, Bangor 1988. is available here.