We express the Frobenius–Hecke traces on the compactly supported cohomology of a Shimura variety of abelian type in terms of  elliptic parts of stable Arthur–Selberg trace formulas for the endoscopic groups. This confirms predictions of Langlands and Kottwitz at primes where the level is hyperspecial.

§ INTRODUCTION

§.§ The main results

Shimura varieties have provided a testing ground for many conjectures in the Langlands Program, and have been indispensable in the (partial) solutions of some of these conjectures. Motivated by the work of Eichler, Shimura, Kuga, Sato, and Ihara, Langlands formulated the problem of expressing the Hasse–Weil zeta function of a Shimura variety in terms of automorphic $L$-functions.
This question is itself a special case of Langlands' conjecture that all motivic $L$-functions are automorphic.

In a series of papers [77, 78, 79, 80, 81], Langlands developed the idea of systematically using trace formulas to attack this problem. In his initial investigations, he encountered the phenomenon of $L$-indistinguishability, which motivated the theory of endoscopy. Based on the latter, Langlands predicted that one should be able to compare a  Lefschetz-type trace formula for the Shimura variety with trace formulas arising in the theory of automorphic representations after stabilizing both types of the formulas. This prediction was formulated as a precise conjecture in Kottwitz's paper [65].

The main result of the present paper is a verification of this conjecture for Shimura varieties of abelian type: We prove an identity between a Grothendieck–Lefschetz–Verdier trace formula on the Shimura variety and elliptic parts of stable Arthur–Selberg trace formulas for the endoscopic groups.

To state our main result more precisely, we fix some notation. Let $(G,X)$ be a Shimura datum with reflex field $E$. Fix a prime $\ell$, and let $\xi$ be an algebraic representation of $G$ over $\ol \QQ_{\ell}$. Let

$$\coh^i_c (\Sh, \xi): = \varinjlim_K \coh^i_c(\Sh_K(G,X)_{\overline E}, \mL_{\xi}),$$

where $K$ runs through all sufficiently small compact open subgroups of $G(\A_f)$, and for each $K$ we denote by $\Sh_K(G,X)$ the Shimura variety at level $K$, and by $\mL_{\xi}$ the automorphic $\ell$-adic sheaf attached to $\xi$. (We need a technical assumption on $\xi$ so that $\mL_{\xi}$ is well defined, but we omit this here. In the introduction the reader can assume $\xi$ is trivial and $\mL_\xi = \ol \QQ_{\ell}$.)  Then $\coh^i_c(\Sh, \xi)$ admits commuting actions by $\Gal(\overline E/E)$ and $G(\A_f)$.

Let $p\neq \ell$ be a prime, and let $\Phi \in \Gal(\ol E/E)$ be a geometric Frobenius element at a place $\fkp$ of $E$ above $p$. Let $f$ be an element of the Hecke algebra of $G(\A_f)$. We always assume that $f$ is of the form $1_{K_p}f^p$, where $f^p$ is in the Hecke algebra of $G(\A_f^p)$ and $1_{K_p}$ is the characteristic function of a hyperspecial subgroup $K_p \subset G(\Q_p)$. (When $f$ is fixed, this condition is satisfied for almost all primes $p$.) For $m$ an integer we define

$$T(m,f) : =   \sum_i (-1)^i \tr( f \times \Phi^m \mid \coh^i_c(\Sh, \xi)) . $$

Note that if $f$ is the characteristic function of some compact open subgroup $K \subset G(\A_f)$ and $\xi$ is trivial, then $T(m,f)$ is directly related to the Euler factor at $\fkp$ of the Hasse–Weil zeta function of $\Sh_{K} (G,X)$, when $p$ is sufficiently large.

[see Theorem <ref>]
Assume that $(G,X)$ is of abelian type. For all sufficiently large $m$ we have

\begin{align}\label{introeq:STF}
T(m,f) =  \sum_{\fke} \iota(\fke) ST^{H_1}_{\el, \chi_{H_1}}(f^{H_1}) ,
\end{align}

where $\fke$ runs through the elliptic endoscopic data for $G$ up to isomorphism, $\iota(\fke) \in \QQ$ is a constant depending only on $\fke$, and $ST^{H_1}_{\el, \chi_{H_1}}$ is an elliptic stable distribution associated with $\fke$ (defined on a $z$-extension $H_1$ of the endoscopic group in $\fke$).

If the derived subgroup $G_{\der}$ of $G$ is simply connected and the center $Z_G$ of $G$ is cuspidal (i.e., having equal $\QQ$-rank and $\RR$-rank), then $ST^{H_1}_{\el, \chi_{H_1}}$ is the elliptic part of the stable trace formula for $\fke$. Without these assumptions, the definition involves $z$-extensions and fixed central characters. The functions $f^{H_1}$ will be explained after we state Theorem <ref> below. The requirement that $m$ is sufficiently large is needed to ensure that the local terms in the Grothendieck–Lefschetz–Verdier trace formula can be calculated naively; this is a special case of Deligne's conjecture, which has been proved in general by Fujiwara [33]  and Varshavsky [142]. For applications this restriction turns out to be harmless. Note that by contrast, knowing (<ref>) only for all sufficiently divisible $m$ would be insufficient for most applications.

Kottwitz <cit.> conjectured the equality in Theorem <ref>   for general Shimura varieties, and proved it in the case of PEL type A or C in <cit.> and <cit.>.
By results of Matsushima [98] and Franke [32], the $G(\A_f)$-action on $\coh^i _c(\Sh, \xi )$ can be understood in terms of automorphic representations of $G.$ It is expected that the equality in Theorem <ref> should lead to a description of $\coh^i_c(\Sh, \xi)$, or a variant when the Shimura varieties are non-compact, as a $\Gal(\ol E/E)\times G(\A_f)$-module. This description should involve the global Langlands correspondence between automorphic representations and Galois representations, as well as Arthur's conjectures on automorphic multiplicities. This would lead to an expression of the Hasse–Weil zeta function in terms of automorphic $L$-functions. See <cit.> for an explanation of this circle of ideas. In the non-compact case one expects that replacing $\coh^i _c(\Sh, \xi )$ by the intersection cohomology of the Baily–Borel compactification will lead to a description similar to the compact case. We do not prove this variant of Theorem <ref> for intersection cohomology in the present paper, but Theorem <ref> and the point counting formula in Theorem <ref> below are expected to play a crucial role in the proof of such a result; see for instance [108, 109, 153].

The proof of Theorem <ref> consists of two steps. The first step is to prove a “point counting formula”, expressing $T(m,f)$ in terms of orbital integrals and twisted orbital integrals on $G$ in a way resembling the geometric side of the Arthur–Selberg trace formula. The second step is stabilization, which relates the (twisted) orbital integrals on $G$ with the terms constituting $  ST^{H_1}_{\el, \chi_{H_1}}(f^{H_1})$.

When $G_{\der}$ is simply connected and $Z_G$ is cuspidal, the point counting formula was already conjectured by Kottwitz
<cit.>. Let $q = p^r$ be the cardinality of the residue field of $\fkp$. For $m$ sufficiently large, the conjecture states that

\begin{multline}\label{eq:intro point counting}
T(m,f) =  \\  \sum_{\substack{(\gamma_0,\gamma,\delta) \in \KP_{\clsc}(q^{m})/{\sim},\\ \alpha(\gamma_0,\gamma,\delta) =0}} c_1(\gamma_0,\gamma,\delta) c_2(\gamma_0) O_{\gamma}(f^p) TO_{\delta}(\phi_{mr}) \tr\xi(\gamma_0).
\end{multline}
Here $\KP_{\clsc}(q^m)$ consists of  triples $(\gamma_0,\gamma, \delta)\in G (\Q) \times G(\A_f^p) \times G(\Q_{q^m})$  such that $\gamma_0$ is $\RR$-elliptic, stably conjugate to $\gamma$, and stably conjugate to the degree $mr$ norm of $\delta$. There is also a technical assumption on $\delta$ which we omit here. (The notation $\KP_{\clsc}$ stands for “classical Kottwitz parameters”.) The equivalence relation $\sim$ is given by stable conjugacy on the first factor, conjugacy on the second factor, and $\sigma$-conjugacy on the third factor.  Kottwitz defines a Galois cohomological invariant $\alpha(\gamma_0,\gamma,\delta)$ for each $(\gamma_0,\gamma,\delta) \in \KP_{\clsc}(q^m)$, and in (<ref>) the summation is subject to the condition  $\alpha (\gamma_0,\gamma,\delta)=0$. In each summand, we have an orbital integral $O_{\gamma}(f^p)$ on $G(\A_f^p)$, a twisted orbital integral $TO_{\delta}(\phi_{mr})$ on $G(\Q_{q^m})$ (where $\phi_{mr}$ is an explicit function on $G(\Q_{q^m})$), the character $\tr \xi $ of $\xi$ evaluated at $\gamma_0$, a volume term $c_1(\gamma_0,\gamma,\delta)$, and a term $c_2(\gamma_0)$ defined via Galois cohomology.

In the conjectural formula (<ref>), the assumption that $G_{\der}$ is simply connected is quite serious. Without it, Kottwitz's construction of the invariant $\alpha(\gamma_0,\gamma,\delta)$ for $(\gamma_0,\gamma,\delta) \in \KP_{\clsc}(q^m)$ no longer works, and also the volume term $c_1(\gamma_0,\gamma,\delta)$ is not well defined. These problems are caused by the possible disconnectedness of $G_{\gamma_0}$ for a semi-simple $\gamma_0 \in G(\QQ)$. In the following theorem, the point counting formula we prove is a generalization of (<ref>) without any assumptions on $G_{\der}$ and $Z_G$.
[see Theorem <ref>]
If $(G,X)$ is of abelian type, then for all sufficiently large $m$ we have
\begin{multline}
\label{eq:intro refined point counting}	 T(m,f) \\ = 	\sum_{\gamma_0 \in \Sigma} \sum_{\substack{\fkc \in \KP(\gamma_0, q^m) \\ \alpha(\fkc) = 0 }} \abs{(G_{\gamma_0}/G_{\gamma_0}^0)(\Q)}^{-1} c_1(\fkc) c_2(\gamma_0) O_{\fkc}(f^p) TO_{\fkc}(\phi_{mr}) \tr\xi (\gamma_0),
\end{multline}

where the terms $c_1(\fkc), c_2(\gamma_0), O_{\fkc}(f^p), TO_{\fkc}(\phi_{mr})$ are defined analogously as the terms in (<ref>).

The most significant new feature of (<ref>) is that the summation index set $\KP_{\clsc} (q^m)/{\sim}$ in (<ref>) has been replaced by a more refined set
$$\coprod_{\gamma_0 \in \Sigma} \KP(\gamma_0, q^m)$$
which admits a map to the former. Here $\Sigma$ is a certain subset of the set of $\RR$-elliptic elements of $G(\QQ)$, and for each $\gamma_0 \in \Sigma$ the definition of $\KP(\gamma_0, q^m)$ is Galois cohomological in nature. (We also allow $Z_G$ to be non-cuspidal, in which case $\Sigma$ depends on the choice of a compact open subgroup $K^p \subset G(\A_f^p)$ such that $f^p$ is $K^p$-bi-invariant.) For each $\fkc \in \KP(\gamma_0, q^m)$, we define an invariant $\alpha(\fkc)$ lying in an abelian group that depends only on $G_{\gamma_0}^0$ and $G$. This definition specializes to Kottwitz's invariant $\alpha(\gamma_0,\gamma,\delta)$ when $G_{\der}$ is simply connected. In (<ref>) the condition $\alpha (\fkc)=0$ is imposed, similarly
as in (<ref>).

Once Theorem <ref> is proved, in order to prove Theorem <ref> we need to stabilize the right hand side of (<ref>). We prove this stabilization in general as in the next theorem, without assuming that $(G,X)$ is of abelian type.
[see Theorem <ref>]
The right hand side of (<ref>) is equal to
$$ \sum_{\fke} \iota(\fke) ST^{H_1}_{\el, \chi_{H_1}}(f^{H_1}). $$

Theorem <ref> is immediate from Theorems <ref> and <ref>.
The proof of Theorem <ref> follows the outline of <cit.>. Namely, after applying a Fourier transform on the finite abelian group of which $\alpha(\fkc)$ is a character, we can turn the right hand side of (<ref>)  into the sum of $\kappa$-orbital integrals (twisted at $p$) over adelic conjugacy classes. To rewrite the sum in terms of stable distributions on endoscopic groups, the key input is the transfer of orbital integrals via the Kottwitz–Langlands–Shelstad transfer and the fundamental lemma. More precisely, $f^{H_1}$ away from $\{p,\infty\}$ is obtained from $f^p$ via the usual untwisted transfer, whereas $f^{H_1}$ at $p$ is a twisted transfer of $\phi_{mr}$, and $f^{H_1}$ at $\infty$ is constructed explicitly as a finite linear combination of certain stably cuspidal functions.

We carry out the stabilization without the simplifying hypotheses in <cit.> that $G_{\der}$ is simply connected and that $Z_G$ is cuspidal, by working systematically with $z$-extensions and fixed central characters. Here a useful fact is that once a $z$-extension $G_1$ of $G$ is fixed, it induces $z$-extensions $H_1$ of endoscopic groups $H$ for $G$. To transfer functions with fixed central characters (thus the functions are not compactly supported in general), the main point is that the transfer factors enjoy an equivariance property with respect to the translation by central elements. It is also worth mentioning the improvement that, unlike <cit.>, Theorem <ref> has no $(G,H)$-regularity condition imposed in the stable distributions. The reason is that there is no contribution coming from the non-$(G,H)$-regular semisimple terms, as shown by Morel (<ref> and Lemma <ref> below).

§.§ Applications

Theorem <ref>, or its proof (Theorem <ref>), has already been used to obtain the following results.

* With Kret, one of us (Shin) has constructed the automorphic to Galois direction of the Langlands correspondence for
$\textup{GSp}_{2n}$ and (a form of) $\textup{GSO}_{2n}$ over totally real fields, under a technical local hypothesis
[73, 74]. This involves constructing Galois representations into $\textup{GSpin}$ groups,
cf. <cit.>.

* One of us (Zhu) has given a description of the Hasse–Weil zeta function and the Hecke–Galois action on the intersection cohomology of the Baily–Borel compactification of Shimura varieties for some global forms of $\textup{SO}(N,2)$ in terms of automorphic representations [153]. This completes the Langlands–Kottwitz program for these varieties at almost all primes.

* Youcis [151] has extended Scholze's version [122] of the Langlands–Kottwitz method for Shimura varieties
with bad reduction from the case of PEL type to the case of abelian type.

* Mack-Crane [99] has obtained a trace formula for Igusa varieties of Hodge type which is
analogous to Theorem <ref> in the case of Hodge type. This generalizes [134].
A generalization to the case of abelian type, as well as a stabilization analogous to Theorem <ref> is expected, cf. [135].)

We stress that the Shimura data appearing in concrete applications, as in the first two items, are typically of abelian type but not of Hodge type. The same is true with the three applications below. As we will explain in <ref> below, the proof of Theorem <ref> in the case of Hodge type is substantially easier, but this does not suffice for many applications.

In general,
Theorem <ref> is the key to determining the fundamental virtual $G(\A_f)\times \Gal(\ol E/E)$-module $[\coh_c(\Sh,\xi)]:=\sum_{i} (-1)^i \coh^i_c(\Sh, \xi)$ in terms of automorphic representations. A notable corollary is then to express the Hasse–Weil zeta function of $\Sh_{K}$ as an alternating product of automorphic $L$-functions for sufficiently small compact open subgroups $K\subset G(\A_f)$, possibly up to Euler factors at finitely many primes.
We intend to work out the details in a sequel and obtain unconditional results in various special cases, which will provide important ingredients for some remarkable arithmetic results:

* The Beilinson–Bloch–Kato conjecture for Rankin–Selberg motives using
Shimura varieties of unitary groups [96],

* Higher dimensional Gross–Zagier formula (i.e., arithmetic inner product formula) using
Shimura varieties of unitary groups [89].

* Euler systems arising from Shimura varieties of $\textup{SO}(2n-1,2)$ [21].
Related to the applications in [96, 89],
it is worth pointing out that when one passes between a Shimura datum of abelian type and an “isogenous” Shimura datum of Hodge type, the reflex field is often not preserved. Thus even if one is just interested in constructing representations of $\Gal(\ol E/E)$ using the cohomology of a Shimura variety of a unitary group with reflex field $E$ (which is of abelian type but not of Hodge type), one cannot pass to a Shimura variety of Hodge type without having to enlarge $E$ in general.

To understand the structure of $[\coh_c(\Sh,\xi)]$ in the general case of abelian type, there are two main obstacles to proving an unconditional theorem. Let us briefly address them, leaving the details to <ref> below.

When $G$ is anisotropic modulo center over $\Q$, or equivalently when the finite-level Shimura varieties $\Sh_K(G,X)$ are projective,
the first problem is to show that

in the summand of Theorem <ref>, namely that the non-elliptic terms in the stable distribution cancel each other out. The resolution of this problem is within reach at least in various special cases that are of interest for applications, and this will be treated in the sequel. The second problem is that the endoscopic classification for automorphic representations is not available for general reductive groups.

If $G$ is isotropic modulo center, the second problem remains the same. In place of the first problem, however, it is desirable to promote Theorem <ref> by proving an equality where the compactly supported cohomology and $ST^{H_1}_{\el,\chi_{H_1}}$ are replaced with the intersection cohomology of the Baily–Borel compactification and $ST^{H_1}_{\chi_{H_1}}$, respectively. As mentioned above, such an upgrade is obtained for $\mathrm{SO}(N,2)$ in [153]. Some results were previously known for Shimura varieties of PEL type A and C [92, 107, 108, 109].

Another application of our work would be the analogues of Theorems <ref> and <ref> for Shimura varieties of parahoric level at $p$, in light of recent advances on the Haines–Kottwitz test function conjecture [45, 44] and the Langlands–Rapoport conjecture in the parahoric case [152, 141]. The latter takes as an input the hyperspecial case through the earlier work [53]; a strengthening should be possible by appealing to our improvement (Theorem <ref>) instead.

§.§ Variants of the Langlands–Rapoport Conjecture

We now discuss the proof of Theorem <ref>.
To simplify the exposition we assume that $\xi$ is trivial (so that $\mL_{\xi} = \overline \QQ_{\ell}$), and that $f^p = 1_{K^p}$ for a sufficiently small compact open subgroup $K^p \subset G(\A_f^p)$. We continue to assume that $K_p$ is hyperspecial.
If $\Sh_{K_pK^p}$ is proper over $E,$ then one expects that there exists a proper smooth integral model, $\Shh_{K_pK^p},$
of $\Sh_{K_pK^p}$ over $\oo_{E,(\fkp)}$. In this case we have

\begin{align}\label{eq:intro Lefschetz}
T(m,f)  = \# \Shh_{K_pK^p}(\FF_{q^m}).
\end{align}
If $\Sh_{K_pK^p}$ is not proper, one still conjectures that there exists a canonical smooth integral model $\Shh_{K_pK^p}$ satisfying (<ref>) (among other conditions). Hence in all cases we seek for a formula for $\# \Shh_{K_pK^p}(\FF_{q^m})$, thus the name “point counting formula”.

