#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Options

# Lecture 7 - Universal properties: products, coproducts and exponentials - David Spivak

edited February 5

• Options
1.

It was interesting to learn about the relationship between currying, uncurrying, and exponentials. I'd heard people talking about currying before and handwaving, but this lecture made it very concrete. The motivation of set exponentiation (the set of maps) {1, 2, 3}^{1,2} as "3"^"2" ~ 9 maps in total was nice as well.

I also liked the motivation of Either as a pushout from two functions. I recently did a few exercises using Either in scala and ended up getting very confused! So this sort of knowledge would probably have made that experience a bit less confusing.

I noticed that it was mentioned in passing that products, co-products and exponentials are all examples of adjunctions. And I just listened to the first 10 seconds of lecture 8, and I gather that they are discussed therein, so I look forward to reviewing that lecture too in time.

Comment Source:It was interesting to learn about the relationship between currying, uncurrying, and exponentials. I'd heard people talking about currying before and handwaving, but this lecture made it very concrete. The motivation of set exponentiation (the set of maps) {1, 2, 3}^{1,2} as "3"^"2" ~ 9 maps in total was nice as well. I also liked the motivation of Either as a pushout from two functions. I recently did a few exercises using Either in scala and ended up getting very confused! So this sort of knowledge would probably have made that experience a bit less confusing. I noticed that it was mentioned in passing that products, co-products and exponentials are all examples of [adjunctions](https://en.wikipedia.org/wiki/Adjoint_functors). And I just listened to the first 10 seconds of lecture 8, and I gather that they are discussed therein, so I look forward to reviewing that lecture too in time.
• Options
2.
edited March 7

Yes, it's a good one!

Ideas from the first five minutes (using David Spivak's terminology):

• A universal property is a "one-stop shop" for maps

• The product of sets $$A$$ and $$B$$ is the one-stop shop from maps into $$A$$ and $$B$$.

Meaning: suppose you have a set $$I$$, and maps $$f: I \rightarrow A$$ and $$g: I \rightarrow B$$, with $$f$$ in your "left-hand", and $$g$$ in your right.

These two functions are equivalent to a single function $$f \times g: I \rightarrow A \times B$$.

The set $$I$$ can be thought of as an "index" set which is used to pick out elements via the functions out of $$I$$.

When $$I$$ is a singleton, the "one-stop shop" gives you a single element in the product of $$A$$ and $$B$$, in lieu of two separate elements one from $$A$$ and the other from $$B$$.

Comment Source:Yes, it's a good one! Ideas from the first five minutes (using David Spivak's terminology): * A universal property is a "one-stop shop" for maps * The product of sets \$$A\$$ and \$$B\$$ is the one-stop shop from maps into \$$A\$$ and \$$B\$$. Meaning: suppose you have a set \$$I\$$, and maps \$$f: I \rightarrow A\$$ and \$$g: I \rightarrow B\$$, with \$$f\$$ in your "left-hand", and \$$g\$$ in your right. These two functions are equivalent to a single function \$$f \times g: I \rightarrow A \times B\$$. The set \$$I\$$ can be thought of as an "index" set which is used to pick out elements via the functions out of \$$I\$$. When \$$I\$$ is a singleton, the "one-stop shop" gives you a single element in the product of \$$A\$$ and \$$B\$$, in lieu of two separate elements one from \$$A\$$ and the other from \$$B\$$.
• Options
3.
• The coproduct of $$A$$ and $$B$$ is the "one-stop shop" for maps into $$A$$ and $$B$$.
Comment Source:* The coproduct of \$$A\$$ and \$$B\$$ is the "one-stop shop" for maps into \$$A\$$ and \$$B\$$.
• Options
4.
edited March 8

Thinking out loud here...

The idea of the "one-stop shop for maps" generalizes nicely from the product to the limit.

Looking at the general case of the limit, which includes as special cases terminal objects, products, equalizers and pullbacks, brings clarity to the whole picture. And in the category Set, there is an explicit construction for all limits.

To review: suppose we are given a diagram D in the category C. Note: for this definition, D is not required to be a commuting diagram -- it's just a collection of objects and arrows.

