Skip to content

Categories

Brooks Mershon edited this page Oct 20, 2016 · 17 revisions

Category

Categories are generalized monoids.

  • Set of Objects.
  • Set of morphisms between objects.

Such that the following category laws hold:

  • There is an identity morphism for each object.
  • There is a way to compose morphisms (the composition formula).

Set (category of sets)

The objects are sets and the morphisms are functions. Composition is merely function composition.

Fin (category of finite sets)

Same as Set, except the sets must be finite. A subcategory Fin ⊆ Set.

Mon (category of monoids)

Unit and associativity hold as a category because they must hold for monoids.

Grp (category of groups)

Non-examples (and how to fix them)

A graph

Not a category if we take the vertices of G to be objects and the arrows to be morphisms. The category laws for identity functions (unit) and composition do not hold.

screen shot 2016-10-15 at 11 59 36 am

Adding a bunch of arrows ensures the category laws hold for G.

screen shot 2016-10-15 at 11 59 43 am

TODO (brooks): Add more examples.

Alternate visualization of categories

Spivak presents the following diagram.

screen shot 2016-10-16 at 1 53 47 pm

The diagram expresses the objects, arrows between objects, unit morphisms, and composition of morphisms required in the definition of a category.

  • A set Ob(C).
  • A set of homomorphisms of the category C.
  • A function ids which gives, for any object in category C, the morphism in HomC which serves as the unit morphism.
  • "Accessor" functions dom and cod which return the object in the domain or codomain, respectively, of some homomorphism of C.
  • A function comp which gives a way to compose any two homomorphisms of C.

Note the use of a fiber product to define a pullback of HomC and HomC over the objects of category C. Naturally this operation is needed to define composition of morphisms.

Monoid as a category

A monoid is a category with one object.

And on a related note:

A monoid homomorphism is just a functor between one-object categories.