Lably
Skip to content

Category (mathematics)

Collection of objects and morphisms

  • 10 min read
  • 6 chapters
  • 4 labs on Lably

Learn it on Lably

Category theory is a branch of mathematics that seeks to generalize all of mathematics in terms of categories, independent of what their objects and arrows represent. Virtually every branch of modern mathematics can be described in terms of categories, and doing so often reveals deep insights and similarities between seemingly different areas of mathematics. As such, category theory provides an alternative foundation for mathematics to set theory and other proposed axiomatic foundations. In general, the objects and arrows may be abstract entities of any kind, and the notion of category provides a fundamental and abstract way to describe mathematical entities and their relationships.

In addition to formalizing mathematics, category theory is also used to formalize many other systems in computer science, such as the semantics of programming languages.

Two categories are the same if they have the same collection of objects, the same collection of arrows, and the same associative method of composing any pair of arrows. Two different categories may also be considered "equivalent" for purposes of category theory, even if they do not have precisely the same structure. A mapping between two categories compatible with their respective structures is called a functor.

Well-known categories are denoted by a short capitalized word or abbreviation in bold or italics: examples include Set, the category of sets and set functions; Ring, the category of rings and ring homomorphisms; and Top, the category of topological spaces and continuous maps. All of the preceding categories have the identity map as identity arrows and composition as the associative operation on arrows. Any monoid can be understood as a special sort of category (with a single object whose self-morphisms are represented by the elements of the monoid), and so can any preorder.

The classic and still much used text on category theory is Categories for the Working Mathematician by Saunders Mac Lane. Other references are given in the References below. The basic definitions in this article are contained within the first few chapters of any of these books.

Definition

There are many equivalent definitions of a category. One commonly used definition is as follows. A category C consists of

  • a class ob⁡(C) of objects,
  • a class mor⁡(C) of morphisms or arrows,
  • a domain or source class function dom:mor⁡(C)→ob⁡(C),
  • a codomain or target class function cod:mor⁡(C)→ob⁡(C),
  • for every three objects a,b,c, a binary operation hom⁡(a,b)×hom⁡(b,c)→hom⁡(a,c) called composition of morphisms. Here hom⁡(a,b) denotes the subclass of morphisms f in mor⁡(C) such that dom⁡(f)=a and cod⁡(f)=b. Morphisms in this subclass are written f:a→b, and the composite of f:a→b and g:b→c is often written as g∘f or gf.

such that the following axioms hold:

  • the associative law: if f:a→b, g:b→c and h:c→d then h∘(g∘f)=(h∘g)∘f, and
  • the left and right unit laws: for every object x, there exists a morphism 1x:x→x (some authors write idx) called the identity morphism for x, such that every morphism f:a→x satisfies 1x∘f=f, and every morphism g:x→b satisfies g∘1x=g.

We write f:a→b, and we say "f is a morphism from a to b". We write hom⁡(a,b) (or homC⁡(a,b) when there may be confusion about to which category hom⁡(a,b) refers) to denote the hom-class of all morphisms from a to b.

Some authors write the composite of morphisms in "diagrammatic order", writing f;g (sometimes with ⨟ ) or fg instead of g∘f.

From these axioms, one can prove that there is exactly one identity morphism for every object. Often the map assigning each object its identity morphism is treated as an extra part of the structure of a category, namely a class function i:ob⁡(C)→mor⁡(C).

Some authors use a slight variant of the definition in which each object is identified with the corresponding identity morphism. This stems from the idea that the fundamental data of categories are morphisms and not objects. In fact, categories can be defined without reference to objects at all using a partial binary operation with additional properties.

Sign in to keep reading

5 more chapters are free with a Lably account.

More in Foundations