The limit of D, if it exists, will be another object Lim(D) in C, along with "projection maps" from Lim(D) to each of the objects in D, which satisfies a couple of conditions. First, for every arrow $$f: X_1 \rightarrow X_2$$ in D, the triangle diagram with objects Lim(D), $$X_1$$, and $$X_2$$ and arrows $$f$$ and the two projections from Lim(D) to $$X_1$$ and $$X_2$$ -- this triangle diagram commutes.

Lim(D) along with these projections is called a cone over D. The cones over D form a category, with arrows going between the apexes of the cones, such that these arrows satisfy the following commutativity condition with respect to the cones. Suppose that $$X$$ and $$Y$$ are each the apex of a cone, and $$f: X \rightarrow Y$$. Then $$f$$ is defined to be a morphism between the two cones if for each object $$d$$ in D, the triangle formed by $$d$$, $$X$$ and $$Y$$, with arrows $$f$$ and the two projections to $$d$$ -- one projection within each cone -- commutes.

The second requirement on Lim(D) is that it be a terminal object in this category of cones.

Comment Source:Thinking out loud here... The idea of the "one-stop shop for maps" generalizes nicely from the product to the limit. Looking at the general case of the limit, which includes as special cases terminal objects, products, equalizers and pullbacks, brings clarity to the whole picture. And in the category Set, there is an explicit construction for all limits. To review: suppose we are given a diagram D in the category C. Note: for this definition, D is not required to be a _commuting_ diagram -- it's just a collection of objects and arrows. The limit of D, if it exists, will be another object Lim(D) in C, along with "projection maps" from Lim(D) to each of the objects in D, which satisfies a couple of conditions. First, for every arrow \$$f: X_1 \rightarrow X_2\$$ in D, the triangle diagram with objects Lim(D), \$$X_1\$$, and \$$X_2\$$ and arrows \$$f\$$ and the two projections from Lim(D) to \$$X_1\$$ and \$$X_2\$$ -- this triangle diagram commutes. Lim(D) along with these projections is called a cone over D. The cones over D form a category, with arrows going between the apexes of the cones, such that these arrows satisfy the following commutativity condition with respect to the cones. Suppose that \$$X\$$ and \$$Y\$$ are each the apex of a cone, and \$$f: X \rightarrow Y\$$. Then \$$f\$$ is defined to be a morphism between the two cones if for each object \$$d\$$ in D, the triangle formed by \$$d\$$, \$$X\$$ and \$$Y\$$, with arrows \$$f\$$ and the two projections to \$$d\$$ -- one projection within each cone -- commutes. The second requirement on Lim(D) is that it be a terminal object in this category of cones. 
• Options
5.
edited March 8

Now that's somewhat of an abstract story, which doesn't give you a feeling for how to actually find what this special cone Lim(D) actually is. And in general such an object may not exist at all.

But in the category Set it always exists, and can be constructed explicitly, as follows.

Comment Source:Now that's somewhat of an abstract story, which doesn't give you a feeling for how to actually find what this special cone Lim(D) actually is. And in general such an object may not exist at all. But in the category Set it always exists, and can be constructed explicitly, as follows. 
• Options
6.
edited March 8

Suppose we have a diagram $$D$$ in Set. Let the objects in $$D$$ be named $$S_1, \ldots S_n$$, where each $$S_i$$ is a set. Let the arrows in $$D$$ be $$f_1, \ldots f_k$$ -- these are functions.

Then Lim(D) consists of a subset of the Cartesian product of the set $$S_1, \ldots S_n$$ -- so it is a relation R between these sets. It consists of all tuples $$(x_1, \ldots, x_n)$$ that satisfy the all of the constraints given by the functions $$f_i$$. Suppose $$f_i: S_j \rightarrow S_k$$. Then the constraint given by $$f_i$$ stipulates that for a tuple $$(x_1, \ldots, x_n)$$, that $$f_i(x_j) = x_k$$.

The cone has relation R at its apex, and the ordinary projection functions from R to each of the sets $$S_1, \ldots, S_n$$ as the arrows from the apex R to the objects in the diagram $$D$$.

