\section{A perfect complex whose trace cannot cancel} \label{fl:sec:punctured-spectral-fibre} As explained in Section~\ref{fl:sec:strategy}, the first step of the geometric construction is to find a perfect complex whose Frobenius trace cannot vanish by cancellation. It is constructed in this section, in characteristic zero and before any sheaf is specialized. Its cohomology is an exterior algebra, so the alternating trace of Frobenius on it is a determinant, and purity shows that no factor of this determinant is zero. The section is organized as follows. After fixing the data (Setup~\ref{rw:setup:auxiliary-curve}), we describe the stack on which the perfect complexes live, a derived fibre (Lemma~\ref{fl:lem:puncture-fibre-model}), define the corresponding family of automorphic sheaves and compute its Whittaker coefficient \eqref{fl:eq:puncture-vacuum}, show that the family is compatible with Hecke functors and with Frobenius (Lemma~\ref{fl:lem:coarse-covariance}), and finally compute the supertrace (Proposition~\ref{fl:prop:puncture-exact-trace}). \begin{setup}\label{rw:setup:auxiliary-curve} Let $C$ be a smooth proper curve over an algebraically closed field $K_{\rm geom}$ of characteristic zero, and let $\rho$ be a semisimple $\widehat G$-local system on $C$ with coefficients in $k=\overline{\mathbb Q}_\ell$. The curve and the local system carry a semilinear automorphism lifting the arithmetic $q$-Frobenius; let $g\in\widehat G(k)$ be its action on a marked fibre of $\rho$. Let $\mathsf{Mon}_{\rho}$ be the Zariski closure of the geometric monodromy. We assume that \begin{enumerate} \item $\mathsf{Mon}_{\rho}$ is reductive; \item $\overline{\langle\mathsf{Mon}_{\rho},g\rangle}/\mathsf{Mon}_{\rho}$ is finite; \item $C_{\widehat G}(\mathsf{Mon}_{\rho},g)$ is finite. \end{enumerate} \end{setup} Such data are constructed from the given elliptic parameter in Section~\ref{fl:sec:geometrization}. The curve lives over $K_{\rm geom}$, and $k$ is the field of coefficients of the sheaves. Put $Z_\rho=C_{\widehat G}(\mathsf{Mon}_{\rho})$, $\alpha=\operatorname{Ad}(g)|_{Z_\rho}$ and $\Pi_\rho=\pi_0(Z_\rho)$. Thus $Z_\rho$ is the centralizer of the geometric monodromy. Ellipticity makes the centralizer of the arithmetic monodromy finite, while $Z_\rho$ can contain a torus. \begin{lemma}[The centralizer of the geometric monodromy] \label{fl:lem:geometric-centralizer-torus} The group $Z_\rho$ is reductive, $Z_\rho^\circ$ is a torus, and $1-\alpha:Z_\rho^\circ\to Z_\rho^\circ$ is an isogeny. \end{lemma} \begin{proof} The centralizer of a reductive subgroup of a reductive group in characteristic zero is reductive. By assumption (2) some power $g^n$ lies in $\mathsf{Mon}_\rho$; it commutes with $Z_\rho$, so $\alpha^n=1$. The group of fixed points of $\alpha$ is $C_{\widehat G}(\mathsf{Mon}_\rho,g)$, which is finite by assumption (3). Suppose that the derived group of $Z_\rho^\circ$ is not trivial. An automorphism of finite order of a connected reductive group stabilizes a Borel subgroup and a maximal torus of it \cite[\S3.3, Proposition~3(b)--(c)]{Serre2007}. Then $\alpha$ permutes the corresponding simple coroots, and the sum of the coroots in one orbit is a nonzero cocharacter fixed by $\alpha$. Its image is a torus of dimension one fixed by $\alpha$, which contradicts the finiteness of the group of fixed points. So $Z_\rho^\circ$ is a torus. The kernel of $1-\alpha$ on it is the group of fixed points, which is finite; so $1-\alpha$ is an isogeny. \end{proof} \subsection{Filling punctures as a derived intersection} Choose a nonempty divisor $D_{\rm aux}$ on $C$, stable under the Frobenius automorphism and consisting of distinct points, and write $C^\circ=C-D_{\rm aux}$. For the stacks of local systems with restricted variation of \cite{AGKRRV2022,GR2025}, consider \[ Z_C=\operatorname{LS}_{\widehat G}^{r}(C),\qquad Z_{C^\circ}=\operatorname{LS}_{\widehat G}^{r}(C^\circ),\qquad \mathfrak F_\rho=BZ_\rho\mathbin{\times^R}_{Z_{C^\circ}}Z_C. \] Here $BZ_\rho\to Z_{C^\circ}$ is the residual gerbe of the point $\rho|_{C^\circ}$, and we write $j:\mathfrak F_\rho\to Z_C$ for the projection. The underlying classical stack of $\mathfrak F_\rho$ is $BZ_\rho$. The derived structure records the equations which express that the monodromy at the punctures is trivial; they are satisfied at $\rho$, but not transversally. The stacks $Z_C$ and $Z_{C^\circ}$ are defined by means of lisse $\ell$-adic sheaves. To compute with them we compare them with stacks of representations of topological fundamental groups. The comparison has three parts: a change of the base field, the passage from $\ell$-adic sheaves to sheaves for the classical topology, and the passage from local systems with restricted variation to all local systems. We make them explicit, because the second and the third are used for the curve $C^\circ$, which is not proper. \emph{The base field.} The curve $C$ and the divisor $D_{\rm aux}$ are defined over an algebraically closed subfield $K_0\subset K_{\rm geom}$ of finite transcendence degree over $\mathbb Q$, and such a field can be embedded in $\mathbb C$. For an extension of algebraically closed fields of characteristic zero and a scheme $Y$ of finite type over the smaller field, pullback is an equivalence between the categories $\operatorname{QLisse}$ of $Y$ and of its base change \cite[\S9.5.2, with its footnote, and Remark~9.5.3]{AGKRRV2022}. It is compatible with tensor products and with restriction to open subschemes. The stack of local systems with restricted variation is defined in terms of the symmetric monoidal category $\operatorname{QLisse}$ with its $t$-structure. Therefore $Z_C$, $Z_{C^\circ}$, the map between them and the point $\rho$ do not change when the pair $(C,D_{\rm aux})$ is replaced by its model over $K_0$, and then by the base change of this model to $\mathbb C$. Lemmas~\ref{fl:lem:puncture-fibre-model} and~\ref{fl:lem:puncture-compactness} concern only these objects; the semilinear automorphism of Setup~\ref{rw:setup:auxiliary-curve} does not occur in them. In their proofs we may therefore assume that $K_{\rm geom}=\mathbb C$. \begin{lemma}[Comparison with the Betti stacks] \label{rw:lem:betti-comparison} Suppose that $K_{\rm geom}=\mathbb C$. For $Y=C$ or $Y=C^\circ$ let $\operatorname{LS}^{\rm B}(Y)$ be the stack of $\widehat G$-local systems with coefficients in $k$ on the topological space $Y(\mathbb C)$, that is, the stack of maps from its homotopy type to $B\widehat G$ \cite[\S4.5.1]{AGKRRV2022}. \begin{enumerate} \item There are monomorphisms of prestacks $\iota_Y:Z_Y\to\operatorname{LS}^{\rm B}(Y)$, compatible with restriction from $C$ to $C^\circ$. \item Put \[ T=BZ_\rho\mathbin{\times^R}_{\operatorname{LS}^{\rm B}(C^\circ)} \operatorname{LS}^{\rm B}(C), \] the fibre product being formed with the residual gerbe of $\rho|_{C^\circ}$ and the restriction map. The projection $T\to\operatorname{LS}^{\rm B}(C)$ factors through $\iota_C$, and the resulting map $T\to\mathfrak F_\rho$ is an isomorphism, under which the projection becomes $\iota_C\circ j$. \item Let $\widehat X_\rho$ be the formal completion of $\operatorname{LS}^{\rm B}(C)$ along the fibre through $\rho$ of the map to its coarse moduli space \cite[\S4.6.2]{AGKRRV2022}. The intersection $Z_{C,\rho}$ of $Z_C$ and $\widehat X_\rho$ in $\operatorname{LS}^{\rm B}(C)$ is open and closed in each of them, and $j$ factors through $Z_{C,\rho}$. \end{enumerate} \end{lemma} \begin{proof} Write $\operatorname{LS}^{{\rm B},r}(Y)$ for the stack of local systems with restricted variation in the classical topology \cite[\S4.7]{AGKRRV2022}; the results quoted from there apply to $C$ and to $C^\circ$, which are smooth connected varieties over $\mathbb C$. \step{1}{the monomorphisms} The comparison functor from $\ell$-adic sheaves to ind-constructible sheaves of $k$-vector spaces for the classical topology is fully faithful and commutes with inverse images \cite[\S2.2.1]{GR2025}; on lisse sheaves it is symmetric monoidal \cite[\S2.2.4]{GR2025}. It preserves the usual $t$-structure, filtered colimits and lisse sheaves, so it maps the full subcategory $\operatorname{QLisse}(Y)$ of the first kind \cite[Definition~1.2.6]{AGKRRV2022} to that of the second kind, and the functor so obtained is fully faithful and symmetric monoidal, being the restriction of a fully faithful functor to full subcategories. The functor from the second category $\operatorname{QLisse}$ to all locally constant sheaves is fully faithful as well \cite[Proposition~4.7.2]{AGKRRV2022}. A fully faithful symmetric monoidal functor remains fully faithful after tensoring with $\operatorname{QCoh}(S)$, which is dualizable, and therefore induces a monomorphism between the prestacks of symmetric monoidal functors from $\operatorname{Rep}(\widehat G)$; this is the argument of \cite[Lemma~4.1.4]{AGKRRV2022}, used in \cite[\S4.7.4]{AGKRRV2022} for the second functor. So we have monomorphisms \[ Z_Y\longrightarrow\operatorname{LS}^{{\rm B},r}(Y) \longrightarrow\operatorname{LS}^{\rm B}(Y), \] and $\iota_Y$ is their composite. Both functors commute with restriction to $C^\circ$. This proves (1). \step{2}{the projection factors through local systems with restricted variation} The monomorphism $\operatorname{LS}^{{\rm B},r}(C)\to\operatorname{LS}^{\rm B}(C)$ is a formal isomorphism \cite[Proposition~4.7.8]{AGKRRV2022}. By the definition \cite[\S4.1.6]{AGKRRV2022} this means that a point of $\operatorname{LS}^{\rm B}(C)$ with values in an affine scheme $S$ lies in $\operatorname{LS}^{{\rm B},r}(C)$ as soon as its restriction to the reduced classical scheme underlying $S$ does. So let $S$ be reduced and classical. On classical schemes the Betti stack classifies families of homomorphisms from the fundamental group to $\widehat G$, up to conjugation \cite[\S4.5]{AGKRRV2022}. A point of $T$ with values in $S$ is therefore given by a $Z_\rho$-torsor on $S$, a family of local systems on $C$ parametrized by $S$, and an isomorphism between the restriction of this family to $C^\circ$ and the twist by the torsor of the constant family with fibre $\rho|_{C^\circ}$. Since $\pi_1(C^\circ)\to\pi_1(C)$ is surjective, the family on $C$ is the twist by the torsor of the constant family with fibre $\rho$. Locally on $S$ for the \'etale topology the torsor is trivial, and the family is the image of the point $\rho$ of $\operatorname{LS}^{{\rm B},r}(C)$ under $S\to\mathrm{pt}$. The prestack $\operatorname{LS}^{{\rm B},r}(C)$ is a stack for the \'etale topology \cite[Main Theorem~1.4.5]{AGKRRV2022}, so the point lies in it. \step{3}{the projection factors through $Z_C$} The map $Z_C\to\operatorname{LS}^{{\rm B},r}(C)$ is an isomorphism onto a union of connected components \cite[Lemma~2.2.5]{GR2025}, that is, onto an open and closed substack. Its complement is open and closed as well. By step~2 every point of $T$ with values in a field maps to the point $\rho$, after an extension of the field, and $\rho$ is a point of $Z_C$. So the inverse image in $T$ of the complement has no points and is empty, and the projection factors through $Z_C$. \step{4}{the isomorphism} If a map $A\to Y$ factors through a monomorphism $Y'\to Y$, then $A\times_YY'\simeq A$; and if two maps $A\to Y$ and $B\to Y$ factor through $Y'$, then $A\times_{Y'}B\simeq A\times_YB$. Both follow from $Y'\times_YY'\simeq Y'$. Applying the second to the monomorphism $\iota_{C^\circ}$ and the first to $\iota_C$ and the projection of $T$, which factors through it by step~3, we get \[ \mathfrak F_\rho =BZ_\rho\times_{Z_{C^\circ}}Z_C \simeq BZ_\rho\times_{\operatorname{LS}^{\rm B}(C^\circ)}Z_C \simeq T\times_{\operatorname{LS}^{\rm B}(C)}Z_C \simeq T , \] all fibre products being derived. The composite is inverse to the map of (2), and it is compatible with the projections to $\operatorname{LS}^{\rm B}(C)$. This proves (2). \step{5}{the formal completion} The substack $\operatorname{LS}^{{\rm B},r}(C)$ of $\operatorname{LS}^{\rm B}(C)$ is the disjoint union of the formal completions of the fibres of the map to the coarse moduli space \cite[Corollary~4.8.5]{AGKRRV2022}. So $\widehat X_\rho$ is open and closed in $\operatorname{LS}^{{\rm B},r}(C)$, and so is $Z_C$ by step~3; hence their intersection is open and closed in each. The map $j$ factors through $Z_C$ by construction, and through $\widehat X_\rho$ because every point of $\mathfrak F_\rho$ with values in a reduced classical scheme maps into the fibre through $\rho$, by step~2. This proves (3). \end{proof} \begin{lemma}[The derived fibre] \label{fl:lem:puncture-fibre-model} There is an isomorphism \begin{equation}\label{fl:eq:puncture-fibre} \mathfrak F_\rho\simeq [\operatorname{Spec}\Lambda(\mathsf B_\rho[1])/Z_\rho],\qquad \mathsf B_\rho=\bigoplus_{x\in D_{\rm aux}}\widehat{\mathfrak g}_x^*, \end{equation} where $\Lambda(\mathsf B_\rho[1])$ is the exterior algebra of $\mathsf B_\rho$, placed in degrees $\le0$ with zero differential, and $Z_\rho$ acts through the coadjoint representation at each point. In particular $H^0\Gamma(\mathfrak F_\rho,\mathcal O)=k$. The objects $\mathcal O\otimes W$, for $W$ a representation of finite dimension of $Z_\rho$, generate $\operatorname{Perf}(\mathfrak F_\rho)$ under finite cones and retracts. \end{lemma} \begin{proof} We may assume that $K_{\rm geom}=\mathbb C$. By Lemma~\ref{rw:lem:betti-comparison}(2) the stack $\mathfrak F_\rho$ is then the fibre $T$ of the restriction map between the Betti stacks, which we now compute. Let $h$ be the genus of $C$ and $n=|D_{\rm aux}|$. The fundamental group of the punctured surface has generators $a_1,b_1,\dots,a_h,b_h,c_1,\dots,c_n$ and the relation $\prod_i[a_i,b_i]\prod_jc_j=1$. We eliminate $c_n$: the punctured surface retracts onto a graph with $2h+n-1$ loops, so its Betti stack is $[\widehat G^{2h+n-1}/\widehat G]$. The closed surface is obtained from it by attaching a disc along each boundary loop, and this is a homotopy pushout. The stack of maps to $B\widehat G$ turns it into a derived fibre product: the Betti stack of the closed surface is the fibre product of that of the punctured surface and of $B\widehat G$ over $[\widehat G^n/\widehat G]$, for the map which records the images of $c_1,\dots,c_n$ and the inclusion of the identity. Since $\rho$ has trivial monodromy at the punctures, the fibre over the residual gerbe of $\rho|_{C^\circ}$ is the quotient by $Z_\rho$ of the spectrum of \[ k\otimes^L_{\mathcal O(\widehat G^n)}k , \] both copies of $k$ being the residue field at the identity. The identity is a smooth point with cotangent space $\mathsf B_\rho$, and the Koszul resolution shows that the cohomology of this ring is the exterior algebra of $\mathsf B_\rho$, with $\mathsf B_\rho$ in degree $-1$. To obtain an isomorphism of algebras with an action of $Z_\rho$, and not only of their cohomology, we use formal coordinates at the identity which are compatible with the action. They exist: since $Z_\rho$ is reductive, the surjections $\mathfrak m/\mathfrak m^{a+1}\to\mathfrak m/\mathfrak m^2$ of representations of $Z_\rho$ are split, compatibly in $a$, and the image of a splitting is a space of coordinates. In such coordinates the Koszul complex is a resolution of $k$ by modules with an action of $Z_\rho$, and after tensoring with $k$ its differential is zero. This gives \eqref{fl:eq:puncture-fibre} for $T$, hence for $\mathfrak F_\rho$. The identification of the cohomology in degree $-1$ with the cotangent space, and of the graded algebra of cohomology with its exterior algebra, is canonical. So an automorphism which preserves the fibre acts on the graded algebra of cohomology by the exterior powers of its action in degree $-1$. The splitting which was used to produce a model with zero differential is a choice, and it need not be compatible with Frobenius; it is not used for the action. The functions of degree zero on $\mathfrak F_\rho$ are the invariants of $Z_\rho$ in the part of degree zero of the exterior algebra, which is $k$. For a complex $Q$ of modules over the exterior algebra with a compatible action of $Z_\rho$, the complex of maps from $\mathcal O\otimes W$ to $Q$ is $(W^*\otimes Q)^{Z_\rho}$. This functor of $Q$ commutes with filtered colimits, because taking invariants under a reductive group does. If $Q$ has a nonzero cohomology class, the class lies in a finite-dimensional subrepresentation $W$ of a cohomology group, and gives a nonzero map from a shift of $\mathcal O\otimes W$. So the objects $\mathcal O\otimes W$ are compact generators, and the perfect complexes, which are the compact objects, are obtained from them by finite cones and retracts. \end{proof} \begin{lemma}[Compactness] \label{fl:lem:puncture-compactness} For every $P\in\operatorname{Perf}(\mathfrak F_\rho)$, the object $j_*P$ is compact in $\operatorname{QCoh}(Z_C)$. \end{lemma} \begin{proof} By Lemma~\ref{fl:lem:puncture-fibre-model} it is enough to consider $P=\mathcal O\otimes W$. We may assume that $K_{\rm geom}=\mathbb C$, and we use the notation of Lemma~\ref{rw:lem:betti-comparison} and of the preceding proof. Write $X=\operatorname{LS}^{\rm B}(C)$ and $j^{\rm B}=\iota_C\circ j:\mathfrak F_\rho\to X$. \step{1}{the direct image on the Betti stack is perfect} The variety $\widehat G^{2h+n-1}$ is smooth, and the orbit of the semisimple representation $\rho|_{C^\circ}$ in it is closed and smooth; so the inclusion of this orbit is a regular immersion. The sheaf on $[\widehat G^{2h+n-1}/\widehat G]=\operatorname{LS}^{\rm B}(C^\circ)$ supported on the orbit and defined by the representation $W$ of the stabilizer $Z_\rho$ is therefore perfect. It is the direct image of $W$ from the residual gerbe. The inclusion of the residual gerbe is a closed immersion, because the orbit is closed; so its base change $j^{\rm B}$ is an affine morphism, and direct images along these two maps commute with base change. By base change in the square which defines $T$, and by Lemma~\ref{rw:lem:betti-comparison}(2), the pullback of this sheaf to $X$ is $j^{\rm B}_*(\mathcal O\otimes W)$. Hence $j^{\rm B}_*(\mathcal O\otimes W)$ is perfect. The stack $X$ is the quotient of an affine derived scheme $\operatorname{Spec}R$ by $\widehat G$ \cite[\S\S4.5--4.6.1]{AGKRRV2022}. Since $\widehat G$ is reductive, the functor of global sections on $X$ commutes with colimits, and perfect complexes on $X$ are compact in $\operatorname{QCoh}(X)$. \step{2}{sheaves on the formal completion} Let $\hat\iota:\widehat X_\rho\to X$ be the inclusion of the formal completion of Lemma~\ref{rw:lem:betti-comparison}(3). The coarse moduli space of $X$ is the spectrum of the invariants $R^{\widehat G}$, and its underlying classical scheme is of finite type \cite[\S\S4.6.1--4.6.2]{AGKRRV2022}; let $f_1,\ldots,f_m\in H^0(R)^{\widehat G}$ generate the maximal ideal of the image of $\rho$ in it. Then $\widehat X_\rho$ is the quotient by $\widehat G$ of the formal completion of $\operatorname{Spec}R$ along the locus $f_1=\cdots=f_m=0$, which is a formal affine scheme in the sense of \cite[\S7.1]{AGKRRV2022}. Let $\operatorname{QCoh}(X)_\rho\subset\operatorname{QCoh}(X)$ be the full subcategory of the objects whose restriction to the complement of the fibre is zero; it is closed under colimits. We claim that $\hat\iota^*$ restricts to an equivalence \[ \operatorname{QCoh}(X)_\rho\xrightarrow{\ \sim\ } \operatorname{QCoh}(\widehat X_\rho). \] For the affine scheme $\operatorname{Spec}R$ in place of $X$ this is \cite[Proposition~7.1.5]{AGKRRV2022}, and the same holds for the schemes $\widehat G^a\times\operatorname{Spec}R$ with the pullbacks of the functions $f_i$. These schemes form the \v Cech nerve of $\operatorname{Spec}R\to X$, and their formal completions form the \v Cech nerve of the corresponding cover of $\widehat X_\rho$. The equivalences are given by pullback, so they are compatible with the maps of the two nerves, and the condition on the support is compatible with these maps, because pullback commutes with restriction to the open complement of the fibre. The claim follows by descent for quasi-coherent sheaves. \step{3}{conclusion} The complex $j^{\rm B}_*(\mathcal O\otimes W)$ is supported at the point $\rho$, so it lies in $\operatorname{QCoh}(X)_\rho$. It is compact in $\operatorname{QCoh}(X)$ by step~1. Hence it is compact in the full subcategory $\operatorname{QCoh}(X)_\rho$: the inclusion commutes with colimits, so maps from the complex into a filtered colimit formed in the subcategory are computed in $\operatorname{QCoh}(X)$. By step~2 the complex $\hat\iota^*j^{\rm B}_*(\mathcal O\otimes W)$ is compact in $\operatorname{QCoh}(\widehat X_\rho)$. The map $j^{\rm B}$ factors through the monomorphism $\hat\iota$, so $\mathfrak F_\rho\times_X\widehat X_\rho=\mathfrak F_\rho$, and by base change $\hat\iota^*j^{\rm B}_*(\mathcal O\otimes W)$ is the direct image of $\mathcal O\otimes W$ under $\mathfrak F_\rho\to\widehat X_\rho$. By Lemma~\ref{rw:lem:betti-comparison}(3) this map factors through $Z_{C,\rho}$, which is open and closed in $\widehat X_\rho$ and in $Z_C$. So $\operatorname{QCoh}(Z_{C,\rho})$ is a direct factor of $\operatorname{QCoh}(\widehat X_\rho)$ and of $\operatorname{QCoh}(Z_C)$, and the direct images of $\mathcal O\otimes W$ to $\widehat X_\rho$ and to $Z_C$ both come from its direct image to $Z_{C,\rho}$. An object of a direct factor which is compact in the whole category is compact in the factor, and an object which is compact in a direct factor is compact in the whole category. Therefore $j_*(\mathcal O\otimes W)$ is compact in $\operatorname{QCoh}(Z_C)$. \end{proof} \subsection{The automorphic family and its Whittaker coefficient} We use the equivalence of categories of the geometric Langlands correspondence with restricted variation in characteristic zero \cite[Theorem~1.3.9(ii)]{GR2025}, which we denote by $\mathbb L_G^r$. Let $\mathsf e$ be the fully faithful embedding of the category of quasi-coherent complexes into the spectral category with nilpotent singular support, normalized as in \cite[\S\S1.3.1--1.3.4]{GR2025}; the normalization includes the graded line of the dualizing complex. Define \[ \mathcal F_P=(\mathbb L_G^r)^{-1}\mathsf e(j_*P), \qquad P\in\operatorname{Perf}(\mathfrak F_\rho). \] The functor $P\mapsto\mathcal F_P$ is exact and $k$-linear. Since $j_*P$ is compact, \cite[Theorem~1.1.7 and \S1.3.4]{GR2025} shows that $\mathcal F_P$ is compact in the category of all automorphic sheaves; its restriction to every smooth chart of finite type is a bounded constructible complex. \subsubsection*{The Whittaker coefficient} Let $\operatorname{Poinc}^{\rm Vac}_!$ be the Poincar\'e object defined by $!$-pushforward from the Whittaker stack, with the regular representation of the finite centre as coefficient (it is recalled in the proof of Lemma~\ref{fl:lem:coarse-covariance}). The Whittaker coefficient is the functor $\operatorname{Wh}$ which it corepresents. The projection of $\operatorname{Poinc}^{\rm Vac}_!$ to the category of sheaves with nilpotent singular support corepresents the functor to $\operatorname{QCoh}(Z_C)$ followed by global sections. The two objects are different, but on our family the two functors agree: \begin{equation}\label{fl:eq:puncture-vacuum} \operatorname{Wh}(\mathcal F_P) \simeq\Gamma_!(Z_C,j_*P) \simeq\Gamma(\mathfrak F_\rho,P). \end{equation} The first isomorphism is \cite[Proposition~1.2.5]{GR2025}. For the second, $\Gamma_!$ agrees with $\Gamma$ on compact objects \cite[Remark~7.6.2]{AGKRRV2022}, and $\Gamma(Z_C,j_*P)=\Gamma(\mathfrak F_\rho,P)$. In terms of the projected object, the adjunction for the functor $\mathbb L^r_{G,\rm coarse}$ to $\operatorname{QCoh}(Z_C)$ gives \begin{equation}\label{fl:eq:projected-vacuum-coefficient} \operatorname{RHom} (\operatorname{Poinc}^{\rm Vac}_{!,\operatorname{Nilp}},\mathcal F_P) \simeq\Gamma(Z_C,j_*P), \end{equation} since $\mathbb L^r_{G,\rm coarse}\mathcal F_P=j_*P$: the right adjoint of the fully faithful functor $\mathsf e$ maps $\mathsf e(j_*P)$ to $j_*P$ \cite[Corollary~1.3.6(ii)]{GR2025}. \subsubsection*{Theta pairs} The curves in this paper carry a \emph{theta pair}: a line bundle $L$ with an isomorphism $L^2\simeq\Omega_C$. Let $\lambda_{\rm pr}$ be the sum of the positive coroots of $G$, a cocharacter of the maximal torus $T$, and $\mathcal P_T=\lambda_{\rm pr}(L)$ the $T$-bundle induced from $L$. The theta pair enters the definition of the Whittaker stack through $\mathcal P_T$, and that of the canonical bundle in Section~\ref{fl:sec:boundary-whittaker-geometry-section}. \paragraph{Pullback and transport.} A semilinear automorphism $u_C$ of the curve acts on the moduli stacks in two ways which are inverse to each other: an object can be pulled back by $u_C$, or transported by it. The direction of Frobenius in the rest of the paper depends on keeping the two apart, so we give them different names: \[ u_B(\mathcal E)=u_C^*\mathcal E, \qquad u_L(\tau)=u_C^*\tau, \qquad u_{\rm aut}=u_B^{-1},\quad u_{\rm spec}=u_L^{-1}. \] Thus $u_{\rm aut}$ and $u_{\rm spec}$ are transport by $u_C$, that is, pullback of bundles and of local systems by $u_C^{-1}$. When $u_C$ is the arithmetic Frobenius acting on the coefficients, $u_{\rm aut}$ is the arithmetic Frobenius of the stack of bundles. The same convention must be used on the two stacks. Indeed the pullback of a modification at $x$ is a modification at $u_C^{-1}x$, and for the universal local system $V_{\rm univ}$ evaluation gives a canonical isomorphism \[ (u_L\times u_C^{-1})^*V_{\rm univ}\simeq V_{\rm univ}. \] The corresponding statements for the inverse maps $u_{\rm aut}$ and $u_{\rm spec}$ follow. The directions of all the Frobenius maps which occur in the paper are collected in the table of Remark~\ref{rw:rem:trace-conventions}. Let $c:u_C^*\rho\xrightarrow{\sim}\rho$ be the chosen descent isomorphism. The point $\rho$ is fixed by $u_L$, and on the residual gerbe $BZ_\rho$ of this point $u_L$ acts by the automorphism \[ \delta:Z_\rho\longrightarrow Z_\rho, \qquad z\longmapsto c\,u_C^*(z)\,c^{-1}. \] So $u_{\rm spec}=u_L^{-1}$, and its lift $u_{\mathfrak F}$ to the derived fibre, act on the gerbe through $\delta^{-1}$. The pullback of a vector bundle on $BZ_\rho$ along the map induced by an automorphism $\gamma$ of $Z_\rho$ is the restriction of the representation along $\gamma$. Hence \begin{equation}\label{rw:eq:arithmetic-coefficient-pullback} u_{\mathfrak F}^*P_W\simeq P_{(\delta^{-1})^*W}. \end{equation} We compute $\delta$ for the arithmetic Frobenius of Setup~\ref{rw:setup:auxiliary-curve}. The semilinear map $u_C$ is the one with $u_C^\#(a)=a^q$ on the residue field. Let $a$ be the chosen arithmetic lift of Frobenius in the fundamental group, used to base it, and $g$ its image. Then $u_C$ acts on the geometric fundamental group by $\gamma\mapsto a^{-1}\gamma a$, so that \[ (u_C^*\rho)(\gamma)=g^{-1}\rho(\gamma)g, \qquad c=g, \] in the marked fibre, and $\delta=\operatorname{Ad}(g)=\alpha$. The orientation can be seen on a finite \'etale torsor: pulling back a section with coordinates $b$ along $u_C$ replaces them by $b^q$, so the canonical descent map on the fibre is the arithmetic Frobenius; the local system is a limit of such torsors. Therefore \eqref{rw:eq:arithmetic-coefficient-pullback} reads \[ u_{\mathfrak F}^*P_W=P_{(\alpha^{-1})^*W}. \] \begin{lemma}[Hecke action and semilinear covariance] \label{fl:lem:coarse-covariance} \begin{enumerate} \item Let $V$ be a representation of $\widehat G$, and let $V_\rho|_{C^\circ}=\bigoplus_aW_a\boxtimes L_a$ be a decomposition of the associated local system, with $W_a$ a representation of $Z_\rho$ and $L_a$ a local system on $C^\circ$. Then \begin{equation}\label{fl:eq:puncture-family-hecke} \mathsf H_{V}(\mathcal F_P) \simeq\bigoplus_a\mathcal F_{P\otimes W_a}\boxtimes L_a \end{equation} over $C^\circ$. The isomorphism does not depend on the decomposition. The same holds for every finite set $I$ of legs and every representation of $\widehat G^I$, over $(C^\circ)^I$, and these isomorphisms are compatible with tensor products, composition, permutations of the legs and fusion. We refer to them as the \emph{Hecke identities} of the family; for $P=P_W=\mathcal O_{\mathfrak F_\rho}\otimes W$ they make $W\mapsto\mathcal F_{P_W}$ a Hecke family in the sense of Definition~\ref{rw:def:hecke-family}(1). \item Let $u_C=u$ be a semilinear isomorphism of the curve $C$ which preserves the pinning, the theta pair and the divisor $D_{\rm aux}$, together with an isomorphism $u^*\rho\simeq\rho$. It induces an autoequivalence $u_{\mathfrak F}^*$ of $\operatorname{Perf}(\mathfrak F_\rho)$ and a natural isomorphism \[ u_{\rm aut}^*\mathcal F_P \simeq\mathcal F_{u_{\mathfrak F}^*P}, \] compatible with the Hecke identities. For a composite of two semilinear isomorphisms the isomorphism is the composite of the two. In particular the chosen lift of Frobenius and all its powers act on the family compatibly. \end{enumerate} \end{lemma} \begin{proof} The Hecke identities concern the spectral action. The covariance concerns the object to which the spectral action is applied, and it is this part which determines the Frobenius structure of the family. \step{1}{the Hecke identities} On $\mathfrak F_\rho\times C^\circ$ the universal local system is pulled back from $BZ_\rho\times C^\circ$, where the local system attached to $V$ is $\bigoplus_aW_a\boxtimes L_a$ with $W_a$ regarded as a vector bundle on $BZ_\rho$. The Hecke functor $\mathsf H_V$ corresponds under $\mathbb L^r_G$ to the tensor product with the local system attached to $V$, and by the projection formula for $j$ \[ j_*P\otimes V_{\rm univ}|_{Z_C\times C^\circ} \simeq\bigoplus_a j_*(P\otimes W_a)\boxtimes L_a . \] The left-hand side does not involve the decomposition. The compatibilities for all finite sets of legs are part of the equivalence between the spectral action and the action of Hecke functors on sheaves with nilpotent singular support \cite[Theorems~8.1.4, 14.3.2 and \S14.3.3]{AGKRRV2022}. \step{2}{a formula for the family} Let $\mathcal P_C$ be the projection of $\operatorname{Poinc}^{\rm Vac}_!$ to the category of sheaves with nilpotent singular support. For $A\in\operatorname{QCoh}(Z_C)$ and an automorphic sheaf $\mathcal K$, \[ \operatorname{RHom}((\mathbb L_G^r)^{-1}\mathsf e A,\mathcal K) \simeq\operatorname{RHom} (A,\mathsf e^R\mathbb L_G^r\mathcal K) \simeq\operatorname{RHom}(A,\mathbb L_{G,\rm coarse}^r\mathcal K), \] where $\mathsf e^R$ is the right adjoint of $\mathsf e$. So $(\mathbb L_G^r)^{-1}\mathsf e$ is the left adjoint of $\mathbb L^r_{G,\rm coarse}$. By the construction of the latter \cite[\S\S1.1.3--1.1.8]{GR2025} this left adjoint is $A\mapsto A\star\mathcal P_C$, where $\star$ denotes the spectral action. Hence \begin{equation}\label{rw:eq:family-by-spectral-action} \mathcal F_P\simeq(j_*P)\star\mathcal P_C. \end{equation} This formula does not involve the choice of an inverse of $\mathbb L_G^r$, and it fixes the normalization of $\mathsf e$. \step{3}{covariance of the Poincar\'e object} Let $\mathscr W_C=\operatorname{Bun}_{N,\mathcal P_T}/T$ be the Whittaker stack and $r$ the rank of $G$. The Poincar\'e object is defined by the diagram \[ \operatorname{Bun}_G(C)\xleftarrow{\ p_C\ } \mathscr W_C\xrightarrow{\ \chi_C\ } [\mathbb A^r/T]\xleftarrow{\ j_{\rm reg}\ }BZ(G) \] as $p_{C,!}\chi_C^*$ of the sheaf $j_{{\rm reg},*}\operatorname{Reg}_{Z(G)}[-r]$, where $\operatorname{Reg}_{Z(G)}=(\operatorname{pt}\to BZ(G))_!k$, with the shifts of \cite[\S\S3.3.3--3.3.7]{GLCI2024}. The component of $\chi_C$ attached to a simple root sends an $N$-torsor to the class of the extension it defines, an element of $H^1(C,\Omega_C)$, followed by the trace $H^1(C,\Omega_C)\to K_{\rm geom}$ of Serre duality. With the convention of transport fixed above, $u$ acts on the $N$-torsors, on their quotients attached to the simple roots and on the theta pair, and the trace of Serre duality commutes with semilinear pullback. So $u$ carries the whole diagram to the diagram of the curve obtained by base change. Here $\chi_C$ is a morphism of stacks over $K_{\rm geom}$, along which the sheaves, with coefficients in $k$, are pulled back. Pullback by an isomorphism commutes with $p_!$, $\chi^*$ and $j_*$ and preserves $\operatorname{Reg}_{Z(G)}$. These base change isomorphisms give $u_{\rm aut}^*\operatorname{Poinc}^{\rm Vac}_! \simeq\operatorname{Poinc}^{\rm Vac}_!$. \step{4}{covariance of the projection} The projection to sheaves with nilpotent singular support is given by the universal Hecke projector of \cite[\S13.4.1, Corollary~13.4.6 and \S15.4.7]{AGKRRV2022}. It is a colimit of Hecke functors, indexed by diagrams formed from finite sets of points of the curve, their collisions, representations of $\widehat G$ and the fibres of the universal local system. The pullbacks by $u_{\rm aut}$, on the automorphic side, and by $u_{\rm spec}$, on the spectral side, send each of these diagrams to the corresponding diagram for the curve obtained by base change, and they commute with tensor products, with colimits and with $\Gamma_!$ on the spectral side. So they commute with the projector. The comparison is canonical. By \cite[Theorem~1.1.7]{GR2025} and \cite[Proposition~17.2.3]{AGKRRV2022} the projector is the right adjoint of the inclusion of the sheaves with nilpotent singular support; the equivalence $u_{\rm aut}^*$ preserves this subcategory, and an equivalence which commutes with a fully faithful functor commutes with its right adjoint, compatibly with the counits. Applied to the Poincar\'e object this gives $u_{\rm aut}^*\mathcal P_C\simeq\mathcal P_C$. \step{5}{covariance of the family} For the same reason \[ u_{\rm aut}^*(A\star\mathcal K) \simeq(u_{\rm spec}^*A)\star(u_{\rm aut}^*\mathcal K). \] The Cartesian square which defines $\mathfrak F_\rho$ is preserved by $u$, so $u_{\rm spec}^*j_*P\simeq j_*u_{\mathfrak F}^*P$. Substituting in \eqref{rw:eq:family-by-spectral-action} we obtain the asserted isomorphism, that is, a natural isomorphism which makes the square \[ \begin{tikzcd}[column sep=large] \operatorname{Perf}(\mathfrak F_\rho) \arrow[r,"P\mapsto\mathcal F_P"]\arrow[d,"u_{\mathfrak F}^*"'] & \operatorname{Shv}_{\rm Nilp}(\operatorname{Bun}_G(C)) \arrow[d,"u_{\rm aut}^*"]\\ \operatorname{Perf}(\mathfrak F_\rho) \arrow[r,"P\mapsto\mathcal F_P"'] & \operatorname{Shv}_{\rm Nilp}(\operatorname{Bun}_G(C)) \end{tikzcd} \] commute. For two semilinear isomorphisms $u$ and $v$, the isomorphism attached to $uv$ and the composite of those attached to $u$ and $v$ are both base change maps for the same diagrams, and base change maps are compatible with composition. The same argument applies to the maps of creation, fusion and annihilation in the Hecke action, so the isomorphisms are compatible with the Hecke identities. \end{proof} \subsection{Why the whole family is needed} The comparison with a microstalk in Section~\ref{fl:sec:boundary-whittaker-geometry-section} is at first a comparison over an algebraically closed field, without Frobenius. For a single complex this would give no control of the trace of Frobenius. The control comes from the following property of the functor of global sections on the whole category $\operatorname{Perf}(\mathfrak F_\rho)$. \begin{lemma}[Rigidity of the functor of global sections] \label{fl:lem:scalar-coefficient-covariance} Let $\Gamma_\rho(P)=\Gamma(\mathfrak F_\rho,P)$ on $\operatorname{Perf}(\mathfrak F_\rho)$. Every natural endomorphism of degree zero of the functor $\Gamma_\rho$ acts on the cohomology groups $H^i\Gamma_\rho(P)$ by one scalar, the same for all $P$ and all $i$. For this it suffices that the endomorphism be natural for the morphisms of the homotopy category and commute with the shift. Consequently, if a functor $\mu$ is isomorphic to $\Gamma_\rho\otimes L$ for a graded line $L$, and both functors are compatible with Frobenius, the two actions of Frobenius on cohomology differ, under the isomorphism, by a nonzero scalar which does not depend on $P$ or on the degree. \end{lemma} \begin{proof} In the homotopy category of $\operatorname{Perf}(\mathfrak F_\rho)$ the functor $P\mapsto H^0\Gamma_\rho(P)$ is $\operatorname{Hom}(\mathcal O,P)$: it is corepresented by the structure sheaf, which is a perfect complex. By the Yoneda lemma for this ordinary category, its endomorphisms are the compositions with the elements of \[ \operatorname{End}(\mathcal O_{\mathfrak F_\rho}) =H^0\Gamma(\mathfrak F_\rho,\mathcal O)=k, \] the last equality by Lemma~\ref{fl:lem:puncture-fibre-model}. Concretely, a natural endomorphism is determined by its value on the identity of $\mathcal O$, an endomorphism of $\mathcal O$, and its value on a section $v:\mathcal O\to P$ is the composite of $v$ with this endomorphism. So the given endomorphism acts on $H^0\Gamma_\rho(P)$ by a scalar $c$ which does not depend on $P$. Since $H^i\Gamma_\rho(P)=H^0\Gamma_\rho(P[i])$ and the endomorphism commutes with the shift, it acts by $c$ on $H^i\Gamma_\rho(P)$. For the second assertion, transport the action of Frobenius on $\mu$ to $\Gamma_\rho\otimes L$ by the isomorphism, and compose it with the inverse of the action of Frobenius on $\Gamma_\rho\otimes L$. The result is a natural automorphism of the functor $\Gamma_\rho\otimes L$, of degree zero, and the first part applies to it after the choice of a generator of $L$; the scalar is not zero because the automorphism is invertible. \end{proof} \begin{remark}[Which naturality is used] \label{rw:rem:homotopy-naturality} Only the Yoneda lemma of an ordinary category enters. So the isomorphisms of functors to which the lemma is applied below, in particular the comparison with the microstalk of Proposition~\ref{fl:lem:vacuum-microstalk-comparison}, are needed only as isomorphisms of functors on homotopy categories which commute with the shift. This is enough, because the functors take values in complexes of vector spaces over a field and all conclusions concern supertraces. \end{remark} \begin{remark} The lemma would be of no use for the single object $P_{\rm reg}$. Its cohomology $\Gamma(\mathfrak F_\rho,P_{\rm reg})$ lives in several degrees, and an automorphism acting by different scalars in different degrees can turn a nonzero alternating trace into zero. Naturality on all of $\operatorname{Perf}(\mathfrak F_\rho)$ forces the same scalar in every degree. \end{remark} \begin{proposition}[The supertrace is a nonzero determinant] \label{fl:prop:puncture-exact-trace} Suppose that every orbit of Frobenius in $D_{\rm aux}$ consists of the points which lift a closed point of degree $d_{\rm aux}$ of a fibre in characteristic $p$, and that the adjoint action of the Frobenius element $g_D\in\widehat G(k)$ of that point is pure of weight zero. Let \[ P_{\rm reg}=\mathcal O_{\mathfrak F_\rho}\otimes k[\Pi_\rho] \] with the action of Frobenius induced by $\alpha$, which permutes the basis by $e_\gamma\mapsto e_{\alpha(\gamma)}$. Then Frobenius and its inverse have nonzero supertrace on $\Gamma(\mathfrak F_\rho,P_{\rm reg})$. \end{proposition} \begin{proof} Write $\phi$ for the action of Frobenius. We compute in the graded algebra of cohomology $\Lambda=\Lambda(\mathsf B_\rho[1])$, on which Frobenius acts by the exterior powers of its action in degree $-1$. The group $Z_\rho$ is linearly reductive, so $H^*\Gamma(\mathfrak F_\rho,P_{\rm reg}) =(k[\Pi_\rho]\otimes\Lambda)^{Z_\rho}$. \step{1}{removing the group of components} For a complex $\mathcal K$ of representations of $Z_\rho$ the map \[ \mathcal K^{Z_\rho^\circ}\longrightarrow(k[\Pi_\rho]\otimes \mathcal K)^{Z_\rho}, \qquad v\longmapsto\sum_{\gamma\in\Pi_\rho} e_\gamma\otimes\widetilde\gamma v , \] where $\widetilde\gamma\in Z_\rho$ is a representative of $\gamma$, is an isomorphism: it does not depend on the representatives because $v$ is invariant under $Z_\rho^\circ$, and its inverse is the coefficient of $e_1$. For $\mathcal K=\Lambda$ it commutes with $\phi$, since $\phi(\widetilde\gamma v)=\alpha(\widetilde\gamma)\phi(v)$. So the supertrace to be computed is that of $\phi$ on $\Lambda^{Z_\rho^\circ}$. \step{2}{removing the torus} Decompose $\Lambda$ according to the characters of the torus $Z_\rho^\circ$. The map $\phi$ sends the part of weight $\chi$ to the part of weight $\chi\circ\alpha^{-1}$. If $\chi\circ\alpha^{-1}=\chi$, then $\chi$ is trivial on the image of $1-\alpha$, which is $Z_\rho^\circ$ by Lemma~\ref{fl:lem:geometric-centralizer-torus}; so $\chi=0$. The parts of nonzero weight are therefore permuted without fixed points and do not contribute to the trace, in any degree. Hence $\phi$ has the same supertrace on $\Lambda^{Z_\rho^\circ}$ and on $\Lambda$, and since $\Lambda^i\mathsf B_\rho$ is in degree $-i$, \begin{equation}\label{fl:eq:puncture-exact-trace} \operatorname{Str}\bigl(\phi; \Gamma(\mathfrak F_\rho,P_{\rm reg})\bigr) =\sum_i(-1)^i\operatorname{tr}(\phi;\Lambda^i\mathsf B_\rho) =\det(1-\phi;\mathsf B_\rho). \end{equation} \step{3}{the determinant} Take an orbit of punctures; its length is $d=d_{\rm aux}$. At one of its points choose a local arithmetic lift $a_D$ of Frobenius and a generator $\tau$ of the tame inertia. On the $\ell$-primary tame quotient \[ a_D\tau a_D^{-1}=\tau^{q^d}. \] Write $g_D=\rho(a_D)$, and let $\operatorname{Ad}(g_D)^\vee(\xi) =\xi\circ\operatorname{Ad}(g_D^{-1})$ be the coadjoint action on $\widehat{\mathfrak g}^{\,*}$. The arithmetic map on the spectral side is the transport $u_{\rm spec}$. Let $M$ be the monodromy at the puncture of a local system near $\rho$, a formal variable near the identity. After $d$ steps, and after identifying the base local system by $g_D^{-1}$, the transport is \[ M\longmapsto g_D^{-1}M^{q^d}g_D , \] whose linearization on the Lie algebra is $q^d\operatorname{Ad}(g_D^{-1})$. So the pullback of the equation $M=1$ acts on its conormal space by $q^d\operatorname{Ad}(g_D)^\vee$. This is the action on $H^{-1}$ of the Koszul complex of the derived intersection, and its exterior powers give the action on all the cohomology groups; the complex itself need not be given an action of Frobenius. Hence the arithmetic operator $\phi$ on $\mathsf B_\rho$ permutes the summands of the orbit cyclically, and \[ \phi^d|_{\widehat{\mathfrak g}_x^*} =q^d\operatorname{Ad}(g_D)^\vee. \] The determinant of $1-\phi$ on the cyclic sum is $\det(1-\phi^d;\widehat{\mathfrak g}_x^*)$. Its factors are $1-q^d\lambda$, with $\lambda$ an eigenvalue of $\operatorname{Ad}(g_D)^\vee$, and $|\lambda|=1$ for every complex embedding by purity. So no factor vanishes. The geometric operator is the inverse of the arithmetic one, on the conormal space and on the representation of the group of components together; its factors are $1-q^{-d}\lambda^{-1}$, which do not vanish either. What is essential is purity: compactness of the image of the parameter gives only $\ell$-adic information, and by itself would not exclude an eigenvalue of complex absolute value $q^{\pm d}$. \end{proof} \begin{remark} The hypothesis on weights cannot be dropped: the determinant $\det(1-\phi;\mathsf B_\rho)$ vanishes as soon as $\phi$ has the eigenvalue $1$. In the application the puncture is chosen over a closed point of the original curve (Lemma~\ref{fl:lem:closed-return-puncture}), so that Theorem~\xref{I}{fl:thm:arithmetic-strong-purity} applies to $g_D$. \end{remark}