# example diagram of pullbacks and fiber products

I am going through Category Theory for Scientists. I am on section 2.5.1 Pullbacks.

I am having trouble visualizing a pullback.

Earlier in the book the author gives a nice diagram of an example of products of sets.

There is a similar diagram for coproducts of sets.

Is there some way to draw an example of a pullback or a fiber product? Or is there some sort of example that would make pullbacks and fiber products easier to understand for someone coming from a programming background as opposed to a math background? Or am I just thinking about this completely wrong?

-
I don't have enough reputation to embed images into this post. I would be grateful if someone could edit this post and change the links to images to actual embedded images. – illabout May 13 '14 at 13:21
Images embedded. – Pece May 13 '14 at 13:26
Thanks! It looks much better now :) – illabout May 13 '14 at 13:28

A pullback as just a certain subset of the product: those pairs $(a,b)$ on which the two given maps on coordinates agree, i.e. $f(a)=g(b)$.
This needs an explicit example, which I'll build on the lovely product diagram we already have available. So map $X=\{1,2,3,4,5,6\}\to \{\text{even},\text{odd}\}$ in the obvious way, and $Y=\{\clubsuit,\diamondsuit,\heartsuit,\spadesuit\}$ by saying, for instance, the black suits $\clubsuit,\spadesuit$ are "even" and the others are "odd." Then the pullback becomes a subset of $X\times Y$ given by pairs $(n,s)$ where $n$ and $s$ have the same image in $\{\text{even},\text{odd}\}$. That is, the pullback has the twelve elements $\{(1,\heartsuit),(1,\diamondsuit),(3,\heartsuit),...,(5,\diamondsuit),(2,\spadesuit),(2,\clubsuit),...,(6,\clubsuit)\}$. If this begins to make some sense, see if you can compute
• the pullback of $X$ and $Y$ over the unique maps sending $X$ and $Y$ to a one-element set
• the pullback over the identity map $i:Y\to Y$ and any map $f:X\to Y$.
Would the pullback of $X$ and $Y$ over the unique maps sending $X$ and $Y$ to a one-element set be the entire product set of $X$ and $Y$? All of the elements in $X \times Y$? – illabout May 13 '14 at 14:48