# Behrend's trace formula

In algebraic geometry, Behrend's trace formula is a generalization of the Grothendieck–Lefschetz trace formula to a smooth algebraic stack over a finite field conjectured in 1993 and proven in 2003 by Kai Behrend. Unlike the classical one, the formula counts points in the "stacky way"; it takes into account the presence of nontrivial automorphisms.
The desire for the formula comes from the fact that it applies to the moduli stack of principal bundles on a curve over a finite field (in some instances indirectly, via the Harder–Narasimhan stratification, as the moduli stack is not of finite type.) See the moduli stack of principal bundles and references therein for the precise formulation in this case.
Pierre Deligne found an example that shows the formula may be interpreted as a sort of the Selberg trace formula.
A proof of the formula in the context of the six operations formalism developed by Yves Laszlo and Martin Olsson is given by Shenghao Sun.

## Formulation

By definition, if C is a category in which each object has finitely many automorphisms, the number of points in $C$ is denoted by
    $\#C=\sum _{p}{1 \over \#\operatorname {Aut} (p)},$
with the sum running over representatives p of all isomorphism classes in C. (The series may diverge in general.) The formula states: for a smooth algebraic stack X of finite type over a finite field $\mathbb {F} _{q}$ and the "arithmetic" Frobenius $\phi ^{-1}:X\to X$, i.e., the inverse of the usual geometric Frobenius $\phi$ in Grothendieck's formula,
    $\#X(\mathbb {F} _{q})=q^{\dim X}\sum _{i=0}^{\infty }(-1)^{i}\operatorname {tr} \left(\phi ^{-1};H^{i}(X,\mathbb {Q} _{l})\right).$
Here, it is crucial that the cohomology of a stack is with respect to the smooth topology (not etale).
When X is a variety, the smooth cohomology is the same as etale one and, via the Poincaré duality, this is equivalent to Grothendieck's trace formula. (But the proof of Behrend's trace formula relies on Grothendieck's formula, so this does not subsume Grothendieck's.)

## Simple example

Consider $B\mathbb {G} _{m}=[\operatorname {Spec} \mathbb {F} _{q}/\mathbb {G} _{m}]$, the classifying stack of the multiplicative group scheme (that is, $\mathbb {G} _{m}(R)=R^{\times }$). By definition, $B\mathbb {G} _{m}(\mathbb {F} _{q})$ is the category of principal $\mathbb {G} _{m}$-bundles over $\operatorname {Spec} \mathbb {F} _{q}$, which has only one isomorphism class (since all such bundles are trivial by Lang's theorem). Its group of automorphisms is $\mathbb {G} _{m}$, which means that the number of $\mathbb {F} _{q}$-isomorphisms is $\#\mathbb {G} _{m}(\mathbb {F} _{q})=\#\mathbb {F} _{q}^{\times }=q-1$.
On the other hand, we may compute the l-adic cohomology of $B\mathbb {G} _{m}$ directly. We remark that in the topological setting, we have $B\mathbb {C} ^{\times }\cong \mathbb {CP} ^{\infty }$ (where $B\mathbb {C} ^{\times }$ now denotes the usual classifying space of a topological group), whose rational cohomology ring is a polynomial ring in one generator (Borel's theorem), but we shall not use this directly. If we wish to stay in the world of algebraic geometry, we may instead "approximate" $B\mathbb {G} _{m}$ by projective spaces of larger and larger dimension. Thus we consider the map $B\mathbb {G} _{m}\to \mathbb {P} ^{N}$ induced by the $\mathbb {G} _{m}$-bundle corresponding to ${\mathcal {O}}(1).$ This map induces an isomorphism in cohomology in degrees up to 2N. Thus the even (resp. odd) Betti numbers of $B\mathbb {G} _{m}$ are 1 (resp. 0), and the l-adic Galois representation on the (2n)th cohomology group is the nth power of the cyclotomic character. The second part is a consequence of the fact that the cohomology of $\mathbb {P} ^{N}$ is generated by algebraic cycle classes. This shows that
    $\sum _{i\geq 0}(-1)^{i}\operatorname {tr} \left(\phi ^{-1};H^{i}(B\mathbb {G} _{m},\mathbb {Q} _{l})\right)=1+{\frac {1}{q}}+{\frac {1}{q^{2}}}+\cdots ={\frac {q}{q-1}}.$
Note that
    $\dim B\mathbb {G} _{m}=\dim \operatorname {Spec} \mathbb {F} _{q}-\dim \mathbb {G} _{m}=-1.$
Multiplying by $q^{-1}$, one obtains the predicted equality.