where the vertical maps are induced by $G_1\rightarrow G$, using $\cE_{\el}(G_1)\cong \cE_{\el}(G)$ (Lemma <ref>) and part (i) of Lemma <ref>. We add that the right vertical is required to send $\emptyset$ to itself. By the $Z_{G_1}(\Q)$-equivariance of $\fkE_1$, there exists a unique $Z_G(\Q)$-equivariant map $\fkE$ making the entire diagram commute. (The image of $\fkE$ does not contain $\emptyset$ if $G$ is quasi-split over $\Q$, since every $\gamma_H$ then has an image in $G(\Q)$.)

The map $\fkE$ is $Z(\Q)$-equivariant and contains $\Sigma\fkK_{\el}(G)$ in its image. Moreover for $(\gamma_0,\kappa)\in \Sigma\fkK_{\el}(G)$ and $\fke\in E_{\el}(G)$,

$$\ol\iota_G(\gamma_0)^{-1}=\lambda(\fke)^{-1}\sum_{\gamma_H \in \Sigma(H)~\textup{s.t.}\atop \fkE:(\fke,\gamma_H)\mapsto (\gamma_0,\kappa) } \ol\iota_H(\gamma_H)^{-1}.$$

We remark that, in the strongly regular case the lemma follows from <cit.>, which covers twisted endoscopy.

The $Z(\Q)$-equivariance was observed above.
Since the right vertical map is surjective in (<ref>) by Lemma <ref>,
the containment of $\Sigma\fkK_{\el}(G)$ in the image of $\fkE$ reduces to the case for $G_1$, which is proved in <cit.> (since $G_{1,\der}=G_{1,\sconn}$).
Finally the equality asserted in the lemma follows from <cit.>.

Recall that $K^p$ is a neat subgroup and that $\fkX=(Z(\A_f)\cap K)\cdot Z(\R)$. In particular

\begin{equation}\label{e:X-cap-Gder-trivial}
\fkX\cap G_{\der}(\ol{\Q})=\{1\}.
\end{equation}

Let $\cE\Sigma^\sim_{\el,\fkX}(G)$ denote the quotient set of $\cE\Sigma^\sim_{\el}(G)$ by the obvious multiplication of $\fkX_\Q=\fkX\cap Z(\Q)$. Likewise, define $\Sigma_{\fkX}(H)$ and $\Sigma\fkK_{\el,\fkX}(G)$ from $\Sigma(H)$ and $\Sigma\fkK_{\el}(G)$.
$$\tilde\fkE_{\fkX}:\cE\Sigma^\sim_{\el,\fkX}(G)\ra \Sigma\fkK_{\el,\fkX}(G)\cup \{\emptyset\}$$
denote the map $\fkE$ pre-composed with (<ref>) modulo the $\fkX_\Q$-action.

The image of $\tilde{\fkE}_\fkX$ is equal to $\Sigma\fkK_{\el,\fkX}(G)$ if $G$ is quasi-split and contains $\Sigma\fkK_{\el,\fkX}(G)$ in general. Moreover for fixed $(\gamma_0,\kappa)$ and $\fke$,

$$\ol\iota_G(\gamma_0)^{-1}=\lambda(\fke)^{-1}\sum_{\gamma_H \in \Sigma_\fkX(H)~\textup{s.t.}\atop \fkE_\fkX:(\fke,\gamma_H)\mapsto (\gamma_0,\kappa) } \ol\iota_H(\gamma_H)^{-1}.$$

The only non-trivial point is to deduce the equality from Lemma <ref>. Let $\fke=(H,\cH,s,\eta)\in E_{\el}(G)$, $\gamma_H,\gamma'_H\in H(\Q)_{(G,H)\text{-} \reg}$. Suppose that $\fkE$ maps both $(\fke,\gamma_H)$ and $(\fke,\gamma'_H)$ to $(\gamma_0,\kappa)$. What we need to show is that, if $\gamma'_H$ is stably conjugate to $z\gamma_H$ for some $z\in \fkX$, then $\gamma'_H$ is stably conjugate to $\gamma_H$.

By assumption, $\fkE$ maps $(\fke,z\gamma_H)$ to $(z\gamma_0,\kappa)$. Hence $z\gamma_0$ is stably conjugate to $\gamma_0$. In particular $gz\gamma_0g^{-1}=\gamma_0$ for some $g\in G(\ol{\Q})$. Thanks to (<ref>) the element $z$ is trivial, so $\gamma'_H$ is stably conjugate to $\gamma_H$ as desired.

Let $f^{H_1}$ be as in <ref>.
Assume that $\tilde\fkE_\fkX$ maps $(\fke,\gamma_H)$ to $\emptyset$.
Then $SO_{\gamma_{H_1}}(f^{H_1})=0$ for every lift $\gamma_{H_1}\in H_1(\Q)$ of $\gamma_H$.

Suppose that $SO_{\gamma_{H_1}}(f^{H_1})\neq 0$. By Lemma <ref> there exists $\gamma_{0,1}\in G_1(\A)$ such that $\gamma_{0,1,v}$ is an image of $\gamma_{H_1,v}$ at every place $v$. To show that $(\fke,\gamma_H)$ is not mapped to $\emptyset$ under $\fkE$, it suffices to show the existence of $\gamma'_{0,1}\in G_1(\Q)$ which is stably conjugate to $\gamma_{0,1}$ in $G_1(\Q_v)$ for every place $v$.
Indeed, $(\fke_1,\gamma_{H_1})$ then does not map to $\emptyset$, thus $(\fke,\gamma_H)$ does not either, cf. (<ref>). Thus the proof boils down to the case where $G=G_1$ and $H=H_1$ (with $G_{\der}=G_{\sconn}$). Henceforth we will write $\gamma_0$ for $\gamma_{0,1}$, $\gamma_H$ for $\gamma_{H_1}$, and so on.

Let $G^*$ denote a quasi-split inner form of $G$. Write $\gamma^*_0\in G^*(\Q)_{\semi}$ for the image of $\gamma_{H}$ under (<ref>).
Now recall that Labesse (see <cit.>, with $L= G, H= G^*$) constructs a non-empty subset
$$ \mathrm{obs}_{\gamma_{0}^*} (\gamma_0)\subset \E (I_{\gamma_0^*}, G^*; \adele/\QQ)  \xlongequal{\mathrm{Cor.~\ref{cor:compare with Kottwitz}}} \fkK(I_{\gamma^*_0}/\Q)^D , $$
generalizing the construction of Kottwitz in [63].

As in the second paragraph of <cit.>, the Chebotarev density theorem implies that the natural map $\fkK(I_{\gamma^*_0}/\Q_w)^D\ra \fkK(I_{\gamma^*_0}/\Q)^D$ is surjective for some finite place $w$.
In Labesse's construction, if we twist $\gamma_{0 ,w}$ within its stable conjugacy class by a class $c \in \fkK(I_{\gamma^*_0}/\Q_w)^D $, then $\mathrm{obs}_{\gamma_0^*} (\gamma_0)$ gets shifted by the image of $c$ in the abelian group $\fkK(I_{\gamma^*_0}/\Q)^D $. Hence, if we replace $\gamma_{0,w}$ by a stably conjugate element and keep the components of $\gamma_0$ outside $w$ unchanged, then we may arrange that
$ 0 \in\mathrm{obs}_{\gamma_0^*} (\gamma_0) \subset \fkK(I_{\gamma^*_0}/\Q)^D$. By <cit.>, the $G(\A)$-conjugacy class of $\gamma_0$ contains an element of $G(\Q)$, which we can take to be $\gamma_0'$.

For each $\fke=(H,\cH,s,\eta)\in \cE_{\el}(G)$, set

\begin{equation}\label{eq:iota}
\iota(G,H):=\tau(G)\tau(H)^{-1}\lambda(\fke)^{-1}=\tau_\fkX(G)\tau_\fkX(H)^{-1}\lambda(\fke)^{-1}.
\end{equation}

