# A Ramanujan bound for
Drinfeld modular forms

Sjoerd de Vries

###### Abstract

In this paper, we prove a Lefschetz trace formula for Böckle-Pink crystals on
tame Deligne-Mumford stacks of finite type over $\mathbb{F}_{q}$ and apply it
to the crystal associated to the universal Drinfeld module. Combined with the
Eichler-Shimura theory developed by Böckle, this leads to a trace formula for
Hecke operators on Drinfeld modular forms. As a corollary, we deduce a
Ramanujan bound on the traces of Hecke operators.

###### Contents

  1. 1 Introduction
  2. 2 Drinfeld modules, $\tau$-sheaves, and crystals over stacks
    1. 2.1 Definitions and basic properties
    2. 2.2 The $\tau$-sheaf associated to a Drinfeld module
    3. 2.3 Descent
    4. 2.4 Derived categories of crystals
  3. 3 Lefschetz trace formula
    1. 3.1 Flatness
    2. 3.2 $L$-functions and $l$-series of crystals
    3. 3.3 The trace formula
  4. 4 A trace formula for Hecke operators
    1. 4.1 Drinfeld modular forms
    2. 4.2 Böckle-Eichler-Shimura theory
    3. 4.3 A trace formula for Hecke operators
    4. 4.4 Ramanujan bounds

##  1 Introduction

Drinfeld modules of rank 2 are function field analogues of elliptic curves.
Since their inception due to Drinfeld [Dri74], much of the theory of elliptic
curves has been translated to the function field setting. In particular, there
is a theory of Drinfeld modular forms, which are defined as sections of
certain line bundles on moduli spaces of Drinfeld modules. In [Böc02], Böckle
develops an Eichler-Shimura theory for Drinfeld modular forms, showing that
one can realise spaces of Drinfeld cusp forms as the compactly supported
cohomology of certain crystals.

In the classical setting, Eichler-Shimura theory naturally leads to a proof of
the Ramanujan bound, which states the following. Let
$\Gamma\subseteq\operatorname{SL}_{2}(\mathbb{Z})$ be a congruence subgroup,
let $p$ be a prime number, and let $\alpha$ be an eigenvalue of the Hecke
operator $\mathbf{T}_{p}$ acting on the space $\operatorname{S}_{k}(\Gamma)$
of cusp forms of weight $k$ and level $\Gamma$. Then we have $|\alpha|\leq
2p^{(k-1)/2}$, where $|\cdot|$ denotes the complex absolute value.
Equivalently, for all $n\geq 1$, we have

$|\operatorname{Tr}(\mathbf{T}^{n}_{p}\hskip 1.99997pt|\hskip
1.00006pt\operatorname{S}_{k}(\Gamma))|\leq\dim\operatorname{S}_{k}(\Gamma)\cdot
2^{n}p^{n(k-1)/2}.$

This bound was conjectured in 1916 by Ramanujan in the case $k=12$ and
$\Gamma=\operatorname{SL}_{2}(\mathbb{Z})$. Almost six decades later, it
became a celebrated result of Deligne [Del69], [Del74]. Let us sketch the idea
of the proof. By Eichler-Shimura theory, cusp forms arise in the cohomology of
certain $\ell$-adic local systems on moduli spaces of elliptic curves, and the
Hecke operator $\mathbf{T}_{p}$ acts locally at $p$ as the sum of Frobenius
and Verschiebung. Deligne’s idea was to prove the Ramanujan bound by combining
Eichler-Shimura theory with the purity of cohomology which follows from the
Weil conjectures (more specifically, the Riemann hypothesis).

In the function field setting, this approach seems fruitless due to the lack
of purity for cohomology of crystals. However, rather than studying the
Frobenius action on the cohomology directly, one can instead study the
Frobenius action on the fibers via the Lefschetz trace formula. Since absolute
values on function fields are non-archimedean, this change of perspective
turns out to be very effective. We show in this paper how the Ramanujan bound
for Drinfeld modular forms then becomes a consequence of the Riemann
hypothesis for Drinfeld modules. The statement in level 1 is as follows:

######  Theorem 1.1 (Corollary 4.12).

Let $\operatorname{S}_{k,l}$ denote the space of Drinfeld cusp forms of weight
$k\geq 2$ and type $l\in\mathbb{Z}$. Then for any prime
$\mathfrak{p}\trianglelefteq A$ with residue field of size $\mathcal{P}$ and
any $n\geq 1$, we have

$|\operatorname{Tr}(\mathbf{T}_{\mathfrak{p}}^{n}\hskip 1.00006pt|\hskip
1.00006pt\operatorname{S}_{k,l})|_{\infty}\leq\mathcal{P}^{n\left(\frac{k}{2}+l-k\right)}.$

Along the way, we prove several results of independent interest. For good
coefficient rings $B$ [BP09, Def. 9.7.4], we define $l$-series of $B$-crystals
on tame Deligne-Mumford stacks of finite type over $\mathbb{F}_{q}$ (cf.
Definition 3.6) and show that the following version of the Lefschetz trace
formula holds:

######  Theorem 1.2 (Theorem 3.9).

Let $f\colon\mathfrak{Y}\to\mathfrak{X}$ be a compactifiable morphism of tame
Deligne-Mumford stacks of finite type over $\mathbb{F}_{q}$, let $B$ be
reduced, and let $\underline{\mathcal{F}}^{\bullet}$ be a bounded complex of
flat $B$-crystals on $\mathfrak{Y}$. Then we have

$l(\mathfrak{Y},\underline{\mathcal{F}}^{\bullet},t)=l(\mathfrak{X},Rf_{!}\underline{\mathcal{F}}^{\bullet},t).$

Theorem 1.2 in combination with Böckle-Eichler-Shimura theory leads to our
third main result, which is a trace formula for Hecke operators on Drinfeld
cusp forms.

######  Theorem 1.3 (Theorem 4.10).

Let $\operatorname{S}_{k,l}$ denote the space of Drinfeld cusp forms of weight
$k$ and type $l$, and let $\mathbf{T}_{\mathfrak{p}}$ be the Hecke operator
associated to a prime $\mathfrak{p}$ of degree $d$. Then for every $n\geq 1$,
we have

$\operatorname{Tr}(\mathbf{T}^{n}_{\mathfrak{p}}\hskip 1.99997pt|\hskip
1.00006pt\operatorname{S}_{k+2,l})=\sum_{[(E,\varphi)]/\mathbb{F}_{{\mathfrak{p}}^{n}}}\sum_{i=0}^{k}\pi_{\varphi}^{i+l-k-1}\bar{\pi}_{\varphi}^{l-1-i},$
(1)

where the first sum is taken over the set of isomorphism classes of Drinfeld
modules over $\mathbb{F}_{q^{dn}}$ with characteristic $\mathfrak{p}$,
$\pi_{\varphi}$ denotes the Frobenius endomorphism of $(E,\varphi)$, and
$\bar{\pi}_{\varphi}$ its conjugate.

This paper grew out of the author’s licentiate thesis [Vri23a].

### Outline of the paper

In Section 2, we recall some theory of Drinfeld modules and crystals and
extend it to Deligne-Mumford stacks. In Section 3, we define $l$-series of
crystals and prove the Lefschetz trace formula. In Section 4, we deduce the
trace formula for Hecke operators on Drinfeld modular forms, as well as the
Ramanujan bound.

### Notation and conventions

Let $p$ be a prime number and let $q$ be a power of $p$. The set of closed
points of a scheme $X$ is denoted $|X|$. Fix a smooth, geometrically
connected, proper curve $C/\mathbb{F}_{q}$ with function field $K$. Fix also a
closed point $\infty\in|C|$ and denote the corresponding valuation on $K$ by
$v_{\infty}$. Define $A:=\mathcal{O}_{C}(C\setminus\\{\infty\\})$. For a
maximal ideal $\mathfrak{p}\trianglelefteq A$, we denote by
$\mathbb{F}_{\mathfrak{p}}$ its residue field, and by
$\mathbb{F}_{\mathfrak{p}^{n}}$ its unique degree $n$ extension. We denote by
$B$ a general $\mathbb{F}_{q}$-algebra. For a ring $R$, benote by
$\text{Nil}(R)$ the nilradical of $R$, and by $\textsf{Sch}_{R}$ the category
of $R$-schemes.

All algebraic stacks are assumed to be noetherian and separated.

### Acknowledgements

I would like to thank Dan Petersen and David Rydh for helpful conversations,
and Lucas Mann for answering some questions about his work. I would also like
to thank my supervisor Jonas Bergström and my co-supervisor Olof Bergvall.

##  2 Drinfeld modules, $\tau$-sheaves, and crystals over stacks

In this section, we recall the basic theory of Drinfeld modules over schemes.
We then define the moduli stack of Drinfeld $A$-modules and the category of
crystals over a stack, along with its pre-6-functor formalism.

For more thorough treatments of the theory of Drinfeld modules, we refer the
reader to [Gos96], [Pap23]. For background material on stacks, we refer the
reader to [Ols16]. The theory of crystals on schemes developed in [BP09]. The
extension to stacks is based on the results from [Man22].

###  2.1 Definitions and basic properties

Let $S$ be an $\mathbb{F}_{q}$-scheme. By a line bundle $E/S$, we mean a
commutative $S$-group scheme which is Zariski-locally on $S$ isomorphic to
$\mathbb{G}_{a}$. Denote by $\operatorname{End}_{S}^{\mathbb{F}_{q}}(E)$ the
ring of $\mathbb{F}_{q}$-linear $S$-group scheme endomorphisms of $E$.

######  Proposition 2.1.

Let $S=\operatorname{Spec}(R)$ be an affine $\mathbb{F}_{q}$-scheme. Denote by
$R\\{\tau\\}$ the non-commutative polynomial ring in $\tau$ satisfying $\tau
r=r^{q}\tau$ for all $r\in R$. Then the map

$R\\{\tau\\}\longrightarrow\operatorname{End}_{S}^{\mathbb{F}_{q}}(\mathbb{G}_{a,S})$

sending $\tau$ to the $q$-Frobenius endomorphism is a ring isomorphism. $\Box$

######  Definition 2.2.

Let $S$ be an $\mathbb{F}_{q}$-scheme.

1. A _Drinfeld $A$-module of rank $r\geq 1$ over $S$_ is a pair $(E,\varphi)$ consisting of a line bundle $E/S$ and a ring homomorphism $\varphi\colon A\to\operatorname{End}_{S}^{\mathbb{F}_{q}}(E)$ with the following property: for any open subset $\operatorname{Spec}(R)=U\subseteq S$ trivialising $E$ and any $a\in A$, we have

$\varphi(a)|_{U}=\sum_{i=0}^{n}\alpha^{U}_{i}(a)\tau^{i}\in R\\{\tau\\}$

with the following properties:

  1. 1.

$\alpha^{U}_{i}(a)\in R^{\times}$ for $i=-r\cdot\deg(\infty)\cdot
v_{\infty}(a)$;

  2. 2.

$\alpha^{U}_{i}(a)\in\text{Nil}(R)$ for $i>-r\cdot\deg(\infty)\cdot
v_{\infty}(a)$.

2. A _morphism of Drinfeld modules_ $f\colon(E,\varphi)\to(E^{\prime},\varphi^{\prime})$ is a morphism $E\to E^{\prime}$ of $S$-group schemes such that for all $a\in A$, the following diagram commutes:

$E$$E$$E^{\prime}$$E^{\prime}$$\varphi(a)$$f$$f$$\varphi^{\prime}(a)$

######  Definition 2.3.

Let $(E/S,\varphi)$ be a Drinfeld $A$-module. The _characteristic morphism_
$\vartheta\colon S\to\operatorname{Spec}(A)$ of $\varphi$ is defined via the
map on sections

$\vartheta^{\sharp}\colon A\xrightarrow{\ \varphi\
}\operatorname{End}_{S}^{\mathbb{F}_{q}}(E)\xrightarrow{\ D\
}H^{0}(S,\mathcal{O}_{S}),$

where $D$ is the map which locally sends
$\sum{\alpha_{i}\tau^{i}}\mapsto\alpha_{0}$.

######  Definition 2.4.

Fix an integer $r\geq 1$. The _moduli stack of Drinfeld $A$-modules of rank
$r$_ is the category fibered in groupoids
$\mathfrak{M}_{r}^{A}\to\mathbb{F}_{q}$ whose objects are

$\text{Ob}(\mathfrak{M}_{r}^{A})=\left\\{(E/S,\varphi)\ |\
S\in\textsf{Sch}_{\mathbb{F}_{q}},\ \varphi\colon
A\to\operatorname{End}_{S}(E)\text{ is a Drinfeld $A$-module of rank
}r\right\\},$

and whose morphisms $(E^{\prime}/S^{\prime},\varphi^{\prime})\to(E/S,\varphi)$
are given by pullback diagrams

$E^{\prime}$

$\lrcorner$

$E$$S^{\prime}$$S$

in the category of Drinfeld modules.

We will often suppress the ring $A$ from the notation and simply write
$\mathfrak{M}_{r}$ for the stack defined above. The characteristic morphism
induces a structure map
$\Theta\colon\mathfrak{M}_{r}\to\operatorname{Spec}(A)$. The fibered category
$\mathfrak{M}_{r}$ is representable by a smooth affine Deligne-Mumford stack
of pure relative dimension $r-1$ over $A$ [Lau96, Cor. 1.4.3], which we also
denote by $\mathfrak{M}_{r}$. If $r=2$, it can be thought of as the function
field analogue of the modular curve
$\mathcal{M}_{1,1}\to\operatorname{Spec}(\mathbb{Z})$.

The following lemma shows that $\mathfrak{M}_{r}$ is tame, i.e., for every
geometric point $x$ of $\mathfrak{M}_{r}$, the order of the automorphism group
of $x$ is prime to $p$.

######  Lemma 2.5.

Let $\varphi$ be a Drinfeld $A$-module of any rank over a finite field $k$ of
characteristic $p$. Then $\\#\operatorname{Aut}(\varphi)\equiv-1\pmod{p}$.

###### Proof.

This follows because for some integers $1\leq n_{a}\leq[k:\mathbb{F}_{q}]$, we
have

$\operatorname{Aut}(\varphi)=\bigcap_{a\in
A}\text{Cent}_{k\\{\tau\\}}(\varphi(a))^{\times}=\bigcap_{a\in
A}\mathbb{F}_{q^{n_{a}}}^{\times}=\mathbb{F}_{q^{\gcd\\{n_{a}|a\in
A\\}}}^{\times}.$