For Shimura varieties of Hodge type, it is possible to establish a point counting formula by generalizing the considerations of Kottwitz [67] in the PEL-type setting, with the aid of the results from [53]. In this approach one attaches group-theoretic invariants to isogeny classes over a fixed finite field $\FF_{q^m}$; see [87]. It
does not seem to be possible to deduce Theorem <ref> for general Shimura varieties of abelian type from such results in the case of Hodge type. In the current paper, we take the point of view of Langlands–Rapoport [91], which relates $\ol \FF_q$-isogeny classes and certain Galois gerbs. Although the statements we prove in the case of Hodge type require more effort, they have the merit that one can then infer similar statements in the case of abelian type, and hence deduce the point counting formula.

Write $\Shh_{K_p}$ for $\varprojlim_{K^p} \Shh_{K_p K^p}$. The Langlands–Rapoport Conjecture states that there is a $G(\A_f^p)\times \Gal(\overline \FF_{q}/\FF_q)$-equivariant bijection

$$ \Shh_{K_p } (\overline \FF_q) \isom \coprod_{\phi} \varprojlim_{K^p} I_{\phi} (\QQ) \backslash X(\phi)/K^p. $$
Here $\phi$ runs through conjugacy classes of admissible morphisms from a pro-(Galois gerb) $\Qf$ over $\QQ$, called the quasi-motivic gerb, to the neutral gerb associated with $G$. For each admissible morphism $\phi$, we have a  reductive group $I_\phi$ over $\Q$, and a set $X(\phi)$ equipped with commuting actions by $I_\phi(\A_f)$, $\Gal(\overline \FF_q/\FF_q)$, and $G(\A_f^p)$.

Currently, the Langlands–Rapoport Conjecture is open even for the Siegel modular varieties. (For some quaternionic Shimura varieties the conjecture has been proved by Reimann [118].) In [53], a weaker version of the conjecture is proved for the canonical integral models of Shimura varieties of abelian type, which are constructed in [52] for $p>2 $ and in [54] for $p=2$, and are shown to satisfy  (<ref>) in  [95]. (The assumption that $p>2$ in [53] can be dropped; see the proof of Theorem <ref>.) In this weaker version, the set

$$\varprojlim_{K^p} I_{\phi}(\QQ) \backslash X(\phi)/K^p $$
is replaced by

$$\varprojlim_{K^p} I_{\phi}(\QQ)_{\tau(\phi)} \backslash X(\phi)/K^p, $$
where $\tau(\phi)$ is an unspecified element of $I_{\phi}^{\ad}(\A_f)$, and $I_{\phi}(\QQ)_{\tau(\phi)} $ is the image of $I_{\phi}(\QQ)$ under
$$ I_{\phi}(\QQ) \hookrightarrow I_{\phi}(\A_f) \xrightarrow{\Int(\tau(\phi))} I_\phi (\A_f). $$
It turns out that in order to deduce (<ref>) from such a weaker statement, one must have better control of the elements $\tau(\phi)$. We formulate the desiderata in what we call the “Langlands–Rapoport–$\tau$ Conjecture”.

We introduce some definitions in order to state the conjecture. For each admissible morphism $\phi$, we have the algebraic part $\phi^{\Delta}$ of $\phi$, which is a $\Qbar$-homomorphism from a pro-torus $\Qf^{\Delta}$ to $G_{\Qbar}$. The double quotient set
is an abelian group, and up to canonical isomorphism it depends only on the $G(\Qbar)$-conjugacy class of $\phi^{\Delta}$. For each maximal torus $T$ in $I_{\phi}$, write $\cH(\phi)_T$ for the cokernel of the localization map
$$\ker\big(\coh^1(\Q,T) \to \coh^1(\RR,T) \oplus \coh^1_{\ab}(\Q,G)\big) \To  \coh^1(\A_f,T). $$
There is a natural homomorphism

$$ \cH(\phi) \To \cH(\phi)_T,$$
see Definition <ref>.
[“Langlands–Rapoport–$\tau$”; see Conjecture <ref>] There is a  bijection

$$   \Shh_{K_p} (\overline \FF_q) \isom \coprod_{\phi} \varprojlim_{K^p} I_{\phi} (\QQ)_{\tau(\phi)} \backslash X(\phi)/K^p,$$
which is $G(\A_f^p)\times \Gal(\overline \FF_{q}/\FF_q)$-equivariant, with respect to elements $\tau(\phi) \in I_{\phi}^{\ad}(\A_f)$ satisfying the following conditions.

* The image of $\tau(\phi)$ in $\cH(\phi)$ depends only on the $G(\Qbar)$-conjugacy class of $\phi^{\Delta}$.

* For each maximal torus $T$ in $I_{\phi}$, the image of $\tau(\phi)$ in $\cH(\phi)$ lies in the kernel of $\cH(\phi) \to \cH(\phi)_T$.

Note that the original Langlands–Rapoport Conjecture implies Conjecture <ref>, as we can take all $\tau(\phi)$ to be $1$. Also Conjecture <ref> is stronger than the version of Langlands–Rapoport proved in [53], as two non-trivial conditions on $\tau(\phi)$ are imposed.

[see Theorem <ref>]
Conjecture <ref> implies (<ref>).

The proof of Theorem <ref> is group theoretic in nature (and works without the abelian type assumption). Some of the key ingredients come from [60] and <cit.>. If one assumes the original Langlands–Rapoport Conjecture, that $G_{\der}$ is simply connected, and that every admissible morphism factors through the pseudo-motivic gerb, then the proof of (<ref>) is essentially given in loc. cit., as explained in [103]. However, our proof of Theorem <ref> does not logically follow from [91] or [103], as we have the following new features:

* We need to show that the possibly non-trivial elements $\tau(\phi)$ do not affect the desired “point counting” on $\coprod_{\phi} \varprojlim_{K^p} I_{\phi} (\QQ)_{\tau(\phi)} \backslash X(\phi)/K^p$,  as long as they satisfy the two conditions in Conjecture <ref>.

* We use the corrected construction of the quasi-motivic gerb $\Qf$ given by Reimann [118], and do not assume that $G_{\der}$ is simply connected. As a result several definitions and arguments in <cit.> need to be modified. (In the general case of abelian type, it is not enough to work with the pseudo-motivic gerb as is done in [103].)

* We need to work with the more refined set $\coprod_{\gamma_0\in \Sigma} \KP(\gamma_0, q^m)$ as opposed to $\KP_{\clsc}(q^m)/{\sim}$, for the reasons explained below Theorem <ref>.

The logical relations between the various conjectures are depicted in the following diagram. All the implications are valid without the abelian type assumption.

$$ \xymatrix { &   \boxed{\text{weak LR Conj.~as in [53]}} \\ \boxed{\text{LR Conj.}} \ar@{=>}[r]
&  \boxed{ \text{LR--$\tau$ Conj. (Conj.~\ref{introconj:LRtau})}}  \ar@{=>}[u]   \ar@{=>}[d]^{\text{Thm.~\ref{introthm:one conj implies the other}}} \\ &  \boxed{\text{point counting formula (\ref{eq:intro refined point counting})}}
\ar@{=>}[d]^{\text{Thm.~\ref{thm:intro stabilization}}} \\
&  \boxed{\text{stable trace formula (\ref{introeq:STF})}}    }$$

[see Theorem <ref>] If $(G,X)$ is of abelian type, then Conjecture <ref> holds with respect to the canonical integral models.

Theorem <ref> follows from Theorems <ref> and <ref>. In the rest of the introduction we discuss the proof of Theorem <ref>.

§.§ The conjecture in the case of Hodge type

Questions about Shimura varieties of abelian type can often be reduced to the same questions for Shimura varieties of Hodge type, plus some additional information on connected components. For instance, this is what is done in [53]
for the weak form of the Langlands–Rapoport conjecture. In Conjecture <ref>, we have imposed the minimal set of conditions that allow one to deduce the point counting formula (<ref>) from the conjecture (see Theorem <ref>), regardless of the type of the Shimura datum. However,  one may strengthen the conjecture by requiring certain compatibility conditions with connected components. It is this stronger version of Conjecture <ref>
which we prove in the case of Hodge type. We then use this to prove Conjecture <ref> in the general case of abelian type.

We now discuss some key ideas in the proof of Conjecture <ref> for a $(G,X)$ of Hodge type, and indicate the kind of strengthening we obtain. We postpone to <ref> the explanation of how our results in the case of Hodge type imply Conjecture <ref> in the general case of abelian type.

By the theory of integral models in [52], after fixing a suitable embedding of $(G,X)$ into a Siegel Shimura datum, for each $x\in \Shh_{K_p}(\overline \FF_q)$ we obtain an abelian variety $\cA_x$ (up to prime-to-$p$ isogeny) over the residue field of $x$, together with tensors over the $\A_f^p$-Tate module and over the (integral) Dieudonné module of $\cA_x$.
Recall that these tensors arise by specializing Hodge cycles on abelian varieties over points in the generic fiber of $\Shh_{K_p}.$
The set $\Shh_{K_p}(\overline \FF_q)$ is partitioned into isogeny classes, where two points $x,x'$ are called isogenous if there exists a quasi-isogeny $\cA_x \to \cA_{x'} $ preserving the tensors.

Let $\cG$ be the reductive group scheme over $\Z_p$ corresponding to $K_p$. For $x\in\Shh_{K_p}(\overline \FF_q)$, the relative Frobenius  on the $\A_f^p$-Tate module and the absolute Frobenius on the Dieudonné module of $\cA_x$ give rise to
an element of

$$  G^\sim : = \bigg(\varinjlim_n G(\A_f^p) \bigg) \times \set{\cG(\Z_p^{\ur}) \text{-}\sigma\text{-conjugacy classes in } G(\Qpur)}, $$

where the direct limit is over positive integers $n$ ordered by divisibility and with respect to the transition maps $\gamma \mapsto \gamma^{n'/n}$
for $n| n'$.

As we have already indicated, in the current case of Hodge type,  we would like to keep track of some information about connected components. For technical reasons we work with a set $\pi^*(G,X)$ that is equipped with a map from (but is not equal to) the set of connected components of $\Shh_{K_p, \overline \FF_q}$. We then have a natural map
$$\Shh_{K_p}(\overline \FF_q) \To G^\sim \times \pi^*(G,X). $$

Analogously, for each admissible morphism $\phi$, we have a natural map
$$X(\phi) \To G^{\sim} \times \pi^*(G,X). $$

By an amicable pair, we mean a pair $(\phi, \II)$ consisting of an admissible morphism $\phi$ and an isogeny class $\II \subset \Shh_{K_p}(\overline \FF_q)$ such that the images of $X(\phi)$ and $\II$ in $G^\sim \times \pi^*(G,X)$ have non-empty intersection.

[see Theorem <ref>]
Let $\ica$ be the set of isogeny classes, and let $\cca$ be the set of admissible morphisms up to conjugacy.[In the rest of the introduction we shall deliberately conflate an admissible morphism with its conjugacy class to simplify the exposition.] There exists a bijection $\bij: \cca \isom \ica$ such that for each $\phi \in \cca$ the pair $(\phi, \bij(\phi))$ is amicable,  and such that
$\mathscr B$ is equivariant with respect to Galois cohomological twistings.

We explain the last requirement on $\bij$. The Galois cohomological twisting on $\ica$ is defined by twisting a $\QQ$-isogeny class of abelian varieties (with the additional tensors) in its $\Qbar$-isogeny class, and the Galois cohomological twisting on $\cca$ is defined by replacing an admissible morphism $\phi$ with another admissible morphism $\phi'$ such that $\phi^{\Delta} = \phi^{\prime,\Delta}$. For an arbitrary amicable pair $(\phi, \II)$, the set of Galois cohomology classes that can be used to twist $\phi$ is canonically identified with the corresponding set for $\II$. Since $(\phi,\bij(\phi))$ is required to be amicable, it makes sense to require that $\bij$ is equivariant with respect to the two twisting operations.

We now explain the proof of   Proposition <ref>. We make use of the following diagram:

\begin{align}\label{introdiag}
\xymatrixcolsep{5pc} \xymatrix{& \{ \text{special point data}\}  \ar@/_1pc/[ldd]  \ar@/^1pc/[rdd]  \ar@{-->}[d] \\ &  \{ \text{amicable pairs} \}   \ar[ld] \ar[rd] \\ \cca && \ica }
\end{align}

Here a special point datum refers to a triple $(T,i,h)$, where $(T,h)$ is a Shimura datum on a torus, and $i$ is an embedding of Shimura data $(T,h) \to (G,X)$ such that $i(T)$ is a maximal torus in $G$. Given $(T,i,h)$, we obtain a special point $\tilde x_{(T,i,h)}$ in the generic fiber of $\Shh_{K_p}$, which specializes to a point  $x _{(T,i,h)}\in \Shh_{K_p}(\Fpbar)$. Define $ \II(T,i,h)$ to be the isogeny class of $x_{(T,i,h)}$. Similarly, $(T,i,h)$ gives rise to an admissible morphism $\phi(T,i,h)$. We thus have maps from the set of special point data to $\ica$ and $\cca$. The following proposition asserts that we can fill in the dashed arrow in the above diagram.

[see Corollary <ref>]
Let $(T,i,h)$ be a special point datum. Then the pair $(\phi(T,i,h), \II(T,i,h))$ is amicable.

The key arithmetic input to the proof of Proposition <ref> is the construction of certain integral special points and the computation of their images in $G^\sim \times \pi^*(G,X)$. We first sketch the construction. Attached to the special point
$\tilde x_{(T,i,h)}$ we have a CM abelian variety $\tilde A$  defined over some number field, together with a canonical $\cG$-representation on the dual $p$-adic Tate module
$$ \Lambda : = T_p(\tilde A)^{\vee}. $$
Let $\cT^{\circ}$ be the connected Néron model of $T_{\Q_p}$ over $\Z_p$. Then $T_{\Q_p}$ acts on $\Lambda[1/p]$ via $i: T_{\Q_p} \to G_{\Q_p}$, and we fix a $\cT^\circ$-stable $\Z_p$-lattice $\Lambda'$ in $\Lambda[1/p]$. The lattice $\Lambda'$ corresponds to a $\Q_p$-isogeny $\iota : \tilde A \to \tilde A'$ between CM abelian varieties. We can choose a finite extension $F/ \QQ_p$ such that both $\tilde A$ and $\tilde A'$ are defined over $F$ and have good reduction, and such that $\iota$ is also defined over $F$.  Let $M$ and $M'$ be the base changes to $\ZZ_p^{\ur}$ of the contravariant Dieudonné modules of the reductions of $\tilde A$ and $\tilde A'$, respectively.  The reduction of $\iota$ induces a Frobenius-equivariant isomorphism $\iota^*: M'[1/p] \isom M[1/p]$.

Using some integral $p$-adic Hodge theory to be discussed in <ref> below, we construct a $\Z_p^\ur$-linear isomorphism

\begin{align}\label{eq:eta}
\eta: M' \isom \Lambda' \otimes_{\ZZ_p} \Z_p^{\ur}   ,
\end{align}

which is canonical up to automorphisms of the right hand side induced by elements of $\cT^\circ (\Z_p^\ur)$. Let $M''$ be the  image of the  composite map

$$ \Lambda \otimes_{\ZZ_p} \Z_p^{\ur} \hookrightarrow   \Lambda \otimes_{\ZZ_p}\QQ_p^{\ur} \cong \Lambda' \otimes_{\ZZ_p} \QQ_p^{\ur}  \xrightarrow{\eta^{-1}} M'[1/p] \xrightarrow{\iota^*}M[1/p]. $$

Then $M''$ is a $\ZZ_p^{\ur}$-lattice in $M[1/p]$. Moreover, we have a $\cG_{\ZZ_p^\ur}$-representation on $M$ (canonical up to $\cG(\ZZ_p^\ur)$-conjugation), and $M'' \subset M[1/p]$ is a translate of $M$ by an element $ g \in G(\Qpur).$
[By contrast, since $
\Lambda'$ is not required to be a $G(\QQ_p)$-translate of $\Lambda$, there is no reason to expect that the image of $M'$ under $\iota^*$ is a $G(\Qpur)$-translate of $M$.]

We would like to define a point of $\II(T,i,h)$ corresponding to $M'',$ but this is not possible in general, as
$g \in G(\Qpur)$ may not satisfy the defining condition of an affine Deligne–Lusztig set,
so that $g\cdot M$ may not be the Dieudonné module of an abelian variety.
To remedy this, for each isogeny class $\II$ we introduce a canonical enlargement $\II^* \supset \II$, and extend the map $\II \to G^{\sim } \times \pi^*(G,X)$ to $\II^*$. In the current situation, every $G(\Qpur)$-translate of $M$ defines an element of $\II(T,i,h)^*$, and in particular we view $M''$ as an element of $\II(T,i,h)^*$, called an integral special point.

We then need to compute the image of $M'' \in \II(T,i,h)^*$ in $G^\sim \times \pi^*(G,X)$. This is based on the following result, whose proof will be discussed in <ref> below.
Write $\Gamma_{p,0}$ for the inertia subgroup of $\Gal(\Qpbar/\Q_p).$ Then we have

* The Frobenius on $M'[1/p]$ corresponds via $\eta$ to $\delta \sigma,$ with $\delta \in T(\Qpur) \subset \GL(\Lambda' \otimes_{\ZZ_p} \Qpur)$ such that the image of $\delta$ in $X_*(T)_{\Gamma_{p,0}}$ under the Kottwitz homomorphism is equal to the natural image of $\mu_h$, the Hodge cocharacter of $h: \mathbb S \to T_{\RR}$.

* $M''$ is a $G_{\der} (\Qpur)$-translate of $M$ inside $M[1/p]$.

Using part (i) of the proposition and the Shimura–Taniyama reciprocity law, we obtain an explicit description of the image of $M''$ in $G^\sim$. Using part (ii), we prove that the image of $M''$ in $\pi^*(G,X)$ is equal to that of $x_{(T,i,h)} \in \II(T,i,h)$.

For Galois gerbs there is parallel construction of integral special points. By comparing the images of integral special points in $G^\sim \times \pi^*(G,X)$ in the two contexts, we obtain Proposition <ref>.

Given Proposition <ref>, Proposition <ref> is proved in two stages. In the first stage, we construct subsets $\cca' \subset \cca$ and $\ica' \subset \ica$ and a bijection $\bij: \cca' \isom \ica'$ such that for each $\phi \in \cca'$ there exists a special point datum which induces both $\phi$ and $\bij(\phi)$. By Proposition <ref> we know that $(\phi,  \bij(\phi))$ is amicable for such $\phi$. In the second stage, we use Galois cohomological twisting on both sides to extend $\bij$ to a bijection $\cca \isom \ica$. For this, we need to show that if $(\phi, \II)$ is an amicable pair then, after we twist $\phi$ and $\II$ by a common Galois cohomology class, we again obtain an amicable pair. To show this we again utilize integral special points. More precisely, we use the fact that for each amicable pair $(\phi, \II)$ and each maximal torus $T \subset I_\phi$, there exist two special point data of the form $(T,i,h)$ and $(T,i',h)$ such that