Given $\gamma_H\in \Sigma_{\el,\fkX}(H)$ we define $\mathrm{Stab}_{\fkX}(\gamma_H)$ to be the group of $z\in \fkX_\Q$ such that $z\gamma_H=\gamma_H$ in $ \Sigma_{\el,\fkX}(H)$. This group is finite by the same argument as in <ref> showing the finiteness of $\mathrm{Stab}_{\fkX}(\gamma_H)$.

Let us introduce the stable analogue of $T_{\el}$ (see <ref>) for $H_1$ with respect to the central character datum $(\fkX_{H_1},\chi_{H_1})$, where $\chi_{H_1}:=\chi_1 \lambda_{H_1}^{-1}$. To check that it is indeed a central character datum, note that both $\chi_1$ and $\lambda_{H_1}$ are trivial on $\fkX_{H_1,\Q}$ by construction, cf. <ref> and (<ref>).
For $ h\in \cH(H_1(\A),\chi_{H_1}^{-1})$, set

\begin{equation}\label{e:def-ST-ell}
ST^{H_1}_{\el, \chi_{H_1}}(h) :=   \tau_{\fkX_{H_1}}(H_1) \sum_{\gamma_{H_1}\in \Sigma_{\el,\fkX_{H_1}}(H_1)} |\mathrm{Stab}_{\fkX_{H_1}}(\gamma_{H_1})|^{-1} SO_{\gamma_{H_1}}(h).
\end{equation}

There is no need for the factor $\ol\iota(\gamma_{H_1})^{-1}$, which is equal to 1 since $H_1$ has simply connected derived subgroup.

For $\gamma_{H_1}\in H_1(\Q)_{(G_1,H_1)\textup{-reg}}$,

It suffices to construct a short exact sequence of groups

$$1\ra (H_{\gamma_H}/H^0_{\gamma_H})(\Q) \ra \mathrm{Stab}_{\fkX_{H_1}}(\gamma_{H_1}) \ra \mathrm{Stab}_{\fkX}(\gamma_{H}) \ra 1.$$

The third arrow from the left is the map induced by the projection $\fkX_{H_1}\rightarrow \fkX$ and is clearly surjective. To construct the second arrow, given $\ol h\in (H_{\gamma_H}/H^0_{\gamma_H})(\Q)$, choose a lift $h\in H_{\gamma_H}(\ol\Q)$ and a further lift $h_1\in H_1(\ol\Q)$. Then $x_1:=h_1 \gamma_{H_1} h_1^{-1} \gamma_{H_1}$ belongs to $Z_1(\Q)$, and moreover $x_1\in \mathrm{Stab}_{\fkX_{H_1}}(\gamma_{H_1})$ since $h_1 \gamma_{H_1} h_1^{-1}  = x_1 \gamma_{H_1}$. The assignment $\ol h \mapsto x_1$ is a well-defined homomorphism. To check this map is injective, suppose $h_1 \gamma_{H_1} h_1^{-1}=\gamma_{H_1}$. Then $h_1$ lies in the centralizer of $\gamma_{H_1}$ in $H_1$, which is connected. (To see this, choose a place $v$ such that $G_{1,\Q_v}$ is quasi-split, so that $\gamma_{H_1,v}$ has an image $\gamma_{1,v}\in G_{1,\Q_v}$. Since the centralizer of $\gamma_{1,v}$ is connected, and since $\gamma_{H_1}$ is $(G_1,H_1)$-regular, the same is true for $\gamma_{H_1,v}$ by <cit.>.) Thus the image of $h_1$ in $H_{\gamma_H}$ lies in $H^0_{\gamma_H}$, implying that $\ol h$ is trivial.

The composition of the two maps above is clearly trivial.
Finally suppose that $x_1\in \mathrm{Stab}_{\fkX_{H_1}}(\gamma_{H_1})$ maps trivially into $ \mathrm{Stab}_{\fkX}(\gamma_{H})$. Then $x_1\in Z_1(\Q)$. To check that $x_1$ comes from $ (H_{\gamma_H}/H^0_{\gamma_H})(\Q) $, choose $h_1\in H_1(\ol\Q)$ such that $h_1 \gamma_{H_1} h_1^{-1}  = x_1 \gamma_{H_1}$. Its image $h$ in $H(\ol\Q)$ clearly centralizes $\gamma_H$. Writing $\ol h$ for the image of $h$ in $(H_{\gamma_H}/H^0_{\gamma_H})(\ol\Q)$, we see that $\ol h$ is $\Q$-rational and maps to $x_1$ by construction.

In our situation $|\mathrm{Stab}_{\fkX}(\gamma_H)|=1$. Indeed the stabilizer group is a finite subgroup of $K$ via $\fkX_\Q\subset Z(\Q)_K \subset K$, but $K$ has no non-trivial torsion elements as $K$ is neat.

Assume that Conjecture <ref> is true (cf. Remark <ref>). With $f^{H_1}$ constructed as in <ref> for each $\fke\in \cE_{\el}(G)$, we have

\sum_{i} (-1)^i \tr \bigg({\Phi}_{\mathfrak p}^m \times (f^p dg^p)  \mid \coh_c^i(\Sh_{\ol{E}},\xi)^{K_p} \bigg)  = \sum_{\fke\in \cE_{\el}(G)} \iota(G,H) ST^{H_1}_{\el,\chi_{H_1}}(f^{H_1})$$
for all sufficiently large $m$.

We compute the right hand side as follows.

\begin{eqnarray}
& &  \sum_{\fke\in \cE_{\el}(G)} \iota(G,H) ST^{H_1}_{\el,\chi_{H_1}}(f^{H_1})\nonumber\\
& = &\tau_{\fkX_{H}}(G)  \sum_{\fke\in \cE_{\el}(G)}  \lambda(\fke)^{-1} \sum_{\gamma_{H_1}\in \Sigma_{\el,\fkX_{H_1}}(H_1)} |\mathrm{Stab}_{\fkX_{H_1}}(\gamma_{H_1})|^{-1} SO_{\gamma_{H_1}}(f^{H_1})
\nonumber\\
& = & \tau_{\fkX_{H}}(G)  \sum_{\fke\in \cE_{\el}(G)}  \lambda(\fke)^{-1} \sum_{\gamma_{H}\in \Sigma_{\el,\fkX}(H)} \ol\iota(\gamma_H)^{-1} SO_{\gamma_{H_1}}(f^{H_1})
\nonumber\\
& = &
\tau_\fkX(G)\sum_{(\fke,\gamma_H)\in \cE\Sigma^\sim_{\el,\fkX}(G)} \lambda(\fke)^{-1}\ol\iota(\gamma_H)^{-1}SO_{\gamma_{H_1}}(f^{H_1})
\nonumber\\
& =&
\tau_\fkX(G) \sum_{(\gamma_0,\kappa)\in \Sigma\fkK_{\el,\fkX}(G)} \sum_{(\fke,\gamma_H)\in \cE\Sigma^\sim_{\el,\fkX}(G)
\atop \fkE_\fkX:(\fke,\gamma_H)\mapsto (\gamma_0,\kappa) } \lambda(\fke)^{-1}\ol\iota(\gamma_H)^{-1}SO_{\gamma_{H_1}}(f^{H_1}) \nonumber\\
&  = &
\tau_\fkX(G) \sum_{(\gamma_0,\kappa)\in \Sigma\fkK_{\el,\fkX}(G)\atop \gamma_0:\,\R\textrm{-elliptic}} \sum_{a \in \fkD(I_0,G;\A_f^p) \atop [b]\in \fkD_n(\gamma_0,G;\Q_p)}  \ol\iota(\gamma_0)^{-1} N(\gamma_0,\kappa,a,[b]).
\nonumber
\end{eqnarray}

