^^Category definition.

logicmatters  Category Theory, A Gentle Introduction. by Peter Smith

3 Category Definition

A category C comprises 2 kinds of things:

governed by the following axioms:

  1. Sources and targets

    For each arrow f, there are unique associated objects src(f) and tar(f),
    respectively the source and target of f; not necessarily distinct.
    We write `f:A→B'  or `Af→B' to notate that f is an arrow with src(f) A and tar(f) B.

  2. Composition

    For any two arrows f:A→B, g:B→C, where src(g) = tar(f),
    there exists an arrow g∘f:A→C, `g following f', which we call the composite of f with g.

  3. Identity arrows

    Given any object A, there is an arrow 1A:A→A called the identity arrow on A.

  4. Associativity of composition.

    For any f:A→B, g:B→C, h:C→D, we have h∘(g∘f) = (h∘g)∘f

  5. Identity arrows behave as identities (of arrows)

    For any f:A→B we have f∘1A = f = 1B∘f


  1. the objects and arrows of a category are very often called the category's data. That's a helpfully neutral term if you don't read too much into it.
  2. The labels `objects' and `arrows' for the two kinds of data are quite standard. But note that the `objects' in categories needn't be objects at all in the logician's familiar strict sense, i.e. in the sense which contrasts objects with entities like relations or functions. There are perfectly good categories whose `objects' (in the sense of their first type of data) are actually relations, and other categories where they are functions.
  3. Borrowing familiar functional notation `f:A→B' for arrows in categories is entirely natural given that arrows in many categories are (structure-preserving) functions: indeed, that is the motivating case. But again not all arrows in categories are functions. Which means that not all arrows are morphisms either, in the usual sense of that term.
    Which is why I rather prefer the colourless `arrow' to the equally common term `morphism' for the second sort of data in a category. (Not that that will stop me often talking of morphisms or maps when context makes that natural!)
  4. In keeping with the functional paradigm, the source and target of an arrow are frequently called, respectively, the `domain' and `codomain' of the arrow (for usually, when arrows are functions, that's what the source and target are). But that usage has the potential to mislead when arrows aren't functions (or aren't functions `in the right direction'), which is again why I prefer our common alternative terminology.
  5. Note the order in which we write the components of a composite arrow (some from computer science do things the other way about). Our standard notational convention is again suggested by the functional paradigm. In a category where f:A→B, g:B→C are both functions, then (g∘f)(x)= g(f)x)).
    Occasionally, to reduce clutter, we may later allow ourselves to write simply `gf' rather than `g∘f'.
  6. In early chapters we will explicitly indicate which object an identity arrow has as both source and target, as in `1A'. Eventually, again to reduce clutter, we will often allow ourselves simply write `1' when context makes it clear which identity arrow is in question.