Categorical products

Here are a bunch of constructions that share a similar property:

  • The intersection of two sets is the largest set that’s a subset of both of them.
  • The minimum of two numbers is the largest number that’s less than or equal to both of them.
  • The greatest common divisor of two numbers is the largest number that divides both of them.
  • The proposition “A and B” is the one with the least assumptions needed to prove both A and B.

A partial order is a set equipped with a relation ≤ that is

  • transitive (X \le Y \le Z \Rightarrow X \le Z),
  • reflexive (X \le X), and
  • antisymmetric (X \le Y \mbox{ and } Y \le X \Rightarrow X = Y).

All of these examples are extremes in a partial order, either the largest or smallest example of something. We say they satisfy a “universal property”.

Another definition of partial order is “a category where there’s at most one morphism between any two objects and the only cycles are identities”, so we have four categories:

  • The category whose objects are sets and whose morphisms are statements of the form “X ⊂ Y”.
  • The category whose objects are real numbers and whose morphisms are statements of the form “x ≤ y”.
  • The category whose objects are natural numbers and whose morphisms are statements of the form “x is a factor of y”.
  • The category whose objects are propositions and whose morphisms are statements of the form “X implies Y”.

In order to state more precisely what it means to be the most extreme example of this property, let’s look at the examples again:

  • Say we have a set X that we believe to be the intersection of A and B. It has to be the case that X ⊂ A and X ⊂ B. It should also be the largest such subset. We can frame this in terms of a duel between competitors: say Y is a set that also satisfies Y ⊂ A and Y ⊂ B. What is the relation between the real intersection and Y? Well, the intersection is the biggest one, so if X is the intersection, we’ve got to have Y ⊂ X for any choice of Y.
  • Say we have a number x that we believe to be the minimum of two numbers a and b. It has to be the case that x ≤ a and x ≤ b. It should also be the largest such number. We can frame this in terms of a duel between competitors: say y is a number that also satisfies y ≤ a and y ≤ b. What is the relation between the real minimum and y? Well, the minimum is the biggest one, so if x is the minimum, we’ve got to have y ≤ x for any choice of y.
  • Say we have a number x that we believe to be the GCD of two numbers a and b. It has to be the case that x is a factor of a and x is a factor of b. It should also be the largest such number. We can frame this in terms of a duel between competitors: say y is a number such that y is a factor of a and y is a factor of b. What is the relation between the real GCD and y? Well, the GCD is the biggest one, so if x is the GCD, it’s got to be true that y is a factor of x for any choice of y.
  • Say we have a proposition X that we believe to be the logical AND, or conjunction, of A and B. It has to be the case that X implies A and X implies B. It should also be the weakest such proposition. We can frame this in terms of a duel between competitors: say Y is a proposition that also satisfies Y implies A and Y implies B. What is the relation between the real conjunction and Y? Well, the conjunction is the weakest one, so if X is the conjunction, we’ve got to have Y implies X for any choice of Y.

Each of the examples above can be illustrated with a simple diagram:

\begin{tikzpicture}
\begin{scope}[scale = 3]
\node (A) at (0,0) {$A$};
\node (B) at (2,0) {$B$};
\node (X) at (1,0) {$X$}
edge [->] (A)
edge [->] (B);
\node (Y) at (1,1) {$Y$}
edge [->] (A)
edge [->] (B)
edge [->, dashed] (X);
\end{scope}
\end{tikzpicture}

It says that X is an object with morphisms to A and B such that given any object Y with morphisms to A and B, there exists a morphism from Y to X. We call X the categorical product of A and B.

It turns out that we can generalize the product from partial orders to categories and get useful structures. In the category of sets and functions, we are no longer restricted to a single morphism between two objects, so we need labels on the diagram naming our functions; in order to have a “best” object, though, we want the arrow from Y to X to remain unique:

\begin{tikzpicture}
\begin{scope}[scale = 3]
\node (A) at (0,0) {$A$};
\node (B) at (2,0) {$B$};
\node (X) at (1,0) {$X$}
edge [->] node [below,l] {$p$} (A)
edge [->] node [below,l] {$q$} (B);
\node (Y) at (1,1) {$Y$}
edge [->] node [above left,l] {$r$} (A)
edge [->] node [above right,l] {$s$} (B)
edge [->, dashed] node [right,l] {!} (X);
\end{scope}
\end{tikzpicture}

This says that X is an object with morphisms to A and B such that given any object Y with morphisms to A and B, there exists a unique morphism from Y to X making the diagram commute—that is, if we apply the morphism marked ! and then p, we get the same result as applying r; similarly, if we apply ! and then q, we get the same result as applying s.

In the category of sets and functions, the categorical product gives us the cartesian product of sets:

\begin{tikzpicture}
\begin{scope}[scale = 3]
\node (A) at (0,0) {$A$};
\node (B) at (2,0) {$B$};
\node (X) at (1,0) {$A\times B$}
edge [->] node [below,l] {$p$} (A)
edge [->] node [below,l] {$q$} (B);
\node (Y) at (1,1) {$Y$}
edge [->] node [above left,l] {$r$} (A)
edge [->] node [above right,l] {$s$} (B)
edge [->, dashed] node [right,l] {!} (X);
\end{scope}
\end{tikzpicture}

If instead of using two sets and two functions “first” and “second”, we use an arbitrary finite number of sets and index them with brackets and natural numbers, then we get tuples.

\begin{tikzpicture}
\begin{scope}[scale = 3]
\node (B) at (2,0) {$A_i$};
\node (X) at (1,0) {$\prod_i A_i$}
edge [->] node [below,l] {$[i]$} (B);
\node (Y) at (1,1) {$Y$}
edge [->] node [above right,l] {$s_i$} (B)
edge [->, dashed] node [right,l] {!} (X);
\end{scope}
\end{tikzpicture}

The function toArray we saw earlier took an array-like object Y = arguments and turned it into a real array.

Advertisements

2 Comments to “Categorical products”

  1. You meant to say that a partial order is *antisymmetric*, not symmetric.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: