Contents

category theory

# Contents

## Idea

A cofunctor is a kind of morphism between categories (not to be confused with a contravariant functor). In contrast to a functor, the assignment on objects of a cofunctor goes in the opposite direction to the assignment on morphisms.

Cofunctors generalise both bijective-on-objects functors and discrete opfibrations.

Cofunctors arise naturally in the study non-cartesian internal categories.

## Definition

A cofunctor $\varphi : A \nrightarrow B$ from a category $A$ to a category $B$ consists of a map sending each object $a \in A$ to an object $\varphi_{0}a \in B$ and a map sending each pair $(a \in A, u : \varphi_{0}a \to b \in B)$ to a morphism $\varphi_{1}(a, u) : a \to a'$ in $A$, where $a' = cod(\varphi_{1}(a, u))$, such that

• $\varphi_{1}$ respects codomains: $\varphi_{0}a' = cod(u)$ where $a' = cod(\varphi_{1}(a, u))$,

• $\varphi_{1}$ preserves identity morphisms: $\varphi_{1}(a, 1_{\varphi_{0}a}) = 1_{a}$,

• $\varphi_{1}$ preserves composition: $\varphi_{1}(a, v \circ u) = \varphi_{1}(a', v) \circ \varphi_{1}(a, u)$ where $a' = cod(\varphi_{1}(a, u))$.

Given a pair of cofunctors $\varphi : A \nrightarrow B$ and $\gamma : B \nrightarrow C$, their composite cofunctor $\gamma \circ \varphi \colon A \nrightarrow C$ sends each object $a \in A$ to an object $\gamma_{0}\varphi_{0}a \in C$ and each pair $(a \in A, u : \gamma_{0}\varphi_{0}a \to c \in C)$ to a morphism $\varphi_{1}(a, \gamma_{1}(\varphi_{0}a, u))$ in $A$. This defines a category $\mathbf{Cof}$ whose objects are small categories, and whose morphisms are cofunctors.

## Properties

###### Proposition

The category $\mathbf{Cof}$ of small categories and cofunctors has an orthogonal factorization system $(Bij^{op}, DOpf)$ which factors each cofunctor $\varphi : A \nrightarrow B$ into a bijective on objects functor $A \leftarrow I$ followed by a discrete opfibration $I \to B$.

###### Proposition

Let $\mathbf{Poly}(1, 1)$ be the monoidal category arising from the bicategory of polynomials on the singleton set. Then $\mathbf{Cof}$ is isomorphic to the category of comonoids in $\mathbf{Poly}(1, 1)$.

###### Proof

Originally proven in (Ahman-Uustalu 2016). See (Spivak-Niu 2021, Theorem 6.26) for details.

## Examples

• Every function $A \to B$ yields a cofunctor $disc(A) \nrightarrow disc(B)$ between discrete categories. This defines a fully faithful functor $\mathbf{Set} \to \mathbf{Cof}$.

• Every monoid homomorphism $A \to B$ yields a cofunctor $B \nrightarrow A$. This defines a fully faithful functor $\mathbf{Mon} \to \mathbf{Cof}^{op}$.

• Every bijective on objects functor $A \to B$ yields a cofunctor $B \nrightarrow A$.

• Every discrete opfibration $A \to B$ yields a cofunctor $A \nrightarrow B$.

• Every split Grothendieck opfibration has an underlying cofunctor given by the splitting.

• More generally, every delta lens has an underlying cofunctor.

• Let $\mathbb{N}$ denote the monoid of natural numbers under addition. A cofunctor $\tau : A \to \mathbb{N}$ is the same as a choice of morphism $\tau(a, 1)$ out of every object in $a \in A$.

• A comorphism of Lie groupoids is an internal cofunctor in the category Diff of smooth manifolds; see (Higgins-Mackenzie 1993, definition 5.12).

The notion of cofunctor first appeared under the name comorphism in the paper:

The definition of internal cofunctor between non-cartesian internal categories was introduced in Section 4.4 of the thesis:

• Marcelo Aguiar, Internal categories and quantum groups, PhD thesis, Cornell University, 1997 (pdf)

The characterization of cofunctors as morphisms between directed containers is developed in the papers:

The link between cofunctors, delta lenses, and split Grothendieck opfibrations is developed in the papers:

• Bryce Clarke, Internal lenses as functors and cofunctors, EPTCS, 323, 2020 (doi:10.4204/EPTCS.323.13)

• Bryce Clarke, Internal split opfibrations and cofunctors, Theory and Applications of Categories, 35, 2020 (link)

Cofunctors between groupoids and the link with inner automorphisms of groupoids is explored in the paper:

The notion of cofunctor between partite internal categories is introduced in Definition 5.5 of the paper:

A detailed account of the relationship between cofunctors and polynomials appears in Chapter 6 of the draft textbook:

• David Spivak, Nelson Niu, Polynomial Functors: A General Theory of Interaction, 2021 (pdf)