Some Basic Examples of Categories

For me, the frustrating thing about learning category theory was that
it seemed to be full of definitions, but that I couldn’t see why I should care.
What were these category things, and what could I really talk about using this
strange new mathematical language of categories?

To avoid that in my presentation, I’m going to show you a couple of examples up front of things we can talk about using the language of category theory: sets, partially ordered sets, and groups.

Sets as a Category

We can talk about sets using category theory. The objects in the category of sets are, obviously, sets. Arrows in the category of sets are total functions between sets.

Let’s see how these satisfy our definition of categories:

  • Given a function f from set A to set B, it’s represented by an arrow f : A → B.
  • º is function composition. It meets the properties of a categorical º:
    • Associativity: function composition over total functions is associative; we know that from set theory.
    • Identity: for any set S, 1S is the identity function: (∀ i ∈ S) 1S(i) = i. It should be pretty obvious that for any f : S → T, f º 1S = f; and 1T º f = f.

Partially Ordered Sets

Partially ordered sets (that is, sets that have a “<=" operator) can be described as a category, usually called PoSet. The objects are the partially ordered sets; the arrows are monotonic functions (a function f is monotonic if (∀ x,y &isin domain(x)) x <= y ⇒ f(x) <= f(y).). Like regular sets, º is function composition.

It’s pretty easy to show the associativity and identity properties; it’s basically the same as for sets, except that we need to show that º preserves the monotonicity property. And that’s not very hard:

  • Suppose we have arrows f : A → B, g : B → C. We know that f and g are monotonic
    functions.

  • Now, for any pair of x and y in the domain of f, we know that if x <= y, then f(x) <= f(y).
  • Likewise, for any pair s,t in the domain of g, we know that if s <= t, then g(s) <= g(t).
  • Put those together: if x <= y, then f(x) <= f(y). f(x) and f(y) are in the domain of g, so if (f(x) <= f(y)) then we know g(f(x)) <= g(f(y)).

Groups as a Category

There is a category Grp where the objects are groups; group homomorphisms are arrows. Homomorphisms are structure-preserving functions between sets; so function composition of those structure-preserving functions is the composition operator º. The proof that function composition preserves structure is pretty much the same as the proof we just ran through for partially ordered sets.

Once you have groups as a category, then you can do something very cool. If groups are a category, then functors over groups are symmetric transformations. Walk it through, and you’ll see that it fits. What took me a week of writing to be able to explain when I was talking about group theory can be stated in one sentence using the language of category theory. That’s a perfect example of why cat theory is useful: it lets you say some very important, very complicated things in very simple ways.

Miscellaneous Comments

There’ve been a couple of questions about from category theory skeptics in the comments. Please don’t think I’m ignoring you. This stuff is confusing enough for most people (me included) that I want to take it slowly, just a little bit at a time, to give readers an opportunity to digest each bit before going on to the next. I promise that I’ll answer your questions eventually!

0 thoughts on “Some Basic Examples of Categories

  1. Mark C. Chu-Carroll

    Thomas:
    What browser/OS are you using?
    I’ve tried viewing with both Firefox and Safari on MacOSX 10.4, and it comes out as the mathematical forall. If it’s consistently not working on some popular OS/browser, I’ll have to switch to either MathML or image files for equation-type stuff which would be a lot less pleasant for me than being able to just type. If it’s something that I can give really easy instructions for how to fix, then I’d rather keep doing it this way ๐Ÿ™‚

    Reply
  2. stephen

    >What happened to matrices as arrows between vector spaces?
    Matrices aren’t arrows between vector spaces in any easy way I can think of – they’re arrows between vector spaces with certain fixed bases : ) (of course, matrices are also elements of vector spaces themselves…).

    Reply
  3. Joe Shelby

    ironic that you have an entry on “categories” just as the SB home page has started its own catagorization of blog entries? ๐Ÿ™‚

    Reply
  4. Nagu

    A few examples are as follows:
    1. Let U, V are finite dimensional with given bases (u_i) i belongs to I,(v_j) j belongs to J.
    There are natural bijections:
    linear maps U—>V e.g. matrices of appropriate size, functions I—>V
    i.e. for all V, f: I—>V, there exists a linear map g: U—>V such that g(u_i) = f(i) for all i belongs to I.
    A simple diagram explains it better, but I do not know how to do it. Apologies. (I tried the trivial way, using the “natural” key-board symbols, but the format was messed up in the preview.)
    2. For any sets X, Y, we have projections
    p1:XxY—>X
    p2:XxY—>Y
    for any set W and functions f1: W–>X, f2: W–>Y, there exists a unique function f: W –> XxY such that p1of = f and p2of = f2.
    3. The circle S1
    0,1*
    {pt}—->[0,1]—->S1
    * 0,1 are mappings
    where {pt} is the one-point set.

    Reply

Leave a Reply