It is but an exercise to show that this cone with R at its apex is terminal within the category of cones over $$D$$.

Comment Source:Suppose we have a diagram \$$D\$$ in Set. Let the objects in \$$D\$$ be named \$$S_1, \ldots S_n\$$, where each \$$S_i\$$ is a set. Let the arrows in \$$D\$$ be \$$f_1, \ldots f_k\$$ -- these are functions. Then Lim(D) consists of a subset of the Cartesian product of the set \$$S_1, \ldots S_n\$$ -- so it is a relation R between these sets. It consists of all tuples \$$(x_1, \ldots, x_n)\$$ that satisfy the all of the constraints given by the functions \$$f_i\$$. Suppose \$$f_i: S_j \rightarrow S_k\$$. Then the constraint given by \$$f_i\$$ stipulates that for a tuple \$$(x_1, \ldots, x_n)\$$, that \$$f_i(x_j) = x_k\$$. The cone has relation R at its apex, and the ordinary projection functions from R to each of the sets \$$S_1, \ldots, S_n\$$ as the arrows from the apex R to the objects in the diagram \$$D\$$. It is but an exercise to show that this cone with R at its apex is terminal within the category of cones over \$$D\$$. 
• Options
7.

The relation R = Lim(D) is a one-stop shop for cones over D, in the following sense. Suppose that we have a cone C with apex A over D. Then C consists of a bunch of separate maps from A into the objects of D. The universal property for R = Lim(D) says that there a unique map m(C) from A into R, which gives a morphism from C into the universal cone with apex Lim(D).

m(C) is a single map that contains all of the information in C. That's because the projections from C into the objects of D can be reconstructed by composing m(C) with the standard projections from R into the objects of D.

So the multiple separate maps comprising the cone C can, without loss of information, be replaced by the single map m(C).

Comment Source:The relation R = Lim(D) is a one-stop shop for cones over D, in the following sense. Suppose that we have a cone C with apex A over D. Then C consists of a bunch of separate maps from A into the objects of D. The universal property for R = Lim(D) says that there a unique map m(C) from A into R, which gives a morphism from C into the universal cone with apex Lim(D). m(C) is a single map that contains all of the information in C. That's because the projections from C into the objects of D can be reconstructed by composing m(C) with the standard projections from R into the objects of D. So the multiple separate maps comprising the cone C can, without loss of information, be replaced by the single map m(C). 
• Options
8.
edited March 8

For an illustration of this construction, let's apply it to the equalizer.

Here, the diagram D consists of two objects $$X_1, X_2$$, and two maps $$f,g: X_1 \rightarrow X_2$$.

Note: here the fact that D is not required to be a commutative diagram is significant. If it were so required, then that would imply that $$f$$ and $$g$$ are equal. But we don't require that, as we are constructing the equalizer of distinct maps $$f$$ and $$g$$.

Then, as per the general construction given above, the relation R = Lim(D) will consist of all tuples $$(x,y)$$, such that $$f(x) = y$$, and $$g(x) = y$$. Putting these together, we get that:

$equalizer(f,g) = Lim(D) = \lbrace (x,y)\ |\ y = f(x) = g(x) \rbrace = \lbrace (x,y)\ |\ x \in dom(f) \cap dom(g),\ f(x) = g(x)\rbrace = f \cap g$

Which is to say: the equalizer of functions $$f$$ and $$g$$ is the relation (the graph representation) for the partial function that is obtained by restricting both functions to the set of points where they are both defined and both produce the same value.

