In these notes, I would like to write down some details on a body of related results pertaining to corecursion and recursion theory. They include (but are not limited to) the following.
The category of trees is the terminal coalgebra for the small coproduct completion (as an endofunctor on locally small categories).
The category of well-founded trees is the initial algebra for the small coproduct completion endofunctor on locally small categories.
The category of bisimulation classes of well-founded trees is the initial algebra for the small sup-cocompletion endofunctor on “locally small” (i.e., possibly large) posets.
The point of this exercise is not so much for these results (important though they are) as it is to develop techniques for proving these and related results. These are supposed to be test cases for a general sort of problem which for now I’ll state only very imprecisely: how to construct initial algebras of inaccessible endofunctors on accessible categories. My hunch is that in many such situations, it is technically easier to attack the problem starting from the coalgebraic end, or at least this can free us from having to consider potentially tricky set-theoretic issues involving transfinite constructions over all ordinal ranks, and work rather more cleanly and conceptually.
Most of this is inspired by Paul Taylor’s idea of understanding recursion in terms of well-founded coalgebras. These notes can be seen as a detailed application of his ideas, or rather a categorified version of his ideas, in some special cases.
Another motivation for these notes is to rewrite certain aspects of Algebraic Set Theory (about which I am hardly expert) in terms I can more readily follow. In particular, I had been reading the book by Joyal and Moerdijk, where everything seems to come together in the final chapter on construction of models; here one really sees how the smallness axioms and representability results conspire in the construction of initial ZF-algebras. In my reading, many of the core concepts in this development (open maps of forests, simulations, well-foundedness, extensionality, etc.) can be expressed directly in the coalgebraic language, and in this way are conceptually unified.
By forest, we mean simply a presheaf on the first infinite ordinal . A tree can be understood in one of two ways:
A tree is a connected forest (meaning preserves arbitrary coproducts).
A tree is a forest such that is terminal.
It is clear that a forest admits an essentially unique decomposition as a coproduct of trees, namely its connected components.
Let be the pulling back (precomposing) with the successor operation :
Concretely, gives the shift functor . This clearly has a right adjoint , defined by the formula
Thus is a tree for any forest . The following result is almost a tautology.
The adjunction is an adjoint equivalence.
The category of forests is in fact the free small-coproduct completion of the category of trees, so this proposition means that (or ) is a fixpoint of the free small-coproduct cocompletion. In fact, we have the stronger result:
(or ) is the terminal coalgebra (in a 2-dimensional sense) for the free small-coproduct cocompletion endofunctor on the 2-category of locally small categories.
This follows from Adámek’s theorem. For a finite number , let be the ordinal with elements, and let be the category of forests of height . There is an explicit equivalence
which results from the following comma category description of : the objects of are pairs where is a set and is the discrete category on , and morphisms are pairs where is a function and is a natural transformation . Letting be a (Grothendieck) topos, we may identify the category of functors with the slice , where is the unique left exact left adjoint. In this way becomes an Artin gluing construction . In the particular case where is a presheaf topos, this gluing construction is equivalent to where is obtained by freely adjoining a (new) initial element to . This gives the equivalence (1).
Hence . The sequence
is identified with the sequence
where each is the inclusion of an initial segment. The 2-limit of this sequence is equivalent to , and it is not hard to see that the canonical functor which obtains from the 2-limit property is identified with the obvious equivalence , induced by the inclusion as initial segment. Thus, by Adámek’s theorem, is the terminal coalgebra.
The idea in this section will be to exploit a relationship between “macrocosms” of well-founded (extensional) -subcoalgebras of the category of forests, and “microcosms” which consist of individual well-founded forests.
In ordinary 1-category theory, Paul Taylor introduces the concept of well-founded coalgebra as follows.
Let be a finitely complete category, and let be an endofunctor on . We will suppose that preserves pullbacks of monomorphisms (that is, it preserves limits of cospans in which one of the cospan arrows is monic). In particular, this implies that preserves monos. An example is the covariant power-set functor .
Let be a -coalgebra structure on . A subobject in is -inductive if in the pullback
the map factors through (note that is monic since preserves monos).
Alternatively, that for every commutative square as above (not necessarily a pullback square), factors through . A coalgebra is well-founded if the only inductive subobject of is itself.
If is a well-founded -coalgebra and is an isomorphism, then is an initial algebra.
The proof may be found in section 6.3 of Taylor’s book Practical Foundations of Mathematics.
Now we categorify the results of the preceding subsection so as to apply to the context of 2-categories, at least in the special case (locally small, but not necessarily small, categories). The role of “mono” will be played by fully faithful functors (so in effect, we are considering a factorization system on given by essentially surjective functors followed by fully faithful functors). 1-pullbacks are categorified to weak pullbacks. Observe that the weak pullback of a fully faithful functor along any functor is again fully faithful.
The small-coproduct completion functor preserves weak pullbacks of fully faithful functors. In particular, preserves full-faithfulness.
Let be a 2-endofunctor on that preserves weak pullbacks of fully faithful functors, and let be a -coalgebra. A full subcategory is 2-inductive if in the pullback
the functor factors through up to isomorphism (note that is fully faithful since preserves full faithfulness).
Alternatively, that for every weakly commutative square as above (not necessarily a weak pullback), factors through . A (2-)coalgebra is well-founded if every inductive subobject of is equivalent to itself.
If is a -coalgebra and is an equivalence, then together with an inverse equivalence is an initial algebra iff is a well-founded coalgebra.
The expectation is that the proof is a straightfoward categorification of the proof of theorem 1
We now wish to show that the category of well-founded forests (or well-founded trees) , as a full subcategory of the category of forests, is an initial algebra of the free small-coproduct completion . In particular, we will need that
is a well-founded -coalgebra,
The coalgebra structure is an equivalence.
For this we will need some preliminaries.
The data of a forest structure can be expressed internally as a function together with a map
over , where is the evident pullback
Committing an abuse of language, if as before we also let be the pulling back along the successor map , then every forest is canonically an algebra of the endofunctor , with structure map as before (but now seen as a map between presheaves over ). The graph of this map is a subobject
which is classified by a map in , where is the covariant power-object functor. In this way, every forest carries a canonical -coalgebra structure. (Morphisms of forests are actually colax -coalgebra maps.) We observe that preserves the pulling back of monos.
A tree (or forest) is well-founded if it is well-founded as a -coalgebra.
(This definition is at the ordinary 1-categorical level, not the categorified level.)
Next, we associate to each forest a simple but fundamental category, the category of initial segments of (denoted by ), whose objects are elements (nodes) of , and whose morphisms are maps between the trees “above” the nodes and . To be just a bit more formal: for each forest
there is a canonical map , because is initial in ; this takes each node to the node at height (“the root”) below it. If is an element, we define the tree above to be the pullback
considered as a subforest, in fact a connected component (a tree) of . This may be generalized: for each , let be an abbreviation for . Each may be regarded as a root of the forest , and we define the tree above to be
Thus we have an internal category whose nodes are elements and whose morphisms are tree maps . This entire construction can be expressed in the internal language of ETCS, or indeed in the Mitchell-Bénabou language of a general topos in place of .
The point is that has a -coalgebra construction that matches exactly the -coalgebra construction on . The functor takes a node (or, if you prefer, the tree ) to the formal coproduct
(or, if you prefer, the formal coproduct of trees where ranges over immediate predecessors of ). This is practically the same thing as the -coalgebra structure , which takes to the disjoint union
According to the way we have defined the -coalgebra structure on , the full inclusion , taking to , is a -coalgebra map.
If is a 2-inductive subobject of a -coalgebra , then for any -coalgebra map , the weak pullback is a 2-inductive subobject of .
Suppose
commutes up to isomorphism. This is embedded in a larger diagram
and if is inductive in , the map from to factors through the full inclusion (up to isomorphism of course), and hence factors through . This is all we need.
Let be a forest. Then is a well-founded if and only if is well-founded as a -coalgebra.
The proof will be omitted (at least for now).
Let be a -subcoalgebra of . If every object of is a well-founded forest, then is a well-founded -coalgebra.
We must show that under the hypothesis, every inductive full subcategory of is an equivalence, or that the inclusion is essentially surjective. So, let be an arbitrary object of ; the hypothesis is that is well-founded, so that is a subcoalgebra that is well-founded by lemma 2. Letting be the weak intersection; the inclusion is inductive by lemma 1. Putting these two facts together, the inclusion is an equivalence. But this means that factors through (up to isomorphism), which in turn implies that is contained in the essential image of , as was to be shown.
The category is a well-founded -subcoalgebra of .
In the first place, the composite
factors through the full inclusion ; this boils down to the statement that if is a well-founded forest, then the forest
is also well-founded for any .
Thus we obtained a -coalgebra structure on , in fact a -subcoalgebra of . It is well-founded by the previous theorem.
Now we show only that the coalgebra structure is an equivalence.
The coalgebra structure is evidently full and faithful (since the composite in (2) is fully faithful). Thus we have only to show that it is essentially surjective.
However, this is clear: given an object of , the forest defined by
with transition maps defined in the obvious way, is also well-founded. This maps to the object in , and therefore is essentially surjective.
, together with an essential inverse to its coalgebra structure, is an initial -algebra.
with its coalgebra structure is a -fixpoint that is also well-founded as a -coalgebra.
I am particularly interested in understanding better what is really going on in the chapter on Existence Theorems in AST, or at least try to develop it along clean (co)algebraic lines. The object is to construct initial ZF-structures of various kinds (with a successor, with a monotone successor, etc.) from the structure of a (Heyting) pretopos with a suitable notion of small map. One could think of the pretopos as a category of “classes”, and small maps as a function between classes with small fibers, and the object is to construct, for example, a cumulative hierarchy out of this data.
The basic picture is more or less clear: a set as conceived in a material theory of well-founded sets is, by the extensionality and foundation axioms, completely determined by its membership tree. So, one could think of the structure of a material set as that of a well-founded tree. Except: trees must be identified according to the extensionality axiom; for example, we have the equality between sets
where each side of the set equation is a tree formed by attaching a root to the disjoint union of four trees. Such equations are closely related to the notions of simulation and bisimulation, so that the cumulative hierarchy may be constructed or construed as the class of bisimulation-equivalence classes of well-founded trees, and inclusions between such classes are given by simulations.
The last line is really a take-off point for algebraic set theory, or at least the AST approach to the cumulative hierarchy. For instance, the standard ZF axioms are shown to hold for the initial algebra of the small sup-cocompletion.
Remark: Joyal and Moerdijk actually have a more flexible approach: they define a ZF-algebra as a (small sup)-lattice equipped with a function (called “successor”), where a (small sup)-lattice is defined to be an algebra over the monad . The initial algebra of the endofunctor is the same as the initial ZF-algebra. However, ZF-algebras allow some extra generality: by adding extra assumptions on , such as that is monotone, or inflationary, etc., they are able to account for other classes of sets as suitable initial ZF-algebras. These include various notions of ordinal that are distinguished from one another when we move to an intuitionistic setting.
Initially, the role played by simulations and bisimulations in AST was quite mysterious to me; I really don’t think the underlying intuitions were explained too well by Joyal and Moerdijk. The tack I am hoping to take is that the initial algebra for the free small sup cocompletion is obtained by localizing the initial algebra for the free small coproduct cocompletion with respect to a suitable class of maps. Well, that’s not quite right. What we do is localize the category of well-founded trees and simulations with respect to the class of surjective simulations.
But the sweet way to describe all these things is coalgebraic.
Let be a category with pullbacks. Throughout this section, will be an endofunctor on that preserves inverse images of monos. In other words, we assume preserves pullback squares of the form
where is monic. This implies that preserves monos in particular and also intersections of subobjects.
We define algebras and coalgebras of and their morphisms in the usual way.
The pullback of an inductive subobject along a coalgebra map is an inductive subobject .
Let and be the coalgebra structures. Given a commutative square
we must show that the top arrow factors through . Since is formed by pulling back along , it suffices to produce a map that fits into a commutative square
Gluing together the evident commutative squares
and using the fact that is a coalgebra map, we may form a map from to the pullback of and :
and now using the fact that is an inductive subobject, the map factors as a map followed by . The map followed by gives us the desired .
If a coalgebra is well-founded, then so is .
We must prove that any inductive subobject is the entirety of . The map is a coalgebra map, so by lemma , the map formed by the pullback
is an inductive subobject. Since is well-founded, is an isomorphism. Applying to this pullback, we have a commutative square
but because is inductive, the map factors through . Since is an iso, is forced to be a monic retraction, and thus an iso itself, as was to be proved.
For the next lemma, assume the category is locally cartesian closed.
A small colimit of well-founded coalgebras (in the category of coalgebras) is again well-founded.
Notice that the underlying functor preserves and reflects colimits. Let be such a colimit, and let be an inductive subobject. The pullbacks along the coalgebra maps are again inductive subobjects, and thus isomorphisms since the are well-founded. We have since colimits are stable under pullback (by local cartesian closure), and the induced comparison map between colimits in is an isomorphism since the are. Thus is well-founded.