Counting abelian varieties over finite fields via Frobenius densities

Let $[X,\lambda]$ be a principally polarized abelian variety over a finite field with commutative endomorphism ring; further suppose that either $X$ is ordinary or the field is prime. Motivated by an equidistribution heuristic, we introduce a factor $\nu_v([X,\lambda])$ for each place $v$ of $\mathbb Q$, and show that the product of these factors essentially computes the size of the isogeny class of $[X,\lambda]$. The derivation of this mass formula depends on a formula of Kottwitz and on analysis of measures on the group of symplectic similitudes, and in particular does not rely on a calculation of class numbers.


INTRODUCTION
Let [X, λ] ∈ A g (F q ) be a principally polarized g-dimensional abelian variety over the finite field F q = F p e . Its isogeny class I([X, λ], F q ) is finite; our goal is to understand the (weighted by automorphism group) cardinality #I([X, λ], F q ).
A random matrix heuristic might suggest the following. Let f X/F q (T) be the characteristic polynomial of Frobenius of X. It is well-known that f X/F q (T) ∈ Z[T]. Following Gekeler [Gek03], for a rational prime ℓ ∤ p disc( f ), one can define a number (1.1) ν ℓ ([X, λ], F q ) = lim n→∞ #{γ ∈ GSp 2g (Z ℓ /ℓ n ) : charpoly γ (T) = f X/F q (T) mod ℓ n } # GSp 2g (Z ℓ /ℓ n )/#A GSp 2g (Z/ℓ n ) , where GSp 2g is the group of symplectic similitudes of a symplectic space of dimension 2g, and A GSp 2g is the space of characteristic polynomials of these similitudes.
For ℓ ∤ p disc( f ), in which case the conjugacy class is determined by the characteristic polynomial (cf. Lemma 3.1), we interpret ν ℓ [X, λ] as the deviation of the size of the conjugacy class with characteristic polynomial f X/F q (T) from the average size of a conjugacy class in GSp(Z ℓ ).
Careless optimism might lead one to hope that #I([X, λ], F q ) is given by the product of the average archimedean and p-adic masses with the local deviations: (1.2) This argument is (at best) superficially plausible. Nonetheless, in this paper we give a purethought proof of the following theorem: 1 Theorem A. Let [X, λ] be a principally polarized abelian variety over F q with commutative endomorphism ring. Suppose that either X is ordinary or that F q = F p is the prime field. Then Here dim(A g ) = g(g+1) 2 and τ T is the Tamagawa number of the algebraic torus associated with [X, λ] in §2.1.
As we have mentioned, this formulation is inspired by [Gek03], in which Gekeler proves Theorem A for an ordinary elliptic curve E over a finite prime field F p . (In the case g = 1 considered by Gekeler, τ T equals 1.) Roughly speaking, the strategy there is to compute the terms ν ℓ explicitly, and show that the right-hand side of (1.3) actually computes, via Euler products, the value at s = 1 of a suitable L-function. One concludes via the analytic class number formula and the known description of the isogeny class I(E, F q ) as a torsor under the class group of the quadratic imaginary order attached to the Frobenius of E. This strategy was redeployed in [AW15] and [GW19] for certain ordinary abelian varieties.
More recently, in [AG17], the first-and last-named authors showed directly that the right-hand side of (1.3) actually computes the product of the volume of a certain (adelic) quotient and an orbital integral on GL 2 . Thanks to the work of Langlands [Lan73], and Dirichlet's class number formula, one has a direct proof that this product computes the size of the isogeny class of the elliptic curve.
In fact, this formula of Langlands, originally developed to count points on modular curves over finite fields, has been generalized by Kottwitz to an essentially arbitrary Shimura variety of PEL type [Kot92]. Kottwitz's formula (see Proposition 2.1 below), as in the case of Langlands, comes as a product of an (adelic) volume of a torus and an orbital integral, this time over GSp 2g . Let us remark that although the orbital integral in Kottwitz's and Langlands' formulas clearly decomposes as a product of local terms, the volume term, however, appears as a global quantity (a class number in the case of GL 2 , cf. Lemma A.4 of [AG17]). Therefore an Euler product expression for #I([X, λ], F q ) such as the one in (1.3) is, at least, not immediate.
The content of the present paper is to prove that the Euler product given by the right-hand side of (1.3) is indeed equal to the product of the global volume and the orbital integral given by Kottwitz's formula. We establish this by a delicate analysis of the interplay between various measures on the relevant spaces. This paper is the logical extension of [AG17], which worked out these details for the case where the governing group is GSp 2 = GL 2 . The reader will correctly expect that the structure of the argument is largely similar. However, the cohomological and combinatorial intricacies of symplectic similitude groups in comparison to general linear groups -in particular, the tori are much more complex and conjugacy and stable conjugacy need not coincide -mean that each stage is considerably more involved.
We highlight three particular issues that make the generalization from elliptic curves to higher rank not straight-forward.
The first is already mentioned above -the difference between conjugacy and stable conjugacy in GSp 2g when g > 1. This issue is discussed in detail in Section 3, and leads to the definition 4.1, which (as we prove in Section 3) coincides with (1.1) when ℓ ∤ p disc( f ).
The second is the fundamental lemma for base change, which is used to relate a Gekeler-style ratio at p to the twisted orbital integral. The complicated function one generally gets as a result of base change is the reason we have to assume that X is ordinary if q = p; this is discussed in detail in 4.3.
The last is that the tori in GSp 2g for g ≥ 2 are significantly more complicated than those for g = 1. The global calculation in Section 5 reflects this complexity, and involves the Tamagawa number of the algebraic torus T. This number is well-known to be 1 for g = 1, but for general g we have to leave it as an (unknown) constant; Thomas Rüd and (independently) Wen-Wei Li obtained suggestive partial results and kindly agreed to present them in Appendix A.
Perhaps not surprisingly, (1.3) can also be interpreted as a Smith-Minkowski-Siegel type mass formula (in the sense of Tamagawa-Weil) with explicit local masses (cf. [GY00]). Here the underlying group, of course, is GSp 2g and the masses calculate sizes of the relevant isogeny classes. Although this point of view is interesting in its own right we do not pursue it further in this paper. We would, however, like to note that the appearance of Tamagawa numbers is natural in this context.
The present work is, of course, part of a long and thriving discourse on the size of isogeny classes of abelian varieties over finite fields. Deuring computes the size of an isogeny class of elliptic curves as a class number [Deu41] . Waterhouse reinterprets and extends Deuring's work to a much larger class of abelian varieties [Wat69]. The key point in his study is to consider separately the ℓprimary components of the kernel of an isogeny, and model them using the various Tate modules (for ℓ prime to the characteristic) and the Dieudonné module. Both of these approaches have been revisited and enhanced in recent times. Yu (and collaborators) have undertaken a detailed analysis of, for example, the number of supersingular abelian varieties over finite fields; their answers are often expressed in terms of a mass formula which comes from a local lattice-theoretic perspective on the isogeny problem (e.g., [XY21,Yu12]). In a somewhat different direction, Marseglia [Mar21] and Howe [How20] are often able to express the size of an isogeny class of principally polarized abelian varieties as a sum of suitably generalized class numbers.
In the approach taken here, the orbital integral in the Langlands-Kottwitz formula (Proposition 2.1) does the work of assimilating information from the different local lattice calculations. Class numbers necessarily arise from our formula, but are not built-in; see §6 for this emergence.
If K is a field, α ∈ G(K), and Γ ⊆ G(K), we let Γ α = {β −1 αβ : β ∈ Γ} be the orbit of α under Γ. Since G has simply connected derived group, the stable conjugacy class, or stable orbit, of α is those elements of G(K) which are conjugate to α as elements of G(K) ([Kot82, p.785]).
2. BACKGROUND 2.1. The Kottwitz formula. The key formula we need is developed by Kottwitz in [Kot92]. In fact, the special case we need is detailed in [Kot90,Sec. 12]. By way of establishing necessary notation, we review the relevant part of this work here.
Let A g denote the moduli space of principally polarized abelian varieties of dimension g. An isogeny between two principally polarized abelian varieties [X, λ], [Y, µ] ∈ A g (F q ) is an isogeny φ : X → Y such that mφ * µ = n · λ for some nonzero integers m and n. The isogeny class I([X, λ], F q ) is the set of all principally polarized abelian varieties [Y, µ]/F q admitting such an isogeny (over F q ), and its weighted cardinality is The abelian variety X/F q admits a Frobenius endomorphism ̟ X/F q , with characteristic polynomial f X/F q (T) of degree 2g. (By [Tat66], this polynomial determines the isogeny class of X as an unpolarized abelian variety.) For each ℓ = p, H 1 (X F q , Z ℓ ) (the dual of the Tate module) is a free Z ℓ -module of rank 2g, endowed with a symplectic pairing ·, · λ induced by the polarization. The Frobenius endomorphism ̟ X/F q induces an element γ X/F q ,ℓ ∈ GSp(H 1 (X F q , Z ℓ ), ·, · λ ), and thus an element of G(Z ℓ ), well-defined up to conjugacy. Moreover, there is an equality of characteristic polynomials f γ X/Fq,ℓ (T) = f X/F q (T). Simultaneously considering all finite primes ℓ = p, we obtain an adelic similitude γ [X,λ] ∈ G(A p f ). (Alternatively one can, of course, directly consider the action of Similarly, the crystalline cohomology group H 1 cris (X, Q q ) is endowed with an integral structure H 1 cris (X, Z q ) and a σ-linear endomorphism F. It determines, up to σ-conjugacy, The e th iterate of F is linear, and in fact F e is the endomorphism of H 1 cris (X, Q q ) induced by ̟ X/F q . Let T [X,λ] /Q represent the automorphism group of [X, λ] in the category of abelian varieties up to Q-isogeny. Concretely, the polarization λ induces a (Rosati) involution ( †) on End(X) ⊗ Q; and for each Q-algebra R, we have By Tate's theorem [Tat66], for ℓ = p, T [X,λ] (Q ℓ ) ∼ =G γ X/Fq,ℓ (Q ℓ ), the centralizer of γ X/F q ,ℓ , and T [X,λ] (Q q ) ∼ =G δ X/Fq σ (Q p ), the twisted centralizer of δ X/F q in G(Q q ).
A direct analysis of the effect of isogenies on the first cohomology groups of abelian varieties then shows: Kot90]). The weighted cardinality of the isogeny class of [X, λ] (2.1) In the orbital and twisted orbital integrals in (2.1), we choose the Haar measures on G which assign volume 1 to G(Ẑ p ) and to G(Z q ), respectively. The choice of measure on T does not matter here, as long as the same measure is used to calculate the global volume. We define the specific measure on T in §5. It coincides with the canonical measure at all but finitely many places.
well-defined up to G(Q)-conjugacy, such that γ X/F q ,0 and γ X/F q ,ℓ are conjugate in G(Q ℓ ). Similarly, γ X/F q ,0 and N δ X/F q are conjugate in G(Q q ), where N denotes the norm map In particular, the characteristic polynomial of γ X/F q ,0 is f X/F q (T). In fact, by adjusting δ X/F q in its twisted conjugacy class, we henceforth can and will assume that [Kot82,p.206]. Then the group variety T [X,λ]/F q is isomorphic to the centralizer of N(γ X/F q ,0 ) in G.
It turns out that moreover, one can find a rational element γ 0 ∈ G(Q) such that γ 0 is G(Q ℓ )conjugate to γ X/F q ,ℓ for every ℓ = p (see [Kis17,p.889]). Consequently, in (2.1) we could replace γ X/F q with a global object γ 0 ; but we will never use this fact in this paper.
In the remainder of this paper we fix a principally polarized abelian variety [X, λ]/F q with commutative endomorphism ring End(X). (For example, any simple, ordinary abelian variety necessarily has a commutative endomorphism ring [Wat69, Thm. 7.2].) By Tate's theorem, the commutativity of End(X) is equivalent to the condition that T [X,λ] is a maximal torus in G.
To ease notation slightly, we will write δ 0 and T for δ X/F q and T [X,λ] , respectively. If ℓ is a fixed, notationally suppressed prime, we will sometimes write γ 0 for γ X/F q ,ℓ ; by Remark 2.2, one may equally well let γ 0 be the image of some choice γ 0 in G(Q) (though we will not be using it).
2.2. Structure of the centralizer. For future use, we record some information about the centralizer T = T [X,λ] . Recall that X is a g-dimensional abelian variety with commutative endomorphism ring. Then T is a maximal torus in G, and K := End(X) 0 = End(X) ⊗ Q is a CM-algebra of degree 2g over Q. Then K is isomorphic to a direct sum K ∼ = ⊕ t i=1 K i of CM fields, and the Rosati involution on End(X) induces a positive involution a → a on K, which in turn restricts to complex conjugation on each component K i . Let K + ⊂ K be the subalgebra fixed by the positive involution. Then In general, if L is a field and M/L is a finiteétale algebra, let R M/L be Weil's restriction of scalars functor. The norm map N M/L induces a map of tori R M/L G m → G m , and the norm one torus is the kernel of this map: On points, we have Let T = T der × G m . It is not hard to write down an explicit isogeny α : T → T and a complementary isogeny β : T → T such that α • β is the squaring map. We choose the maps which, on points, are given by 2.3. The Steinberg quotient. Recall that we have fixed a maximal split torus T spl in G; let W be the Weyl group of G relative to T spl . Let T der spl = T spl ∩ G der , and let A der = T der spl /W be the Steinberg quotient for the semisimple group G der . It is isomorphic to the affine space of dimension r − 1 = g.
2.4. Truncations. Let ℓ be any finite prime (including ℓ = p). Let π n = π ℓ,n : Z ℓ → Z ℓ /ℓ n be the truncation map. For any Z ℓ -scheme X , we denote by π X n the corresponding map induced by π n . Given S n ⊂ X (Z ℓ /ℓ n ), we will often set The projection maps π G n extend to a somewhat larger set of similitudes. Let M(Z ℓ ) be the set of symplectic similitudes which stabilize the lattice V ⊗ Z ℓ ; Inside this set, for each d ≥ 0 we identify a subset Finally, let us denote by M(Z ℓ /ℓ n ) d the set Note that M(Z ℓ ) 0 = G(Z ℓ ), and in the last definition, the condition on the determinant is not vacuous even if d ≫ n, because it rules out the matrices of determinant zero.
With a certain amount of abuse, we introduce the following notion of "M(Z ℓ ) d -conjugacy": When n is small relative to d, truncations of M(Z ℓ ) d -conjugate elements might not be M(Z ℓ /ℓ n ) dconjugate (since, e.g., all the elements A ∈ M(Z ℓ ) satisfying Aγ = γ 0 A might project to 0 mod ℓ n ). Of course, this does not happen when n ≫ d. We also note that trivially, if γ ∼ M(Z ℓ ) d 0 γ 0 for some d 0 , then γ ∼ M(Z ℓ ) d γ 0 for all d ≥ d 0 . The analogous statement holds for γ ∈ G(Z ℓ /ℓ n ) as long as n ≫ d.