Comment Source:For an illustration of this construction, let's apply it to the equalizer. Here, the diagram D consists of two objects \$$X_1, X_2\$$, and two maps \$$f,g: X_1 \rightarrow X_2\$$. Note: here the fact that D is not required to be a _commutative_ diagram is significant. If it were so required, then that would imply that \$$f\$$ and \$$g\$$ are equal. But we don't require that, as we are constructing the equalizer of distinct maps \$$f\$$ and \$$g\$$. Then, as per the general construction given above, the relation R = Lim(D) will consist of all tuples \$$(x,y)\$$, such that \$$f(x) = y\$$, and \$$g(x) = y\$$. Putting these together, we get that: \$equalizer(f,g) = Lim(D) = \lbrace (x,y)\ |\ y = f(x) = g(x) \rbrace = \lbrace (x,y)\ |\ x \in dom(f) \cap dom(g),\ f(x) = g(x)\rbrace = f \cap g\$ Which is to say: the equalizer of functions \$$f\$$ and \$$g\$$ is the relation (the graph representation) for the partial function that is obtained by restricting both functions to the set of points where they are both defined and both produce the same value. 
• Options
9.
edited March 8

We get the product as a special case of a limit, where the diagram $$D$$ consists only of objects, and no arrows.

In Set, this will be a collection of sets $$S_1, \ldots, S_n$$ -- and no arrows to impose constraints on the tuples in R = Lim(D).

So Lim(D) is the unconstrained set of tuples -- i.e., the Cartesian product $$S_1 \times \cdots \times S_n$$.

Comment Source:We get the _product_ as a special case of a limit, where the diagram \$$D\$$ consists only of objects, and no arrows. In Set, this will be a collection of sets \$$S_1, \ldots, S_n\$$ -- and no arrows to impose constraints on the tuples in R = Lim(D). So Lim(D) is the unconstrained set of tuples -- i.e., the Cartesian product \$$S_1 \times \cdots \times S_n\$$.
• Options
10.

What's the limit of an empty diagram $$D$$?

It's simply a terminal object in the category, for the following reason.

A cone over the empty diagram consists just of an apex object A, along with zero "leg" morphisms.

So the category of cones over the empty diagram coincides exactly with the ambient category C.

The limit is defined to be a terminal cone, which amounts to the same thing as a terminal object in C.

Comment Source:What's the limit of an empty diagram \$$D\$$? It's simply a terminal object in the category, for the following reason. A cone over the empty diagram consists just of an apex object A, along with zero "leg" morphisms. So the category of cones over the empty diagram coincides exactly with the ambient category C. The limit is defined to be a terminal cone, which amounts to the same thing as a terminal object in C. 
• Options
11.
edited March 8

Exercise 1. Use this construction to concretely explain the meaning of pullbacks in Set.

Recall that a pullback is defined as the limit of a diagram $$D$$, consisting of three objects $$A,B,C$$, and morphims $$f: A \rightarrow C$$ and $$g: B \rightarrow C$$.

Comment Source:Exercise 1. Use this construction to concretely explain the meaning of pullbacks in Set. Recall that a pullback is defined as the limit of a diagram \$$D\$$, consisting of three objects \$$A,B,C\$$, and morphims \$$f: A \rightarrow C\$$ and \$$g: B \rightarrow C\$$. 
• Options
12.
edited March 8