∎

######  Definition 2.6.

A _Drinfeld $A$-module of rank $r$_ over a Deligne-Mumford stack
$\mathfrak{X}$ is a morphism of stacks $\mathfrak{X}\to\mathfrak{M}_{r}^{A}$.

Having defined Drinfeld modules over stacks, we now want to associate crystals
to them. We start by defining $\tau$-sheaves and crystals over stacks.

######  Definition 2.7.

Let $B$ be an $\mathbb{F}_{q}$-algebra. We denote by
$\textsf{Coh}_{B}\to\mathbb{F}_{q}$ the category fibered in groupoids whose
objects are

$\text{Ob}(\textsf{Coh}_{B})=\left\\{(\mathcal{F},S)\ |\
S\in\textsf{Sch}_{\mathbb{F}_{q}},\hskip 1.49994pt\mathcal{F}\text{ is a
coherent Zariski sheaf of }\mathcal{O}_{S\otimes B}\text{-modules}\right\\},$

and whose morphisms are given by

$\operatorname{Hom}(\mathcal{F}^{\prime}/S^{\prime},\mathcal{F}/S)=\\{(s,t)\
|\ s\colon S^{\prime}\to S,\hskip
1.99997ptt\colon\mathcal{F}^{\prime}\xrightarrow{\ \sim\
}(s\times\text{id})^{*}\mathcal{F}\\}.$

We call $\textsf{Coh}_{B}$ the _stack of coherent sheaves with coefficients in
$B$_. The category $\textsf{QCoh}_{B}\to\mathbb{F}_{q}$ of _quasi-coherent
sheaves with coefficients in $B$_ is defined as above with the word “coherent”
replaced by “quasi-coherent”.

The categories $\textsf{Coh}_{B}$ and $\textsf{QCoh}_{B}$ are stacks (although
they are not algebraic). Setting $B=\mathbb{F}_{q}$ recovers the usual stack
of (quasi-)coherent sheaves. If $S$ is a scheme, an isomorphism class of maps
$S\to\textsf{Coh}_{B}$ is equivalent to a coherent sheaf on $S\otimes B$.

For a Deligne-Mumford stack $\mathfrak{X}$, denote by
$\sigma=\sigma_{\mathfrak{X}}$ the $q$-Frobenius endomorphism of
$\mathfrak{X}$.

######  Definition 2.8.

A _(quasi-)coherent $\tau$-sheaf on $\mathfrak{X}$ over $B$_ is a pair
$\underline{\mathcal{F}}=(\mathcal{F},\tau_{\mathcal{F}})$ consisting of the
following data:

  * •

A (quasi-)coherent sheaf $\mathcal{F}\colon\mathfrak{X}\to\textsf{Coh}_{B}$
(resp. $\textsf{QCoh}_{B}$);

  * •

An $\mathcal{O}_{\mathfrak{X}\otimes B}$-linear map
$\tau_{\mathcal{F}}\colon\sigma^{*}\mathcal{F}\to\mathcal{F}$.

A _morphism of $\tau$-sheaves_
$\underline{\mathcal{F}}\to\underline{\mathcal{G}}$ is a natural
transformation $\psi\colon\mathcal{F}\to\mathcal{G}$ such that
$\psi\circ\tau_{\mathcal{F}}=\tau_{\mathcal{G}}\circ\sigma^{*}\psi$. The
category of coherent $\tau$-sheaves on $\mathfrak{X}$ over $B$ is denoted
$\textsf{Coh}_{\tau}(\mathfrak{X},B)$.

######  Definition 2.9.

A $\tau$-sheaf $\underline{\mathcal{F}}\in\textsf{Coh}_{\tau}(\mathfrak{X},B)$
is called _nilpotent_ if some power
$\tau^{n}_{\mathcal{F}}\colon(\sigma^{n})^{*}\mathcal{F}\to\mathcal{F}$ of
$\tau_{\mathcal{F}}$ is zero. We denote the full subcategory of nilpotent
coherent $\tau$-sheaves by $\textsf{NilCoh}_{\tau}(\mathfrak{X},B)$. A
morphism $f\colon\underline{\mathcal{F}}\to\underline{\mathcal{G}}$ of
$\tau$-sheaves is called a _nil-isomorphism_ if $\ker(f)$ and
$\operatorname{coker}(f)$ are nilpotent $\tau$-sheaves.

######  Proposition 2.10.

Let $\mathfrak{X}$ be a Deligne-Mumford stack. Then
$\textsf{NilCoh}_{\tau}(\mathfrak{X},B)$ is a Serre subcategory of
$\textsf{Coh}_{\tau}(\mathfrak{X},B)$.

###### Proof.

We need to show that $\textsf{NilCoh}_{\tau}$ is closed under taking
subobjects, quotients, extensions, and isomorphisms. By [BP09, Prop. 3.3.5],
this is true whenever $\mathfrak{X}$ is a scheme. We conclude by applying
Corollary 2.17 below. ∎

######  Definition 2.11.

The category $\textsf{Crys}(\mathfrak{X},B)$ of _$B$ -crystals on
$\mathfrak{X}$_ is the localisation of $\textsf{Coh}_{\tau}(\mathfrak{X},B)$
at $\textsf{NilCoh}_{\tau}$.

More concretely, the objects in $\textsf{Crys}(\mathfrak{X},B)$ are coherent
$\tau$-sheaves on $\mathfrak{X}$ over $B$, and morphisms
$\underline{\mathcal{F}}\to\underline{\mathcal{G}}$ are given by roofs, i.e.,
diagrams of the form

$\underline{\mathcal{F}}\longleftarrow\underline{\mathcal{Z}}\longrightarrow\underline{\mathcal{G}}$

where $\underline{\mathcal{F}}\longleftarrow\underline{\mathcal{Z}}$ is a nil-
isomorphism and
$\underline{\mathcal{Z}}\longrightarrow\underline{\mathcal{G}}$ is any
morphism of coherent $\tau$-sheaves. Similarly, one defines
$\textsf{QCrys}(\mathfrak{X},B)$ as the localisation of
$\textsf{QCoh}_{\tau}(\mathfrak{X},B)$ at nil-isomorphisms.

######  Remark 2.12.

Every morphism of crystals $\underline{\mathcal{F}}\to\underline{\mathcal{G}}$
can be represented by a roof of the form

$\underline{\mathcal{F}}\xleftarrow{\hskip 1.00006pt\tau^{n}\hskip
1.00006pt}(\sigma^{n})^{*}\underline{\mathcal{F}}\longrightarrow\underline{\mathcal{G}};$

when $\mathfrak{X}$ is a scheme, this is [BP09, Prop. 3.4.6], and in general
it follows from the descent results in §2.3. Thus, passing from $\tau$-sheaves
to crystals is equivalent to inverting $\tau$.

###  2.2 The $\tau$-sheaf associated to a Drinfeld module

Consider the map
$\operatorname{Hom}(-,\mathbb{G}_{a})\colon\mathfrak{M}^{A}_{r}\to\textsf{Coh}_{A}$
which acts on objects as

$(E/S,\varphi)\longmapsto\mathcal{H}om_{S\textsf{-Grp}}^{\mathbb{F}_{q}}(E,\mathbb{G}_{a}),$

where the right-hand side denotes the coherent sheaf of $\mathcal{O}_{S\otimes
A}$-modules of $\mathbb{F}_{q}$-linear $S$-group scheme morphisms
$E\to\mathbb{G}_{a}$, where $a\in A$ acts via right multiplication by
$\varphi(a)$. The map on morphisms is induced by precomposition. By
Proposition 2.1, the coherent sheaf
$\mathcal{H}om_{S\textsf{-Grp}}^{\mathbb{F}_{q}}(E,\mathbb{G}_{a})$ is
Zariski-locally isomorphic to $\mathcal{O}_{S}\\{\tau\\}$, which is locally
free of rank $r$ over $\mathcal{O}_{S\otimes A}$ [Dri77, Prop. 3].

######  Construction 2.13.

Given a Drinfeld module
$(\mathcal{E},\varphi)\colon\mathfrak{X}\to\mathfrak{M}_{r}$, we associate a
$\tau$-sheaf $\underline{\mathcal{M}}(\varphi)$ to it as follows: the
underlying sheaf is the composition

$\mathcal{M}(\varphi):\mathfrak{X}\xrightarrow{(\mathcal{E},\varphi)}\mathfrak{M}_{r}\xrightarrow{\operatorname{Hom}(-,\mathbb{G}_{a})}\textsf{Coh}_{A},$

and the map $\tau=\tau_{\mathcal{M}(\varphi)}$ is the natural transformation
$\sigma^{*}\mathcal{M}(\varphi)\to\mathcal{M}(\varphi)$ given by composition
with $\sigma_{\mathbb{G}_{a}}$ on the left, where $\sigma$ denotes the
$q$-Frobenius endomorphism.

######  Example 2.14.

Suppose $\mathfrak{X}=\operatorname{Spec}(k)$ for some finite extension
$k=\mathbb{F}_{q^{n}}$ of $\mathbb{F}_{q}$. Then
$\mathcal{E}\cong\mathbb{G}_{a}$, and the underlying coherent sheaf of
$\mathcal{M}(\varphi)$ is given by
$\operatorname{End}_{k\textsf{-Grp}}^{\mathbb{F}_{q}}(\mathbb{G}_{a})\cong
k\\{\tau\\}$, cf. Proposition 2.1. The left action of $\alpha\otimes a\in
k\otimes A$ on $\psi\in k\\{\tau\\}$ is given by $(\alpha\otimes
a)\star\psi=\alpha\psi\varphi(a)$. The morphism
$\tau\colon\sigma^{*}k\\{\tau\\}\to k\\{\tau\\}$ is given by multiplication by
$\tau$ on the left, which is indeed a module homomorphism by the commutation
relation in $k\\{\tau\\}$. We conclude this example by noting that the element
$\tau^{n}$ is the Frobenius endomorphism of $(\mathcal{E},\varphi)$.

###  2.3 Descent

A (quasi-)coherent sheaf on a Deligne-Mumford stack is equivalent to a
(quasi-)coherent sheaf with a descent datum on an étale cover. In this
subsection, we prove that the same is true for crystals. Throughout,
$\mathfrak{X}$ denotes a Deligne-Mumford stack over $\mathbb{F}_{q}$, and
$\pi\colon X\to\mathfrak{X}$ denotes an étale cover by a scheme.

######  Definition 2.15.

Let
$\textsf{C}(-)\in\\{\textsf{Coh}_{\tau}(-,B),\textsf{QCoh}_{\tau}(-,B),\textsf{Crys}(-,B),\textsf{QCrys}(-,B)\\}$.
Define the _category of descent data_ $\textsf{C}(X\to\mathfrak{X})$ as
follows: objects are pairs $(\underline{\mathcal{F}},\psi)$ consisting of an
object $\underline{\mathcal{F}}\in\textsf{C}(X)$ and a descent datum
$\psi\colon\text{pr}_{1}^{*}\underline{\mathcal{F}}\xrightarrow{\sim}\text{pr}_{2}^{*}\underline{\mathcal{F}}$
in $\operatorname{Aut}_{\textsf{C}}(X\times_{\mathfrak{X}}X)$ which satisfies
the cocycle condition: i.e., we require that the diagram

$\text{pr}_{1,2}^{*}\text{pr}_{1}^{*}\underline{\mathcal{F}}$$\text{pr}_{1,3}^{*}\text{pr}_{1}^{*}\underline{\mathcal{F}}$$\text{pr}_{1,3}^{*}\text{pr}_{2}^{*}\underline{\mathcal{F}}$$\text{pr}_{2,3}^{*}\text{pr}_{2}^{*}\underline{\mathcal{F}}$$\text{pr}_{1,2}^{*}\text{pr}_{2}^{*}\underline{\mathcal{F}}$$\text{pr}_{2,3}^{*}\text{pr}_{1}^{*}\underline{\mathcal{F}}$$\text{pr}_{1,3}^{*}\psi$$\text{pr}_{1,2}^{*}\psi$$\text{pr}_{2,3}^{*}\psi$

commutes. A morphism
$(\underline{\mathcal{F}},\psi)\to(\underline{\mathcal{F}}^{\prime},\psi^{\prime})$
is a map $f\colon\underline{\mathcal{F}}\to\underline{\mathcal{F}}^{\prime}$
in $\textsf{C}(X)$ such that
$\text{pr}_{2}^{*}f\circ\psi=\psi^{\prime}\circ\text{pr}_{1}^{*}f$.

Note that $\pi^{*}$ induces a functor from $\textsf{C}(\mathfrak{X})$ to
$\textsf{C}(X\to\mathfrak{X})$. The goal of this section is to show this is an
equivalence in all cases; in other words, $\tau$-sheaves and crystals satisfy
effective descent with respect to the étale topology.

######  Proposition 2.16 (Descent for $\tau$-sheaves).

Let
$\textsf{C}(-)\in\\{\textsf{Coh}_{\tau}(-,B),\textsf{QCoh}_{\tau}(-,B)\\}$.
Then $\pi^{*}$ induces an equivalence of categories
$\textsf{C}(\mathfrak{X})\xrightarrow{\sim}\textsf{C}(X\to\mathfrak{X})$.

###### Proof.

This follows from descent for (quasi-)coherent sheaves and unwinding
definitions. In particular, a morphism
$\tau_{\mathcal{F}}\colon\sigma^{*}\mathcal{F}\to\mathcal{F}$ of
(quasi-)coherent sheaves on $X$ descends to $\mathfrak{X}$ if and only if it
is compatible with the descent data $\psi$ and $\sigma^{*}\psi$, which is
precisely the condition that $\psi$ is a morphism of $\tau$-sheaves.
Similarly, a morphism of $\tau$-sheaves on $X$ descends to $\mathfrak{X}$ if
and only if it is compatible with the descent data. ∎

######  Corollary 2.17.

The pullback functor
$\pi^{*}\colon\textsf{Coh}_{\tau}(\mathfrak{X},B)\to\textsf{Coh}_{\tau}(X,B)$
is exact and conservative. Moreover, $\underline{\mathcal{F}}$ is nilpotent if
and only if $\pi^{*}\underline{\mathcal{F}}$ is nilpotent.

###### Proof.