In the third, fourth, and fifth lines, $\gamma_{H_1}\in H_1(\Q)_{\semi}$ is an arbitrary lift of $\gamma_H\in H(\Q)_{\semi}$. Each summand is independent of the choice since $f_1$ transforms under the character $\chi_{H_1}^{-1}$, which is trivial on $Z_1(\Q)$.

We justify these equalities. The first equality uses Lemma <ref> and (<ref>).
The next one is based on Lemma <ref> and the bijection $\Sigma_{\el,\fkX_{H_1}}(H_1)\ra \Sigma_{\el,\fkX}(H)$ induced by the surjection $H_1(\Q)\rightarrow H(\Q)$. We also used $|\mathrm{Stab}_{\fkX}(\gamma_H)|=1$, and the vanishing of the summand if $\gamma_{H_1}$ is not $(G_1,H_1)$-regular by Lemma <ref>.
To continue, the third equality is justified by Lemma <ref> telling us that only $(G,H)$-regular $\gamma_H$ contributes to the sum.
The fourth equality follows from Lemma <ref>. The last equality is deduced from Lemma <ref> Corollary <ref>, and (<ref>), noting that $\gamma_{0,1}$ can be taken from $G_1(\Q)$ whenever $SO_{\gamma_{H_1}}(f^{H_1})\neq 0$ as shown in the proof of Lemma <ref>.

The proof is complete as the last expression in the displayed formula is exactly the left hand side of the theorem by <ref>.

Assume that $(G,X)$ is of abelian type. With notation as in Theorem <ref>, we have

\sum_{i} (-1)^i \tr \bigg({\Phi}_{\mathfrak p}^m \times (f^p dg^p)  \mid \coh_c^i(\Sh_{\ol{E}},\xi)^{K_p} \bigg)  = \sum_{\fke\in \cE_{\el}(G)} \iota(G,H) ST^{H_1}_{\el,\chi_{H_1}}(f^{H_1})$$
for all sufficiently large $m$.

This follows from Theorems <ref> and  <ref>.

§ SPECTRAL INTERPRETATION

In order to read off spectral information from Theorem <ref>, we need to turn the geometric stable distribution into a spectral expansion.
After discussing the stable trace formula in <ref> when the test function is stable cuspidal at $\infty$, we will remark on the prospect for unconditional spectral interpretation in <ref>.

§.§ The stable trace formula

Let $G$ be a quasi-split connected reductive group over $\Q$ with a fixed $z$-extension $G_1$. (We do not assume that $G$ is part of a Shimura datum in <ref>.)
Let $(\fkX,\chi)$ be a central character datum such that $\fkX\supset A_{Z,\infty}$. For each elliptic endoscopic datum $\fke=(H,\cH,s,\eta)\in \cE_{\el}(G)$, choose a central extension $H_1$ and define $\fke_1\in \cE_{\el}(G_1)$ as well as characters $\chi_1$ and $\lambda_{H_1}$ as at the start of <ref>. We have a central character datum $(\fkX_{H_1},\chi_{H_1})$ with $\chi_{H_1}:=\chi_1\lambda_{H_1}^{-1}$ as in <ref>.
Let us recall relationships between certain stable distributions on $G(\A)$.

Set $\fkX_0:=A_{Z,\infty}$. Define $\chi_0:A_{Z,\infty}\ra\C^\times$ to be the restriction of $\fkX$ to $\fkX_0$.
Then $(\fkX_0,\chi_0)$ is a central character datum.
Let $S_{\chi_0}=S^G_{\chi_0}$ denote Arthur's stable distribution on $\cH(G(\A),\chi_0^{-1})$ inductively defined in <cit.>. Write $S_{\disc,\chi_0}$ for the discrete part of $S_{\chi_0}$ (see (7.11) in loc. cit.). Define $S_{\chi}$ and $S_{\disc,\chi}$ in terms of $S_{\chi_0}$ and $S_{\disc,\chi_0}$ exactly as in (<ref>). The equality defining $S^G_{\chi_0}$ inductively leads to the analogous equality (compare with <cit.>)

\begin{equation}\label{eq:S=I-S}
S^G_{\chi}(f)=I^G_\chi(f)-\sum_{\fke=(H,\cH,s,\eta)\in \cE_{\el}(G)\atop H\neq G} \iota(G,H) S^{H_1}_{\chi_{H_1}}(f^{H_1}),
\end{equation}

where $I^G_\chi$ means either $I^G_{\spec,\chi}$ or $I^G_{\geom,\chi}$, which are equal, and $f^{H_1}\in \cH(H_1(\A),\chi^{-1}_{H_1})$ denotes a Langlands–Shelstad transfer of $f$ (Proposition <ref>). If $f_\infty$ is stable cuspidal then $f^{H_1}_\infty$ is also stable cuspidal (possibly trivial). Indeed, this is reduced via $z$-extensions to the case that $G_{\der}=G_{\sconn}$, where this fact follows from work of Shelstad and Clozel–Delorme by the argument as in <cit.>. (This argument is also at the basis of constructing $f^{H_1}_\infty$ in <ref>.)

Likewise the analogue of (<ref>) holds true with $S_{\disc}$ and $I_{\disc}$ in place of $S$ and $I$.
What follows is the stable version of Proposition <ref>.

Let $f=f^\infty f_\infty\in \cH(G(\A),\chi^{-1})$ with $f_\infty$ stable cuspidal. Then

This follows from Proposition <ref>, which implies that

via the inductive definition above.

We are going to state a stabilization of the geometric side. Let $(\fkX,\chi)$ be a central character datum for $G$. Write $A_{G_{\R}}$ for the maximal $\R$-split torus in $Z_{G_{\R}}$. (In general $A_{G_{\R}}\neq (A_G)_{\R}$.)
Consider the following hypotheses:

(H1) $G_{\R}$ contains an elliptic maximal torus,

(H2) $\fkX=\fkX^\infty\times \fkX_\infty$ with $\fkX^\infty \subset Z(\A_f)$ and $A_{G_\R,\infty}\subset \fkX_\infty\subset Z(\R)$.

The two conditions are satisfied by the groups contributing to the right hand side of Theorem <ref>, so (H1) and (H2) are harmless to assume for our purpose.

We adapt the definition of the stable distribution $ST^G_M$ in <cit.> to the case of fixed central character.
Let $T_{\infty}$ be an elliptic maximal torus of $G_{\R}$ and write $T_{\textup{sc},\infty}\subset G_{\textup{sc},\R}$ for the preimage. Write $G^{\textup{cpt}}$ for an inner form of $G_{\R}$ which is anisotropic modulo $A_{G_{\R}}$; such a  $G^{\textup{cpt}}$ exists by (H1).
The Haar measure on $G^{\textup{cpt}}(\R)$ is always chosen to be compatible with that of $G(\R)$.

\begin{eqnarray}
k(G_{\R})&:=&|\textup{im}(\coh^1(\R,T_{\textup{sc},\infty}) \ra H^1(\R,T_\infty))|, \nonumber\\
\ol{v}(G_{\R})&:=&e(G^{\textup{cpt}}) \vol(G^{\textup{cpt}}(\R)/A_{G_{\R}}(\R)^0). \nonumber
\end{eqnarray}

The two numbers depend only on $G_{\R}$ and a Haar measure on $G(\RR)$.

Let $M_{\R}\subset G_{\R}$ be an $\R$-rational Levi subgroup containing an elliptic maximal torus. (So the torus is anisotropic modulo $A_{M_{\R}}$.) Let $\Pi$ be a discrete series $L$-packet of $G(\R)$ with fixed central character $\chi_\infty$ on $\fkX$, and write $\Theta_\Pi$ for the associated stable character (either as a function on regular elements or as a distribution on the space of test functions). Let $D^{G_{\R}}_{M_{\R}}$ denote the Weyl discriminant. Write $\Phi^{G_{\R}}_{M_{\R}} (\cdot,\Theta_\Pi)$ for the unique function on the set of elliptic elements in $M(\R)$ which extends the function $\gamma \mapsto |D^{G_{\R}}_{M_{\R}}(\gamma)|^{1/2} \Theta_\Pi(\gamma)$ on $M(\R)\cap G(\R)_{\textup{reg}}$; such an extension exists by <cit.>.
Let $f_\infty\in C^\infty_c(G(\R),\chi_\infty^{-1})$.
For elliptic elements $\gamma$ in $M(\R)$, define