\begin{align}\label{eq:abundance}
\II= \II(T,i,h) \quad  \text{ and } \quad  \phi = \phi(T,i',h).
\end{align}
(Here the second equality is up to conjugacy.)  This fact follows from the special point lifting theorem in [53] and a similar result for Galois gerbs, and it allows us to understand arbitrary Galois cohomological twistings by studying the twisting of integral special points.

Note that  Proposition <ref> does not yet give a bijection $\cca \isom \ica$ compatible with the diagram (<ref>). It remains an interesting open problem to show the existence of such a compatible bijection (which is necessarily unique). We expect that the solution would lead to better understanding of the Langlands–Rapoport Conjecture.

Having shown Proposition <ref>, we proceed to prove Conjecture <ref> in the case of Hodge type as follows: Fix a bijection $\bij$ as in Proposition <ref>. For each $\phi \in \cca$, using that $(\phi,\bij(\phi))$ is amicable, we can find an element $\tau(\phi) \in I_{\phi}^{\ad}(\A_f)$ and a $G(\A_f^p)\times \Gal(\overline \FF_{q}/\FF_q)$-equivariant bijection
$$ f_{\phi}: \bij(\phi) \isom \varprojlim_{K^p} I_{\phi}(\Q)_{\tau(\phi)} \backslash X(\phi)/K^p$$
which commutes with the natural maps from the two sides to $G^\sim \times \pi^*(G,X)$. We also require that the map $X(\phi) \to \bij(\phi)$ induced by $f_{\phi}^{-1}$ satisfies some natural equivariance conditions. Here neither $\tau(\phi)$ nor $f_{\phi}$ is unique, but essentially our requirements on $f_\phi$ restrict the ambiguity of $\tau(\phi)$ such that the image of $\tau(\phi)$ in $ \mathcal H(\phi)$ depends only on the pair $(\phi, \bij(\phi))$ and thus only on $\phi$ if we keep $\bij$ fixed.  We then need to show that these canonical elements of $\cH(\phi)$ for all $\phi$ satisfy the two conditions in Conjecture <ref>.

Condition (i) follows from the fact that $\bij$ is compatible with Galois cohomological twistings. It is proved as a byproduct of the second stage of the proof of Proposition <ref>.

Condition (ii) follows from the fact that $(\phi, \bij (\phi))$ is amicable for all $\phi$, and that for each amicable pair
$(\phi, \II)$ and each maximal torus $T$ in $I_\phi$ we can arrange (<ref>).

We now discuss the strengthening of Conjecture <ref> that we obtain in the case of Hodge type. We have already mentioned that the requirements on $f_\phi$ restrict the ambiguity of $\tau(\phi) \in I_{\phi}^{\ad}(\A_f)$ such that it has a well-defined image in $\cH(\phi)$. In fact we can do better. Let $Z_\phi^{\dagger}$ be the intersection of the center of $I_\phi$ with $G_{\der}$, which is a $\Q$-subgroup of $I_\phi$. We define $\fkH(\phi)$ to be the quotient of

\begin{multline*}
\cok\bigg(  \ker\big(  \coh^1(\Q, Z_{\phi}^{\dagger}) \to  \coh^1(\RR, Z_{\phi}^{\dagger} )  \oplus \coh^1_{\ab} (\QQ, G_{\der})   \big) \To \coh^1(\A_f , Z_{\phi} ^{\dagger} )  \bigg)
\end{multline*}

by the image of a certain map $\cG^{\ab}(\Z_p) \to \coh^1(\A_f , Z_{\phi}^{\dagger})$; see <ref>. Using especially the fact that $f_\phi$ is compatible with the maps to $\pi^*(G,X)$, we know that the image of $\tau(\phi)$ in $\fkH(\phi)$ is also well defined, i.e., it depends only on the pair $(\phi, \bij(\phi))$. We prove a strengthened version of condition (i) in Conjecture <ref>, where $\cH(\phi)$ is replaced by $\fkH(\phi) \oplus \cH(\phi)$.
Similarly, for each maximal torus $T$ in $I_\phi$, writing $T^\dagger : = T \cap G_{\der}$ we define $\fkH(\phi)_T$ to be the quotient of
\begin{multline*}
\cok\bigg(  \ker\big(  \coh^1(\Q, T^{\dagger}) \to  \coh^1(\RR, T^{\dagger} )  \oplus \coh^1_{\ab} (\QQ, G_{\der})   \big) \To \coh^1(\A_f , T ^{\dagger} )  \bigg)
\end{multline*}

by the image of a certain map $\cG^{\ab}(\Z_p) \to \coh^1(\A_f , T ^{\dagger})$; see <ref>. In analogy with the natural map $\cH(\phi) \to \cH(\phi)_T$ we have a natural map $\fkH(\phi) \to \fkH(\phi)_T$. We prove a strengthened version of condition (ii) in Conjecture <ref> where the kernel of $\cH(\phi) \to \cH(\phi)_T$ is replaced by the kernel of $\fkH(\phi) \oplus \cH(\phi) \to \fkH(\phi)_T \oplus \cH(\phi)_T$.

§.§ Integral p-adic Hodge theory

We now explain the ingredients from $p$-adic Hodge theory that go into the construction and study of the integral special points in

Let $\cP$ be a parahoric group scheme over $\ZZ_p$. Write $\Rep \cP$ for the category of $\cP$-representations on finite free $\ZZ_p$-modules.   Let $F/\QQ_p$ be a finite extension with residue field $k$. Write $W= W(k)$ and $F_0 = W(k)[1/p]$.
Consider  a crystalline representation $\rho : \Gal(\ol F/F) \to \cP(\Z_p).$ Then for each $\Lambda \in \Rep  \cP$, we can view $\Lambda$ as a $\Gal(\ol F/F)$-stable lattice in the crystalline representation $\Lambda[1/p]$. Using the functor $\gM$ in [51] we obtain from $\Lambda$ a pair
$$ (M_{\cris}(\Lambda) , \varphi),$$
where $M_{\cris}(\Lambda)  : = \gM(\Lambda) \otimes_{W \lps u \rps } W  $ is a finite free $W$-module and $\varphi$ is a $\sigma$-linear automorphism of $M_{\cris}(\Lambda) [ 1/p]$, called the Frobenius.  This yields a  $\otimes$-functor $\tomega_\rho$ from $\Rep \cP $ to the category of pairs as above. Using a purity result proved recently by Anschütz [3][The special cases for connected reductive group schemes and  parahoric group schemes with tamely ramified generic fibers were previously shown in [52] and [70] respectively.] we show that the $\otimes$-functor $\Lambda \mapsto M_{\cris}(\Lambda)$ (where we forget the Frobenius) is isomorphic to $\Lambda \mapsto \Lambda \otimes_{\ZZ_p} W$. We denote by $Y(\tomega_\rho)^\circ$ the
$\cP(W)$-torsor of isomorphisms between the two $\otimes$-functors.

For our purposes it is important to know that the formation of $M_{\cris}(\Lambda)$ for a crystalline $\Gal(\ol F/ F)$-lattice $\Lambda$ is compatible with replacing $F$ by an arbitrary finite extension of $F$. This has been proved by T. Liu [88].

If we fix an element of $Y(\tomega_\rho)^\circ$, then the Frobenius structure on $\tomega_{\rho}$ is given by an element $\delta \in \cP(F_0)$. We prove the following result about $\delta$.
[see Proposition <ref>]
The image of  $\delta$ under the Kottwitz homomorphism $\cP(\Qpur) \to \pi_1(\cP_{\Q_p})_{\Gamma_{p,0}}$ is equal to the image of the Hodge–Tate cocharacter for $\rho$.

Before discussing the proof of Proposition <ref>, we explain how the above local theory is applied in the global situation of <ref>, namely for the construction of (<ref>) and the proof  of Proposition <ref>. We use the notation as in the paragraph preceding (<ref>). Up to enlarging $F$, the natural action of $\Gal(\ol F/F)$ on $\Lambda'$ is induced by a crystalline representation $\rho_T: \Gal(\ol F/F) \to \cT^\circ (\Z_p)$. We apply the local theory to $\rho_T$ and the group scheme $\cT^\circ$.  On choosing an element of the $\cT^\circ (W)$-torsor $Y(\tomega_{\rho_T})^\circ$, we obtain an isomorphism $M_{\cris} (\Lambda') \isom \Lambda' \otimes_{\Z_p} W$. On the other hand, we have a canonical integral comparison isomorphism  $M_{\cris} (\Lambda') \otimes _W \ZZ_p^\ur \isom M' $. See <ref> for references. We define $\eta$ to be the composition of the two isomorphisms.
Now part (i) of Proposition <ref> follows from Proposition <ref>. For part (ii) of Proposition <ref>, we use that the $\Gal(\ol F/F)$-action on $\Lambda$ is induced by a crystalline representation $\rho: \Gal(\ol F/F) \to \cG(\Z_p^{\ur})$, and apply the local theory to $\rho$ and the group scheme $\cG$. There is no direct map between the $\cT^{\circ}(W)$-torsor $Y(\tomega_{\rho_T})^{\circ}$ and the $\cG(W)$-torsor $Y(\tomega_\rho)^{\circ}$ since there is (in general) no $\ZZ_p$-homomorphism $\cT^\circ \to \cG$. Nevertheless, we have natural $\ZZ_p$-homomorphisms $\cG \to \cG^{\ab}$ and $\cT^\circ \to \cG^{\ab}$, and $\rho$ and $\rho_T$ induce the same crystalline representation $\rho^{\ab} : \Gal(\ol F /F) \to \cG^{\ab}(\Z_p)$. We can apply the local theory for the third time, to $\rho^{\ab}$ and the group scheme $\cG^{\ab}$. Comparing each of $Y(\tomega_{\rho})^{\circ}$ and $Y(\tomega_{\rho_T})^{\circ}$ with the $\cG^{\ab}(W)$-torsor $Y(\tomega_{\rho^{\ab}})$, we obtain part (ii). See Proposition <ref> and Remark <ref> for details of this argument.

We now explain the proof of Proposition <ref>. As usual we write $\oo_F$ as $W\lps u \rps/E$, where $E$ is an Eisenstein polynomial in $W[u]$. Write $\gS$ for $W\lps u \rps$. We construct a homomorphism

\begin{align}\label{eq:E-adic}
\cP(\Frac \gS) \To \pi_1(P)_{\Gal(\Qpbar/K_0)},
\end{align}
which can be viewed as an $E$-adic variant of the Kottwitz homomorphism.  The proof of Proposition <ref> has the following two steps.

* We show that $\delta$ comes from an element $\delta_{\gS}\in \cP(\gS[1/E])$ under the specialization $u \mapsto 0$, and that the image of $\delta_{\gS}$ under (<ref>) is equal to the image of the Hodge–Tate cocharacter for $\rho$.

* We show that if an element $g \in \cP(\gS[1/E]) \subset \cP(\Frac \gS)$ specializes to $g_0 \in \cP(K_0)$ under $u \mapsto 0$, then the image of $g$ under (<ref>) is equal to the image of $g_0$ under the $p$-adic (i.e., classical) Kottwitz homomorphism.
In step (i), we use properties of the functor $\gM$ in [51]. In both steps we make use of the following result about “Kottwitz homomorphisms in families”, which may be of independent interest.
[see <ref>] Let $F$ be a field of characteristic $0,$ $R$ an
$F$-algebra, and $v$ a discrete valuation on $R.$ Then for each reductive group $P$ over $F$ there is a natural map

$$\kappa_P^v: P(R) \to \pi_1(P)_{\Gal(\overline F/F)},$$

generalizing the Kottwitz homomorphism, which is given by $v : R^{\times} \to \ZZ$ when $P = \GG_m.$
Moreover we have

* Suppose that $\Spec R$ has trivial Picard group. For discrete valuations $v_1,\cdots, v_n$ on  $R$ and integers $a_1,\cdots, a_n$ such that $ \sum_i a_v v_i$ vanishes on $R^\times$, we have
$$\sum_i a_i \kappa_P^{v_i}(P(R))= 0$$
for all reductive groups $P$ over $F$.

* Suppose that $R= F$, and let $v$ be a discrete valuation on $F$ with valuation ring $\oo_F$. For any reductive group $P$ over $F$ and any smooth affine group scheme $\mathcal P$ over $\oo_F$ with connected fibers extending $P$, we have
$$\kappa_P^{v}(\mathcal P(\oo_F)) = 0. $$

§.§ From Hodge type to abelian type
We now explain how our proof of Conjecture <ref> in the case of Hodge type, together with the strengthening discussed at the end of <ref>, implies the conjecture in the case of abelian type. For this we follow the reduction method in [53], which takes as input a construction of the elements $\tau(\phi)$ in the case of Hodge type, and outputs a construction of them in the case of abelian type. Thus we only need to transport the properties of $\tau(\phi)$ proved in the case of Hodge type to the case of abelian type. Specifically, for a Shimura datum $(G_2, X_2)$ of abelian type that is of interest, we pick an auxiliary Shimura datum $(G,X)$ of Hodge type satisfying some standard  compatibility conditions with $(G_2, X_2)$. We show that the strengthened version of Conjecture <ref>, which we have proved for $(G,X)$, implies the original Conjecture <ref> for $(G_2,X_2)$, provided that $(G,X)$ satisfies the following technical hypothesis:

* The $\Gal(\Qbar/\Q)$-module $X_*(G^{\ab})$ is generated by the image of a Hodge cocharacter.

That for any $(G_2,X_2)$ we can indeed find such $(G,X)$ follows from a construction of Deligne.

For a fixed $(G_2,X_2)$, the auxiliary $(G,X)$ that we find does not, in general, have connected center, which violates an assumption in the reduction method in [53]. For this reason, we need a generalization of <cit.> from reductive group schemes to (certain) parahoric group schemes; see Corollary <ref>.
The proof again uses the local theory exposed in <ref>, as well as Proposition

§.§ Organization of the paper

In <ref>, after some group theoretic preparation, we state the conjectural point counting formula as in (<ref>) for a general Shimura datum (with hyperspecial level at $p$; see Conjecture <ref>).
Of note is <ref>, in which we generalize the Kottwitz homomorphism to families, as discussed in Proposition <ref> above.

In <ref>, we first recall the formalism of Galois gerbs and the Langlands–Rapoport Conjecture, and then state the Langlands–Rapoport–$\tau$ Conjecture (see Conjecture <ref>). For the formulation of the conjecture we need a general twisting construction for admissible morphisms. We study this in

In <ref>, we show that the Langlands–Rapoport–$\tau$ Conjecture implies the desired point counting formula. The key step is the assignment of a Kottwitz parameter (i.e., a summation index in the point counting formula) to a gg LR pair (an object within the realm of Galois gerbs and the Langlands–Rapoport Conjecture). We study this construction in <ref>
in the presence of general twisting elements $\tau(\phi)$. In <ref>, we study the special case when the elements $\tau(\phi)$ are controlled as in the Langlands–Rapoport–$\tau$ Conjecture. Roughly speaking, we show that the set of Kottwitz parameters that can arise from this construction is unaffected by the presence of these twisting elements.

In <ref>, we develop the input from integral $p$-adic Hodge theory. We define integral $F$-isocrystals with $G$-structure in <ref>, and attach them to $G$-valued crystalline representations in <ref> (for $G$ a $\ZZ_p$-group scheme satisfying “property KL”). Most of the content of this section is of a local nature, with the exception of the later parts of <ref>, where global abelian Galois representations related to the Shimura–Taniyama reciprocity law are considered.

In <ref> and <ref>, we prove the Langlands–Rapoport–$\tau$ Conjecture for Shimura varieties of abelian type. In <ref> and <ref>, we prove intermediate results for Shimura varieties of Hodge type. These results constitute the strengthened version of Langlands–Rapoport–$\tau$ mentioned above. As we have already explained, the crucial innovations needed for proving these results  are the construction and study of integral special points. These are carried out in <ref> and <ref>, in the geometric context and the Galois gerb context respectively.  In <ref>, we combine the results proved in the case of Hodge type with the reduction method in  [53] and a construction of Deligne to prove the Langlands–Rapoport–$\tau$ Conjecture in the case of abelian type.

We devote
<ref>–<ref> to stabilization.
In <ref>, we have preparatory discussions on central character data in <ref>, endoscopic data and $z$-extensions in <ref>, Galois cohomology invariants in <ref>, and the Langlands–Shelstad–Kottwitz transfer in <ref>. By implementing central characters and $z$-extensions, we make it unnecessary to assume any undesirable technical hypothesis such as cuspidality of $Z_G$ or simple connectedness of $G_{\der}$.

In <ref>, we present the stabilization in three steps following Kottwitz. We rewrite the point counting formula in terms of adelic $\kappa$-orbital integrals (<ref>), transfer $\kappa$-orbital integrals to stable orbital integrals on $z$-extensions of endoscopic groups (<ref>), and then finish by reorganizing the terms into the sum of stable distributions intrinsic to the endoscopic groups and their $z$-extensions (<ref>).

Finally, in <ref>, after some recollection of the general stable trace formula, we indicate what extra information and steps are needed, in addition to our main results, for understanding the cohomology of Shimura varieties unconditionally.

§.§ Acknowledgments

We thank T. Haines and R. Zhou for answering our questions on parahoric group schemes. We thank M. Rapoport for intriguing conversations on the Langlands–Rapoport Conjecture and useful suggestions. We thank M. Harris for his long-term interest in this project and encouragement.

M. K. is partially supported by NSF grant DMS-1902158. S. W. S. is partially supported by NSF grant DMS-1802039/2101688, NSF RTG grant DMS-1646385, and a Miller Professorship.
Y. Z. is partially supported by NSF grant DMS-1802292, and by a startup grant at University of Maryland.

§.§ Conventions

* When $G$ is a group acting on a set $X$ on the left, we denote the action map $G \times X \to X$ by  $(\rho, x) \mapsto \leftidx^{\rho} x$, or $(\rho, x) \mapsto \rho (x)$. We shall not use the notation $x^{\rho}$.

* If $g, h$ are elements of a group, we define $\Int(g) h $ to be $ghg^{-1}. $

* Given a field $F$, we denote by $\ol F$ a fixed algebraic closure. Throughout we fix  field embeddings ${\overline {\QQ}} \to \overline{\QQ}_v$ for all places $v$ of $\Q$. The Galois groups will sometimes be abbreviated as follows:
$$\Gamma = \Gamma_\QQ  = \Gal({\overline {\QQ}} /\QQ),\quad \Gamma_v = \Gamma_{\QQ_v} = \Gal (\overline{\QQ}_v / \QQ_v).$$
Using the field embeddings fixed above, we view $\Gamma_v$ as a subgroup of $\Gamma$. When $v$ is non-archimedean, we write $\Gamma_{v,0}$ for the inertia subgroup of $\Gamma_{v}$.

* If $L$ is a subfield of $\overline \QQ$ and $v$ is a place of $\QQ$, we denote by $L_v$ the completion of $L$ inside $\overline \QQ_v$, with respect to the fixed embedding $\overline \QQ \to \overline \QQ_v$.

* For a prime $p$, we denote by $\QQ_{p}^{\ur}$ the maximal unramified extension of $\QQ_p$ in $\ol\QQ_p$. We write $\QQ_{p^n}$ for the degree $n$ unramified extension of $\QQ_p$ in $\QQ_{p}^{\ur}$, and write $\ZZ_{p^n}$ for its ring of integers. We write $\ZZ_p ^{\ur}$ for the strict henselization of $\ZZ_p$, i.e., $\ZZ_p^{\ur}= \bigcup _{n} \ZZ_{p^n}$.

* For a prime $p$, we denote by $\LL$ the completion of $\QQ_{p}^{\ur}$, and denote by $\breve{\ZZ}_p$ its ring of integers. We fix an embedding $\Qpbar \hookrightarrow \overline {\breve \QQ}_p$, and thereby identify $\Gamma_{\LL} = \Gal(\overline {\breve \QQ}_p / \LL) $ with the inertia subgroup $\Gamma_{p,0}$ of $\Gamma_p$. We denote by $\sigma $ the arithmetic $p$-Frobenius in $\Aut(\LL)$.

* We denote by $\A, \A_f, \A_f^p$ respectively the adeles over $\QQ$, the finite adeles over $\QQ$, and the finite adeles away from $p$. We also denote by $\A^*_f$ the product $\A^p_f \times \QQ_p^{\ur}$, when $p$ is clear in the context.