Using the equivalence from Proposition 2.16, we can describe $\pi^{*}$ as the
functor sending
$(\underline{\mathcal{F}},\psi)\mapsto\underline{\mathcal{F}}$. Then $\pi^{*}$
is exact because forgetting the descent datum commutes with taking kernels and
cokernels. It is conservative because the property of a morphism of
$\tau$-sheaves on $\mathfrak{X}$ being an isomorphism does not depend on the
descent datum. Similarly, a $\tau$-sheaf is nilpotent if and only if
$\tau^{n}=0$ for some $n\geq 1$, which does not depend on the descent datum. ∎

######  Construction 2.18.

Let $\underline{\mathcal{F}}$ be a coherent $\tau$-sheaf on $\mathfrak{X}$.
Iterated composition of the adjoint of $\tau$ yields a direct system

$\sigma_{*}^{\bullet}\tau:=\left(\mathcal{F}\longrightarrow\sigma_{*}\mathcal{F}\longrightarrow\sigma^{2}_{*}\mathcal{F}\longrightarrow\ldots\
\right)$

Write $\widehat{\mathcal{F}}:=\varinjlim\sigma_{*}^{\bullet}\tau$ for the
direct limit. The adjoint of the canonical isomorphism
$\widehat{\mathcal{F}}\to\sigma_{*}\widehat{\mathcal{F}}$ gives
$\widehat{\mathcal{F}}$ the structure of a $\tau$-sheaf, which we denote by
$\underline{\widehat{\mathcal{F}}}$. We call
$\underline{\widehat{\mathcal{F}}}$ the _perfection_ of
$\underline{\mathcal{F}}$. The assignment
$\underline{\mathcal{F}}\mapsto\underline{\widehat{\mathcal{F}}}$ yields a
functor
$\text{perf}\colon\textsf{QCoh}_{\tau}(\mathfrak{X},B)\to\textsf{QCoh}_{\tau}(\mathfrak{X},B)$.

One easily sees that $\underline{\widehat{\mathcal{F}}}=0$ if
$\underline{\mathcal{F}}$ is nilpotent. More generally, if $f$ is a nil-
isomorphism, then $\text{perf}(f)$ is an isomorphism.

######  Lemma 2.19.

The induced functor
$\overline{\text{perf}}\colon\textsf{QCrys}(\mathfrak{X},B)\to\textsf{QCoh}_{\tau}(\mathfrak{X},B)$
is an exact, fully faithful right adjoint to the localisation functor.

###### Proof.

Exactness follows from the exactness of filtered direct limits in
$\textsf{QCoh}_{\tau}(\mathfrak{X},B)$, cf. [Stacks, Tag 0781]. The rest is
formal: the adjunction is proved as in [BP09, Prop. 3.4.8], and the counit is
an isomorphism by [BP09, Prop. 3.3.13]; the latter is equivalent to the right
adjoint being fully faithful. ∎

######  Proposition 2.20 (Descent for crystals).

Let $\textsf{C}(-)\in\\{\textsf{Crys}(-,B),\textsf{QCrys}(-,B)\\}$. Then
$\pi^{*}$ induces an equivalence of categories
$\textsf{C}(\mathfrak{X})\xrightarrow{\sim}\textsf{C}(X\to\mathfrak{X})$.

###### Proof.

Consider the diagram

$\textsf{C}(\mathfrak{X})$$\textsf{QCoh}_{\tau}(\mathfrak{X},B)$$\textsf{C}(X\to\mathfrak{X})$$\textsf{QCoh}_{\tau}(X\to\mathfrak{X},B)$$\overline{\text{perf}}$$\overline{\text{perf}}$$\pi^{*}$$\pi^{*}_{\textsf{Q}}$

The horizontal arrows are fully faithful by Lemma 2.19 and
$\pi_{\textsf{Q}}^{*}$ is an equivalence by Proposition 2.16, so $\pi^{*}$ is
fully faithful. Since the essential images of the horizontal arrows agree,
$\pi^{*}$ is in fact an equivalence. ∎

######  Corollary 2.21.

The pullback functor
$\pi^{*}\colon\textsf{Crys}(\mathfrak{X},B)\to\textsf{Crys}(X,B)$ is exact and
conservative.

###### Proof.

See the proof of Corollary 2.17. ∎

###  2.4 Derived categories of crystals

An important aspect of the theory of crystals are the functors $f^{*},f_{!}$
and $\otimes$. Together, these establish a pre-6-functor formalism in the
sense of [Man22, Appendix A.5]. Our primary goal is to apply the theory of
crystals to the moduli stack $\mathfrak{M}_{r}$. For this reason, we study the
bounded derived category $D^{b}(\textsf{Crys}(\mathfrak{X},B))$ of crystals on
a tame Deligne-Mumford stack $\mathfrak{X}$. One could mimic the constructions
from [BP09] to construct the derived functors on
$D^{b}(\textsf{Crys}(\mathfrak{X},B))$ directly. Instead we will, where
possible, apply the results of [Man22] to construct the functors abstractly.

Recall that a morphism $f\colon\mathfrak{Y}\to\mathfrak{X}$ is called
compactifiable if it can be factored as $f=\overline{f}\circ j$, where $j$ is
an open immersion and $\overline{f}$ is proper.

######  Theorem 2.22.

Let $f\colon\mathfrak{Y}\to\mathfrak{X}$ be a morphism between Deligne-Mumford
stacks of finite type over $\mathbb{F}_{q}$, and let $B\to B^{\prime}$ be a
ring map. Then we have the following functors:

$\displaystyle f^{*}$ $\displaystyle\colon
D^{b}(\textsf{Crys}(\mathfrak{X},B))\longrightarrow
D^{b}(\textsf{Crys}(\mathfrak{Y},B));$ $\displaystyle-\otimes^{L}-$
$\displaystyle\colon D^{-}(\textsf{Crys}(\mathfrak{X},B))\times
D^{-}(\textsf{Crys}(\mathfrak{X},B))\longrightarrow
D^{-}(\textsf{Crys}(\mathfrak{X},B));$
$\displaystyle-\otimes^{L}_{B}B^{\prime}$ $\displaystyle\colon
D^{b}(\textsf{Crys}(\mathfrak{X},B))\longrightarrow
D^{b}(\textsf{Crys}(\mathfrak{X},B^{\prime})).$

If $f$ is proper, we also have a derived pushforward

$Rf_{*}\colon D^{b}(\textsf{Crys}(\mathfrak{Y},B))\longrightarrow
D^{b}(\textsf{Crys}(\mathfrak{X},B)),$

and if $f$ is compactifiable, we have a proper pushforward

$Rf_{!}\colon D^{b}(\textsf{Crys}(\mathfrak{Y},B))\longrightarrow
D^{b}(\textsf{Crys}(\mathfrak{X},B)).$

These functors satisfy all usual compatibilities, including the base change
isomorphism and projection formula.

###### Proof.

By [BP09, Chapter 6], the theorem is true when $f$ is a morphism of schemes.
We use [Man22, A.5] to extend it to representable morphisms of stacks, as
follows. With notation as in loc. cit., we let $(\mathcal{C},E)$ be the
geometric setup given by $\mathcal{C}=\textsf{Sch}_{\mathbb{F}_{q}}$ and $E$
is the class of compactifiable morphisms. One easily checks that the pair
$(I,P)$, where $I$ is the class of open immersions and $P$ is the class of
proper morphisms, forms a suitable decomposition of $E$ as in Def. A.5.9 of
loc. cit. Let
$\mathcal{D}\colon\mathcal{C}^{\text{op}}\to\textsf{Cat}_{\infty}^{\otimes}$
be the functor sending $X\mapsto D^{-}(\textsf{Crys}(X,B))$ and $f\mapsto
f^{*}$. Then Prop. A.5.10 in loc. cit. yields a pre-6-functor formalism
$\mathcal{D}\colon\text{Corr}(\mathcal{C})_{E,all}\to\textsf{Cat}_{\infty}$.
One can do the same with $\mathcal{D}(X)$ replaced with
$D^{b}(\textsf{Crys}^{\text{flat}}(X,B))$ (cf. Definition 3.1), by [BP09,
Chapter 7], or with $D^{-}(\textsf{QCrys}(X,B))$.

Let $\mathcal{C}^{\prime}$ be the category of Deligne-Mumford stacks over
$\mathbb{F}_{q}$, and let $E^{\prime}$ denote the class of compactifiable
morphisms which are representable by schemes. Then [Man22, Prop. A.5.16]
yields the desired pre-6-functor formalism for crystals on stacks, which
automatically satisfies the claimed compatibilities. The only difference is
that the functors thus obtained are defined on the _bounded above_ derived
category. To see that boundedness is preserved by $f^{*}$ and $Rf_{!}$, we
apply Corollary 2.21. It implies that if $\pi\colon X\to\mathfrak{X}$ is an
étale cover and $\underline{\mathcal{F}}^{\bullet}\in
D^{-}(\textsf{Crys}(\mathfrak{X},B))$ satisfies
$\pi^{*}\underline{\mathcal{F}}^{\bullet}\in D^{b}(\textsf{Crys}(X,B))$, then
$\underline{\mathcal{F}}^{\bullet}\in D^{b}(\textsf{Crys}(\mathfrak{X},B))$;
combining this with proper base change yields the claim. Note that so far,
$Rf_{!}$ is only defined for representable $f$.

To define $Rf_{!}$ for compactifiable morphisms, it suffices to define
$Rf_{*}$ for proper $f$. To see this, consider a decomposition $f=\bar{f}\circ
j$ with $\bar{f}$ proper and $j$ an open immersion. Then we may define
$Rf_{!}:=R\bar{f}_{*}\circ j_{!}$, noting that $Rj_{!}=j_{!}$ is exact. By the
same arguments as in [BP09, §6.7], the assignment $f\mapsto Rf_{!}$ is then
natural in $f$ and does not depend on the chosen compactification; moreover,
if $f$ is representable by schemes, this definition of $Rf_{!}$ coincides with
the previous one.

To define $Rf_{*}$ for proper $f$, note that this functor already exists on
the level of coherent sheaves [Ols16, Thm 11.6.1]. It can be extended to
$\tau$-sheaves thanks to the base change morphism $\sigma^{*}f^{*}\to
f^{*}\sigma^{*}$, and since it preserves nilpotence, it induces a functor on
crystals which behaves as one expects.

The last functor $-\otimes^{L}_{B}B^{\prime}$ falls outside of the scope of
[Man22], but is simple to describe: it is induced by the extension of scalars
functor on the underlying sheaves, and is straightforward to construct for
crystals on stacks. This completes the proof. ∎

##  3 Lefschetz trace formula

In this section, we define $l$-series of flat crystals on tame Deligne-Mumford
stacks. In the case of schemes, the $l$-series is the logarithmic derivative
of the crystalline $L$-function defined in [BP09]. Our main result is a
Lefschetz trace formula which relates the $l$-series of the fibers of a
crystal to the $l$-series of its compactly supported cohomology, cf. Theorem
3.9.

###  3.1 Flatness

Let $\mathfrak{X}$ be a Deligne-Mumford stack of finite type over
$\mathbb{F}_{q}$. In order to begin discussing $l$-series of $B$-crystals, one
needs to isolate a class of crystals for which it makes sense to talk about
the trace of $\tau$ when considered as a $B$-linear map. This leads to the
notion of flat crystals.

######  Definition 3.1.

A crystal $\underline{\mathcal{F}}\in\textsf{Crys}(\mathfrak{X},B)$ is _flat_
if the functor
$\underline{\mathcal{F}}\otimes-\colon\textsf{Crys}(\mathfrak{X},B)\to\textsf{Crys}(\mathfrak{X},B)$
is exact. The full subcategory of flat crystals is denoted by
$\textsf{Crys}^{\text{flat}}(\mathfrak{X},B)$.

Flatness is preserved by all the derived functors from Theorem 2.22, and the
derived tensor product
$\underline{\mathcal{F}}^{\bullet}\otimes^{L}\underline{\mathcal{G}}^{\bullet}$
of two bounded complexes
$\underline{\mathcal{F}}^{\bullet},\underline{\mathcal{G}}^{\bullet}\in
D^{b}(\textsf{Crys}^{\text{flat}}(\mathfrak{X},B))$ lies again in
$D^{b}(\textsf{Crys}^{\text{flat}}(\mathfrak{X},B))$.

The following result shows that flatness is a pointwise property, and hence
the theory of flat crystals over stacks is analogous to the theory for
schemes.

######  Lemma 3.2.

A crystal $\underline{\mathcal{F}}\in\textsf{Crys}(\mathfrak{X},B)$ is flat if
and only if $x^{*}\underline{\mathcal{F}}$ is flat for every
$x\in\mathfrak{X}(\mathbb{F}_{q^{n}})$.

###### Proof.

Let $\pi\colon X\to\mathfrak{X}$ be an étale cover by a scheme. By Corollary
2.21 and the fact that pullback commutes with tensor product,
$\underline{\mathcal{F}}$ is flat if and only if
$\pi^{*}\underline{\mathcal{F}}$ is flat. Since moreover every
$x\colon\operatorname{Spec}(\mathbb{F}_{q^{n}})\to\mathfrak{X}$ lifts to a
closed point of $X$ after a finite field extension, the result follows from
[BP09, Prop. 7.2.6 and Cor. 4.6.3]. ∎

The following result is [BP09, Prop. 9.3.4]. It implies that flatness is
related to being pointwise locally free, and will allow us to define
crystalline $L$-functions.

######  Proposition 3.3.

Suppose $B$ is artinian, and let $k/\mathbb{F}_{q}$ be finite. Let
$\underline{\mathcal{F}}\in\textsf{Crys}(\operatorname{Spec}(k),B)$.

  1. 1.

The perfection $\underline{\widehat{\mathcal{F}}}$ from Construction 2.18 is
naturally isomorphic to the direct summand
$\underline{\mathcal{F}}_{ss}\subset\underline{\mathcal{F}}$ on which $\tau$
acts as an isomorphism. In particular,
$\underline{\widehat{\mathcal{F}}}\in\textsf{Coh}_{\tau}(\operatorname{Spec}(k),B)$.

  2. 2.

$\underline{\mathcal{F}}$ is flat if and only if the underlying sheaf
$\widehat{\mathcal{F}}$ of $\underline{\widehat{\mathcal{F}}}$ is locally
free. $\Box$

###  3.2 $L$-functions and $l$-series of crystals

