nLab dinatural transformation




Dinatural transformations are a generalization of ordinary natural transformations and also of extranatural transformations. The differences can be summarized thus:

  • In an ordinary natural transformation FGF\to G, both FF and GG involved depend on some variable xx with the same variance (covariant or contravariant).
  • In an extranatural transformation FGF\to G, either FF depends on xx both covariantly and contravariantly and GG does not depend on xx at all, or vice versa.
  • In a dinatural transformation FGF\to G, both FF and GG can depend on xx both covariantly and contravariantly.

If the dependence of FF or GG on xx in a dinatural transformation is trivial, it reduces to an extranatural one. Similarly, if the contravariant (or, dually, the covariant) dependence of FF and GG on xx are trivial, it reduces to an ordinary natural one.

Arguably, most dinatural transformations which arise in practice are ordinary natural, extranatural, or paranatural.


Let F,G:C op×CDF, G: C^{op} \times C \to D be functors. A dinatural transformation from FF to GG, sometimes written

α:FG,\alpha: F \stackrel{\bullet}{\to} G,

consists of a collection of morphisms

α c:F(c,c)G(c,c)\alpha_{c}: F(c, c) \to G(c, c)

such that for every morphism f:ccf: c \to c' in CC,

(1)G(c,f)α cF(f,c)=G(f,c)α cF(c,f):F(c,c)G(c,c) G(c, f)\alpha_c F(f, c) = G(f, c')\alpha_{c'}F(c', f): F(c', c) \to G(c, c')

If drawn out as a commutative diagram, this becomes a “hexagon identity”:

F(c,c) α c G(c,c) F(f,c) G(c,f) F(c,c) G(c,c) F(c,f) G(f,c) F(c,c) α c G(c,c). \begin{array}{ccccccc} & & F(c,c) & \overset{\alpha_{c}}{\to} & G(c,c)\\ & \overset{\mathclap{F(f,c)}}{\nearrow} & & & & \overset{\mathclap{G(c,f)}}{\searrow}\\ F(c',c) & & & & & & G(c,c')\\ & \underset{\mathclap{F(c',f)}}{\searrow} & & & & \underset{\mathclap{G(f,c')}}{\nearrow}\\ & & F(c',c') & \underset{\alpha_{c'}}{\to} & G(c',c') \end{array}\,.

Special cases

If FF and GG both factor through the projection C op×CCC^{op}\times C \to C, then the notion reduces to an ordinary natural transformation, and similarly if they both factor through C opC^{op}.

If FF factors through CC while GG factors through C opC^{op}, then we obtain a notion of natural transformation from a covariant functor to a contravariant one, and dually.

If GG is constant, the hexagon identity reduces to the “domain” version of extranaturality, involving a commutative square of the form

(2)α cF(f,c)=α cF(c,f):F(c,c)G \alpha_c F(f, c) = \alpha_{c'} F(c', f): F(c', c) \to G

where GG is constant with respect to the argument cc. Similarly, if FF is constant, it yields the “codomain” version with a commutative square of the form

(3)G(c,f)α c=G(f,c)α c:FG(c,c) G(c, f) \alpha_c = G(f, c')\alpha_{c'}: F \to G(c, c')

when FF is constant with respect to the argument cc.


Of course, all ordinary natural transformations, and also all extranatural transformations, are also dinatural ones. Here we will confine ourselves to examples that do not reduce to either of these.

  • Perhaps the most well known example is the Church numerals: for any category CC, we have a class of dinatural transformations from the hom-functor hom:C op×CSethom: C^{op}\times C\to Set

    hom(x,x)α nhom(x,x)\hom(x, x) \stackrel{\alpha_n}{\to} \hom(x, x)

    defined by the rule α n(f)=f (n)\alpha_n(f) = f^{(n)}.

  • Not every endo-dinatural-transformation of a hom-functor is of this form; several other examples are given in Pare-Roman. For instance, if C=FinSetC=FinSet then the operation sending each endomorphism to its eventual image is dinatural.

  • The following example of a dinatural transformation from a covariant functor to a contravariant one is found in Dubuc-Street and attributed to Mac Lane. Let CC be the category of inner product spaces and isometries, and DD the category of vector spaces and linear transformations (all over a fixed field). Let F:CDF:C\to D be the forgetful functor and let G:C opDG:C^{op}\to D be the functor sending each inner product space to its dual. Define α V:F(V)G(V)\alpha_V : F(V) \to G(V) to send vVv\in V to the operation v,\langle v,-\rangle; then α\alpha is dinatural.

By a yoneda-like argument, dinatural transformations α:FG\alpha : F \xrightarrow{\bullet} G are in bijection with natural transformations η x,y:hom(x,y)hom(F(y,x),G(x,y))\eta_{x,y} : \hom(x, y) \to \hom(F(y,x), G(x,y)). The corresponding transformations are related by

  • η x,y(f)=G(x,f)α xF(f,x)=G(f,y)α yF(x,f)\eta_{x,y}(f) = G(x, f) \alpha_x F(f, x) = G(f, y) \alpha_y F(x, f)

  • α x=η x,x(id)\alpha_x = \eta_{x,x}(id)

Dinaturality versus extranaturality

Many people who encounter the notion of dinaturality through the general definition (as in equation (1)) have subsequent difficulty grokking it. It is the opinion of at least one author of this article (Todd Trimble), and it was certainly the opinion of Max Kelly, that this “efficient” definition is not the most useful or intuitive one. Rather, one may be better off grokking the separate squares (2) and (3) – that is, the notion of extranaturality – and how they arise in practice.

One could try to argue against that by pointing to dinatural transformations which do not reduce to extranatural ones.

A counterargument, however, is that any dinatural transformation between functors F,G:C op×CDF,G:C^{op}\times C\to D can be “bent” into domain extranaturality by defining

C op×C[F,G]Set:(x,y)D(F(y,x),G(x,y)).C^{op} \times C \stackrel{[F,G]}{\to} Set: (x, y) \mapsto D(F(y, x), G(x, y)).

Then a dinatural transformation FGF\to G can be identified with an extranatural transformation from the constant 11 (the terminal set) to [F,G][F,G]. Such tricks support the counterargument that the extra generality of the traditional definition is largely spurious, and not particularly helpful in terms of comprehension.

A further argument for the relative importance of extranatural transformations over dinatural ones is that extranatural transformations can be defined for any sort of enriched categories, whereas dinatural ones (including the other special case of natural transformations from covariant functors to contravariant ones) only make sense when the enriching category is cartesian.


Dinatural transformations cannot, in general, be composed with each other, although there are certain circumstances when they can be.

  • One such case is when certain squares are pushouts or pullbacks.

  • Of course, ordinary natural transformations can be composed.

  • In fact, there is a category whose objects consist of both covariant functors CDC\to D and contravariant ones C opDC^{op}\to D, and whose morphisms are dinatural transformations.

In general, what we can say is that for two fixed categories CC and DD, the functors C op×CDC^{op}\times C \to D and the dinatural transformations between them form a paracategory.


  • Guy McCusker, Alessio Santamaria, A Calculus of Substitution for Dinatural Transformations, I, (arXiv:2007.07576)

Here is a blog post inspired by the above discussion that discusses these concepts in the context of the programming language Haskell:

Last revised on July 20, 2023 at 18:12:21. See the history of this page for a list of all contributions to it.