---
title: "Functors: Maps Between Categories"
module: Foundations
moduleNumber: 1
lessonNumber: 4
order: 104
summary: >
  A functor sends objects to objects and arrows to arrows while preserving
  composition and identities. Covariant and contravariant functors, the standard
  stock (forgetful, free, hom, and powerset), and the classification by
  faithfulness, fullness, and essential surjectivity all follow. Functors compose,
  so categories and functors form a category themselves.
topics: [Foundations]
sources:
  - book: Leinster
    ref: "§1.2 Functors — definition, forgetful and free functors, contravariance, presheaves, full and faithful"
  - book: Simmons
    ref: "Ch. 3 §3.1 Functors defined; §3.2 Some simple functors; §3.3.1 Three power set functors"
  - book: Barr & Wells
    ref: "Ch. 3 §3.1 Functors; §3.3 Types of functors"
draft: false
---

Whenever we conceive of a collection of objects, we should decide at the same
time how those objects are to be compared — Simmons states this as the operating
principle of the subject.[^simmons-def] Categories are themselves mathematical objects, so
the principle applies to them, and the comparison gadget is called a functor. A
functor translates one category into another (objects to objects, arrows to
arrows) in a way that respects the only structure a category has: composition
and identities. The standard constructions of mathematics (take the underlying
set, form the free group, form the fundamental group, take the dual space) are
all functors, and seeing them as such is one of the first practical uses of the
subject.

## The definition

> **Definition (Functor).** Let $\mathcal{A}$ and $\mathcal{B}$ be categories. A
> **functor** $F : \mathcal{A} \to \mathcal{B}$ consists of:
> - a function $\operatorname{ob}(\mathcal{A}) \to \operatorname{ob}(\mathcal{B})$,
>   written $A \mapsto F(A)$;
> - for each pair $A, A'$, a function
>   $\mathcal{A}(A, A') \to \mathcal{B}(F(A), F(A'))$, written $f \mapsto F(f)$;
>
> such that
> - $F(f' \circ f) = F(f') \circ F(f)$ whenever the composite is defined, and
> - $F(1_A) = 1_{F(A)}$ for every object $A$.

The two axioms supply what the following bookkeeping fact needs:
from any string $A_0 \xrightarrow{f_1} \cdots \xrightarrow{f_n} A_n$ in
$\mathcal{A}$, all ways of applying $F$ and composing yield the same arrow
$F(A_0) \to F(A_n)$.[^lein-def] A functor is a picture of the source category
drawn inside the target category, with all commuting diagrams preserved: if
$gf = h$ in $\mathcal{A}$, then $F(g)F(f) = F(h)$ in $\mathcal{B}$. In
particular, functors preserve isomorphisms: if $gf = 1$ and $fg = 1$ then
$F(g)F(f) = 1$ and $F(f)F(g) = 1$, so $A \cong A'$ implies $F(A) \cong F(A')$.

$$
% caption: A functor $F$ carries a commuting triangle of $\mathcal{A}$ to a
% commuting triangle of $\mathcal{B}$; the image may collapse objects but never
% breaks an equation between composites.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
% source triangle
\node (A) at (0,1.5) {$A$};
\node (B) at (1.9,1.5) {$B$};
\node (C) at (1.9,-0.2) {$C$};
\draw[->, acc, thick] (A) -- (B) node[midway, above] {$f$};
\draw[->, acc, thick] (B) -- (C) node[midway, right] {$g$};
\draw[->, black, thick] (A) -- (C) node[midway, below left] {$gf$};
\draw[black, dashed] (-0.7,-1.0) rectangle (2.7,2.2);
\node[black, font=\footnotesize] at (1.0,-1.35) {$\mathcal{A}$};
% arrow between categories
\draw[->, black, very thick] (3.2,0.6) -- (4.6,0.6) node[midway, above] {$F$};
% target triangle
\node (FA) at (5.5,1.5) {$F(A)$};
\node (FB) at (7.8,1.5) {$F(B)$};
\node (FC) at (7.8,-0.2) {$F(C)$};
\draw[->, acc, thick] (FA) -- (FB) node[midway, above] {$F(f)$};
\draw[->, acc, thick] (FB) -- (FC) node[midway, right] {$F(g)$};
\draw[->, black, thick] (FA) -- (FC) node[midway, below left] {$F(gf)$};
\draw[black, dashed] (4.8,-1.0) rectangle (8.8,2.2);
\node[black, font=\footnotesize] at (6.8,-1.35) {$\mathcal{B}$};
\end{tikzpicture}
$$

