scieee AI-readable full text Open interactive document viewer

Polynomial functors and trees

Kock, Joachim

Abstract

We explore the relationship between polynomial functors and trees. In the first part we characterise trees as certain polynomial functors and obtain a completely formal but at the same time conceptual and explicit construction of two categories of rooted trees, whose main properties we describe in terms of some factorisation systems. The second category is the category Ω of Moerdijk and Weiss. Although the constructions are motivated and explained in terms of polynomial functors, they all amount to elementary manipulations with finite sets. Included in Part 1 is also an explicit construction of the free monad on a polynomial endofunctor, given in terms of trees. In the second part we describe polynomial endofunctors and monads as structures built from trees, characterising the images of several nerve functors from polynomial endofunctors and monads into presheaves on categories of trees. Polynomial endofunctors and monads over a base are characterised by a sheaf condition on categories of decorated trees. In the absolute case, one further condition is needed, a projectivity condition, which serves also to characterise polynomial endofunctors and monads among (coloured) collections and operads.

Full text

POLYNOMIAL FUNCTORS AND TREES JOACHIM KOCK To my Father for his 70th birthday Abstract. We explore the relationship between polynomial functors and trees. In the first part we characterise trees as certain polynomial functors and obtain a completely formal but at the same time conceptual and explicit construction of two categories of rooted trees, whose main properties we describe in terms of some factorisation systems. The second category is the category Ω of Moerdijk and Weiss. Although the constructions are motivated and explained in terms of polynomial functors, they all amount to elementary manipulations with finite sets. Included in Part 1 is also an explicit construction of the free monad on a polynomial endofunctor, given in terms of trees. In the second part we describe polynomial endofunctors and monads as structures built from trees, characterising the images of several nerve functors from polynomial endofunctors and monads into presheaves on categories of trees. Polynomial endofunctors and monads over a base are characterised by a sheaf condition on categories of decorated trees. In the absolute case, one further condition is needed, a projectivity condition, which serves also to characterise polynomial endofunctors and monads among (coloured) collections and operads. 0. Introduction and preliminaries 0.0. Introduction While linear orders and the category ∆ of nonempty finite ordinals constitute the combinatorial foundation for category theory, the theories of operads and multicategories are based on trees. Where ∆ is very well understood and admits good formal descriptions, trees are often treated in an ad hoc manner, and arguments about them are often expressed in more or less heuristic terms based on drawings. Having solid combinatorial foundations is crucial for developing homotopical and higher-dimensional versions of the theories. Recently, Moerdijk and Weiss [16], [17] have undertaken the project of developing a homotopy theory for operads by mimicking the simplicial approach to homotopical 1 2 JOACHIM KOCK category theory. Their work is the main motivation and inspiration for the present article (although no homotopy theory is developed here). This paper analyses the relationship between polynomial functors, polynomial monads and trees, keeping the analogy with graphs, categories and linear orders as close as possible. In both cases, the interplay between algebra, combinatorics and homotopy theory follows the same pattern, whose general theory has been worked out by Weber [20]. Categories are first defined algebraically: they are algebras for a nice monad on the category of graphs. There is a canonical way to distill the combinatorics of such a monad, which in this case yields the category ∆. Finally categories are characterised among presheaves on ∆. In close analogy, polynomial monads are algebras for a nice monad on the category of polynomial endofunctors. From this monad a category of trees arises naturally. Finally polynomial monads are characterised among presheaves on this category of trees. One single observation accounts for the close relationship between polynomial endofunctors and trees, namely that they are represented by diagrams of the same shape, as we now proceed to explain. Although this observation is both natural and fruitful, it seems not to have been made before. Trees are usually defined and manipulated in either of two ways: •‘Topological/static characterisation’: trees are graphs E- -V with certain topological properties and structure (a base point). •‘Recursive characterisation’: a tree is either a trivial tree or a collection of smaller trees. In this work, a different viewpoint is taken, specifically designed for the use of trees in operad theory and related topics: •‘Operational characterisation’: trees are certain many-in/one-out structures, i.e. built from building blocks like out in Accordingly a tree should have a set of edges A, and a set of vertices (or nodes) N, which we think of as operations; these should have inputs and output (source and target). So the structure is something like N in A A. out - POLYNOMIAL FUNCTORS AND TREES 3 The fork represents a ‘multi-valued map’, because a node may have several input edges. A standard way to encode multi-valued maps is in terms of correspondences or spans; hence we arrive at this shape of diagram to represent a tree: (1) As Mp -Nt -A. To be explicit, Mis the set of input edges (i.e. pairs (b, e) where bis a node and eis an input edge of b). In order to be trees, such diagrams should satisfy certain axioms, which turn out to be quite simple. Although this is clearly also a static graph-like definition, its operational aspect comes to the fore with the observation that this shape of diagram is precisely what defines polynomial endofunctors [11], vindicating the interpretation of Nas a set of operations. The polynomial endofunctor represented by a diagram (1) is Set/A s∗ -Set/M p∗-Set/N t! -Set/A. Among all polynomial endofunctors we characterise those that correspond to trees, and since the needed conditions have a clear intuitive content and are convenient to work with, we will simply take this as the definition of tree (1.0.3). If in (1) the map pis the identity, the diagram is just that of a directed (non-reflexive) graph, and the associated polynomial functor becomes linear. Imposing the tree axioms in this case yields linear trees, i.e. finite linear orders. The theory of polynomial functors is relatively new and has hitherto mostly been exploited from the viewpoint of type theory and computer science (some references can be found in [5] or [11]). The point that polynomial functors are an excellent tool for making explicit and analysing the combinatorics underlying operad theory was first made in the paper [12], where polynomial functors were used to extract the first purely combinatorial characterisation of opetopes. Opetopes can be seen as higher-dimensional analogues of trees. The present paper goes to a more fundamental level, substantiating that already the usual notion of tree is of polynomial nature and benefits from this explicitation. The crucial feature of polynomial endofunctors and polynomial monads compared to operads, is that they can be represented by diagrams of sets like (1), and most constructions with polynomial functors can be performed in terms of elementary operations on those representing sets. As a result, all operations on trees can be carried out completely formally (e.g., grafting is given in terms of pushouts of finite sets), without ever having seen a tree in nature — although of course the arguments are easier to follow with drawings of trees in mind. 4 JOACHIM KOCK The recursive aspect of trees is also prominent in the present approach, remembering that polynomial endofunctors provide categorical semantics for inductive data types (W-types), the latter appearing as initial Lambek algebras for the former [15]. In fact, a recursive characterisation of trees (1.1.21) follows quite easily from the definition, although we shall not attempt to explain it in this introduction. While in type theory trees (of a certain branching profile P) appear as initial algebras for some polynomial functor P(expressing the branching profile), in this work trees are themselves certain polynomial functors. In a precise sense they are absolute trees, i.e. not relative to any preassigned branching profile. The paper naturally divides into two parts: the first part concerns the categories of trees. Most arguments in this part are quite elementary, and some of the initial manœuvres may appear pedantic. They are deliberately included in order to emphasise the workability of the new tree formalism — the reader is challenged to provide easier arguments in other formalisms of trees. The second part uses the tree formalism to prove theorems about polynomial functors and polynomial monads and to clarify the relationship with operads. This part is of a more technical nature and requires some more category theory. We proceed to give an overview of each of the two parts of the paper. 0.0.1. Overview of Part 1: trees in terms of polynomial endofunctors. After recalling the relevant notions from the theory of polynomial functors, we define a tree to be a diagram of sets of shape (1) satisfying four simple conditions (1.0.3). The category TEmb is the full subcategory of PolyEnd consisting of the trees. The symbol TEmb stands for ‘tree embeddings’, as it turns out maps between trees are always injective (1.1.3) and correspond to a notion of subtree. Root-preserving embeddings and ideal embeddings are characterised in terms of pullback conditions, and every tree embedding factors as root-preserving followed by ideal embedding (1.1.15). These two classes of maps allow pushouts along each other in the category TEmb — this is grafting of trees. This leads to a recursive characterisation of trees (1.1.21), as well as the useful result that every tree is the iterated pushout of its one-node subtrees over its inner edges (1.1.24). For a polynomial endofunctor P, a P-tree is a tree with a map to P. This amounts to structuring the set of input edges of each node. For example, if Mis the free-monoid monad (0.1.8), then M-trees are precisely planar trees. It is shown, using the recursive characterisation of trees, that the set of isomorphism classes of P-trees, denoted tr(P), is the least fixpoint (initial Lambek algebra) for the polynomial endofunctor 1 + P(Theorem 1.2.5). This leads to the following explicit construction of the free monad on P: if POLYNOMIAL FUNCTORS AND TREES 5 Pis given by the diagram A←M→N→A, then the free monad on Pis given by A←tr′(P)→tr(P)→A where tr′(P) denotes the set of isomorphism classes of P-trees with a marked leaf (1.2.8). The monad structure is given by grafting P-trees. We are particularly interested in free monad on trees. Since maps between trees are embeddings, the free monad on a tree T= (A←M→N→A) is given by A←sub′(T)→sub(T)→A (where sub(T) (resp. sub′(T)) denotes the set of subtrees of T(resp. subtrees with a marked leaf). The category Tree is defined to be the category whose objects are trees and whose arrows are maps between their free monads (1.3.1). This means that edges are mapped to edges and subtrees are mapped to subtrees. (It is shown that any map in PolyEnd between free monads on trees is a monad map (1.3.2).) In other words, Tree is the Kleisli category of TEmb with respect to the free-monad monad on PolyEnd. This category Tree is equivalent to the category Ω of Moerdijk and Weiss [16], whose presheaves are called dendroidal sets. Its construction in terms of polynomial functors reveals important properties analogous to properties of ∆. In fact, ∆ is equivalent to the full subcategory in Tree consisting of the linear trees. (The word ‘linear’ matches also the meaning of the word for polynomial functors, namely those given by matrix multiplication (see [11]).) The main intrinsic features of the category Tree can be expressed in terms of three factorisation systems: Tree is shown to have has surjective/ injective factorisation, generic/free factorisation, as well as root-preserving/ ideal-embedding factorisation. The relation between these factorisation systems is summarised in this figure: surjective injective generic free root preserving ideal The generic/free factorisation is the most interesting one, cf. the second part of the paper. The root-preserving/ideal-embedding factorisation is inherited from TEmb. Every surjection is generic, and the generic maps are precisely the boundary-preserving maps, and in particular root-preserving. Every ideal embedding is free, and every free map is injective. Hence the the three factorisation systems are compatible, and provide a four-component 6 JOACHIM KOCK factorisation system, as suggested by the above figure: every arrow factors essentially uniquely as a surjection followed by a generic injection, followed by a free root-preserving map followed by an ideal embedding. Explicit descriptions are derived for each of the four classes of maps: the surjections consist in deleting unary nodes, the generic injections are node refinements (and of course the free maps are the tree embeddings). The ideal embeddings are by definition those corresponding to subtrees containing all descendants — this is the notion of subtree most relevant to computer science and linguistics. The subcategory of generic tree maps is opposite to the category of trees studied by Leinster [13, §7.3]. On Leinster’s side of the duality, tree maps can be described in terms of set maps between the sets of nodes. On our side of the duality, tree maps are described in terms of set maps between the sets of edges. The category of generic injections is roughly the opposite of the category of trees studied by Ginzburg and Kapranov [7]; the difference is that they exclude all trees with nullary nodes. In fact, most of the time they also exclude trees with unary nodes, and call the remaining trees reduced. 0.0.2. Overview of Part 2: polynomial endofunctors in terms of trees. In the second part we describe polynomial endofunctors and monads as structures built from trees. Let tEmb and tree denote chosen skeleta of TEmb and Tree, respectively. Since tEmb is a subcategory in PolyEnd, there is a natural nerve functor PolyEnd →PrSh(tEmb), and similarly there is a nerve functor PolyMnd →PrSh(tree). These nerve functors are fully faithful, and we characterise their images. A main tool for these results is the theory of monads with arities due to Weber [20], which is reviewed in Section 2.0. Nerves of polynomial functors constitute an interesting application of Weber’s theory, of a somewhat different flavour than the previously known examples, the new twist being that PolyEnd is not a presheaf category. A key observation is that although PolyEnd itself is not a presheaf category, every slice of it is a presheaf category. This result relies on a notion of element of a polynomial endofunctor, introduced in Section 2.1: the elements of a polynomial endofunctor are the maps into it from elementary trees, i.e. trees with at most one node. The elementary trees, forming the subcategory elTr, play the role of representables: we show rather easily that the slice category PolyEnd/Pis naturally equivalent to the presheaf category PrSh(el(P)) (cf. 2.1.3), and that each polynomial endofunctor P is the colimit of a diagram of shape el(P) (cf. 2.1.7). In Section 2.2 we come to the notions of generic morphism and generic factorisation, key notions in Weber’s theory. We show that every element POLYNOMIAL FUNCTORS AND TREES 7 of a polynomial monad factors as generic followed by free, and the object appearing in the middle of the factorisation is a tree (2.2.4). This is a main ingredient in the proof that the free-monad monad on PolyEnd is a local right adjoint (2.2.6). We then show that trees provide arities for the free-monad monad on PolyEnd (cf. 2.2.10). With these facts established, Weber’s general nerve theorem (2.0.5) implies the following characterisation (2.2.12): a presheaf on tree is a polynomial monad if and only if its restriction to tEmb is a polynomial endofunctor. What is here called the special nerve theorem (2.0.3), first proved by Leinster [14] and subsumed in the theory of Weber [20], concerns the case of a parametric right adjoint cartesian monad on a presheaf category; it characterises nerves in terms of the Segal condition. The Segal condition is about requiring certain canonical cocones to be sent to limit cones, and can also be formulated as a sheaf condition for a Grothendieck topology defined in terms of those canonical cocones. The Segal condition makes sense also in the present case (the Grothendieck topology is introduced in Section 2.3). It is shown that the nerve of a polynomial endofunctor is always a sheaf (2.3.3), and we have an equivalence of categories Sh(tEmb)≃PrSh(elTr). However, the Segal condition is not enough to characterise nerves of polynomial monads. The special nerve theorem does apply to slices, though, (they are presheaf categories): for a fixed polynomial monad P, monads over Pare characterised (2.3.5) as presheaves on tree/Psatisfying the Segal condition. In the absolute case, one more condition is needed for a nerve theorem: it amounts to characterising the polynomial endofunctors among the presheaves on elTr. Presheaves on elTr are precisely (coloured) collections. The category Coll(I) of I-coloured collections has a monoidal structure for which the monoids are the I-coloured operads. The nerve functor from polynomial endofunctors to collections is monoidal, and therefore PolyMnd embeds into the category of operads. We show that a collection is (isomorphic to) the nerve of a polynomial endofunctor if and only if it is (isomorphic to) the symmetrisation of a nonsymmetric collection (2.4.5). (More precisely, the category of polynomial endofunctors is the Kleisli category for the symmetrisation monad for nonsymmetric collections). Another characterisation is obtained: the polynomial endofunctors are the projective objects in Coll with respect to colour-preserving termwise surjections (2.4.8). The final section contains a big diagram relating the various objects involved: polynomial endofunctors and monads (as well as their planar versions), collections and operads (as well as the nonsymmetric versions), and the adjunctions and nerve functors relating them. Polynomial monads are characterised as operads whose underlying collection is projective (in the sense just described). 8 JOACHIM KOCK A note about generality. In this paper, for simplicity, we only consider finite trees, and correspondingly we always assume our polynomial functors to be finitary. This is the natural level of generality from the viewpoint of operad theory, and for the sake of giving a formal construction of the category of trees of Moerdijk and Weiss, which was the original motivation for this work. It is mostly straightforward to generalise the results and constructions to wellfounded trees (in the category of sets) and arbitrary polynomial functors — the proofs go through almost verbatim. I believe large parts of the theory will also generalise to an arbitrary locally cartesian closed category E. Many proofs can be reinterpreted in the internal language of E, but there are also some that cannot (e.g. involving complements), and new viewpoints may be required. This general case, perhaps more interesting from the viewpoint of type theory, is left to another occasion. Acknowledgments. I am especially indebted to Andr´e Joyal for his contributions to my mathematical apprenticeship, and specifically for introducing me to polynomial functors. Countless discussions with him on the subject over the past years have been crucial for this work. This work was prompted by Ieke Moerdijk’s talk on dendroidal sets at the Mac Lane Memorial Conference in April 2006 — I am grateful for the input. The first part of the paper was in place in March 2007 when I presented it at the 85th Peripatetic Seminar on Sheaves and Logic in Nice. At that occasion Clemens Berger pointed out the similarities with his theory [3] of Joyal’s Theta [9] and pointed me to Weber’s work [19], [20]; many conceptual improvements resulted from these links, and the second part of the paper found its natural setting — I thank him for those pointers. More recently I have profited from conversations with Anders Kock, David Gepner, Denis-Charles Cisinski, Ieke Moerdijk, Mark Weber, Michael Batanin, Nicola Gambino, and Tom Fiore, all of whom have been visiting Barcelona to participate in the special programme on Homotopy Theory and Higher Categories at the CRM, where this work was finished. I am grateful to Panagis Karazeris for organising the Patras conference (March 2008) in honour of my father, the perfect opportunity for me to present this work. Finally I acknowledge benefit from research grants MTM2006-11391 and MTM2007-63277 of the Spanish Ministry of Education and Science. 0.1. Polynomial functors 0.1.1. Notation. Throughout we denote by 0 the empty set and by 1 the singleton. We use the symbols + and Pfor disjoint union of sets (or of categories). POLYNOMIAL FUNCTORS AND TREES 9 We recall some facts about polynomial functors. For further details and many other aspects of this fascinating topic, the reader is referred to the manuscript in preparation Notes on Polynomial Functors [11]. 0.1.2. Polynomial functors. A diagram of sets and set maps like this (2) Ep-B I s  J t - gives rise to a polynomial functor P:Set/I →Set/J defined by Set/I s∗ -Set/E p∗ -Set/B t! -Set/J. Here lowerstar and lowershriek denote, respectively, the right adjoint and the left adjoint of the pullback functor upperstar. In explicit terms, the functor is given by Set/I −→ Set/J [f:X→I]7−→ X b∈BY e∈Eb Xs(e) (3) where Eb:=p−1(b) and Xi:=f−1(i), and where the last set is considered to be over Jvia t!. In this paper we shall only consider polynomial functors for which the map phas finite fibres (equivalently, the functor preserves sequential colimits.) Such polynomial functors are called finitary. From now on, ‘polynomial functor’ means ‘finitary polynomial functor’. 0.1.3. Categories of polynomial functors. (Cf. [6].) There is a category Poly(I, J) whose objects are the polynomial functors from Set/I to Set/J, and whose arrows are the cartesian natural transformations (i.e. natural transformations with cartesian naturality squares). A cartesian natural transformation u:P′⇒Pbetween polynomial functors corresponds precisely to a commutative diagram (4) E′p′ -B′ I s′  J t′ - E ? p - s  B ?t - whose middle square is cartesian. In other words, giving uamounts to giving a J-map u:B′→Btogether with an I-bijection E′ b′∼ →Eu(b′)for each b′∈B′. 16 JOACHIM KOCK a b⊂a b e⊃e 1.1.6. Edges. For each edge xof Tthere is a subtree p p p→Tgiven by 10-0-1 T0 pxq?T2 ?-T1 ?-T0. pxq ? The subtree consists solely of the edge x. The edge is the root edge iff the left-hand square is a pullback, and the edge is a leaf iff the right-hand square is a pullback. 1.1.7. One-node subtrees. For each node bin Tthere is a subtree inclusion (T2)b+ 1  (T2)b-{b}-(T2)b+ 1 T0 ?T2 ?-T1 ?-T0 ? The vertical maps at the ends are the sum of s|(T2)band the map sending 1 to t(b). The subtree defined is the local one-node subtree at b: the node itself with all its incident edges. 1.1.8. Proposition. Let Rand Sbe nontrivial subtrees in T, and suppose that R1⊂S1. Then R⊂S. In particular, a nontrivial subtree is determined by its nodes. Proof. We need to provide the dotted arrows in the diagram R0R2-R1-R0 S0 - S2- - S1- - S0 - T0 ?  T2 ?-  T1 ?-  T0 ?  The arrow R1→S1is the assumed inclusion of nodes. For each node bin Rwe have a bijection between the fibre (R2)band the fibre (S2)b. These bijections assemble into a map R2→S2and a cartesian square. Since R0=R2+{r}where ris the root edge of R, to specify the arrow R0→S0 POLYNOMIAL FUNCTORS AND TREES 17 it remains to observe that rmaps into S0: indeed, there is a b∈R1with t(b) = r. Hence φ0(r) = φ0(t(b)) = t(φ1(b)) ∈S0. 1.1.9. Ideal subtrees. An ideal subtree is a subtree containing all the descendant nodes of its edges, and hence also all the descendant edges. (Hence it is a ‘down-set’ for the tree order (both with respect to nodes and with respect to edges), and just by being a subtree it is also closed under binary join.) Each edge zof a tree Tdetermines an ideal subtree denoted Dz: Dz:D0D2-D1-D0 T0 ? ∩ T2 ? ∩ -T1 ? ∩ -T0 ? ∩ where D0:={x∈T0|x≤z}, D1:={b∈T1|t(b)∈D0}, D2:={e∈T2|t(p(e)) ∈D0}=D0r{z}. It is easy to check that this is a tree; it looks like this: z Dz Note also that we have x∈Dz⇔x≤z. 1.1.10. Lemma. The following are equivalent for a tree embedding φ:S→T: (1)The image subtree is an ideal subtree. (2)The right-hand square is cartesian (like in the above diagram). (3)The image of each leaf is again a leaf. Proof. (1) ⇒(2): clearly every ideal subtree S⊂Tis equal to Dzfor zthe root of S. Hence the embedding has cartesian right-hand square. (2) ⇒(3): a leaf in Sis characterised (1.1.6) as an edge for which the right-hand square is cartesian; composing with φgives then again a cartesian right-hand square, so the edge is again a leaf in T. (3) ⇒(1): let xbe an edge in S, having a child node bin T(that is, p(b) = x). This means xis not a leaf in T, and hence by assumption, not a leaf in Seither. So bis also in S. 18 JOACHIM KOCK 1.1.11. Pruning. Using complements, it is not difficult to see that an edge z∈T0defines also another subtree which has the original root, but where all descendants of zhave been pruned. In other words, the ideal subtree Dz is thrown away (except for the edge zitself). Formally, with the notation of the ideal subtree: put C1:=T1rD1and C2:=T2rD2. Then clearly we have a cartesian square C2-C1 T2 ? ∩ -T1. ? ∩ Now simply put C0:=C2+{1}(the original root). It remains to see that the map t:T1→T0restricts to C1→C0, but this follows from the fact that if t(b) is not in D0, then it must be in either C2or 1. Using simple set theory, one readily checks that this is a tree again. In any poset, we say that two elements eand e′are incomparable if neither e≤e′nor e′≤e. If two subtrees have incomparable roots then they are disjoint. Indeed, suppose the subtrees Sand S′of Thave an edge xin common. Then the totally ordered set of ancestors of xin Twill contain both the root of Sand the root of S′, hence they are comparable. Clearly siblings are incomparable. In particular, if two subtrees have sibling roots, then they are disjoint. 1.1.12. Lemma. Let xand ybe edges of a tree T. Then the following are equivalent: (1) The ideal subtrees Dxand Dyare disjoint. (2) xand yare incomparable (i.e. neither x≤ynor y≤x). (3) There exists a subtree in which xand yare leaves. Proof. If x≤ythen clearly Dx⊂Dy. On the other hand if Dxand Dy have an edge ein common, then e≤xand e≤y, and hence x≤yor y≤x. Concerning condition (3): if xand yare leaves of a subtree, in particular they are both minimal, and in particular they are incomparable. Conversely, if they are incomparable, then we already know that the ideal subtrees they generate are disjoint, so we can prune at xand yto get a subtree in which xand yare leaves.  1.1.13. Root-preserving embeddings. An arrow S→Tin TEmb is called root preserving if the root is mapped to the root. In other words, S viewed as a subtree of Tcontains the root edge of T: POLYNOMIAL FUNCTORS AND TREES 19 T S The root preserving subtrees are those that are up-sets in the tree order. It is easy to check that S→Tis root-preserving if and only if the left-hand square is a pullback. 1.1.14. Lemma. If a tree embedding is both root preserving and ideal, then it is invertible (i.e. its image is the whole tree). Proof. Indeed, if it is root preserving then its image contains 1, and because it is ideal its image contains all other edges, as they are descendants of the root.  1.1.15. Proposition. Every arrow φ:S→Tin TEmb factors uniquely as a root-preserving map followed by an ideal embedding. Proof. Put r:=φ0(root), and consider the ideal subtree Dr⊂T. Since the map preserves childhood relation, it is clear that all edges in Smap into Dr, and this map is root preserving by construction.  1.1.16. Remark. One can equally well factor every map the other way around: first an ideal embedding and then a root-preserving embedding. We will not have any use of that factorisation, though. 1.1.17. Lemma. A subtree is determined by its boundary. Proof. Let S⊂Tand S′⊂Tbe subtrees with common boundary. Suppose bis a node of Swhich is not in S′. Since bis in S, for some kwe have σk(t(b)) = root(S) = root(S′). In this chain of nodes and edges, there is a node bwhich is in Sbut not in S′, and such that t(b) is an edge in S′. This means t(b) is a leaf in S′and hence a leaf in S, but this in turn implies that bis not in S, in contradiction with the initial assumption. So the two subtrees contain the same nodes. If they do contain nodes at all then they are equal by Lemma 1.1.8. If both subtrees are trivial, then they must coincide because their roots coincide.  1.1.18. Pushouts in PolyEnd.A polynomial functor Pis a diagram in Set of shape · ← · → · → · While pointwise sums are also sums in PolyEnd, pointwise pushouts are not in general pushouts in PolyEnd, because of the condition on arrows that the middle square be cartesian. Only pushouts over polynomial functors of 20 JOACHIM KOCK shape ? ←0→0→? can be computed pointwise. In particular we can take pushouts over the trivial tree p p p: 1 ←0→0→1. The pushout of the morphisms S←p p p→Tis the polynomial endofunctor given by (7) S2+T2-S1+T1 S0+T0  S0+T0 - S0+1T0  S0+1T0, - where S0+1T0denotes the amalgamated sum over the singleton. 1.1.19. Proposition. Given a diagram of trees and tree embeddings Srp p pl-T such that ris the root edge in S, and lis a leaf in T, then the pushout in PolyEnd is again a tree, called the grafting of Sonto the leaf of T, and denoted S+p p pT. Proof. We check that the polynomial endofunctor (7) is a tree by inspection of the four axioms. It is obvious the involved sets are finite. The calculation S0+1T0= (S2+{r}) +{r}T0=S2+T0=S2+T2+ 1 (where 1 denotes the root of the bottom tree T) shows that Axiom (3) holds and that 1 is also the root of the new tree. Now we check that the right-hand leg is injective. To say that lis a leaf of Tmeans it is not in the image of t:T1→T0. So we can write S1+T1=S1+{l}({l}+T1), and the map we want to prove injective is just the inclusion S1+T1=S1+{l}({l}+T1)֒→S1+{l}T0. Finally, we check the walk-to-the-root axiom: for x∈S0, in a finite number of steps we arrive at r=e=l, and from here in another finite number of steps down to the root of T0. 1.1.20. Remark. More generally, the pushout of a root-preserving embedding along an ideal embedding is again a tree, and the two resulting maps are again root-preserving and ideal, respectively, as in this diagram ·root pres. -· · ideal ? root pres. -· ideal ? We will not need or prove this result here. The following expresses the recursive characterisation of trees. POLYNOMIAL FUNCTORS AND TREES 21 1.1.21. Proposition. A tree Tis either a nodeless tree, or it has a node b∈T1with t(b) = 1; in this case for each e∈(T2)bconsider the ideal subtree Decorresponding to e. Then the original tree Tis the grafting of all the Deonto the input edges of b. Proof. The grafting exists by Proposition 1.1.19, and is a subtree in Tby the universal property of the pushout. Clearly every node in Tis either b or a node in one of the ideal subtrees, therefore the grafting is the whole tree, by Lemma 1.1.8.  1.1.22. Corollary. An automorphism of a tree amounts to permutation of siblings whose generated ideal subtrees are isomorphic. Proof. Use the recursive characterisation of trees. By childhood preservation, an automorphism must send an edge eto a sibling e′. For the same reason it must map Deisomorphically onto De′. 1.1.23. Inner edges. An inner edge of a tree T0s T2p -T1t -T0 is one that is simultaneously in the image of sand t. In other words, the set of inner edges is naturally identified with T1×T0T2considered as a subset of T0; its elements are pairs (b, e) such that t(b) = s(e). 1.1.24. Corollary. Every nontrivial tree Tis the grafting (indexed by the set of inner edges T1×T0T2) of its one-node subtrees.  The elements of a tree Tare its nodes and edges. i.e. its elementary subtrees. These form a poset ordered by inclusion, and we denote this category el(T). There is an obvious functor el(T)→TEmb. This functor has a colimit which is just T. Indeed, each edge is included in at most two one-node subtrees of T, and always as root in one and as leaf in the other; the colimit is obtained from these pushouts. The general notion of elements of a polynomial endofunctor will be introduced in Section 2.1. 1.2. P-trees and free monads The trees studied so far are in a precise sense abstract trees, whereas many trees found in the literature are structured trees, amounting to a morphism to a fixed polynomial functor. The structure most commonly found is planarity: a planar structure on a tree Tis a linear ordering of the input edges of each node, i.e. a linear ordering on each fibre of T2→T1. This amounts to giving a morphism T→M, where Mis the free-monoid monad (0.1.8). 22 JOACHIM KOCK 1.2.1. P-trees. Let Pbe a fixed polynomial endofunctor P0←P2→ P1→P0. By definition, the category of P-trees is the comma category TEmb/Pwhose objects are trees Twith a morphism T→Pin PolyEnd. Explicitly, a P-tree is a tree T0←T2→T1→T0together with a diagram T0T2-T1-T0 P0 ?P2 ?-P1 ?-P0. ? Unfolding further the definition, we see that a P-tree is a tree whose edges are decorated in P0, whose nodes are decorated in P1, and with the additional structure of a bijection for each node n∈T1(with decoration b∈P1) between the set of input edges of nand the fibre (P2)b, subject to the compatibility condition that such an edge e∈(P2)bhas decoration s(e), and the output edge of nhas decoration t(b). Note that the P0-decoration of the edges is completely specified by the node decoration together with the compatibility requirement, except for the case of a nodeless tree. (The notion of P-tree for a polynomial endofunctor Pis closely related to the notion of TS-tree of Baez and Dolan [1, Proof of Thm. 14], but they neglect to decorate the edge in the nodeless tree.) If Pis the identity monad, a P-tree is just a linear tree. If Pis the free-monoid monad, a P-tree is precisely a planar tree, as mentioned. If Pis the free-nonsymmetric-operad monad on Set/N, the P-trees are the 3-dimensional opetopes, and so on: opetopes in arbitrary dimension are P-trees for a suitable P, cf. [1], [13, §7.1], [12]. 1.2.2. Remark. It is important to note that P-trees are something genuinely different from just trees, in the sense that TEmb is not equivalent to TEmb/Pfor any P. It is true of course that every tree admits a planar structure, i.e. a decoration by the free-monoid monad M(0.1.8): the possible diagrams T0T2-T1-T0 I ? N′ ?-N ?-1 ? have to send a node b∈T1to its arity n(the number of input edges), and then there are n! different choices for mapping the fibre to the n-element set n, the fibre over n. The crucial property of P-trees is that they are rigid: 1.2.3. Proposition. P-trees have no nontrivial automorphisms. POLYNOMIAL FUNCTORS AND TREES 23 Proof. Every automorphism of a tree consists in permuting siblings. Now in a P-tree, the set of siblings (some set (T2)b) is in specified bijection with (P2)φ1(b), so no permutations are possible.  The basic results about trees, notably grafting (1.1.19) and the recursive characterisation (1.1.21), have obvious analogues for P-trees. We shall not repeat those results. 1.2.4. The set of P-trees. Let Pbe a polynomial endofunctor. Denote by tr(P) the set of isomorphism classes of P-trees, i.e. isomorphism classes of diagrams T0T2-T1-T0 P0 ?P2 ?-P1 ?-P0 ? where the first row is a tree. Note that tr(P) is naturally a set over P0by returning the decoration of the root edge. 1.2.5. Theorem. If Pis a polynomial endofunctor then tr(P)is a least fixpoint (i.e. initial Lambek algebra) for the endofunctor 1 + P:Set/P0−→ Set/P0 X7−→ P0+P(X). Proof. The proof uses the recursive characterisation of P-trees analogous to 1.1.21. For short, put W:= tr(P). We have P(W) = (b, f)|b∈P1, (P2)b f -W P0  -  This set is in natural bijection with the set of P-trees with a root node decorated by b∈P1. Indeed, given (b, f)∈P(W), we first consider the unique one-node P-tree whose node is decorated by b. (This is well-defined: since (P2)bis finite, the one-node tree is given as in 1.0.5, and the decorations are completely determined by the requirement that the node is decorated by b.) Now for each e∈(P2)bwe can graft the P-tree f(e) onto the leaf eof that one-node P-tree as in 1.1.19. The result is a P-tree Dwith root node decorated by b. Conversely, given a P-tree Dwith root node decorated by b, define f: (P2)b→Wby sending eto the ideal sub-P-tree De. Now, Wis the sum of two sets: the nodeless P-trees (these are in bijection with P0) and the P-trees with a root node. Hence we have (1+P)(W)∼ →W, saying that Wis a fixpoint. Finally, we must show that Wis a least fixpoint. Suppose V⊂Wis also a fixpoint. Let Wn⊂Wdenote the set of P-trees with at most nnodes. 24 JOACHIM KOCK Clearly W0⊂V. But if Wn⊂Vthen also Wn+1 ⊂Vbecause each tree with n+ 1 nodes arises from some (b, f) where bdecorates the root node and f: (P2)b→Wn. 1.2.6. Historical remarks: well-founded trees. Theorem 1.2.5 has a long history: it is a classical observation (due to Lambek) that the elements of an initial algebra for an endofunctor Pare tree-like structures, and that the branching profile of such trees depends on P. A very general version of the theorem is due to Moerdijk and Palmgren [15] providing categorical semantics for the notion of W-types (wellfounded trees) in Martin-L¨of type theory. Briefly, under the Seely correspondence between (extensional) type theory and locally cartesian closed categories E, the Sigma and Pi types correspond to dependent sums and products (as in (3)). The Wtype constructor associates to a given combination Pof Sigma and Pi types a new inductive type WP. Under the correspondence, Pis a polynomial endofunctor on E(i.e. with P0terminal), and WPis its initial algebra. The new feature of Theorem 1.2.5 (and the treatment leading to it) is to have trees and endofunctors on a common footing. This makes everything more transparent. Such a common footing was not possible in [15] because they only considered polynomial endofunctors Pwith P0terminal. Trees cannot be captured by such, since it is essential to be able to distinguish the edges in a tree. The case of arbitrary polynomial functors was considered by Gambino and Hyland [5], corresponding to dependent type theory. 1.2.7. Construction of free monads. Let tr′(P) denote the set of (isomorphism classes of) P-trees with a marked input leaf, i.e. the set of diagrams 10-0-1 T0 ?T2 ?-T1 ?-T0 ? P0 ?P2 ?-P1 ?-P0 ? modulo isomorphism. (The cartesianness of the upper right-hand square says the edge is a leaf.) The set tr′(P) is naturally an object of Set/P0, the structure map tr′(P)→P0returning the decoration of the marked leaf. There is also the natural projection to tr(P) given by forgetting the mark. We get altogether a polynomial functor P0←tr′(P)→tr(P)→P0 which we denote by P. Its value on a set X→P0is the set of P-trees with leaves decorated in X. More precisely, for a P-tree S, denote by LSthe set POLYNOMIAL FUNCTORS AND TREES 25 of leaves of S, then P(X) = (S, f)|S∈tr(P), LS f-X P0  - . The polynomial functor Pis naturally a monad: the multiplication map P P(X)→P(X) sends a P-tree Twith leaves decorated by other P-trees to the P-tree obtained by grafting the other P-trees onto the leaves of T. Note that the compatibility condition on the decorations states that the root edges of the decorating trees are precisely the leaves of the bottom tree, so the grafting makes sense. The unit for the multiplication is the map P0→P(P0) sending an edge xto the trivial P-tree decorated by x∈P0. The construction P7→ Pis clearly functorial. If α:Q→Pis a morphism of polynomial endofunctors, it is clear that α1: tr(Q)→tr(P) sends trivial trees to trivial trees, and it is also clear it is compatible with grafting. Hence αis a monad map. 1.2.8. Proposition. Let Pbe a polynomial endofunctor. The monad Pgiven by P0←tr′(P)→tr(P)→P0 is the free monad on P. Proof. Given X→P0, put WX:=P(X), the set of P-trees with leaves decorated in X. In other words, WX=P(X) = (S, f)|S∈tr(P), LS f-X P0  - , where LSdenotes the set of leaves of a tree S. It follows from the argument of Lemma 1.2.5 that WXis a least fixpoint for the endofunctor X+P, i.e. an initial object in (X+P)-alg ≃X↓P-alg. Via the inclusion P⊂X+Pit also becomes a P-algebra. The construction X7→ WXis clearly functorial and defines a functor F:Set/P0−→ P-alg X7−→ WX. To say that WXis the initial in (X+P)-alg ≃X↓P-alg is equivalent to saying that Fis left adjoint to the forgetful functor U:P-alg →Set/P0, and therefore (e.g. by Barr-Wells [2, Theorem 4, p.311]), the generated monad X7→ WXis the free monad on P. 32 JOACHIM KOCK maps. In order to characterise the primitive boundary-preserving injections, we change the viewpoint, looking at maps into a given tree instead of out of it: Fix a tree T, and suppose it has an inner edge x=t(b) = s(e). We construct a new tree T/x by contracting the edge x, and exhibit a canonical boundary-preserving injection φx:T/x →T: (10) T0r{x}T2r{x}-T1/(b=p(e)) -T0r{x} T0 ?sub′(T) ?-sub(T) ?-T0 ? The maps are all obvious, except possibly T1/(b=p(e)) →sub(T): this map sends the node b=p(e) to the two-node subtree containing band p(e), and sends all other nodes to their corresponding one-node subtree. It is clear that φXis boundary preserving and injective. The tree T/x has one inner edge less than T. We can now repeat the process for any subset of the inner edges in T, and for each subset we get a different boundary-preserving injection into T. Conversely, every boundary-preserving injection S→Tarises in this way. Indeed, we already know that these boundary-preserving injections are glued together from node refinements. The inner edges of the image trees form precisely the subset of edges we need to contract in order to recover the tree S. In conclusion, we have derived explicit descriptions for each of the four classes of maps. The surjections can be described more explicitly as deletion of unary nodes, and each surjection can be broken into a composite of maps deleting just one node. The boundary-preserving injections are described as node refinements, and each boundary-preserving injection can be broken into a sequence of ‘primitive’ refinements adding just one new node. The free maps are the ‘arity-preserving’ tree embeddings, which also can be given add-one-node wise. The new node is added either at a leaf (in which case the map is root preserving), or at the root (in which case the map is an ideal embedding). 1.3.20. Linear trees. Alinear tree is one in which every node has precisely one input edge. The full subcategory of Tree consisting of the linear trees is equivalent to the simplex category ∆. The factorisation systems restrict to ∆, recovering the well-known fact that every map in ∆ factors uniquely as a surjection followed by a top-and-bottom-preserving injection, followed by distance-preserving injection. POLYNOMIAL FUNCTORS AND TREES 33 The primitive maps correspond to degeneracy and face maps in ∆, which motivates the terminology employed by Moerdijk and Weiss [16]. They call the unary-node deletions degeneracy maps. The primitive node refinements they call inner face maps, and the primitive tree embeddings outer face maps. The inner face maps play a crucial role in their theory, to express horn-filling conditions for dendroidal sets [17]. 2. Polynomial endofunctors in terms of trees Since we are now going to consider presheaves, for size reasons we choose a skeleton for each of the categories TEmb ⊂Tree, and denote them with a lowercase initial: tEmb ⊂tree. Clearly these are small categories. The embedding i0:tEmb →PolyEnd induces a nerve functor N0:PolyEnd −→ PrSh(tEmb) P7−→ HomPolyEnd (i0(−),P). Similarly, i:tree →PolyMnd induces a nerve functor N:PolyMnd −→ PrSh(tree) P7−→ HomPolyMnd (i(−),P) The goal of this second part is to characterise the image of these nerve functors. 2.0. Background on nerve theorems We shall first recall the classical nerve theorem for categories, then review Weber’s general framework for nerve theorems. 2.0.1. The nerve theorem for categories, after Berger [3].It is classical that a simplicial set X: ∆op →Set is (isomorphic to) the nerve of a small category if and only if the ‘Segal condition’ holds: for each n≥1, the natural map Xn→X1×X0· · · ×X0X1is an isomorphism. In the viewpoint of Berger and Weber, the starting point is the free-category monad on Grph =PrSh(0 ⇉1), the category of directed (non-reflexive) graphs. The free category on a graph Ahas as objects the vertices of Aand as arrows the finite paths in A, i.e. graph maps from the finite, nonempty, linear graphs [n] = {0→1→ · · · → n}into A. Let ∆0⊂Grph denote the full subcategory consisting of those linear graphs; note that all maps in 34 JOACHIM KOCK ∆0are injective. Equipped with the jointly-surjective topology, there is an equivalence of categories (11) Sh(∆0)≃Grph (the topology is in fact determined by this equivalence). Now ∆ appears as the Kleisli category over ∆0with respect to the freecategory monad, and we have the diagram ∆i-Cat ∆0 j 6 i0 -Grph free 6 ⊣forgetful ? as in (8). The category ∆ has generic-free factorisation; the generic maps are the endpoint-preserving maps. (The free maps can be characterised as distance preserving.) The embeddings i0and iare dense, hence induce fully faithful nerve functors Cat N -PrSh(∆) Grph ? N0 -PrSh(∆0). j∗ ? The classical nerve theorem can now be broken into two steps. The first says that X: ∆op →Set is in the essential image of Nif and only if j∗Xis in the essential image of N0. The second step concerns presheaves on ∆0, and can be phrased in several equivalent ways: X: ∆op 0→Set is a graph if and only if it is a sheaf (this is essentially a reformulation of the equivalence (11)). The sheaf condition amounts to the condition that certain cocones are sent to limit cones: each [n]∈∆0has a canonical expression as a colimit of copies of the two representables [0] and [1], and the condition amounts to saying that these cocones are sent to limit cones. This is just the usual Segal condition. Berger [3] explained the nerve theorem for categories along these lines as a baby case of a similar theorem characterising strict ω-categories as presheaves on Joyal’s cell category Θ satisfying a Segal condition. Leinster [14] proved a more general nerve theorem (cf. 2.0.3), and Weber [20] fitted everything into a natural (and more general) framework whose main notions we now recall. POLYNOMIAL FUNCTORS AND TREES 35 2.0.2. Local right adjoints and generic factorisation. A functor F:D→Cis called a local right adjoint if every slice D/X FX −→ C/FX [Y→X]7−→ [FY →F X] is a right adjoint. (If Dhas a terminal object, the notion of local right adjoint coincides with Street’s notion of parametric right adjoint [18].) This condition is equivalent to the following: every map in Cof the form a:A→ FX factors essentially uniquely as Aa-FX FM F f - g - where g:A→FM is generic. We shall define generic in a moment (2.2.1). Suppose now that C=PrSh(C) and that Fis a local right adjoint cartesian monad on C. In this case the local adjointness condition is equivalent to having generic factorisations just for maps of the form C→F1, where C∈Cis a representable object in C. Choose one such factorisation for each representable. Let Θ0denote the full subcategory of Cconsisting of the objects Mappearing in these factorisations. Let Θ denote the Kleisli category of Frestricted to Θ0, i.e. the full subcategory of F-Alg given by the FM for M∈Θ0. We have a diagram (12) Θi-F-Alg Θ0 j 6 i0 -C. free 6 ⊣forgetful ? 2.0.3. Special nerve theorem. (Cf. Leinster [14] and Weber [20].) The nerve functor N:F-Alg →PrSh(Θ) induced by iis fully faithful, and its essential image consists of those presheaves on Θsatisfying the Segal condition, namely that the canonical cocones are sent to limit cones in Set. 2.0.4. Monads with arities. The conditions needed in order to get a nerve theorem have been further abstracted by Weber [20]. A monad with arities on a category C(not required to be a presheaf category or even to have a terminal object) consists of a monad F(not required to be cartesian) and a full subcategory i0: Θ0⊂Crequired to be dense and small, such that the 36 JOACHIM KOCK following condition is satisfied: the left Kan extension Θ0 i0-C id ⇒ C id  i0 - is preserved by the composite CT -CN0 -PrSh(Θ0) (cf. the proof of Proposition 2.2.10 below). As above, denote by Θ the Kleisli category of Frestricted to Θ0, refer to Diagram (12), and let N:F-Alg → PrSh(Θ) and N0:C→PrSh(Θ0) be the nerve functors induced by iand i0respectively. 2.0.5. General nerve theorem. (Cf. Weber [20, Thm. 4.10].) If (F, Θ0)is a monad with arities, then Nis fully faithful, and X: Θop →Set is in the essential image of Nif and only if its restriction to Θ0is in the essential image of N0. The remainder of this article is concerned with establishing a nerve theorem for polynomial endofunctors and polynomial monads. In this case, the Segal condition is not enough to characterise the nerves, the reason being that PolyEnd is not a presheaf category: specifically it lacks a terminal object. 2.1. Elements of a polynomial endofunctor Although PolyEnd is not a presheaf category, we shall see in a moment that all its slices are presheaf categories. The crucial construction is that of a category of elements of a polynomial endofunctor. Recall that for an object Fof a presheaf category PrSh(C), the category of elements is the comma category C/F, via the Yoneda embedding. Among the important properties of this construction is the fact that the composite functor C/F -Cy -PrSh(C) has colimit F; it is called the canonical diagram for F. Second, there is a canonical equivalence of categories PrSh(C)/F ≃PrSh(C/F). We shall introduce the category of elements of a polynomial endofunctor P, and establish the analogues of these two properties. POLYNOMIAL FUNCTORS AND TREES 37 2.1.1. The category of elements of a polynomial endofunctor. To a given polynomial endofunctor P, represented by I←E→B→I, we associate a small category el(P), the category of elements of P. Since Poly is not a presheaf category, this notion is not the standard notion of category of elements. However, the terminology will be justified by Proposition 2.1.4 below. We first associate a bipartite graph to P: its vertex set is I+B and every edge will go from an element in Ito an element in B. The set of edges is B+E. An edge b∈Bhas source t(b) and target b. An edge e∈Ehas source s(e) and target p(e). Now define el(P) to be the category generated by that bipartite graph; since the graph is bipartite, there are no composable arrows, so this step just amounts to adding an identity arrow for each object. It is clear that this construction is functorial, so we have defined a functor el: PolyEnd →Cat, easily seen to be faithful. 2.1.2. Examples. Let Pbe the identity functor (represented by 1 ←1→ 1→1). Then el(P) is a category with two objects and two parallel arrows (in addition to the identity arrows): 0 - -1. That is, the category whose presheaves are the graphs. Let Pbe the free-monoid endofunctor M(represented by 1 ←N′→ N→1, cf. 0.1.8). Then el(M) has object set 1 + N={p p p,0,1,2, . . . }, and its arrows all go from p p pto somewhere else. The set of arrows is N+N′ (plus the identity arrows): for each n∈Nthere is an arrow p p p→n, and for each {i < n} ∈ N′there is another arrow p p p→n. This is the category whose presheaves are the nonsymmetric coloured collections (2.4.4) (called multigraphs in [20], Example 2.14). 2.1.3. Proposition. There is an equivalence of categories PolyEnd/P≃PrSh(el(P)). Proof. To a given polynomial endofunctor Qover P: QAM-N-A P ? I ?  sE ? p -B ? t -I ? assign the presheaf e Q: el(P)op →Set whose value on the object iis Ai, whose value on the object bis Nb, whose value on the arrow t(b)→bis the restriction Nb→At(b), and whose value on the arrow e:s(e)→p(e) is the composite Np(e)≃Me→As(e). 38 JOACHIM KOCK Conversely, given a presheaf X: el(P)op →Set, we have in particular sets X(i) or X(b) for each of the objects ior bof I+B. Define a polynomial functor over Pby ` i∈I X(i)` e∈E X(p(e)) -` b∈B X(b)-` i∈I X(i) I ? E ?-B ?-I. ? For each b∈Bthere is an arrow b:t(b)→bin el(P) and hence a map X(b)→X(t(b)), the sum of these maps constitute the endpoint component of the map. For each e∈Ethere is an arrow e:s(e)→p(e) in el(P) and hence a map X(p(e)) →X(s(e)); the sum of these maps constitute the left-hand map of the polynomial functor. The map in the middle is obvious. It is easy to see that these assignments are functorial, and that the two constructions are inverse to each other.  2.1.4. Proposition. Let Qbe a polynomial endofunctor over P, and let e Q: el(P)op →Set denote the corresponding presheaf via Proposition 2.1.3. Then there is a natural isomorphism between el(Q)and the category of elements of e Q. Proof. (We work just with the graphs, omitting the verification needed for identity arrows.) Let Q→Pbe given by AM-N-A I ?  sE ? p -B ? t -I. ? The elements of the presheaf e Q: el(P)op →Set are pairs (u, x) where u∈ obj(el(P)) = I+Band x∈e Q(u). In other words, an element of e Qis either a pair (i, a), with i∈Iand a∈e Q(i) = Ai, or a pair (b, n), with b∈Band n∈e Q(b) = Nb. In conclusion the object set is A+N, as desired. An arrow from element (u, x) to element (v, y) is a pair (f, y) where f:u→vbelongs to arr(el(P)) = B+E, and y∈e Q(v). In other words, an arrow is either a pair (b, n) where b:t(b)→bin el(P) and n∈e Q(b) = Nb, or it is a pair (e, m) where e:s(e)→p(e) in el(P) and m∈e Q(p(e)) = Np(e)≃ Me. In conclusion, the set of arrows of the category of elements of e Qis N+M, and it is clear from the construction that their sources and targets are as required.  2.1.5. Elementary trees. Let ElTr denote the full subcategory of TEmb consisting of the elementary trees, i.e. trees with at most one node. Let elTr POLYNOMIAL FUNCTORS AND TREES 39 denote a fixed skeleton of ElTr: we fix one trivial tree p p pand one one-node tree nfor each n∈N. There are n+ 1 arrows from p p pto n, one for each leaf and one for the root edge, and in addition to these arrows, each object nhas n! endomorphisms, all invertible. Henceforth we use the symbol nto denote an arbitrary object of elTr, possibly the trivial tree. For each polynomial endofunctor P, there is a canonical equivalence of categories (13) el(P)≃ElTr/P: to each element i∈Icorresponds the trivial P-tree {i}0-0-{i} I ? E ?-B ?-I, ? and to each element b∈Bcorresponds the one-node P-tree Eb+{t(b)}Eb-{b}-Eb+{t(b)} I ? E ?-B ?-I. ? In particular, each element of Pcan be viewed as a morphism n→P (in analogy with the situation for presheaves), and we can think of ElTr as the category of representables. (We shall come back to the relation between PolyEnd and the presheaf category PrSh(elTr) in Section 2.4.) The equivalences we have established fit into this diagram (commutative up to isomorphism): el(P)y-PrSh(el(P)) elTr/P ≃?-PolyEnd/P, ≃ ? so locally elTr →PolyEnd is the Yoneda embedding of the representables. 2.1.6. The canonical diagram for P.The composite functor DP: el(P)-PolyEnd/P-PolyEnd is called the canonical diagram for P, in view of the following result: 2.1.7. Proposition. The colimit of DPis P. Proof. For Qover Pwe have colim el(Q)→PolyEnd/P=Q 40 JOACHIM KOCK since PolyEnd/Pis a presheaf category by 2.1.3, and since the notion of elements is the usual one in this case by 2.1.4. The result now follows since the forgetful functor PolyEnd/P→PolyEnd preserves colimits. (It is a basic fact that PolyEnd has binary products, cf. [11], so P× − is right adjoint to the forgetful functor in question.)  2.2. Generic factorisation, and trees as arities The main results of this section are that the free-monad monad on PolyEnd is a local right adjoint, or equivalently that it has generic factorisations, and that trees are arities for the free-monad monad. We first show that elements of free monads have generic factorisation and that the resulting middle objects are precisely the trees. This is an explicit verification relying on our good handle on trees and free monads. The second step is to establish local right adjointness from the first result using the density of elementary trees. Finally we find that for trees the notions of generic and boundary-preserving coincide, as claimed in Section 1.3. From this it follows readily that trees satisfy Weber’s axioms for arities. 2.2.1. Generic maps. The notion of generic map was introduced by Weber [19] generalising the notion of generic element of [8]. The following special case of the notion is the most useful. Let Fbe a monad on a category C. An arrow g:A→FB in Cis called generic (with respect to F) if for every diagram A-FC FB g? F(b) -FD F(c) ? there is a unique arrow u:B→Csuch that C Bb - u - D c ?and A-FC FB g?F(u) - The endofunctor Fis said to admit generic factorisations if every A→FD admits a factorisation into a generic map followed by one in the image of F. Such a factorisation is then necessarily unique up to unique isomorphism. The maps of the form A→FD correspond by adjunction to F-algebra maps F A →FD, which we shall also call generic. All the involved maps can then be seen as living in the Kleisli category of F. From POLYNOMIAL FUNCTORS AND TREES 41 this perspective, generic factorisations amount to having an orthogonal factorisation system generic/free in the Kleisli category. (To be correct, the right hand class of the factorisation system should be saturated with the isomorphisms. In our case all isomorphisms will already be free.) 2.2.2. Lemma. If g:S→Tis a boundary-preserving map between trees, then gis generic in PolyEnd (with respect to the free-monad monad P7→ P). Proof. Given a square Sσ-Q T g? τ -P q ? let R→Qdenote the Q-tree σ1(S). It image under q1is just R→Q→P. Going the other way around the square, the maximal subtree Sis first mapped to T∈sub(T) (by boundary preservation), and then to the P- tree τ:T→P. Since the diagram commutes, Rand Trepresent the same P-tree, and since P-trees have no nontrivial automorphisms, there is a unique isomorphism T∼ →R, and hence a unique diagonal filler d:T→Qfor the square.  We shall see in a moment that the converse of the lemma is true as well. 2.2.3. Generic factorisation of elements of free monads. The key point towards getting all generic factorisations is the following easy result: 2.2.4. Lemma. Every element s:n→Pof a free monad Pfactors essentially uniquely as ng -Tf -P, where the middle object Tis a tree, gis boundary preserving (hence generic), and fis free. Proof. If nis the trivial tree, the map s:n→Psingles out a single element x∈P0, and sis the free map 10-0-1 P0 pxq?P2 ?-P1 ?-P0. pxq ? Hence we can take T=n, and gis just the identity. If nis a one-node tree, the unique element in n1maps to some element in (P)1= tr(P), i.e. a P-tree f:T→P. The cartesian condition on maps 48 JOACHIM KOCK 2.3.5. Theorem. For a presheaf X: (tree/P)op →Set, the following are equivalent: (1) Xis in the essential image of N(i.e. Xis isomorphic to the nerve of a polynomial monad over P). (2) j∗Xis in the essential image of N0(i.e. j∗Xis isomorphic to the nerve of a polynomial endofunctor over P). (3) j∗Xis a sheaf on tEmb/P≃tr(P). (4) Xtakes the canonical cocones to limit cones, i.e. satisfies the Segal condition. The key point to note is that we have an equivalence of categories PolyEnd/P≃Sh(tr(P)). 2.3.6. Examples. If Pis the identity monad, we recover the classical nerve theorem for categories. For P=M(the free-monoid monad), tree/Mis the category of planar trees, polynomial monads over Mare nonsymmetric operads, and the theorem says that such are characterised among presheaves on tree/Mby the Segal condition. 2.4. Polynomial endofunctors and collections 2.4.1. Collections. The category PrSh(elTr) is the category of (coloured, symmetric) collections, which we denote by Coll. To be explicit, a collection Cconsists of a set C(p p p) of colours and for each n∈Na set C(n) of n-ary operations. The structure maps are first of all n+ 1 projections C(n)→C(p p p), and for each n∈Nthe symmetric group Snacts on C(n) by permuting the first nprojections. The inverse image in C(n) of the elements (i1,...,in;i)∈C(p p p)n+1 is denoted C(i1,...,in;i) and is interpreted as the set of n-ary operations with input colours i1,...,inand output colour i. Since elTr is dense in PolyEnd, the nerve functor R0:PolyEnd −→ PrSh(elTr) = Coll P7−→ Hom(−,P) is fully faithful. We proceed to characterise its image, and start by looking at the slices: 2.4.2. Proposition. The nerve functor R0:PolyEnd →PrSh(elTr)is a local equivalence. That is, for every polynomial endofunctor P, the sliced functor PolyEnd/P−→ PrSh(elTr)/R0P [Q→P]7−→ [R0Q→R0P] is an equivalence. POLYNOMIAL FUNCTORS AND TREES 49 Proof. We use the equivalence PolyEnd/P≃PrSh(el(P))≃PrSh(elTr/P) of Proposition 2.1.3 (with equation (13)). Under this equivalence the sliced nerve functor has the following description: it sends a presheaf e Q: (elTr/P)op →Set to X:elTrop −→ Set n7−→ X s:n→Pe Q(s) (This presheaf has a natural map to R0P= [n7→ Hom(n,P)] by returning the running index of the sum.) In the other direction, given a presheaf X:elTrop →Set with a map α:X⇒R0P, define e Q: (elTr/P)op −→ Set [s:n→P]7−→ X(n)s where X(n)sdenotes the fibre of αn:X(n)→Hom(n,P) over s. It is easy to see that these two functors are inverse to each other, establishing the asserted equivalence.  2.4.3. The nerve and its slices. For each polynomial endofunctor Pwe have a diagram PolyEnd R0-PrSh(elTr) PolyEnd/P 6 ⊣?∼ -PrSh(elTr)/R0P. 6 ⊣? The left adjoints are just forgetting the structure map to Pand R0P, respectively, and clearly the square with the left adjoints commutes. The right adjoints are multiplication with Pand multiplication with R0P, respectively. The square with the right adjoints commutes because R0, as every nerve functor, commutes with limits, and in particular with products. The right adjoint on presheaves has another conceptual description, via the equivalence PrSh(elTr)/R0P≃PrSh(elTr/P): in terms of the latter it is just precomposition with the forgetful functor elTr/P→elTr. 2.4.4. Nonsymmetric collections. The above diagram is most interesting when Pis the free-monoid monad M: in this case we have PrSh(elTr)/R0M≃PrSh(el(M)), and the latter is the category of nonsymmetric collections, denoted NonSymColl, and the left adjoint is then the symmetrisation functor, 50 JOACHIM KOCK denoted S. The category el(M) is equivalent to the category of planar elementary trees. Nonsymmetric collections are described just as collections, except that there are no symmetries. The diagram now reads: PolyEnd R0-PrSh(elTr) = Coll PolyEnd/M L 6 ⊣?∼-PrSh(elTr)/R0M≃NonSymColl. S 6 ⊣? Note that Lis surjective on objects. Indeed, every polynomial endofunctor admits a map to M. It follows that R0and Shave the same essential image. Since R0is fully faithful we get: 2.4.5. Theorem. The category PolyEnd, as a subcategory of Coll, is naturally identified with the Kleisli category for the symmetrisation monad S on NonSymColl. 2.4.6. Remark. The symmetrisation monad Son PrSh(elTr/M) is a local right adjoint, since it is the composite of a forgetful functor from a slice category and a true right adjoint. It is endowed with arities by the representables themselves, and elTr appears as the Kleisli category of elTr/M with respect to S. The generic/free factorisation on elTr is quite degenerate: every arrow in elTr already is either a generic map (an automorphism of some n) or it is free (an inclusion p p p→n). Slightly more interesting is the corresponding generic/free factorisation system on Tree, the Kleisli category on the category Tree/M, still with respect to S. To see it most clearly, let ptree denote a skeleton of Tree/M, the category of planar trees. Let tree′denote the full subcategory of Tree with one object for each object in ptree (i.e. the category of planar trees and not-necessarily planar maps). This is just the Kleisli category of Srestricted to ptree. Now in tree′, the generics are the isomorphisms and the free maps are the planar maps, and every arrow factors as an isomorphism followed by a planar map (in analogy with the skeleton of the category of finite sets consisting of the sets {0,...,n−1}which happen to have a natural order: every arrow in this category factors as an isomorphism followed by an order-reserving map). 2.4.7. Polynomial endofunctors as projective collections. There is another characterisation of PolyEnd as a subcategory of Coll, suggested to me by Andr´e Joyal: it is the subcategory of projective objects with respect to a certain class of surjections. For the sake of having some word for it, say that an arrow in Coll is an isochrome surjection if it is termwise POLYNOMIAL FUNCTORS AND TREES 51 surjective and bijective on colours. Call a collection Pisochrome projective if every isochrome surjection Z→Padmits a section. 2.4.8. Theorem. A collection Pis isomorphic to the nerve of a polynomial endofunctor if and only if it is isochrome projective. Theorem 2.4.8 will be broken into a chain of biimplications (Theorem 2.4.10) each of which is rather easy to establish, once the correct viewpoint has been set up. 2.4.9. Collections with a fixed set of colours. We denote by Coll(I) the category of collections with colour set Iand colour preserving morphisms. This category is again (equivalent to) a presheaf category. Namely, let MonEnd(I) be the full subcategory of PolyEnd(I) consisting of the monomial endofunctors (with endpoints I), i.e. those I←E→B→Ifor which Bis singleton. Clearly MonEnd(I) is a groupoid. Write nfor a fixed n-element set, and denote by monEnd(I)⊂MonEnd(I) the small subgroupoid consisting of the objects I←n→1→I (n∈N). It is a disjoint union: monEnd(I) = X n∈N monEnd(I)n where monEnd(I)nis the subgroupoid of monomials of degree n. Now we have Coll(I)≃PrSh(monEnd(I)). (This viewpoint on Coll(I) was also used in the appendix of Berger-Moer- dijk [4], except that they did not formulate it in terms of monomial functors.) An object I←n→1→Iamounts to an (n+ 1)-tuple (i1, . . . , in;i) of elements in I, and the value on it of a presheaf Cis the set C(i1,...,in;i); the arrows in monEnd(I) provide the colour-preserving symmetries. More formally, given a presheaf F:monEnd(I)op →Set, define a presheaf with colour set Iby elTrop −→ Set n7−→ X Q∈monEnd(I)n F(Q), and conversely, given a presheaf C:elTrop →Set with C(p p p) = I, define a presheaf on monEnd(I) by sending an object (i1,...,in;i) to the inverse image of this (n+ 1)-tuple under the structure map C(n)→I. 52 JOACHIM KOCK Since monEnd(I) is a full subcategory of PolyEnd(I) we have a nerve functor R0(I):PolyEnd(I)−→ PrSh(monEnd(I)) P7−→ HomPolyEnd(I)(−,P), and this nerve functor is compatible with the global nerve R0:PolyEnd → Coll. Precisely, the diagram PolyEnd R0-PrSh(elTr)= Coll PolyEnd(I) ∪ 6 R0(I) -PrSh(monEnd(I))≃Coll(I) ∪ 6 commutes up to a natural isomorphism, as is easy to check. 2.4.10. Theorem. For any collection Pwith set of colours I, the following are equivalent. (1) Pis isochrome projective (i.e. every isochrome surjection onto Pin Coll admits a section). (2) Pis projective in Coll(I)(i.e. every surjection onto Pin Coll(I) admits a section). (3) Pis a sum of representables in Coll(I)≃PrSh(monEnd(I)). (4) Pis in the essential image of the nerve functor R0(I):PolyEnd(I)→ Coll(I). (5) Pis in the essential image of the nerve functor R0:PolyEnd → Coll. Proof. (1) ⇔(2): for the sake of defining isochrome projectivity, requiring bijectivity on colours is equivalent to requiring identity on colours — clearly the section required to exist will then automatically be the identity on colours too. (2) ⇔(3): It is true in any category of presheaves on a groupoid that an object is projective (with respect to termwise surjections) if and only if it is a sum of representables. (3) ⇔(4): The R0(I)-nerve of a polynomial functor I←E→B→I is the sum of the representables I←Eb→ {b} → I(indexed by b∈ B). Conversely any sum of representables defines a polynomial endofunctor (with endpoints I). Phrased more elegantly: polynomial endofunctors are precisely the sums of monomial endofunctors. (4) ⇔(5): This follows from the fact that the nerve functors are compatible.  POLYNOMIAL FUNCTORS AND TREES 53 2.5. Polynomial monads and operads In this final section we characterise the image of the nerve functor for polynomial monads, explain the relation with operads, and sum up the relation between the various nerve functors. Combining Proposition 2.2.12 and Proposition 2.4.8, we already have: 2.5.1. Proposition. A presheaf X:treeop →Set is isomorphic to the nerve of a polynomial monad if and only if j∗X:tEmbop →Set is an isochrome projective collection. We now finally come to operads, and aim to fit everything into this diagram: N:PolyMnd R-Opd W-PrSh(tree) N0:PolyEnd 6 ⊣?R0-Coll 6 ⊣?W0-PrSh(tEmb) 6 ⊣j∗ ? Npl 0:PolyEnd/M 6 ⊣?≃ Rpl 0 -NonSymColl 6 ⊣? Wpl 0 -PrSh(tEmb/M) 6 ⊣k∗ ? The middle row and the bottom row were explained in the previous section. 2.5.2. Operads. For fixed set of colours I, the category Coll(I) has a monoidal structure given by the substitutional tensor product (cf. [10], see also the Appendix of [4]). The monoids in Coll(I) are the I-coloured operads, forming a category Opd(I) and fitting into a free-forgetful adjunction Opd(I)- Coll(I). Morphisms between operads of different colours can be defined in terms of base-change (just like for collections): if α:I→Jis a map of sets there is an obvious change-of-colours functor α∗:Opd(J)→Opd(I), and a morphism from an I-coloured operad Xto aJ-coloured operad Yis defined to be a pair (α, φ) where α:I→Jis a map of sets and φ:X→α∗Yis a morphism of I-coloured operads. With this extra structure the free-forgetful adjunctions assemble into a single adjunction Opd - Coll. The functor R0:PolyEnd →Coll is monoidal (for each I) and commutes with base-change, hence induces the functor R:PolyMnd →Opd. 2.5.3. The nerve functor for operads. The nerve functor W:Opd → PrSh(tree) is now defined in the obvious way from the embedding 54 JOACHIM KOCK tree ⊂PolyMnd ⊂Opd. It is the nerve functor for operads introduced by Moerdijk and Weiss. The image of Wis characterised in the following theorem, due to Moerdijk-Weiss and Weber: 2.5.4. Theorem. For a presheaf X:treeop →Set, the following are equivalent. (1) Xis isomorphic to the nerve of an operad (i.e. Xis in the essential image of W). (2) Every inner horn of Xhas a unique filler. (3) j∗Xis isomorphic to the nerve of a collection (i.e. j∗Xis in the essential image of W0). (4) k∗j∗Xis isomorphic to the nerve of a nonsymmetric collection (i.e. k∗j∗Xis in the essential image of Wpl 0). (5) Xsatisfies the Segal condition (i.e. takes canonical cocones to limit cocones.) Proof. The equivalence of (1) and (2) is due to Moerdijk and Weiss [17] (their Proposition 5.3 together with Theorem 6.1). We shall not need the horn-filling condition here, and mention the result only because it was the first nerve theorem for operads. The equivalence of (1), (4) and (5) are due to Weber [20] (combining his Examples 2.14, 4.19, and 4.27). Condition (3) and the category tEmb, central to the present paper, are not considered by Moerdijk and Weiss, nor by Weber. The equivalence between (4) and (3) follows from the fact that the symmetrisation functor is a local right adjoint on a presheaf category (cf. 2.4.6).  For emphasis, we state the characterisation of the essential image of R, that is, characterise polynomial monads among operads: 2.5.5. Proposition. An operad is isomorphic to a polynomial monad if and only if its underlying collection is isochrome projective.  References [1] John C. Baez and James Dolan.Higher-dimensional algebra. III. n-categories and the algebra of opetopes. Adv. Math. 135 (1998), 145–206. ArXiv:q-alg/9702014. [2] Michael Barr and Charles Wells.Toposes, triples and theories. no. 278 in Grundlehren der Mathematischen Wissenschaften. Springer-Verlag, 1985. Corrected reprint in Reprints in Theory and Applications of Categories, 12 (2005) (electronic). [3] Clemens Berger.A cellular nerve for higher categories. Adv. Math. 169 (2002), 118–175. [4] Clemens Berger and Ieke Moerdijk.Resolution of coloured operads and rectification of homotopy algebras. In Categories in algebra, geometry and mathematical physics, vol. 431 of Contemp. Math., pp. 31–58. Amer. Math. Soc., Providence, RI, 2007. ArXiv:math/0512576. POLYNOMIAL FUNCTORS AND TREES 55 [5] Nicola Gambino and Martin Hyland.Wellfounded Trees and Dependent Polynomial Functors. In S. Berardi, M. Coppo, and F. Damiani, editors, TYPES 2003, vol. 3085 of Lecture Notes in Computer Science, pp. 210–225. Springer Verlag, Heidelberg, 2004. [6] Nicola Gambino and Joachim Kock. Categories of polynomial functors. Manuscript in preparation. [7] Victor Ginzburg and Mikhail Kapranov.Koszul duality for operads. Duke Math. J. 76 (1994), 203–272. ArXiv:0709.1228. [8] Andr´ e Joyal.Foncteurs analytiques et esp`eces de structures. In Combinatoire ´enum´erative (Montr´eal/Qu´ebec, 1985), vol. 1234 of Lecture Notes in Math., pp. 126–159. Springer, Berlin, 1986. [9] Andr´ e Joyal.Disks, duality and Θ-categories. Preprint, September 1997. [10] G. Max Kelly.On the operads of J. P. May. Repr. Theory Appl. Categ. (2005), 1–13 (electronic). Written 1972. [11] Joachim Kock. Notes on polynomial functors. Rough draft, 280pp. Available from http://mat.uab.cat/~kock/cats/polynomial.html. [12] Joachim Kock, Andr´ e Joyal, Michael Batanin, and Jean-Franc¸ois Mascari. Polynomial functors and opetopes. Preprint, arXiv:0706.1033. [13] Tom Leinster.Higher Operads, Higher Categories. London Math. Soc. Lecture Note Series. Cambridge University Press, Cambridge, 2004. ArXiv:math.CT/0305049. [14] Tom Leinster. Nerves of algebras. Talk at CT04, Vancouver. Slides available from http://www.maths.gla.ac.uk/~tl/vancouver/. [15] Ieke Moerdijk and Erik Palmgren.Wellfounded trees in categories. Annals of Pure and Applied Logic 104 (2000), 189–218. [16] Ieke Moerdijk and Ittay Weiss.Dendroidal sets. Alg. Geom. Top. (2007), 1441–1470. ArXiv:math/0701293. [17] Ieke Moerdijk and Ittay Weiss.On inner Kan complexes in the category of dendroidal sets. Preprint, arXiv:math/0701295. [18] Ross Street.The petit topos of globular sets. J. Pure Appl. Algebra 154 (2000), 299–315. Category theory and its applications (Montreal, QC, 1997). [19] Mark Weber.Generic morphisms, parametric representations and weakly Cartesian monads. Theory Appl. Categ. 13 (2004), 191–234 (electronic). [20] Mark Weber.Familial 2-functors and parametric right adjoints. Theory Appl. Categ. 18 (2007), 665–732 (electronic). Joachim Kock Departament de matem` atiques Universitat Aut` onoma de Barcelona 08193 Bellaterra (Cerdanyola), Spain E-mail address:[email protected]