Coinductive Definitions
Posted by Mike Shulman
I’ve come to believe, over the past couple of years, that anyone trying to study -categories (a.k.a. -categories) without knowing about coinductive definitions is going to be struggling against nature due to not having the proper tools. But although coinductive definitions are a basic notion in mathematics, for some reason they don’t seem to be taught, even to graduate students. Write something like
A 1-morphism in an -category is an equivalence if there exists a 1-morphism and equivalences and in the relevant hom--categories; and every 1-morphism in a 0-category is an equivalence
and any mathematician (who has some inkling of what -categories are) will be happy. If you ask why this definition isn’t circular, since it defines the notion of “equivalence” in terms of “equivalence”, the mathematician will say “it’s an inductive definition” and expect you to stop complaining. But if you write something like
A 1-morphism in an -category is an equivalence if there exists a 1-morphism and equivalences and in the relevant hom--categories
the same mathematician will object loudly, saying that this definition is circular. (In fact, not very long ago, that mathematician was me.) But actually, this latter is a perfectly valid coinductive definition.
One way of saying what an inductive definition means is that it defines the smallest class of things that is closed under some “constructor” operations. That is, the above definition of equivalences in -categories for finite says, when unraveled a bit, that the class of “equivalences in -categories” is the smallest class such that
- Every morphism in a 0-category is in , and
- If has the property that there exists , and also morphisms and that are in , then is in .
As usual, “smallest” means “minimum”, i.e. it is contained in every other such class . How do we know that there is a smallest such class? Because of the nature of the closure conditions (each of them takes some input consisting of things in and produces something else in ), the collection of classes satisfying them is closed under intersection; thus we can take the intersection of all such to obtain the smallest one.
Inductive definitions are best-adapted to proving stuff about things which satisfy the definition. Namely, if we want to prove that all equivalences in -categories have property , all we need to do is prove that morphisms in 0-categories have property , and (2) given and , and and with property , also has property . Then the class of things satisfying will be one of the classes , and hence contain the class of equivalences. This is called a proof by induction.
Dually, a coinductive definition defines the largest class of things that is closed under some “destructor” operations. Thus, the above definition of equivalences in -categories says that the class of “equivalences in -categories” is the largest class such that
- If is in , then there exists a , and also morphisms and that are in .
As usual, “largest” means “maximum”, i.e. containing every other such class . How do we know that there is a largest such class? Because of the nature of the closure conditions (each of them takes one input in and produces some number of other things in ), the collection of classes satisfying them is closed under unions; thus we can take the union of all such to obtain the largest one.
Coinductive definitions are best-adapted to proving that things do satisfy the definition. Namely, if we want to prove that some morphism in an -category is an equivalence, all we need to do is prove that belongs to some class of morphisms with the above property. Then will be contained in the class of equivalences, so that is an equivalence. This is called a proof by coinduction.
The theory of -categories is full of concepts that are naturally defined coinductively. For instance:
A functor between -categories is an equivalence if (1) for each , there exists an and an equivalence , and (2) for each , the functor is an equivalence between -categories.
The schematic definition of n-fibration makes perfect sense as a definition of -fibration, if interpreted coinductively.
In fact, -categories themselves are naturally defined coinductively!
- An -category is a category enriched over -categories.
This requires a more general kind of coinductive definition, though, since now we are defining a structure coinductively, rather than a property of elements of some existing structure.
Here’s a way of rephrasing the inductive definition of equivalences in an -category. Consider the poset of “classes of morphisms in -categories” for finite , and given such a class , let be the class of all morphisms which are either (1) morphisms in 0-categories, or (2) are morphisms such that there exists , and also morphisms and that are in . Then is an endofunctor of this poset, and the inductive definition says that the equivalences are the initial algebra for this endofunctor, i.e. the smallest such that .
Similarly, we can consider the poset of “classes of morphisms in -categories” and define to be the class of all morphisms such that there exists a , and also morphisms and that are in . Then the coinductive definition says that is the terminal coalgebra for the endofunctor , i.e. the largest such that .
The generalization to structure, rather than properties, is now immediate: in general, an inductively defined gadget is an initial algebra for some endofunctor, and a coinductively defined gadget is a terminal coalgebra for some endofunctor. Of course, we need some conditions on the endofunctor to ensure that initial or terminal coalgebras exist; usually one asks them to be polynomial.
For instance, the natural numbers are the initial algebra for the endofunctor of . This automatically gives us the principle of definition by iteration or recursion.
Similarly, we can exhibit -categories as the terminal coalgebra for an endofunctor of a suitable category. The above coinductive definition suggests that the endofunctor in question should take and output the collection of -enriched categories. Thus, must belong to a category of “things we can enrich over.” If we take our endofunctor to live on the category of cartesian monoidal categories (or, I think, even all symmetric monoidal categories), and use the usual notion of enrichment, then we obtain as terminal coalgebra the category of strict -categories. And Eugenia and Tom showed here that if we use Todd Trimble’s notion of operadic iterated enrichment, then we obtain a Trimblean model for weak -categories.
Re: Coinductive Definitions
Nice post! I occasionally run into computer sciencey types who fling around coinduction with gay abandon, and I admit that it makes me a bit nervous. It probably comes down to a lack of practice.