Functors compose in the evident way (apply one, then the other), and every
category has an identity functor $1_{\mathcal{A}}$. So categories and functors
themselves form a category, written $\mathbf{CAT}$ (with $\mathbf{Cat}$ reserved
for the category of _small_ categories, a distinction taken up in
[the size lesson](/category-theory/foundations/size-and-set-theory)).[^lein-cat]
The pattern "structures and their structure-preserving maps form a category"
applies one level up.

## Forgetful and free functors

The easiest functors discard structure.

- **$U : \mathbf{Grp} \to \mathbf{Set}$** sends a group to its underlying set
  and a homomorphism to itself-as-function. It forgets the group structure.
- **$\mathbf{Ring} \to \mathbf{Ab}$** forgets multiplication, keeping the
  additive group; **$\mathbf{Ring} \to \mathbf{Mon}$** forgets addition, keeping
  the multiplicative monoid. Forgetting can be partial.
- **$\mathbf{Ab} \to \mathbf{Grp}$** changes nothing at all: it forgets the
  _property_ of being abelian rather than any structure.

"Forgetful" has no precise definition; it is a name for a family of examples,
but the family is coherent enough to reason about.[^lein-forget] Simmons
tabulates a dozen of these; the pattern is always a functor to a category of
less-furnished objects that is the identity on underlying functions.

Free functors run the other way, adding structure as freely as possible.

- **$F : \mathbf{Set} \to \mathbf{Grp}$** sends $S$ to the free group on $S$:
  words like $x^{-4} y x^2 z y^{-3}$ in the elements of $S$, multiplied by
  concatenation, with only the cancellation forced by the group axioms. A
  function $f : S \to S'$ induces $F(f)$ by renaming letters.
- **$F : \mathbf{Set} \to \mathbf{Vect}_k$** sends $S$ to the vector space with
  basis $S$: formal finite $k$-linear combinations $\sum_{s} \lambda_s s$.
- **$F : \mathbf{Set} \to \mathbf{CRing}$** sends $S$ to the polynomial ring
  $\mathbb{Z}[x_s : s \in S]$; a polynomial is a formal expression in the
  generators, so this is the free commutative ring.
- **$F : \mathbf{Set} \to \mathbf{Mon}$** sends $S$ to the Kleene closure
  $S^\ast$, the [free monoid](/category-theory/foundations/examples-of-categories)
  on $S$.

$$
% caption: The free and forgetful functors between Set and Grp run in opposite
% directions; the precise sense in which they are partners is an adjunction,
% the subject of a later module.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\node[draw, minimum width=22mm, minimum height=10mm] (set) at (0,0) {$\mathbf{Set}$};
\node[draw, minimum width=22mm, minimum height=10mm] (grp) at (5,0) {$\mathbf{Grp}$};
\draw[->, acc, thick] ([yshift=6pt]set.east) -- ([yshift=6pt]grp.west) node[midway, above] {$F$ (free)};
\draw[->, acc, thick] ([yshift=-6pt]grp.west) -- ([yshift=-6pt]set.east) node[midway, below] {$U$ (forgetful)};
\end{tikzpicture}
$$

The pairing is not an accident. Free and forgetful functors are partners in a
precise sense — each free functor is _left adjoint_ to its forgetful companion —
made precise in the
[adjunctions module](/category-theory/adjunctions/adjunctions).[^lein-free]

