arbitrary Shimura variety is a product of automorphic $L$-functions. This formula is deduced from the following formula, via the machinery of stabilization of the trace formula.

\[thm\_intro:Kottwitz\_formula\] For any $f^p$ in the Hecke algebra $\mathcal{H}(G({\mathbb A}_f^p)/\!\!/ K^p)$, there exists $m(f^p)\in{\mathbb N}$, depending on $f^p$, such that for each $m\geq m(f^p)$, the Lefschetz number of $\Phi^m\times f^p$ is given by $$\begin{aligned}
 \label{eq_intro:Kottwitz_formula}
\sum_{i}(-1)^i\mathrm{tr}( & \Phi^m\times f^p | H^i_c(Sh_{K}(G,X)_{{\overline{\mathbb Q}}},{\mathscr{F}}_K)) \\
& = \sum_{(\gamma_0;\gamma,\delta)} c(\gamma_0;\gamma,\delta)\cdot \mathrm{O}_{\gamma}(f^p)\cdot \mathrm{TO}_{\delta}(\phi_p) \cdot \mathrm{tr}\xi(\gamma_0), \nonumber\end{aligned}$$ where the sum is over a set of representatives $(\gamma_0;\gamma,\delta)$ of *all* equivalence classes of *stable* Kottwitz triples of level $n$ having trivial Kottwitz invariant and $c(\gamma_0;\gamma,\delta)$ is a certain constant (defined in terms of Galois cohomology). Moreover, if $G^{{\mathrm{ad}}}$ is ${\mathbb Q}$-anisotropic or $f^p$ is the identity, we can take $m(f^p)$ to be $1$.

See Thm. \[thm:Kottwitz\_formula:Kisin\] for a precise description of the terms involved and more details. We emphasize that in both theorems, we do *not* assume that the derived group $G^{{\mathrm{der}}}$ of $G$ is simply connected. In such case that $G^{{\mathrm{der}}}=G^{{\mathrm{sc}}}$, $G^{{\mathrm{sc}}}$ being the simply connected cover of $G^{{\mathrm{der}}}$, the expression on the right-hand side of (\[eq\_intro:Kottwitz\_formula\]) equals the one in the Kottwitz’s conjecture [@Kottwitz90 (3.1)]. Regarding this generality, 