Introduction to Category Theory/Functors

Functor
A structure-preserving map between categories is called functor. A (covariant) functor F from category $$\mathcal{C}$$ to category $$\mathcal{D}$$ satisfies
 * $$F$$ sends objects of $$\mathcal{C}$$ to objects of $$\mathcal{D}$$.
 * $$F$$ sends arrows of $$\mathcal{C}$$ to arrows of $$\mathcal{D}$$.
 * If $$m$$ is an arrow from $$A$$ to $$B$$ in $$\mathcal{C}$$, then $$F(m)$$ is an arrow from $$F(A)$$ to $$F(B)$$ in $$\mathcal{D}$$.
 * $$F$$ sends identity arrows to identity arrows: $$F(1_A) = 1_{F(A)}\;$$.
 * $$F$$ preserves compositions: $$F(g \circ f) = F(g) \circ F(f)$$.

A contravariant functor reverses arrows:
 * If $$m$$ is an arrow from $$A$$ to $$B$$ in $$\mathcal{C}$$, then $$F(m)$$ is an arrow from $$F(B)$$ to $$F(A)$$ in $$\mathcal{D}$$.
 * $$F$$ preserves compositions: $$F(g \circ f) = F(f) \circ F(g)$$.

Natural Transformations
If F and G are covariant functors between the categories $$\mathcal{C}$$ and $$\mathcal{D}$$, then a natural transformation $$\eta$$ from F to G associates to every object X in $$\mathcal{C}$$ a morphism $$\eta_X: F(X) \to G(X)$$ in $$\mathcal{D}$$ called the component of $$\eta$$ at X, such that for every morphism $$f: X \to Y$$ in $$\mathcal{C}$$ we have $$\eta_Y \circ F(f) = G(f) \circ \eta_X$$. This equation can conveniently be expressed by the commutative diagram



If both F and G are contravariant, the horizontal arrows in this diagram are reversed. If $$\eta$$ is a natural transformation from F to G, we also write $$\eta:F \to G$$. This is also expressed by saying the family of morphisms $$\eta_X: F(X) \to G(X)$$ is natural in X.

If, for every object X in C, the morphism $$\eta_X$$ is an isomorphism in $$\mathcal{D}$$, then $$\eta$$ is said to be a natural isomorphism (or sometimes natural equivalence or isomorphism of functors). Two functors F and G are called naturally isomorphic or simply isomorphic if there exists a natural isomorphism from F to G.

Natural transformations are usually far more natural than the definition above.

Related resources

 * Functor
 * Natural transformation