* For a perfect field $k$, we write $W(k) $ for the ring of Witt vectors over $k$. When $k = \FF_{p^n}$ we identify $W(k)$ with $\ZZ_{p^n}$.

* By a reductive group over a field, we always mean a connected reductive group.

* For a connected reductive group $I$ over a field, we write $I_{\der}, I_{\sconn}, I^{\ad}$ for the derived subgroup, the simply connected cover of the derived subgroup, and the adjoint group respectively. We define $I^{\ab} $ to be $I/I_{\der}$, the maximal torus quotient of $I$.

* For a reductive group $I$ over $\RR$, we write $I(\R)^+$ for the identity connected component of the real Lie group $I(\R)$, and write $I(\R)_+$ for the preimage of $I^{\ad}(\R)^+$ under $I(\R) \to I^{\ad}(\R)$. If $I$ is defined over $\QQ$, we write $I(\Q)^+$ for $I(\Q) \cap I(\R)^+$, and write $I(\Q)_+$ for $I(\Q) \cap I(\R)_+$.

* All group cohomology classes or cocycles for profinite groups (e.g. Galois groups) are understood in the continuous sense. We shall denote a $1$-cochain by $(g_{\rho})_\rho$, or $\rho \mapsto g_{\rho}$, or simply $g_{\rho}$. A $1$-cocycle $g_\rho$ satisfies $g_{\rho \sigma} = g_{\rho} \leftidx^{\rho} g_{\sigma}$.

* Let $I$ be a linear algebraic group over a field $F$ of characteristic zero. Let $F'/F$ be a Galois extension. We denote by $Z^1(F'/F,I(F'))$ the set of continuous $1$-cocycles $\Gal(F'/F) \to I(F')$. Denote by $\coh^1(F'/F, I(F'))$ the corresponding cohomology set. When $F' = \overline F$ is an algebraic closure of $F$, we write $Z^1(F, I)$ and $\coh^1(F,I)$. When $I$ is reductive, for $\tau \in I^{\ad}(F)$, its image in $\coh^1(F,Z_I)$ is understood to be the  class of the cocycle $\rho \mapsto \tilde \tau^{-1}\leftidx^{\rho} \tilde \tau$, where $\tilde \tau \in I(\overline F)$ is an (arbitrary) lift of $\tau$.

* When $I$ is a connected reductive group over $F$, we denote by $I(F)_{\semi}$ the set of semi-simple elements of $I(F)$.

* We denote by $\mathbb S$ the Deligne torus $\Res_{\C/\R} \Gm.$

Axiomatic point counting

§ THE POINT COUNTING FORMULA

§.§ Abelianized Galois cohomology

Let $F$ be a field of characteristic zero, $\overline F$ an algebraic closure, and $\Gamma = \Gal(\overline F/F).$ Let
$\GMod$ (resp. $\GMod_f$) be the abelian category of discrete $\ZZ[\Gamma]$-modules that are finitely generated (resp. finite free) over $\ZZ.$
Let $\Mult(F)$ be the abelian category of algebraic groups of multiplicative type over $F,$ and $\Tori(F) \subset \Mult(F)$ the full subcategory of tori.
Each of the above four categories is naturally an exact category, and we have the corresponding bounded and unbounded
derived categories; see for instance [49].

We have an exact anti-equivalence of abelian categories
$$X^* : \Mult(F) \To \GMod, $$
sending each multiplicative group to its group of characters. We set
$$X_* = \Hom_{\ZZ} (\cdot , \ZZ) \circ X^* : \Mult(F) \To \GMod_f,$$
sending each multiplicative group to its group of cocharacters.

We have a commutative diagram (that is, commuting up to natural isomorphisms) of equivalences of triangulated categories

\cD^b(\Tori(F)) \ar[r]^\sim \ar[d]^\sim &  \cD^b(\GMod_f) \ar[d]^\sim \\
\cD^b(\Mult(F)) \ar[r]^\sim & \cD^b(\GMod)}

where the top functor is induced by $X_*,$ and the bottom functor realizes the derived functor $\RX_*$ of $X_*: \Mult(F) \to \GMod.$

The vertical functors are induced by the inclusions $\GMod_f \subset \GMod$ and
$\Tori(F) \subset \Mult(F).$ Note that every $M \in \GMod_f$ is a $\ZZ[\Gamma/U]$-module for some open normal subgroup $U \subset \Gamma$. Using this one checks that the fully exact subcategory $\GMod_f \subset \GMod$ satisfies the dual versions of conditions C1 and C2 in <cit.>. By <cit.>, the canonical functor $\cD^-(\GMod_f) \to \cD^-(\GMod)$ is an equivalence. This implies that the vertical functor on the right is an equivalence, in view of the observation that the acyclicity of a complex in $\GMod_f$ at a given degree (in the sense of <cit.>) is equivalent to the vanishing of the cohomology at the same degree computed in $\GMod$. Now that the vertical functor on the left is an equivalence follows by applying the exact anti-equivalence $X^*,$
or more precisely its quasi-inverse given by $\underline{\Hom}_{\Spec F} (\_, \mathbb G_m).$

Since $X_*: \Tori(F) \rightarrow \GMod_f$ is an exact equivalence, the functor on the top is an equivalence.
Now we can fill in the equivalence in the bottom row. The exactness also implies that $X_*: \Tori(F) \rightarrow \GMod_f$ preserves
acyclicity of bounded complexes, which implies that the bottom row realizes the derived functor of $X_*,$ by

Let $G$ be a connected reductive group over $F$. Let $Z_G , Z_{G_\sconn}$ be the centers of $G, G_{\sconn}$ respectively. Let $\mathscr Z_G$ be the complex $Z_{G_\sconn} \to Z_G$ in $\Mult(F)$, at degrees $-1, 0$.

There is a canonical isomorphism
$\RX_*(\mathscr Z_G) \cong \pi_1(G)$ inside $\dercat{\GMod}$.

Let $T$ be a maximal torus in $G$, and let $\tilde T$ be its inverse image in $G_{\sconn}.$
Recall that $\pi_1(G)$ is defined to be the $\Gamma$-module $X_*(T)/X_*(\tilde T).$ If $S$ is another maximal torus in $G$, with preimage $\tilde S$ in $G_{\sconn},$ and $g$ is any element of $G(\overline F)$ such that $\Int(g) (T_{\overline F}) = S_{\overline F},$ then $g$ induces an isomorphism of $\Gamma$-modules $\iota_{T,S}: X_*(T)/X_*(\tilde T) \isom  X_*(S)/X_*(\tilde S),$ which is independent of $g.$ Thus $\pi_1(G)$ does not depend on $T.$

Now the natural map $\mathscr Z_G \rightarrow (\tilde T \to T)$ is a quasi-isomorphism, as the cone of this map is easily seen to be acyclic (here we regard $\tilde T \to T$ as being in degrees $-1$ and $0$). Thus

$$ \RX_*(\mathscr Z_G) \cong  \RX_*(\tilde T \to T) = X_*(T)/X_*(\tilde T) = \pi_1(G).$$

We now review the theory of abelianized Galois cohomology, developed by Borovoi [13] and Labesse [75].

For the rest of this subsection $F$ will be a local or global field of characteristic zero. We introduce a symbol $?$ as follows. When $F$ is local, $?$ denotes $F$.  When $F$ is global, $?$ denotes one of $F$, $\adele_F/F$, or $\adele_F^S,$ where $S$ is a finite  set of places of $F$, and $\adele_F^S$ is the ring of adeles away from $S$. Let $\Gamma = \Gal(\overline F/F)$, and define the discrete $\Gamma$-module

$$ \bD_? = \begin{cases}
\overline F ^{\times}, & \text{if } ? = F ,\\
(\bar \adele_F^S)^{\times}, & \text{if } ? = \adele_F^S ,\\
(\bar \adele_F)^{\times}/ \overline F^{\times}, & \text{if } ? = \adele_F/F.
\end{cases}$$

Here $\bar \A_F^S$ denotes $\overline F\otimes _F\A_F^S$.

For any bounded complex $C^{\bullet}$ in $\Mult(F)$, we define the abelian groups

$$\coh^i (?, C^{\bullet}) :  = \coh^i (\Gamma, \RX_*(C^{\bullet})\ltensor_{\ZZ}\bD_?), \quad i\in \ZZ ,$$

cf. <cit.>.  Here the term on the right denotes the continuous group cohomology of the profinite group $\Gamma$

Let $G$ be a connected reductive group over $F$. We define

$$\coh ^i_{\ab}(?, G) : =  \coh^i(?, \mathscr Z_G) ,$$
cf. <cit.>. When $?$ is not $\adele_F/F$, we have the usual Galois/adelic cohomology

$$\coh^i (?, G), \quad i = 0,1,$$
defined to be the continuous cohomology of $\Gamma$ acting on $G(\overline F)$ or $G(\bar \A_F^S)$ according as $?$ is $F$ or $\A_F^S$. This is a group for $i = 0$ and a pointed set for $i =1$. We have natural “abelianization” maps

\begin{align*}\
\ab^i_? : \coh^i (?, G) \to  \coh^i_{\ab} (?,G), \quad i=0,1,
\end{align*}

which is a group homomorphism for $i=0$ and a map of pointed sets for $i=1$.
By <cit.>, the map $\ab^1_F: \coh^1(F,G) \to \coh^1_{\ab}(F,G)$ is surjective, and is bijective when $F$ is local non-archimedean. In particular, when $F$ is local non-archimedean, $\coh^1(F,G)$ has a canonical structure of an abelian group.

When $F$ is global, we have

\begin{align} \label{eq:adelic coh}
\coh^1(\adele_F^S, G ) \cong \prod'_{\substack{\text{places $v$ of $F$,} \\ v \notin S}}  \coh^1(F_v, G),\end{align}

where the restricted product is with respect to the trivial elements; see for instance <cit.>. Analogously we have

\begin{align}\label{eq:adelic ab coh}
\coh^1_{\ab}(\adele_F^S, G ) \cong \bigoplus_{\substack{\text{places $v$ of $F$,} \\ v \notin S}}  \coh^1_{\ab}(F_v, G).
\end{align}
The decompositions (<ref>) and (<ref>) are compatible with $\ab^1_{\A_F^S}$ and $\ab^1_{F_v}$. If $S$ contains all archimedean places of $F$, then $\ab^1_{\adele_F^S} : \coh^1(\adele_F^S, G) \to \coh^1_{\ab}(\adele_F^S, G)$ is bijective, giving $\coh^1(\adele_F^S, G)$ a canonical structure of an abelian group.

Let $f: I \to G$ be an $F$-homomorphism between connected reductive groups over $F$.
Let $\mathscr Z_{I\to G}$ be the mapping cone of the map of complexes $\mathscr Z_I \to \mathscr Z_G$ induced by $f$. We set  (cf. <cit.>)

$$ \coh^i_{\ab}(? , I \to G)= \coh^i(? , \mathscr Z_{I\to G}) .$$

Assume $?$ is not $\adele_F/F$. We follow [75] in writing:

\begin{align*}
&\D(I,G ;?     ) := \ker \left(\coh^1(?, I) \to \coh^1(?, G )\right),\\
&\E(I,G ; ?)  : =  \ker \left(\coh^1_{\ab}(?, I) \to \coh^1_{\ab}(?, G )\right).
\end{align*}
Thus $\D(I,G;?)$ is a pointed set, and $\E(I,G;?)$ is an abelian group. We have a map of pointed sets

$$\D(I,G ; ?  ) \To \E(I,G ; ?)$$
induced by $\ab^1_?$. This map is bijective in the following two cases:

* $F$ is local non-archimedean and $?=F$.

* $F$ is global, $? = \adele_F^S$, and $S$ contains all the archimedean places of $F$.

Let $\Gamma= \Gal(\overline F/F),$ and  $M \in \GMod.$
When $F$ is global or local non-archimedean,  we set $\mathcal A_F(M) = M_{\Gamma, \tors},$ the torsion subgroup of the coinvariants $M_{\Gamma}.$
When $F$ is local archimedean, we set $\mathcal A_F(M) = \tatecoh^{-1}(\Gamma, M).$ Note that in both cases, there is a canonical embedding $\mathcal A_F(M) \hookrightarrow M_{\Gamma, \tors}$ for each $M \in \GMod$.

Now suppose $F$ is global. For each place $v$ of $F$ we fix an embedding $\overline F \to \overline F_v$, and thereby view $\Gamma_v= \Gal(\overline F_v/F_v)$ as a subgroup of $\Gamma= \Gal(\overline F/F)$. For  $M \in \GMod,$ set

\begin{align*}
\mathcal B_F(M) :=  \bigoplus_{\substack{\text{places $v$ of $F$} \\ }}    \mathcal A_{F_v} (M),
\end{align*}

and define the map $\mathscr P(M):\cB_F (M)  \to \mathcal A_F(M) $ to be the direct sum over $v$ of the maps
$$\mathcal A_{F_v} (M) \hookrightarrow M_{\Gamma_v, \tors} \xrightarrow{\dagger}  M_{\Gamma, \tors} = \mathcal A_F(M), $$
where $\dagger$ is induced by the identity on $M$. Then $\mathscr P$ is a natural transformation $\mathcal B_F \to \mathcal A_F$ between functors from $\GMod$ to finite abelian groups.

More generally, if $S$ is a finite set of places of $F$, we set
\begin{align*}
\mathcal B_F^S(M) =  \bigoplus_{\substack{\text{places $v$ of $F$,} \\ v\notin S }}    \mathcal A_{F_v} (M). \end{align*}

Let $F$ be local or global, and let $I \to G$ be a homomorphism of connected reductive groups over $F$. Assume that the induced map $\pi_1(I) \to \pi_1(G)$ is surjective, and denote its kernel by $K.$

* Let $? = F$ when $F$ is local, and let $? = \adele_F/F$ when $F$ is global. Then the exact sequence

$$ \coh^0_{\ab}(?, I\to G)  \to  \coh^1_{\ab}(? , I) \to \coh^1_{\ab}(?, G) $$
is canonically isomorphic to the natural sequence

$$ \mathcal A_F(K) \to \mathcal A_F(\pi_1(I)) \to \mathcal A_F(\pi_1(G)). $$
If $F$ is global and $? = \A_F^S$ for a finite set $S$ of places of $F$, then the above statement still holds with $\cA_F$ replaced by $\cB_F^S$.

* When $F$ is global, the commutative diagram with exact rows

$$ \xymatrix{\coh^0_{\ab} (\adele_F, I \to G) \ar[r] \ar[d] & \coh^1_{\ab}(\adele_F, I) \ar[d] \ar[r] & \coh^1_{\ab}(\adele_F, G) \ar[d] \\ \coh^0_{\ab} (\adele_F/F, I \to G) \ar[r]  & \coh^1_{\ab}(\adele_F/F, I) \ar[r] & \coh^1_{\ab}(\adele_F/F, G) }$$
is canonically identified with the natural commutative diagram

$$\xymatrix{\mathcal B_F(K) \ar[r] \ar[d] ^{\mathscr P(K)} & \mathcal B_F(\pi_1(I)) \ar[d] ^{\mathscr P(\pi_1(I))} \ar[r] & \mathcal B_F(\pi_1(G)) \ar[d]^{\mathscr P(\pi_1(G))} \\\mathcal A_F(K) \ar[r]  &\mathcal A_F(\pi_1(I)) \ar[r] &  \mathcal A_F(\pi_1(G)) .} $$

This follows from the results of <cit.>, Proposition <ref> applied to $I$ and $G$, and the analogous fact that  $\RX_*(\mathscr Z_{I\to G})$ is represented by the complex $K[1]$ (which uses the surjectivity of $\pi_1(I) \to \pi_1(G)$).

§.§ Inner twistings and local triviality conditions

Let $F$ be a field, and let $\overline F$ be an algebraic closure. Let $H, H_1$ be algebraic groups over $F$.

* By an inner twisting from $H$ to $H_1$, we mean an $\ol F$-group isomorphism $\psi: H_{\overline F} \isom H_{1, \overline F}$ such that for each $\rho \in \Gamma$ the automorphism $(\leftidx ^{\rho} \psi  )^{-1} \psi $ of $H_{\overline F}$ is inner.

* Two inner twistings from $H$ to $H_1$ are called equivalent, if they differ by an inner automorphism of $H_{\overline F}$.

Let $F$ be a field, and let $H$ be an algebraic group over $F$. By an inner form of $H$, we mean a pair $(H_1, [\psi])$, where $H_1$ is an algebraic group over $F$ and $[\psi]$ is an equivalence class of inner twistings from $H$ to $H_1$. By an isomorphism between two inner forms $(H_1, [\psi])$ and $(H_1', [\psi'])$ of $H$, we mean an $F$-group isomorphism $H_1 \isom H_1'$ under which $[\psi]$ is identified with $[\psi']$.
By abuse of notation, we often denote an inner form $(H_1, [\psi])$ simply by $H_1$, if no confusion can arise.

In the setting of Definition <ref>, there is a bijection from the set of isomorphism classes of inner forms of $H$ to $\coh^1(F, H^{\ad})$, sending $(H_1, [\psi])$ to the class of the cocycle $\rho \mapsto \psi^{-1} \circ \lix^{\rho} \psi$. Note that the natural map $\coh^1(F,H^{\ad}) \to \coh^1(\Gal(\ol F/F), \Aut(H_{\ol F}))$ is in general not injective. The image of this map classifies the $F$-isomorphism classes of algebraic groups $H_1$ over $F$ which can be extended to an inner form $(H_1, [\psi])$ of $H$.

Let $I$ and $G$ be connected reductive groups over a field $F$. By an inner transfer datum from $I$ to $G$, we mean a pair $(f, \cW)$, where $f$ is an injective $\overline F$-homomorphism $I_{\overline F} \to G_{\overline F}$, and $\cW$ is a non-empty subset of $G(\overline F)$, satisfying the following conditions:

* For each $g \in \cW$, there is an $F$-subgroup $\cI_g \subset G$, such that $\Int(g) (\im f) = (\cI_g)_{\overline F}$, and such that the $\overline F$-isomorphism $\psi_g: = \Int(g) \circ f : I_{\overline F} \isom (\cI_g)_{\overline F}$ is an inner twisting between the $F$-groups $I$ and $\cI_g$.

* For all $g_1, g_2 \in  \cW$, the $\overline F$-isomorphism $\psi_{g_1,g_2}: = \Int(g_2 g_1^{-1}) : (\cI_{g_1})_{\overline F} \isom (\cI_{g_2})_{\overline F}$ is an inner twisting between the $F$-groups $\cI_{g_1}$ and $\cI_{g_2}$.

Let $F$ be a local or global field of characteristic zero, and let the symbol $?$ be as in <ref>. Let $I, G$ be connected reductive groups over $F$, and let $(f,\cW)$ be an inner transfer datum from $I$ to $G$ (Definition <ref>). Choose an element $g \in \cW$, and let $\cI_g, \psi_g$ be as in Definition <ref>. Since $\psi_g$ is an inner twisting, it induces an isomorphism $\mathscr Z_I \to \mathscr Z_{\cI_g}$ between complexes in $\Mult(F)$, and in particular an isomorphism $\psi_{g,*}: \coh^i_{\ab}(?, I) \isom \coh^i_{\ab} (? , \cI_g), \forall i \in \ZZ$. Since inner automorphisms of $G_{\overline F}$ act as the identity on $\mathscr Z_G$, the composite homomorphism

$$ \coh^i_{\ab}(?, I) \xrightarrow{\psi_{g,*}} \coh^i_{\ab} (? , \cI_g) \to \coh^i_{\ab}(?, G) $$
is independent of the choice of $g$, and we say that it is induced by $(f, \cW)$.

