Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As it is, what is the difference between functor and function? As far as I know, they look really similar.

And is functor used in set theory? I know that function is used in set theory.


share|cite|improve this question
A function assigns to every element of a set $X$ an element of a set $Y$. A functor assigns to every object of a category $C$ an object of a category $D$ and also assigns to every morphism in $C$ a morphism in $D$ in a way compatible with sources, targets, and composition. – Qiaochu Yuan May 7 '12 at 5:14
up vote 9 down vote accepted

To elaborate on Qiaochu's comment:

  • A set $X$, barren of additional structure, is comprised solely of elements $x\in X$. A function from one set to another merely sends elements of the first to elements of the second.
  • A category $\cal C$ is comprised of a class of objects $\mathrm{ob}(\cal C)$, and between any two objects $A,B$ a class of morphisms (or "arrows") denoted $\hom(A,B)$. These classes can be "bigger" than sets too. The objects $A,B$ need not be distinct; there is always the identity morphism $\mathrm{id}_A\in\hom(A,A)$, which is defined so that $f\circ\mathrm{id}_A=f$ and $\mathrm{id}_A\circ g=g$ for any $f\in\hom(A,\cdot)$ and $g\in\hom(\cdot,A)$.

A (covariant) functor $F:\cal C\to D$ of categories sends objects of $\cal C$ to those of $\cal D$, and similarly morphisms in $\cal C$ to morphisms of $\cal D$, such that the following three hold true:

  1. Identities are preserved: $F\,\mathrm{id}_A=\mathrm{id}_{FA}$.
  2. Sources and targets are preserved: If $A\xrightarrow{f}B$, then $FA\xrightarrow{Ff}FB$.
  3. Composition is preserved: If $A\xrightarrow{f}B\xrightarrow{g}C$, then $FA\xrightarrow{Ff}FB\xrightarrow{Fg}FC$.

Note that the functor sends an object $A$ to $FA$ and morphism $f$ to $Ff$; this is our given notational convention. Alternatively, the latter two may be stated non-diagramatically:

$~~$ 2. If $f\in\hom(A,B)$ then $Ff\in\hom(FA,FB)$.

$~~$ 3. If $f\in\hom(A,B)$ and $g\in\hom(B,C)$, then $F(g\circ f)=Fg\circ Ff$ inside $\cal D$. (Note the order.)

These properties ensure that commutative diagrams are preserved by functors. A *contra*${}$variant functor is defined similarly, except order of composition is reversed, ie $F(g\circ f)=Ff\circ Fg$ in $\cal D$.

So, like functions between sets, functors map the entities inside one category to another. The difference is that categories have more structure than sets, and indeed can be "bigger" than sets, and further that functors must preserve the internal structure of the categories.

share|cite|improve this answer
I always wondered... Thanks for illuminating. – MathematicalOrchid May 7 '12 at 9:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.