From now on, we assume that $B$ is a _good coefficient ring_ as defined in
[BP09, Def. 9.7.4]. For example, $B$ can be artinian or a normal integral
domain; in particular, $A=\mathcal{O}_{C}(C\setminus\\{\infty\\})$ is a good
coefficient ring. If $\mathfrak{p}_{1},\ldots,\mathfrak{p}_{n}$ are the
minimal primes of $B$, we denote by
$Q_{B}:=B_{\mathfrak{p}_{1}}\oplus\cdots\oplus B_{\mathfrak{p}_{n}}$ the
quotient ring of $B$. Note that the inclusion $B\hookrightarrow Q_{B}$ is
flat, so the functor $-\otimes_{B}Q_{B}$ on crystals is exact.

Let $\underline{\mathcal{F}}$ be a flat $B$-crystal on a scheme $X$. For a
closed point $x\in|X|$ of degree $d$, denote by
$i_{x}\colon\operatorname{Spec}(\mathbb{F}_{q^{d}})\to X$ the corresponding
inclusion. We now recall the $L$-function of a crystal, defined in [BP09,
Chapter 9].

######  Definition 3.4.

Suppose $B$ is an artinian $\mathbb{F}_{q}$-algebra, and let
$\underline{\mathcal{F}}\in\textsf{Crys}^{\text{flat}}(X,B)$. The _crystalline
$L$-function_ associated to $\underline{\mathcal{F}}$ is the power series

$L(X,\underline{\mathcal{F}},t)=\prod_{x\in|X|}\det_{B}\left(1-t\tau\
\bigg{|}\ \widehat{i_{x}^{*}\mathcal{F}}\right)^{-1}\in 1+tB[\\![t]\\!].$

For general good coefficient rings $B$ and
$\underline{\mathcal{F}}\in\textsf{Crys}^{\text{flat}}(X,B)$, define

$L(X,\underline{\mathcal{F}},t)=L(X,\underline{\mathcal{F}}\otimes_{B}Q_{B},t)\in
1+tB[\\![t]\\!].$

For a derived crystal $\underline{\mathcal{F}}^{\bullet}\in
D^{b}(\textsf{Crys}^{\text{flat}}(X,B))$, define

$L(X,\underline{\mathcal{F}}^{\bullet},t)=\prod_{i\in\mathbb{Z}}L(X,\underline{\mathcal{F}}^{i},t)^{(-1)^{i}}.$

Our aim is to extend the notion of $L$-functions to crystals on tame Deligne-
Mumford stacks. To do this without losing the good functoriality properties
$L$-functions satisfy, one must take into account the fact that points can
have automorphisms. Instead of a product over closed points, we want to obtain
a sum over $\mathbb{F}_{q^{n}}$-points for all $n$.

######  Lemma 3.5.

Let $\underline{\mathcal{F}}\in\textsf{Crys}^{\text{flat}}(X,B)$ with $B$
artinian. Consider the map $\text{d}\log\colon 1+tB[\\![t]\\!]\to
B[\\![t]\\!]$ sending $f\mapsto f^{\prime}/f$. Then we have

$t\cdot\text{d}\log L(X,\underline{\mathcal{F}},t)=\sum_{n\geq 1}\sum_{x\in
X(\mathbb{F}_{q^{n}})}\operatorname{Tr}_{\mathbb{F}_{q^{n}}\otimes
B}\left(\tau^{n}\ \bigg{|}\ \widehat{x^{*}\mathcal{F}}\right)t^{n}.$

###### Proof.

Using the definition of the $L$-function, basic properties of $\text{d}\log$,
and the fact that

$-t\cdot\text{d}\log\det_{R}(1-t\psi\ |\ M)=\sum_{n\geq
1}\operatorname{Tr}_{R}(\psi^{n}\ |\ M)t^{n}$

for any endomorphism $\psi$ of a projective $R$-module $M$ (see e.g. [GS97,
Thm 4.7]), we obtain the formula

$t\cdot\text{d}\log L(X,\underline{\mathcal{F}},t)=\sum_{x\in|X|}\sum_{n\geq
1}\operatorname{Tr}_{B}\left(\tau^{n}\ \bigg{|}\
\widehat{i_{x}^{*}\mathcal{F}}\right)t^{n}.$

Next, for a closed point $x\in|X|$ with residue field $k_{x}$ of degree $d$,
we have

$\det_{B}\left(1-t\tau\ \bigg{|}\
\widehat{i_{x}^{*}\mathcal{F}}\right)=\det_{k_{x}\otimes
B}\left(1-t^{d}\tau^{d}\ \bigg{|}\ \widehat{i_{x}^{*}\mathcal{F}}\right),$

by [BP09, Lemma 8.1.4]. Using the chain rule, this gives

$\operatorname{Tr}_{B}\left(\tau^{n}\ \bigg{|}\
\widehat{i_{x}^{*}\mathcal{F}}\right)=\begin{cases}d\operatorname{Tr}_{k_{x}\otimes
B}\left(\tau^{n}\ \bigg{|}\ \widehat{i_{x}^{*}\mathcal{F}}\right)&\text{ if
}d\mid n;\\\ 0&\text{otherwise.}\end{cases}$

Finally, if $d\mid n$, there are precisely $d$ maps $x_{1},\ldots,x_{d}\in
X(\mathbb{F}_{q^{n}})$ with image $x$. For any such map
$x_{j}=i_{x}\circ\overline{x}_{j}$, we have

$\operatorname{Tr}_{\mathbb{F}_{q^{n}}\otimes B}\left(\tau^{n}\ \bigg{|}\
\widehat{x_{j}^{*}\mathcal{F}}\right)=\operatorname{Tr}_{\mathbb{F}_{q^{n}}\otimes
B}\left(\tau^{n}\ \bigg{|}\
\overline{x}_{j}^{*}\widehat{i_{x}^{*}\mathcal{F}}\right)=\operatorname{Tr}_{k_{x}\otimes
B}\left(\tau^{n}\ \bigg{|}\ \widehat{i_{x}^{*}\mathcal{F}}\right).$

Combining the above gives the formula from the lemma. ∎

From now on, let $\mathfrak{X}$ be a tame Deligne-Mumford stack of finite type
over $\mathbb{F}_{q}$. Then for every $x\in\mathfrak{X}(\mathbb{F}_{q^{n}})$,
we have a group scheme $\underline{\operatorname{Aut}}_{x}$, given by the
following 2-fiber product:

$\underline{\operatorname{Aut}}_{x}$

$\lrcorner$

$\mathfrak{X}$$\operatorname{Spec}(\mathbb{F}_{q^{n}})$$\mathfrak{X}\times\mathfrak{X}$$\Delta$$(x,x)$

The conditions on $\mathfrak{X}$ imply that
$\underline{\operatorname{Aut}}_{x}\to\operatorname{Spec}(\mathbb{F}_{q^{n}})$
is finite étale and the cardinality of the group
$\operatorname{Aut}(x):=\underline{\operatorname{Aut}}_{x}(\mathbb{F}_{q^{n}})$
is coprime to $p$. We denote by $[\mathfrak{X}(\mathbb{F}_{q^{n}})]$ the set
of isomorphism classes of objects in the groupoid
$\mathfrak{X}(\mathbb{F}_{q^{n}})$.

######  Definition 3.6.

Suppose $B$ is an artinian $\mathbb{F}_{q}$-algebra, and let
$\underline{\mathcal{F}}\in\textsf{Crys}^{\text{flat}}(\mathfrak{X},B)$. The
_crystalline $l$-series_ associated to $\underline{\mathcal{F}}$ is the power
series

