TITLE: Set theory aspects of category theory
QUESTION [5 upvotes]: I have never learnt axiomatic set theory, but have studied it from Munkres's Topology book first chapter. So I do not understand the difference between a class and a set except in some vague sense.
Now I am willing to learn category theory and have studied the chapter in Hungerford's book. But this issue of classes vs sets and the related ones like when is a category small are unclear to me. What could be a good place to study these topics (does MacLane deal with them ?) in a proper logical way for the purpose of understanding categories? I am not planning to specialize in logic/set theory so am not looking for the most detailed books.
I have taken undergrad courses in Analysis, Topology and graduate level courses in Algebra.

REPLY [5 votes]: Suppose we know what sets are, either naively or in some more formal way. Let us say that a set $\mathcal U$ is a (Grothendieck) universe if the following hold.

$x\in y\in\mathcal U\implies x\in \mathcal U$;
$x,y\in\mathcal U\implies \{x,y\}\in \mathcal U$;
$x\in\mathcal U\implies\mathcal P(x)\in \mathcal U$;
if $J\in\mathcal U$ and $x_j\in\mathcal U$ for all $j\in J$, then $\bigcup_{j\in J}x_j\in\mathcal U$.

One can then show that all the set operations performed on elements of $\mathcal U$ result in elements of $\mathcal U$. For example if $x,y\in\mathcal U$ then $x\times y\in\mathcal U$, $x^y\in\mathcal U$, etc. In fact, if you assume that the set of natural numbers is an $element$ of $\mathcal U$, then $\mathcal U$ is a model of set theory, so you can do all "normal" mathematics inside $\mathcal U$. This also means that you cannot prove the existence of such a $\mathcal U$ in set theory, but let's forget about that for a moment.
Suppose we have some universe $\mathcal U$. We call the elements of $\mathcal U$ $\mathcal U$-sets and the subsets of $\mathcal U$ $\mathcal U$-classes. Notice that every $\mathcal U$-set is a $\mathcal U$-class (follows from condition (1) above), but not vice versa (consider $\mathcal U$ itself). One can then define a $\mathcal U$-category to be a category whose collections of objects and arrows are $\mathcal U$-classes. Such a category is small when these collections are $\mathcal U$-sets.
There are several ways to use these universes. One powerful way is to assume that every set is contained in some universe. Then in particular, since we defined a universe to be a set itself, we get a chain of universes $\mathcal U_0\in\mathcal U_1\in\mathcal U_2\in\dotsb$, and whenever our categories become too big to be (small) $\mathcal U_n$-categories we can just switch to a bigger universe.
If the above sounds too much, you can just assume the existence of one universe $\mathcal U$ which contains the natural numbers. [I'm a little unsure about the details, but I believe this should be equivalent to assuming that our standard set theory ZFC is consistent. Correct me if I'm wrong.] Then, instead of calling the elements of $\mathcal U$ $\mathcal U$-sets, you call them just sets (or small sets), and you call the subsets of $\mathcal U$ just classes. At least for the purposes of category theory, this is a perfectly good way to define sets and classes. Plus, whenever you suddenly see that you need bigger categories, you can just assume one bigger universe and continue ;)