Now assume that $F$ is global, and let $S$ be a (finite or infinite) set of places of $F$ containing all the archimedean places. We let

\begin{align*}
\Sha^S (F, I) &: = \ker (\coh^1(F, I) \to \prod_{v\in S} \coh^1(F_v, I) ) ,\\ \Sha^S_{\ab} (F, I) &: = \ker (\coh^1_{\ab}(F, I) \to \prod_{v\in S} \coh^1_{\ab}( F_v, I) ).
\end{align*}
By <cit.>, we have a canonical isomorphism

\begin{align}\label{eq:Sha ab}
\Sha^S (F, I) \cong \Sha ^S_{\ab} (F,I )\end{align}

induced by $\ab^1_F$. In the sequel we shall often make this identification implicitly.

The homomorphism $\coh^1_{\ab}(F, I) \to \coh^1_{\ab}(F, G)$ induced by $(f,\cW)$ restricts to a homomorphism

$$  \Sha ^S_{\ab} (F, I) \To  \Sha^S_{\ab} (F, G).$$
We  denote the kernel of this homomorphism by
$$\Sha^S_G (F, I).$$
Via (<ref>) we also view $\Sha^S_G(F, I)$ as a subset of $\coh^1(F, I)$.

More generally, for any $\Q$-subgroup $I' \subset I$, we denote by $\Sha^S_G (F,I')$ the kernel of the composite
$$\Sha^S_{\ab} (F, I') \to \Sha^{S}_{\ab} (F, I) \to \Sha^{S}_{\ab} (F, G).$$

If $S$ is the set of all places we omit $S$ from the notation, and write $\Sha(F, I)$, $\Sha _G(F, I)$, etc.

Let $G$ be a connected reductive group over $\QQ$. Let $\mathcal I$ be a connected reductive subgroup of $G$ defined over $\Q$. Let $\tilde {\mathcal I}$ be the inverse image of $\mathcal I$ in $G_{\sconn}$. Assume that $\cI$ contains a maximal torus in $G$ defined over $\Q$, and assume that $\tilde {\mathcal I}$ is connected reductive. Then the natural map $\Sha _{G_{\sconn}} ^{\infty} (\QQ, \tilde {\mathcal I}) \to \Sha_G^{\infty}(\QQ, {\mathcal I})$ is surjective. (Here $\Sha _{G_{\sconn}} ^{\infty} (\QQ, \tilde {\mathcal I})$ is defined using the trivial inner transfer datum $(f,\cW)$, where $f$ is the inclusion and $\cW$ contains $1$. Similarly, $\Sha_G^{\infty}(\QQ, {\mathcal I})$ is defined using the trivial inner transfer datum.)

In the current situation $\Sha_G^{\infty}(\Q, \cI)$ is nothing but the kernel of the natural map $\coh^1(\Q, \cI) \to \coh^1(\RR, \cI) \oplus \coh^1(\Q, G)$, whose second component is induced by the inclusion $\cI \hookrightarrow G$. The similar remark holds for $\Sha_{G_{\sconn}}^{\infty}(\Q, \tilde \cI)$. Now let $\beta \in \Sha_G^{\infty} (\QQ, {\mathcal I})$. Then there exists $g \in G(\overline \QQ)$ such that $\beta$ is represented by the cocycle

$$\Gamma \ni \tau \mapsto g^{-1} \leftidx^{\tau} g \in {\mathcal I} (\overline \QQ). $$

Note that we may replace $g$ by any other element of $G(\QQ) g {\mathcal I}(\overline \QQ)$, without changing the class $\beta$. Since $\beta$ is trivial at $\infty$, we have
$g\in G(\RR) {\mathcal I}(\CC)$. By real approximation, we can left-multiply $g$ by an element of $G(\QQ)$ to arrange that
$$g \in G(\RR) ^+ {\mathcal I}(\CC). $$
Let $\pi$ denote the projection $G(\RR) \to G^{\ab} (\RR)$. Since $\pi (G(\RR)^+)  \subset G^{\ab}(\RR)^+ = \pi(T(\RR)^+)$, we have $G(\RR) ^+ \subset G_{\der} (\RR) T(\RR)^+ \subset G_{\der}(\RR) \cI(\RR)$. Thus we have
$$g\in G_{\der} (\RR) {\mathcal I}(\CC). $$
Again by real approximation, we may further left-multiply $g$ by an element of $G_{\der}(\QQ)$ to arrange that
$$g\in G_{\der} (\RR)^+ {\mathcal I}(\CC). $$
Now since $G(\overline \QQ) = G_{\der} (\overline \QQ) T(\overline \QQ)$, we may right-multiply $g$ by an element of $T(\overline \QQ)$ to arrange that

$$g \in G_{\der} (\overline \QQ) \cap G_{\der} (\RR) ^+ {\mathcal I}(\CC). $$

Now we pick a lift $\tilde g \in G_{\sconn} (\overline \QQ)$ of $g \in G_{\der} (\overline \QQ)$. Since $G_{\sconn} (\RR)$ (which is connected by Cartan's theorem) maps onto $G_{\der} (\RR) ^+$, we have $\tilde g \in G_{\sconn} (\RR) \tilde {\mathcal I}(\CC)$. The cocycle

$$ \Gamma \ni \tau \mapsto \tilde g^{-1} \leftidx ^{\tau} (\tilde g) $$
is then valued in $\tilde {\mathcal I}(\overline \Q)$ (since $g^{-1 } \leftidx^{\tau} g \in {\mathcal I}(\overline \QQ)$), and represents a class in $\Sha _{G_{\sconn}} ^{\infty} (\QQ, \tilde {\mathcal I})$ lifting $\beta$.

In the setting of the above lemma, we in fact have $\Sha _{G_{\sconn}}^{\infty}  (\QQ, \tilde {\mathcal I}) = \Sha ^{\infty}_{\ab} (\QQ, \tilde {\mathcal I})$, because $\coh ^1_{\ab} (\QQ, G_{\sconn}) = 0 $.

Let $I, G$ be connected reductive groups over $\Q$, and let $(f,\cW)$ be an inner transfer datum from $I$ to $G$. Assume that $I$ and $G$ have the same absolute rank. For each $g \in \cW$, we know that $\cI_{g}$ contains a maximal torus in $G$ defined over $\Q$, and in particular $\cI_{g}$ contains $Z_G$. Let $Z$ be a $\QQ$-subgroup of $Z_G$. Note that $f^{-1}(Z)$ is a $\QQ$-subgroup of $I$, and $f$ induces a $\Q$-isomorphism $f^{-1}(Z) \isom Z$. Let
$\bar  I : = I /f^{-1}(Z)$ and $\bar G : = G/Z$. Then $(f,\cW)$ induces an inner transfer datum $(\bar f, \overline{\cW})$ from $\bar I$ to $\bar G$. We use $(f,\cW)$ to define $\Sha_G^{\infty} (\Q, I)$, and use $(\bar f, \overline{\cW})$ to define $\Sha_{\bar G}^{\infty}(\Q, \bar I)$

In the setting of <ref>, the natural map $\Sha _{G}^{\infty} (\QQ, I) \to \Sha _{\bar G} ^{\infty} (\QQ, \bar I)$ is surjective.

By picking an arbitrary element $g\in \cW$ and replacing $I$ by $\cI_g$, we reduce to the following situation:

* $I$ is a $\Q$-subgroup of $G$ containing a maximal torus in $G$,

* $f$ is the inclusion,

* $\cW$ contains $1$.

Since $G_{\sconn} = (\bar G)_{\sconn}$, and since the inverse image of $I$ in $G_{\sconn}$ is equal to the inverse image of $\bar I$ in $(\bar G)_{\sconn}$, the corollary immediately follows from Lemma <ref>.

Let $F$ be a field of characteristic zero. Let $I \rightarrow S$ be a surjective homomorphism from a connected reductive group $I$ to a torus $S$ over $F$. Let $I'$ be the kernel.

* We have $Z_I \cap I' = Z_{I'}$, and we have short exact sequences

$$1\to Z_{I'} \to I' \to I^{\ad} \to 1 $$

$$ 1 \to Z_{I'} \to Z_I \to S \to 1.$$

* The maps

$$f_1: I(F) \rightarrow I^{\ad}(F) \xrightarrow {\delta^1 }  \coh ^1 (F, Z_{I'}) $$

$$f_2: I(F) \rightarrow S(F) \xrightarrow {\delta^2}  \coh ^1(F, Z_{I'}) $$

differ by a sign. Here the maps $\delta^1,\delta^2$ are the boundary maps induced by the short exact sequences in (i). In particular, every element of the image of $f_1$ or $f_2$ has trivial image in $\coh^1(F,I')$ and trivial image in $\coh^1(F,Z_I)$.

Part (i) follows from the fact that $I'$ contains $I_{\der}$. For part (ii), let $i \in I(F)$ and write $i = i_0i_1 = i_1 i_0 $ with $i_0 \in I'(\ol F)$ and $i_1 \in Z_I(\ol F).$
Then $f_2(i)$ is represented by the cocycle
$( i_1^{-1} \lix ^{\rho}i_1 )_{\rho}$ in $Z^1(F, Z_{I'})$. Since $\lix ^{\rho}i = i$, this cocycle equals
$( i_0 \lix^ {\rho}i_0^{-1} )_\rho$, which represents $- f_1(i)$.

In Lemma <ref>, take $F = \Q$, and take $I \to S$ to be the natural map $I \to I^{\ab}$, so that $I' = I_{\der}$. Then the image of $I(\Q)_+$ in $\coh ^1(\Q, Z_{I_{\der}})$, under either of the maps $f_1$ or $f_2$, is contained in $\Sha^{\infty}_{I_{\der}} (\Q, Z_{I_{\der}})$.

Using the notation of Lemma <ref>, the image of $I^{\ad}(\R) ^+$ under the boundary map $\delta^1 : I^{\ad}(\R) \to \coh ^1 (\R, Z_{I_{\der}} )$ is trivial, because the image of $I_{\der}(\R)\to I^{\ad}(\R)$ contains $I^{\ad} (\R) ^+$. The corollary then follows from Lemma <ref>.

§.§ The Kottwitz homomorphism

Let $F$ be a field of characteristic $0$, $\overline F$ an algebraic closure, and $\Gamma_F = \Gal(\overline F/F).$ Let $G$ be a reductive group over $F.$ Recall that, when $F$ is complete, discretely valued, with algebraically closed residue field, the Kottwitz homomorphism is a homomorphism $ G(F) \rightarrow \pi_1(G)_{\Gamma_F}$
which is functorial in $G,$ and for $G = \mathbb G_m$ is the valuation map $F^{\times} \to \ZZ$. The original construction in <cit.> relies on Steinberg's theorem for $F$.

Here we generalize the construction of the Kottwitz homomorphism. We shall obtain a homomorphism $\kappa_G^{R,v}: G(R) \to \pi_1(G)_{\Gamma_F}$, where $R$ is any $F$-algebra (with $F$ arbitrary) equipped with a discrete valuation $v$. This will allow us to show that the Kottwitz homomorphism
is constant in certain families.

Let $\site$ be the big fpqc site of $\Spec F$. Let $\Abshv (\site)$ be the category of abelian sheaves on $\site$. We shall view $\Mult(F)$ and $\Tori(F)$ (see <ref>) as full subcategories of $\Abshv(\site)$. Let $\cD(\site)$ be the derived category of $\Abshv(\site)$, and let $\cD^{[-1,0]}(\site)$ be the full subcategory of $\cD(\site)$ consisting of those $L \in \dercat{\site}$ such that $\coh^i(L) = 0$ unless $i\in \set{-1,0}$.

We shall need the formalism of Picard stacks[We omit the adjective “strictly commutative”, as that will always be understood.] on $\site$, as in <cit.>. Following loc. cit., let $\Ch(\site)$ be the category whose objects are the small Picard stacks on $\site$, and whose morphisms are the isomorphism classes of additive functors between Picard stacks. By <cit.>, we have an equivalence of categories
$$\ch: \cD^{[-1,0]}(\site) \to \Ch(\site).$$
For a complex $C^{\bullet} = (C^{-1} \to C^0)$ in $\Mult(F)$ (at degrees $-1, 0$), $\ch(C^{\bullet})$ is given by the quotient stack $[C^{-1} \backslash C^0]$.

As in Proposition <ref>, we have an equivalence of categories

$$\RX_*: \dercat{\Mult(F)} \to \dercat{\GFMod}.$$

We fix once and for all a quasi-inverse $\mathcal Y$ of $\RX_*$, and natural isomorphisms $\epsilon: \RX_* \circ \mathcal Y \to \id$ and $\eta: \id \to \mathcal Y \circ \RX_* $.

Let $G$ be a reductive group over $F.$ Let $\mathscr Z_G$ be as in Definition <ref>. By Proposition <ref>, we have a canonical isomorphism $\RX_*(\mathscr Z_G) \cong \pi_1(G)$ in $\dercat{\GFMod}$. Let $\mathrm {pr}: \pi_1(G) \to \pi_1(G)_{\Gamma_F}$ be the canonical map, viewed as a morphism in $\dercat{\GFMod}$. Let
$$\mathscr Z_G^F : = \mathcal Y(\pi_1(G)_{\Gamma_F}) \in \dercat{\Mult(F)}, $$
and let
$$\kappa_0: \mathscr Z_G \To \mathscr Z_G^F$$
be given by the composite

$$ \mathscr Z_G \xrightarrow{\eta} \mathcal Y (\RX_*(\mathscr Z_G)) \xrightarrow{\mathcal Y(\mathrm {pr})} \mathcal Y (\pi_1(G)_{\Gamma_F}) = \mathscr Z_G^F.$$
Thus we have a canonical isomorphism
$$\epsilon : \RX_*(\mathscr Z_G^F) \isom \pi_1(G)_{\Gamma_F}.$$

In $\dercat{\Mult(F)}$, $\mathscr Z_G^F$ is isomorphic to a complex of the form
$$T^{-1} \To T^0, $$
where $T^{-1}$ and $T^0$ are split tori over $F$ and located at degrees $-1 $ and $0$. In particular, the image of $\mathscr Z_G^F$ in $\cD(\site)$ lies in $\cD^{[-1,0]} (\site)$.

This follows from the fact that $\pi_1(G)_{\Gamma_F}$ is isomorphic to a complex $L^{-1} \to L^0$ in $\dercat{\GFMod}$, where $L^{-1}$ and $L^0$ are finite free $\ZZ$-modules with the trivial $\Gamma$-action.

We write $\mathscr K^F_G$ for $\ch(\mathscr Z_G^F) \in \Ch(\site)$, and call it the Kottwitz stack of $G$ over $F$. The inclusions induce a canonical equivalence between quotient stacks $[Z_{G_\sconn} \backslash Z_G] \to [G_{\sconn} \backslash G]$. Thus we obtain a functor between stacks on $\site$:

$$\kappa_G^{\can}: G \To [G_{\sconn} \backslash G] \isom [Z_{G_\sconn} \backslash Z_G] \cong \ch(\mathscr Z_G) \xrightarrow{\ch(\kappa_0)} \ch(\mathscr Z_G^F)  = \mathscr K^F_G,$$
which is canonical up to isomorphism.

For any small Picard category $P$ (strictly commutative, as always), we denote by $\pi_0(P)$ the set of isomorphism classes of $P$, which is naturally an abelian group. Then $\kappa_G^{\can}$ induces a morphism

$$ \pi_0(\kappa_G^{\can}) : G \To \pi_0( \mathscr K^F_G (\cdot))$$
of presheaves in groups[We caution the reader that the right hand side is not a sheaf.] on $\site$.

Now choose $T^{\bullet} = (T^{-1}\to T^0)$ as in Lemma <ref>, and choose an isomorphism $f : T^{\bullet} \isom \mathscr Z_G^F$ in $\dercat{\Mult(F)}$.  If $R$ is any $F$-algebra with $\Pic(\Spec R) = \{1\}$, then we have canonical isomorphisms of abelian groups

\begin{multline}\label{eq:ch to coh0}
\pi_0 \big( \ch(T^\bullet) (R) \big ) \cong  T^0(R)/ T^{-1}(R) \\ \cong  (X_*(T^0)/X_*(T^{-1})) \otimes_{\ZZ} R^\times  \cong \coh^0(\RX_*(T^{\bullet})) \otimes_{\ZZ} R^\times , \end{multline}
since $T^{-1}$ is a split torus.  In this case, consider the composite isomorphism:

\begin{multline*}
\gamma_R:  \pi_0 (\mathscr K^F_G (R) )  \xrightarrow{f^{-1}}  \pi_0 \big( \ch(T^{\bullet}) (R) \big )  \cong \coh^0(\RX_*(T^{\bullet})) \otimes R^{\times } \\  \xrightarrow{f} \coh^0(\RX_* (\mathscr Z^F_G)) \otimes  R^{\times} \xrightarrow{\epsilon} \pi_1(G)_{\Gamma_F} \otimes R^\times.
\end{multline*}

Then $\gamma_R$ is independent of the choice of $(T^{\bullet}, f)$, by the functoriality of (<ref>) in $T^{\bullet}$.

If $R$ is a commutative ring, by a discrete valuation on $R$, we mean a function $v: R \to \ZZ \cup \set{\infty}$ satisfying $v(0) = \infty$, $v(1) = 0$, $v(ab) = v(a) +v(b)$, and $v(a +b) \geq \min(v(a), v(b))$, for all $a,b\in R$. (Here $\infty >n, \forall n\in \ZZ$, and we do not require $v(a) =\infty \Rightarrow a=0$.)

Now consider an $F$-algebra $R$ satisfying $\Pic(\Spec R) = \set{1}$, and a discrete valuation $v$ on $R$. Composing the canonical map $\pi_0(\kappa_G^{\can})$ in <ref> with the canonical map $\gamma_R$ in <ref>, we obtain the canonical map

$$ \kappa_G^R: G(R) \xrightarrow{\pi_0(\kappa_G^{\can})} \pi_0 (\mathscr K_G^F (R) )   \xrightarrow{\gamma_R} \pi_1(G)_{\Gamma_F} \otimes R^{\times},$$
which is a group homomorphism.
On composing the above with $v: R^{\times} \to \ZZ$, we obtain the group homomorphism

\begin{align}\label{eq:kappa^R,v}
\kappa_G^{R,v} : G(R) \xrightarrow{\kappa_G^R} \pi_1(G)_{\Gamma_F} \otimes R^{\times} \xrightarrow{v} \pi_1(G)_{\Gamma_F}.
\end{align}

We now extend the definition of $\kappa_G^{R,v}$, dropping the hypothesis $\Pic(\Spec R) = \set{1}$.

Let $R$ be an arbitrary $F$-algebra, and let $v$ be a discrete valuation on $R$. The elements $r \in R$ with $v(r) = \infty$
form a prime ideal $\mathfrak p$, and $v$ factors as $R \to \Frac(R/\mathfrak p) \xrightarrow{\bar v} \ZZ \cup \set{\infty}$. We define $\kappa_G^{R,v}$ to be the composition
$$G(R)  \To G(\Frac (R/\mathfrak p)) \xrightarrow{\kappa_G^{\Frac(R/\mathfrak p), \bar v} } \pi_1(G)_{\Gamma_F}.$$
We call $\kappa_G^{R,v}$ the Kottwitz homomorphism. We often simply write $\kappa_G^v$ for $\kappa_G^{R,v}$.

In Definition <ref>, if $R$ satisfies $\Pic(\Spec R) = \set{1}$, one checks that the definition of $\kappa_G^{R,v}$ agrees with the previous definition (<ref>). Moreover, the generally defined $\kappa_G^{R,v}$ (without the hypothesis $\Pic(\Spec R) = \set{1}$) is functorial in the pair $(R,v)$ in the following sense. Let $R'$ be another $F$-algebra equipped with a discrete valuation $v'$. Suppose there is an $F$-algebra map $h: R\to R'$ such that $v$ is the pull-back of $v'$ along $h$. Then $\kappa_G^{R,v}$ equals the composition $G(R) \xrightarrow{h} G(R') \xrightarrow{\kappa _G^{R',v'}} \pi_1(G)_{\Gamma_F}$. For fixed $(R,v)$, the homomorphism $\kappa_G^{R,v}$ is also functorial in the reductive group $G$ over $F$, i.e., it is a natural transformation between the functors $G \mapsto G(R)$ and $G \mapsto \pi_1(G)_{\Gamma_F}$. Using this, one easily checks that $\kappa_G^{F,v}$ agrees with Kottwitz's original construction in <cit.>, in the special case when $(F,v)$ is a complete discretely valued field with algebraically closed residue field.

Let $R$ be an $F$-algebra, and let $v_1, \dots, v_n$ be a collection of discrete valuations on $R$. Let $a_1,\dots, a_n \in \mathbb Z$. Suppose that

* $\sum_{i=1}^n a_i v_i(u) = 0$ for all $u\in R^{\times}$, and

* the group $\Pic(\Spec R)$ is trivial.

Then $\sum_{i=1}^n a_i\kappa_G^{v_i}(h) = 0$ for all $h \in G(R).$

By condition (ii), each $\kappa_G^{v_i}$ factors as in (<ref>). Thus the map $\sum_i  a_i \kappa_G^{v_i}$ factors through the map $\id \otimes \sum a_i v_i : \pi_1(G)_{\Gamma_F} \otimes R^{\times} \to  \pi_1(G)_{\Gamma_F}$, which is zero by (i).

Let $R \supset F$ be a domain, and $v_1, \ldots , v_n$
a collection of discrete valuations on $R$. Let $a_1,\dots, a_n \in \mathbb Z$. Suppose that $R = R^\circ[1/f_j]_{j=1}^m,$ where $R^\circ \subset R$ is a subring and $f_j \in R^{\circ}$ are non-zero prime elements, satisfying the following conditions.

* The ring $R^{\circ}$ is a noetherian locally factorial domain.

* For $i=1, \dots, n$, we have $v_i(R^\circ) \subset \ZZ_{\geq 0} \cup \set{\infty}$.

* $\sum_{i=1}^n a_iv_i(f_j) = 0$ for each $j=1,\ldots, m.$

Then $\sum_{i=1}^n a_i\kappa^{v_i}_G(h) = 0$ for all $h \in G(R)$.

Let $R^{\circ\prime}$ be the ring obtained from $R^{\circ}$ by inverting all elements $f$
such that $v_i(f) = 0$ for all $i.$ The conditions of the proposition continue to hold if we replace $R^{\circ}$ (resp. $R$) by $R^{\circ\prime}$ (resp. $R^{\circ\prime}[1/f_j]_{j=1}^m$), and omit from the list of $f_j$ those elements such that $v_i(f_j) = 0$ for all $i$ (as they become units in $R^{\circ\prime}$). By the functoriality of the Kottwitz map as discussed in <ref>, we reduce to the case where $R^{\circ}= R^{\circ\prime}.$ Then $R^{\circ}$ is semi-local, as each proper ideal is contained in one of the prime ideals $\mathfrak p_i = \set{x\in R^{\circ}\mid v_i(x) >0}, i = 1,\dots,n$.

Since $R^{\circ}$ is noetherian and locally factorial, the restriction map $\Pic(\Spec R^{\circ}) \to \Pic(\Spec R)$ is surjective (see <cit.>). Since $R^{\circ}$ is semi-local, we have $\Pic(\Spec R^{\circ}) = \Pic(\Spec R) = \set{1}$.

Now since the $f_j$ are prime in $R^{\circ}$, any unit in $R$ has the form $u = w f_1^{e_1}\dots f_m^{e_m}$ where
$w \in R^{\circ\times}, e_j \in \ZZ.$ Since $v_i(w) = 0$ for all $i$, we have

$$ \sum_{i=1}^n a_iv_i(u) =  \sum_{j=1}^m e_j \sum_{i=1}^n a_iv_i(f_j) = 0.$$

The proposition now follows from Proposition <ref>.

Suppose that $F$ is equipped with a discrete valuation $v_F: F \rightarrow \mathbb Z\cup\{\infty\}$ with ring of integers $\O_F,$ and that $\cG$ is a smooth affine group scheme over $\O_F$ extending $G.$ Assume that $\cG$ has connected
fibers. Then $\kappa_G^{v_F}: G(F) \to \pi_1(G)_{\Gamma_F}$ maps $\cG(\O_F)  \subset G(F)$ to $\set{0}$.

Let $R^{\circ}$ be the affine ring of $\cG$. Let $\pi_F \in \oo_F$ be a uniformizer.
Our conditions imply that $\pi_F$ is a prime element of the noetherian domain $R^{\circ},$ and hence $R^{\circ}_{(\pi_F)}$ is a DVR. Let $v_0$ be the pull-back to $R^{\circ}$ of the canonical discrete valuation on $R^{\circ}_{(\pi_F)}$. Let $g \in \cG(\O_F).$ We also consider the valuation $v_{g}$ given by
$R^{\circ} \xrightarrow {g}\O_F \xrightarrow{v_F} \ZZ \cup \set{\infty}$. In the following we show that $\kappa_G^{v_F}(g) = 0$.

Let $R = R^{\circ}[1/\pi_F]$.
Note that $v_0(\pi_F) = v_{g}(\pi_F) = 1$. In particular, $v_0$ and $v_g$ extend to $R$. Since $R^{\circ}$ and $v_0, v_g$ satisfy conditions (i) (ii) in Proposition <ref>, and since $v_0(\pi_F) - v_g(\pi_F) = 0$, we may apply that proposition to conclude that
$\kappa^{v_0}_G(h) - \kappa_G^{v_{g}}(h) =0 $ for all $h \in G(R)$.
Applying this to $h = g_u$, where $g_u$ is the universal point in $\cG(R^{\circ}) \subset G(R)$, we get

$$ \kappa^{v_0}_G(g_u) = \kappa_G^{v_{g}}(g_u) = \kappa_G^{v_F}(g),$$
where the second equality follows from functoriality (<ref>).
This shows that $\kappa_G^{v_F}(g)$ does not depend on $g \in G(R).$
Hence it must be $0,$ its value on the identity.

In Corollary <ref>, if $\cG$ is a parahoric group scheme ([43]), and if the discretely valued field $(F,v_F)$ is strictly henselian, then the conclusion follows from <cit.>.

Keep the setting and notation of Corollary <ref>. Assume that $\cG$ is reductive,
and $F$ is complete. Let $\pi _F \in F$ be a uniformizer. Let $\cS \subset \cG$ be a maximal split torus. Then we have the Cartan–Iwahori–Matsumoto decomposition

$$ G(F) = \bigcup_{\mu \in X_*(\cS)} G(\O_F)\mu(\pi_F)G(\O_F).$$
(The union is not disjoint.) The decomposition in this generality is proved in <cit.>.

Keep the setting of <ref>.	If $g \in G(F)$ belongs to the double coset indexed by $\mu \in X_*(\cS),$ then $\kappa_G^{v_F}(g) = [\mu]$, where $[\mu]$ is the image of $\mu$ under the natural map $X_*(\cS) = \pi_1(\cS_{F}) \to \pi_1(G) \to \pi_1(G)_{\Gamma_F}$.

By Corollary <ref>, it suffices to show that $\kappa_G^{v_F}(\mu(\pi_F)) = [\mu].$ But this follows from the functoriality of the Kottwitz map in the group $G$.

§.§ Decent elements and twisting

Throughout this subsection, we fix a prime $p$, and denote by $\sigma$ the arithmetic $p$-Frobenius in $\Aut(\LL)$.

Let $G$ be a connected reductive group over $\QQ_p$. For $b\in G(\breve \Q_p)$, we write $\nu_b$  for the Newton cocharacter of $b$, which is a fractional cocharacter of $G_{\LL}$; see <cit.> and <cit.>. Following <cit.>, we say that $b$ is decent, if there exists $n \in \ZZ_{\geq 1}$ such that $n\nu_b$ is a cocharacter of $G_{\LL}$, and such that

\begin{align}\label{eq:n-decency}
b \sigma(b ) \cdots \sigma^{n-1} (b) = (n \nu_b) (p).
\end{align}

In this case, we also say that $b$ is $n$-decent.

For any $n$-decent $b \in G(\LL)$, it is shown in <cit.> that $b \in G(\QQ_{p^n})$, and that $\nu_b$ is defined over $\QQ_{p^n}$. In particular, if $b$ is $n$-decent, then it is also $n'$-decent for $n|n'$. Clearly the condition that an element of $G(\Q_{p^n})$ is $n$-decent is invariant under $\sigma$-conjugation by $G(\Q_{p^n})$. Conversely, if $b,b'$ are $n$-decent and if $b' = g b \sigma(g)^{-1}$ for some $g\in G(\breve \Q_p)$, then necessarily $g\in G(\Q_{p^n})$; see <cit.>.

We denote by $\B(G)$ the set of $\sigma$-conjugacy classes in $G(\LL)$. For $b \in G(\LL)$, we denote its class in $\B(G)$ by $[b]$. We recall Kottwitz's classification of elements of $\B(G)$. Let $\Newton(G)$ denote the set of $\sigma$-stable $G(\LL)$-conjugacy classes of fractional cocharacters of $G_{\LL}$. The association $b\mapsto \nu_b$ descends to the Newton map
$\bar \nu : \B(G) \to \Newton (G)$. As in <ref>, we have the Kottwitz homomorphism $w_G: G(\breve \Q_p) \to \pi_1(G)_{\Gamma_{p,0}}$ associated with the $p$-adic valuation on $\breve \Q_p$. By <cit.>, $w_G$ is surjective, and descends to a map $\kappa_G: \B(G) \to \pi_1(G)_{\Gamma_p} ,$ called the Kottwitz map. By <cit.>, the map
$$(\bar \nu, \kappa_G): \B(G) \To \Newton(G) \times \pi_1(G)_{\Gamma_p}$$
is injective.

It is proved by Kottwitz <cit.> (cf. <cit.>) that every $\sigma$-conjugacy class in $G(\LL)$ is represented by a decent element. Thus $\B(G)$ is in natural bijection with the set of $G(\Q_p^{\ur})$-orbits in the set of decent elements of $G(\Q_p^{\ur})$, where $G(\Q_p^{\ur})$ acts by $\sigma$-conjugation.

Let $b \in G(\LL)$. The functor sending any $\QQ_p$-algebra $R$ to the group

$$ J_b (R) : = \set{g\in G(R\otimes _{\QQ_p} \LL) \mid gb = b \sigma (g)}$$
is represented by a reductive group $J_b$ over  $\QQ_p$. We shall also write $J_b^G$ for $J_b$, to make the presence of $G$ explicit. If $b$ is decent (so $b \in G(\Q_p^{\ur})$), then by <cit.>, there is a canonical $\Q_p^{\ur}$-isomorphism from $J_{b, \Q_p^{\ur}}$ to the centralizer $G_{\Q_p^{\ur}, \nu_b}$ of $\nu_b$ in $G_{\Q_p^{\ur}}$. (In this case, for any $\Qpur$-algebra $R$ we have $J_b(R)\subset G(R \otimes_{\Q_p} \Q_p^{\ur})$, and the embedding $J_{b,\Qpur} \to G_{\Qpur}$ is induced by the natural map $R \otimes_{\Q_p} \Q_p^{\ur} \to R$.)
In this case the action of $\sigma$ on $G_{\Q_p^{\ur}, \nu_b}(\Q_p^{\ur})$ with respect to the $\Q_p$-form $J_b$ is given by $g \mapsto b \sigma (g) b^{-1}$, where $\sigma(\cdot)$ is defined with respect to the $\Q_p$-form $G$.

If $b$ is decent and if

\begin{align}\label{eq:W non-empty}
\cW : = \set{c \in  G(\Q_p^{\ur}) \mid c \nu_b c^{-1}\text{ is defined over } \Q_p} \neq \emptyset,
\end{align}
then the canonical embedding $J_{b , \Q_p^{\ur}} \to G_{\Q_p^{\ur}}$ and $\cW$ form an inner transfer datum from $J_b$ to $G$ (Definition <ref>). We thus obtain a canonical map

\begin{align}\label{eq:from coh J_b}
\coh^1(\Q_p, J_b) \cong \coh^1_{\ab}(\Q_p, J_b) \to \coh^1_{\ab}(\Q_p, G).
\end{align}

Note that for $b$ decent, (<ref>) holds in the following two cases:

* $G$ is quasi-split over $\Q_p$.

* $b$ is basic in $G$, i.e., $\nu_b$ is central.

Indeed, the $G(\Q_p^{\ur})$-conjugacy class of $\nu_b$ is always stable under $\Gal(\Q_p^{\ur}/\Q_p)$. In case (i), this conjugacy class must contain a fractional cocharacter defined over $\Q_p$. In case (ii), $\nu_b$ itself is already defined over $\QQ_p$.

We remark that in case (ii), the canonical inner transfer datum from $J_b$ to $G$ equips $J_b$ with the structure of an inner form of $G$. The isomorphism class of this inner form of $G$ (see Definition <ref>) depends only on $[b] \in \B(G)$, not on the decent representative $b$.

Let $G$ be a connected reductive group over $\Q_p$. Let $b \in G(\LL)$ be a decent element, and fix an element $\beta \in \coh^1(\Q_p, J_b)$. By Steinberg's theorem, $\beta$ is represented by a cocycle $ (a_{\rho})_{\rho} \in Z^1(\Q_p^{\ur}/\Q_p, J_b(\Q_p^{\ur}))$. Under the canonical isomorphism $J_{b, \Q_p^{\ur}} \isom G_{\Q_p^{\ur}, \nu_b}$, we view $a_{\sigma} \in J_b(\Q_p^{\ur})$ as an element of $G(\Q_p^{\ur})$, and define $b' : = a_{\sigma} b \in G(\Q_p^{\ur})$. It is easy to see that the $\sigma$-conjugacy class of $b'$ in $G(\Q_{p}^\ur)$ depends only on $b, \beta$, not on $(a_{\rho})_{\rho}$. We shall say that (the $\sigma$-conjugacy class of) $b'$ is the twist of $b$ by $\beta$.

In the setting of <ref>, we have $\nu_{b'} = \nu_b$, and $b'$ is decent. Moreover, if (<ref>) holds for $b$ (e.g., if $G$ is quasi-split), then $\kappa_G([b']) - \kappa _G([b])$ is equal to the image of $\beta$ under

$$ \coh^1(\Q_p, J_b) \to  \coh^1_{\ab}(\Q_p, G) \isom \pi_1(G)_{\Gamma_p, \tors}, $$
where the first map is (<ref>), and the second isomorphism is as in Proposition <ref>.

Choose $n\in\NN$ to be divisible enough such that
$$(a_{\rho})_{\rho} \in Z^1(\Q_{p^n}/\Q_p, J_b(\Q_{p^n})), $$
and such that $b$ is $n$-decent. Using that $(a_{\rho})_{\rho}$ is a cocycle, one shows by induction that

$$ a_{\sigma^i} = b' \sigma (b') \cdots \sigma ^{i-1} (b') \sigma ^{i-1}(b^{-1}) \cdots \sigma (b^{-1}) b^{-1} ,$$
for each $ i \in \ZZ_{\geq 1}$. Since $a_{\sigma^n} =1$, we have

$$ b' \sigma (b') \cdots \sigma ^{n-1} (b') = b \sigma (b) \cdots \sigma ^{n-1} (b). $$

Since $b$ is $n$-decent, the right hand side is equal to $p^{n\nu_b}$. By the characterization of $\nu_{b'}$ (see <cit.>), we conclude that $\nu_{b'} = \nu_b$, and that $b'$ is $n$-decent.

We now prove the statement about $\kappa_G([b']) - \kappa_G([b])$. Since (<ref>) holds, we can replace $b$ by a $\sigma$-conjugate in $G(\Q_{p}^{\ur})$ and assume that $\nu_b$ is defined over $\Q_p$. Then we can replace $G$ by $G_{\nu_b}$ and reduce to the case where $\nu_b$ is central. To finish the proof we only need to show that the image of $\beta$ under the composite isomorphism $\coh^1(\Q_p, J_b) \cong \coh^1_{\ab}(\Q_p, J_b) \cong \pi_1(J_b)_{\Gamma_p, \tors}$ is equal to $\kappa_{J_b} (a_{\sigma}).$ This follows from <cit.> applied to $J_b$ (cf. <cit.>).

§.§ Shimura varieties and their cohomology

Let $H$ be a locally profinite group admitting a countable neighborhood basis of the identity.	Let $B$ be a locally noetherian scheme. Let $S$ be a $B$-scheme equipped with a right $H$-action via $B$-automorphisms. We say that the action is admissible if there exists a class $\mathscr K$ of compact open subgroups of $H$ satisfying the following conditions.

* The class $\mathscr K$ contains all sufficiently small compact open subgroups of $H$ (i.e., all open subgroups of a fixed compact open subgroup).

* For $K \in \mathscr K$, the categorical quotient $S/K$ in the category of $B$-schemes exists, and is smooth, separated, and of finite type over $B$.

* For $K_1, K_2 \in \mathscr K$ of $H$ such that $K_1 \subset K_2$, the natural map $S/K_1 \to S/K_2$ is finite étale.

* The maps $S \to S/K$ identify $S$ with $\varprojlim_{K\in \mathscr K} S/K$.

Let $H$, $B$, $S$ and $\mathscr K$ be as in Definition <ref>. For $K \in \mathscr K$, we write $S_K$ for $S/K$.
Let $\ell$ be a prime number invertible on $B$. The construction in <cit.> can be generalized to define $\ell$-adic sheaves on $S_K$ and the Hecke action on the cohomology. We explain this in the following.

Let $K , U \in \mathscr K,$ with $U$ normal in $K$. The group $K/U$ acts on $S_U$ via $S_K$-automorphisms. Since $S_K= S_U/K$ and since the map $S_{U} \to S_{K}$ is finite étale, we know that $S_U \to S_K$ is a Galois étale cover, and moreover $\Gal(S_U/S_K)$ is identified with the maximal quotient of $K/U$ that acts faithfully on $S_{U}$, cf. <cit.>.

For each $K \in \mathscr K$, we define the profinite group

\begin{align}\label{eq:profinite Galois}
\Gal(S/S_K) : = \varprojlim_{U \mathrel{\unlhd} K \text{ open}} \Gal(S_U/S_K) .
\end{align}
Since there exists neighborhood basis of $1$ in $H$ consisting of countably many open normal subgroups $U_i$ of $K$ with
$$\cdots \subset U_i \subset U_{i-1} \subset \cdots U_1 \subset K, $$
we have a presentation
\begin{align}\label{eq:Gal(S/S_K)}
\Gal(S/S_K) \cong \varprojlim_i \Gal(S_{U_i}/S_K).
\end{align}

Thus we are in a special case of the general setting at the beginning of <cit.>, with our $S_K$ playing the role of $X$, and our $\Gal(S/S_K)$ playing the role of $\Gamma$. By the construction in loc. cit., every continuous $\Gal(S/S_K)$-representation $\rho$ on a finite-dimensional $\ol \QQ_{\ell}$-vector space gives rise to a lisse $\ol \QQ_{\ell}$-sheaf $\mL_{\rho}$ on $S_K$.

Note that for each $K\in \mathscr K$, the  natural homomorphism $K \to \Gal(S/S_K)$ is surjective, which can be seen from (<ref>) and the similar presentation $K \cong \varprojlim_i K/U_i$ (using that the indexing set is countable). Now let $\xi$ be a continuous representation of $H$ on a finite-dimensional $\ol \QQ_{\ell}$-vector space $W$. We make the following assumption on $\xi$:

* For all sufficiently small $K\in \mathscr K$, the restriction $\xi|_K$ factors through $\Gal(S/S_K)$.

Given such a $\xi$, we may and shall shrink $\mathscr K$ and assume that the above condition holds for all $K \in \mathscr K$. Then for each $K\in \mathscr K$ we apply the previous construction to the representation of $\Gal(S/S_K)$ on $W$ induced by $\xi$, and obtain a lisse $\ol \QQ_{\ell}$-sheaf on $S_K$, denoted by $\mL_{\xi, K}$.

Consider $K_1,K_2 \in \mathscr K$ and $g \in H$ such that $g^{-1} K_1 g \subset K_2$. The action of $g$ on $S$ induces a map $g: S_{K_1} \to S_{K_2}$. As on p. 96 of [46], the actions of $g$ on $S$ and on $W$ together define a morphism

$$ \overrightarrow{g} ^* : g^* \mL_{\xi, K_2} \To \mL_{\xi, K_1}$$

between $\ol \QQ_{\ell}$-sheaves on $S_{K_1}$. For any geometric point $x$ of $B$, this induces a map

$$ [g]_{K_2, K_1}: \coh^i_{c} (S_{K_2, x} , \mL_{\xi, K_2}) \To \coh^i_{c} (S_{K_1, x} , \mL_{\xi, K_1}). $$

$$\coh^i_c (S_x, \xi) : = \varinjlim_{K \in \mathscr K} \coh^i_c (S_{K,x} , \mL_{\xi,K}) , $$
where the transition maps are given by $[1]_{K_2, K_1}$ for $K_1 \subset K_2$. The maps $[g]_{K_2, K_1}$ for varying $g, K_1, K_2$ give rise to a left $H$-action on $\coh^i_c(S_x, \xi)$, called the Hecke action. As on p. 97 of [46], $\coh^i_c(S_x, \xi)$ is an admissible $H$-module over $\ol \QQ_{\ell}$. Indeed, using the Hochschild–Serre spectral sequence and the fact that the cohomology of a finite group acting on a $\ol \QQ_{\ell}$-vector space vanishes in positive degrees, we see that for each $K \in \mathscr K$ the natural map $\coh^i_c(S_{K,x}, \mL_{\xi,K}) \to \coh^i_c(S_x, \xi)$ is injective, and its image is the subspace of $K$-invariants. Since $\coh^i_c(S_{K,x}, \mL_{\xi,K})$ is finite-dimensional, we know that $\coh^i_c(S_x, \xi)$ is an admissible $H$-module.

Let $(G,X)$ be a Shimura datum with reflex field $E= E(G,X) \subset \CC$. By the theory of canonical models due to Shimura [126, 127, 128, 129, 130, 131, 132, 133], Deligne [25, 26], Milne [100] (cf. [101]), and Borovoi [14], we have a canonical $E$-scheme $\Sh = \Sh(G,X)$ equipped with a right $G(\A_f)$-action that is admissible in the sense of Definition <ref>. The class $\mathscr K$ as in Definition <ref> can be taken to be the class of neat compact open subgroups of $G(\A_f)$ (as defined in <cit.>). For each $K \in \mathscr K$, we denote $\Sh/K$ by $\Sh_K = \Sh_K(G,X)$. This is a smooth, quasi-projective $E$-scheme, whose analytification over $\CC$ is identified with the hermitian locally symmetric variety $G(\QQ) \backslash X \times G(\A_f) /K$.

If $G=T$ is a torus, then $X$ consists of a single $\RR$-homomorphism $h: \mathbb S \to T_{\RR}$, and $\Sh_K(\overline E)$ is identified with the finite set $\Sh_K(\CC) = T(\QQ) \backslash T(\A_f)/ K$. The action of $\Gal(\overline E/E)$ on this finite set is given by the reciprocity law, which we now recall in order to fix the sign convention.
Let $\mu = \mu_h$[The convention used here is the same as in [26]. If $T_{\RR}= \GG_{m, \RR}$ and $h$ is given by $h(z) = z^p \bar z^q$, then $\mu_h$ is given by $\mu_h(z) = z^{-p}$.], which is a cocharacter of $T$ defined over $E$. Consider the composite  homomorphism of $\Q$-algebraic groups

\begin{align*}
r(\mu)^{\alg}: \Res_{E/\Q} \GG_m \xrightarrow{\Res_{E/\Q} \mu} \Res_{E/\Q} T \xrightarrow{\N_{E/\Q}} T.
\end{align*}
This induces a group homomorphism

$$\pi_0(E^{\times} \backslash \adele_E^{\times} ) \To \pi_0(T(\Q) \backslash T(\A)).$$
Now the left hand side is identified with $\Gal(E^{\ab}/E)$ under the global Artin map (normalized geometrically, i.e., uniformizers correspond to geometric Frobenius elements at the finite places), while the right hand side admits a natural map to $T(\Q) \backslash T(\A_f)/K$ (cf. <cit.>). We thus obtain a group homomorphism
$$ r: \Gal(E^{\ab}/E)  \To T(\Q) \backslash T(\A_f)/K. $$
For $\sigma \in \Gal(\overline E/E)$ and $x \in \Sh_K(\overline E)\cong T(\QQ)\backslash T(\A_f)/K$, we have the reciprocity law
$$\sigma (x) = r(\sigma) \cdot x. $$
This uniquely determines the $E$-scheme structure of $\Sh_K$. Note that the above reciprocity law differs from [26] in the sign of $\mu$. Thus the $E$-scheme which we call the canonical model for $(T,\set{h})$ would be called the canonical model for $(T, \set{h^{-1}})$ according to loc. cit. Our sign convention is the same as that used by Pink [113, 114] and Morel [108].

For general Shimura data, the canonical models are uniquely characterized by functoriality and the case of tori. According to our sign convention, the Siegel modular varieties classifying polarized abelian varieties are canonical models for the Siegel Shimura data as specified in <cit.>. (This is proved in <cit.>.) The discrepancy between this fact and Deligne's sign conventions in [26] was observed in [102].

Let $T$ be a $\QQ$-torus. We denote by $T_a$ be the maximal $\QQ$-anisotropic subtorus of $T$ (see
<cit.>). We denote by $T_{ac}$ the smallest $\QQ$-subgroup of $T_a$ whose base change to $\RR$ contains the maximal $\RR$-split subtorus of $T_{a,\RR}$. (Clearly $T_{ac}$ exists and is a torus.) We call $T_{ac}$ the anti-cuspidal part of $T$.  We say that $T$ is cuspidal, if $T$ has equal $\QQ$-split rank and $\RR$-split rank (cf. <cit.>).

Let $T$ be a $\QQ$-torus. The following statements are equivalent.

* $T$ is cuspidal.

* $T$ is isogenous over $\QQ$ to the product of a split $\Q$-torus and a $\Q$-torus that is anisotropic over $\R$.

* $T_a$ is $\RR$-anisotropic.

* $T_{ac}$ is trivial.

* $T(\QQ)$ is discrete in $T(\A_f)$.

* All arithmetic subgroups of $T(\QQ)$ are finite.

* $T$ satisfies the following Serre condition (cf. <cit.>). Fix a complex conjugation $\iota \in \Gal(\Qbar/\Q)$. For all $\tau \in \Gal(\Qbar/\Q ) $ and all $\mu \in X_*(T)$, we have

$$ (\tau - 1) (\iota+1) \mu = (\iota+1)(\tau-1)\mu = 0.$$

In general, $T_{ac}$ is the smallest $\QQ$-subgroup $S$ of $T$ such that $T/S$ is cuspidal.

The equivalence of (i), (ii), (iii), and (iv) follows  from <cit.>. The equivalence of (i), (v), and (vi) is shown in  <cit.>. We now show that (vii) is equivalent to the other conditions. Note that (vii) is invariant under isogeny over $\QQ$, and is satisfied when $T$ is is either split over $\QQ$ or anisotropic over $\RR$. Hence (ii) implies (vii). Conversely, if (vii) holds, then every $\mu \in X_*(T)^{\iota = 1}$ is fixed by $\Gal(\Qbar/\Q)$, since $(\iota+1)\mu = 2 \mu$ is fixed by $\Gal(\Qbar/\Q)$. This implies (i).

The last assertion in the lemma is clear since (i) and (iii) are equivalent.

Let $(G,X)$ be a Shimura datum with reflex field $E$. Write $Z$ for $Z_G$, and write $Z_{ac}$ for $(Z^0)_{ac}$. For each compact open subgroup $K \subset G(\A_f)$, we write $Z(\Q)_K$ for $Z(\Q) \cap K$, and write $Z_K$ for $Z(\A_f) \cap K$. Here both intersections are inside $G(\A_f)$.

Let $K\subset G(\A_f)$ be a neat compact open subgroup. Then $Z(\Q)_K$ is contained in $Z_{ac}(\Q)$.

By Lemma <ref>, $Z^0/Z_{ac}$, all congruence subgroups of $(Z^0/Z_{ac})(\Q)$ are finite. Thus the same is true for all congruence subgroups of $(Z/Z_{ac})(\Q)$. It follows that the image of $Z(\QQ)_K$ in $(Z/Z_{ac})(\Q)$ is finite. But this image is also neat inside $(Z/Z_{ac})(\A_f)$, so it is trivial.

Fix a prime number $\ell$. Let $\xi$ be an irreducible algebraic representation of $G$ over $\ol \Q_{\ell}$.
We set $G^c : = G/ Z_{ac}$, and assume that $\xi$ factors through $G^c$.[
In <cit.>, $G^c$ is defined to be $G/Z_s$, where $Z_s$ is the maximal $\QQ$-subtorus of $Z^0$ that is $\QQ$-anisotropic and $\RR$-split. Note that it is assumed in <cit.> that $Z^0$ splits over a CM field. Under this assumption, $Z_s$ is equal to $Z_{ac}$. In general, the two can be different. ]   In the following we construct $\ol \Q_{\ell}$-sheaves on $\Sh_K$ associated with $\xi$, for all sufficiently small $K$, by applying the general formalism in <ref>. This construction is well known. See for instance <cit.>, <cit.>, <cit.>, and <cit.>, which give this construction at different levels of generality. Note that in all but the last reference, the Shimura varieties being considered satisfy $G= G^c$.

Let $K$ and $U$ be neat compact open subgroups of $G(\A_f)$, with $U$ normal in $K$. Since each neat congruence subgroup $\Lambda$ of $G(\Q)$ acts on $X$ with kernel $\Lambda \cap Z(\Q)$, we have

\begin{align}\label{eq:(K/U)'}
\Gal(\Sh_U/\Sh_K) =  K/ (Z(\QQ)_K U). \end{align}

Write $Z(\Q)^-$ for the closure of $Z(\Q)$ in $Z(\A_f)$, and write $Z(\Q)^-_K$ for the intersection $Z(\Q)^- \cap K$ inside $G(\A_f)$. Note that $Z(\Q)^-_K$ is also the closure of $Z(\Q)_K$ inside $K$, since $K$ is open and closed in $G(\A_f)$. Define $\Gal(\Sh/\Sh_K)$ as in (<ref>). By (<ref>), we have

\begin{align}\label{eq:computation of Galois group}
\Gal(\Sh/ \Sh_K) \cong K/Z(\Q)_K^-,
\end{align}
(cf. <cit.>). By Lemma <ref>, the natural map $K \to G^c(\A_f)$ factors through $\Gal(\Sh/\Sh_K)$.[In fact, the induced map $\Gal(\Sh/\Sh_K) \cong K /Z(\Q)_K^- \to G^c(\A_f)$ is never injective, if $Z_{ac}$ is non-trivial. This follows from the fact that $Z_{ac}(\Q)(K\cap Z_{ac}(\A_f))$ has finite index in $Z_{ac}(\A_f)$ (<cit.>), and the fact that $Z_{ac}(\Q)^-$ has infinite index in $Z_{ac}(\A_f)$ (<cit.>). In <cit.> it is incorrectly stated that $\Gal(\Sh/\Sh_K)$ is isomorphic to the image of $K$ in $G^c(\A_f)$, cf. 3 of the updated online version of [95] and its erratum.]

Via the projection $G(\A_f) \to G(\QQ_{\ell})$, we obtain a continuous representation of $G(\A_f)$ on a finite-dimensional $\ol\QQ_{\ell}$-vector space induced by $\xi$. This continuous representation satisfies the assumption in <ref>, namely its restriction to $K$ factors through $\Gal(\Sh/\Sh_K)$ for all sufficiently small (in fact, all neat) $K$. By the construction in <ref>, we obtain a lisse $\ol \QQ_{\ell}$-sheaf $\mL_{\xi,K}$ on $\Sh_K$ for all neat $K$, and obtain the admissible $G(\A_f)$-module

$$ \coh^i_c(\Sh_{\ol E}, \xi) : =\varinjlim_{K} \coh^i_c(\Sh_{K, \ol E}, \mL_{\xi, K}).$$

We have a natural continuous $\Gal(\ol E/E)$-action on $\coh^i_c(\Sh_{\ol E}, \xi)$ that commutes with the $G(\A_f)$-action. Our main interest is to understand the virtual $G(\A_f)\times \Gal(\ol E/E)$-module

$$ \sum_i (-1)^i \coh^i_c (\Sh_{\overline E}, \xi). $$

§.§ Kottwitz parameters

Let $(G,X)$ be a Shimura datum, and let $p$ be a prime number.
In this subsection we define Kottwitz parameters with respect to $(G,X)$ and $p$, generalizing the considerations in <cit.> where $G_{\der}$ is  assumed to be simply connected.

Let $E\subset \CC$ be the reflex field of $(G,X)$. From the fixed embeddings $\Qbar\hookrightarrow \CC$ and $\Qbar \hookrightarrow \Qpbar$, we obtain a prime $\mathfrak p$ of $E$ over $p$. Let $p^r$ be the cardinality of the residue field of $\mathfrak p$. Fix a positive multiple $n$ of $r$.

The Hodge cocharacters attached to $h\in X$ all have the same image in $\pi_1(G)$, which we denote by $[\mu]_X \in \pi_1(G)$.

We say that an element $\gamma_0 \in G(\QQ)$ is semi-simple and $\RR$-elliptic, if $\epsilon \in T(\RR)$ for some elliptic maximal torus $T$ in $G_{\RR}$. Since $G$ is part of a Shimura datum, $G^{\ad}_{\RR}$ admits a Cartan involution. Therefore $G_{\RR}$ contains elliptic maximal tori, and our definition of $\RR$-elliptic elements agrees with the more general definition in the literature, cf. <cit.>.

A classical Kottwitz parameter of degree $n$ (with respect to $(G,X)$ and $p$) is a triple
$$(\gamma_0, \gamma = (\gamma_l)_{l\neq p} , \delta) \in G(\QQ)\times G(\mathbb A_f^p)\times G(\QQ_{p^n}), $$
satisfying the following conditions.

CKP1 The element $\gamma_0\in G(\QQ)$ is semi-simple and $\RR$-elliptic.

CKP2 For each prime $l\neq p$, $\gamma_l$ is stably conjugate to $\gamma_0$ as elements of $G(\QQ_l)$.

CKP3 The image of $\gamma_0$ in $G(\QQ_p) $ is a degree $n$ norm of $\delta $ (see <cit.>).

CKP4 The image of $\delta $ under the Kottwitz map $\kappa_{G} : \B(G_{\Q_p}) \to \pi_1 (G)_{\Gamma_p} $ is equal to the image of $ -[\mu]_X$.

We denote by $\KP_{\clsc}(p^n)$ the set of classical Kottwitz parameters of degree $n$.

We define an equivalence relation $\sim$ on $ G(\QQ)\times G(\mathbb A_f^p)\times G(\QQ_{p^n}) $  by declaring $(\gamma_0, \gamma, \delta) \sim ({\gamma_0}', \gamma' , \delta')$ if the following conditions are satisfied:

* The elements $\gamma_0$ and ${\gamma_0}'$ are stably conjugate in $G(\Q)$.

* The elements $\gamma$ and $\gamma'$ are conjugate in $G(\mathbb A_f^p)$.

* The elements $\delta$ and $\delta'$ are $\sigma$-conjugate in $G(\QQ_{p^n})$.

The subset $\KP_{\clsc}(p^n) \subset  G(\QQ)\times G(\mathbb A_f^p)\times G(\QQ_{p^n})$ is stable under $\sim$.

A Kottwitz parameter (with respect to $(G,X)$ and $p$)  is a tuple $(\gamma_0, a, [b])$, consisting of:

* a semi-simple and $\RR$-elliptic element $\gamma_0 \in G(\Q)$,

* an element $a \in \D(G_{\gamma_0}^0, G ; \A_f^p  )$,

* a $\sigma$-conjugacy class $[b]$ in $G_{\gamma_0}^0 (\LL)$ (i.e., $[b] \in \B(G_{\gamma_0, \Q_p}^0)$),

satisfying the following condition.

KP0 Let $[b]_G$ be the image of $[b]$ in $\B(G_{\Q_p})$. Then the element $\kappa_{G}([b]_G) \in \pi_1(G)_{\Gamma_p}$ is equal to the image of  $-[\mu]_X$.  We denote by $\KP$ the set of all Kottwitz parameters.
For $\fkc = (\gamma_0, a, [b]) \in \KP$, we write $I_0(\fkc)$ for $G_{\gamma_0}^0$. When $\fkc$ is fixed in the context we also simply write $I_0$ for $I_0(\fkc)$.

We say that $(\gamma_0, a, [b])\in \KP$ is $p^n$-admissible, if it satisfies the following condition.

KP1 Let $b \in I_0(\LL)$ be a representative of $[b]$.
There exists $c\in G(\LL)$ such that, letting $\delta := c^{-1} b \sigma(c) \in G(\LL)$, we have
\begin{align} \label{eqn in KP1}
c^{-1} \gamma_0 c = \delta \cdot \sigma(\delta) \cdots \sigma^{n-1}(\delta).
\end{align}

(Clearly this condition is independent of the representative $b$ of $[b]$.) We denote by $\KP_{\adm}(p^n)$ the set of $p^n$-admissible Kottwitz parameters.

Next we deduce some consequences of the condition KP1. We shall work in a local setting as follows. Let $\gamma_0 \in G(\Q_p)_{\semi}$ and let $I_0 : = (G_{\Q_p})_{\gamma_0}^0$. Let $[b] \in \B(I_0)$, and assume that KP1 holds for $[b]$ and $\gamma_0$.

Keep the setting of <ref>. Choose $b$ and $c$ as in KP1 with respect to $[b]$ and $\gamma_0$. Let $\delta = c^{-1} b \sigma(c)$. Then we have $\delta\in G(\QQ_{p^n})$. The $\sigma$-conjugacy class of $\delta$ in $G(\QQ_{p^n})$ depends only on $[b] \in \B(I_0)$, not on the choices of $b$ and $c$. Moreover, $\gamma_0\in G(\Q_p)$ is a degree $n$ norm of $\delta\in G(\Q_{p^n})$.

By (<ref>) we have $(\delta\rtimes \sigma )^n = c^{-1 } \gamma_0 c \rtimes \sigma^n $. Since $b$ and $1\rtimes \sigma$ both commute with $\gamma_0$, we know that $\delta\rtimes \sigma = c^{-1} (b\rtimes \sigma ) c$ commutes with $c^{-1} \gamma_0 c$. Hence $\delta\rtimes \sigma $ commutes with $\sigma^n$, which means that $\delta \in G(\QQ_{p^n})$.

To prove the second statement, we first note that when $b$ is fixed, any choice of $c$ has to satisfy the equation

\begin{align*}
\gamma_0 c = b \sigma(b) \cdots \sigma^{n-1}( b) \sigma^n (c).
\end{align*}

Hence two choices of $c$ give rise to the same coset $cG(\QQ_{p^n}) $. It follows that the $\sigma$-conjugacy class of $\delta$ in $G(\QQ_{p^n})$ is independent of the choice of $c$. Now suppose we choose another representative $b' \in I_0(\LL)$ of $[b] \in \B(I_0)$. Then $b' = d b \sigma( d)^{-1}  $ for some $d \in I_0(\LL)$. Letting $c' : = dc$, we have
$ c'^{-1} b'  \sigma(c') = \delta ,$ and

$$c'^{-1} \gamma_0 c' = c^{-1}\gamma_0 c = \delta \sigma (\delta) \cdots \sigma^{n-1}(\delta). $$
Hence $b'$ still determines the same $\delta\in G(\Q_{p^n})$ up to $\sigma$-conjugacy.

Finally, we show that $\gamma_0$ is a degree $n$ norm of $\delta$. If $G_{\der}$ is simply connected, then the statement follows from (<ref>) and the definition of norm. In general, take a $z$-extension $1 \to Z \to H \to G_{\Q_p} \to 1$ over $\Q_p$. Let $\tilde c \in H(\LL)$ be a lift of $c \in G(\LL)$, and let $\tilde \delta \in H(\Q_{p^n})$ be a lift of $\delta \in G(\Q_{p^n})$. Define $\tilde \gamma_0 \in H(\LL)$ by the equation

\begin{align}\label{eq:tilde norm}
\tilde c^{-1} \tilde \gamma_0 \tilde c = \tilde \delta \sigma (\tilde \delta) \cdots \sigma^{n-1}(\tilde \delta).
\end{align}

Then $\tilde \gamma_0 $ is a lift of $\gamma_0$. We claim that $\tilde \gamma_0 \in H(\Q_p)$. Once the claim is proved, we know that $\tilde \gamma_0$ is a degree $n$ norm of $\tilde \delta$ by (<ref>), and it follows that $\gamma_0$ is a degree $n$ norm of $\delta$ (see <cit.>).

It remains to prove the claim. Let $\tilde b = \tilde c \tilde \delta \sigma (\tilde c)^{-1} \in H (\LL)$. By (<ref>) we have $(\tilde \delta \rtimes \sigma)^n = \tilde c^{-1} \tilde \gamma_0 \tilde c \rtimes \sigma^n$. Since $\tilde \delta \rtimes \sigma$ commutes with $\sigma^n$ (i.e., $\tilde \delta \in H(\Q_{p^n})$), it must commute with $\tilde c^{-1} \tilde \gamma_0 \tilde c$. Hence $\tilde b \rtimes \sigma = \tilde c (\tilde \delta \rtimes \sigma) \tilde c^{-1}$ commutes with $\tilde \gamma_0$. On the other hand since $\tilde b$ is a lift of $b \in I_0$, we know that $\tilde b$ commutes with $\tilde \gamma_0$ by <cit.>. Therefore $\sigma$ commutes with $\tilde \gamma_0$, which proves the claim.

Let $\cH$ be a smooth affine group scheme over $\Z_p$ with connected fibers. Then every element of $\cH(\LL)/\cH(\breve \ZZ_p)$ is fixed by some power of $\sigma$. The natural map $\cH(\Q_p^{\ur})/ \cH(\Z_p^{\ur}) \to \cH(\LL)/\cH(\breve \Z_p)$ is a bijection.

By <cit.>, there exists a closed embedding of $\Z_p$-groups $\cH \to \GL_n$. Hence the first statement in the lemma reduces to the case where $\cH = \GL_n$, and it follows from the fact that $\GL_n(\Q_p^{\ur})$ is dense in $\GL_n(\LL)$ under the $p$-adic topology. The second statement (for general $\cH$) follows from the first statement and Greenberg's theorem <cit.> asserting the surjectivity of the map $\cH(\breve \Z_p) \to \cH(\breve \Z_p), g \mapsto g \cdot \sigma^n(g)^{-1}$ for arbitrary $n \in \ZZ_{\geq 1}$.

Keep the setting of <ref>. Let $b \in I_0(\LL)$ be a decent representative of $[b] \in \B(I_0)$ (see <ref>). Then there exists $t\in \NN$ such that $b$ is $t$-decent, and such that

\begin{align}\label{eq:polar'}
\gamma_0^t = p^{nt\nu_b}k,
\end{align}
where $k$ lies in a bounded subgroup of $G(\LL)$ (in the sense of <cit.>).

Assume $b$ is $t_0$-decent. Let $c$ be as in KP1. Let $\cG$ be a parahoric model of $G_{\Q_p}$ over $\ZZ_p$, and write $\bar c$ for the image of $c$ in $\in G(\LL)/\cG(\breve \ZZ_p)$. By (<ref>), we have $
\gamma_0 \cdot \bar c = (b\rtimes \sigma )^n \cdot \bar c.$ Since $\gamma_0$ commutes with $b$ and $1 \rtimes \sigma$, for any multiple $t$ of $t_0$ we have
$$\gamma_0^{t} \cdot \bar c = (b\rtimes \sigma)^{nt}
\cdot \bar c = (p^{nt \nu_b} \rtimes \sigma ^{nt} ) \cdot \bar c.
By Lemma <ref>, when $t$ is sufficiently divisible we have $\sigma^{nt} \bar c =\bar c$. Then   $k:= p^{-nt\nu_b} \gamma_0^t$ lies in $c\cG(\breve \ZZ_p)c^{-1}$, which is a bounded subgroup of $G(\LL)$.

One can view (<ref>) as a “polar decomposition” of $\gamma_0^t$. Such a decomposition satisfies a very strong sense of uniqueness, as specified in the following lemma.
Let $F$ be a complete discretely valued field. Let $H$ be a linear algebraic group over $F$, and let $\epsilon$ be a semi-simple element of $H(\overline F)$. Then there exists at most one cocharacter $\nu$ of $H_{\epsilon}$ defined over $\overline F$ such that for some uniformizer $\pi \in F^{\times}$, $\epsilon ^{-1} \pi^{\nu}$ lies in a $H(\overline F  )$-conjugate of a bounded subgroup of $H(F)$.

Let $\rho: H \to \GL_N$ be a  faithful representation of $H$ over $F$. If $k$ is an element of a bounded subgroup of $H(F)$, then $\rho(k)$ lies in a $\GL_N(F)$-conjugate of $\GL_N(\oo_F)$ (cf. the proof of <cit.>), and hence all eigenvalues of $\rho(k)$ have valuation zero. (Here and below, by eigenvalues we always mean eigenvalues in $\ol F$.) To prove the lemma it suffices to prove that for each semi-simple $\epsilon \in \GL_N(\ol F)$, there exists at most one cocharacter $\nu$ of $\GL_{N,\epsilon, \ol F}$ such that for some uniformizer $\pi \in F$ all eigenvalues of $\epsilon^{-1} \pi^\nu$ have valuation zero.

Without loss of generality we may assume that $\epsilon=\diag(\lambda_1 I_{N_1},\cdots, \lambda_r I_{N_r})$ with distinct $\lambda_1,\cdots ,\lambda_r \in \overline F^\times$. Then $\GL_{N,\epsilon}$ is naturally identified with $\GL_{N_1} \times \cdots \times \GL_{N_r}$. Note that if a semi-simple element $k \in \GL_{N,\epsilon}(\overline F)$ is such that all its eigenvalues have valuation zero, then the projection of $k$ in each $\GL_{N_i}(\overline F)$ satisfies the analogous condition. We have thus reduced to the case where $\epsilon$ is central in $\GL_N(\overline F)$. In this case, if
$\nu$ is a cocharacter of $\GL_{N, \ol F}$ such that for some uniformizer $\pi$ all eigenvalues of $\epsilon^{-1} \pi^{\nu}$ have valuation zero,  then $\nu$ must be given by $z \mapsto \diag(z^m,\cdots, z^m)$ where $m$ is the valuation of the unique eigenvalue of $\epsilon$. This proves the uniqueness of $\nu$.

Keep the setting of <ref>. Then $[b]$ is basic in $\B(I_{0})$. If $[b'] \in \B(I_{0})$ is another class satisfying KP1 with respect to $\gamma_0$, then $\nu_{b} = \nu_{b'}$.

Let $b$ be a decent representative of $[b]$. By Lemma <ref> and Lemma <ref> (the latter applied to $F  = \LL$, $\pi = p$, $H =G_{\LL}$,  $\epsilon = \gamma_0$), any element of $G(\LL)$ that centralizes $\gamma_0$ has to centralize $\nu_b$. Therefore $\nu_b $ factors through the center of $I_0$, and $[b]$ is basic in $\B(I_0)$. The second statement also follows from these two lemmas.

Let $\fkc = (\gamma_0, a, [b])\in \KP(p^n)$. Then $[b]$ is basic in $\B(I_0(\fkc)_{\Q_p})$. If $(\gamma_0, a',[b'])$ is another element of $\KP(p^n)$, then $\nu_b = \nu_{b'}$.

This follows from Corollary <ref>.

Our next goal is to define the notion of an isomorphism between Kottwitz parameters. We first consider a general construction. Let $\gamma_0 \in G(\QQ)_{\semi}$, and let $I_0 : = G_{\gamma_0}^0$. Let $u \in G(\Qbar)$ be an element satisfying

$$ \gamma_0' : = u \gamma_0 u^{-1} \in G(\Q)$$

$$ u^{-1} \lix^{\rho} u \in I_0, \quad \forall \rho \in \Gamma = \Gal(\Qbar/\QQ). $$
Let $I_0' : = G_{\gamma_0'}^0$.
We have a bijection

\begin{align}\label{eq:u_* away from p}
u_*: \D(I_0, G ; \adele_f^p) \isom \D(I_0', G ; \adele_f^p),
\end{align}

sending the class of a cocycle $(a_{\rho})_\rho \in Z^1(\Gamma, I_0(\bar \A_f^p))$ to the class of $(u a_{\rho} \lix^{\rho} u^{-1})_{\rho}$.
Next note that the cocycle $( u^{-1}\lix{^\rho} u  )_{\rho}  \in Z^1(\QQ_p, I_0)$ becomes trivial in $\coh^1( \LL, I_0)$ by Steinberg's theorem. Hence there exists $d\in I_0(\overline {\breve \QQ}_p)$ such that

\begin{align*}
u^{-1}\lix{^\rho} u  = d^{-1}\lix{^\rho} d, \quad  \forall \rho \in  \Gamma_{p,0}.
\end{align*}

Then $u_0:= ud^{-1} $ lies in $G(\LL)$. We have

\begin{align*}
u_0 \gamma_0 u_0^{-1}= \gamma'_0,
\end{align*}

\begin{align*}
u_0^{-1} \lix{^\sigma} u_0  \in  I_0 (\LL).
\end{align*}

By the previous two properties of $u_0$, we have a bijection

\begin{align}\label{eq:u_* at p}
u_* : \B(I_{0, \Q_p}) & \isom \B(I'_{0,\Q_p}) \\ \nonumber [b] &\longmapsto [ u_0 b \sigma ( u_0)^{-1}   ] ,
\end{align}

which depends only on $u$, not on the choice of $d$.

Let $ \fkc = (\gamma_0 , a ,[b]), \fkc' =  ( \gamma'_0, a' , [b'])  \in \KP$. By an isomorphism from $\fkc$ to $\fkc'$, we mean an element $u\in G(\Qbar)$,  satisfying the following conditions.

* We have $\Int(u) \gamma_0 = \gamma'_0$, and $u^{-1}\lix{^\rho} u \in I_0(\fkc)$ for all $\rho \in \Gamma$.

* The bijection $u_*: \D(I_0(\fkc), G ; \adele_f^p) \isom \D(I_0(\fkc'), G ; \adele_f^p)$ as in (<ref>) sends $a$ to $a'$.

* The bijection $u_* : \B(I_0(\fkc)_{\Q_p})\isom \B(I_0(\fkc')_{\Q_p})$ as in (<ref>) sends $[b]$ to $[b']$.

In such a situation we write $ u : \fkc \isom \fkc'.$

If $u: \fkc \isom \fkc'$ and $v: \fkc' \isom \fkc''$ are two isomorphisms between Kottwitz parameters, then $vu \in G(\Qbar)$ is an isomorphism $\fkc \isom \fkc ''$, and $u^{-1} \in G(\Qbar)$ is the isomorphism $\fkc' \isom \fkc$ inverse to $u$. Moreover, one checks that $p^n$-admissibility of Kottwitz parameters (Definition <ref>) is preserved under isomorphisms.

We denote by $\KP/{\cong}$ the set of isomorphism classes of Kottwitz parameters, and by ${\KP_{\adm}(p^n)}/{\cong}$ the set of isomorphism classes of $p^n$-admissible Kottwitz parameters.

We define a natural map

\begin{align}\label{eq:CK to K}
\KP_{\adm}(p^n) \To \KP_{\clsc}(p^n)/{\sim} \end{align}
as follows. Let $\fkc = (\gamma_0, a, [b]) \in \KP_{\adm}(p^n)$. The element $a \in \D(I_0(\fkc), G ; \adele_f^p)$ determines a conjugacy class in $G(\A_f^p)$ which is stably conjugate to $\gamma_0$. Take $\gamma$ to be an arbitrary element of this conjugacy class. By Lemma <ref>, $[b]$ determines a $\sigma$-conjugacy class in $G(\Q_{p^n})$, of which $\gamma_0$ is a degree $n$ norm. Take $\delta$ to be an arbitrary element of this $\sigma$-conjugacy class. Then $(\gamma_0, \gamma, \delta)$ is an element of $\KP_{\clsc}(p^n)$, and its equivalence class depends only on $\fkc$. We define the map (<ref>) by sending $\fkc $ to the equivalence class of $(\gamma_0,\gamma, \delta)$.

One checks that the map (<ref>) factors through $\KP_{\adm}(p^n)/{\cong}$. Moreover, when $G_{\der}$ is simply connected, the induced map $\KP_{\adm}(p^n)/{\cong} ~ \To  \KP_{\clsc}(p^n)/{\sim}$ is a bijection. We will not need this fact in the paper, but we outline here how to recover $[b] \in \B(I_{0}(\fkc)_{\Q_p})$ from $\delta$, which is perhaps the only non-obvious part of the argument. Since $G_{\der}$ is simply connected, $I_0(\fkc)= G_{\gamma_0}$. Since $\gamma_0$ is a degree $n$ norm of $\delta$ and since $\coh^1(\LL, I_0)$ is trivial by Steinberg's theorem, there exists $c \in G(\LL)$ such that (<ref>) holds. Define $b : = c \delta \sigma(c) \in G(\LL)$. Since $(\delta\rtimes \sigma)^n = c^{-1} \gamma_0 c \rtimes \sigma^n$ and since $\delta \rtimes \sigma$ commutes with $\sigma^n$, we know that $\delta \rtimes \sigma$ commutes with $c^{-1} \gamma_0 c$, or equivalently that $b\rtimes \sigma$ commutes with $\gamma_0$. Since $\gamma_0$ is $\sigma$-invariant, we know that $b$ commutes with $\gamma_0$, i.e., $b \in I_0(\fkc)(\LL)$. In this way we have recovered $[b] \in \B(I_{0}(\fkc)_{\Q_p})$ from $\delta$.

§.§ The Kottwitz invariant

In this subsection we define an invariant attached to each Kottwitz parameter. We first construct the abelian group where the invariant lies in. We start with a general setting.

Let $G$ be a reductive group over $\Q$, and let $I$ be a reductive subgroup of $G$. We have an infinite commutative diagram with exact rows and columns

$$\xymatrix<EMAIL_ADDRESS>{ \vdots \ar[d] & \vdots \ar[d] & \vdots \ar[d] & \vdots \ar[d] \\ \cdots \to  \coh^i_{\ab}(\QQ,I) \ar[r] \ar[d] & \coh^i_{\ab}(\QQ, G) \ar[r]\ar[d]  & \coh^i_{\ab}(\QQ, I \to G) \ar[r]  \ar[d] & \coh^{i+1}_{\ab}(\QQ, I) \ar[d]  \to \cdots \\   \cdots \to  \coh^i_{\ab}(\adele,I) \ar[r] \ar[d] & \coh^i_{\ab}(\adele, G) \ar[r]\ar[d] \ar@{-->}[rd] & \coh^i_{\ab}(\adele, I \to G) \ar[r]  \ar[d] & \coh^{i+1}_{\ab}(\adele, I) \ar[d] \to \cdots  \\ \cdots \to \coh^i_{\ab}(\adele/\QQ,I) \ar[r] \ar[d] & \coh^i_{\ab}(\adele/\QQ, G) \ar[r]\ar[d]  & \coh^i_{\ab}(\adele/\QQ, I \to G) \ar[r]  \ar[d] & \coh^{i+1}_{\ab}(\adele/\QQ, I) \ar[d] \to \cdots  \\ \cdots \to \coh^{i+1}_{\ab}(\QQ,I) \ar[r] \ar[d] & \coh^{i+1}_{\ab}(\QQ, G) \ar[r]  \ar[d]& \coh^{i+1}_{\ab}(\QQ, I \to G) \ar[r]  \ar[d] & \coh^{i+2}_{\ab}(\QQ,I) \ar[d] \to \cdots \\ \vdots & \vdots & \vdots &\vdots  }$$
We define $
\E( I,G ; \adele/\QQ) $ to be the cokernel of the map
$$\coh^0_{\ab}(\adele, G)  \To \coh^0_{\ab} (\adele/\QQ, I \to G )  $$
given by the dashed arrow in the above diagram for $i=0$. We have a natural map $\E(I, G ; \adele) \to \E(I, G ; \A/\Q)$ defined by first lifting an element of $\E(I, G ; \A)$ to $\coh^0_{\ab}(\A, I\to G)$, and then mapping the lift to $\coh^0_{\ab}(\A/\Q, I \to G)$ and then to $\E(I, G; \A/\Q)$. We know that the sequence
\begin{align}  \label{eq:how to show zero invariant}
\E( I,G ; \Q ) \to \E( I,G ; \A) \to \E( I,G ; \A/\Q) \end{align}
is exact; see <cit.>.

We write $K$ for the kernel of $\pi_1(I) \to \pi_1(G)$. Recall that the functor $\cA_\Q$ is introduced in <ref>. As usual we write $\Gamma$ for $\Gal(\Qbar/\QQ)$.

The natural inclusions

\begin{align*}
\ker \!\bigg( \mathcal A_\Q(K) \to \mathcal A_\Q(\pi_1(I))\bigg)  \hookrightarrow \ker \!\bigg(K_{\Gamma,\tors} \to \pi_1(I)_{\Gamma,\tors}\bigg)    \hookrightarrow \ker \!\bigg(K_{\Gamma} \to \pi_1(I)_{\Gamma}\bigg)
\end{align*}

are equalities.