# Category of elements

In category theory, if C is a category and is a set-valued functor, the category of elements of F (also denoted by CF) is the category defined as follows:

• Objects are pairs where and .
• An arrow is an arrow in C such that .

A more concise way to state this is that the category of elements of F is the comma category , where is a one-point set. The category of elements of F comes with a natural projection that sends an object (A,a) to A, and an arrow to its underlying arrow in C.

## The category of elements of a presheaf

Somewhat confusingly in some texts (e.g. Mac Lane, Moerdijk), the category of elements for a presheaf is defined differently. If is a presheaf, the category of elements of P (again denoted by , or, to make the distinction to the above definition clear, C P) is the category defined as follows:

• Objects are pairs where and .
• An arrow is an arrow in C such that .

As one sees, the direction of the arrows is reversed. One can, once again, state this definition in a more concise manner: the category just defined is nothing but . Consequentially, in the spirit of adding a "co" in front of the name for a construction to denote its opposite, one should rather call this category the category of coelements of P.

For C small, this construction can be extended into a functor C from to , the category of small categories. In fact, using the Yoneda lemma one can show that CP , where is the Yoneda embedding. This isomorphism is natural in P and thus the functor C is naturally isomorphic to .