> **Worked example (The list functor on a map).** Lists form a functor
> $(-)^\ast : \mathbf{Set} \to \mathbf{Set}$, sending a set $A$ to the set $A^\ast$
> of finite lists over $A$ and a function $f : A \to B$ to the function $f^\ast$
> that applies $f$ entrywise. For $f : \{a, b\} \to \{0, 1\}$ with $f(a) = 0$,
> $f(b) = 1$,
> $$
> f^\ast([a, b, a, b]) = [0, 1, 0, 1], \qquad f^\ast([\,]) = [\,].
> $$
> Functoriality holds entrywise: $(g \circ f)^\ast = g^\ast \circ f^\ast$ because
> applying $g \circ f$ to each entry equals applying $f$ then $g$, and
> $(1_A)^\ast = 1_{A^\ast}$ because leaving each entry alone leaves the list alone.

Historically, some of the first functors came from algebraic topology, where the
strategy is to convert a hard question about spaces into a tractable one about
algebra. The fundamental group is a functor
$\pi_1 : \mathbf{Top}_\ast \to \mathbf{Grp}$ from based spaces to groups: a
based continuous map $f$ induces a homomorphism $\pi_1(f) = f_\ast$, and
functoriality, $(g \circ f)_\ast = g_\ast \circ f_\ast$, is what lets
topological conclusions be drawn from algebraic computations.

## Functors between small categories

When the source and target are one-object or thin categories, functoriality
specializes to familiar notions.

| Source $\to$ target | A functor amounts to |
| --- | --- |
| monoid $G \to$ monoid $H$ | a monoid homomorphism $G \to H$ |
| monoid $G \to \mathbf{Set}$ | a left $G$-set (an action of $G$) |
| monoid $G \to \mathbf{Vect}_k$ | a $k$-linear representation of $G$ |
| poset $A \to$ poset $B$ | a monotone map $A \to B$ |

Expand the $G$-set row. A functor $F : G \to \mathbf{Set}$ from a
one-object category picks a single set $S = F(\ast)$ and, for each $g \in G$, a
function $F(g) : S \to S$; functoriality says $F(g'g) = F(g') \circ F(g)$ and
$F(1) = 1_S$. Writing $g \cdot s$ for $F(g)(s)$, these are precisely the axioms
of a left action.[^lein-gset] Representation theory, from this angle, is the
study of functors out of a one-object category — a first instance of a
definition that yields new theorems once recast functorially.

> **Worked example (An action of $\mathbb{Z}/2$ as a functor).** Regard the group
> $\mathbb{Z}/2 = \{e, g\}$ as a one-object category, so a functor
> $F : \mathbb{Z}/2 \to \mathbf{Set}$ is a set $S = F(\ast)$ together with an
> involution $F(g) : S \to S$: functoriality forces
> $F(g) \circ F(g) = F(g^2) = F(e) = 1_S$. Take $S = \{1, 2, 3\}$ and $F(g)$ the
> permutation swapping $1$ and $2$ and fixing $3$. Then
> $F(g)(F(g)(1)) = F(g)(2) = 1$, and likewise for $2$ and $3$, so $F(g)$ is its
> own inverse and $F$ is a functor. The action $g \cdot s$ is the swap, and the
> single functor axiom is the group law $g \cdot (g \cdot s) = s$.

$$
% caption: The functor from the two-element group to Set that sends the generator
% to the swap of 1 and 2 fixing 3; applying the generator twice returns the
% identity, which is the only functor axiom with content here.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\node (n1) at (0,0) {$1$};
\node (n2) at (2.4,0) {$2$};
\node (n3) at (4.8,0) {$3$};
\draw[->, acc, thick] (n1) to[bend left=35] node[midway, above] {$g$} (n2);
\draw[->, acc, thick] (n2) to[bend left=35] node[midway, below] {$g$} (n1);
\draw[->, black, thick] (n3) to[out=45, in=-45, looseness=6] node[midway, right] {$g$} (n3);
\end{tikzpicture}
$$

## Contravariance

