Codensity Monads via Density and Duality
arXiv:2509.26197
Abstract
Codensity monads provide a universal method to generate complex monads from simple functors. Recently, a wide range of important monads in logic, denotational semantics, and probabilistic computation, such as several incarnations of the ultrafilter monad and the Giry monad, have been presented as codensity monads, using complex arguments. We propose a unifying categorical approach to codensity presentations of monads, based on the idea of relating the presenting functor to a dense functor via a suitable duality between categories. We prove a general presentation result applying to every such situation and demonstrate that most codensity presentations known in the literature emerge from this strikingly simple duality-based setup, drastically alleviating~the complexity of their proofs and in many cases completely reducing them to standard duality results. Additionally, we derive a number of new codensity presentations using our framework, including the filter, lower Vietoris and Stone-Cech compactification monads on topological spaces, and the canonical extension and expectation monads on sets.