Recall (eg. from here) that every right adjoint functor induces a monad on whose underlying endofunctor is .
The notion of the codensity monad is a generalization of this construction to functors that need not be right adjoints but do at least admit a right Kan extension along themselves, such that both constructions agree when is in fact a right adjoint.
The name ‘codensity monad’ stems from the fact that reduces to the identity monad iff is a codense functor. Thus, in general, the codensity monad “measures the failure of to be codense”.
The same idea applies to 2-categories or bicategories more general than Cat: codensity monads can be defined whenever suitable right Kan extensions exist.
(codensity monad)
Let be a functor whose pointwise right Kan extension along itself exists, with denoting the corresponding universal 2-morphism on the underlying functor .
The codensity monad of is the monad
where
the carrier functor is given by the end
where is power, i.e. repeated product.
the monad unit is the natural transformation given by the universal property of with respect to the pair ,
the monad multiplication results from the universal property of with respect to the pair .
Concerning existence, exists for , e.g. when is small and is complete.
In this circumstance, when is small and is complete, then the codensity monad is equivalently the one that arises from the adjunction
where
the left adjoint takes any object to the hom-functor ,
the right adjoint is the unique limit-preserving functor from the free completion of to which agrees on with .
(See also nerve and realization; the description of the adjunction above is a formal dual of a nerve-realization adjunction, and gives the right Kan extension as a pointwise Kan extension. In the pointwise setting, is codense if and only if the left adjoint is full and faithful.)
Even if (assuming it exists) is not a pointwise Kan extension, Def. indeed defines a monad. The proof may be given generally for any 2-category in which the right Kan extension exists for a 1-cell .
, with the unit and multiplication , is a monad.
The universal property of the Kan extension states that for any , there is a natural bijection
let be the 2-cell corresponding to . Note that the bijection takes a 2-cell to the composite
The 2-cell is defined so that , and the 2-cell is defined so that .
To check the monad unit law that says the triangle
commutes, it suffices by universality to check that applying on the right, followed by , results in a commutative diagram. This follows from commutativity of the diagram
(where the square commutes by 2-categorical interchange), together with commutativity of
To check the other monad unit law is even simpler, because it follows directly from the commutativity of
where commutativity of the triangle comes from how we introduced in this proof.
Monad associativity follows by showing that the maximal paths in
evaluate to the same 2-cell. By 2-categorical interchange, we may replace the composite “down, then right” to obtain the diagram
and then use how we introduced in this proof to further replace “right, then down” by
and finally finish the proof by observing that coequalizes , .
Every monad that is induced by an adjunction is the codensity monad of . In particular, every enriched monad is a codensity monad (via its Kleisli category).
Let be an object in a closed category . Then the -enriched codensity monad of the constant functor is the double dualization monad associated to , given by .
More conceptually, the codensity monad construction may be seen as a generalisation of the double dualisation construction analogous to the generalisation from algebras for a monad to modules over a monad (the latter is the perspective that is most natural 2-categorically).
The Giry monad (as well as a finitely additive version) arise as codensity monads of forgetful functors from subcategories of the category of convex sets to the category of measurable spaces (Avery 14).
The codensity monad of the inclusion FinSet Set is the ultrafilter monad. Its algebras are compact Hausdorff spaces.
The codensity monad of the inclusion Grp, is the profinite completion monad, whose algebras may be identified with profinite groups – that is, topological groups whose underlying topological space is profinite (Avery 17, Proposition 2.7.10).
The codensity monad of the inclusion computes the Stone spectrum of the Boolean algebra of clopen subsets of a topological space. Its algebras are precisely the Stone spaces. (Sipoș, Theorem 2).
The codensity monad of the inclusion , where denotes the full subcategory of Top consisting of arbitrary small products of the Sierpiński space, is the localic spectrum? of the frame of opens of a topological space. Its algebras are precisely the sober spaces. (Sipoș, Theorem 6)
The codensity monad of the inclusion of countable sets in all sets, , assigns to each set the set of ultrafilters on closed under countable intersections. This still holds for the inclusion of the full subcategory of on the single set .
More generally, the codensity monad of the inclusion of sets of cardinality less than that of fixed , , assigns to each set the set of -complete ultrafilters on .
For the codensity monad induced by the inclusion of homotopy types with finite homotopy groups into all homotopy types see there.
The codensity monad induced by the Yoneda embedding is isomorphic to the monad induced by the Isbell adjunction.
In the bicategory Rel, the right Kan extension of a relation along a relation is the relation such that iff . In particular, reduces to the identity relation iff whenever is such that then , in other words, iff implies . The codensity monad , being a monad in , is a preorder. This construction frequently recurs; see for instance specialization order for a topology.
Let be a functor admitting a codensity monad on . The Kleisli category for has homs .
See Bourn and Cordier 1980, for instance.
One of the first references is
For the special case of double dualisation, see:
Overview:
Fred Linton, Codensity triples, Section 8 in: An outline of functorial semantics, in Seminar on Triples and Categorical Homology Theory, Lecture Notes in Mathematics 80, Springer (1969) 7-52 [doi:10.1007/BFb0083080]
Tom Leinster, Codensity and the Ultrafilter Monad , TAC 12 no.13 (2013) pp.332-370. [tac:28-13]
See also:
nCafé blog 2012: Where do Monads come from?
MO-discussion Tim Campion: What is the point of pointwise Kan extensions?
Codensity monads arising from subcategory inclusions are studied in
The role in shape theory is discussed in
Armin Frei, On categorical shape theory , Cah. Top. Géom. Diff. XVII no.3 (1976) pp.261-294. (numdam)
D. Bourn, J.-M. Cordier, Distributeurs et théorie de la forme, Cah. Top. Géom. Diff. Cat. 21 no.2 (1980) pp.161-189. (pdf)
J.-M. Cordier, T. Porter, Shape Theory: Categorical Methods of Approximation , (1989), Mathematics and its Applications, Ellis Horwood. Reprinted Dover (2008).
The dual concept of a “model-induced cotriple”:
On possible uses in functional programming:
For a description of the Giry monad and other probability monads as codensity monads, see
Tom Avery, Codensity and the Giry monad, Journal of Pure and Applied Algebra 220 3 (2016) 1229-1251 [arXiv:1410.4432, doi:10.1016/j.jpaa.2015.08.017]
Ruben Van Belle, Probability monads as codensity monads. Theory and Applications of Categories 38 (2022), 811–842, (tac)
Other references include
Dominique Bourn and Jean-Marc Cordier, Distributeurs et théorie de la forme, Cahiers de topologie et géométrie différentielle 21.2 (1980): 161-189.
Tom Avery, Structure and Semantics, (arXiv:1708.01050)
C. Casacuberta, A. Frei, Localizations as idempotent approximations to completions , JPAA 142 (1999) no. 1 pp.25–33. (draft)
Yves Diers, Complétion monadique , Cah. Top. Géom. Diff. Cat. XVII no.4 (1976) pp.362-379. (numdam)
S. Katsumata, T. Sato, T. Uustalu, Codensity lifting of monads and its dual , arXiv:1810.07972 (2012). (abstract)
J. Lambek, B. A. Rattray, Localization and Codensity Triples , Comm. Algebra 1 (1974) pp.145-164.
Jiří Adámek, Lurdes Sousa?, D-Ultrafilters and their Monads, (arXiv:1909.04950)
Andrei Sipoş?, Codensity and Stone spaces, Mathematica Slovaca, 68 no. 1, p. 57–70, (2018). doi:10.1515/ms-2017-0080, (arXiv:1409.1370)
Last revised on December 18, 2024 at 12:57:11. See the history of this page for a list of all contributions to it.