Some natural operations reverse arrows. Simmons's dichotomy is sharp: a functor
either preserves the direction of every arrow (covariant) or reverses the
direction of every arrow (contravariant) — never a mixture.[^simmons-def]

> **Definition (Contravariant functor).** A **contravariant functor** from
> $\mathcal{A}$ to $\mathcal{B}$ is a functor
> $\mathcal{A}^{\mathrm{op}} \to \mathcal{B}$. Concretely: $f : A \to A'$ is sent
> to $F(f) : F(A') \to F(A)$, and composition reverses,
> $F(g \circ f) = F(f) \circ F(g)$.

Phrasing contravariance through the opposite category keeps every functor
literally covariant and pushes the reversal into the source; this convention
simplifies later work. The main examples:

- **Dual spaces.** Fix a field $k$. Sending $V \mapsto V^\ast =
  \operatorname{Hom}(V, k)$ and $f \mapsto f^\ast$ (precomposition) is a
  contravariant functor from $\mathbf{Vect}_k$ to itself.
- **Function rings.** Sending a space $X$ to the ring $C(X)$ of continuous
  real-valued functions on $X$, and a continuous $f : X \to Y$ to the
  homomorphism $C(f) : C(Y) \to C(X)$, $q \mapsto q \circ f$, is a contravariant
  functor from $\mathbf{Top}$ to $\mathbf{Ring}$.[^lein-contra]
- **Open sets.** Sending a space $S$ to its poset of open sets
  $\mathcal{O}S$ and a continuous $\varphi$ to the inverse-image map
  $\varphi^{\leftarrow}$ is contravariant from $\mathbf{Top}$ to $\mathbf{Pos}$.

Contravariant functors into $\mathbf{Set}$ are important enough to be named: a
**presheaf** on $\mathcal{A}$ is a functor
$\mathcal{A}^{\mathrm{op}} \to \mathbf{Set}$. The name comes from topology: a
presheaf on the poset of open sets of a space assigns to each open $U$ a set
$F(U)$ (say, the continuous functions on $U$) and to each inclusion
$U \subseteq U'$ a restriction map $F(U') \to F(U)$. Presheaves become
central in the [Yoneda module](/category-theory/representables-yoneda/representable-functors).

### The hom-functors

For a fixed object $K$ of any category $\mathcal{C}$, composition itself gives
two functors into $\mathbf{Set}$, one of each variance:

$$
\mathcal{C}(K, -) : \mathcal{C} \to \mathbf{Set},
\qquad
\mathcal{C}(-, K) : \mathcal{C}^{\mathrm{op}} \to \mathbf{Set}.
$$

On objects, $A \mapsto \mathcal{C}(K, A)$ and $A \mapsto \mathcal{C}(A, K)$. On
an arrow $f : A \to B$, the covariant functor post-composes,
$r \mapsto f \circ r$, and the contravariant functor pre-composes,
$l \mapsto l \circ f$. The variance check is a two-line computation each way:
$(g \circ f) \circ r$ associates as $g \circ (f \circ r)$, while
$l \circ (g \circ f)$ associates as $(l \circ g) \circ f$ — post-composition
preserves order, pre-composition reverses it.[^simmons-hom] The dash `$-$` is a
placeholder for the argument. These hom-functors are central to the subject; the
[representables module](/category-theory/representables-yoneda/representable-functors)
is entirely about them.

### Three powerset functors

Different functors can share an object assignment. On objects, send every set
$A$ to its powerset $\mathcal{P}A$; there are three standard ways to extend this
to arrows $f : A \to B$:[^simmons-powerset]

- **Direct image (covariant):** $\exists(f)(X) = f[X]$, so
  $b \in \exists(f)(X)$ iff $b = f(a)$ for _some_ $a \in X$.
- **Inverse image (contravariant):** $I(f)(Y) = f^{\leftarrow}(Y)$, so
  $a \in I(f)(Y)$ iff $f(a) \in Y$.