$l(\mathfrak{X},\underline{\mathcal{F}},t)=\sum_{n\geq
1}\sum_{x\in[\mathfrak{X}(\mathbb{F}_{q^{n}})]}\frac{\operatorname{Tr}_{\mathbb{F}_{q^{n}}\otimes
B}\left(\mathcal{\tau}^{n}\ \bigg{|}\
\widehat{x^{*}\mathcal{F}}\right)}{\\#\operatorname{Aut}(x)}t^{n}\in
tB[\\![t]\\!].$

For general good coefficient rings $B$ and
$\underline{\mathcal{F}}\in\textsf{Crys}^{\text{flat}}(X,B)$, define

$l(X,\underline{\mathcal{F}},t)=l(X,\underline{\mathcal{F}}\otimes_{B}Q_{B},t)\in
tB[\\![t]\\!].$

For a derived crystal $\underline{\mathcal{F}}^{\bullet}\in
D^{b}(\textsf{Crys}^{\text{flat}}(X,B))$, define

$l(X,\underline{\mathcal{F}}^{\bullet},t)=\sum_{i\in\mathbb{Z}}(-1)^{i}l(X,\underline{\mathcal{F}}^{i},t).$

######  Remark 3.7.

It follows from Lemma 3.5 that
$l(\mathfrak{X},\underline{\mathcal{F}}^{\bullet},t)=t\cdot\text{d}\log
L(\mathfrak{X},\underline{\mathcal{F}}^{\bullet},t)$ if $\mathfrak{X}$ is a
scheme.

######  Lemma 3.8.

Given a distinguished triangle
$\underline{\mathcal{F}}^{\bullet}\to\underline{\mathcal{G}}^{\bullet}\to\underline{\mathcal{H}}^{\bullet}\to\underline{\mathcal{F}}^{\bullet}[1]$
of flat derived crystals on $\mathfrak{X}$, we have

$l(\mathfrak{X},\underline{\mathcal{G}}^{\bullet},t)=l(\mathfrak{X},\underline{\mathcal{F}}^{\bullet},t)+l(\mathfrak{X},\underline{\mathcal{H}}^{\bullet},t).$

###### Proof.

It suffices to prove the statement for artinian $B$ and for a distinguished
triangle induced by a short exact sequence of complexes. By the definition of
$l$-series, it suffices to prove it in a single degree and at a single point
$x\in\mathfrak{X}(\mathbb{F}_{q^{n}})$. In this setting, the statement follows
because the perfection functor is exact and traces are additive in short exact
sequences. ∎

###  3.3 The trace formula

One of the main results of [BP09] is the trace formula: for a morphism
$f\colon Y\to X$ of schemes of finite type and
$\underline{\mathcal{F}}^{\bullet}\in
D^{b}(\textsf{Crys}^{\text{flat}}(Y,A))$, we have

$L(Y,\underline{\mathcal{F}}^{\bullet},t)\sim_{\text{uni}}L(X,Rf_{!}\underline{\mathcal{F}}^{\bullet},t),$

where $\sim_{\text{uni}}$ means that the quotient of these power series is a
unipotent polynomial; that is, an element in $P\in 1+B[t]$ such that $P-1$ is
nilpotent. We now state the main result of this section.

######  Theorem 3.9 (Lefschetz trace formula).

Let $f\colon\mathfrak{Y}\to\mathfrak{X}$ be a compactifiable morphism of tame
Deligne-Mumford stacks of finite type over $\mathbb{F}_{q}$, and let
$\underline{\mathcal{F}}^{\bullet}\in
D^{b}(\textsf{Crys}^{\text{flat}}(\mathfrak{Y},B))$. Then we have

$l(\mathfrak{Y},\underline{\mathcal{F}}^{\bullet},t)\sim_{\text{nil}}l(\mathfrak{X},Rf_{!}\underline{\mathcal{F}}^{\bullet},t),$

where $\sim_{\text{nil}}$ means that the difference of these power series is
$tP$ for some nilpotent polynomial $P$. In particular, if $B$ is reduced, the
$l$-series are equal.

We will prove the trace formula by hand for the classifying stack of a finite
étale group scheme. Combining this with the trace formula for schemes will
then imply the theorem in the generality stated above.

######  Lemma 3.10.

Theorem 3.9 holds when $\mathfrak{X}$ and $\mathfrak{Y}$ are schemes.

###### Proof.

By replacing $B$ with $Q_{B}$, we may assume $B$ is artinian. Thus the lemma
follows from [BP09, Thm 9.6.5], Lemma 3.5, and the fact that $\text{d}\log P$
is nilpotent if $P$ is unipotent. ∎

######  Proposition 3.11.

Fix $d\geq 1$. Let $G$ be a finite étale group scheme over
$\operatorname{Spec}(\mathbb{F}_{q^{d}})$ of order coprime to $p$. Let
$s\colon BG\to\operatorname{Spec}(\mathbb{F}_{q^{d}})$ be the classifying
stack of $G$, and let
$\underline{\mathcal{F}}\in\textsf{Crys}^{\text{flat}}(BG,B)$ be a flat
$B$-crystal on $BG$. Then we have

$l(BG,\underline{\mathcal{F}},t)=l(\operatorname{Spec}(\mathbb{F}_{q^{d}}),Rs_{!}\underline{\mathcal{F}},t).$

###### Proof.

By replacing $q$ with $q^{d}$, we may assume $d=1$. By replacing $B$ with
$Q_{B}$, we may assume $B$ is artinian, and since the underlying topological
space of $BG$ is a point, we may replace $\underline{\mathcal{F}}$ by its
perfection. Suppose first that $G$ is a constant group.

Since $\underline{\mathcal{F}}$ is flat, $\underline{\mathcal{F}}$ is
represented by a locally free $\tau$-sheaf $(M,\tau)$ on $BG$, which we may
view as a finitely generated $k\otimes B$-module $M$ equipped with a
$G$-action commuting with $\tau$. Since $BG$ is proper, we have
$Rs_{!}=Rs_{*}$. Since $BG$ is tame, $s_{*}$ is exact [Ols16, Prop. 11.3.4],
and so $Rs_{!}M\cong s_{*}M\cong(M^{G},\tau)$ is a representative of
$Rs_{!}\underline{\mathcal{F}}$.

For any finite extension $k/\mathbb{F}_{q}$, the groupoid $BG(k)$ has as
objects the elements of $G$ and as morphisms

$\text{Hom}_{BG(k)}(g,h)=\\{x\in G\ |\ xgx^{-1}=h\\}.$

Indeed, a $G$-torsor on $\operatorname{Spec}(k)$ is equivalent to a map
$\pi_{1}(\operatorname{Spec}(k))\cong\hat{\mathbb{Z}}\to G$ up to conjugation.
In particular, $[BG(k)]=G/\\!\\!\sim$, the set of conjugacy classes of $G$. So
we need to show that for every $n\geq 1$, we have

$\sum_{[g]\in G/\sim}\frac{\operatorname{Tr}_{\mathbb{F}_{q^{n}}\otimes
B}(\tau^{n}\hskip 1.99997pt|\hskip
3.00003ptg^{*}M)}{\\#\text{Stab}_{G}(g)}=\operatorname{Tr}_{\mathbb{F}_{q^{n}}\otimes
B}(\tau^{n}\ |\ \mathbb{F}_{q^{n}}\otimes
M^{G})=\operatorname{Tr}_{B}(\tau^{n}\ |\ M^{G}).$

By the orbit-stabilizer formula and the fact that the endomorphism
$\tau^{n}\circ g$ is defined over $\mathbb{F}_{q}$, the left-hand side is
equal to

$\sum_{g\in G}\frac{\operatorname{Tr}_{B}(\tau^{n}\circ g\ |\ M)}{\\#G}.$

But this is also equal to the right-hand side, since the map $M\to M$ sending
$m\mapsto\frac{1}{\\#G}\sum_{g\in G}gm$ is a projection onto $M^{G}$ commuting
with $\tau$.

In general, the finite étale group $G$ corresponds to an abstract finite group
$\bar{G}:=G(\overline{\mathbb{F}}_{q})$ with an action of
$\operatorname{Gal}(\mathbb{F}_{q})$ given by a map
$\sigma\in\operatorname{Aut}(\bar{G})$. Then $\underline{\mathcal{F}}$ can be
identified with a $\bar{G}$-representation, and $BG(\mathbb{F}_{q^{n}})$ can
be described as above after replacing $G$ by $\bar{G}$ and conjugation by the
relation $g\sim xg\sigma^{n}(x^{-1})$ for all $x\in\bar{G}$. Then the trace
formula for $BG$ again reduces to the projection formula in representation
theory. ∎

We now deduce the trace formula as stated in Theorem 3.9. The following proof
is inspired by [Beh91, §2], as well as the treatment [Sun12]. It uses
noetherian induction on the topological space
$|\mathfrak{Y}|:=\mathfrak{Y}(\overline{\mathbb{F}}_{q})/\operatorname{Gal}(\mathbb{F}_{q})$.

###### Proof of Theorem 3.9.

We apply a sequence of reduction steps.

1\. By Lemma 3.8 and the fact that $Rf_{!}$ preserves distinguished triangles,
it suffices to prove the theorem for a single crystal, as we can apply the
truncation sequence

$T_{\leq
n}\underline{\mathcal{F}}^{\bullet}\longrightarrow\underline{\mathcal{F}}^{\bullet}\longrightarrow
T_{>n}\underline{\mathcal{F}}^{\bullet}\longrightarrow T_{\leq
n}\underline{\mathcal{F}}^{\bullet}[1]$

to reduce the statement to complexes of smaller length.

2\. It is enough to show the statement for the structure morphisms
$s_{\mathfrak{Y}}\colon\mathfrak{Y}\to\operatorname{Spec}(\mathbb{F}_{q})$ for
all $\mathfrak{Y}$. Indeed, given $f\colon\mathfrak{Y}\to\mathfrak{X}$, we
have $Rs_{\mathfrak{Y},!}\cong Rs_{\mathfrak{X},!}Rf_{!}$ and hence

$l(\mathfrak{Y},\underline{\mathcal{F}}^{\bullet},t)\sim_{\text{nil}}l(\operatorname{Spec}(\mathbb{F}_{q}),Rs_{\mathfrak{Y},!}\underline{\mathcal{F}}^{\bullet},t)\sim_{\text{nil}}l(\mathfrak{X},Rf_{!}\underline{\mathcal{F}}^{\bullet},t).$

3\. By noetherian induction, it is enough to show that the trace formula holds
on a non-empty open substack of $\mathfrak{Y}$, cf. [BP09, Lemma 9.6.8]. Hence
we may assume that $\mathfrak{Y}$ is a quotient stack; in particular, it
admits a coarse moduli scheme $\pi\colon\mathfrak{Y}\to Y$.

4\. It is enough to show the statement for the coarse moduli space $\pi$.
Indeed, we already know the statement for the structure map $s_{Y}$ since $Y$
is a scheme, and we have $Rs_{\mathfrak{Y},!}\cong Rs_{Y,!}R\pi_{!}$.

5\. By proper base change and the local definition of $l$-series, we may take
a point $y\in|Y|$ of degree $d$ and replace $\pi$ with
$\pi_{y}\colon\mathfrak{Y}_{y}\to y$. Then $\pi_{y}$ defines an
$\underline{\text{Aut}}_{y}$-gerbe, but any gerbe over a finite field is
neutral [Beh03, Cor. 6.4.2]. Hence $\pi_{y}$ is of the form
$BG\to\operatorname{Spec}(\mathbb{F}_{q^{d}})$, where
$G=\underline{\text{Aut}}_{y}$ is a finite étale group scheme of order coprime
to $p$. Thus we are done by Proposition 3.11. ∎

##  4 A trace formula for Hecke operators

Our aim in this section is to apply the Lefschetz trace formula to certain
crystals on the moduli stack of Drinfeld modules. This will yield a trace
formula for Hecke operators on Drinfeld cusp forms.

For the remainder of this paper, Drinfeld modules will be assumed to be of
rank $r=2$. We briefly recall the definition of Drinfeld modular forms, as
well as the Eichler-Shimura theory developed by Böckle in [Böc02], which
realizes spaces of Drinfeld cusp forms as cohomology groups of crystals.

###  4.1 Drinfeld modular forms

Let $A=\mathcal{O}_{C}(C\setminus\\{\infty\\})$ and $K=\operatorname{Frac}(A)$
as before. Let $K_{\infty}$ be the completion of $K$ at the place $\infty$,
and let $\mathbb{C}_{\infty}$ be the completion of an algebraic closure of
$K_{\infty}$. Denote by $\Omega:=\mathbb{C}_{\infty}\setminus K_{\infty}$ the
Drinfeld upper half-plane, seen as a rigid-analytic space. It has an action of
$\operatorname{GL}_{2}(K_{\infty})$ by Möbius transformations.

######  Definition 4.1.

Fix integers $k,l\in\mathbb{Z}$. A _Drinfeld modular form of weight $k$ and
type $l$_ is a function $f\colon\Omega\to\mathbb{C}_{\infty}$ satisfying the
following properties:

  1. 1.

For each $\gamma=\begin{pmatrix}a&b\\\
c&d\end{pmatrix}\in\operatorname{GL}_{2}(A)$, we have

$f(\gamma z)=\det(\gamma)^{-l}(cz+d)^{k}f(z).$ (2)

  2. 2.

$f$ is holomorphic on $\Omega$ and at infinity.

A subgroup $\Gamma\subset\operatorname{GL}_{2}(A)$ is called a _congruence
subgroup_ if it contains

$\Gamma(\mathfrak{n})=\left\\{M\in\operatorname{GL}_{2}(A)\ \bigg{|}\
M\equiv\begin{pmatrix}1&0\\\ 0&1\end{pmatrix}\pmod{\mathfrak{n}}\right\\}$

for some ideal $\mathfrak{n}\trianglelefteq A$. A Drinfeld modular form _of
level $\Gamma$_ is a rigid-analytic function, holomorphic at the cusps of
$\Gamma$ [Gek86, V.2.4], which satisfies the transformation property (2) for
all $\gamma\in\Gamma$. By a modular form of level 1, we mean a modular form
for $\operatorname{GL}_{2}(A)$. A modular form of level $\Gamma$ is called a
_cusp form_ if it vanishes at all the cusps of $\Gamma$. We denote the space
of Drinfeld cusp forms of weight $k$, type $l$, and level $\Gamma$ by
$\operatorname{S}_{k,l}(\Gamma)$. If $\Gamma=\operatorname{GL}_{2}(A)$, we
simply write $\operatorname{S}_{k,l}$.

######  Remark 4.2.

In [Böc02, §5], Böckle defines _adelic Drinfeld modular forms_ and shows that
spaces of adelic Drinfeld modular forms are naturally isomorphic to spaces of
Drinfeld modular forms. The advantage of this is that one can define Hecke
operators on Drinfeld modular forms for general rings $A$ rather than just
$\mathbb{F}_{q}[T]$. We will use the adelic language where necessary without
recalling all details. In particular, we will consider modular forms of level
$\mathcal{K}$, where $\hat{A}=\varprojlim A/I$ is the completion of $A$ and
$\mathcal{K}\subset\operatorname{GL}_{2}(\hat{A})$ is an admissible subgroup.
For a prime ideal $\mathfrak{p}\trianglelefteq A$ not dividing the minimal
conductor of $\mathcal{K}$, we denote by $\mathbf{T}_{\mathfrak{p}}$ the
corresponding Hecke operator acting on $\operatorname{S}_{k,l}(\mathcal{K})$.

######  Remark 4.3.

When $A=\mathbb{F}_{q}[T]$, the action of the Hecke operators on adelic cusp
forms is different from the Hecke operators defined in [Gos80], [Gek88]. For
clarity, we distinguish between the two notions of Hecke operators: we retain
the notation $\mathbf{T}_{\mathfrak{p}}$ for the adelic Hecke operators, and
write $\mathbf{T}_{\mathfrak{p}}^{\mathbb{F}_{q}[T]}$ the Hecke operators from
loc. cit. Let us emphasise an important difference between the two.

From Definition 4.1, it follows immediately that we have canonical
isomorphisms $\operatorname{S}_{k,l}\cong\operatorname{S}_{k,l^{\prime}}$ for
any $l\equiv l^{\prime}\pmod{q-1}$. This isomorphism is compatible with the
Hecke operators $\mathbf{T}_{\mathfrak{p}}^{\mathbb{F}_{q}[T]}$. However, it
is not equivariant with respect to the Hecke operators
$\mathbf{T}_{\mathfrak{p}}$: the action differs by a character [Böc02, Remark
6.12]. Given integers $k,l\in\mathbb{Z}$, we have

$\mathbf{T}_{\mathfrak{p}}=P^{l-k}\mathbf{T}_{\mathfrak{p}}^{\mathbb{F}_{q}[T]},$

where $P$ is the monic generator of $\mathfrak{p}$. In particular, we must
view $l\in\mathbb{Z}$ as an integer and not as an element in
$\mathbb{Z}/(q-1)\mathbb{Z}$.

###  4.2 Böckle-Eichler-Shimura theory

Denote by $\Theta\colon\mathfrak{M}_{2}\to\operatorname{Spec}(A)$ the
structure morphism of the moduli stack of Drinfeld modules. Fix a maximal
ideal $\mathfrak{p}\trianglelefteq A$ with residue field
$\mathbb{F}_{\mathfrak{p}}$, corresponding to a map
$i_{\mathfrak{p}}\colon\operatorname{Spec}(\mathbb{F}_{\mathfrak{p}})\to\operatorname{Spec}(A)$.
Similarly, for the completion $K_{\infty}$ of $K=\operatorname{Frac}(A)$ at
$\infty$, write
$i_{K_{\infty}}\colon\operatorname{Spec}(K_{\infty})\to\operatorname{Spec}(A)$.

The _universal Drinfeld module over $\mathfrak{M}_{2}$_ is the Drinfeld module
$\varphi_{\text{univ}}:=\text{id}\colon\mathfrak{M}_{2}\to\mathfrak{M}_{2}$.
We denote its associated $\tau$-sheaf by
$\underline{\mathcal{F}}:=\underline{\mathcal{M}}(\varphi_{\text{univ}})$, cf.
Construction 2.13.

######  Definition 4.4.

Fix integers $k\geq 2$ and $l\in\mathbb{Z}$. With notation as above, we define
the $A$-crystals

$\underline{\mathcal{F}}_{k,l}:=(\det\underline{\mathcal{F}})^{\otimes
l-k+1}\otimes\text{Sym}^{k-2}\underline{\mathcal{F}};\qquad\underline{\mathcal{S}}_{k,l}:=R^{1}\Theta_{!}\underline{\mathcal{F}}_{k,l}.$

We call $\underline{\mathcal{S}}_{k,l}$ the _crystal of Drinfeld cusp forms of
weight $k$ and type $l$_.

Similarly, given an admissible subgroup
$\mathcal{K}\subset\operatorname{GL}_{2}(\hat{A})$, one has a moduli space
$\mathfrak{M}_{2,\mathcal{K}}$ of Drinfeld modules with level
$\mathcal{K}$-structure. If $\mathcal{K}$ has minimal conductor
$\mathfrak{n}\trianglelefteq A$, then the moduli space of Drinfeld modules
with level $\mathcal{K}$-structure is representable by a scheme over
$\operatorname{Spec}(A[\mathfrak{n}^{-1}])$. Forgetting the level structure
defines an étale cover
$\pi_{\mathcal{K}}\colon\mathfrak{M}_{2,\mathcal{K}}\to\mathfrak{M}_{2}$, and
we define

$\underline{\mathcal{F}}_{k,l}(\mathcal{K}):=\pi_{\mathcal{K}}^{*}\underline{\mathcal{F}}_{k,l};\qquad\underline{\mathcal{S}}_{k,l}(\mathcal{K}):=R^{1}\Theta_{\mathcal{K},!}\underline{\mathcal{F}}_{k,l}(\mathcal{K}).$

We call $\underline{\mathcal{S}}_{k,l}(\mathcal{K})$ the _crystal of cusp
forms of weight $k$, type $l$, and level $\mathcal{K}$_. For any prime
$\mathfrak{p}\trianglelefteq A[\mathfrak{n}^{-1}]$, one has a Hecke operator
$\mathbf{T}_{\mathfrak{p}}$ acting on the crystals of cusp forms via
correspondences [Böc02, Section 13.1].

######  Lemma 4.5.

Let $k\geq 2$ and $l\in\mathbb{Z}$, and let
$x\in\mathfrak{M}_{2}(\mathbb{F}_{q^{n}})$ correspond to the Drinfeld module
$(E,\varphi)$.

  1. 1.

The perfection of $x^{*}\underline{\mathcal{F}}_{k,l}\otimes_{A}K$ is the
coherent $\tau$-sheaf

$\underline{\mathcal{M}}_{k,l}(\varphi)_{K}:=((\det\underline{\mathcal{M}}(\varphi))^{\otimes
l-k+1}\otimes\operatorname{Sym}^{k-2}\underline{\mathcal{M}}(\varphi))\otimes_{A}K.$

  2. 2.

The crystals $\underline{\mathcal{F}}_{k,l}$,
$\underline{\mathcal{F}}_{k,l}(\mathcal{K})$, $\underline{\mathcal{S}}_{k,l}$,
and $\underline{\mathcal{S}}_{k,l}(\mathcal{K})$ are flat.

###### Proof.

By definition of the universal Drinfeld module, we have
$x^{*}\underline{\mathcal{F}}\cong\underline{\mathcal{M}}(\varphi)$ as
$A$-crystals. By Example 2.14, $\tau$ acts as an isomorphism on
$\underline{\mathcal{M}}(\varphi)\otimes_{A}K$, since $\pi_{\varphi}=\tau^{n}$
is an isogeny and hence becomes invertible after tensoring with $K$. Hence
$\tau$ also acts as an isomorphism on
$\underline{\mathcal{M}}_{k,l}(\varphi)_{K}$. Since the perfection functor in
this setting sends a $\tau$-sheaf to the direct summand on which $\tau$ acts
as an isomorphism, this gives 1. For 2, note that
$\underline{\mathcal{M}}(\varphi)$ is flat as its underlying sheaf is locally
free. Hence the result follows from Lemma 3.2 and the fact that flatness is
preserved under the functors from Theorem 2.22. ∎

For any rigid-analytic space $\mathcal{X}$, there is a category of _rigid
$A$-crystals_ which we denote by $\widetilde{\textsf{Crys}}(\mathcal{X},A)$.
For any scheme $X$ over $\operatorname{Spec}(K_{\infty})$, one can define a
rigidification functor

$(-)^{\text{rig}}:\textsf{Crys}(X,A)\longrightarrow\widetilde{\textsf{Crys}}(X^{\text{rig}},A)$

where $X^{\text{rig}}$ is a certain rigid analytic space associated to $X$.
When applied to the crystal of cusp forms, one can show the following:

######  Lemma 4.6 ([Böc02], Cor. 10.13).

The crystal
$i_{K_{\infty}}^{*}\underline{\mathcal{S}}_{k,l}(\mathcal{K})^{\text{rig}}$ is
represented by a rigid $\tau$-sheaf of the form

$\underline{\tilde{\mathds{1}}}_{K_{\infty}}\otimes_{A}P_{k,l}(\mathcal{K}),$

where $P_{k,l}(\mathcal{K})$ is a projective finitely generated $A$-module and
$\underline{\tilde{\mathds{1}}}_{K_{\infty}}$ denotes the trivial rigid
$\tau$-sheaf on $\text{Spm}(K_{\infty})$. $\Box$

For a scheme $X$, recall that the trivial $\tau$-sheaf
$\underline{\mathds{1}}_{X}$ on $X$ over $A$ is given by the pair
$(\mathcal{O}_{X\otimes A},\tau)$, where

$\tau\colon(\sigma_{X}\times\text{id})^{*}\mathcal{O}_{X\otimes
A}\longrightarrow\mathcal{O}_{X\otimes A}$

is given by the adjoint of the map $x\otimes a\mapsto x^{q}\otimes a$. The
construction for rigid $\tau$-sheaves is entirely similar. In particular, the
functor taking $\tau$-invariants

$\displaystyle(-)^{\tau}\colon\widetilde{\textsf{Crys}}(\mathcal{X},A)$
$\displaystyle\longrightarrow A\textsf{-Mod}$
$\displaystyle\underline{\mathcal{F}}$ $\displaystyle\longmapsto
H^{0}(\mathcal{X}\times\operatorname{Spec}(A),\mathcal{F})^{\tau},$

which is well-defined on crystals, sends
$\underline{\tilde{\mathds{1}}}_{\mathcal{X}}\otimes_{A}P\mapsto P$.

We can now state the Eichler-Shimura isomorphism for Drinfeld cusp forms,
which is proven in [Böc02, Thm 10.3] in the case $l=k-1$ and which is easily
generalised to arbitrary types $l$:

######  Theorem 4.7 (Eichler-Shimura isomorphism).

Let $\mathcal{K}\subset\operatorname{GL}_{2}(\hat{A})$ be an admissible
subgroup. Then there is a Hecke-equivariant isomorphism

$\mathbb{C}_{\infty}\otimes_{A}\left(i_{K_{\infty}}^{*}\underline{\mathcal{S}}_{k,l}(\mathcal{K})^{\text{rig}}\right)^{\tau}\cong\operatorname{S}_{k,l}(\mathcal{K})^{\vee},$
(3)

called the _Eichler-Shimura isomorphism for Drinfeld cusp forms_. $\Box$

There is also an Eichler-Shimura relation. Classically, this says that for a
prime $p\nmid N$, the Hecke operator at $p$ is the sum of the $p$-Frobenius
and the Verschiebung as correspondences on $X_{0}(N)$. For Drinfeld modules,
the Hecke operator at $\mathfrak{p}$ is simply the $\mathfrak{p}$-Frobenius
[Böc02, Theorem 13.10]:

######  Theorem 4.8 (Eichler-Shimura relation).

Suppose $\mathcal{K}$ has minimal conductor $\mathfrak{n}$. Let $\mathfrak{p}$
be a prime not dividing $\mathfrak{n}$. Then we have an equality

$i_{\mathfrak{p}}^{*}\mathbf{T}_{\mathfrak{p}}=\tau^{\deg(\mathfrak{p})}$ (4)

as endomorphisms of
$i_{\mathfrak{p}}^{*}\underline{\mathcal{S}}_{k,l}(\mathcal{K})$. $\Box$

We now show that the above results extend to the crystals
$\underline{\mathcal{S}}_{k,l}$ of level 1. In particular, we obtain the
following:

######  Corollary 4.9.

Denote by $\underline{\hat{\mathcal{S}}}^{K,\mathfrak{p}}_{k,l}$ the
perfection of $i_{\mathfrak{p}}^{*}\underline{\mathcal{S}}_{k,l}\otimes_{A}K$.
Then we have

$\operatorname{Tr}_{\mathbb{F}_{\mathfrak{p}}\otimes
K}\left(\tau^{\deg(\mathfrak{p})n}\ \bigg{|}\
\hat{\mathcal{S}}^{K,\mathfrak{p}}_{k,l}\right)=\operatorname{Tr}_{\mathbb{C}_{\infty}}\left(\mathbf{T}_{\mathfrak{p}}^{n}\hskip
3.00003pt\bigg{|}\hskip 1.00006pt\operatorname{S}_{k,l}\right).$

###### Proof.

Consider $\mathcal{K}=\mathcal{K}(\mathfrak{n})$ for some proper non-zero
ideal $\mathfrak{n}$ not contained in $\mathfrak{p}$. Then
$\mathcal{K}(\mathfrak{n})\subset\operatorname{GL}_{2}(\hat{A})$ is a normal
subgroup with quotient $G\cong\operatorname{GL}_{2}(A/\mathfrak{n}A)$, and as
a result $\mathfrak{M}_{2,\mathcal{K}}$ is a Galois cover of
$\mathfrak{M}_{2}$ with Galois group $G$. In other words, we can identify
$\mathfrak{M}_{2}$ with the stack quotient $[\mathfrak{M}_{2,\mathcal{K}}/G]$.
Via base change, this statement holds also over both $K_{\infty}$ and
$\mathbb{F}_{\mathfrak{p}}$.

Since a $G$-action on a crystal induces a $G$-action on its rigidification, we
define
$i_{K_{\infty}}^{*}\underline{\mathcal{S}}_{k,l}^{\text{rig}}:=(i_{K_{\infty}}^{*}\underline{\mathcal{S}}_{k,l}(\mathcal{K})^{\text{rig}})^{G}$.
Then the Eichler-Shimura isomorphism (3) and Lemma 4.6 imply

$i_{K_{\infty}}^{*}\underline{\mathcal{S}}_{k,l}^{\text{rig}}\cong(\underline{\mathds{1}}_{K_{\infty}}\otimes_{A}\operatorname{S}_{k,l}(\mathcal{K})^{\vee})^{G}\cong\underline{\mathds{1}}_{K_{\infty}}\otimes_{A}\operatorname{S}_{k,l}^{\vee}.$

Next,
$i_{\mathfrak{p}}^{*}\mathbf{T}_{\mathfrak{p}}^{n}=\tau^{\deg(\mathfrak{p})n}$
follows from the Eichler-Shimura relation (4) and Corollary 2.21, since exact
and conservative functors are faithful. Combining the above and noting that
$A$ is reduced, the Hecke action on $\operatorname{S}_{k,l}$ can be computed
on the underlying sheaf of any locally free representative of the crystal
$i_{\mathfrak{p}}^{*}\underline{\mathcal{S}}_{k,l}$. This may also be done
after tensoring with $K$, which gives the desired expression. ∎

###  4.3 A trace formula for Hecke operators

Let $\pi\in\bar{K}$ be a root of the quadratic equation
$X^{2}-(\pi+\bar{\pi})X+\pi\bar{\pi}\in A[X]$. Then we set for $m\geq 0$,

$\operatorname{Tr}_{m}(\pi):=\sum_{i=0}^{m}\pi^{i}\bar{\pi}^{m-i}.$

Combining Corollary 4.9 with the Lefschetz trace formula, we obtain a trace
formula for Hecke operators on Drinfeld cusp forms of level 1.

######  Theorem 4.10.

Let $\mathfrak{p}\trianglelefteq A$ be a maximal ideal with residue field
$\mathbb{F}_{\mathfrak{p}}$. Fix a weight $k\geq 2$ and a type
$l\in\mathbb{Z}$. Then for every $n\geq 1$, we have

$\operatorname{Tr}_{\mathbb{C}_{\infty}}(\mathbf{T}^{n}_{\mathfrak{p}}\hskip
1.99997pt|\hskip
1.00006pt\operatorname{S}_{k,l})=\sum_{[(E,\varphi)]/\mathbb{F}_{{\mathfrak{p}}^{n}}}\operatorname{Tr}_{k-2}(\pi_{\varphi})\cdot(\pi_{\varphi}\bar{\pi}_{\varphi})^{l-k+1},$
(5)

where the sum is taken over the set of isomorphism classes of Drinfeld modules
over $\mathbb{F}_{\mathfrak{p}^{n}}$, and $\pi_{\varphi}\in\bar{K}$ denotes
the Frobenius endomorphism of $(E,\varphi)$.

###### Proof.

Let $j_{\mathfrak{p}}\colon\mathfrak{M}_{2,\mathfrak{p}}\to\mathfrak{M}_{2}$
be the fiber of the moduli space of Drinfeld modules at $\mathfrak{p}$.
Consider the $l$-series of the crystal
$j_{\mathfrak{p}}^{*}\underline{\mathcal{F}}_{k,l}$. By Lemma 4.5, we have

$l(\mathfrak{M}_{2,\mathfrak{p}},j_{\mathfrak{p}}^{*}\underline{\mathcal{F}}_{k,l},t)=\sum_{n\geq
1}\sum_{[(E,\varphi)]/\mathbb{F}_{\mathfrak{p}^{n}}}\frac{\operatorname{Tr}_{\mathbb{F}_{\mathfrak{p}^{n}}\otimes
K}\left(\tau^{\deg(\mathfrak{p})n}\ \bigg{|}\
\underline{\mathcal{M}}_{k,l}(\varphi)_{K}\right)}{\\#\operatorname{Aut}(\varphi)}t^{\deg(\mathfrak{p})n}.$

By Lemma 2.5, we have $\\#\operatorname{Aut}(\varphi)=-1$ for all $\varphi$.
Moreover, the endomorphism $\tau^{\deg(\mathfrak{p})n}$ of the $\tau$-sheaf
associated to $\varphi$ may be identified with the Frobenius endomorphism
$\pi_{\varphi}$ of $\varphi$. If the characteristic polynomial of
$\pi_{\varphi}$ has roots $\pi_{\varphi}$ and $\bar{\pi}_{\varphi}$, then by
definition of $\underline{\mathcal{M}}_{k,l}(\varphi)_{K}$ we obtain

$l(\mathfrak{M}_{2,\mathfrak{p}},j_{\mathfrak{p}}^{*}\underline{\mathcal{F}}_{k,l},t)=\sum_{n\geq
1}\sum_{[(E,\varphi)]/\mathbb{F}_{\mathfrak{p}^{n}}}-(\pi_{\varphi}\bar{\pi}_{\varphi})^{l-k+1}\operatorname{Tr}_{k-2}(\pi_{\varphi})t^{\deg(\mathfrak{p})n}.$

On the other hand, since $\mathfrak{M}_{2}$ is compactifiable, we may apply
the trace formula to the crystal
$j_{\mathfrak{p}}^{*}\underline{\mathcal{F}}_{k,l}$ under the structure map
$s_{\mathfrak{p}}\colon\mathfrak{M}_{2,\mathfrak{p}}\to\operatorname{Spec}(\mathbb{F}_{\mathfrak{p}})$.
We have $R^{i}\Theta_{!}\underline{\mathcal{F}}_{k,l}=0$ for $i\neq 1$ by
[BP09, Theorem 8.4.2(a)] and étale descent. Combined with proper base change,
this gives
$Rs_{\mathfrak{p},!}j_{\mathfrak{p}}^{*}\underline{\mathcal{F}}_{k,l}\cong
i_{\mathfrak{p}}^{*}\underline{\mathcal{S}}_{k,l}[-1]$. Thus the trace formula
states that

$l(\mathfrak{M}_{2,\mathfrak{p}},j_{\mathfrak{p}}^{*}\underline{\mathcal{F}}_{k,l},t)=l(\operatorname{Spec}(\mathbb{F}_{\mathfrak{p}}),i_{\mathfrak{p}}^{*}\underline{\mathcal{S}}_{k,l}[-1],t),$

with equality holding on the nose since $A$ is reduced. Applying Corollary 4.9
and comparing coefficients yields the desired equation (5). ∎

######  Remark 4.11.

Let $\mathcal{K}\subset\operatorname{GL}_{2}(\hat{A})$ be an admissible
subgroup. Applying the Lefschetz trace formula to the crystal
$\underline{\mathcal{S}}_{k,l}(\mathcal{K})$ yields a similar formula for
traces of Hecke operators on Drinfeld cusp forms of level $\mathcal{K}$:

$\operatorname{Tr}_{\mathbb{C}_{\infty}}(\mathbf{T}^{n}_{\mathfrak{p}}\hskip
1.99997pt|\hskip
1.00006pt\operatorname{S}_{k,l}(\mathcal{K}))=-\sum_{[(E,\varphi,[\psi])]/\mathbb{F}_{{\mathfrak{p}}^{n}}}\operatorname{Tr}_{k-2}(\pi_{\varphi})\cdot(\pi_{\varphi}\bar{\pi}_{\varphi})^{l-k+1},$

where the sum is taken over the set of isomorphism classes of Drinfeld modules
over $\mathbb{F}_{{\mathfrak{p}}^{n}}$ with level $\mathcal{K}$-structure.

###  4.4 Ramanujan bounds

As a consequence of the trace formula, we obtain bounds on the traces of Hecke
operators. Denote by $|\cdot|_{\infty}$ the unique extension to
$\mathbb{C}_{\infty}$ of the norm on $K$ given by
$|x|_{\infty}=q^{-\deg(\infty)v_{\infty}(x)}$.

######  Corollary 4.12 (Ramanujan bound).

Let $\mathfrak{p}\trianglelefteq A$ be a maximal ideal of degree $d$. Then for
every $n\geq 1$, we have

$|\operatorname{Tr}_{\mathbb{C}_{\infty}}(\mathbf{T}_{\mathfrak{p}}^{n}\hskip
1.99997pt|\hskip
1.00006pt\operatorname{S}_{k,l})|_{\infty}\leq(q^{nd})^{\frac{k}{2}+l-k}.$ (6)

###### Proof.

For any Drinfeld module over $\mathbb{F}_{\mathfrak{p}^{n}}$ with Frobenius
endomorphism $\pi$, the elements $\pi$ and $\bar{\pi}$ are Weil numbers of
rank $2$ over $\mathbb{F}_{\mathfrak{p}^{n}}\cong\mathbb{F}_{q^{nd}}$. In
particular,

$|\pi|_{\infty}=|\bar{\pi}|_{\infty}=q^{\frac{nd}{2}}.$

By equation (5), the definition of $\operatorname{Tr}_{k-2}$, and the triangle
inequality, we obtain

$q^{-nd(l-k+1)}|\operatorname{Tr}_{\mathbb{C}_{\infty}}(\mathbf{T}_{\mathfrak{p}}^{n}\hskip
1.99997pt|\hskip
1.00006pt\operatorname{S}_{k,l})|_{\infty}\leq\max_{\pi}\\{|\operatorname{Tr}_{k-2}(\pi,\bar{\pi})|_{\infty}\\}\leq
q^{nd(k-2)/2}.$

This yields the desired inequality. ∎

######  Remark 4.13.

Using Remark 4.11, one can use the same argument to obtain a Ramanujan bound
for the traces of $\mathbf{T}_{\mathfrak{p}}$ acting on
$\operatorname{S}_{k,l}(\mathcal{K})$ for any $\mathfrak{p}$ not dividing the
minimal conductor of $\mathcal{K}$.

######  Remark 4.14.

The bound (6) involves the exponent $k/2+l-k$, which at first sight looks
strange. We argue that the main term in the exponent is $k/2$, whereas the
term $l-k$ is an artefact of the adelic interpretation of Hecke operators. As
explained in Remark 4.3, it is natural to view $l$ as an element in
$\mathbb{Z}/(q-1)\mathbb{Z}$, but then the adelic Hecke operator is only
defined up to a character twist. After a suitable normalisation, the exponent
does indeed reduce to $k/2$, as demonstrated by the case
$A=\mathbb{F}_{q}[T]$, cf. Corollary 4.15 below.

######  Corollary 4.15 (Ramanujan bound for $\mathbb{F}_{q}[T]$).

Let $A=\mathbb{F}_{q}[T]$ and fix a monic and irreducible polynomial $P\in A$
of degree $d$. Let $\mathfrak{p}=(P)$ and denote by
$\mathbf{T}_{\mathfrak{p}}^{\mathbb{F}_{q}[T]}$ the Hecke operator for
$\mathfrak{p}$ as defined in [Gek88, §7]. Then for every $n\geq 1$, we have

$\deg\operatorname{Tr}\left(\left(\mathbf{T}_{\mathfrak{p}}^{\mathbb{F}_{q}[T]}\right)^{n}\hskip
1.00006pt\bigg{|}\hskip
1.99997pt\operatorname{S}_{k,l}\right)\leq\frac{ndk}{2}.$

###### Proof.

This follows because $|f|_{\infty}=q^{\deg(f)}$ for $f\in A$, and the fact
that
$\mathbf{T}_{\mathfrak{p}}^{\mathbb{F}_{q}[T]}=P^{k-l}\mathbf{T}_{\mathfrak{p}}$.
∎

We conclude with an observation about the Hecke eigenvalues. In characteristic
0, Newton’s identities imply that for an operator $\mathbf{T}$ acting on a
$d$-dimensional vector space $V$, knowing $\operatorname{Tr}(\mathbf{T}^{n})$
for $n=1,\ldots,d$ is equivalent to knowing the eigenvalues of $\mathbf{T}$.
Although this fails in characteristic $p$, one can still say the following.

######  Corollary 4.16.

Suppose the action of $\mathbf{T}_{\mathfrak{p}}$ on $\operatorname{S}_{k,l}$
does not have $p$ repeated eigenvalues. Then any eigenvalue $\alpha$ of
$\mathbf{T}_{\mathfrak{p}}$ satisfies

$|\alpha|_{\infty}\leq(q^{d})^{\frac{k}{2}+l-k}.$

###### Proof.

This is a direct consequence of the Ramanujan bound (6) and [Vri23, Prop.
4.1]. ∎

We further study the consequences of the trace formula for
$A=\mathbb{F}_{q}[T]$ in [Vri24].

## References

  * [Beh03] Kai Behrend  “Derived $\ell$-adic categories for algebraic stacks”  In _Memoirs of the American Mathematical Society_ 774, 2003
  * [Beh91] Kai Behrend  “The Lefschetz Trace Formula for the Moduli Stack of Principal Bundles”, 1991  URL: https://personal.math.ubc.ca/~behrend/thesis.pdf
  * [Böc02] Gebhard Böckle  “An Eichler-Shimura isomorphism over function fields between Drinfeld modular forms and cohomology classes of crystals” Preprint, 2002  URL: https://www1.iwr.uni-heidelberg.de/fileadmin/groups/arithgeo/templates/data/Gebhard_Boeckle/EiShNew.pdf
  * [BP09] Gebhard Böckle and Richard Pink  “Cohomological Theory of Crystals over Function Fields” 9, Tracts in Mathematics  European Mathematical Society, 2009
  * [Del69] Pierre Deligne  “Formes modulaires et représentations $l$-adiques”  In _Séminaire Bourbaki_ 11 Springer-Verlag, 1969, pp. 139–172
  * [Del74] Pierre Deligne  “La conjecture de Weil : I”  In _Publications Mathématiques de l’IHÉS_ 43, 1974, pp. 273–307
  * [Dri74] Vladimir Drinfel’d  “Elliptic modules”  In _Mat. Sb. (N.S.)_ 94(136), 1974, pp. 594–627
  * [Dri77] Vladimir Drinfel’d  “Commutative subrings of certain noncommutative rings”  In _Functional Analysis and Its Applications_ 11, 1977, pp. 9–12
  * [Gek86] Ernst-Ulrich Gekeler  “Drinfeld Modular Curves” 1231, Lecture Notes in Mathematics  Springer, 1986
  * [Gek88] Ernst-Ulrich Gekeler  “On the Coefficients of Drinfeld modular forms”  In _Inventiones Mathematicae_ 93, 1988, pp. 667–700
  * [Gos80] David Goss  “$\pi$-adic Eisenstein series for function fields”  In _Compositio Mathematica_ 41, 1980, pp. 3–38
  * [Gos96] David Goss  “Basic Structures of Function Field Arithmetic” 35, Ergebnisse der Mathematik und ihrer Grenzgebiete  Springer, 1996
  * [GS97] Ernst-Ulrich Gekeler and Brian Snyder  “Drinfeld Modules Over Finite Fields”  In _Drinfeld Modules, Modular Schemes and Applications_ World Scientific, 1997
  * [Lau96] Gérard Laumon  “Cohomology of Drinfeld Modular Varieties, Part I” 41, Cambridge studies in advanced mathematics  Cambridge University Press, 1996
  * [Man22] Lucas Mann  “A $p$-Adic 6-Functor Formalism in Rigid-Analytic Geometry”, 2022  arXiv:2206.02022
  * [Ols16] Martin Olsson  “Algebraic Spaces and Stacks” 62, Colloquium Publications  American Mathematical Society, 2016
  * [Pap23] Mihran Papikian  “Drinfeld Modules” 296, Graduate Texts in Mathematics  Springer, 2023
  * [Stacks] The Stacks Project Authors  “The Stacks Project”, 2024  URL: https://stacks.math.columbia.edu
  * [Sun12] Shenghao Sun  “$L$-series of Artin stacks over finite fields”  In _Algebra & Number Theory_ 6, 2012, pp. 47–122
  * [Vri23] Sjoerd Vries  “On Newton’s identities in positive characteristic”, 2023  arXiv:2305.19850v3
  * [Vri23a] Sjoerd Vries  “Traces of Hecke operators on Drinfeld modular forms via point counts”, 2023  URL: https://urn.kb.se/resolve?urn=urn:nbn:se:su:diva-223837
  * [Vri24] Sjoerd Vries  “Traces of Hecke operators on Drinfeld modular forms for $\mathbb{F}_{q}[T]$” Forthcoming, 2024


# Need is All You Need: Homeostatic Neural Networks Adapt to Concept Shift

Kingson Man
University of Southern California
<EMAIL_ADDRESS>
Antonio Damasio
University of Southern California
<EMAIL_ADDRESS>
Hartmut Neven
Google Inc.
<EMAIL_ADDRESS>

###### Abstract

In living organisms, homeostasis is the natural regulation of internal states
aimed at maintaining conditions compatible with life. Here, we introduce an
artificial neural network that incorporates some homeostatic features. Its own
computing substrate is placed in a needful and vulnerable relation to the very
objects over which it computes. For example, a network classifying MNIST
digits may receive excitatory or inhibitory effects from the digits, which
alter the network’s own learning rate. Accurate recognition is desirable to
the agent itself because it guides decisions to up- or down-regulate its
vulnerable internal states and functionality. Counterintuitively, the addition
of vulnerability to a learner confers benefits under certain conditions.
Homeostatic design confers increased adaptability under concept shift, in
which the relationships between labels and data change over time, and the
greatest advantages are obtained under the highest rates of shift. Homeostatic
learners are also superior under second-order shift, or environments with
dynamically changing rates of concept shift. Our homeostatic design exposes
the artificial neural network’s thinking machinery to the consequences of its
own "thoughts", illustrating the advantage of putting one’s own "skin in the
game" to improve fluid intelligence.

##  1 Introduction

To paraphrase Heraclitus, "The only constant in life is change". This
observation goes a long way towards explaining why the performance of trained
systems often degrades over time. The real world is non-stationary; the rules
and relationships learned today may no longer hold tomorrow. Un-learning the
bad old rules, re-learning the good new ones, and knowing how to tell the
difference remains a major challenge for learning machines. Here we are
inspired by the natural intelligence of living organisms, which maintain
themselves in the face of environmental change by following the dictates of
homeostasis.

Homeostasis is the regulation of internal body states within a range
compatible with life. In organisms capable of forming mental states, feelings
are the mental expression of these internal viability states (see Carvalho and
Damasio 2021; Damasio and Carvalho 2013). It has been proposed that (a)
machines that implement a process resembling homeostasis could be designed to
exhibit a feeling-like device for the motivation and evaluation of their
behavior and that (b) equipping an artificial learner with a feeling-like
device might improve its adaptiveness to the inconstant data streams of the
real world (Man and Damasio 2019).

Our approach diverges from traditional conceptions of artificial intelligence
that emphasize outward-directed perception and abstract problem solving. We
regard high-level cognition as an outgrowth of resources that originated to
solve the ancient biological problem of homeostasis. A body is subject to
perennial risk and decay. Organisms do not take a neutral or value-free stance
towards information processing. Their actions have consequences for their own
well-being. In our perspective, sense-data become meaningful when the data are
connected to the maintenance and integrity of the sensing system.

Here we present a homeostatic neural network architecture based on a sketch by
(Man and Damasio 2020) in which a classifier is placed into a needful and
vulnerable relation to the objects over which it computes. By way of analogy,
the homeostat must learn to distinguish between cups of coffee and cups of
beer, while also needing to take a drink every so often to regulate its own
mental arousal. In this setting, accurate classification is desirable to the
agent itself because it guides decisions that can carry consequences for its
internal states.

##  2 Background

We begin by providing some background on related work in biologically inspired
mechanisms of self-regulation in neural networks.

###  2.1 Homeostatic features in neural networks

In biological brains, neurons must regulate their intrinsic excitability and
synaptic conductance to ensure stable network function (Marder and Goaillard
2006). In artificial neural networks, and especially in those containing
recurrent connections, homeostatic regulation of excitability can reduce
saturation and improve signal propagation (Williams and Noble 2007). In
simulation experiments of evolutionary robotics, which made explicit reference
to homeostasis, phototactic robots were controlled by a fully connected neural
network and used ‘neural plasticity’ to restore adaptive behavior following
visual field inversion (Di Paolo 2000; Iizuka and Di Paolo 2008).

We note, however, that the homeostatic-like features of prior work, where
present, were implemented from the outside-in: the systems were instructed to
maximize, or keep within a set range, certain arbitrary values that were
labeled "homeostatic". There was no obligatory link between external
conditions and internal parameters. The operation of the system itself was not
exposed to the consequences of the system’s own activities, that is, it was
not made vulnerable. At best, a simulated population was culled by the
designer’s fitness function, a fact that was not appreciated by the simulated
agents themselves.

###  2.2 The problem of concept shift

A major challenge in machine learning is dataset shift, in which learners fail
to generalize because the training and testing data are drawn from different
distributions. A severe variant of dataset shift is concept shift (we follow
the terminology of Moreno-Torres et al 2012; see also Widmer and Kubat 1996;
Tsymbal 2004; Kull and Flach 2014), in which the relationships between labels
and attributes can change over time.

Under concept shift, the associations between labels $y$ and observations $x$
change across the training and testing phases: $P_{train}(y|x)\neq
P_{test}(y|x).$ (The observations, however, are drawn from the same
distribution across training and testing: $P_{train}(x)=P_{test}(x)$)

This type of phenomenon occurs frequently in real world settings of online
supervised learning – especially in social settings. As rapidly as fashions
and trends can change, recommender systems must stay ccurrent and serve the
same user’s new tastes. As another example, at the onset of a global pandemic,
an entire demographic previously well-served by travel ads may suddenly be
better served by ads for home furnishings.

We may also compare the problem of concept shift to the problem of lifelong
learning. In lifelong learning a system must sequentially learn to perform
multiple different tasks (see Thrun 1998; Chen and Liu 2018). New tasks often
interfere with earlier tasks, leading to poor performance or even
"catastrophic forgetting". One biologically inspired method around this
problem reduced the learning rate of neurons that were found to be important
in learning previous tasks, leaving the other neurons free to pick up new
tasks (Kirkpatrick et al 2017). Under concept shift, on the other hand, some
forgetting is not catastrophic but rather desirable and necessary.

##  3 Homeostatic architecture of needful neural networks

One way of explaining our homeostatic design is to say that it exposes an
artificial neural network’s thinking machinery to the consequences of its own
"thoughts". This incentivizes the network to regulate itself to think better –
to become better aligned with reality and to adapt to external change.

Figure 1: Algorithm: Pseudocode for homeostatic self-regulation of learning
rate.

###  3.1 Classifications with consequences

A homeostatic learner is given the task of classifying images of objects. In a
twist, the learner is designed to be needful – it depends on the objects that
it classifies for its continued integrity and functionality. The objects can
have direct effects, excitatory or inhibitory, on the learner itself. For
example, in a classification of MNIST digits, the digits {0,1,2,3,4} have
inhibitory effects and reduce the neural network’s learning rate, while the
digits {5,6,7,8,9} have excitatory effects and increase the neural network’s
learning rate.

Critically, following classification of an object, the learner decides to
either take it or leave it, that is, it can choose to either "ingest" or
reject the recognized digit, and therefore to regulate its own learning rate.
The agent must answer a question akin to "How does this object make me feel?"
We use a counterfactual decision process to answer a related question, "How
would my own functionality be affected by taking or leaving this object?" This
introduces a homeostatic meta-task to secure the internal conditions under
which the learner can perform the ostensible task of image classification. The
learner assesses the desirability of each alternative by evaluating each
version of itself against a store of recently seen objects and their labels
(Fig. 1).

With its own skin in the game, the homeostatic learner naturally chooses the
course of action that best improves its classification ability. This
arrangement sets up a "strange loop" (Hofstadter 2007) of causality in which
accurate classification is desirable to the classifier itself. Mis-
identification of an object can lead to mis-prediction of the object’s effects
on the learner. The learner is therefore incentivized to improve performance,
especially during times of great change – and great peril.

###  3.2 The vicissitudes of life

As so often happens in life, the rules have a way of changing on you. We
introduce concept shift to the dataset by permuting labels on a subset of the
data. When a shift occurs, we randomly select two of the 10 classes and swap
their labels for all instances in the data. For example, in the MNIST dataset,
we may swap the labels for "zero" and "nine", such that all images of a large
vertical oval (0) are now labelled "nine", and all images of a small circle
with a line hanging off of its right (9) are now labelled "zero" (Fig. 2).
Note that in this swap, the homeostatic effects of the digits have been
inverted. Images that were previously associated with inhibitory effects
(image 0 $\to$ label "zero" $\to$ inhibitory) are now excitatory (image 0
$\to$ label "nine" $\to$ excitatory), and vice versa.

Figure 2: Concept shift is implemented by swapping the mapping between label
and image between two randomly selected classes. Illustrated here on the MNIST
dataset, the mappings for “zero” and “nine” are swapped. This swap will also
invert the homeostatic effects expected for each number – a potentially
hazardous situation for a vulnerable classifier.

##  4 Experiments

We perform empirical studies to compare homeostatic regulation of learning
rate (LR) against two control conditions: a randomly regulated “wandering”
learning rate, and a more conventional, constant learning rate. We
characterize the conditions under which homeostatic regulation either imposes
an overhead cost and a performance penalty, or else allows a learner to
smoothly adapt to changing conditions.

All classification studies are performed with a multilayer perceptron with two
hidden layers containing 80 and 60 units respectively, using the ELU
activation function (Clevert et al 2015) and He initialization (He et al
2015). We evaluate our method on two datasets, MNIST (Lecun et al 2010) and
Fashion-MNIST (Xiao et al 2017). All experiments were performed in MATLAB and
the source code is provided in the Appendix.

###  4.1 The homeostatic learner adapts to concept shift

Testing across a wide range of rates of concept shift, measured in swaps
performed per epoch of training, we find that in the stationary setting (no
swapping) the conventional, constant-LR classifier is most accurate (Fig. 3,
red traces in left columns). However, the homeostatic learner is only
marginally less accurate than the constant-LR learner up to about 10 swaps per
epoch (Fig. 3, blue traces). The ability of the homeostat to nearly match the
constant-LR classifier’s performance is remarkable because the homeostat
starts with a seeming disadvantage: it is vulnerable to its own mistakes. The
homeostat’s incorrect classifications can compound into poor decisions that
impair future performance. Illustrating how badly things could have gone for
the homeostat, the randomly regulating LR classifier (green traces) quickly
goes off the rails and shows large variance across replicates.

Figure 3: Homeostatic learners incur some performance penalty in environments
with no or low concept shift, but are far superior under conditions of highest
shift. Color-coded validation accuracies of learners with their learning rates
homeostatically regulated (blue), randomly regulated (green), and held
constant (red). Traces show mean +/- SEM over 20 replicates.  Figure 4:
Keeping the same conventions as in Fig. 3, omitting the random-LR learner for
clarity. Left, in the stationary environment the homeostat performs slightly
below the constant-LR learner. Right, the homeostat is far more accurate than
the constant-LR learner under severe concept shift. Note the difference in
ordinate scales across charts. Figure 5: Accuracies by classifier type. Left,
At high rates of concept shift – the green and blue traces – there is a large
drop in accuracy for the constant-LR classifier. Right, The homeostat exhibits
better adaptation to concept shift, with less marked declines of the green and
blue traces.

The benefits of the homeostatic architecture become apparent at the highest
intensities of concept shift (Fig. 3, right columns). At the extreme of 500
swaps per epoch – in which the learner experiences a digit/label swap every
100 digit presentations – the constant-LR classifier is swamped by change and
falls to near chance level. The homeostat, on the other hand, continues to
learn and improve despite the onslaught of environmental change. The contrast
between homeostatic and static LRs, under high concept shift, is even more
stark when omitting the high-variance traces of the random learner (Fig. 4).

For another view into the data, we group accuracies by learner type,
illustrating the declines in performance with increasing rates of concept
shift (Fig. 5). The homeostat shows more graceful declines in comparison to
the constant-LR learner.

###  4.2 Homeostatic LR regulation is responsive to the prevailing rates of
concept shift

The homeostat tunes its learning rate to a level specific to the environment
in which it finds itself (Fig. 6). All learning rates are initialized at the
same value (0.005) but the homeostat seeks a level appropriate to the
experienced rate of concept shift. For the random LR regulators, on the other
hand, the sequence of learning rates is insensitive to shift rates and shows a
lower-bounded random walk that drifts upward.

Figure 6: Learning rate sequencies of the two LR-regulating classifiers. The
homeostatic learner seeks an LR appropriate to each level of concept shift,
while the random regulator drifted upwards. At 500 swaps per epoch (left,
blue), the homeostat arrests its own LR growth and asymptotes. Data shown from
MNIST only.

###  4.3 The homeostatic learner adapts to second-order shifts, or
"seasonality"

Encouraged by the ability of the homeostat to seek out a learning rate
appropriate to the prevailing rate of concept shift, we created learning
environments with seasonality, in which the rate of concept shift can vary
over the course of training. We find that the homeostat maintains the best
average performance across "calm" and "stormy" seasons, and rapidly recovers
after the onset of a stormy period (Fig. 7).

Figure 7: Accuracy and learning rate under “seasonality” of concept shift. Top
row: Schedule A cycles between extreme rates of concept shift, while schedule
B is more gradual. Middle row: The homeostat maintains good average
performance across shifts in the rate of concept shift. The accuracy of the
constant-LR classifier declines precipitously during stormy periods but
returns to normal during calm periods. Bottom row: The sequence of learning
rates reveals that the homeostatic learner ratchets up its learning rate
during stormy periods but is far less inclined to reduce it during calm
periods.

This pattern may be explained by the homeostat’s LR sequences under seasonal
training. The homeostat rapidly ramps up LR during stormy periods but tends to
hang on to these gains; it does not lower LR during the return to a calm
period (Fig. 7, bottom). This refractory behavior of persistently elevated LR
may lead to relatively poor performance in the calm periods following seasonal
cycles (e.g., the blue traces in the final 20 epochs).

##  5 Discussion

To summarize, we show that: 1) homeostatic learners are superior to
conventional learners under concept shift, with the greatest advantage
obtained under the greatest rates of shift; 2) homeostatic regulation imposes
a slight performance penalty under static and low-shift environments; 3)
homeostatic learners tune their learning rate in accordance with environmental
conditions; and 4) homeostatic learners can adapt to second-order shift, or
changes in the rate of environmental change. Although we find these converging
results across the MNIST and Fashion-MNIST datasets we note that one possible
limitation on the scope of our claims is the use of only these two datasets,
each being somewhat limited in visual complexity and image size.