$$\require{begingroup}\begingroup\require{AMScd}\newcommand{\tlap}[1]{\raisebox{0pt}[0pt][0pt]{#1}}\newcommand{\blap}[1]{\vbox to 0pt{\hbox{#1}\vss}}$$ Exercise 2. Apply this explanation to prove that following square is indeed a pullback:

\begin{CD} A \cap B @>\subseteq>>B \\@V{\subseteq}VV {}@VV{\subseteq}V \\ A @>>\subseteq> C \end{CD}

Here, $$C$$ is taken to be any set which contains both $$A$$ and $$B$$, and $$\subseteq$$ means the inclusion function.

Diagram from Example 1.8.3 of:

• Benjamin C. Pierce, Basic Category Theory for Computer Scientists, MIT Press, 1991.
Comment Source:\$$\require{begingroup}\begingroup\require{AMScd}\newcommand{\tlap}[1]{\raisebox{0pt}[0pt][0pt]{#1}}\newcommand{\blap}[1]{\vbox to 0pt{\hbox{#1}\vss}}\$$ Exercise 2. Apply this explanation to prove that following square is indeed a pullback: \begin{CD} A \cap B @>\subseteq>>B \\\@V{\subseteq}VV {}@VV{\subseteq}V \\\ A @>>\subseteq> C \end{CD} Here, \$$C\$$ is taken to be any set which contains both \$$A\$$ and \$$B\$$, and \$$\subseteq\$$ means the inclusion function. * * * Diagram from Example 1.8.3 of: * Benjamin C. Pierce, Basic Category Theory for Computer Scientists, MIT Press, 1991.
• Options
13.
edited March 8

$$\require{begingroup}\begingroup\require{AMScd}\newcommand{\tlap}[1]{\raisebox{0pt}[0pt][0pt]{#1}}\newcommand{\blap}[1]{\vbox to 0pt{\hbox{#1}\vss}}$$ Exercise 3. Apply this explanation to prove that the following is indeed a pullback:

\begin{CD} f^{-1}(A) @>\subseteq>>B \\@V{f|_{f^{-1}(A)}}VV {}@VV{f}V \\ A @>>\subseteq> C \end{CD}

Here, $$A$$ is a subset of the codomain of $$f$$. The claim made by this diagram is that inverse image of $$A$$ under $$f$$ is the pullback of $$f$$ along the inclusion function for $$A$$.

Diagram from Example 1.8.2 of:

• Benjamin C. Pierce, Basic Category Theory for Computer Scientists, MIT Press, 1991.
Comment Source:\$$\require{begingroup}\begingroup\require{AMScd}\newcommand{\tlap}[1]{\raisebox{0pt}[0pt][0pt]{#1}}\newcommand{\blap}[1]{\vbox to 0pt{\hbox{#1}\vss}}\$$ Exercise 3. Apply this explanation to prove that the following is indeed a pullback: \begin{CD} f^{-1}(A) @>\subseteq>>B \\\@V{f|_{f^{-1}(A)}}VV {}@VV{f}V \\\ A @>>\subseteq> C \end{CD} Here, \$$A\$$ is a subset of the codomain of \$$f\$$. The claim made by this diagram is that inverse image of \$$A\$$ under \$$f\$$ is the pullback of \$$f\$$ along the inclusion function for \$$A\$$. * * * Diagram from Example 1.8.2 of: * Benjamin C. Pierce, Basic Category Theory for Computer Scientists, MIT Press, 1991.
• Options
14.
edited March 8

@ChrisGoddard wrote:

I noticed that it was mentioned in passing that products, co-products and exponentials are all examples of adjunctions.

Interesting! Keep us posted if you dig further into this.

Comment Source:@ChrisGoddard wrote: > I noticed that it was mentioned in passing that products, co-products and exponentials are all examples of [adjunctions](https://en.wikipedia.org/wiki/Adjoint_functors). Interesting! Keep us posted if you dig further into this.
• Options
15.
edited March 8

Problem 1: spell out the explicit construction for colimits in the category Set.

The path of analysis is similar to that used for the explicit construction for limits. But the result is not "symmetrical." In one of the lectures Bartosz commented on the asymmetry between product and coproduct in Set. He traced it back to some asymmetries in the structure of the morphisms in Set, which as we know are total functions. The asymmetry is that whereas each point in the domain must map -- be related to -- to just one point in the codomain, each point in the codomain can be related to zero points in the domain (where the function is not onto), or multiple points in the domain (where the function is not one-to-one).

Comment Source:Problem 1: spell out the explicit construction for colimits in the category Set. The path of analysis is similar to that used for the explicit construction for limits. But the result is not "symmetrical." In one of the lectures Bartosz commented on the asymmetry between product and coproduct in Set. He traced it back to some asymmetries in the structure of the morphisms in Set, which as we know are total functions. The asymmetry is that whereas each point in the domain must map -- be related to -- to just one point in the codomain, each point in the codomain can be related to zero points in the domain (where the function is not onto), or multiple points in the domain (where the function is not one-to-one). 
• Options
16.

Problem 2: use this construction to give a concrete explanation for coequalizers, coproducts, pushouts and initial objects in Set.

Comment Source:Problem 2: use this construction to give a concrete explanation for coequalizers, coproducts, pushouts and initial objects in Set.