- **Universal image (covariant):** $\forall(f)(X) = (f[X'])'$ (complement of the
  image of the complement), so $b \in \forall(f)(X)$ iff _every_ $a$ with
  $f(a) = b$ lies in $X$.

In a more general setting $\exists$ and $\forall$ are precisely the categorical
semantics of the two quantifiers, and the three functors line up into adjunctions
$\exists \dashv I \dashv \forall$. The functor equations to check are
$\exists(g \circ f) = \exists(g) \circ \exists(f)$ and its two companions, with
the middle one reversed: $I(g \circ f) = I(f) \circ I(g)$.

> **Worked example (The three powerset functors on a constant map).** Let
> $f : \{1, 2\} \to \{a\}$ be the only map to a one-element set. The direct image
> $\exists f : \mathcal{P}\{1, 2\} \to \mathcal{P}\{a\}$ sends every nonempty
> subset to $\{a\}$ and $\emptyset$ to $\emptyset$. The inverse image
> $I f : \mathcal{P}\{a\} \to \mathcal{P}\{1, 2\}$ (contravariant) sends
> $\{a\} \mapsto \{1, 2\}$ and $\emptyset \mapsto \emptyset$. The universal image
> $\forall f$ places $a$ in the output only when _every_ preimage of $a$ is
> present, so
> $$
> \forall f(\{1, 2\}) = \{a\}, \qquad
> \forall f(\{1\}) = \forall f(\{2\}) = \forall f(\emptyset) = \emptyset.
> $$
> The three extensions of the single object assignment $A \mapsto \mathcal{P}A$
> disagree already on this two-point set, and the adjunctions
> $\exists f \dashv I f \dashv \forall f$ relate them.

## Faithful, full, essentially surjective

Functions between sets are classified by injectivity and surjectivity; functors
admit a finer classification because they act on two levels, objects and arrows.
The useful notions live at the hom-set level.

> **Definition (Faithful, full).** A functor $F : \mathcal{A} \to \mathcal{B}$
> is **faithful** (resp. **full**) if for every pair $A, A'$ the function
>
> $$
> \mathcal{A}(A, A') \to \mathcal{B}(F(A), F(A')), \qquad f \mapsto F(f)
> $$
>
> is injective (resp. surjective). It is **essentially surjective** if every
> object of $\mathcal{B}$ is isomorphic to $F(A)$ for some $A$.

Faithfulness is a hom-set-by-hom-set condition, not global injectivity on
arrows. A faithful functor can send two arrows with
different sources to the same arrow: the inclusion of a two-object discrete
category into $\mathbf{1}$ collapses everything yet is vacuously faithful on
each hom-set.[^lein-faithful]

$$
% caption: Fullness and faithfulness measure the fibers of the hom-set map: for
% each arrow $g$ downstairs, faithful means at most one preimage upstairs, full
% means at least one.
\begin{tikzpicture}[scale=1.0, >=stealth, font=\small]
\definecolor{acc}{HTML}{4A6FA5}
\node (A) at (0,1.2) {$A$};
\node (A2) at (2.6,1.2) {$B$};
\draw[->, acc, thick] ([yshift=3pt]A.east) -- ([yshift=3pt]A2.west);
\draw[->, acc, thick, dashed] ([yshift=-3pt]A.east) -- ([yshift=-3pt]A2.west);
\node[black, font=\footnotesize] at (1.3,1.85) {arrows $A$ to $B$};
\node (FA) at (0,-1.2) {$F(A)$};
\node (FA2) at (2.6,-1.2) {$F(B)$};
\draw[->, black, thick] (FA) -- (FA2) node[midway, below] {$g$};
\draw[->, black, thick] (1.3,0.6) -- (1.3,-0.5) node[midway, right] {$F$};
\node[black, font=\footnotesize, align=left] at (6.4,0.0)
  {faithful: at most one dashed lift\\full: at least one dashed lift\\full and faithful: exactly one};
\end{tikzpicture}
$$

The stock examples calibrate the definitions:

| Functor | Faithful | Full | Essentially surjective |
| --- | --- | --- | --- |
| $U : \mathbf{Grp} \to \mathbf{Set}$ | yes | no | no |
| $\mathbf{Ab} \hookrightarrow \mathbf{Grp}$ | yes | yes | no |
| free $F : \mathbf{Set} \to \mathbf{Grp}$ | yes | no | no |
| $\pi_1 : \mathbf{Top}_\ast \to \mathbf{Grp}$ | no | no | yes |

A **subcategory** $\mathcal{S}$ of $\mathcal{A}$ selects some objects and some
arrows among them, closed under composition and identities; it is **full** when
it keeps _all_ arrows between selected objects, so a full subcategory is
specified by its objects alone ($\mathbf{Ab}$ inside $\mathbf{Grp}$). Inclusion
functors of subcategories are automatically faithful, and full exactly for full
subcategories. One caution: the image of a functor need not be a subcategory,
since composable image-arrows can have a composite that is not itself an image —
$F(g) \circ F(f)$ exists downstairs even when $g$ and $f$ do not compose
upstairs.[^lein-faithful]

Full-and-faithful functors are the categorical notion of embedding: they reflect
isomorphism ($F(A) \cong F(A')$ implies $A \cong A'$), and adding essential
surjectivity yields the functors that are _equivalences_ of categories, the notion
of "the same category." Defining equivalence requires comparing functors to
identity functors, which is what
[natural transformations](/category-theory/foundations/natural-transformations)
do; the [Yoneda embedding](/category-theory/representables-yoneda/yoneda-consequences)
being full and faithful rests on the same vocabulary.

[^simmons-def]: **Simmons**, _An Introduction to Category Theory_, §3.1 — functors as the comparison gadgets for categories; Definitions 3.1.1–3.1.2 with the covariant/contravariant dichotomy ("always one or the other, never sometimes each").
[^lein-def]: **Leinster**, _Basic Category Theory_, §1.2, Definition 1.2.1 and Remarks 1.2.2 — the functor axioms and the unique-composite bookkeeping they guarantee.
[^lein-cat]: **Leinster**, §1.2, Remarks 1.2.2(b) — functors compose, identity functors exist, and categories and functors form the category $\mathbf{CAT}$.
[^lein-forget]: **Leinster**, §1.2, Examples 1.2.3 — forgetful functors from $\mathbf{Grp}$, $\mathbf{Ring}$, $\mathbf{Vect}_k$; forgetting structure versus forgetting properties ($\mathbf{Ab} \to \mathbf{Grp}$); with Simmons §3.2, Table 3.1 for the extended catalogue.
[^lein-free]: **Leinster**, §1.2, Examples 1.2.4 — free groups (words with cancellation), free commutative rings (polynomial rings), and free vector spaces (formal linear combinations) as functors on $\mathbf{Set}$.
[^lein-gset]: **Leinster**, §1.2, Examples 1.2.7–1.2.9 — functors between one-object categories are homomorphisms, functors $G \to \mathbf{Set}$ are $G$-sets, functors $G \to \mathbf{Vect}_k$ are representations, and functors between posets are monotone maps.
[^lein-contra]: **Leinster**, §1.2, Definition 1.2.10 and Examples 1.2.11–1.2.15 — contravariant functors as functors on $\mathcal{A}^{\mathrm{op}}$; the function-ring functor $C$, dual vector spaces, and presheaves.
[^simmons-hom]: **Simmons**, §3.2 — the covariant and contravariant hom-functors $\mathcal{C}[K, -]$ and $\mathcal{C}[-, K]$, with the parallel associativity computations that fix their variances.
[^simmons-powerset]: **Simmons**, §3.3.1 — the three powerset functors $\exists$, $I$, $\forall$: direct image, inverse image, and universal image, with the quantifier readings and the double adjunction of Exercise 3.3.2.
[^lein-faithful]: **Leinster**, §1.2, Definition 1.2.16, Warning 1.2.17, Definition 1.2.18, and Warning 1.2.19 — faithful and full via hom-set maps, the caution that faithfulness is not injectivity on arrows, full subcategories, and the image-not-a-subcategory example.
