I am reading "Basic category theory" of Tom Leinster, in page 42, it says:
(a) The naturality axiom might seem ad hoc, but we will see in Chapter 4 that it simply says that two particular functors are naturally isomorphic. In this section, we ignore the naturality axiom altogether, trusting that it embodies our usual intuitive idea of naturality: something defined without making any arbitrary choices.
The natuality which I learnt before is all about the commutative square. So could someone tell me what does the author want me to know here? What is the intuition behind the "commutative square" definition of natuality? To be more precise, what does it mean for "something defined without making any arbitrary choices"? Could someone please help me understanding this?
Thanks for any help.
Think about functors as data structures. Like in programming "collection" types are functors. The choice of the type of data the collection holds corresponds to the choice of the object in the categories of the functor. Thus collection can contain any type of data ["content"]. But the "structure" of it is fixed by the type of the collection, that is by the functor.
An example of collection type [functor] is homogeneous Pair [X * X]. Let us move to heterogeneous Pairs [X * Y]. This has 2 element-type parameters, so it can not be a functor. But if we fix one of them, then only one parameter is left and such Pair data construction is a functor. Thus X * C is a functor in X for all constant choice of C.
And obviously so is C * X. X * C and C * X are not the same functors. They feel like they are the same, but they are not. They are only isomorphic.
Can you think of an invertible function that witnesses this isomorphism? Of course, it is trivial. Here is the fun part : I know which one you think of : the one that reverses the component order in the pair structure. How do i know? It is a "natural" choice and in this particular example it is the only choice. You was constrained by not knowing what X and C are concretely. You only knew the structures of the collections, thus you could come up only with a solution that relates the structures, independently of what the contents are. This independence is the "naturality".
"independence" is not rigorous enough for a mathematical definition. A rephrase : 2 aspects are independent if both of them can freely vary without interfering with the other. "interfere" is still far from rigor, but from it i can develop a rigorous thing through a good concrete example : threads in computer programs. The scheduling of threading is non-deterministic, so from the programmer's point of view : 2 threads do not interfere with each other iff they produce correct results|effects for all possible scheduling. With more rigor : iff for any 2 instructions {i1, i2} [of different threads] : their relative execution order does not matter, that is iff i1;i2 has the same behavior as i2;i1. We can translate this picture to math by thinking about the instructions as endo-functions on the state-space of the program. Then the condition is : iff the [function-]composition of state-space-mutating-functions [of different threads] is commutative. And this is exactly what the the definition of natural isomorphism says with its commutative diagram : 2 changes of the 2 different aspects [(transition between objects inside category) and (transition between the functors], may happen in any order, the result must be the same. To further support the intuition : go back to the functor as data structure view. In it naturality says : it does not matter if (we change the content first and then the structure) or (we change the structure first and then the content). More concretely in my previous heterogeneous pair example : it does not matter if (we change the content of the "X" component of the pair first and then the order of the 2 components) or (we change the order of the 2 components first and then the content of the "X" component).
Naturality in "natural transformation" and "natural isomorphism" is the same property. The difference between the 2 notion is in the components of them : a transformation is any function, an isomorphism must be invertible.
Interesting facts about naturality :