The Euler characteristic of a category
Abstract
The Euler characteristic of a finite category is defined and shown to be compatible with Euler characteristics of other types of object, including orbifolds. A formula is proved for the cardinality of a colimit of sets, generalizing the classical inclusion-exclusion formula. Both rest on a generalization of Rota's Möbius inversion from posets to categories.
Full text
THE EULER CHARACTERISTIC OF A CATEGORY TOM LEINSTER Abstract. The Euler characteristic of a finite category is defined and shown to be compatible with Euler characteristics of other types of object, including orbifolds. A formula is proved for the cardinality of a colimit of sets, generalizing the classical inclusion-exclusion formula. Both rest on a generalization of Rota’s M¨obius inversion from posets to categories. Contents Introduction 1 1. M¨obius inversion 4 2. Euler characteristic 12 3. The cardinality of a colimit 19 4. Relations with Rota’s theory 22 5. Appendix: category theory 26 References 28 Introduction We first learn of Euler characteristic as “vertices minus edges plus faces”, and later as an alternating sum of ranks of homology groups. But Euler characteristic is much more fundamental than these definitions make apparent, as has been made increasingly explicit over the last fifty years; it is something akin to cardinality or measure. More precisely, it is the fundamental dimensionless quantity associated with an object. The very simplest context for Euler characteristic is that of finite sets, and of course the fundamental way to assign a quantity to a finite set is to count its elements. Euler characteristic of topological spaces can usefully be thought of as a generalization of cardinality; for instance, it obeys the same laws with respect to unions and products. Partially supported by a Nuffield Foundation award NUF-NAL 04 and an EPSRC Advanced Research Fellowship. 1
2 TOM LEINSTER In a more sophisticated context, integral geometry, Euler characteristic also emerges clearly as the fundamental dimensionless invariant. A subset of Rnis polyconvex if it is a finite union of compact convex subsets. Let Vnbe the vector space of finitely additive measures, invariant under Euclidean transformations, defined on the polyconvex subsets of Rn. Hadwiger’s Theorem [KR] states that dim Vn=n+ 1. (See also [Sc2], and [MS] for an important application to materials science.) A natural basis consists of one d-dimensional measure for each d∈ {0, . . . , n}: for instance, {Euler characteristic,perimeter,area}when n= 2. Thus, up to scalar multiplication, Euler characteristic is the unique dimensionless measure on polyconvex sets. Schanuel [Sc1] showed that for a certain category of polyhedra, Euler characteristic is determined by a simple universal property, making its fundamental nature transparent. All of the above makes clear the importance of defining and understanding Euler characteristic in new contexts. Here we do this for finite categories. Categories are often viewed as large structures whose main purpose is organizational. However, some different viewpoints will be useful here. A combinatorial point of view is that a category is a directed graph (objects and arrows) equipped with some extra structure (composition and identities). We will concentrate on finite categories (those with only finitely many objects and arrows), which also suits the combinatorial viewpoint, and the composition and identities will play a surprisingly minor role. A topological point of view is that a category can be understood through its classifying space. This is formed by starting with one 0-cell for each object, then gluing in one 1-cell for each arrow, one 2-cell for each commutative triangle, and so on. Both of these points of view will be helpful in what follows. The topological perspective is heavily used in the sequel [BL] to this paper. With topology in mind, one might imagine simply transporting the definition of Euler characteristic from spaces to categories via the classifying space functor, as with other topological invariants: given a category A, define χ(A) as the Euler characteristic of the classifying space BA. The trouble with this is that the Euler characteristic of BAis not always defined. Below we give a definition of the Euler characteristic of a category that agrees with the topological Euler characteristic when the latter exists, but is also valid in a range of situations when it does not. It is a rational number, not necessarily an integer. A version of the definition can be given very succinctly. Let Abe a finite category; totally order its objects as a1, . . . , an. Let Zbe the matrix whose (i, j)-entry is the number of arrows from aito aj. Let M=Z−1, assuming
THE EULER CHARACTERISTIC OF A CATEGORY 3 that Zis invertible. Then χ(A) is the sum of the entries of M. Of course, the reader remains to be convinced that this definition is the right one. The foundation on which this work rests is a generalization of M¨obius– Rota inversion (§1). Rota developed M¨obius inversion for posets [R]; we develop it for categories. (A poset is viewed throughout as a category in which each hom-set has at most one element: the objects are the elements of the poset, and there is an arrow a-bif and only if a≤b.) This leads, among other things, to a “representation formula”: given any functor known to be a sum of representables, the formula tells us the representation explicitly. This in turn can be used to solve enumeration problems, in the spirit of Rota’s paper. However, the main application of this generalized M¨obius inversion is to the theory of the Euler characteristic of a category (§2). We actually use a different definition than the one just given, equivalent to it when Zis invertible, but valid for a wider class of categories. It depends on the idea of the “weight” of an object of a category. The definition is justified in two ways: by showing that it enjoys the properties that the name would lead one to expect (behaviour with respect to products, fibrations, etc.), and by demonstrating its compatibility with Euler characteristics of other types of structure (groupoids, graphs, topological spaces, orbifolds). There is an accompanying theory of Lefschetz number. The technology of M¨obius inversion and weights also solves another problem: what is the cardinality of a colimit? For example, the union of a family of sets and the quotient of a set by a free action of a group are both examples of colimits of set-valued functors, and there are simple formulas for their cardinalities. (In the first case it is the inclusion-exclusion formula.) We generalize, giving a formula valid for any shape of colimit (§3). Rota and his school proved a large number of results on M¨obius inversion for posets. As we will see repeatedly, many are not truly order-theoretic: they are facts about categories in general. In particular, important theorems in Rota’s original work [R] generalize from posets to categories (§4). (The body of work on M¨obius inversion in finite lattices is not, however, so ripe for generalization: a poset is a lattice just when the corresponding category has products, but a finite category cannot have products unless it is, in fact, a lattice.) Other authors have considered different notions of M¨obius inversion for categories; notably, there is that developed by Content, Lemay and Leroux [CLL] and independently by Haigh [H]. This generalizes both Rota’s notion for posets and Cartier and Foata’s for monoids [CF]. (Here a monoid is viewed as a one-object category.) The relation between their approach
4 TOM LEINSTER and ours is discussed in §4. Further approaches, not discussed here, were taken by D¨ur [D] and L¨uck [L¨u]. In the case of groupoids, our Euler characteristic of categories agrees with Baez and Dolan’s groupoid cardinality [BD]. The cardinality of the groupoid of finite sets and bijections is e= 2.718 . . ., and there are connections to exponential generating functions and the species of Joyal [J, BLL]. Par´e has a definition of the cardinality of an endofunctor of the category of finite sets [Pa]; I do not know whether this can be related to the definition here of the Lefschetz number of an endofunctor. The view of Euler characteristic as generalized cardinality is promoted in [Sc1], [BD] and [Pr1]. The appearance of a non-integral Euler characteristic is nothing new: see for instance Wall [Wl], Bass [Ba] and Cohen [Co], and the discussion of orbifolds in §2. Ultimately it would be desirable to have the Euler characteristic of categories described by a universal property, as Schanuel did for polyhedra [Sc1]. For this, it may be necessary to relax the constraints of the present work, where for simplicity our categories are required to be finite and the coefficients are required to lie in the ring of rational numbers. Rather than asking, as below, “does this category have Euler characteristic (in Q)?”, we should perhaps ask “in what rig (semiring) does the Euler characteristic of this category lie?” However, this is not pursued here. Acknowledgements. I thank John Baez, Andy Baker, Nick Gurski, Ieke Moerdijk, Urs Schreiber, Ivan Smith and Stephen Watson for inspiration and useful discussions. I am grateful to the Centre de Recerca Matem`atica, Barcelona, for their hospitality. I also thank the very helpful referee. 1. M¨ obius inversion We consider a finite category A, writing ob Afor its set of objects and, when aand bare objects, A(a, b) for the set of maps from ato b. Definition 1.1. We denote by R(A) the Q-algebra of functions ob A× ob A-Q, with pointwise addition and scalar multiplication, multiplication defined by (θφ)(a, c) = X b∈A θ(a, b)φ(b, c) (θ, φ ∈R(A), a, c ∈A), and the Kronecker δas unit. The zeta function ζA=ζ∈R(A) is defined by ζ(a, b) = |A(a, b)|. If ζ is invertible in R(A) then Ais said to have M¨obius inversion; its inverse µA=µ=ζ−1is the M¨obius function of A. If a total ordering is chosen on the nobjects of Athen R(A) can be regarded as the algebra of n×nmatrices over Q. The defining equations
THE EULER CHARACTERISTIC OF A CATEGORY 5 of the M¨obius function are X b µ(a, b)ζ(b, c) = δ(a, c) = X b ζ(a, b)µ(b, c) for all a, c ∈A. By finite-dimensionality, µζ =δif and only if ζµ =δ. The definitions above could be made for directed graphs rather than categories, since they do not refer to composition. However, this generality seems to be inappropriate. For example, the definition of M¨obius inversion will lead to a definition of Euler characteristic, and if we use graphs rather than categories then we obtain something other than “vertices minus edges”. Proposition 2.10 clarifies this point. A different notion of M¨obius inversion for categories has been considered; see §4. Examples 1.2. (a) Any finite poset Ahas M¨obius inversion; this special case was investigated by Rota [R] and others. We may compute µ(a, c) by induction on the number of elements between aand c: µ(a, c) = δ(a, c)−X b:a≤b<c µ(a, b). In particular, µ(a, c) = 0 unless a≤c, and µ(a, a) = 1 for all a. See also Theorem 1.4 and Corollary 1.5. (b) Let Mbe a finite monoid, regarded as a category with unique object ?. (The arrows of the category are the elements of the monoid, and composition in the category is multiplication in the monoid.) Then ζ(?, ?) = |M|, so µ(?, ?)=1/|M|. (c) Let N≥0. Write Dinj Nfor the category with objects 0, . . . , N whose maps a-bare the order-preserving injections {1, . . . , a}- {1, . . . , b}. Then ζ(a, b) = b a, and it is easily checked that µ(a, b) = (−1)b−ab a. If we use surjections instead of injections then ζ(a, b) = a−1 b−1and µ(a, b)=(−1)a−ba−1 b−1. A category with M¨obius inversion must be skeletal (isomorphic objects must be equal), for otherwise the matrix of ζwould have two identical rows. The property of having M¨obius inversion is not, therefore, invariant under equivalence of categories. In general we cannot hope to just spot the M¨obius function of a category. In 1.3–1.7 we make tools for computing M¨obius functions. These cover large classes of categories, although not every finite skeletal category has M¨obius inversion (1.11(d), (e)).
6 TOM LEINSTER Let n≥0, let Abe a category or a directed graph, and let a, b ∈A. An n-path from ato bis a diagram (1) a=a0 f1 -a1 f2 -· · · fn -an=b in A. It is a circuit if a=b, and (when Ais a category) nondegenerate if no fiis an identity. Lemma 1.3. The following conditions on a finite category Aare equivalent: (a) every idempotent in Ais an identity (b) every endomorphism in Ais an automorphism (c) every circuit in Aconsists entirely of isomorphisms. Proof. (a) =⇒(b) follows from the fact that if fis an element of a finite monoid then some positive power of fis idempotent. The other implications are straightforward. Theorem 1.4. Let Abe a finite skeletal category in which the only idempotents are identities. Then Ahas M¨obius inversion given by µ(a, b) = X(−1)n/|Aut(a0)|···|Aut(an)| where Aut(a)is the automorphism group of a∈Aand the sum runs over all n≥0and paths (1) for which a0, . . . , anare all distinct. Proof. First observe that for a path (1) in A, if a06=a16=· · · 6=anthen the ais are all distinct. Indeed, if 0 ≤i<j≤nand ai=ajthen the sub-path running from aito ajis a circuit, so by Lemma 1.3, fi+1 is an isomorphism, and by skeletality, ai=ai+1. Now let a, c ∈Aand define µby the formula above. We have X b∈A µ(a, b)ζ(b, c) = µ(a, c)ζ(c, c) + X b:b6=c µ(a, b)ζ(b, c) =|Aut(c)|nµ(a, c) + X b:b6=c, g∈A(b,c) µ(a, b)/|Aut(c)|o =|Aut(c)|nµ(a, c) + X(−1)n/|Aut(a0)| · · · · · · |Aut(an)||Aut(c)|o, where the last sum is over all n≥0 and paths a=a0 f1 -· · · fn -an=bg -c such that a06=· · · 6=an6=c. By definition of µ, the term in braces collapses to 0 if a6=cand to 1/|Aut(a)|if a=c. Hence Pbµ(a, b)ζ(b, c) = δ(a, c), as required.
THE EULER CHARACTERISTIC OF A CATEGORY 7 Corollary 1.5. Let Abe a finite skeletal category in which the only endomorphisms are identities. Then Ahas M¨obius inversion given by µ(a, b) = X n≥0 (−1)n|{nondegenerate n-paths from ato b}| ∈ Z. When Ais a poset, this is Philip Hall’s theorem (Proposition 3.8.5 of [St] and Proposition 6 of [R]). An epi-mono factorization system (E,M) on a category Aconsists of a class Eof epimorphisms in Aand a class Mof monomorphisms in A, satisfying axioms [FK]. The axioms imply that every map fin Acan be expressed as me for some e∈ E and m∈ M, and that this factorization is essentially unique: the other pairs (e0, m0)∈ E × M satisfying m0e0=fare those of the form (ie, mi−1) where iis an isomorphism. Typical examples are the categories of sets, groups and rings, with Eas all surjections and M as all injections. Theorem 1.6. Let Abe a finite skeletal category with an epi-mono factorization system (E,M). Then Ahas M¨obius inversion given by µ(a, b) = X(−1)n/|Aut(a0)|···|Aut(an)| where the sum is over all n≥r≥0and paths (1) such that a0, . . . , arare distinct, ar, . . . , anare distinct, f1, . . . , fr∈ M, and fr+1, . . . , fn∈ E. Proof. The objects of Aand the arrows in Edetermine a subcategory of A, also denoted E; it satisfies the hypotheses of Theorem 1.4 and therefore has M¨obius inversion. The same is true of M. Any element α∈Qob A=Qa∈AQgives rise to an element of R(A), also denoted αand defined by α(a, b) = δ(a, b)α(b). This defines a multiplication-preserving map from Qob Ato R(A), where the multiplication on Qob Ais coordinatewise. We have elements |Aut|and 1/|Aut|of Qob A, where, for instance, |Aut|(a) = |Aut(a)|. By the essentially unique factorization property, ζA=ζE·1 |Aut|·ζM. Hence Ahas M¨obius function µA=µM· |Aut| · µE. Theorem 1.4 applied to µMand µEthen gives the formula claimed. Example 1.7. Let N≥0 and write FNfor the full subcategory of Set with objects 1, . . . , N, where ndenotes a (chosen) n-element set. Let E be the set of surjections in FNand Mthe set of injections; then (E,M) is an epi-mono factorization system. Theorem 1.6 gives a formula for the inverse of the matrix (ij)i,j . For instance, take N= 3; then µ(1,2) may be
8 TOM LEINSTER computed as follows: Paths Contribution to sum 1 -2 -2−2/1!2! = −1 1 -3 -36 -- 2 3 ·6/1!3!2! = 3/2 1 -2 -2 -6 -36 -- 2−2·6·6/1!2!3!2! = −3 Here “1 -2-2” means that there are 2 monomorphisms from 1 to 2, “3 6 -- 2” that there are 6 epimorphisms from 3 to 2, etc. Hence µ(1,2) = −1+3/2−3 = −5/2. One of the uses of the M¨obius function is to calculate Euler characteristic (§2). Another is to calculate representations. Specifically, suppose that we have a Set-valued functor known to be familially representable, that is, a coproduct of representables. The Yoneda Lemma tells us that the family of representing objects is unique (up to isomorphism). But if we have M¨obius inversion, there is actually a formula for it: Proposition 1.8. Let Abe a finite category with M¨obius inversion and let X:A-Set be a functor satisfying X∼ =X a r(a)A(a, −) for some natural numbers r(a)(a∈A). Then r(a) = X b |X(b)|µ(b, a) for all a∈A. In the first formula, Pdenotes coproduct of Set-valued functors. Proof. Follows from the definition of M¨obius function. In the spirit of Rota’s programme, this can be applied to solve counting problems, as illustrated by the following standard example. Example 1.9. Aderangement is a permutation without fixed points. We calculate dn, the number of derangements of nletters. Fix N≥0. Take the category Dinj Nof Example 1.2(c) and the functor S:Dinj N-Set defined as follows: S(n) is Sn, the underlying set of the nth symmetric group, and if f∈Dinj N(m, n) and τ∈Sm, the induced permutation Sf(τ)∈Snacts as τon the image of fand fixes all other
THE EULER CHARACTERISTIC OF A CATEGORY 9 points. Any permutation consists of a derangement together with some fixed points, so there is an isomorphism of sets Sn∼ =X m dmDinj N(m, n) where Pdenotes disjoint union. Then by Proposition 1.8 and Example 1.2(c), dn=X m |Sm|µ(m, n) = X m m!(−1)n−mn m= =n!1 0! −1 1! +· · · +(−1)n n!. To set up the theory of Euler characteristic we will not need the full strength of M¨obius invertibility; the following suffices. Definition 1.10. Let Abe a finite category. A weighting on Ais a function k•: ob A-Qsuch that for all a∈A, X b ζ(a, b)kb= 1. Acoweighting k•on Ais a weighting on Aop. Note that Ahas M¨obius inversion if and only if it has a unique weighting, if and only if it has a unique coweighting; they are given by ka=X b µ(a, b), kb=X a µ(a, b). Examples 1.11. (a) Let Lbe the category b1 a - b2. - Then the unique weighting k•on Lis (ka, kb1, kb2)=(−1,1,1). (b) Let Mbe a finite monoid, regarded as a category with unique object ?. Again there is a unique weighting k•, with k?= 1/|M|. (c) If Ahas a terminal object 1 then δ(−,1) is a weighting on A. (d) A finite category may admit no weighting at all. (This can happen even when the category is Cauchy-complete, in the sense defined
16 TOM LEINSTER c0-c1-· · · -cn d0- - d1- - - - · · · - - dn. - (If we take the usual expression of the topological n-sphere Snas a CW-complex with two cells in each dimension ≤nthen Snis the set of cells ordered by inclusion; Snis the classifying space of Sn.) Each Snis a poset, so has Euler characteristic. By Proposition 2.8, χ(Sn) = −χ(Sn−1)+2χ(1)=2−χ(Sn−1) for all n≥0; also χ(S−1) = 0. Hence χ(Sn) = 1 + (−1)n. The next three propositions show how the Euler characteristics of various types of structure are compatible with that of categories. First, Euler characteristic of categories extends Euler characteristic of graphs. More precisely, let G= (G1- -G0) be a directed graph, where G1is the set of edges and G0the set of vertices. We will show that if F(G) is the free category on Gthen χ(F(G)) = |G0|−|G1|. This only makes sense if F(G) is finite, which is the case if and only if Gis finite and circuitfree; then F(G) is also circuit-free. (A directed graph is circuit-free if it contains no circuits of non-zero length, and a category is circuit-free if every circuit consists entirely of identities.) Proposition 2.10. Let Gbe a finite circuit-free directed graph. Then χ(F(G)) is defined and equal to |G0|−|G1|. Proof. Given a, b ∈G0, write ζG(a, b) for the number of edges from ato b in G. Then ζF(G)=Pn≥0ζn Gin R(F(G)), the sum being finite since Gis circuit-free. Hence µF(G)=δ−ζG, and the result follows. This suggests that in the present context, it is more fruitful to view a graph as a special category (via F) than a category as a graph with structure. Compare the comments after Definition 1.1. The second result compares the Euler characteristics of categories and topological spaces. We show that under suitable hypotheses, χ(BA) = χ(A), where BAis the classifying space of a category A(that is, the geometric realization of its nerve NA). To ensure that BAhas Euler characteristic, we assume that NAcontains only finitely many nondegenerate simplices;
THE EULER CHARACTERISTIC OF A CATEGORY 17 then χ(BA) = X n≥0 (−1)n|{nondegenerate n-simplices in NA}|. An n-simplex in NAis just an n-path in A, and is nondegenerate in the sense of simplicial sets if and only if it is nondegenerate as a path, so A must contain only finitely many nondegenerate paths. This is the case if and only if Ais circuit-free, if and only if Ais skeletal and contains no endomorphisms except identities. So by Corollary 1.5, we have: Proposition 2.11. Let Abe a finite skeletal category containing no endomorphisms except identities. Then χ(BA)is defined and equal to χ(A). For the final compatibility result, consider the following schematic diagrams: {triangulated manifolds} {posets} ? χ -Z χ- {triangulated orbifolds} {categories} ? χ -Q. χ- On the left, we start with a compact manifold Mequipped with a finite triangulation. As shown in §3.8 of [St], the topological Euler characteristic of Mis equal to the Euler characteristic of the poset of simplices in the triangulation, ordered by inclusion. We generalize this result from manifolds to orbifolds, which entails replacing posets by categories and Zby Q. Let Mbe a compact orbifold equipped with a finite triangulation. (See [MP] for definitions.) The simplices in the triangulation form a poset P, and if p∈Pis a d-dimensional simplex then ↓p={q∈P|q≤p}is isomorphic to the poset Pd+1 of nonempty subsets of {1, . . . , d + 1}, with p∈↓pcorresponding to {1, . . . , d + 1} ∈ Pd+1. Every p∈Phas a stabilizer group G(p), and χ(M) = X p∈P (−1)dim p/|G(p)|. On the other hand, the groups G(p) fit together to form a complex of finite groups on Pop, that is, a weak functor G:Pop -Cat taking values in finite groups (regarded as one-object categories) and injective homomorphisms; see §3 of [M]. This gives a finite category E(G). For example, when Mis a manifold, each group G(p) is trivial and E(G)∼ =P. The following result is joint with Ieke Moerdijk. Proposition 2.12. Let Mbe a compact orbifold equipped with a finite triangulation. Let Gbe the resulting complex of groups. Then χ(E(G)) is defined and equal to χ(M).
18 TOM LEINSTER Proof. Every arrow in E(G) is monic, so by Theorem 1.4, E(G) has Euler characteristic. Moreover, Pis a finite poset, so has a unique coweighting k•, and χ(E(G)) = Ppkp/|G(p)|by the dual of Proposition 2.8. The coweight of pin Pis equal to the coweight of pin ↓p∼ =Pd+1, where d= dim p. The unique coweighting k•on Pd+1 is given by kJ= (−1)|J|−1, so kp= (−1)(d+1)−1= (−1)dim p. The result follows. We now turn to the theory of Lefschetz number. Let F:A-Abe an endofunctor of a category A. The category Fix Fhas as objects the (strict) fixed points of F, that is, the objects a∈Asuch that F(a) = a; a map a-bin Fix Fis a map f:a-bin Asuch that F(f) = f. Definition 2.13. Let Fbe an endofunctor of a finite category. Its Lefschetz number L(F) is χ(Fix F), when this exists. The Lefschetz number is, then, the sum of the (co)weights of the fixed points. This is analogous to the standard Lefschetz fixed point formula, (co)weight playing the role of index. The following results further justify the definition. Proposition 2.14. Let Abe a finite category. (a) L(1A) = χ(A), one side being defined if and only if the other is. (b) If Bis another finite category and A F - G Bare functors then L(GF) = L(FG), one side being defined if and only if the other is. (c) Let F:A-Aand write BF :BA-BAfor the induced map on the classifying space of A. If Ais skeletal and contains no endomorphisms except identities then L(F) = L(BF), with both sides defined. In the special case that Ais a poset, part (c) is Theorem 1.1 of [BB]. Proof. For (a) and (b), just note that Fix 1A∼ =Aand Fix GF ∼ =Fix FG. For (c), recall from the proof of Proposition 2.11 that NAhas only finitely many nondegenerate simplices; then L(BF) = X n≥0 (−1)n|{nondegenerate n-simplices in NAfixed by NF}| =X n≥0 (−1)n|{nondegenerate n-paths in Fix F}| =L(F), using Corollary 1.5 in the last step.
THE EULER CHARACTERISTIC OF A CATEGORY 19 An algebra for an endofunctor Fof Ais an object a∈Aequipped with a map h:F(a)-a. With the evident structure-preserving morphisms, algebras for Fform a category Alg F. There is a dual notion of coalgebra (where now h:a-F(a)), giving a category Coalg F. Proposition 2.15. Let Fbe an endofunctor of a finite skeletal category A containing no endomorphisms except identities. Then χ(Alg F) = L(F) = χ(Coalg F), with all three terms defined. Proof. First observe that Ais circuit-free. Now, the inclusion Fix F- Alg Fhas a right adjoint R: given an algebra (a, h), circuit-freeness implies that FN(a) is a fixed point for all sufficiently large N, and R(a, h) = FN(a). The Euler characteristics of Alg Fand Fix Fexist, by Corollary 1.5, and are equal, by Proposition 2.4(a). The statement on coalgebras follows by duality. For example, if fis an endomorphism of a finite poset Athen the subposets {a∈A|f(a)≤a},{a∈A|f(a) = a},{a∈A|f(a)≥a} all have the same Euler characteristic. The theory of Euler characteristic presented here can be extended in at least two directions. First, we can relax the finiteness assumption. For instance, the category of finite sets and bijections should have Euler characteristic P∞ n=0 1/|Sn|=e, as observed in [BD]. See the remarks after Corollary 4.3. Second, the Euler characteristic of categories is defined in terms of the cardinality of finite sets, and the theory can be generalized to V-enriched categories whenever there is a suitable notion of cardinality or Euler characteristic of objects of V. For example, Vmight be the category of finitedimensional vector spaces, with dimension playing the role of cardinality, and this leads to an Euler characteristic for finite linear categories. For another example, a 0-category is a set and an n-category is a category enriched in (n−1)-categories; iterating, we obtain an Euler characteristic for finite n-categories. In particular, if Snis the n-category consisting of two parallel n-cells then χ(Sn) = 1 + (−1)n. 3. The cardinality of a colimit The main theorem of this section generalizes the formulas |X∪Y|=|X|+|Y|−|X∩Y|,|S/G|=|S|/|G| where Xand Yare finite subsets of some larger set and Sis a finite set acted on freely by a finite group G.
20 TOM LEINSTER Take a finite functor X:A-Set. The colimit (or direct limit, or inductive limit) lim −→ Xcan be viewed as the gluing-together of the sets X(a). Its cardinality depends on the way in which these sets are glued together, which in turn is determined by the action of Xon arrows, so in general there is no formula for |lim −→ X|purely in terms of the cardinalities |X(a)| (a∈A). Suppose, however, that we are in the extreme case that there are no unforced equations of the type (X(f))(x) = (X(f0))(x0), where fand f0 are arrows in A. For pushouts, this means that the two functions along which we are pushing out are injective; when Ais a group G, so that Xis a set with a G-action, it means that the action is free. In this extreme case, |lim −→ X|can be calculated as a weighted sum of the cardinalities |X(a)|. We now make this precise. Recall from §1 that a Set-valued functor is said to be familially representable if it is a sum of representables. Proposition 3.1. Let Abe a finite category and k•a weighting on A. If X:A-Set is finite and familially representable then |lim −→ X|= Paka|X(a)|. Proof. The result holds if Xis representable, since then |lim −→ X|= 1. On the other hand, the class of functors Xfor which the conclusion holds is clearly closed under finite sums. To make use of this, we need a way of recognizing familially representable functors. Carboni and Johnstone [CJ1, CJ2] show that when Asatisfies certain hypotheses, including having all limits, a functor A-Set is familially representable if and only if it preserves connected limits. This does not help directly, because our categories Aare finite, and a finite category does not have even all finite limits unless it is a lattice. However, a standard philosophy applies: when Afails to have all limits of a certain type, it is rarely useful to consider the functors A-Set preserving limits of that type; the correct substitute is the class of functors that are suitably “flat”. The notion of flatness appropriate here will be called nondegeneracy. (This is unrelated to the usage of “nondegenerate” in §1.) Definition 3.2. Let Abe a small category. A functor X:A-Set is nondegenerate if E(X) has the following diagram-completion properties: · · ......... - · - · - ......... - ·.......... -·- -·
THE EULER CHARACTERISTIC OF A CATEGORY 21 Explicitly, this means that (a) given arrows af -b f0 a0in Aand x∈X(a), x0∈X(a0) satisfying (X(f))(x)=(X(f0))(x0), there exist arrows agcg0 - a0and z∈X(c) satisfying fg =f0g0, (X(g))(z) = x, and (X(g0))(z) = x0, and (b) given arrows af - f0 -bin Aand x∈X(a) satisfying (X(f))(x) = (X(f0))(x), there exist cg -aand z∈X(c) satisfying fg =f0g and (X(g))(z) = x. This is the most concrete form of the definition. For further explanation, see the Appendix; for references, see [Ln]. In the Appendix (Lemma 5.2) it is shown that under suitable hypotheses, nondegeneracy is equivalent to familial representability, and from this we deduce a more applicable form of Proposition 3.1: Theorem 3.3. Let Abe a finite Cauchy-complete category and k•a weighting on A. If X:A-Set is finite and nondegenerate then |lim −→ X|= Paka|X(a)|. Using the fact that lim −→ Xis the set of connected-components of E(X), this may be rephrased as |π0(E(X))|=Pka|X(a)|. On the other hand, Proposition 2.8 implies that χ(E(X)) = Pka|X(a)|. Indeed, under the hypotheses of the Theorem, Xis familially representable, so each connectedcomponent of E(X) has an initial object, so χ(E(X)) = |π0(E(X))|. Examples 3.4. (a) Let Lbe the category of 1.11(a). A functor X:L-Set is nondegenerate if and only if both functions X(a)-X(bi) are injective. In that case, Theorem 3.3 says that |X(b1) +X(a)X(b2)|=|X(b1)|+|X(b2)|−|X(a)| where the set on the left-hand side is a pushout. (b) Let Bbe the category af - g -b. A functor X:B-Set is nondegenerate if and only if the two functions X(f), X(g) are injective and have disjoint images. The unique weighting k•on Bis (ka, kb) = (−1,1), and |(X(b))/∼ | =|X(b)|−|X(a)| where ∼is the equivalence relation generated by (X(f))(x)∼ (X(g))(x) for all x∈X(a).
22 TOM LEINSTER (c) Let Gbe a group. A functor X:G-Set is a set Sequipped with a left G-action; the functor is nondegenerate if and only if the action is free. Theorem 3.3 then says that the number of orbits is |S|/|G|. (d) The Theorem can be viewed as a generalized inclusion-exclusion principle. (Compare [R].) Let n≥0 and let Pnbe the poset of nonempty subsets of {1, . . . , n}, ordered by inclusion. (So Pop 2is the category Lof (a).) Its unique coweighting k•is defined by kJ= (−1)|J|−1. Given subsets S1, . . . , Snof some set, there is a nondegenerate functor X:Pop n-Set defined on objects by X(J) = Tj∈JSjand on maps by inclusion. Theorem 3.3 gives the inclusion-exclusion formula, |S1∪ · · · ∪ Sn|=X ∅6=J⊆{1,...,n} (−1)|J|−1\ j∈J Sj. Corollary 3.5. Let Abe a finite Cauchy-complete category admitting a weighting. Let X, Y :A-Set be finite nondegenerate functors satisfying |X(a)|=|Y(a)|for all a∈A. Then |lim −→ X|=|lim −→ Y|. The condition that Aadmits a weighting cannot be dropped: consider the category Aof Example 1.11(d) and the functors X=A(a1,−) + A(a4,−), Y=A(a2,−). If Anot only has a weighting but admits M¨obius inversion then a sharper statement can be made (Proposition 1.8). 4. Relations with Rota’s theory In 1964, Gian-Carlo Rota published his seminal paper [R] on M¨obius inversion in posets. The name is motivated as follows: in the poset of positive integers ordered by divisibility, µ(a, b) = µ(b/a) whenever adivides b, where the µon the right-hand side is the classical M¨obius function. He was not the first to define M¨obius inversion in posets—Weisner, Hall, and Ward preceded him—but Rota’s contribution was the decisive one; in particular, he realized the power of the method in enumerative combinatorics. The history of M¨obius inversion is well described in [R], [G] and [St]. In this section we discover that some of the principal results in Rota’s theory are the order-theoretic shadows of more general categorical facts. We also examine briefly a different generalization of M¨obius–Rota inversion, proposed by other authors. Given a poset A, Rota considered its incidence algebra I(A), which is the subring of R(A) consisting of the integer-valued θ∈R(A) such that θ(a, b) = 0 whenever a6≤ b. By Example 1.2(a) or Corollary 1.5, µ∈I(A).
THE EULER CHARACTERISTIC OF A CATEGORY 23 In posets, then, ζ(a, b) = 0 =⇒µ(a, b) = 0. More generally: Theorem 4.1. If Ais a finite category with M¨obius inversion then, for a, b ∈A, ζ(a, b) = 0 =⇒µ(a, b)=0. The proof uses a combinatorial lemma. Lemma 4.2. Let n≥2and σ∈Sn−1. Then there exist k≥1and p0, . . . , pksuch that p0= 1, p1, . . . , pk−1∈ {1, . . . , n −1}, pk=n, and pr=σ(pr−1)+1for each r∈ {1, . . . , k}. Proof. Suppose not; then there is an infinite sequence (pr)r≥0of elements of {1, . . . , n −1}satisfying p0= 1 and pr=σ(pr−1) + 1 for all r≥1. Let εbe the endomorphism of the finite set {pr|r≥0}defined by ε(p) = σ(p) + 1. Then εis injective but not surjective (since 1 is not in its image), contradicting finiteness. Proof of Theorem 4.1 Write the objects of Aas a1, . . . , an. There is an n×nmatrix Zdefined by Zij =ζ(ai, aj), and Zis invertible over Qwith (Z−1)ij =µ(ai, aj). Suppose that i, j ∈ {1, . . . , n}and Zij = 0. Certainly i6=j, so n≥2 and we may assume that (i, j) = (1, n). By the standard formula for the inverse of a matrix, our task is to prove that the (n, 1)-minor of Zis 0. The (n, 1)-minor of Zis X σ∈Sn−1 ±Z1,σ(1)+1 · · · Zn−1,σ(n−1)+1, and in fact we will prove that each summand is 0. Indeed, let σ∈Sn−1. Take p0, .. . , pkas in the Lemma. By hypothesis, there is no map a1- anin A. Categories have composition, so there is no diagram a1=ap0 -ap1 -· · · -apk=an in A. Hence ζ(apr−1, apr) = 0 for some r∈ {1, . . . , k}, giving Zpr−1,σ(pr−1)+1 = 0, as required. Given objects a, c of a category A, let Aa,c be the full subcategory consisting of those b∈Afor which there exist arrows a-b-c. Theorem 4.1 easily implies: Corollary 4.3. Let Abe a finite category. Then Ahas M¨obius inversion if and only if Aa,c has M¨obius inversion for all a, c ∈A, and in that case the M¨obius function of Aa,c is the restriction of that of A.
24 TOM LEINSTER These results suggest a way of relaxing the finiteness assumption on our categories. It extends to categories the local finiteness condition on posets used in the Rota theory. Let Abe a category for which each subcategory Aa,c is finite. Then each hom-set A(a, b) has finite cardinality, ζ(a, b), and there is a Q-algebra ˆ R(A) = {θ: ob A×ob A-Q|for a, b ∈A,ζ(a, b) = 0 =⇒θ(a, b)=0} with operations defined as for R(A). Evidently ζ∈ˆ R(A), and Amay be said to have M¨obius inversion if ζhas an inverse µin ˆ R(A). By Theorem 4.1, this extends the definition for finite categories. For example, the skeletal category Dinj of finite totally ordered sets and order-preserving injections has M¨obius inversion; compare Example 1.2(c). The main theorem in Rota’s paper [R] relates the M¨obius functions of two posets linked by a Galois connection. Viewing a poset as a special category, a Galois connection is nothing but a (contravariant) adjunction, and Rota’s theorem is a special case of the following result. Proposition 4.4. Let Aand Bbe finite categories with M¨obius inversion. Let A F - G Bbe an adjunction, FaG. Then for all a∈A,b∈B, X a0:F(a0)=b µ(a, a0) = X b0:G(b0)=a µ(b0, b). Proof. Write ζ(a, b) = ζ(F(a), b) = ζ(a, G(b)). Then for all a∈A,b∈B, X a0:F a0=b µ(a, a0) = X a0∈A µ(a, a0)δ(F(a0), b) =X a0∈A, b0∈B µ(a, a0)ζ(a0, b0)µ(b0, b). The result follows by symmetry. For example, when lis an element of a finite lattice L, the inclusion of the sub-poset {x∈L|x≤l}into Lhas right adjoint (− ∧ l), giving Weisner’s Theorem (p.351 of [R]). The Euler characteristic of posets has been studied extensively; see [St] for references. Given a finite poset A, the classifying space BA always has Euler characteristic, which by Proposition 2.11 is equal to the Euler characteristic of the category A. On the other hand, we may form a new poset e Aby adjoining to Aa least element 0 and a greatest element 1, and then χ(A) = µe A(0,1)+1: see [R] or §3.8 of [St]. This result can be extended from posets to categories:
THE EULER CHARACTERISTIC OF A CATEGORY 25 Proposition 4.5. Let Abe a finite category. Write e Afor the category obtained from Aby freely adjoining an initial object 0and a terminal object 1. If Ahas M¨obius inversion then e Adoes too, and χ(A) = µe A(0,1)+1. Proof. Suppose that Ahas M¨obius inversion. Let A0be the category obtained from Aby freely adjoining an initial object 0. Extend µ∈R(A) to a function µ∈R(A0) by defining µ(0, b) = −X a∈A µ(a, b), µ(a, 0) = 0, µ(0,0) = 1 (b, a ∈A). It is easily checked that this is the M¨obius function of A0. Dually, if Bis a finite category with M¨obius inversion then the category B1obtained from Bby freely adjoining a terminal object 1 also has M¨obius inversion, with µ(c, 1) = −Pb∈Bµ(c, b) for all c∈B. Take B=A0: then A01 =e Ahas M¨obius inversion, and µ(0,1) = −X b∈A0 µ(0, b) =−X b∈A µ(0, b)−µ(0,0) =X a,b∈A µ(a, b)−1 =χ(A)−1. Remark. Given categories B,Aand a functor M:Bop ×A-Set, the collage of Mis the category Cformed by taking the disjoint union of Band Aand adjoining one arrow b-afor each b∈B,a∈Aand m∈M(b, a), with composition defined using M[CKW]. Assuming finiteness, if Band A have M¨obius inversion then so does C: µC(b, b0) = µB(b, b0), µC(a, a0) = µA(a, a0), µC(a, b) = 0, µC(b, a) = −X b0,a0 µB(b, b0)|M(b0, a0)|µA(a0, a) (b, b0∈B,a, a0∈A). In the proof above, the calculation of the M¨obius function of A0is the special case where Bis the terminal category and M has constant value 1. The ordinal sum of posets is another special case. Moreover, one easily deduces a formula for the Euler characteristic of a collage, which in the special case of posets is essentially Theorem 3.1 of Walker [Wk].