2 edited body

Here are a couple of answers to your wider question.

1) Tom Leinster defined the notion of Euler characteristic for a finite categories, generalizing things like cardinality of sets, Euler characteristic of posets and Euler characteristic of finite groups. This can be generalized to enriched categories and specialized to metric spaces, giving rise to an (occasionally undefined) invariant of metric spaces called the magnitude. (The names cardinality and Euler characteristic were deemed to be too confusing.) Interestingly, this was discovered in the nineties by some ecologists interested in measuring biodiversity. See our paper [http://arxiv.org/abs/0908.1582](On the asymptotic magnitude of subsets of Euclidean space) for more details.

2) Given an endofunctor F:*C*->C of a category enriched over V there are two ways of taking the 'trace' of F that I know of, both leading to an object of V. One is the end $\int_c C(c,F(c))$ and the other is the coend $\int^c C(c,F(c))$. In the context of metric spaces this means that for a distance non-decreasing non-increasing function f:*X*->X the two traces are supxd(x,f(x)) and infxd(x,f(x)) - which can be thought of as the furthest distance that f moves points and the least distance that f moves points.

1

Here are a couple of answers to your wider question.

1) Tom Leinster defined the notion of Euler characteristic for a finite categories, generalizing things like cardinality of sets, Euler characteristic of posets and Euler characteristic of finite groups. This can be generalized to enriched categories and specialized to metric spaces, giving rise to an (occasionally undefined) invariant of metric spaces called the magnitude. (The names cardinality and Euler characteristic were deemed to be too confusing.) Interestingly, this was discovered in the nineties by some ecologists interested in measuring biodiversity. See our paper [http://arxiv.org/abs/0908.1582](On the asymptotic magnitude of subsets of Euclidean space) for more details.

2) Given an endofunctor F:*C*->C of a category enriched over V there are two ways of taking the 'trace' of F that I know of, both leading to an object of V. One is the end $\int_c C(c,F(c))$ and the other is the coend $\int^c C(c,F(c))$. In the context of metric spaces this means that for a distance non-decreasing function f:*X*->X the two traces are supxd(x,f(x)) and infxd(x,f(x)) - which can be thought of as the furthest distance that f moves points and the least distance that f moves points.