# The Unapologetic Mathematician

## Ends II

We continue our discussion of ends by noting that the process of taking an end (if it exists) is functorial in a sense.

More specifically, let’s say we have two functors $T$ and $T'$ from $\mathcal{C}^\mathrm{op}\otimes\mathcal{C}$ to $\mathcal{V}$, a $\mathcal{V}$-natural transformation $\alpha:T\rightarrow T'$, and that both of $T$ and $T'$ have ends. Then we can compose $\lambda_A:\int_CT(C,C)\rightarrow T(A,A)$ with the transformation $\alpha_{A,A}:T(A,A)\rightarrow T'(A,A)$ to get a $\mathcal{V}$-natural transformation from the end of $T$ to $T'$. By the universal property of $\int_CT'(C,C)$ there is then a unique arrow $\int_C\alpha_{C,C}:\int_CT(C,C)\rightarrow\int_CT'(C,C)$ so that $\lambda'_A\circ\int_C\alpha_{C,C}=\lambda_A\circ\alpha_{A,A}$.

Now let’s consider a functor $T:\mathcal{C}^\mathrm{op}\otimes\mathcal{C}\otimes\mathcal{A}\rightarrow\mathcal{V}$ so that the end $H(A)=\int_CT(C,C,A)$ exists for each object $A\in\mathcal{A}$. That is, we have arrows $\lambda_{C,A}:H(A)\rightarrow T(C,C,A)$ natural in $C$ for each $A$. There is now a unique way of making $H$ into a functor $H:\mathcal{A}\rightarrow\mathcal{V}$ so that $\lambda_{C,A}$ is also natural in $A$.

First, we note that $H(A')^{H(A)}$ is an end for $T(C,C,A')^{H(A)}$. Indeed, we have
$H(A')^{H(A)}=\left(\int_CT(C,C,A')\right)^{H(A)}=\int_C\left(T(C,C,A')^{H(A)}\right)$
On the other hand, we have
$T(C,C,\underline{\hphantom{X}}):\hom_\mathcal{B}(A,A')\rightarrow T(C,C,A')^{T(C,C,A)}$
and
${1_{T(C,C,A')}}^{\lambda_{C,A}}:T(C,C,A')^{T(C,C,A)}\rightarrow T(C,C,A')^{H(A)}$
By the universal property of the end $H(A')^{H(A)}=\hom_\mathcal{V}(H(A),H(A'))$, there is a unique arrow $H_{A,A'}:\hom_\mathcal{B}(A,A')\rightarrow\hom_\mathcal{V}(H(A),H(A'))$ so that ${\lambda_{C,A'}}^{1_{H(A)}}\circ H_{A,A'}={1_{T(C,C,A')}}^{\lambda_{C,A}}\circ T(C,C,\underline{\hphantom{X}})$. These $H_{A,A'}$ — along with the behavior of $H$ on objects — form a functor because they are $\mathcal{V}$-natural, and we can see this naturality from the litany of naturalities.

Now let’s consider a functor $T:(\mathcal{A}\otimes\mathcal{B})^\mathrm{op}\otimes(\mathcal{A}\otimes\mathcal{B})\cong\mathcal{A}^\mathrm{op}\otimes\mathcal{A}\otimes\mathcal{B}^\mathrm{op}\otimes\mathcal{B}\rightarrow\mathcal{V}$. If each end $\int_{A\in\mathcal{A}}T(A,B,A,B')$ exists, then it they are the values of a $\mathcal{V}$-functor $\mathcal{B}^\mathrm{op}\otimes\mathcal{B}\rightarrow\mathcal{V}$.

Further, every family $\alpha_{A,B}:X\rightarrow T(A,B,A,B)$ that is $\mathcal{V}$-natural in $A$ factorizes uniquely into the composite of $\beta_B:X\rightarrow\int_AT(A,B,A,B)$ and $\lambda_{A,B,B}:\int_AT(A,B,A,B)\rightarrow T(A,B,A,B)$. Again by our litany of naturalities, $\alpha_{A,B}$ is $\mathcal{V}$-natural in $B$ if and only if $\beta_B$ is. Then since $\alpha_{A,B}$ is natural in $A$ and $B$ separately if and only if it is natural in the pair $(A,B)\in\mathcal{A}\otimes\mathcal{B}$, we deduce the “Fubini Theorem”: if every $\int_AT(A,B,A,B')$ exists then
$\int_{(A,B)\in\mathcal{A}\otimes\mathcal{B}}T(A,B,A,B)\cong\int_{B\in\mathcal{B}}\int_{A\in\mathcal{A}}T(A,B,A,B)$
and either side exists if and only if the other side does.

Then, since $\mathcal{A}\otimes\mathcal{B}\cong\mathcal{B}\otimes\mathcal{A}$ we have the “interchange of ends” theorem: if every $\int_AT(A,B,A,B')$ and every $\int_BT(A,B,A',B)$ exists then
$\int_{A\in\mathcal{A}}\int_{B\in\mathcal{B}}T(A,B,A,B)\cong\int_{B\in\mathcal{B}}\int_{A\in\mathcal{A}}T(A,B,A,B)$
and either side exists if and only if the other side does.

It’s this formal, semantic similarity between the process of taking an end and the process of integration (which some of you may have heard of) that leads us to write an end as if it were an integral. We have bound variables ranging over categories, occurring covariantly and contravariantly, pairing off, and different variables do this essentially independently of each other.