# Weighted Co/ends?

## Recall: Limits

Recall that the limit of a functor $$D\colon\mathcal{I}\to\mathcal{C}$$ is, if it exists, the pair $$(\mathrm{lim}(D),\pi)$$ with

• $$\lim(D)$$ an object of $$\mathcal{C}$$, and
• $$\pi\colon\Delta_{\lim(D)}\Rightarrow D$$ a cone of $$\lim(D)$$ over $$D$$

such that the natural transformation $$\pi_*\colon h_{\lim(D)}\Rightarrow\mathrm{Cones}_{(-)}(D),$$ is a natural isomorphism, where

• $$\mathrm{Cones}_{(-)}(D)\overset{\mathrm{def}}{=}\mathrm{Nat}(\Delta_{(-)},D)$$, and
• The component at $$X\in\mathrm{Obj}(\mathcal{C})$$ of $$\pi_*$$ is the map $$(\pi_*)_X \colon \mathrm{Hom}_\mathcal{C}(X,\lim(D))\to \mathrm{Cones}_X(D)$$ sending a morphism $$f\colon X\to\lim(D)$$ to the cone $$\Delta_X\xrightarrow{\Delta_f}\Delta_{\lim(D)}\to D$$ of $$X$$ over $$D$$.

## Recall: Ends

Now, the end of a functor $$D\colon\mathcal{I}^\mathsf{op}\times\mathcal{I}\to\mathcal{C}$$ is the representing object of the functor $$\mathrm{Wedges}_{(-)}(D)\colon\mathcal{C}^\mathsf{op}\to\mathsf{Sets}$$ with $$\mathrm{Wedges}_{(-)}(D)\overset{\mathrm{def}}{=}\mathrm{ExtNat}(\overline{\Delta_{(-)}},\overline{D}),$$ where

• $$\overline{D}\colon\mathsf{pt}\times\mathcal{I}^\mathsf{op}\times\mathcal{I}$$ is the unique functor restricting to $$D$$ under the isomorphism $$\mathsf{pt}\times\mathcal{I}^\mathsf{op}\times\mathcal{I}\cong\mathcal{I}^\mathsf{op}\times\mathcal{I}$$ and similarly for $$\overline{\Delta_{(-)}}$$, and where
• We are now working with extranatural transformations.

That is, the object $$\int_{A\in\mathcal{C}}D^A_A$$ of $$\mathcal{C}$$ such that $$h_{\int_{A\in\mathcal{C}}D^A_A}\cong\mathrm{Wedges}_{(-)}(D).$$

## Recall: Weighted Limits

We can generalise limits by replacing $$\Delta_{(-)}$$ with an arbitrary functor $$W\colon\mathcal{C}\to\mathsf{Sets}$$. This leads to the notion of the weighted limit of $$D\colon\mathcal{I}\to\mathcal{C}$$ with respect to the weight $$W$$. This is the object $$\lim_W(D)$$ of $$\mathcal{C}$$ for which we have a natural isomorphism $$h_{\lim_W(D)}(-)\cong\mathrm{Nat}(W,\mathrm{Hom}_\mathcal{C}(-,D)).$$

## Question: Weighted Ends

Just as with weighted limits, we may define the weighted end of a functor $$D\colon\mathcal{I}^\mathsf{op}\times\mathcal{I}\to\mathcal{C}$$ with respect to a weight $$W\colon\mathcal{I}^\mathsf{op}\times\mathcal{I}\to\mathsf{Sets}$$ as the object $$\int_{A\in\mathcal{C}}^W D^A_A$$ of $$\mathcal{C}$$ (if it exists) such that we have a natural isomorphism $$h_{\int_{A\in\mathcal{C}}^W(D)}(-)\cong\mathrm{ExtNat}(\overline{W},\overline{\mathrm{Hom}_\mathcal{C}(-,D)}).$$ (Or rather that a certain natural transformation $$W_*$$ induced by $$W$$ is a natural isomorphism. Note that precomposing extranatural transformations with natural transformations gives back an extranatural transformation, so $$\mathrm{ExtNat}(\cdots)$$ is indeed a functor.)

Now (finally!) for the actual questions:

1. This notion seems to be very natural. Has it been considered somewhere in the literature?
2. Provided that $$\mathcal{C}$$ has cotensors, we may write any weighted limit on $$\mathcal{C}$$ as an end. Can we similarly express weighted ends in terms of ends or limits (possibly weighted)?
3. Are there any natural occuring examples of this notion?
4. Everything above can be categorified to the setting of bicategories (with pain). Is there anything remarkable about the resulting notion of a "weighted pseudo biend"?
• Ends are themselves examples of (weighted) limits: the end of a functor F : I^op x I -> C can be defined as the limit of F weighted by Hom_I, or as the limit of F composed with Tw(I) -> I^op x I where Tw(I) is the twisted arrow category of I. So "weighted ends" can probably also be expressed as weighted limits... – Rune Haugseng Jul 8 '20 at 12:59

This is a back-of-the-envelope conjecture, but it seems plausible to me that the "weighted coend" of $$T : {\cal I}^\text{op}\times {\cal I}\to {\cal V}$$ by $$W : {\cal I}^\text{op}\times {\cal I}\to {\cal V}$$ is no more than the usual coend of the composition $$W\diamond T$$, regarding both $$W,T$$ as endo-profunctors of $$\cal I$$.
Of course, this only works for coends, and $$T$$ must be valued on the base of enrichment. But hey, that's a start :-)
In this very special case it's very easy to see that the coend of $$T$$ weighted by $$W$$ is the same as the coend of $$W$$ weighted by $$T$$; thus this seems to behave like a tensor product of functors.