Another possible limitation is the re-use of training data over many epochs,
which limits the fundamental novelty of the concept shift. Although the labels
and data are repeatedly shuffled, the classifier is never asked to learn from
never-before-seen image patterns. In the real world, concept shift often co-
occurs with some level of covariate shift. Not only do relationships change
over time, but the predictors change as well.

Although our method can dynamically adjust the learning rate, we did not
benchmark it against LR optimizers such as ADAM (Kingma and Ba 2014) and other
momentum-based methods. In the non-stationary setting the loss surface shifts
over time and it is therefore inappropriate to accumulate previous gradients
from an outdated loss surface. However, see (Kobayashi 2021) for a momentum-
based optimizer in the non-stationary setting, showing some mixed results
compared to ADAM.

Finally, we are aware of the resemblance between reinforcement learning and
our task of homeostatic self-regulation, though we argue that they should not
be identified as the same. The objective here is not to maximize some
arbitrary “reward” by massed trial-and-error. The object of the game is simply
to keep playing the game. We specify a particular target for a learner to
optimize: its homeostatic well-being, crystallized as an internal parameter
that controls its ongoing ability to make good decisions, which affect an
internal parameter that controls its ongoing ability to make good decisions…
and so on. For an excellent example of work in reinforcement learning that
does take homeostatic logic into account see (Keramati and Gutkin 2014).

