In category theory
, a 2-category is a category
with "morphisms between morphisms". It can be formally defined as a category enriched
(the category of categories and functors, with the monoidal
structure given by products
More explicitly, a 2-category C consists of:
- A class of 0-cells (or objects) A, B, ....
- For all objects A and B, a category . The objects of this category are called 1-cells and its morphisms are called 2-cells; the composition in this category is written and called vertical composition.
- For all objects A, B and C, there is a functor , called horizontal composition, which is associative and admits the identity 2-cells of idA as identities.
- For any object "A" there is a functor from the terminal category (with one object and one arrow) to .
The notion of 2-category differs from the more general notion of a bicategory in that composition of (1-)morphisms is required to be strictly associative, whereas in a bicategory it need only be associative up to a 2-isomorphism.