Forbidden (co)end calculus tricks: why are they so effective?

152 Views Asked by At

I've been toying around with (co)ends a lot lately. I tried a lot of things, and many seem to work pretty well. As an example, I computed the end $\int_{X:\mathtt{Set}}X$ using the following chain of nonsensical isomorphisms for every set $Y$ : $$\begin{aligned}\mathtt{Set}\left(Y, \int_{X:\mathtt{Set}}X\right)& \simeq \int_{X:\mathtt{Set}}\mathtt{Set}(Y,X) \\ & \simeq \int_{X:\mathtt{Set}}\mathtt{Set}\left(\{\star\}, \mathtt{Set}(Y,X)\right) \\ & \simeq \int_{X:\mathtt{Set}}\mathtt{Set}\left(\mathtt{Set}(\emptyset, X), \mathtt{Set}(Y, X)\right) \\ &\simeq \mathtt{Set}^{\mathtt{Set}}\left(\mathtt{Set}(\emptyset, \cdot), \mathtt{Set}(Y, \cdot)\right) \\ \mathtt{Set}\left(Y, \int_{X:\mathtt{Set}}X\right)& \simeq \mathtt{Set}(Y, \emptyset)\end{aligned}$$ which by Yoneda wields $\int_{X:\mathtt{Set}}X\simeq \emptyset$. This is no surprise, as the end has an arrow to every set, including the empty set. Similarly, we can compute the coend $\int^{X:\mathtt{Set}}X$ : $$\begin{aligned} \mathtt{Set}\left(\int^{X:\mathtt{Set}}X, Y\right) & \simeq \int_{X:\mathtt{Set}}\mathtt{Set}(X,Y) \\ & \simeq \int_{X:\mathtt{Set}}\mathtt{Set}\left(\mathtt{Set}(\{\star\}, X), Y\right) \\ & \simeq \mathtt{Set}^\mathtt{Set}\left(\mathtt{Set}(\{\star\}, \cdot), Y\right) \\ & \simeq Y \\ \mathtt{Set}\left(\int^{X:\mathtt{Set}}X, Y\right) & \simeq \mathtt{Set}(\{\star\}, Y) \end{aligned}$$ which by Yoneda yields $\int^{X:\mathtt{Set}}X\simeq \{\star\}$.

I know I'm either lucky or wrong (and I'm at least as wrong as there are size issues), but why does it seem to work so well? Are there some other cool computations or tricks one can use?