Measures and integrals.
As in [AG17], we need to explicitly work out the relationships between several different natural measures on the ℓ-adic points of varieties, especially groups and group orbits. The definitions introduced in [AG17, §3] (where a little more historical perspective is briefly reviewed) go through with minimal changes. We recall the relevant notation here.

Serre-Oesterlé measure:
In [Ser81, §3], Serre observed that for a smooth p-adic submanifold Y of Z m p of dimension d, there is a limit lim n→∞ |Y n |p −nd , where Y n is the reduction of Y modulo p n (in our notation, Y n = π n (Y)). Moreover, Serre pointed out that this limit can be understood as the volume of Y with respect to a certain measure, which is canonical. The definition of this measure for more general sets Y was elaborated on by Oesterlé [Oes82] and by Veys [Vey92]. We refer to this measure as the Serre-Oesterlé measure, and denote it by µ SO .

Measures on groups:
Once and for all, we fix the measure |dx| ℓ on the affine line A 1 Q ℓ to be the translation-invariant measure such that vol |dx| ℓ (Z ℓ ) = 1. Then there are two fundamentally different approaches to defining measure. The first is, for any smooth algebraic variety X over Q ℓ with a non-vanishing top degree differential form ω on it, one gets the associated measure |dω| ℓ on X (Q ℓ ). In particular, for a reductive group G, there is a canonical differential form ω G , defined in the greatest generality by Gross [Gro97]. This gives a canonical measure |dω G | ℓ on G(Q ℓ ). When G is split over Q, this measure has an alternative description using point-counting over the finite field (i.e., it coincides with Serre-Oesterlé measure µ SO G defined above): (2.5) This observation is originally due to A. Weil [Wei82], and is actually built into his definition of integration on adeles. Weil's classical observation is precisely what makes this paper possible. For groups, there is a second approach. Start with a Haar measure and normalize it so that some given maximal subgroup has volume 1. The choice of a "canonical" compact subgroup in this approach could lead to very interesting considerations (and is one of the main points of [Gro97]), but in our situation only one easy case is needed. For G(Q ℓ ), the relevant maximal subgroup is G(Z ℓ ); we denote such a Haar measure on G(Q ℓ ) by µ can G . Geometric measure on orbits: This is a measure constructed in [FLN10] on a fiber of the Steinberg map c : G → A G . Let ω G be a volume form on G, and let ω A be the volume form integrating ω geom c(γ) defines a measure µ geom on c −1 (c(γ)).
Suppose φ is a locally constant compactly supported function on G(Q ℓ ). Recall the family γ X/F q ,ℓ (and δ 0 ), whose centralizers are the sets of Q ℓ -points of the algebraic torus T := T [X,λ] . We use two different measures on the orbit G(Q ℓ ) γ X/F q ,ℓ ∼ =T [X,λ] (Q ℓ )\G(Q ℓ ) to define an integral. When ℓ is fixed, we will often denote the element γ X/F q ,ℓ by γ 0 ; we define µ Tama 3. CONJUGACY 3.1. Integral conjugacy. To relate the right-hand side of (2.1) to the ratios ν ℓ of (1.1), we interpret the orbital integral as the volume of the intersection of the Proof. The hypothesis on γ 0 implies that the centralizer G γ 0 is a smooth torus over Z ℓ , and thus the transporter from G γ to G γ 0 is smooth over Z ℓ (e.g., [Con14, Prop. 2.1.2]).
Nonetheless, the number of distinct orbits is bounded; and membership in G(Q ℓ ) γ 0 can be detected at a finite truncation level.
There exists an integer e = e(γ 0 ) such that, if n ≫ 0 and d > e, then for γ ∈ G(Z ℓ /ℓ n ), the following conditions are equivalent: Proof. We prove the original statement.
The intersection of G(Z ℓ ) with the G(Q ℓ )-orbit of γ 0 is a finite union of G(Z ℓ )-orbits, since it is compact (recall that γ 0 is regular semisimple) and the G(Z ℓ )-orbits are open in this intersection; let g 1 , ..., g s be representatives of these orbits, and let is the valuation of the discriminant of γ 0 , e ≥ e(γ 0 ), and n ≫ e. We want to prove that with these assumptions, an element γ ∈ G(Z ℓ /ℓ n ) satisfies One direction is easy: suppose there exists γ ∈ G(Z ℓ ) such that γ mod ℓ n = γ and γ ∼ G(Q ℓ ) γ 0 .
and satisfies the condition Zγ = π n (γ 0 )Z. The other direction is a special case of Hensel's lemma. Since Hensel's lemma in this generality, though well-known, is surprisingly hard to find in the literature, we provide a detailed explanation with references.
Since the core argument simply relies on the solvability, via Hensel's lemma, of a system of equa- Remark 3.3. We observe (though we do not need this observation in this paper) that n(γ 0 ) in fact equals the valuation of the discriminant of γ 0 , e.g. by the argument provided in [Kot05, §7.2].
If d = 0, this coincides with the usual conjugacy class of π n (γ 0 ). As in Section 2.4, let . We also extend this notation to elements γ 0 ∈ M(Z ℓ ): , the two notions coincide and thus there is no ambiguity.) Proof. This is a direct consequence of Lemma 3.2.
3.2. Stable (twisted) conjugacy. In this section, we further assume that [X, λ] is a principallypolarized abelian variety with commutative endomorphism ring for which 1/2 is not a slope of the Newton polygon of X. (Again, any ordinary simple principally polarized abelian variety satisfies these hypotheses.) Since K + p + is a field (and not just a Q p -algebra) of dimension 1 2 ht(X[p + ∞ ]), X[p + ∞ ] has at most two slopes. Since by hypothesis 1/2 is not a slope of X, X[p + ∞ ] has exactly two slopes, say λ = a/b and 1 − a/b, where gcd(a, b) = 1. Let m be the multiplicity of λ as a slope of X[p + ∞ ]; then mb = [K + p + : Q p ]. The endomorphism algebra of X[p + ∞ ] (again, in the category of p-divisible groups up to isogeny) is isomorphic to where the latter is embedded in the former via (id, inv).
Lemma 3.7. The stable conjugacy class of γ 0 consists of a single conjugacy class, and the stable σ-conjugacy class of δ 0 consists of a single σ-conjugacy class.
Proof. To prove the first claim, it suffices (by [Kot82,p.788]) to show that H 1 (Q p , T) vanishes. By taking the long exact sequence of cohomology of the top row of (2.3), and then invoking Hilbert 90 and Corollary 3.6, we find that H 1 (Q p , T) does in fact vanish.
For the second claim, it similarly suffices to show that the first cohomology of the twisted centralizer G δ 0 ,σ vanishes [Kot82,p.805]. However, the twisted centralizer of an element is always an inner form of the (usual) centralizer of its norm [Kot82, Lemma 5.8]. In our case, the centralizer T = G γ 0 is a torus, and thus admits no nontrivial inner forms. We conclude again that Definitions. For ℓ = p, we define a local ratio ν ℓ ([X, λ]) designed to measure the extent to which the conjugacy class of γ X 0 /F q , as an element of G(Z ℓ /ℓ), is more or less prevalent than a randomly chosen conjugacy class. More precisely, to measure this probability, we consider the finite group G(Z ℓ /ℓ n ) for sufficiently large n, and recall that our notion of "conjugacy" in this group is not the usual conjugacy but the relation ∼ M(Z ℓ /ℓ n ) e defined above in §2.4. For ℓ = p, the element γ X 0 /F q is not in G(Z p ), and we use M(Z p ) instead; but this has no effect on the definition since our notion of "conjugacy" in G(Z p /p n ) already uses M(Z p ).
Definition 4.1. For each finite place ℓ, including ℓ = p, using the shorthand γ 0 : At infinity, define where |·| ∞ is the usual real absolute value.
Remark 4.2. So far we have avoided using the fact that there exists a rational element γ 0 ∈ G(Q) as in Remark 2.2, and treated γ 0 as an element of G(A f ). We can continue doing so, and then for (4.2) simply define the archimedean absolute vaue of its discriminant by |D The ratios stabilize for large enough d and n, and thus the limits are not, strictly speaking, necessary. In fact, for ℓ = 2, p and not dividing the discriminant of γ 0 , the ratios stabilize right away, at d = 0 and n = 1, as the next two lemmas show.
4.2. From ratios to integrals. Fix a prime ℓ (possibly ℓ = p or ℓ = 2). (In this subsection, as above, all quantities depend on this notationally suppressed prime.) Recall (2.4) the canonical map c : G → A from G to its Steinberg quotient. The fibres of this map over regular points are stable orbits of regular semisimple elements. Define a system of neighbourhoods of c(γ 0 ) inside In other words, These definitions and (3.1) are summarized by the diagram is the map sending an element to the coefficients of its characteristic polynomial mod ℓ n . The diagram of maps commutes since reduction mod ℓ n is a ring homomorphism, and the map c is polynomial in the matrix entries of γ. (The diagram of subsets need not commute, though.) We also note that when ℓ = p, the sets C (d,n) (γ 0 ) and C (d,n) (γ 0 ) are contained in G(Z ℓ ) and G(Z ℓ /ℓ n ), respectively, since ord ℓ (det(γ 0 )) = 0 in this case, and this is also true for all elements that are congruent to any conjugate of γ 0 .
By definition of the geometric measure, for any open subset Recall that each stable orbit c −1 (c(γ)) is a finite disjoint union of rational orbits. Each rational orbit being an open subset of the stable orbit, we may and do define geometric measure on each rational orbit, by restriction.
In simple terms, the sets U n form a system of neighbourhoods of the point c(γ 0 ) ∈ A G ; the set C (d,n) (γ 0 ) can be thought of as the intersection of a neighbourhood of the orbit of γ 0 with G(Z ℓ ); the set c −1 (c(γ 0 )) is the stable orbit of γ 0 . The following lemma gives the precise relationships between all these sets.
where γ ′ runs over a set of representatives of G(Q ℓ )-conjugacy classes in the stable conjugacy class of γ 0 whose Q ℓ -orbits intersect G(Z ℓ ), so that we may take the elements γ ′ to lie in G(Z ℓ ). (b) When n is sufficiently large (depending on γ 0 ), the sets C d,n (γ ′ ) above are disjoint.
. This is an easy consequence of the fact that two regular semisimple elements of G(Q ℓ ) are stably conjugate if and only if their characteristic polynomials coincide. In our notation, where G(Q ℓ ) γ ′ denotes the rational conjugacy class of γ ′ in G(Q ℓ ) as before. Now, we will describe both the left-hand side and the right-hand side of (4.6) as: the set of elements γ ∈ G(Z ℓ ) whose characteristic polynomial is congruent to that of γ 0 mod ℓ n . Indeed, on the left-hand side, by definition, γ ∈ c −1 ( U n (γ 0 )) ∩ G(Z ℓ ) if and only if π A G n (c(γ)) = π A G n (c(γ 0 )). By the commutativity of (4.4), this is equivalent to c n (π G n (γ)) = c n (π G n (γ 0 )), i.e., the characteristic polynomials of γ and γ 0 are congruent modℓ n . On the right-hand side, given γ ′ ∈ G(Z ℓ ), by Lemma 3.2, for d and n large enough 1 , we have that γ ∈ C (d,n) (γ ′ ) if and only if there exists γ ′′ ∈ G(Z ℓ ) such that γ ′′ ≡ γ ′ mod ℓ n and γ ′′ is G(Q ℓ )-conjugate to γ. Taking the union of these sets as γ ′ runs over the set of integral representatives of G(Q ℓ )-conjugacy classes in the stable class of γ 0 , we obtain the set of all elements γ ∈ G(Z ℓ ) that are congruent modulo ℓ n to an element of G(Z ℓ ) that is stably conjugate to γ 0 , i.e., to an element having the same characteristic polynomial as γ 0 . This means that c n (π G n (γ)) = c n (π G n (γ 0 )), which completes the proof of the first statement.
(b). Since the orbits of regular semisimple elements are closed in the ℓ-adic topology, distinct orbits have disjoint neighbourhoods.
(c). The map π M n : can be thought of as a disjoint union of fibres of π M n . Since M is a smooth scheme over Z ℓ , each fibre of π M n has volume ℓ −n dim(G) with respect to the measure µ SO (cf. [Ser81]). The first statement follows. Moreover, as discussed above in §2.5, on G(Z ℓ ), the measures µ SO and µ |ω G | coincide. For ℓ = p, we have C (d,n) (γ 0 ) ⊂ G(Z ℓ ), which completes the proof.
Recall that φ 0 is the characteristic function of G(Z ℓ ).
Proof. The orbital integral, by definition, calculates the volume of the set of integral points in the rational orbit of γ 0 , with respect to the geometric measure on the orbit. Using Lemma 4.5(a)-(b) we write c −1 ( U n (γ 0 )) ∩ G(Z ℓ ) = ⊔ γ ′ C d,n (γ ′ ), where γ ′ are as in that lemma, with γ 0 being one of the elements γ ′ . The union on the right-hand side of (4.6) is a disjoint union of neighbourhoods of the individual orbits, intersected with G(Z ℓ ). The statement follows from the equality (4.5), applied to the set B := C d,n (γ 0 ).
Corollary 4.7. For ℓ = p, the Gekeler ratio (4.1) is related to the geometric orbital integral by Proof. Note that at a finite level n (and for d large enough so that the equalities in all the previous lemmas hold), the denominator in (4.1) is By Lemma 4.5(c), we have vol |dω G | ( C d,n (γ 0 )) = #C d,n (γ 0 )/ℓ n dim(G) , and by definition of the measure on the Steinberg quotient, vol |dω A | ( U n (γ 0 )) = ℓ −n rank(G) (here we are using the fact that |η(γ X,ℓ )| = 1 for ℓ = p, so the absolute value of the G m -coordinate is 1 on U n ).
Then for a given level n, we have The result now follows from Corollary 4.6.
4.3. Calculation at p. Recall that we have fixed a maximal split torus T spl ⊂ G. For any cocharacter λ ∈ X * (T spl ) (and any power q = p e of p), let ψ λ = ψ λ,q be the characteristic function of the double coset By the Cartan decomposition, the collection of all ψ λ is a basis for H G = H G,Q q , the Hecke algebra of functions on G(Q q ) which are bi-G(Z q )-invariant.
Suppose γ ∈ D a,p ⊆ G(Q p ). Then ord p (η(γ)) is the common value of a i + a g+i ; and γ stabilizes First, suppose X is ordinary. Then exactly g eigenvalues of γ are p-adic units. Consequently, if γ ∈ D a , then f (a) = g. The only a as in (4.7) compatible with the symmetry and integrality constraints is (e, · · · , e, 0, · · · , 0).
Second, suppose X has arbitrary Newton polygon but that e = 1. Again, the only a such that a i + a g+i = e = 1 and each a i ≥ 0 is (1, · · · , 1, 0, · · · , 0). Lemma 4.9. Suppose that [X, λ]/F q is an ordinary, simple, principally polarized abelian variety. Then Proof. There is a base change map b = b G,Q q /Q p : H G,Q q → H G,Q p . The fundamental lemma asserts that, if ψ ∈ H G,Q q , then stable twisted orbital integrals for ψ match with stable orbital integrals for bψ. For our δ 0 and γ 0 , the adjective stable is redundant (Lemma 3.7), the case of the fundamental lemma we need is [Clo90, Thm. 1.1], and we have (4.8) While we will stop short of computing bψ q,p , we will find a function which agrees with it on the orbit G(Q p ) γ 0 .
The Satake transformation is an algebra homomorphism S : H G,Q q → H T spl ,Q q which maps H G,Q q isomorphically onto the subring H W T spl ,Q q of invariants under the Weyl group. It is compatible with base change, in the sense that there is a commutative diagram We exploit the following data about the Satake transform and the base change map.
Under the canonical identification of X * (T spl ) and X * (T spl ), the character group of the dual torus, λ ∈ X * (T spl ) gives rise to a character ofT spl , and thus a representation V λ ofĜ; let χ λ be its trace.
We have If we think of elements of C[X * (T spl )] W as polynomials in 2g variables z 1 , . . . , z 2g , then (essentially by definition of the highest weight and the fact that the multiplicity of the highest weight in an irreducible representation is 1 -in our case the representation in question is in fact the oscillator representation [Gro98, (3.15)]) we find that the leading term of S(ψ µ 0 ,q ) is q µ 0 ,ρ z 1 . . . z g . By definition, the base change map takes f ∈ C[z 1 , . . . , z 2g , z −1 1 , . . . , z −1 2g ] W to f (z e 1 , . . . , z e 2g ). Then b(S(ψ q,p )) = q µ 0 ,ρ z e 1 . . . z e On the other hand, we have In these formulas, a(eµ 0 , λ), b(eµ 0 , λ) and c(eµ 0 , λ) are coefficients of lower weight monomials that are ultimately irrelevant to our calculation. In particular, φ q,p − S −1 (b(S(ψ q,p ))) vanishes on D eµ 0 ,p = G(Z p )eµ 0 (p)G(Z p ).
The last point to note is that the intersection of the support of this difference φ q,p − S −1 (b(S(ψ q,p ))) with the orbit of γ 0 is contained in M(Z p ). Once we have shown this, the desired result follows from the fundamental lemma (4.8) combined with Lemma 4.8. We start by observing that since the multiplier is a multiplicative map, it is constant on double G(Z p )-cosets. Therefore, for any double coset D a,p such that D a,p ∩ G(Q p ) γ 0 = ∅, we have a i + a g+i = e. Now suppose λ ↔ a is a dominant weight satisfying this condition and further satisfying λ ≤ eµ 0 . Then we have a 1 ≥ a 2 ≥ · · · ≥ a g and a g ≥ 0 because λ is dominant; and on the other hand, e − a 1 ≥ e − a 2 ≥ · · · ≥ e − a g , and e − a g ≥ 0 because of the condition λ ≤ eµ 0 . Therefore in particular, a g+1 , . . . , a 2g are non-negative, and thus D λ,p ⊂ M(Z p ) (and in fact, we have also shown that a 1 = · · · = a g ).

