Functors and natural transformations
Preserve categorical structure and test compatibility across every arrow of a diagram.
On this page
The question for today
What you’ll understand
- Check preservation of identities and composition by a proposed functor.
- Write and solve a naturality square with all components correctly typed.
- Distinguish a componentwise family of maps from a natural transformation.
A functor translates a whole category, including its permitted transformations. A natural transformation compares two such translations in a way that respects every original arrow. The word natural therefore imposes an equation, rather than expressing aesthetic approval. Small diagram categories let us solve those equations explicitly. We will see both a family that fails the compatibility test and a familiar coordinate operation whose compatibility follows from one general calculation.
Functoriality includes arrows
A covariant functor chooses an object for every object and an arrow for every . It must preserve identity arrows and composites. Giving only an object assignment is insufficient: choosing dimensions of vector spaces, for example, does not by itself specify what should happen to all linear maps. A functor can identify different objects or different arrows, but any identifications must respect the composition laws.
The opposite category reverses arrows and reverses their composition order. A contravariant functor on is an ordinary covariant functor on . For instance, fixing an object makes covariant by postcomposition, whereas is contravariant by precomposition. Reading source and target types before writing a formula prevents these two Hom constructions from being interchanged.
Naturality is a simultaneous compatibility condition
For parallel functors , a natural transformation consists of components . For every arrow , following the component and then must agree with following and then the component at . Choosing components independently usually fails. Even when the component sets have the same cardinality, naturality can force particular values or prohibit a family altogether.
When the source is an arrow category with just two objects and one nonidentity arrow, a single square controls naturality. For a larger category, all arrows are required; it is enough to check generators only after their relations and the functor laws are established. Natural transformations compose componentwise. If every component is an isomorphism, their inverses are also natural, as follows by multiplying the naturality equation by inverses on the appropriate sides.
A construction can commute with every function
Consider the functor on Set that sends to and sends a function to its coordinatewise application. The swap maps form a natural transformation from to itself. Applying a function to both coordinates and swapping produces exactly the same pair as swapping first and applying the function afterward. This argument works for arbitrary sets and functions, including noninjective maps and empty sets.
Testing a few finite functions can reveal a mistake, but it cannot replace the general calculation establishing naturality on Set. By contrast, in a genuinely finite source category, enumerating every component and every arrow is a complete test. The distinction matters in applications: a coordinate-dependent recipe may accidentally commute with a restricted family of maps while failing for a larger family. The category of allowed transformations is part of the claim being made.
Work it through
Solve a finite naturality square
The source category has objects and one nonidentity arrow . Let , , and let be constant zero. Let , , and . Count natural transformations from to .
The component is forced because its target is a singleton: both and go to . Before imposing naturality, there are four functions available for .
Along the route using , either element of reaches . Along the other route, either element first reaches zero, then reaches . Hence naturality requires exactly .
The value at one is unrestricted, since one is outside the image of . Choosing it to be or gives two transformations. Neither is a natural isomorphism because the component from a two-element set to a singleton is not invertible.
Two of the four componentwise choices extend to natural transformations; neither is a natural isomorphism.
The living notebook
Explore the model
Interactive lab · modular
Check a commuting translation square
Pause and Reset, then set modulus to 5 and additive step to 2. After two Steps the residue is 4. Define a separate translation T(r)=r+1 modulo 5 on paper. Predict T(4+2) and T(4)+2; both reduce to 2. Verify the orbit additions in the instrument. This is a commuting square for translations in a cyclic action, not a display of all natural transformations. For a fresh run use Pause, Reset, then set both controls; editing one control keeps the old clock.
- Residue r0
- 0
- Orbit period · m/gcd(m,a)
- 12
- Distinct residues visited
- 1 of 12
Addition modulo m starts at zero: rₙ = na mod m. Playback advances two additions per second. The orbit has period m/gcd(m,a), including period one for a = 0. This is not a cryptographic security test or a primality algorithm. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forCompatibility with an operation becomes an equality between two routes around a square.
Pause & reason
Check your understanding
Your turn
Try it yourself
Let send zero to a and both one and two to b. Check the swap naturality equation on the pair , then explain why the same equality holds for every pair and every function.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Write the ordered pair after each individual operation. A symbolic pair proves more than the numerical example.
Compare with the solution
Swapping first gives and then applying coordinatewise gives . Applying first gives and then swapping again gives . For any pair , both routes give . This formula proves naturality without assuming that is injective or surjective.
Keep the idea
Take it with you
- A functor specifies images of both objects and arrows.
- Naturality compares two correctly typed composites for every source arrow.
- Componentwise invertibility makes a natural transformation a natural isomorphism.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.