$$ S\Phi^{G_{\R}}_{M_{\R}} (\gamma,f_\infty)
:= (-1)^{\dim A_{M_{\R}}/A_{G_{\R}}} \cdot \ol v(M^0_{\R,\gamma})^{-1} \frac{k(M_\R)}{k(G_\R)}  \sum_{\Pi} \Phi^{G_{\R}}_{M_{\R}}(\gamma^{-1},\Phi_{\Pi}) \Theta_{\Pi}(f_\infty),

where $M_{\R,\gamma}^0$ is the connected centralizer of $\gamma$ in $M_{\R}$, and the sum runs over discrete series $L$-packets with central character $\chi_{\infty}$. Set $S\Phi^{G_{\R}}_{M_{\R}} (\gamma,f_\infty)=0$ if $\gamma\in M(\R)$ is not elliptic.

Turning back to the global setting, assuming (H1) and (H2) for $G$, let $M$ be a $\Q$-rational Levi subgroup of $G$, which is said to be $G$-cuspidal if $M_{\R}$ contains an elliptic maximal torus and if $\dim A_M/A_G = \dim A_{M_{\R}}/A_{G_{\R}}$. This relativizes the notion of cuspidal reductive groups over $\Q$. Note that $M=G$ is always $G$-cuspidal even if $G$ is not cuspidal over $\Q$.
Let $f=f^\infty f_\infty$ with $f^\infty\in \cH(G(\A_f),(\chi^\infty)^{-1})$ and $f_\infty\in \cH(G(\R),\chi_\infty^{-1})$. Denote by $f^\infty_M\in \cH(M(\A_f),(\chi^\infty)^{-1})$ the constant term of $f^\infty$ defined by <cit.>. (The same definition works regardless of fixed central character. As explained therein, it is not $f^\infty_M$ itself but its orbital integral that has well-defined values.) If $M$ is $G$-cuspidal, put

$$ST^G_{M,\chi}(f):=\tau_{\fkX}(M) \sum_\gamma \ol\iota_M(\gamma)^{-1} SO_\gamma(f^\infty_M) S\Phi^{G_{\R}}_{M_{\R}} (\gamma,f_\infty),

where the sum runs over the set of stable semi-simple conjugacy classes in $M(\Q)$. (The summand is zero unless $\gamma$ is elliptic in $M(\R)$.) Define $ST^G_{M,\chi}$ to be identically zero if $M$ is not $G$-cuspidal. Finally, define

$$ ST^G_{\chi}(f):=\sum_M |(N_G(M)/M)(\Q)|^{-1}

where $M$ runs over the set of $G(\Q)$-conjugacy classes of $\Q$-rational Levi subgroups.

Let $G$ be a quasi-split reductive group over $\Q$ with central character datum $(\fkX,\chi)$.
Assume (H1) and (H2) above, and let $f=f^\infty f_\infty$ as above with $f_\infty$ stable cuspidal.

As in (<ref>), we have

$$I^G_{\chi}(f)=\sum_{\fke=(H,\cH,s,\eta)\in \cE_{\el}(G)} \iota(G,H)S^{H_1}_{\chi_{H_1}}(f^{H_1}).$$

The assertion is trivial if $G$ is a torus.
We induct on the semi-simple rank. Then
$$ S^{H_1}_{\chi_{H_1}}(f^{H_1})=ST^{H_1}_{\chi_{H_1}}(f^{H_1})$$
for all $\fke$
such that $H\ncong G$.
Indeed, if $H_{1,\R}$ contains no elliptic maximal torus or if $A_{G_{\R}}\subsetneq A_{H_{\R}}$, then the transfer $f^{H_1}_\infty$ vanishes so the equality holds trivially. Otherwise $H_{1,\R}$ and $\fkX_{H_1}$ satisfy the analogue of (H1) and (H2), so the above equality is true by the induction hypothesis.

To conclude, it is enough to show that

$$I^G_{\chi}(f)=\sum_{\fke=(H,\cH,s,\eta)\in \cE_{\el}(G)}\iota(G,H)ST^{H_1}_{\chi_{H_1}}(f^{H_1})$$

