One approach to learning category theory is to lean on your knowledge of set theory. You can do this by seeing how certain categorical constructs generalize constructs from set theory. Eventually, you will arrive at the elementary theory of the category of sets (ETCS). The general ideas can be used in other parts of category theory as well.

The point of view of the two theories are also different. This is important, since this leads directly to those constructs. So, I’ll begin by contrasting the two perspectives.

Contrasting points of view

From the perspective of set theory, we are often concerned with what the elements of sets are. Category theory focuses more on the morphisms into and out from an object. By narrowing our focus to the category of sets and functions, I’ll directly contrast these two viewpoints.

Consider the notion of an element of a set. We write \(x \in B\) to state that \(x\) is an element of the set \(B\).

Let’s turn our attention to functions. Note that any function from a one-element set (aka a singleton set) \(B\) to some other set will “pick out” a single element from \(B\). There will be one function from that one element set to \(B\) for each element of \(B\) and visa-versa. It doesn’t particularly matter what the one element is here, so lets just call this one-element set \(1\) and its element \(*\).

We can see that, for any such function \(e : 1 \rightarrow B\) we can recover the “actual element” by function application: \(e(*)\). Also, given any “actual element” \(x \in B\), we can define a function \(e(*) = x\) that sends the one element from \(1\) to the element \(x\) in \(B\).

In this way, we can think of elements of a set \(B\) as being represented by functions \(e : 1 \rightarrow B\). In fact, we can go one step further and think of those functions as actually being elements of \(B\). This might seem strange at first but, since there is this exact correspondence between “actual” elements and functions of that kind, this works out.

This step is crucial, because it lets us generalize the notion of membership. We can think of a generalized element of a set \(B\) as a function \(e : T \rightarrow B\) from any set \(T\). When \(T\) is a singleton set, then we recover our original notion of membership. Otherwise, we get a more general notion of membership, where any number of “actual elements” of the set might be “picked out” by \(f\).

When we look at a generalized element \(e : T \rightarrow B\), we often say that e is an element at the stage of definition \(T\) and write \(e \in_T B\). You can learn properties of a set \(B\) by looking at all the generalized elements of each stage of definition, going through the stages of definition one at a time.

Let’s look at an example where this kind of viewpoint can be useful. Consider injective functions. These are the functions which send each element of their source to a unique element in their target. To put it another way, an injective function \(f : A \rightarrow B\) obeys the property

\[ \text{Given $x \in A$ and $y \in A$,}\newline f(x) = f(y) \implies x = y \]

Using our generalized element idea, we can rewrite this like this:

\[ \text{Given $x : 1 \rightarrow A$ and $y : 1 \rightarrow A$,}\newline f \circ x = f \circ y \implies x = y \]