Skip to main content
2 of 3
edited body

Here are the examples of comonads that I personally find most helpful. First from topology:

  • The universal covering is an idempotent comonad on (suitably nice) pointed topological spaces. The functor takes a pointed space $(X,x_0)$ and gives the space of homotopy classes of paths starting at $x_0$. The counit forgets the path and just keeps the endpoint, the comultiplication is an isomorphism. Co-Kleisli morphisms are continuous functions that "depend on the path", such as the complex logarithm. Coalgebras are simply connected spaces. (This comonad appeared in the comments to another answer.)
  • Similar to the example above, the rooted tree comonad on the category of pointed directed multigraphs can be seen as a "discrete universal covering". The functor takes a pointed graph $(X,x_0)$ and gives the graph whose vertices are paths on the graph starting at $x_0$, and which have a unique edge between them if and only if they differ by an edge in $X$. Again this comonad is idempotent, and its unit forgets the path and only keeps the endpoint. Co-Kleisli morphisms are path-dependent incidence-preserving maps. Coalgebras are rooted trees.

The following two are used in theoretical computer science.

  • The reader comonad on the category of sets. Fix a set $A$ of "extra data". The functor maps a set $X$ to the set $X\times A$, "adding the extra data". The comultiplication copies the extra data, and the counit forgets it. Co-Kleisli morphisms are functions that have access to these extra data. Coalgebras are sets equipped with a "default choice" of the data, a function $X\to A$.
  • The stream comonad on sets. Fix a monoid $N$, that we can think of "time". The functor maps a set $X$ to the set of maps $N\to X$, or "sequences" or "trajectories" or "histories". The counit forgets the history and just keeps the present state, the comultiplication looks at the history of the history (which is the history except the latest states...and so on). Co-Kleisli morphisms are maps that may depend on the history, and coalgebras are dynamical systems.

These four examples are taken from my notes (arXiv:1912.10642), sections 5.3 and 5.4 - see there for all the details. I don't claim that I have invented any one of these myself. (In the future I'd like to add these examples, and maybe some more, to the nLab. If anyone wants to help, I'd appreciate that.)