The homotopy cardinality or $\infty$-groupoid cardinality of a (sufficiently “finite”) space or ∞-groupoid $X$ is an invariant of $X$ (a value assigned to its equivalence class) that generalizes the cardinality of a set (a 0-truncated $\infty$-groupoid).
Specifically, whereas cardinality counts elements in a set, the homotopy cardinality counts objects up to equivalences, up to 2-equivalences, up to 3-equivalence, and so on.
This is closely related to the notion of Euler characteristic of a space or $\infty$-groupoid. See there for more details.
The cardinality of a groupoid $X$ is the real number
where the sum is over isomorphism classes of objects of $X$ and $|Aut(x)|$ is the cardinality of the automorphism group of an object $x$ in $X$.
If this sum diverges, we say $|X| = \infty$. If the sum converges, we say $X$ is tame. (See at homotopy type with finite homotopy groups).
This is the special case of a more general definition:
The groupoid cardinality of an ∞-groupoid $X$ – equivalently the Euler characteristic of a topological space $X$ (that’s the same, due to the homotopy hypothesis) – is, if it converges, the alternating product of cardinalities of the (simplicial) homotopy groups
This corresponds to what is referred to as the total homotopy order of a space, introduced by Quinn in notes in 1995 on TQFTs (see reference list).
Let $X$ be a discrete groupoid on a finite set $S$ with $n$ elements. Then the groupoid cardinality of $X$ is just the ordinary cardinality of the set $S$
Let $\mathbf{B}G$ be the delooping of a finite group $G$ with $k$ elements. Then
More generally, for an action of $G$ on a set $X$, then the cardinality of the action groupoid $X//G$ is $\frac{\vert X\vert} {\vert G \vert}$. This is traditionally sometimes called the class formula.
Let $A$ be an abelian group with $k$ elements. Then we can deloop arbitrarily often and obtain the Eilenberg–Mac Lane objects $\mathbf{B}^n A$ for all $n \in \mathbb{N}$. (Under the Dold–Kan correspondence $\mathbf{B}^n A$ is the chain complex $A[n]$ (or $A[-n]$ depending on notational convention) that is concentrated in degree $n$, where it is the group $A$). Then
Let $E = core(FinSet)$ be the groupoid of finite sets and bijections – the core of FinSet. Its groupoid cardinality is the Euler number
Let $E=(E_i)$ be a finite crossed complex, (i.e., an omega-groupoid; see the work of Brown and Higgins) such that for any object $v \in E_0$ of $E$ the cardinality of the set of $i$-cells with source $v$ is independent of the vertex $v$. Then the groupoid cardinality of $E$ can be calculated as $|E|=\displaystyle{\prod_{i} \#(E_i)^{(-1)^i}}$, much like a usual Euler characteristic. For the case when $F$ is a totally free crossed complex, this gives a very neat formula for the groupoid cardinality of the internal hom $HOM(F,E)$, in the category of omega-groupoids. Therefore the groupoid cardinality of the function spaces (represented themselves by internal homs) can easily be dealt with if the underlying target space is represented by a omega-groupoid, i.e., has trivial Whitehead products. (This is explored in the papers by Faria Martins and Porter mentioned in the reference list, below.)
for $G$ a suitable algebraic group, for $\Sigma$ a suitable algebraic curve, and for $q$ a prime number, then the groupoid cardinality of the $\mathbb{F}_q$-points of the moduli stack of G-principal bundles over $X$, $Bun_G(X)$ is the subject of the Weil conjectures on Tamagawa numbers?.
John Baez, Alexander Hoffnung, Christopher Walker, Groupoidification Made Easy (web pdf, blog); Higher-dimensional algebra VII: Groupoidification, arxiv/0908.4305
John Baez, James Dolan, From Finite Sets to Feynman Diagrams (arXiv)
João Faria Martins, On the homotopy type and the fundamental crossed complex of the skeletal filtration of a CW-complex (web pdf )
João Faria Martins, Tim Porter, On Yetter’s Invariant and an Extension of the Dijkgraaf-Witten Invariant to Categorical Groups, (web pdf)
Tom Leinster, The Euler characteristic of a category (arXiv, TWF, blog, blog)
Kazunori Noguchi, The Euler characteristic of infinite acyclic categories with filtrations, arxiv/1004.2547
Frank Quinn, 1995, Lectures on axiomatic topological quantum field theory , in D. Freed and K. Uhlenbeck, eds., Geometry and Quantum Field Theory , volume 1 of IAS/Park City Mathematics Series , AMS/IAS.