We close with some ethical considerations of our work. Robots optimized for
self-preservation – what could possibly go wrong? The proposal of (Man and
Damasio 2019) considers a solution to the possible problems of imbuing
machines with feelings of self-interest: provide them with more feelings, so
that they can comprehend the feelings of self-interest of others, in other
words, so that they can have empathy. Considering present reality, our work
has the potential to improve recommender systems such that they can be
exquisitely attuned to our changes in moods, tastes, and fashions. These could
clearly generate economic benefits, but there is also the potential for such
skilled systems to insult the human experience of free choice and self-
determination. A person may desire to “escape the algorithm” and try to zig
instead of zag – only to quickly end up back in the clutches of their
attentive machines.

## Acknowledgments and Disclosure of Funding

We gratefully acknowledge funding to KM and AD from Google and from the
National Science Foundation under Grant No. IIS-2033961.

## References

Carvalho GB, Damasio A. Interoception and the origin of feelings: A new
synthesis. BioEssays. 2021;2000261.

Chen Z, Liu B. Lifelong machine learning. Synthesis Lectures on Artificial
Intelligence and Machine Learning. 2018;12(3):1-207.

Clevert DA, Unterthiner T, Hochreiter S. Fast and accurate deep network
learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289.
2015.

Damasio A, Carvalho GB. The nature of feelings: evolutionary and
neurobiological origins. Nature Reviews Neuroscience. 2013;14(2):143-52.

