Functors

Published:

If a category is a mathematical world, what preserves the structure of an entire world?

How can one kind of mathematics be translated into another without losing composition?

A category organizes a subject by its objects, morphisms, identities, and composition. Sets with functions form one category. Groups with homomorphisms form another. Vector spaces with linear maps form another. Topological spaces with continuous maps form another.

Each category is a world of structure.

C:
objects and morphisms

D:
objects and morphisms

Once entire worlds have been made visible, the next structural move is to compare them. The comparison must respect the arrows and their composition. Otherwise it would ignore the very feature that made the worlds categorical.

A functor is a structure-preserving map between categories.

C --F--> D

A functor assigns each object A of C to an object F(A) of D, and each morphism f: A -> B in C to a morphism

F(f): F(A) -> F(B)

in D.

A --f--> B        in C
|         |
F         F
v         v
F(A) --F(f)--> F(B)   in D

This object-and-arrow assignment is not enough by itself. The assignment must preserve identity morphisms and composition.

For every object A,

F(id_A) = id_F(A)

For composable morphisms f: A -> B and g: B -> C,

F(g . f) = F(g) . F(f)

These two laws say that the functor respects the categorical grammar. Doing nothing in the source world translates to doing nothing in the target world. Doing two steps and then translating gives the same result as translating each step and then doing them in the target world.

A --f--> B --g--> C
|         |        |
F         F        F
v         v        v
F(A) --F(f)--> F(B) --F(g)--> F(C)

F(g . f) = F(g) . F(f)

This is the categorical version of structure preservation. A group homomorphism preserves multiplication. A linear map preserves addition and scalar multiplication. A continuous map preserves the open-set behavior relevant to continuity. A functor preserves identities and composition.

ordinary structure:
operation preserved

categorical structure:
composition preserved

The simplest example is a forgetful functor.

A group is a set with extra structure: a multiplication, an identity element, and inverses satisfying laws. There is a functor

Grp -> Set

that sends each group to its underlying set and each group homomorphism to its underlying function.

group G        |-> underlying set of G
homomorphism h |-> underlying function h

This functor forgets group structure, but it does not forget how maps compose. The identity homomorphism has the identity function underneath it. The composite of two homomorphisms has the composite function underneath it.

underlying(h . k) = underlying(h) . underlying(k)

So even forgetting structure can be structure-preserving at the categorical level.

There are similar forgetful functors:

Ring -> Set
Vect -> Set
Top -> Set

Each one keeps the underlying points or elements while discarding some selected structure. But each remains a functor because it preserves the shape of identity and composition.

Functors can also add structure. A free construction sends unstructured data to the most general structured object generated by it. A set can generate a free group. A set can generate a free vector space. A set can generate a polynomial algebra.

Set -> Grp
Set -> Vect
Set -> Ring

The details differ, but the pattern is the same. The functor assigns to each input object a structured object, and assigns to each input map a structure-preserving map between the generated objects.

set X ----u----> set Y
  |               |
free             free
  v               v
free object on X -> free object on Y

This explains why "free" constructions kept appearing earlier. They are often functorial: they turn maps between generators into maps between generated structures.

Functors also express representation.

A group can act on a set. That means each group element determines a symmetry of the set, and multiplication in the group matches composition of those symmetries. Categorically, a group can be viewed as a one-object category, with the convention for composition chosen to match the action. A group action is then a functor from that one-object category into Set.

group as one-object category
        |
        | functor
        v
Set

This looks abstract, but it says something simple: the algebra of the group is represented as transformations of a set. The functor preserves composition, so multiplying group elements corresponds, with the chosen convention, to composing the transformations they produce.

g * h
  |
  v
corresponding composite action

Representation theory grows from this idea. A group representation in vector spaces is a functor from the group-as-category into Vect. The group elements become invertible linear maps, and group multiplication becomes composition of linear maps.

group -> Vect

The same structural demand appears again: preserve identity and composition.

Functors can also compare a category with itself. Such a functor is called an endofunctor.

C --T--> C

Endofunctors appear when a construction stays within the same world. For sets, one can send a set to the set of lists of its elements. For vector spaces, the double-dual construction is a covariant endofunctor, while the ordinary dual reverses arrows. For topological spaces, one can send a space to a related construction built from paths or loops.

The important point is that a construction becomes categorical when it acts on both objects and morphisms in a way compatible with composition.

construction on objects
        +
construction on morphisms
        +
composition preserved
        =
functor

This resolves a common hidden gap. Mathematicians often define an operation on objects and then use it on maps as if that behavior were automatic. Category theory makes the requirement explicit. A construction that transforms objects but does not coherently transform arrows is not yet a functor.

The arrows matter because the arrows carry structure.

objects alone:
catalog

objects plus morphisms:
category

object construction plus morphism construction:
functor

Functors preserve isomorphisms. If f: A -> B is an isomorphism in C with inverse f^-1: B -> A, then F(f): F(A) -> F(B) is an isomorphism in D. The inverse of F(f) is F(f^-1), because the functor preserves the equations that define inverses.

f^-1 . f = id_A
f . f^-1 = id_B
        |
        | apply F
        v
F(f^-1) . F(f) = id_F(A)
F(f) . F(f^-1) = id_F(B)

This makes functors reliable translators of structural sameness. They may forget information, collapse distinctions, or add structure, depending on the functor. But they cannot break the formal logic of identity, composition, and isomorphism.

Some functors are faithful to distinctions between morphisms. Some are not. A forgetful functor may also send different structured objects to the same underlying object once the extra structure is ignored. A functor can preserve the categorical laws without preserving every detail of the source. Translation is not always equivalence.

preserve composition
does not imply
preserve all information

That distinction is useful. It lets category theory describe both lossless equivalences and lossy projections. A forgetful functor is valuable precisely because it records what remains after structure is discarded.

The objects are categories. The morphisms between them are functors. A functor sends objects to objects and morphisms to morphisms while preserving identities and composition. What composes are functors themselves: if F: C -> D and G: D -> E, then G . F: C -> E sends each object and morphism through both translations. The invariant is compositional structure. The defining relation is F(id_A) = id_F(A) and F(g . f) = F(g) . F(f). Equality of categories is less important than comparison by functors and, eventually, equivalence of categories. What remains outside the frame is comparison between functors that share the same source and target.

A functor is a translation between mathematical worlds that preserves identity and composition.

If categories have functors between them, then a new level appears. We can ask not only how categories relate, but how two functors from the same source to the same target relate. When should two translations themselves be connected by structure?

References

  1. Functor (opens in a new tab)
  2. Forgetful functor (opens in a new tab)
  3. Free functor (opens in a new tab)