Lemma 4.10. Suppose that either X is ordinary or that q = p. Then there exists d(γ
Proof. Suppose that X is ordinary (but q is an arbitrary power of p). By Lemma 3.7, c −1 (c(γ 0 )) is a single G(Q p )-conjugacy class; the same argument shows this is true for elements in a small neighbourhood of c(γ 0 ). Thus, using (4.5), O . By Lemma 4.8, we have Therefore, all we need to show is that for large enough d and n, we have but this is essentially Corollary 3.4(b).
The case where q = p follows from Lemma 4.6 and the second case of Lemma 4.8.
Lemma 4.11. On the double coset D eµ 0 ,p we have Proof. Let K = G(Z p ). First, observe that the measure µ SO on G(Q p ) ∩ M(Z p ) is both left-and right-K-invariant (since multiplication by an element of G(Z p ) yields a bijection on modp npoints). Consider the decomposition of D eµ 0 ,p into, say, left K-cosets: D eµ 0 ,p = ⊔ s i=1 g i K (the number s of these cosets was computed by Iwahori and Matsumoto but is not needed here). It follows from left K-invariance of µ SO that µ SO (g i K) is the same for all i.
Second, the measure |dω G | is normalized so that each K-coset has volume #G(F p ). Thus, in order to compare the measures µ SO and |dω G |, we need to compare the cardinality #π n (g i K) of the reduction mod p n of any such coset g i K that is contained in D eµ 0 ,p with #G(F p ), for sufficiently large n. (Note that n = 1 is insufficient, because for all such cosets the reduction mod p of any matrix in gK would be of lower rank. One needs to go to n > e for the ratios #π n (gK) p n dim(G) to stabilize.) Since the answer does not depend on g i , we can take g 0 = eµ 0 (p) = diag(q, . . . , q, 1 . . . , 1). In other words, we need to compute the cardinality of the fibre of the map For simplicity, we would like to move the calculation to the Lie algebra. Let n ≫ e. Observe that if ϕ q (γ 1 ) = ϕ q (γ 2 ) for γ 1 , γ 2 ∈ G(Z/p n ), then qI g 0 0 I g (γ 1 γ −1 2 − I) = 0, where I g is the g × g-identity matrix, and I is the identity matrix in M 2g . This implies, in particular, that γ 1 γ −1 2 ≡ I mod p n−e . Then we can write the truncated exponential approximation: γ 1 γ −1 2 = I + X + 1 2 X 2 + . . . for some X ∈ g(Z p ); in particular, there exists X ∈ g(Z p ) such that γ 1 γ −1 2 ≡ I + X mod p 2(n−e) , and thus the kernel of the map ϕ q is in bijection with the set of (X mod p n ) for X ∈ g(Z p ) such that qI g 0 0 I g X ≡ 0 mod p n . We have g = sp 2g ⊕ z, where z is the 1-dimensional Lie algebra of the centre. It will be convenient to decompose it further: let h be the Cartan subalgebra of sp 2g consisting of diagonal matrices, and let V consist of matrices whose diagonal entries are all zero; then Consider the action of multiplication by qI g 0 0 I g on each term of this direct sum decomposition.
On the term z ⊕ h it acts by diag(a 1 , . . . , a 2g ) → diag(qa 1 , . . . , qa g , a g+1 , . . . , a 2g ), which in the z ⊕ hcoordinates can be written as (recalling that a i + a g+i = z is independent of i): The only points (z, a g+1 , . . . , a 2g ) that are killed (mod p n ) by this map are of the form (z ′ , 0, . . . , 0) with qz ′ = 0; so there are q of them.
Next consider an element X = A B C D ∈ V. Then A is determined by D, and B is skew-symmetric (up to a permutation of rows and columns). Multiplication by qI g 0 0 I g scales each entry of A and B by a factor of q, and does not change C and D. Since A is determined by D, the elements X killed by this map are in bijection with symmetric matrices B with entries in Z/p n that are killed by multiplication by q. Since the space of such matrices is a g(g + 1)/2-dimensional linear space, the number of such matrices B is q g(g+1)/2 . Thus, we have computed that |dω G | = q g(g+1) 2 +1 µ SO on the double coset D eµ 0 ,p . Combining this with (4.11), we get: which completes the proof.
Corollary 4.12. Suppose that either X is ordinary or that q = p. For ℓ = p, the Gekeler ratio (4.1) is related to the geometric orbital integral by Proof. First observe that vol |dω A | ( U n (γ 0 )) = qp −n rank(G) , since we are using the invariant measure on the G m -factor of A G = A rank(G)−1 × G m , and for γ 0 (and therefore, for all points in U n ), that coordinate is the multiplier, with absolute value q −1 . Thus, by Lemma 4.5 (c) and the same argument as in Corollary 4.7, we have that for d > d(γ 0 ), The ratio inside the limit on the right-hand side is the same as the ratio in Lemma 4.10, except that the measure in the numerator is the Serre-Oesterlé measure µ SO rather than the measure |dω G |. (Both measures are defined on G(Q p ) ∩ M(Z p ).) Thus, to prove the corollary, we just need to compute the conversion factor between the restrictions of the measures µ SO and |dω G | to the support of φ q,p , which is the content of Lemma 4.11.

THE PRODUCT FORMULA
Now that the relationship between the ratios ν ℓ and orbital integrals (with respect to the geometric measure) is established, we can translate the formula of Langlands and Kottwitz (2.1) into a Siegel-style product formula for the ratios, thus obtaining our main theorem. Recall the notation of §2, in particular, the element γ [X,λ] ∈ G(A f ) associated with the isogeny class of [X, λ], and its centralizer T = T [X,λ] . Here in order to ease the notation we drop all the subscripts [X, λ].
Note that there is some flexibility in the choice of the measures in the Langlands and Kottwitz formula, but the measures need to be normalized by normalizing the measures on G(Q ℓ ) and on T(Q ℓ ) separately. We will use the canonical measure dµ can G on G(Q ℓ ) for every prime ℓ, and the Tamagawa measure µ Tama T (defined in detail below) on T(Q ℓ ) for all ℓ. This gives a convergent product measure globally, since the local orbital integrals equal 1 at almost all places with respect to this measure. Since Gekeler-style ratios are expressed in terms of the geometric measure on orbits, we need to calculate the conversion factor between the geometric measure and the quotient µ can G /µ Tama T . We start with a quick review of the definition of µ Tama T in order to introduce all the relevant notation. 5.1. Tamagawa measure. Let S be an algebraic torus; here we only discuss the setting where S is defined over Q. The character group of S is the free Z-module X * (S) =Ŝ in Ono's notation (we emphasize that this is the lattice of the characters defined over Q). If F is any field containing Q, we let (Ŝ) F be the subgroup of characters of S which are defined over F.
As usual, we have S(A) and S(A f ), the points of S with values in, respectively, the ring of adeles and the ring of finite adeles. The (finite) adeles come equipped with the product absolute value |·| A , and we set Let F be a Galois extension which splits S. Then the character lattice X * (S) can be viewed as a Gal(F/Q)-module, and this module uniquely determines S up to isomorphism. We denote this representation by σ S , and let L(s, σ S ) = ∏ ℓ L ℓ (s, σ S ) be the corresponding Artin L-function (see [Bit11] for a modern treatment). Let r be the multiplicity of the trivial representation in σ S . By definition, Let ω be an invariant gauge form on S. (In particular, ω is defined over Q.) Set where ω ℓ is the invariant volume form on S(Q ℓ ) induced by ω.
By the product formula, as long as ω is defined over Q, none of the global invariants depend on the normalization of ω.
Let χ 1 , · · · , χ r be a basis for (Ŝ) Q , and define a map Λ by (In the cases of interest, when S = T der or S = T, we have r = 0 or r = 1, respectively.) Then Λ induces an isomorphismΛ (Of course, both sides are trivial if S is anisotropic.) Define dt by Let dS Q be the counting measure on S(Q). The Tamagawa measure on S(A) 1 defined by Ono [Ono61,(3.5.2)], (taking into account that in our case the base field denoted by k in [Ono61] is Q) is the measure µ Tama that makes the following equality true:

The Tamagawa number is defined by
We will also make use of the differential form on S that we denote by ω S (this notation agrees with that of [FLN10]). We define: where d is the rank of X * (S). This form is, a priori, defined over Q. However, in fact there exists D ∈ Q such that ω S / √ D is defined over Q. (see [GG99,Corollary 3.7]). Since |D|| ∏ ℓ |D| ℓ = 1, in fact we can use the form ω S instead of ω in the definition of the Tamagawa measure, even though it is not quite defined over Q. Specifically, we will from now on work with the form We denote the product over the finite primes by ω S, f , i.e., write ω Tama S = (ω S ) ∞ ω S, f ; the form ω S, f defines a measure on S(A f ), the set of points of S over the finite adeles. 5.2. The measure µ Tama vs. geometric measure. This section is based on [FLN10]. We recall that the measure on orbits that we call µ geom is constructed as a quotient of the measure |ω G | by the measure |ω A | on our space A G , which is a 'naïve version' of the Steinberg-Hitchin base (see [Gor20,§3.7] for a detailed comparison of the space A G , and the measure on it, with the actual Steinberg-Hitchin base that is used in [FLN10]).
Consider the measure on T defined by the form ω Tama T at every place (its only difference from the Tamagawa measure on T is in the global factor ρ T ). For every finite prime ℓ, let µ Tama γ ℓ be the measure on the orbit of γ ℓ in G(Q ℓ ) obtained as the quotient of the measure ω can on G that gives the maximal compact subgroup G(Z ℓ ) volume 1, by the measure |ω Tama The following proposition is an adaptation of the equality (3.31) of [FLN10] to our setting.
Proof. For γ ∈ G der , this is equivalent to the relation (3.31) of [FLN10]; the additional factor vol ω G (G(Z ℓ )) on the right appears here because in (3.31) of [FLN10], the same measure on G needs to be used on both sides of the equation; here we are using the measure |ω G | on the left, and the measure |ω can G | = |ω G |/ vol(G(Z ℓ )) on the right; so this correction factor is needed. More precisely, the relation (3.30) in [FLN10] (which we also reproved in §4.2.1 of [AG17]) asserts that for a semisimple group G, where ω T\G is the quotient of the measure ω G by the measure ω T on T defined above in §5.1, which is the same as the measure ω T in [FLN10]. Since by definition (and the remark at the end of §5.1 which allows us to use the form ω T in the definition of the Tamagawa measure), ω Tama T,ℓ = L ℓ (1, σ T )ω T,ℓ , this proves the Proposition for γ ∈ G der . For general γ, the factor |η(γ)| − g(g+1) 4 appears on the right-hand side because we are using the space A G instead of the Steinberg-Hitchin base of GSp 2g . This factor is calculated by considering the action of the centre of G on all the measure spaces involved. This is explained in detail in §3.7 of [Gor20].
Taking a product of these over all primes ℓ, and recalling the product formula for absolute values, we obtain: where O Tama γ stands for the product of orbital integrals in the Langlands-Kottwitz formula, with the measure on each factor given by ω Tama T,ℓ . Lemma 5.2.
vol ω Tama Proof. We start by emphasizing that while in the definition of the Tamagawa number, one starts with an arbitrary differential form defined over Q, since here we have split off the infinite places, the specific choice of the differential form matters. This choice (dictated by our calculations above, specifically, Proposition 5.1) is the form ω T of (5.2) (which is not defined over Q but can still be used, as discussed at the end of §5.1). From this form, we make the form ω Tama T = (ω T ) ∞ ω T, f as in (5.3). We need to identify explicitly the component at the infinite place of the form ω Tama T , which is the same as the component (ω T ) ∞ of the differential form ω T . We have a convenient basis for the character lattice of T, cf. §2.2. Define the coordinates (z 1 , . . . , z g , λ) on T(C) such that T(C) = {z 1 , . . . , z g , λz −1 1 , . . . , λz −1 g )}, and define the the characters χ i (z 1 , . . . , z g , z −1 1 , . . . , λz −1 g ) = z i , for i = 1, . . . , g, and the multiplier η(z 1 , . . . , z g , z −1 1 , . . . , λz −1 g ) := λ. (Note that in the Appendix, the character lattice of T is described as a quotient of Z 2g instead, which is convenient for the cohomology computations; we do not use this description here.) We write every element of T(A) as a = a f a ∞ , where a f has the infinity component 1 and a ∞ = (1, z 1 , . . . , z g , λ) has all the components at the finite places equal to 1. In this notation, T(A) 1 is defined by the condition |z i | = |λ| = a f −1/g . We note that the character η coincides with the mapΛ from T(A)/T(A) 1 to R + defined in §5.1. Then by the definition of µ Tama , it is the volume form on T(A) 1 given by and thus its component at ∞ is the form µ Tama It is an easy exercise (see [Gor20, (2.8)]) that the form dz/z gives precisely the arc length measure on the unit circle. Thus, we get: which completes the proof. Now we can complete the proof of the theorem. By the Langlands-Kottwitz formula (in which we choose the Tamagawa measure on T), we have On the other hand, by (5.5), we have It remains to recall that we have defined ν ∞ = |D(γ)| 1/2 (2π) g , and note that the Euler product for L(1, σ T/G ) is conditionally convergent and equals ρ T (cf. [FLN10,(3.25)]), since ρ G m = 1, the residue of the Riemann zeta-function at s = 1. Thus, which completes the proof.

