# Introduction to Category Theory/Functors

## Functor

A structure-preserving map between categories is called functor. A (covariant) functor F from category ${\displaystyle {\mathcal {C}}}$ to category ${\displaystyle {\mathcal {D}}}$ satisfies

• ${\displaystyle F}$ sends objects of ${\displaystyle {\mathcal {C}}}$ to objects of ${\displaystyle {\mathcal {D}}}$.
• ${\displaystyle F}$ sends arrows of ${\displaystyle {\mathcal {C}}}$ to arrows of ${\displaystyle {\mathcal {D}}}$.
• If ${\displaystyle m}$ is an arrow from ${\displaystyle A}$ to ${\displaystyle B}$ in ${\displaystyle {\mathcal {C}}}$, then ${\displaystyle F(m)}$ is an arrow from ${\displaystyle F(A)}$ to ${\displaystyle F(B)}$ in ${\displaystyle {\mathcal {D}}}$.
• ${\displaystyle F}$ sends identity arrows to identity arrows: ${\displaystyle F(1_{A})=1_{F(A)}\;}$.
• ${\displaystyle F}$ preserves compositions: ${\displaystyle F(g\circ f)=F(g)\circ F(f)}$.

A contravariant functor reverses arrows:

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

## Natural Transformations

If F and G are covariant functors between the categories ${\displaystyle {\mathcal {C}}}$ and ${\displaystyle {\mathcal {D}}}$, then a natural transformation ${\displaystyle \eta }$ from F to G associates to every object X in ${\displaystyle {\mathcal {C}}}$ a morphism ${\displaystyle \eta _{X}:F(X)\to G(X)}$ in ${\displaystyle {\mathcal {D}}}$ called the component of ${\displaystyle \eta }$ at X, such that for every morphism ${\displaystyle f:X\to Y}$ in ${\displaystyle {\mathcal {C}}}$ we have ${\displaystyle \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 ${\displaystyle \eta }$ is a natural transformation from F to G, we also write ${\displaystyle \eta :F\to G}$. This is also expressed by saying the family of morphisms ${\displaystyle \eta _{X}:F(X)\to G(X)}$ is natural in X.

If, for every object X in C, the morphism ${\displaystyle \eta _{X}}$ is an isomorphism in ${\displaystyle {\mathcal {D}}}$, then ${\displaystyle \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.