when $f_\infty$ is a stable cuspidal function. This was proven by Peng <cit.> without fixed central character. The desired equality follows from it by averaging with respect to $(\fkX,\chi)$.
(When $G$ is cuspidal over $\Q$ with simply connected derived subgroup, Peng's result was obtained in an unpublished manuscript by Kottwitz <cit.>, cf. <cit.>.)

§.§ Speculations

We return to the setting of Theorem <ref> for the compactly supported cohomology of Shimura varieties, where (H1) and (H2) hold true for $G$ and $\fkX$ as well as for $H_1$ and $\fkX_{H_1}$ contributing non-trivially to the right hand side.

The analogue of Theorem <ref> is expected to be true for the intersection cohomology of the Baily–Borel compactification. Writing $T^{\textup{IH}}(\Phi^m_{\fkp},f^p dg^p)$ for the intersection cohomology analogue of $T(\Phi^m_{\fkp},f^p dg^p)$, the conjectural stabilization should have the form (cf. <cit.>)

\begin{equation}\label{eq:trace-on-IH}
T^{\textup{IH}}(\Phi^m_{\fkp},f^p dg^p)=\sum_{\fke\in \cE_{\el}(G)} \iota(G,H) ST^{H_1}_{\chi_{H_1}}(f^{H_1}).
\end{equation}

The point is that the non-elliptic terms in $ST^{H_1}_{\chi_{H_1}}$ (coming from proper Levi subgroups) should be accounted for exactly by the boundary strata of the Baily–Borel compactification. For non-proper Shimura varieties, (<ref>) is known for certain special orthogonal group and unitary similitude groups in addition to general symplectic groups in [92, 107, 108, 109, 153].
On the other hand, Lemmas <ref> and <ref> imply that

\begin{equation}\label{eq:ST=S}
ST^{H_1}_{\chi_{H_1}}(f^{H_1}) = S^{H_1}_{\disc,\chi_{H_1}}(f^{H_1}).
\end{equation}

Combined with (<ref>), this yields a trace formula for the intersection cohomology in terms of the stable distributions $S^{H_1}_{\disc,\chi_{H_1}}$, which are of a spectral nature. Then one can follow Kottwitz <cit.> to unravel $S^{H_1}_{\disc,\chi_{H_1}}(f^{H_1})$ to obtain a conjectural description of the intersection cohomology (in each degree, by purity) as a $G(\A_f)\times \Gal(\ol E/E)$-module, in terms of automorphic representations of $G(\A)$ and their endoscopic classification; see p. 201 therein.[We do not reproduce Kottwitz's argument or his conjectural description here. We content ourselves with remarking that the destabilization process in [65] may also be carried out by applying the conjectural stable multiplicity formula, cf. <cit.>. Still the key computation at $p$ and $\infty$ of <cit.> is irreplaceable as it reflects the features of test functions at $p$ and $\infty$ specific to the context of Shimura varieties.]
The endoscopic classification for classical groups is worked out in [8, 105, 55, 139], in the quasi-split case and some more. However, little is known for groups of higher rank beyond classical groups, except for partial results on general symplectic and orthogonal groups in [148, 150].

We return to compactly supported cohomology.
In the special case that $G/Z$ is anisotropic over $\Q$, the Shimura variety $\Sh_K$ is proper over $E$ for each $K$. Thus the intersection cohomology coincides with the compactly supported cohomology.
In particular $T^{\textup{IH}}(\Phi^m_{\fkp},f^p dg^p)=T(\Phi^m_{\fkp},f^p dg^p)$, and the above consideration suggests that

\begin{equation}\label{eq:ST=STell}
ST^{H_1}_{\chi_{H_1}}(f^{H_1}) \stackrel{?}{=} S^{H_1}_{\el,\chi_{H_1}}(f^{H_1}).
\end{equation}

We stress that this equality is not intrinsic to $H_1$. Indeed, a quasi-split inner form $G^*$ of $G$ over $\Q$ shares the same elliptic endoscopic data as $G$. When $G^*$ can be promoted to a Shimura datum,  (<ref>) would be false for $f^{H_1}$ constructed in the context of the Shimura variety for $G^*$ (since the latter does have a non-empty boundary).
Once (<ref>) is verified, we obtain (<ref>), and the preceding paragraph explains how to extract the spectral information for the compactly supported cohomology in this case.

If $G/Z$ is isotropic over $\Q$, then the description of the $G(\A_f)\times \Gal(\ol E/E)$-module structure on the compactly supported cohomology is expected to be very complicated. Indeed, this is confirmed by Franke's formula [32] even if the Galois action is forgotten. See also [84] for the case of $\textup{GSp}_4$. Moreover, there may be cancellations between different degrees since the compactly supported cohomology need not be pure. We think that it is better to study the intersection cohomology by proving (<ref>) in this case.

We end by summarizing the prospect of unconditional results on the cohomology of Shimura varieties associated with $(G,X)$. In the case of abelian type, our main result is that the identity in Theorem <ref> holds unconditionally whenever $K_p$ is a hyperspecial subgroup of $G(\Q_p)$ and $m$ is sufficiently large. When $G/Z$ is anisotropic over $\Q$, in order to make the conjectural description in the style of <cit.> unconditional, the two main missing ingredients are the endoscopic classification of automorphic representations (for $G$ and the groups $H_1$'s contributing to the stabilization) and the equality (<ref>).
When $G/Z$ is isotropic, instead of (<ref>), one should attempt to prove (<ref>) by extending the methods of  [108] and  [153]. On top of that, the same endoscopic classification is needed to arrive at the final description of cohomology.

[1]
Michael Artin and Alexander Grothendieck.
Théorie des topos et cohomologie étale des schémas.
Tome 3.
Lecture Notes in Mathematics, Vol. 305. Springer-Verlag, Berlin-New
York, 1973.
Séminaire de Géométrie Algébrique du Bois-Marie
1963–1964 (SGA 4), Dirigé par M. Artin, A. Grothendieck et J. L.
Verdier. Avec la collaboration de P. Deligne et B. Saint-Donat.

[2]
Jarod Alper, Daniel Halpern-Leistner, and Jochen Heinloth.
Cartan-Iwahori-Matsumoto decompositions for reductive groups.
arXiv:1903.00128, February 2019.

[3]
Johannes Anschütz.
Extending torsors on the punctured Spec(A_inf).
arXiv e-prints, page arXiv:1804.06356, April 2018.

[4]
James Arthur.
A trace formula for reductive groups. I. Terms associated to
classes in $G({\bf Q})$.
Duke Math. J., 45(4):911–952, 1978.

[5]
James Arthur.
The invariant trace formula. II. Global theory.
J. Amer. Math. Soc., 1(3):501–554, 1988.

[6]
James Arthur.
The $L^2$-Lefschetz numbers of Hecke operators.
Invent. Math., 97(2):257–290, 1989.

[7]
James Arthur.
A stable trace formula. I. General expansions.
J. Inst. Math. Jussieu, 1(2):175–277, 2002.

[8]
James Arthur.
The endoscopic classification of representations, volume 61 of
American Mathematical Society Colloquium Publications.
American Mathematical Society, Providence, RI, 2013.
Orthogonal and symplectic groups.

[9]
Emil Artin and John Tate.
Class field theory.
AMS Chelsea Publishing, Providence, RI, 2009.
Reprinted with corrections from the 1967 original.

[10]
Bhargav Bhatt, Matthew Morrow, and Peter Scholze.
Integral $p$-adic Hodge theory.
Publ. Math. Inst. Hautes Études Sci., 128:219–397, 2018.

[11]
Armand Borel.
Some finiteness properties of adele groups over number fields.
Inst. Hautes Études Sci. Publ. Math., pages 5–30, 1963.

[12]
Armand Borel.
Linear algebraic groups, volume 126 of Graduate Texts in
Springer-Verlag, New York, second edition, 1991.

[13]
Mikhail Borovoi.
Abelian Galois cohomology of reductive groups.
Mem. Amer. Math. Soc., 132(626):viii+50, 1998.

[14]
M. V. Borovoĭ.
Langlands' conjecture concerning conjugation of connected Shimura
Selecta Math. Soviet., 3(1):3–39, 1983/84.
Selected translations.

[15]
Michael Broshi.
$G$-torsors over a Dedekind scheme.
J. Pure Appl. Algebra, 217(1):11–19, 2013.

[16]
Laurent Clozel and Patrick Delorme.
Le théorème de Paley-Wiener invariant pour les groupes de
Lie réductifs. II.
Ann. Sci. École Norm. Sup. (4), 23(2):193–228, 1990.

[17]
Pierre Colmez and Jean-Marc Fontaine.
Construction des représentations $p$-adiques semi-stables.
Invent. Math., 140(1):1–43, 2000.

[18]
Miaofen Chen, Mark Kisin, and Eva Viehmann.
Connected components of affine Deligne-Lusztig varieties in mixed
Compos. Math., 151(9):1697–1762, 2015.

[19]
Raf Cluckers and François Loeser.
Constructible exponential functions, motivic Fourier transform and
transfer principle.
Ann. of Math. (2), 171(2):1011–1065, 2010.

[20]
Brian Conrad.
Lifting global representations with local properties.
preprint, 2011.
Available at
<http://math.stanford.edu/ conrad/papers/locchar.pdf>.

[21]
Christophe Cornut.
An Euler system of Heegner type.
preprint, 2018.
Available at
<https://webusers.imj-prg.fr/ christophe.cornut/papers/ESHT.pdf>.

[22]
J.-L. Colliot-Thélène and J.-J. Sansuc.
Fibrés quadratiques et composantes connexes réelles.
Math. Ann., 244(2):105–134, 1979.

[23]
Rahul Dalal.
Sato-Tate Equidistribution for Families of Automorphic
Representations through the Stable Trace Formula.
arXiv e-prints, page arXiv:1910.10800, October 2019.

[24]
Stephen DeBacker.
Parameterizing conjugacy classes of maximal unramified tori via
Bruhat-Tits theory.
Michigan Math. J., 54(1):157–178, 2006.

[25]
Pierre Deligne.
Travaux de Shimura.
In Séminaire Bourbaki, 23ème année (1970/71), Exp.
No. 389, pages 123–165. Lecture Notes in Math., Vol. 244. Springer,
Berlin, 1971.

[26]
Pierre Deligne.
Variétés de Shimura: interprétation modulaire, et techniques
de construction de modèles canoniques.
In Automorphic forms, representations and $L$-functions
(Proc. Sympos. Pure Math., Oregon State Univ., Corvallis,
Ore., 1977), Part 2, Proc. Sympos. Pure Math., XXXIII, pages 247–289.
Amer. Math. Soc., Providence, R.I., 1979.

[27]
Pierre Deligne.
Motifs et groupes de taniyama.
In Hodge cycles, motives, and Shimura varieties, pages
261–279. Springer, 1982.

[28]
P. Deligne.
Catégories tannakiennes.
In The Grothendieck Festschrift, Vol. II, volume 87 of
Progr. Math., pages 111–195. Birkhäuser Boston, Boston, MA, 1990.

[29]
Pierre Deligne and James S Milne.
Tannakian categories.
In Hodge cycles, motives, and Shimura varieties, pages
101–228. Springer, 1982.

[30]
Gerd Faltings and Ching-Li Chai.
Degeneration of abelian varieties, volume 22 of Ergebnisse
der Mathematik und ihrer Grenzgebiete (3) [Results in Mathematics and Related
Areas (3)].
Springer-Verlag, Berlin, 1990.
With an appendix by David Mumford.

[31]
Jean-Marc Fontaine.
Modules galoisiens, modules filtrés et anneaux de
In Journées de Géométrie Algébrique de
Rennes. (Rennes, 1978), Vol. III, volume 65 of Astérisque,
pages 3–80. Soc. Math. France, Paris, 1979.

[32]
Jens Franke.
Harmonic analysis in weighted $L_2$-spaces.
Ann. Sci. École Norm. Sup. (4), 31(2):181–279, 1998.

[33]
Kazuhiro Fujiwara.
Rigid geometry, Lefschetz-Verdier trace formula and Deligne's
Invent. Math., 127(3):489–533, 1997.

[34]
M. Goresky, R. Kottwitz, and R. MacPherson.
Discrete series characters and the Lefschetz formula for Hecke
Duke Math., 89:477–554, 1997.

[35]
Marvin J. Greenberg.
Schemata over local rings. II.
Ann. of Math. (2), 78:256–266, 1963.

[36]
A. Grothendieck.
Éléments de géométrie algébrique. IV. Étude
locale des schémas et des morphismes de schémas IV.
Inst. Hautes Études Sci. Publ. Math., page 361, 1967.

[37]
Benedict H. Gross.
Algebraic modular forms.
Israel J. Math., 113:61–93, 1999.

[38]
Alexander Grothendieck.
Revêtements étales et groupe fondamental (SGA 1),
volume 3 of Documents Mathématiques (Paris).
Société Mathématique de France, Paris, 2003.
Séminaire de géométrie algébrique du Bois Marie
1960–61. , Directed by A. Grothendieck, With two papers by M. Raynaud,
Updated and annotated reprint of the 1971 original [Lecture Notes in Math.,
224, Springer].

[39]
Thomas J. Haines.
The base change fundamental lemma for central elements in parahoric
Hecke algebras.
Duke Math. J., 149(3):569–643, 2009.

[40]
Thomas C. Hales.
On the fundamental lemma for standard endoscopy: reduction to unit
Canad. J. Math., 47(5):974–994, 1995.

[41]
Robin Hartshorne.
Residues and duality.
Lecture notes of a seminar on the work of A. Grothendieck, given at
Harvard 1963/64. With an appendix by P. Deligne. Lecture Notes in
Mathematics, No. 20. Springer-Verlag, Berlin-New York, 1966.

[42]
A submersion principle and its applications.
In Geometry and analysis, pages 95–102. Indian Acad. Sci.,
Bangalore, 1980.

[43]
Thomas Haines and Michael Rapoport.
On parahoric subgroups.
Advances in Mathematics, 219(1):188–198, 2008.

[44]
Thomas J. Haines and Timo Richarz.
The test function conjecture for local models of Weil-restricted
Compos. Math., 156(7):1348–1404, 2020.

[45]
Thomas J. Haines and Timo Richarz.
The test function conjecture for parahoric local models.
J. Amer. Math. Soc., 34(1):135–218, 2021.

[46]
Michael Harris and Richard Taylor.
The geometry and cohomology of some simple Shimura varieties,
volume 151 of Annals of Mathematics Studies.
Princeton University Press, Princeton, NJ, 2001.
With an appendix by Vladimir G. Berkovich.

[47]
Tasho Kaletha.
Rigid inner forms of real and $p$-adic groups.
Ann. of Math. (2), 184(2):559–632, 2016.

[48]
Tasho Kaletha.
Global rigid inner forms and multiplicities of discrete automorphic
Invent. Math., 213(1):271–369, 2018.

[49]
Bernhard Keller.
Derived categories and their uses.
In Handbook of algebra, Vol. 1, volume 1 of Handb.
Algebr., pages 671–701. Elsevier/North-Holland, Amsterdam, 1996.

[50]
Wansu Kim.
The classification of $p$-divisible groups over 2-adic discrete
valuation rings.
Math. Res. Lett., 19(1):121–141, 2012.

[51]
Mark Kisin.
Crystalline representations and $F$-crystals.
In Algebraic geometry and number theory, volume 253 of Progr. Math., pages 459–496. Birkhäuser Boston, Boston, MA, 2006.

[52]
Mark Kisin.
Integral models for Shimura varieties of abelian type.
J. Amer. Math. Soc., 23(4):967–1012, 2010.

[53]
Mark Kisin.
Mod $p$ points on Shimura varieties of abelian type.
J. Amer. Math. Soc., 30(3):819–914, 2017.

[54]
Wansu Kim and Keerthi Madapusi Pera.
2-adic integral canonical models.
Forum Math. Sigma, 4:e28, 34, 2016.

[55]
Tasho Kaletha, Alberto Minguez, Sug Woo Shin, and Paul-James White.
Endoscopic classification of representations: Inner forms of unitary
preprint, 2014.

[56]
Martin Kneser.
Galois-Kohomologie halbeinfacher algebraischer Gruppen über
${\mathfrak p}$-adischen Körpern. II.
Math. Z., 89:250–272, 1965.

[57]
R. Kottwitz.
unpublished notes.

[58]
Robert E. Kottwitz.
Rational conjugacy classes in reductive groups.
Duke Math. J., 49(4):785–806, 1982.

[59]
Robert E. Kottwitz.
Sign changes in harmonic analysis on reductive groups.
Trans. Amer. Math. Soc., 278(1):289–297, 1983.

[60]
Robert E. Kottwitz.
Shimura varieties and twisted orbital integrals.
Math. Ann., 269(3):287–300, 1984.

[61]
Robert E. Kottwitz.
Stable trace formula: cuspidal tempered terms.
Duke Math. J., 51(3):611–650, 1984.

[62]
Robert E. Kottwitz.
Isocrystals with additional structure.
Compositio Math., 56(2):201–220, 1985.

[63]
Robert E. Kottwitz.
Stable trace formula: elliptic singular terms.
Math. Ann., 275(3):365–399, 1986.

[64]
Robert E. Kottwitz.
Tamagawa numbers.
Ann. of Math. (2), 127(3):629–646, 1988.

[65]
Robert E. Kottwitz.
Shimura varieties and $\lambda$-adic representations.
In Automorphic forms, Shimura varieties, and $L$-functions,
Vol. I (Ann Arbor, MI, 1988), volume 10 of Perspect. Math.,
pages 161–209. Academic Press, Boston, MA, 1990.

[66]
Robert E. Kottwitz.
On the $\lambda$-adic representations associated to some simple
Shimura varieties.
Invent. Math., 108(3):653–665, 1992.

[67]
Robert E. Kottwitz.
Points on some Shimura varieties over finite fields.
J. Amer. Math. Soc., 5(2):373–444, 1992.

[68]
Robert E. Kottwitz.
Isocrystals with additional structure. II.
Compositio Math., 109(3):255–339, 1997.

[69]
Robert E. Kottwitz.
Harmonic analysis on reductive $p$-adic groups and Lie algebras.
In Harmonic analysis, the trace formula, and Shimura
varieties, volume 4 of Clay Math. Proc., pages 393–522. Amer. Math.
Soc., Providence, RI, 2005.

[70]
M. Kisin and G. Pappas.
Integral models of Shimura varieties with parahoric level
Publ. Math. Inst. Hautes Études Sci., 128:121–218, 2018.

[71]
Robert E. Kottwitz and Diana Shelstad.
Foundations of twisted endoscopy.
Astérisque, pages vi+190, 1999.

[72]
R. Kottwitz and D. Shelstad.
On Splitting Invariants and Sign Conventions in Endoscopic
arXiv e-prints, page arXiv:1201.5658, January 2012.

[73]
Arno Kret and Sug Woo Shin.
Galois representations for general symplectic groups.
arXiv e-prints, page arXiv:1609.04223, September 2016.

[74]
Arno Kret and Sug Woo Shin.
Galois representations for even general special orthogonal groups.
arXiv e-prints, page arXiv:2010.08408, October 2020.

[75]
Jean-Pierre Labesse.
Cohomologie, stabilisation et changement de base.
Astérisque, pages vi+161, 1999.
Appendix A by Laurent Clozel and Labesse, and Appendix B by Lawrence

[76]
J.-P. Labesse.
Stable twisted trace formula: elliptic terms.
J. Inst. Math. Jussieu, 3(4):473–530, 2004.

[77]
R. P. Langlands.
Modular forms and $\ell $-adic representations.
In Modular functions of one variable, II (Proc. Internat.
Summer School, Univ. Antwerp, Antwerp, 1972), pages 361–500.
Lecture Notes in Math., Vol. 349, 1973.

[78]
R. P. Langlands.
Some contemporary problems with origins in the Jugendtraum.
In Mathematical developments arising from Hilbert problems
(Proc. Sympos. Pure Math., Vol. XXVIII, Northern Illinois
Univ., De Kalb, Ill., 1974), pages 401–418. Amer. Math. Soc.,
Providence, R. I., 1976.

[79]
R. P. Langlands.
Shimura varieties and the Selberg trace formula.
Canad. J. Math., 29(6):1292–1299, 1977.

[80]
R. P. Langlands.
Automorphic representations, Shimura varieties, and motives. Ein
In Automorphic forms, representations and $L$-functions
(Proc. Sympos. Pure Math., Oregon State Univ., Corvallis,
Ore., 1977), Part 2, Proc. Sympos. Pure Math., XXXIII, pages 205–246.
Amer. Math. Soc., Providence, R.I., 1979.

[81]
R. P. Langlands.
On the zeta functions of some simple Shimura varieties.
Canad. J. Math., 31(6):1121–1216, 1979.

[82]
R. P. Langlands.
Stable conjugacy: definitions and lemmas.
Canad. J. Math., 31(4):700–725, 1979.

[83]
Kai Wen Lan.
Arithmetic compactifications of PEL Type Shimura
Princeton University Press, 2013.

[84]
Gérard Laumon.
Sur la cohomologie à supports compacts des variétés de
Shimura pour ${\rm GSp}(4)_{\bf Q}$.
Compositio Math., 105(3):267–359, 1997.

[85]
Eike Lau.
Relations between Dieudonné displays and crystalline
Dieudonné theory.
Algebra Number Theory, 8(9):2201–2262, 2014.

[86]
Eike Lau.
Displayed equations for Galois representations.
Nagoya Math. J., 235:86–114, 2019.

[87]
Dong Uk Lee.
Galois gerbs and Lefschetz number formula for Shimura varieties of
Hodge type.
arXiv e-prints, page arXiv:1801.03057, January 2018.

[88]
Tong Liu.
Compatibility of Kisin modules for different uniformizers.
J. Reine Angew. Math., 740:1–24, 2018.

[89]
Chao Li and Yifeng Liu.
Chow groups and $L$-derivatives of automorphic motives for unitary
arXiv e-prints, to appear in Ann. Math., page arXiv:2006.06139,
June 2020.

[90]
Bertrand Lemaire, Colette Moeglin, and Jean-Loup Waldspurger.
Le lemme fondamental pour l'endoscopie tordue: réduction aux
éléments unités.
Ann. Sci. Éc. Norm. Supér. (4), 51(2):281–369, 2018.

[91]
R. P. Langlands and M. Rapoport.
Shimuravarietäten und Gerben.
J. Reine Angew. Math., 378:113–220, 1987.

[92]
Robert P. Langlands and Dinakar Ramakrishnan, editors.
The zeta functions of Picard modular surfaces.
Université de Montréal, Centre de Recherches Mathématiques,
Montreal, QC, 1992.

[93]
R. P. Langlands and D. Shelstad.
On the definition of transfer factors.
Math. Ann., 278(1-4):219–271, 1987.

[94]
R. Langlands and D. Shelstad.
Descent for transfer factors.
In The Grothendieck Festschrift, Vol. II, volume 87 of
Progr. Math., pages 485–563. Birkhäuser Boston, Boston, MA, 1990.

[95]
Kai-Wen Lan and Benoît Stroh.
Nearby cycles of automorphic étale sheaves, II.
In Cohomology of arithmetic groups, volume 245 of Springer
Proc. Math. Stat., pages 83–106. Springer, Cham, 2018.

[96]
Yifeng Liu, Yichao Tian, Liang Xiao, Wei Zhang, and Xinwen Zhu.
On the Beilinson-Bloch-Kato conjecture for Rankin-Selberg motives.
arXiv e-prints, page arXiv:1912.11942, December 2019.

[97]
Bertrand Lemaire and Jean-Loup Waldspurger.
Le lemme fondamental pour l'endoscopie tordue: le cas où le groupe
endoscopique elliptique non ramifié est un tore.
In Representation theory, number theory, and invariant theory,
volume 323 of Progr. Math., pages 399–468. Birkhäuser, 2017.

[98]
Yozô Matsushima.
A formula for the Betti numbers of compact locally symmetric
Riemannian manifolds.
J. Differential Geometry, 1:99–109, 1967.

[99]
Sander Mack-Crane.
Counting points on Igusa varieties of Hodge type.
UC Berkeley PhD thesis, 2021.

[100]
J. S. Milne.
The action of an automorphism of ${\bf C}$ on a Shimura variety
and its special points.
In Arithmetic and geometry, Vol. I, volume 35 of Progr. Math., pages 239–265. Birkhäuser Boston, Boston, MA, 1983.

[101]
J. S. Milne.
Canonical models of (mixed) Shimura varieties and automorphic
vector bundles.
In Automorphic forms, Shimura varieties, and $L$-functions,
Vol. I (Ann Arbor, MI, 1988), volume 10 of Perspect. Math.,
pages 283–414. Academic Press, Boston, MA, 1990.

[102]
J. S. Milne.
Letter to Deligne, 1990.
Available at <https://www.jmilne.org/math/articles/1990b.pdf>.

[103]
J. S. Milne.
The points on a Shimura variety modulo a prime of good reduction.
In The zeta functions of Picard modular surfaces, pages
151–253. Univ. Montréal, Montreal, QC, 1992.

[104]
J. S. Milne.
Basic theory of affine group schemes, 2012.
Available at <https://www.jmilne.org/math/CourseNotes/AGS.pdf>.

[105]
Chung Pang Mok.
Endoscopic classification of representations of quasi-split unitary
Mem. Amer. Math. Soc., 235(1108):vi+248, 2015.

[106]
S. Morel.
Complexes d'intersection des compactifications de Baily-Borel: le
cas des groupes unitaires sur $\mathbb{Q}$.
theèse de doctorat de l'université Paris 11, 2005.

[107]
S. Morel.
Complexes ponderes sur les compactifications de Baily-Borel: Le
cas des varietes de Siegel.
J. Amer. Math. Soc., 21:23–61, 2008.

[108]
Sophie Morel.
On the cohomology of certain noncompact Shimura varieties,
volume 173 of Annals of Mathematics Studies.
Princeton University Press, Princeton, NJ, 2010.
With an appendix by Robert Kottwitz.

[109]
Sophie Morel.
Cohomologie d'intersection des variétés modulaires de Siegel,
Compos. Math., 147(6):1671–1740, 2011.

[110]
James Milne and Kuang-Yen Shih.
Conjugates of Shimura varieties.
In Hodge cycles, motives, and Shimura varieties, volume 900
of Lecture Notes in Mathematics, pages 280–356. Springer-Verlag, 1982.

[111]
Bao Châu Ngô.
Le lemme fondamental pour les algèbres de Lie.
Publ. Math. Inst. Hautes Études Sci., pages 1–169, 2010.

[112]
Zhifeng Peng.
Multiplicity formula and stable trace formula.
Amer. J. Math., 141(4):1037–1085, 2019.

[113]
Richard Pink.
Arithmetical compactification of mixed Shimura varieties.
Bonner Mathematische Schriften [Bonn Mathematical Publications], 209.
Universität Bonn Mathematisches Institut, Bonn, 1990.
Dissertation, Rheinische Friedrich-Wilhelms-Universität Bonn,
Bonn, 1989.

[114]
Richard Pink.
On $l$-adic sheaves on Shimura varieties and their higher direct
images in the Baily-Borel compactification.
Math. Ann., 292(2):197–240, 1992.

[115]
Richard Pink.
On the calculation of local terms in the Lefschetz-Verdier trace
formula and its application to a conjecture of Deligne.
Ann. of Math. (2), 135(3):483–525, 1992.

[116]
Vladimir Platonov and Andrei Rapinchuk.
Algebraic groups and number theory, volume 139 of Pure and
Applied Mathematics.
Academic Press, Inc., Boston, MA, 1994.
Translated from the 1991 Russian original by Rachel Rowen.

[117]
Michael Rapoport.
A guide to the reduction modulo $p$ of Shimura varieties.
Astérisque, pages 271–318, 2005.
Automorphic forms. I.

[118]
Harry Reimann.
The semi-simple zeta function of quaternionic Shimura
varieties, volume 1657 of Lecture Notes in Mathematics.
Springer-Verlag, Berlin, 1997.

[119]
M. Rapoport and M. Richartz.
On the classification and specialization of $F$-isocrystals with
additional structure.
Compositio Math., 103(2):153–181, 1996.

[120]
Michael Rapoport and Eva Viehmann.
Towards a theory of local Shimura varieties.
Münster J. Math., 7:273–326, 2014.

[121]
M. Rapoport and Th. Zink.
Period spaces for $p$-divisible groups, volume 141 of Annals of Mathematics Studies.
Princeton University Press, Princeton, NJ, 1996.

[122]
Peter Scholze.
The Langlands-Kottwitz method and deformation spaces of
$p$-divisible groups.
J. Amer. Math. Soc., 26(1):227–259, 2013.

[123]
Jean-Pierre Serre.
Groupes de Grothendieck des schémas en groupes réductifs
Inst. Hautes Études Sci. Publ. Math., pages 37–52, 1968.

[124]
Jean-Pierre Serre.
Groupes algébriques associés aux modules de Hodge-Tate.
In Journées de Géométrie Algébrique de
Rennes. (Rennes, 1978), Vol. III, volume 65 of Astérisque,
pages 155–188. Soc. Math. France, Paris, 1979.

[125]
D. Shelstad.
$L$-indistinguishability for real groups.
Math. Ann., 259:385–430, 1982.

[126]
Goro Shimura.
On analytic families of polarized abelian varieties and automorphic
Ann. of Math. (2), 78:149–192, 1963.

[127]
Goro Shimura.
On the field of definition for a field of automorphic functions.
Ann. of Math. (2), 80:160–189, 1964.

[128]
Goro Shimura.
On the field of definition for a field of automorphic functions.
Ann. of Math. (2), 81:124–165, 1965.

[129]
Goro Shimura.
On the field of definition for a field of automorphic functions.
Ann. of Math. (2), 83:377–385, 1966.

[130]
Goro Shimura.
Algebraic number fields and symplectic discontinuous groups.
Ann. of Math. (2), 86:503–592, 1967.

[131]
Goro Shimura.
Construction of class fields and zeta functions of algebraic curves.
Ann. of Math. (2), 85:58–159, 1967.

[132]
Goro Shimura.
On canonical models of arithmetic quotients of bounded symmetric
Ann. of Math. (2), 91:144–222, 1970.

[133]
Goro Shimura.
On canonical models of arithmetic quotients of bounded symmetric
domains. II.
Ann. of Math. (2), 92:528–549, 1970.

[134]
Sug Woo Shin.
Counting points on Igusa varieties.
Duke Math. J., 146(3):509–568, 2009.

[135]
Sug Woo Shin.
A stable trace formula for Igusa varieties.
J. Inst. Math. Jussieu, 9(4):847–895, 2010.

[136]
T. A. Springer.
Linear algebraic groups, volume 9 of Progress in
Birkhäuser Boston, Inc., Boston, MA, second edition, 1998.

[137]
Neantro Saavedra Rivano.
Catégories Tannakiennes.
Lecture Notes in Mathematics, Vol. 265. Springer-Verlag, Berlin-New
York, 1972.

[138]
Robert Steinberg.
Torsion in reductive groups.
Advances in Math., 15:63–92, 1975.

[139]
Olivier Taïbi.
Arthur's multiplicity formula for certain inner forms of special
orthogonal and symplectic groups.
J. Eur. Math. Soc. (JEMS), 21(3):839–871, 2019.

[140]
J. Tits.
Reductive groups over local fields.
In Automorphic forms, representations and $L$-functions
(Proc. Sympos. Pure Math., Oregon State Univ., Corvallis,
Ore., 1977), Part 1, Proc. Sympos. Pure Math., XXXIII, pages 29–69.
Amer. Math. Soc., Providence, R.I., 1979.

[141]
Pol van Hoften.
Mod $p$ points on Shimura varieties of parahoric level (with an
appendix by Rong Zhou).
arXiv e-prints, page arXiv:2010.10496, October 2020.

[142]
Yakov Varshavsky.
A proof of a generalization of Deligne's conjecture.
Electron. Res. Announc. Amer. Math. Soc., 11:78–88, 2005.

[143]
J.-L. Waldspurger.
Le lemme fondamental implique le transfert.
Compositio Math., 105(2):153–236, 1997.

[144]
J.-L. Waldspurger.
Endoscopie et changement de caractéristique.
J. Inst. Math. Jussieu, 5(3):423–525, 2006.

[145]
J.-L. Waldspurger.
L'endoscopie tordue n'est pas si tordue.
Mem. Amer. Math. Soc., 194(908):x+261, 2008.

[146]
Torsten Wedhorn.
On Tannakian duality over valuation rings.
J. Algebra, 282(2):575–609, 2004.

[147]
Jean-Pierre Wintenberger.
Propriétés du groupe tannakien des structures de Hodge
$p$-adiques et torseur entre cohomologies cristalline et étale.
Ann. Inst. Fourier (Grenoble), 47(5):1289–1334, 1997.

[148]
Bin Xu.
L-packets of quasisplit $GSp(2n)$ and $GO(2n)$.
Math. Ann., 370(1-2):71–189, 2018.

[149]
Yujie Xu.
Normalization in integral models of Shimura varieties of Hodge
arXiv e-prints, page arXiv:2007.01275, July 2020.

[150]
Bin Xu.
Global L-packets of quasisplit $GSp(2n)$ and $GO(2n)$.
arXiv e-prints, page arXiv:2103.15300, March 2021.

[151]
Alex Youcis.
The Langlands-Kottwitz method and deformation spaces of
$p$-divisible groups of abelian type.
in progress.

[152]
Rong Zhou.
Mod $p$ isogeny classes on Shimura varieties with parahoric level
Duke Math. J., 169(15):2937–3031, 2020.

[153]
Yihang Zhu.
The stabilization of the Frobenius–Hecke traces on the
intersection cohomology of orthogonal Shimura varieties.
arXiv e-prints, page arXiv:1801.09404, January 2018.

[154]
Paul Ziegler.
Graded and filtered fiber functors on Tannakian categories.
J. Inst. Math. Jussieu, 14(1):87–130, 2015.

[155]
Rong Zhou and Yihang Zhu.
Twisted orbital integrals and irreducible components of affine
Deligne-Lusztig varieties.
Camb. J. Math., 8(1):149–241, 2020.