Di Paolo EA. Homeostatic adaptation to inversion of the visual field and other
sensorimotor disruptions. 2000.

He K, Zhang X, Ren S, Sun J. Delving deep into rectifiers: Surpassing human-
level performance on imagenet classification. In: Proceedings of the IEEE
international conference on computer vision 2015 (pp. 1026-1034).

Hofstadter DR. I am a strange loop. Basic books; 2007.

Iizuka H, Di Paolo EA. Extended homeostatic adaptation: Improving the link
between internal and behavioural stability. In: International Conference on
Simulation of Adaptive Behavior 2008 Jul 7 (pp. 1-11).

Keramati M, Gutkin B. Homeostatic reinforcement learning for integrating
reward collection and physiological stability. eLife. 2014;3:e04811.

Kingma DP, Ba J. Adam: A method for stochastic optimization. arXiv preprint
arXiv:1412.6980. 2014.

Kirkpatrick J, Pascanu R, Rabinowitz N, Veness J, Desjardins G, Rusu AA, Milan
K, Quan J, Ramalho T, Grabska-Barwinska A, Hassabis D. Overcoming catastrophic
forgetting in neural networks. Proceedings of the National Academy of
Sciences. 2017;114(13):3521-6.

Kobayashi T. Towards deep robot learning with optimizer applicable to non-
stationary problems. In: 2021 IEEE/SICE International Symposium on System
Integration (SII) 2021 (pp. 190-194).

Kull M, Flach P. Patterns of dataset shift. In: First International Workshop
on Learning over Multiple Contexts (LMCE) at ECML-PKDD 2014.

LeCun Y, Cortes C, Burges CJC. The MNIST database of handwritten digits.
http://yann.lecun.com/exdb/mnist/, 1994.

Man K, Damasio A. Homeostasis and soft robotics in the design of feeling
machines. Nature Machine Intelligence. 2019;1(10):446-52.

Man K, Damasio A. Truth or Consequences: Homeostatic Self-Regulation in
Artificial Neural Networks. In: Artificial Life Conference Proceedings 2020
(pp. 146-147).

Marder E, Goaillard JM. Variability, compensation and homeostasis in neuron
and network function. Nature Reviews Neuroscience. 2006;7(7):563-74.

Moreno-Torres JG, Raeder T, Alaiz-Rodríguez R, Chawla NV, Herrera F. A
unifying view on dataset shift in classification. Pattern Recognition.
2012;45(1):521-30.

Thrun S. Lifelong learning algorithms. In: Learning to learn 1998 (pp.
181-209).

Tsymbal A. The problem of concept drift: definitions and related work.
Computer Science Department, Trinity College Dublin. 2004;106(2):58.

Widmer G, Kubat M. Learning in the presence of concept drift and hidden
contexts. Machine Learning. 1996;23(1):69-101.

Williams H, Noble J. Homeostatic plasticity improves signal propagation in
continuous-time recurrent neural networks. Biosystems. 2007;87(2-3):252-9.

Xiao H, Rasul K, Vollgraf R. Fashion-mnist: a novel image dataset for
benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747.
2017.