COMPLEMENTS
For the convenience of a hypothetical reader interested in explicit calculations, we collect here some reminders concerning the terms which arise in (1.3).
), the product being over all roots of G. We may relate this to the (polynomial) discriminant of f X/F q (T), the characteristic polynomial of Frobenius, as follows.

Polynomial discriminants.
To facilitate comparison with [AW15, Gek03, GW19], we express D(γ 0 ) in terms of polynomial discriminants. Let f (T) = f X/F q (T), and let f + (T) = f + X/F q (T) be the minimal polynomial of the sum of γ 0 and its adjoint, so that Note that Q[T]/ f + (T) ∼ =K + , the maximal totally real subalgebra of the endomorphism algebra of X.
Proof. On one hand, On the other hand, Now use this to evaluate disc( f (T))/ disc( f + (T)), while bearing in mind that 6.2. ν ℓ . Gekeler [Gek03] observed that, for elliptic curves, his product formula essentially computes an L-function; a similar phenomenon has been observed in other contexts, as well [AW15,GW19]. We briefly explain how this relates to (1.3). This detour also has the modest benefit of showing that the right-hand side of (1.3) converges, albeit conditionally. Recall that to a torus S/Q one associates an Artin L-function L(s, σ S ) = ∏ ℓ L ℓ (s, σ S ). This construction is multiplicative for exact sequences of tori, and for a finite direct sum M of number fields one has L(s, σ R M/Q G m ) = ζ M (s). (It may be worth recalling that If ℓ is unramified in some splitting field for S, then (cf. [Bit11,2.8], [Vos98,14.3]) one has #S(F ℓ ) = ℓ dim S L ℓ (1, σ S ) −1 . Lemma 6.2. Suppose that ℓ ∤ 2p disc( f X/F q (T)). Then Proof. By Lemma 4.4 since dim T = g + 1. Using (2.3), first to see that L(s, σ T ) = L(s, σ T der )L(s, σ G m ) and second to compute L(s, σ T der ), we recognize this as Since ζ K (s) and ζ K + (s) both have a simple pole at s = 1, we immediately deduce: Corollary 6.3. The right-hand side of (1.3) converges conditionally.
Moreover, up to a finite factor B([X, λ]), we can express #I([X, λ], F q ) in terms of familiar quantities: Corollary 6.4. We have 6.3. ν p . Since the multiplier η(γ 0 ) of Frobenius is q, γ 0 , while an element of M(Z p ) ⊂ G(Q p ), is never an element of G(Z p ). Nonetheless, if the isogeny class is ordinary, it is possible to transfer part of the work in calculating ν p ([X, λ]) from M(Z p ) to G(Z p ), as follows.
Suppose X is ordinary. Then its p-divisible group splits integrally as X[ (In general, the slope filtration only exists up to isogeny, as in Lemma 3.5.) Therefore, there exists This can also be proved directly through linear algebra.
Lemma 6.5. For n and d sufficiently large and γ ∈ M(Z p /p n ), the following conditions are equivalent:

into maximal isotropic subspaces, and there exists an isomorphism
Proof. The equivalence of (a) and (b) is Lemma 3.2. For the equivalence of (a) and (c), use the argument above to show that any such γ induces an appropriate decomposition of V Z p /p n .
Therefore, if α 0 mod p is regular, we obtain a version of Lemma 6.2 at p.
The argument of Lemma 6.5 shows that, for sufficiently large d and n, both #C (d,n) (γ 0 ) and #C (d,n) (γ 0 ) are given by the product of the number of decompositions V Z p /p n = V + Z p /p n ⊕ V − Z p /p n into maximal isotropic subspaces, and the number of α ∈ End(V Z p /p n ) with α ∼ End(V Z p /p n ) d α 0 . In particular, #C (d,n) (γ 0 ) = #C (d,n) (ǫ 0 ).
The regularity hypothesis implies that ǫ 0 mod p is regular, and the result follows from Lemma 6.2.
The state of the art on calculation of Tamagawa numbers has also improved; see [LYY21,Rü20]. 6.5. Level structure. The Langlands-Kottwitz formula (2.1) is actually written for abelian varieties with arbitrary level structure, and thus a version of our main formula is available in the context of abelian varieties with level structure, too. 6.5.1. Product formula. Let Γ ⊂ G(Ẑ p f ) be an open compact subgroup. There is a notion of principally polarized abelian variety with level Γ structure; let A g,Γ be the corresponding Shimura variety. If (X, λ, α) ∈ A g,Γ (F q ) is a principally polarized abelian variety with level Γ-structure, then the size of its isogeny class in this category is given by the Kottwitz formula, except that the integrand in the adelic orbital integral is replaced with 1 Γ .
We make the definition The analogue of Corollary 4.6 holds, and states that there exists d(γ 0 ) such that The calculations at p and ∞, as well as the global volume term, are unchanged, and we find that 6.5.2. Principal level structure. Fix a prime ℓ 0 , and define Γ(ℓ 0 ) = ∏ ℓ Γ(ℓ 0 ) ℓ by Then A g,Γ(ℓ 0 ) is the moduli space of abelian varieties equipped with a full principal level ℓ 0structure.
For example, to fix ideas, suppose that g = 1 and that ℓ 0 = p, and let a satisfy |a| ≤ 2 √ q, p ∤ a and ℓ 0 ||(a 2 − 4q); we consider the set of elliptic curves with characteristic polynomial of Frobenius f (T) = T 2 − aT + q. Then some, but not all, elements of the corresponding isogeny class admit a principal level ℓ 0 -structure (see, e.g., [AW13]).
Let (X, λ, α) be an elliptic curve over F q with trace of Frobenius a and full level ℓ 0 -structure α.
Consequently, for any d ≥ 0 and any n ≥ 2, we have bijections between the following sets:

GL 2 RECONSIDERED
In [AG17], we essentially treated the g = 1 case of the present paper. Unfortunately, a simple algebra error -ν AG ∞ ([X, λ]) = 2 π |D(γ 0 )| ( §6.1.2), in spite of the claims of the penultimate displayed equation [AG17, p.20] -masked certain mistakes involving the calculations at p. We take the opportunity to correct these mistakes. The reader pleasantly unaware of these issues with [AG17] may simply view the present section as an explication of our technique in the special case where g = 1, and thus G = GL 2 .
Note that the definition [AG17, (2-6)] could have been replaced with a criterion involving characteristic polynomials, e.g., 7.1. Assertions at p. There are two problematic claims in [AG17]: (1) For the test function 1 G(Z ℓ ) at ℓ = p, we have It is claimed in [AG17, Lemma 3.7] that the same is true for ℓ = p, where the test function φ q is the characteristic function of G(Z p ) q 0 0 1 G(Z p ).
This is valid for ℓ = p, but requires correction at p, because our Chevalley-Steinberg map is not exactly the same as the map in [FLN10].
7.2. From point-counts to measure. In (1), one exploits the fundamental fact that point counts Proposition A.1. One has τ T der = τ K + (R (1) For the case of T, the result varies with the extension.
Proposition A.2. Assume that K is a Galois CM field and K + is its maximal totally real subfield. Then we have τ T ≤ 2, and moreover : • If g is odd then τ T = 1.
More results and details will appear in the second author's forthcoming thesis.
We base our approach the following formula of Ono.

Theorem A.3 ([Ono63]). Let T be an algebraic torus defined over a number field F and split over some Galois extension L. Then its Tamagawa number can be computed as
Here X ⋆ (T) denotes the character lattice of T. The symbol X 1 (T) denotes the corresponding Tate-Shafarevich group defined by where v runs over the primes of F and w is a prime of L with w|v.
Our approach is to do the computation on the level of character lattices. A very important consequence of Tate-Nakayama duality theorem (see [PR91,Theorem 6.10]) is that for a torus T as in the previous theorem, the Pontryagin dual of X 1 (T) is isomorphic to X 2 (X ⋆ (T)), so it suffices to compute |X 2 (X ⋆ (T))|.
The proof of proposition A.1 is given in the next section. The proof of proposition A.2 occupies sections A.2 to A.5. In section A.6 we present an example not covered by proposition A.2. In section A.7 we present a computation for the numerator that illustrates the difficulties that arise for a general torus (not assuming that T is contructed from a single field).
A.1. Computation of τ T der . We write the proof of proposition A.1 using Theorem A.3. Since the Tamagawa number is preserved by restriction of scalars we have τ T der = τ Q (R K + /Q R (1) . The cohomology of the characters of a norm 1 torus is obtained by a classic computation that one can see for instance in the proof of the Hasse norm theorem in [PR91, Theorem 6.11]. We havê H i (K/Q, X ⋆ (T der )) =Ĥ i (K/K + , R (1) In particular, |X 1 (T der )| = |X 2 (X ⋆ (T der ))| ≤ |H 2 (X ⋆ (T der ))| = 1. We conclude τ T der = 2 1 = 2. This proves proposition A.1.
Direct computations using that + σ := ∑ σ∈Γ + σ spans the set of Γ + -fixed elements of Z[Γ + ] give us that {1 ⊗ (1 + ι), + σ ⊗ ι} is a Z-basis for Λ Γ + , on which ι acts via 1 g 0 −1 . Identifying the space with Z 2 we can compute cocycles and coboundaries. Coboundaries are of the form a ι = (−gb, 2b) for b ∈ Z. Cocycles are of the form a ι = (a, b) with 2a + gb = 0. Thus, if b is even then it is a coboundary, if b is odd then g cannot be odd, and so we only get a nontrivial cocycle with g even and b odd. The difference of two nontrivial cocycles has an even second entry, so it is a coboundary. This proves H 1 (Z/2Z, Λ Γ + ) = {0} if g is odd Z/2Z if g is even as desired.
For the last assertion in the proposition, when g is odd, by the Schur-Zassenhaus theorem (see [Rot95,Theorem 7.41]) the sequence (A.2) splits and we get our result immediately.
A.7. The numerator in Ono's formula: general case. We give some indications for the general case in which T is described by a CM algebra K = t i=1 K i , each K i being a CM field. The Rosati involution on K is still denoted as ι, with fixed subalgebra K + = t i=1 K + i . In this section we denote by Γ the absolute Galois group of Q. Our modest aim is to understand H 1 (Γ, X ⋆ (T)) through Kottwitz's isomorphism (see [Kot84a] (2.4.1) and §2.4.3): whereT is the dual C-torus. This isomorphism is valid for all tori.
The Γ-action onT := X ⋆ (T) ⊗ C ×∼ =C × × (C × ) Φ is thus σ · (z, Recall from the description of X ⋆ (T der ) that T der can be identified with (C × ) Φ . Note that ( T der ) Γ is finite since T der is anisotropic.
The assertion follows at once.
To illustrate the use of proposition A.11, we prove the following Proposition A.12. If t = 1 and g is odd, then H 1 (Γ, X ⋆ (T)) ∼ =π 0 ( T Γ ) is trivial.
Note that K is not assumed to be Galois over Q.
Kottwitz's theory also relates Tate-Shafarevich groups to similar objects attached to dual tori; see §4 of [Kot84a]. Nevertheless, we are not yet able to determine the Tate-Shafarevich group of T by this approach in the non-Galois case.