# Un peu d’effectivité pour les variétés modulaires de Hilbert-Blumenthal.

Levent Alpöge

###### Abstract.

We prove a "height-free" effective isogeny estimate for abelian varieties of
$\mathrm{GL}_{2}$-type.

More precisely, let $g\in\mathbb{Z}^{+}$, $K$ a number field, $S$ a finite set
of places of $K$, and $A,B/K$ $g$-dimensional abelian varieties with good
reduction outside $S$ which are $K$-isogenous and of $\mathrm{GL}_{2}$-type
over $\overline{\mathbb{Q}}$. We show that there is a $K$-isogeny
$A\rightarrow B$ of degree effectively bounded in terms of $g$, $K$, and $S$
only.

We deduce among other things an effective upper bound on the number of
$S$-integral $K$-points on a Hilbert modular variety.

###### Contents.

  1. 1 Introduction.
    1. 1.1 Main theorems.
    2. 1.2 Technique.
    3. 1.3 Remarks.
  2. 2 Acknowledgements.
  3. 3 Results from our [2].
    1. 3.1 Our reducibility estimate.
    2. 3.2 Faltings’ Lemma.
    3. 3.3 An observation of Silverberg.
    4. 3.4 The isogeny factorization of a $\mathrm{GL}_{2}$-type abelian variety.
  4. 4 A priori control of the endomorphism algebra.
  5. 5 Two "large image" propositions.
    1. 5.1 Large primes.
    2. 5.2 Small primes.
      1. 5.2.1 Lemma 5.3 implies Proposition 5.2.
      2. 5.2.2 Lemma 5.4 implies Lemma 5.3.
      3. 5.2.3 Preliminaries for the proof of Lemma 5.4.
      4. 5.2.4 Proof of Lemma 5.4.
  6. 6 Proof of Theorem 1.1.
    1. 6.1 Reversal of arrows.
    2. 6.2 Reduction to the special case when $\text{End}_{K}(A)$ is "maximal".
    3. 6.3 Proof of Theorem 1.1.
  7. 7 Proof of Theorem 1.2.
  8. 8 Proof of Theorem 1.3.
  9. 9 Proof of Corollary 1.4.
  10. 10 Proof of Theorem 1.5.
  11. 11 Proof of Corollary 1.6.
  12. 12 Proof of Corollary 1.8.
  13. 13 Sketch of proof of Corollary 1.9.
  14. A Finiteness of isogeny classes of (fake) elliptic curves.

##  1 Introduction.

The crux of Faltings’ Great [8] is his proof of the finiteness of isogeny
classes of abelian varieties over number fields, from which he deduces a
finiteness conjecture of Shafarevich. His proof does not111Experience with the
numerous ineffective theorems of number theory leads one to expect that, in
any particular ineffective argument, even if one cannot give a finite-time
algorithm to determine the exceptional set that one proves is finite, one
should at least be able to give an effective upper bound for its size. However
this is not the case for Faltings’ proof of the Shafarevich conjecture. On the
other hand it _is_ the case for his proof of the Mordell conjecture, thanks to
Raynaud’s effectivization of his isogeny theorem and the very clever idea of
Parshin to invoke Mumford’s gap principle — see Szpiro’s [20]. There are now
of course numerous other ways to proceed. give an estimate on the size
$\\#|\mathcal{A}_{g}(\mathfrak{o}_{K,S})|$ of the relevant finite set, and nor
do the subsequent effectivizations and improvements of Raynaud, Masser-
Wüstholz, Bost, David, Gaudron-Rémond, and others222Let us also note work of
the Chudnovsky brothers [5] and Koshikawa [11]. Our list certainly omits
important work, and we ask the reader to forgive our ignorance of the
literature.. This is because all known333We exclude the case of elliptic
curves because it is trivialized by Baker’s explicit height bounds (since the
relevant moduli space is so simple). proofs of his isogeny theorem give bounds
depending on the height of a representative in the relevant isogeny class, a
quantity over which one still has no a priori effective control.

The purpose of this paper is to prove a "height-free" isogeny estimate for a
special class of abelian varieties, namely those of $\mathrm{GL}_{2}$-type.

(We have already explained elsewhere why sufficiently accurate study of these
abelian varieties suffices for an effective form of the Mordell conjecture for
e.g. hyperelliptic curves.) We will give an a priori effective isogeny
estimate depending only on their dimensions, conductors, and fields of
definition. The key point in the argument will be provided by a lemma which
greatly simplified the argument in [2].444Before writing [1] it was clear to
us that this lemma must be known at least with ineffective implied constant
(indeed it is a special case of a theorem of Zarhin which relies on Faltings’
finiteness of isogeny classes). However in the context of [2] the lemma can
also be phrased as a statement about congruences of Hilbert modular forms,
whence it was natural to look in the literature on Hilbert modular forms for
such a statement. And exactly such a statement was proven by Mladen Dimitrov
[6] via a technique that we effectivized with a trick. This paper then amounts
to ”reversing the steps” and using said lemma to deduce something about
Faltings’ finiteness of isogeny classes.

Such an isogeny estimate easily gives an a priori estimate on the number of
such abelian varieties of bounded dimension, conductor, and field of
definition (and their endomorphism rings, and e.g. an effective adelic
surjectivity statement à la Serre), as we will explain.

Let us now list the main results in this paper.

Theorem 1.1 constitutes our "height-free" isogeny estimate for abelian
varieties of $\mathrm{GL}_{2}$-type over a number field.

The resulting effective upper bound for the number of (isomorphism classes of)
such abelian varieties is Theorem 1.3, from which we of course produce an
effective upper bound on the number of $S$-integral points on moduli spaces of
such abelian varieties — see Corollary 1.4.

From said upper bound we deduce effective upper bounds on the number of
rational points on a large class of curves (including e.g. all hyperelliptic
curves over number fields) — see Corollary 1.8. Of course by now this is known
in a number of ways, and our only interest in this is that our argument
follows Szpiro’s [20] but avoids Parshin’s very clever idea of using Mumford’s
gap principle by instead invoking our isogeny estimate.

We also prove that the (isomorphism classes of) endomorphism rings of
$g$-dimensional abelian varieties of $\mathrm{GL}_{2}$-type over a number
field $K$ and with good reduction outside a finite set $S$ of places of $K$
lie in an effectively computable finite set of possibilities — see Theorem
1.2.

Finally our adelic surjectivity theorem is Theorem 1.5, we effectivize a
theorem of M. Dimitrov on the residual representations associated to Hilbert
modular eigencuspforms in Corollary 1.9, and we explain in Appendix A how to
prove the finiteness of isogeny classes of elliptic curves and fake elliptic
curves by reasoning only about Galois representations.

###  1.1 Main theorems.

We prove the following.

######  Theorem 1.1.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Then: there is an effectively computable constant
$\text{\c{s}}_{g,K,S}\in\mathbb{Z}^{+}$ depending only on $g$, $K$, and $S$
such that the following holds.

  * •

Let $A,B/K$ be $g$-dimensional abelian varieties over $K$ which are
$K$-isogenous, have good reduction outside $S$, and are of
$\mathrm{GL}_{2}$-type over $\overline{\mathbb{Q}}$. Then:
$\mathop{\text{Hom}}_{K}(A,B)$ is generated as an abelian group by
$K$-isogenies of degree $\leq\text{\c{s}}_{g,K,S}$.

Our argument is in principle completely explicit except for one step where we
avoid a calculation with Breuil-Kisin modules via a trick. In other words we
believe there is no obstruction to making the map
$(g,K,S)\mapsto\textit{\c{s}}_{g,K,S}$ explicit.

This easily implies the following two theorems.

######  Theorem 1.2.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Then: there is an effectively computable finite
set of (isomorphism classes of) rings $\mathcal{R}_{g,K,S}$ depending only on
$g$, $K$, and $S$ such that the following holds.

  * •

Let $A/K$ be a $g$-dimensional abelian variety of $\mathrm{GL}_{2}$-type over
$\overline{\mathbb{Q}}$ which has good reduction outside $S$. Then:
$\text{End}_{K}(A)\in\mathcal{R}_{g,K,S}$.

######  Theorem 1.3.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Then: there is an effectively computable constant
$\bigiy_{g,K,S}\in\mathbb{Z}^{+}$ depending only on $g$, $K$, and $S$ such
that the number of $K$-isomorphism classes of abelian varieties $A/K$ which
are of $\mathrm{GL}_{2}$-type over $\overline{\mathbb{Q}}$ and have good
reduction outside $S$ is $\leq\bigiy_{g,K,S}$.

Of course the following follows immediately.

######  Corollary 1.4.

Let $g\in\mathbb{Z}^{+}$. Let $F/\mathbb{Q}$ be a totally real field of degree
$g=[F:\mathbb{Q}]$. Let $\mathfrak{o}\subseteq\mathfrak{o}_{F}$ be an order in
$\mathfrak{o}_{F}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a finite
set of places of $K$.555To ignore subtleties with integral models we
implicitly add to $S$ all primes of $K$ of norm
$\leq\left(10^{10}\cdot|\Delta_{\mathfrak{o}}|\right)^{10^{10}\cdot[K:\mathbb{Q}]}$.
Then: there is an effectively computable constant
$\bighardsign_{g,K,S}\in\mathbb{Z}^{+}$ depending only on $g$, $K$, and $S$
such that the number of $\mathfrak{o}_{K,S}$-points on the canonical
$\mathfrak{o}_{K,S}$-integral model $\mathcal{H}_{\mathfrak{o}}$ of the666By
this we really mean that the statement holds regardless of the choice of
polarization data, which our notation leaves implicit. Hilbert modular stack
associated to $\mathfrak{o}$ is
$\\#|\mathcal{H}_{\mathfrak{o}}(\mathfrak{o}_{K,S})|\leq\bighardsign_{g,K,S}$.

We also deduce an effective open image theorem à la Serre for
$\mathrm{GL}_{2}$-type abelian varieties. For $F/\mathbb{Q}$ a number field
and $\mathfrak{o}\subseteq F$ an order, write, informally,
$G_{\mathfrak{o}}:=\\{g\in\mathrm{Res}_{\mathfrak{o}/\mathbb{Z}}\,{\mathrm{GL}_{2}}:\det{g}\in\mathbb{G}_{m}\subseteq\mathrm{Res}_{\mathfrak{o}/\mathbb{Z}}\,{\mathbb{G}_{m}}\\}$,
so that
$G_{\mathfrak{o}}(\mathbb{Z}_{p}):=\\{g\in\mathrm{GL}_{2}(\mathfrak{o}_{p}):\det{g}\in\mathbb{Z}_{p}^{\times}\\}$,
where as usual we have written
$\mathfrak{o}_{p}:=\mathfrak{o}\otimes_{\mathbb{Z}}\mathbb{Z}_{p}$.

######  Theorem 1.5.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Then: there is an explicit (thus effectively
computable) constant $\emph{\text{\^{\i}}}_{g,K,S}\in\mathbb{Z}^{+}$ depending
only on $g$, $K$, and $S$ such that the following holds.

  * •

Let $A/K$ be a $g$-dimensional $\overline{\mathbb{Q}}$-simple split semistable
abelian variety over $K$ which has good reduction outside $S$, is of
$\mathrm{GL}_{2}$-type over $K$, does not admit sufficiently many complex
multiplications over $\overline{\mathbb{Q}}$, and is such that, for all
$p\geq\emph{\text{\^{\i}}}_{g,K,S}$, $\det{\rho_{A,p}}=\chi_{p}$, where
$\chi_{p}$ is the $p$-adic cyclotomic character and, writing $\mathfrak{o}$
for the centre of $\text{End}_{K}(A)$ (thus $\mathfrak{o}\subseteq F$ is an
order in a CM777For us a CM field $K/\mathbb{Q}$ is either totally real or
else a totally imaginary quadratic extension of a totally real field.
$F/\mathbb{Q}$ with $[F:\mathbb{Q}]=g$ or $\frac{g}{2}$),
$\rho_{A,p}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{p})$
is the representation corresponding to the
$\text{End}_{K}(A)[\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)]$-module
structure of $T_{p}(A)$.

Then:
$\left(\prod_{p\geq\emph{\text{\^{\i}}}_{g,K,S}}\rho_{A,p}\right)(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))=\prod_{p\geq\emph{\text{\^{\i}}}_{g,K,S}}G_{\mathfrak{o}}(\mathbb{Z}_{p})$.

For small primes we content ourselves with Proposition 5.2. Of course, given a
$\overline{\mathbb{Q}}$-simple $g$-dimensional abelian variety $A/K$ which is
of $\mathrm{GL}_{2}$-type over $\overline{\mathbb{Q}}$ and which has good
reduction outside $S$, there is an explicit finite extension $L/K$ depending
only on $g$, $K$, and $S$ such that the hypotheses of Theorem 1.5 hold for
$A/L$.

It is perhaps worth noting that for relevant abelian varieties with compact
moduli Theorem 1.5 gives a uniform effective adelic surjectivity statement —
e.g. for fake elliptic curves one has the following.

######  Corollary 1.6.

Let $B/\mathbb{Q}$ be a quaternion algebra over $\mathbb{Q}$ of discriminant
$\Delta_{B}\neq 1$. Let $\mathfrak{o}\subseteq B$ be a maximal order. Let
$X_{\mathfrak{o}}/\mathbb{Q}$ be the corresponding (fine) Shimura curve. Let
$K/\mathbb{Q}$ be a number field. Then: there is an explicit (thus effectively
computable) constant $\zh_{B,K}\in\mathbb{Z}^{+}$ depending only on $B$ and
$K$ such that the following holds.

  * •

Let $P\in X_{\mathfrak{o}}(K)$ be non-CM. Let $A/K$ be the
($\overline{\mathbb{Q}}$-simple) abelian surface corresponding to $P$. Let,
for $p\nmid\Delta_{B}$,
$\rho_{A,p}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathrm{GL}_{2}(\mathbb{Z}_{p})$
be the representation corresponding to the
$\mathfrak{o}[\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)]$-module
structure of $T_{p}(A)$. Then:
$\left(\prod_{p\geq\zh_{B,K}}\rho_{A,p}\right)(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))=\prod_{p\geq\zh_{B,K}}\mathrm{GL}_{2}(\mathbb{Z}_{p})$.

Note e.g. that by Theorem 1.2 the $\mathfrak{o}$ for which there is an abelian
surface $A/K$ with good reduction everywhere and
$\text{End}_{K}(A)\cong\mathfrak{o}$ lie in an explicit finite set.

We conclude with the following two observations.

For the first observation we introduce the following abbreviation.

######  Definition 1.7.

Let $K/\mathbb{Q}$ be a number field. Let $C/K$ be a smooth projective
hyperbolic curve over $K$. Then: $C/K$ is _şirin_ if and only if there is a
finite extension $L/K$, a smooth projective hyperbolic curve
$\widetilde{C}/L$, an étale cover $\varphi:\widetilde{C}\longrightarrow C$
defined over $L$, and a nonisotrivial family
$\pi:A\longrightarrow\widetilde{C}$ of abelian varieties which are of
$\mathrm{GL}_{2}$-type over $L(\widetilde{C})$.

We also call the data $(C,K,L,\widetilde{C},\varphi,\pi)$ a _şirin family_.

(For example, all solvable covers of $\mathbb{P}^{1}$ over a number field are
şirin, via e.g. the family given in Section $6$ of [2] and the main theorem of
Poonen’s [13]. More generally, all curves $C/K$ admitting a diagram
$C\xleftarrow{\varphi}\widetilde{C}\xrightarrow{f}\mathbb{P}^{1}$ over a
finite $L/K$ with $\varphi$ étale and $f$ Belyi with all ramification indices
above $0$, $1$, $\infty$ respectively divisible by $a$, $b$, $c$ with
$\frac{1}{a}+\frac{1}{b}+\frac{1}{c}<1$ are also şirin, by pulling back a
suitable hypergeometric family of abelian varieties.)

Now for the first observation.

######  Corollary 1.8.

Let $K/\mathbb{Q}$ be a number field. Let $C/K$ be a şirin smooth projective
hyperbolic curve over $K$. Then: there is an effectively computable constant
$\mathrm{I}_{K,C}\in\mathbb{Z}^{+}$ depending only on $K$ and $C/K$ such that
$\\#|C(K)|\leq\mathrm{I}_{K,C}$.

Of course this corollary is not new, and we have already explained our
interest. (We refer the reader to V. Dimitrov-Gao-Habegger’s [7] for far
stronger bounds, as well as to Chapter $6$ of [1] for a bound on the number of
large points only.)

Finally let us state the second observation. Write, for $f$ a Hilbert modular
eigencuspform of weight $\vec{k}$ and level $\mathfrak{n}$ over a totally real
field $F$ and $\ell\gg_{F,\vec{k},\mathfrak{n}}1$ a prime of $\mathbb{Z}$,
$\rho_{f,\ell}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/F)\longrightarrow\mathrm{GL}_{2}(\overline{\mathbb{Q}}_{\ell})$
for the corresponding $\ell$-adic representation. Write also
$\overline{\rho}_{f,\ell}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/F)\longrightarrow\mathrm{GL}_{2}(\overline{\mathbb{F}}_{\ell})$
for the (semisimplified) residual representation associated to
$\rho_{f,\ell}$. We will use M. Dimitrov’s abbreviations
$(\textbf{Irr}_{\overline{\rho}})$, $(\textbf{LI}_{\overline{\rho}})$, and
$(\textbf{LI}_{\mathrm{Ind}\,{\overline{\rho}}})$ — see Proposition $0.1$ of
Dimitrov’s [6] for definitions. (We will define all but
$(\textbf{LI}_{\mathrm{Ind}\,{\overline{\rho}}})$ below.)

######  Corollary 1.9 (cf. Proposition $0.1$ of M. Dimitrov’s [6]).

Let $F/\mathbb{Q}$ be totally real. Let
$\mathfrak{n}\subseteq\mathfrak{o}_{F}$ be an ideal of $\mathfrak{o}_{F}$. Let
$S_{\infty}$ be the finite set of infinite places of $F$. Let
$\vec{k}\in\mathbb{Z}^{S_{\infty}}$. Then: there is an effectively computable
constant $\dot{\mathrm{I}}_{F,\vec{k},\mathfrak{n}}\in\mathbb{Z}^{+}$
depending only on $F$, $\vec{k}$, and $\mathfrak{n}$ such that the following
holds.

  * •

Let $p\geq\dot{\mathrm{I}}_{F,\vec{k},\mathfrak{n}}$ be a prime. Let $f$ be a
Hilbert modular eigencuspform over $F$ of weight $\vec{k}$ and level
$\mathfrak{n}$. Then: $\overline{\rho}_{f,p}$ is absolutely irreducible, i.e.
Dimitrov’s condition $(\textbf{\emph{Irr}}_{\overline{\rho}})$ holds.

  * •

Let $p\geq\dot{\mathrm{I}}_{F,\vec{k},\mathfrak{n}}$ be a prime. Let $f$ be a
Hilbert modular eigencuspform over $F$ of weight $\vec{k}$ and level
$\mathfrak{n}$ which is not a theta series. Then: there is a power $q$ of $p$
and a $g\in\mathrm{GL}_{2}(\overline{\mathbb{F}}_{p})$ such that
$g\cdot\mathrm{SL}_{2}(\mathbb{F}_{q})\cdot
g^{-1}\subseteq\overline{\rho}_{f,\ell}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/F))\subseteq\overline{\mathbb{F}}_{\ell}^{\times}\cdot(g\cdot\mathrm{GL}_{2}(\mathbb{F}_{q})\cdot
g^{-1})$, i.e. Dimitrov’s condition $(\textbf{\emph{LI}}_{\overline{\rho}})$
holds.

  * •

Let $p\geq\dot{\mathrm{I}}_{F,\vec{k},\mathfrak{n}}$ be a prime. Let $f$ be a
Hilbert modular eigencuspform over $F$ of weight $\vec{k}$ and level
$\mathfrak{n}$ which is not a theta series and which is not a twist by a
character of any of its internal conjugates. Then: Dimitrov’s condition
$(\textbf{\emph{LI}}_{\mathrm{Ind}\,{\overline{\rho}}})$ holds.

###  1.2 Technique.

We will only describe the argument proving the isogeny estimate. We will
moreover ignore small primes in our sketch.

The first matter is to control a priori the endomorphism algebra of a given
$A/K$ of $\mathrm{GL}_{2}$-type over $K$ with good reduction outside $S$. Now,
$A/K$ is either isotypic or else $K$-isogenous to the product of two isotypic
abelian varieties which are CM over $\overline{\mathbb{Q}}$. Let us ignore the
CM case. Via a Serre tensor product it suffices to treat the case where
$A=B^{\times n}$ with $B/K$ $K$-simple and with geometric endomorphisms by a
maximal order in $\text{End}_{K}^{0}(B)$. There are two cases: either
$\text{End}_{K}^{0}(B)=F$ a CM field of degree $g$, or else
$\text{End}_{K}^{0}(B)=D$ a quaternion algebra over a CM field of degree
$\frac{g}{2}$.

Let us treat the first case for a moment. It is an easy matter to use
Faltings’ proof of the Tate conjecture to prove that $F$ is generated over
$\mathbb{Q}$ by an explicit finite set of Frobenius traces (at a Faltings-
Serre set of primes associated to an auxiliary prime, just as in our proof of
Lemma $3.9$ in our [2]). This of course upper bounds the discriminant of $F$
and thus restricts it to an explicit finite set by Hermite-Minkowski.

(In the quaternionic multiplication case we upper bound the centre in exactly
the same way and then upper bound the discriminant of the quaternion algebra
$D$ by again using Lemma $3.9$ of [2] — were $D$ ramified above a large prime
$p$, one of the mod-$p$ residual representations of $B/K$ would automatically
be reducible.)

So this controls the relevant endomorphism algebras a priori.

So now let $A\longrightarrow C$ be a $K$-isogeny, let $G$ be its kernel, and
write $G=:\bigoplus_{p}G_{p}$ with $G_{p}\subseteq A[p^{\infty}]$. It is
natural to try to write $G=\bigoplus_{\mathfrak{p}}G_{\mathfrak{p}}$, but
there arises the following scare: we seemingly have no control over
$\text{End}_{K}(C)$, so why should $G$ be stable under
$\text{End}_{K}(B)=\mathfrak{o}_{F}$?

To overcome this we use the following trick: for $g\in\mathrm{GL}_{2}$,

$g+(\det{g})\cdot g^{-1}=(\mathrm{tr}\,{g})\cdot\mathop{\mathrm{id}}.$

It is an easy matter to make the determinants of the relevant $2$-dimensional
Galois representations cyclotomic on the nose (by just passing to an explicit
extension provided by Hermite-Minkowski), so in e.g. the case of
$\text{End}_{K}^{0}(B)=F$, we have that, for all $p$,

$\mathbb{Z}_{p}[\rho_{B,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]\supseteq\mathbb{Z}[\\{\mathrm{tr}(\rho_{B,p}(\mathrm{Frob}_{\mathfrak{q}})):\mathfrak{q}\in
T\\}]\otimes_{\mathbb{Z}}\mathbb{Z}_{p},$

where
$\rho_{B,p}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{F,p})$
and $T$ is a Faltings-Serre set of primes associated to a suitably chosen
auxiliary prime. Because of this choice of $T$ we know that
$\mathbb{Z}[\\{\mathrm{tr}(\rho_{B,p}(\mathrm{Frob}_{\mathfrak{q}})):\mathfrak{q}\in
T\\}]\subseteq F$ is an order. But said order is manifestly generated by
elements of bounded height, whence it has bounded discriminant, whence bounded
index in $\mathfrak{o}_{F}$, whence for $p$ sufficiently large we find that

$\mathbb{Z}_{p}[\rho_{B,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]\supseteq\mathfrak{o}_{F,p}.$

Thus
$\mathbb{Z}_{p}[\rho_{B,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=\mathfrak{o}_{F,p}[\rho_{B,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=\bigoplus_{\mathfrak{p}|(p)}\mathfrak{o}_{F,\mathfrak{p}}[\rho_{B,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]$.

Now Lemma $3.9$ of [2] gives more than just residual irreducibility — in fact
for all $\mathfrak{p}|(p)$ the residual image of $\rho_{B,\mathfrak{p}}$
contains a conjugate of $\mathrm{SL}_{2}(\mathbb{F}_{p})$. Hence by Nakayama
we find that
$\mathfrak{o}_{F,\mathfrak{p}}[\rho_{B,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=M_{2}(\mathfrak{o}_{F,\mathfrak{p}})$,
whence

$\mathbb{Z}_{p}[\rho_{B,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=M_{2}(\mathfrak{o}_{F,p}).$

This means that just from Galois-invariance we automatically get that (for $p$
large) $G_{p}$ is $M_{2}(\mathfrak{o}_{F,p})$-invariant.

Let $N_{p}\in\mathbb{Z}^{+}$ with $G_{p}\subseteq A[p^{N_{p}}]$ and let
$\Gamma_{p}\subseteq T_{p}(A)=T_{p}(B)^{\oplus n}$ be the preimage of
$G_{p}\subseteq A[p^{N_{p}}]\simeq T_{p}(A)/p^{N_{p}}$. This means that
$\Gamma_{p}\lhook\joinrel\longrightarrow
T_{p}(A)\cong(\mathfrak{o}_{F,p}^{\oplus 2})^{\oplus n}$ is an
$M_{2}(\mathfrak{o}_{F,p})$-submodule (diagonal action). So by Morita it
follows that $\Gamma_{p}=\widetilde{\Gamma}_{p}^{\oplus 2}$ with
$\widetilde{\Gamma}_{p}\subseteq\mathfrak{o}_{F,p}^{\oplus n}$ an
$\mathfrak{o}_{F,p}$-submodule.

But because $\mathfrak{o}_{F,p}$ is a direct sum of principal ideal domains,
it follows that there is an $\alpha_{p}\in M_{n}(\mathfrak{o}_{F,p})$ such
that $\widetilde{\Gamma}_{p}=\alpha_{p}\cdot\mathfrak{o}_{F,p}^{\oplus n}$,
whence $\Gamma_{p}=\alpha_{p}\cdot T_{p}(A)$. Since $p^{N_{p}}\cdot
T_{p}(A)\subseteq\Gamma_{p}$ it follows that there is a $\beta_{p}\in
M_{n}(\mathfrak{o}_{F,p})$ such that
$\beta_{p}\cdot\alpha_{p}=p^{N_{p}}\cdot\mathop{\mathrm{id}}$, and then
$G_{p}=\ker(\beta_{p}\curvearrowright A[p^{\infty}])$. Of course (by shifting
$\alpha_{p}$ suitably) we may equally well replace $\beta_{p}$ by any element
of $\mathrm{GL}_{n}(\mathfrak{o}_{F,p})\cdot\beta_{p}$.

By considering the class $(\beta_{p})_{p}$ inside
$\left(\prod_{p}\mathrm{GL}_{n}(\mathfrak{o}_{F,p})\right)\backslash\mathrm{GL}_{n}(\mathbb{A}_{F}^{\text{fin.}})/\mathrm{GL}_{n}(F)$
and applying Minkowski we conclude that there is a $\gamma\in
M_{n}(\mathfrak{o})=\text{End}_{K}(A)$ such that $\ker{\gamma}\supseteq G$ and
$[\ker{\gamma}:G]\ll_{g,K,S}1$.

This exactly says that there is a $K$-isogeny $C\longrightarrow A$ of degree
bounded by $\ll_{g,K,S}1$, namely the $K$-isogeny corresponding to the
$K$-subgroup $(\ker{\gamma})/G\subseteq A/G=C$ — QED isogeny estimate.

When $\text{End}_{K}(B)$ is a maximal order $\mathfrak{o}$ in a quaternion
algebra the same argument goes through with minor modifications (namely by
replacing $M_{2}(\mathfrak{o}_{F,p})$ with
$\mathfrak{o}_{p}:=\mathfrak{o}\otimes_{\mathbb{Z}}\mathbb{Z}_{p}$ throughout
— this also explains why we unnecessarily considered the adelic double coset
space in the case $\text{End}_{K}^{0}(B)=F$).

###  1.3 Remarks.

Let us quickly explain why the isogeny estimates of Raynaud/Faltings and
Masser-Wüstholz (as made explicit by Bost, David, and Gaudron-Rémond) do not
suffice to prove Theorem 1.3 (or Theorem 1.2 etc.).

A coarse version (that is, ignoring the explicit dependence of the constant
which was also given by Raynaud) of Raynaud’s effectivization of Faltings’
isogeny theorem is the following.888Koshikawa’s aforementioned improvement —
i.e. Theorem $9.8$ of his [11] — amounts, in these coarse terms, to removing
the dependence of $C_{g,K,S}$ on $S$.

######  Theorem 1.10 (Raynaud — cf. Théorème $4.4.9$ of [15]).

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Then: there is an explicit (thus effectively
computable) constant $C_{g,K,S}\in\mathbb{Z}^{+}$ depending only on $g$, $K$,
and $S$ such that the following holds.

  * •

Let $A,B/K$ be $g$-dimensional abelian varieties over $K$ which are
$K$-isogenous and have good reduction outside $S$. Then: $|h(A)-h(B)|\leq
C_{g,K,S}$.

One concludes finiteness by an application of Northcott. But the resulting
estimate on the size of the finite set of abelian varieties $B/K$ which are
$K$-isogenous to $A/K$ _depends on $h(A)$_. This is why Szpiro needs to apply
Mumford’s gap principle in his [20] — regardless of the interval, at least
there is a uniform (here meaning only independent of $h(A)$) bound on the
number of points on a hyperbolic _curve_ whose heights lie in an interval of
given length.

This would not be an issue if we had an effective estimate $h(A)\ll_{g,K,S}1$
available — but of course if we had this then we would not be asking the
question, since such an estimate would amount to a solution of the effective
Shafarevich conjecture in this case, a problem which is open (though see [2]).

Now let us turn to the Masser-Wüstholz isogeny estimate, as improved and made
explicit by Gaudron-Rémond (after work of Bost and David). Again, we will
state a coarse version for the sake of explanation.

######  Theorem 1.11 (Gaudron-Rémond — cf. Théorème $1.4$ of [10]).

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let
$H\in\mathbb{R}^{+}$. Then: there is an explicit (thus effectively computable)
constant $C_{g,K,H}\in\mathbb{Z}^{+}$ depending only on $g$, $K$, and $H$ such
that the following holds.

  * •

Let $A/K$ be a $g$-dimensional abelian variety over $K$ with $h(A)\leq H$. Let
$B/K$ be $K$-isogenous to $A/K$. Then: there is a $K$-isogeny
$\varphi:A\longrightarrow B$ with $\deg{\varphi}\leq C_{g,K,H}$.

In fact one can take e.g.
$C_{g,K,H}:=\max\left(10^{10}\cdot[K:\mathbb{Q}],H\right)^{O_{g}(1)}$, to be a
bit more explicit.

One concludes finiteness because there are a finite number of $K$-subgroups of
$A$ of size at most $C_{g,K,h(A)}$, but again the resulting bound depends on
$h(A)$, and of course this is the same issue that arose in trying to use
Raynaud’s isogeny theorem.

Having explained this point, let us now prove the theorems.

##  2 Acknowledgements.

Lemma 3.1 is based on Lemma $9.3.3$ of Chapter $9$ of the author’s Ph.D.
thesis at Princeton University [1]. I would like to thank both my advisor
Manjul Bhargava and Peter Sarnak for their patience and encouragement. I would
also like to thank Jacob Tsimerman and Nina Zubrilina for informative
discussions. Finally I thank the National Science Foundation (via their grant
DMS-$2002109$), Columbia University, and the Society of Fellows for their
support during the pandemic.

##  3 Results from our [2].

We will cite four results from our [2].

###  3.1 Our reducibility estimate.

The first is Lemma $3.9$ of our [2]. We will state it here in the particular
case of abelian varieties only.

######  Lemma 3.1 (Cf. Lemma $3.9$ of [2].).

Let $d\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let
$N\in\mathbb{Z}^{+}$.

Then: there is an explicit (thus effectively computable) constant
$C_{d,K,N}\in\mathbb{Z}^{+}$ depending explicitly and only on $d$, $K$, and
$N$ such that the following holds.

  * •

Let $p\geq C_{d,K,N}$ be a prime of $\mathbb{Z}$. Let $E/\mathbb{Q}$ be a
number field of degree $[E:\mathbb{Q}]\leq d$. Let
$\mathfrak{p}\subseteq\mathfrak{o}_{E}$ be a prime of $\mathfrak{o}_{E}$ with
$\mathfrak{p}|(p)$. Let $A/K$ be an abelian variety of
$\mathrm{GL}_{2}(E)$-type over $K$ which does not admit sufficiently many
complex multiplications over $\overline{\mathbb{Q}}$ and has good reduction
outside the primes of $K$ dividing $(N)$. Then: writing the mod-$\mathfrak{p}$
residual representation of $A/K$ as
$\overline{\rho}_{A,\mathfrak{p}}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{E}/\mathfrak{p})$,
there is a $g\in\mathrm{GL}_{2}(\mathfrak{o}_{E}/\mathfrak{p})$ and a subfield
$\mathbb{F}_{q}\subseteq\mathfrak{o}_{E}/\mathfrak{p}$ such that:

$g\cdot\mathrm{SL}_{2}(\mathbb{F}_{q})\cdot
g^{-1}\subseteq\overline{\rho}_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))\subseteq(\mathfrak{o}_{E}/\mathfrak{p})^{\times}\cdot(g\cdot\mathrm{GL}_{2}(\mathbb{F}_{q})\cdot
g^{-1}).$

In fact we will prove the following stronger statement in Section 10.

######  Theorem 3.2.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let
$N\in\mathbb{Z}^{+}$.

Then: there is an explicit (thus effectively computable) constant
$C_{g,K,N}\in\mathbb{Z}^{+}$ depending explicitly and only on $g$, $K$, and
$N$ such that the following holds.

  * •

Let $p\geq C_{g,K,N}$ be a prime of $\mathbb{Z}$. Let $A/K$ be a
$\overline{\mathbb{Q}}$-simple abelian variety of $\mathrm{GL}_{2}$-type over
$K$ which does not admit sufficiently many complex multiplications over
$\overline{\mathbb{Q}}$ and has good reduction outside the primes of $K$
dividing $(N)$. Let $E$ be the centre of $\text{End}_{K}^{0}(A)$ (thus
$E/\mathbb{Q}$ is a CM field of degree either $g$ or $\frac{g}{2}$). Let
$\mathfrak{p}\subseteq\mathfrak{o}_{E}$ be a prime of $\mathfrak{o}_{E}$ with
$\mathfrak{p}|(p)$. Then: writing the mod-$\mathfrak{p}$ residual
representation of $A/K$ as
$\overline{\rho}_{A,\mathfrak{p}}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{E}/\mathfrak{p})$,

$\overline{\rho}_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))\supseteq\mathrm{SL}_{2}(\mathfrak{o}_{E}/\mathfrak{p}).$

For completeness let us now sketch a proof of Lemma 3.1 (by sketching the
proof of Lemma $3.9$ of [2]).

###### Sketch of proof of Lemma 3.1..

By the Dickson classification of subgroups of
$\mathrm{PSL}_{2}(\mathfrak{o}_{E}/\mathfrak{p})$ (see e.g. Theorem $4.15$ of
[9]) and the fact that $\mathrm{SL}_{2}(\mathbb{F}_{q})$ is its own commutator
subgroup, to show that $\mathrm{SL}_{2}(\mathbb{F}_{q})\subseteq
g\cdot\overline{\rho}_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))\cdot
g^{-1}\subseteq(\mathfrak{o}_{E}/\mathfrak{p})^{\times}\cdot\mathrm{GL}_{2}(\mathbb{F}_{q})$
for some $g\in\mathrm{GL}_{2}(\mathfrak{o}_{E}/\mathfrak{p})$ and some
subfield $\mathbb{F}_{q}\subseteq\mathfrak{o}_{E}/\mathfrak{p}$ it suffices to
show that $\overline{\rho}_{A,\mathfrak{p}}$ is absolutely irreducible, has
projective image of size $\gg 1$, and is absolutely not induced. To see that
the projective image is of size $\gg 1$ one restricts to inertia subgroups at
$\mathfrak{q}|(p)$ and uses Raynaud’s classification of the inertial
restrictions of Galois representations corresponding to finite flat group
schemes which prolong over $\mathfrak{o}_{K,\mathfrak{q}}$ (thus
$(\overline{\rho}_{A,\mathfrak{p}}\otimes_{\mathfrak{o}_{E}/\mathfrak{p}}\overline{\mathbb{F}}_{p})|_{I_{\mathfrak{q}}}$
semisimplifies to a sum of two multiplicity-free products of fundamental
characters, and since
$\det{(\overline{\rho}_{A,\mathfrak{p}}|_{I_{\mathfrak{q}}})}$ is cyclotomic
it follows that the projectivization of $\overline{\rho}_{A,\mathfrak{p}}$
must have large image).

Showing that $\overline{\rho}_{A,\mathfrak{p}}$ is absolutely not induced
reduces to showing that
$\overline{\rho}_{A,\mathfrak{p}}|_{\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/L)}$
is absolutely irreducible for $L/K$ an explicit finite extension, so let us
focus on absolute irreducibility. Let us just show irreducibility for
notation’s sake.

Suppose $\overline{\rho}_{A,\mathfrak{p}}$ is reducible. Thus it
semisimplifies to a sum of characters, say
$\mathrm{tr}{\rho_{A,\mathfrak{p}}}\equiv\overline{\chi}+\overline{\chi}^{\prime}\mkern
4.0mu({\operator@font mod}\mkern 6.0mu\mathfrak{p})$. Since $\overline{\chi}$
and $\overline{\chi}^{\prime}$ are subquotients of the representation
$\overline{\rho}_{A,\mathfrak{p}}$, and the latter corresponds to a finite
flat group scheme which prolongs over $\mathfrak{o}_{K,S}$, it follows that
the inertial restrictions $\overline{\chi}|_{I_{\mathfrak{q}}}$ and
$\overline{\chi}^{\prime}|_{I_{\mathfrak{q}}}$ at primes $\mathfrak{q}|(p)$
are reductions modulo $\mathfrak{p}$ of characters corresponding to CM
$p$-divisible groups.

Because (via Artin reciprocity) $\overline{\chi}$ and
$\overline{\chi}^{\prime}$ must be trivial on an explicit finite-index
subgroup of global units, in fact said CM $p$-divisible groups must be
$p$-divisible groups associated to algebraic Hecke characters — indeed,
abusing notation by leaving the Artin map implicit,
$\overline{\chi}(\varepsilon)\equiv 1\mkern 4.0mu({\operator@font mod}\mkern
6.0mu\mathfrak{p})$ for all totally positive
$\varepsilon\in\mathfrak{o}_{K}^{\times}$ with $\varepsilon\equiv 1\mkern
4.0mu({\operator@font mod}\mkern 6.0mu(N)^{(10^{10}\cdot
d\cdot[K:\mathbb{Q}])!})$ means (from the fact that $\overline{\chi}$ lifts to
a CM $p$-divisible group at each inertia group) that a particular product of
embeddings of $\varepsilon$ into a Galois closure $L$ of $K$ is $1$ modulo a
prime above $\mathfrak{p}$. But, considering this congruence only on
generators of this finite-index subgroup of $\mathfrak{o}_{K}^{\times}$, such
a product has explicitly bounded height, and $p$ is huge, so we must have
equality, not just congruence — at least on the generators. Multiplicativity
implies that said product of embeddings is trivial on a finite-index subgroup
of $\mathfrak{o}_{K}^{\times}$, and so, by the classification of algebraic
Hecke characters, it follows that there was in fact an algebraic Hecke
character $\psi$ such that
$\overline{\chi}|_{I_{\mathfrak{q}}}\equiv\psi|_{I_{\mathfrak{q}}}\mkern
4.0mu({\operator@font mod}\mkern 6.0mu\mathfrak{p})$. Similarly for
$\overline{\chi}^{\prime}$.

Twisting by $\psi^{-1}$ leaves a finite-order character with conductor
dividing an explicit constant depending on $N$, so that we conclude that there
are algebraic Hecke characters $\chi$ and $\chi^{\prime}$ of explicitly
bounded conductor such that $\chi\equiv\overline{\chi}\mkern
4.0mu({\operator@font mod}\mkern 6.0mu\mathfrak{p})$ and
$\chi^{\prime}\equiv\overline{\chi}^{\prime}\mkern 4.0mu({\operator@font
mod}\mkern 6.0mu\mathfrak{p})$.

Now consider the congruence
$\mathrm{tr}{\rho_{A,\mathfrak{p}}}\equiv\chi+\chi^{\prime}\mkern
4.0mu({\operator@font mod}\mkern 6.0mu\mathfrak{p})$. Choose an explicit
$\ell$ prime to $N$ and a prime $\lambda|(\ell)$ of $\mathfrak{o}_{E}$ above
$\ell$ and evaluate said congruence on an explicit Faltings-Serre set of
primes with respect to $\lambda$. Both sides are algebraic integers of
explicitly bounded height, so congruence modulo the huge $\mathfrak{p}$
implies equality — so in fact
$\mathrm{tr}{\rho_{A,\lambda}}=\chi+\chi^{\prime}$ on the Faltings-Serre set
(note that we have used compatibility of Frobenius traces at $\mathfrak{p}$
and at $\lambda$), whence $\rho_{A,\lambda}$ is reducible, a contradiction.

So indeed $\overline{\rho}_{A,\mathfrak{p}}$ is irreducible for $p$ explicitly
sufficiently large, completing our sketch. ∎

###  3.2 Faltings’ Lemma.

The second is Lemma $3.1$ of [2].

######  Lemma 3.3 (Faltings — see Lemma $3.1$ of [2].).

Let $d\in\mathbb{Z}^{+}$. Let $N\in\mathbb{Z}^{+}$. Let $X\in\mathbb{Z}^{+}$.
Let $K/\mathbb{Q}$ be a number field. Then: there is an explicit (thus
effectively computable) constant $C_{d,K,N,X}\in\mathbb{Z}^{+}$ such that the
following holds.

  * •

Let $\mathfrak{o}$ be an order in the ring of integers of a number field. Let
$\lambda|(\ell)$ be a prime of $\mathfrak{o}$ such that
$\\#|\mathfrak{o}/\lambda|\leq X$. Let
$\rho,\rho^{\prime}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathrm{GL}_{d}(\mathfrak{o}_{\lambda})$
be unramified outside primes dividing $N\ell$ and such that
$\mathrm{tr}(\rho(\mathrm{Frob}_{\mathfrak{p}}))=\mathrm{tr}(\rho^{\prime}(\mathrm{Frob}_{\mathfrak{p}}))$
for all primes $\mathfrak{p}\subseteq\mathfrak{o}_{K}$ of $\mathfrak{o}_{K}$
with $\mathfrak{p}\nmid(N\ell)$ and $\mathrm{Nm}\,{\mathfrak{p}}\leq
C_{d,K,N,X}$.

Then: $\mathrm{tr}\circ\rho=\mathrm{tr}\circ\rho^{\prime}$ on
$\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)$, and

$\mathbb{Z}_{p}[\rho(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=\mathbb{Z}_{p}[\\{\rho(\mathrm{Frob}_{\mathfrak{p}}):\mathfrak{p}\nmid(N\ell),\mathrm{Nm}\,{\mathfrak{p}}\leq
C_{d,K,N,X}\\}].$

(The second statement follows from Nakayama exactly as in the proof of Lemma
$3.1$ of [2].)

###  3.3 An observation of Silverberg.

The third is Theorem $3.5$ of [2].

######  Lemma 3.4 (Silverberg, Grothendieck — see Theorem $3.5$ of [2].).

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Then: there is an explicit finite Galois
extension $K^{\prime}/K$ depending only on $g$, $K$, and $S$ such that the
following holds.

  * •

Let $A/K$ be a $g$-dimensional abelian variety over $K$ with good reduction
outside $S$. Then: $A/K^{\prime}$ is split semistable and
$\text{End}_{K^{\prime}}(A)=\text{End}_{\overline{\mathbb{Q}}}(A)$.

Consequently its $K^{\prime}$-isogeny decomposition
$A\sim_{K^{\prime}}\prod_{i}B_{i}^{\times n_{i}}$ into $K^{\prime}$-simple
pairwise non-$K^{\prime}$-isogenous $B_{i}/K^{\prime}$ is such that all
$B_{i}/\overline{\mathbb{Q}}$ are $\overline{\mathbb{Q}}$-simple and pairwise
non-$\overline{\mathbb{Q}}$-isogenous.

###  3.4 The isogeny factorization of a $\mathrm{GL}_{2}$-type abelian
variety.

The fourth is Lemma $3.7$ of [2].

######  Lemma 3.5 (Lemma $3.7$ of [2].).

Let $K/\mathbb{Q}$ be a number field. Let $A/K$ be an abelian variety which is
of $\mathrm{GL}_{2}$-type over $K$. Then: either there is a $K$-simple abelian
variety $B/K$ of $\mathrm{GL}_{2}$-type over $K$ such that
$A\sim_{K}B^{\times\frac{\dim{A}}{\dim{B}}}$, or else there are two $K$-simple
abelian varieties $B_{1},B_{2}/K$ which are non-$K$-isogenous and admit
sufficiently many complex multiplications over $K$ such that
$A\sim_{K}B_{1}^{\times\frac{\dim{A}}{2\dim{B_{1}}}}\times
B_{2}^{\times\frac{\dim{A}}{2\dim{B_{2}}}}$.

##  4 A priori control of the endomorphism algebra.

######  Proposition 4.1.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Then: there is an explicit finite set of
(isomorphism classes of) $\mathbb{Q}$-algebras $\mathcal{R}_{g,K,S}^{0}$
depending only on $g$, $K$, and $S$ such that the following holds.

  * •

Let $A/K$ be a $g$-dimensional abelian variety of $\mathrm{GL}_{2}$-type over
$K$ which has good reduction outside $S$. Then:
$\text{End}_{K}^{0}(A)\in\mathcal{R}_{g,K,S}^{0}$.

###### Proof.

Let $N:=\prod_{\mathfrak{p}\in S}\mathrm{Nm}\,{\mathfrak{p}}$. Let $\ell$ be a
prime of $\mathbb{Z}$ which is prime to $N$. Let $X:=\ell^{10^{10}\cdot
g^{10^{10}}}$. Let $C_{2,K,N,X}$ be the explicit constant produced by the
proof of Theorem 3.1. Let $T$ be the finite set of primes
$\mathfrak{q}\subseteq\mathfrak{o}_{K}$ of $\mathfrak{o}_{K}$ such that
$\mathfrak{q}\nmid(N\ell)$ and $\mathrm{Nm}\,{\mathfrak{q}}\leq C_{2,K,N,X}$.

Let $A/K$ be an abelian variety of $\mathrm{GL}_{2}$-type over $K$. By Lemma
3.5 we see that either $A\sim_{K}B^{\times\frac{\dim{A}}{\dim{B}}}$ with $B/K$
$K$-simple and of $\mathrm{GL}_{2}$-type over $K$, or else
$A\sim_{K}B_{1}^{\times\frac{\dim{A}}{2\dim{B_{1}}}}\times
B_{2}^{\times\frac{\dim{A}}{2\dim{B_{2}}}}$ with $B_{1},B_{2}/K$ $K$-simple
and admitting sufficiently many complex multiplications over $K$. Note that
the $K$-isogeny factors of $A/K$ have good reduction outside $S$ (for example
by the Néron-Ogg-Shafarevich criterion aka by consideration of Néron models).

Let us deal with the second case, which we will call the "CM case". That is,
let us deal now with the case that
$A\sim_{K}B_{1}^{\times\frac{\dim{A}}{2\dim{B_{1}}}}\times
B_{2}^{\times\frac{\dim{A}}{2\dim{B_{2}}}}$ with $B_{1},B_{2}/K$ $K$-simple,
with good reduction outside $S$, and admitting sufficiently many complex
multiplications over $K$. Then the $B_{i}/K$ are in fact explicitly
determined: writing $K^{\text{CM}}\subseteq K$ for the maximal CM subfield of
$K$, we see that for each $i$ there is a CM type
$\Phi_{i}\subseteq\mathop{\text{Hom}}_{\mathbb{Q}\text{-alg.}}(K^{\text{CM}},\mathbb{C})$
such that, writing
$\Phi_{i}^{\prime}\subseteq\mathop{\text{Hom}}_{\mathbb{Q}\text{-alg.}}(K_{i},\mathbb{C})$
for the corresponding reflex CM type of the reflex field
$K_{i}\subseteq\mathbb{C}$, the CM Hecke character corresponding to the
$\ell$-adic Galois representations
$\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\overline{\mathbb{Q}}_{\ell}^{\times}$
associated to $B_{i}/K$ is the restriction of the CM character associated to
$\Phi_{i}$ (which is defined over a subfield of $K^{\text{CM}}$, since the
double reflex CM type $\Phi_{i}^{\prime\prime}$ is the primitive CM type which
induces $\Phi_{i}$). Thus $\text{End}_{K}^{0}(B_{i})\cong K_{i}$, and so
$\text{End}_{K}^{0}(A)\cong M_{\frac{\dim{A}}{2\dim{B_{1}}}}(K_{1})\times
M_{\frac{\dim{A}}{2\dim{B_{2}}}}(K_{2})$. Since the $K_{i}$ are determined by
the corresponding CM types
$\Phi_{i}\subseteq\mathop{\text{Hom}}_{\mathbb{Q}\text{-alg.}}(K^{\text{CM}},\mathbb{C})$,
we conclude that in this case $\text{End}_{K}^{0}(A)$ is determined up to an
explicit finite set of possibilities depending only on $g$, $K$, and $S$. The
CM case follows.

Now we move to the isotypic case, i.e. we consider those $g$-dimensional $A/K$
with good reduction outside $S$ and of $\mathrm{GL}_{2}$-type over $K$ for
which there is a $K$-simple abelian variety $B/K$ which is of
$\mathrm{GL}_{2}$-type over $K$ and such that
$A\sim_{K}B^{\times\frac{\dim{A}}{\dim{B}}}$. We immediately dispose of the
case that $B/K$ admits sufficiently many complex multiplications over $K$ by
taking $B_{1}:=B$ and $B_{2}:=0$ in the above argument treating the CM case.
Write $n:=\frac{\dim{A}}{\dim{B}}$ (thus $\dim{B}=\frac{g}{n}$), and
$D:=\text{End}_{K}^{0}(B)$. Let $F$ be the centre of $D$ — by the Albert
classification $F/\mathbb{Q}$ is CM. Let $d$ be the index of the division
algebra $D$ over $F$. Because $B/K$ does not admit sufficiently many complex
multiplications over $K$, by the Albert classification we find that either
$d=1$ or $F/\mathbb{Q}$ is totally real.

Let $E/\mathbb{Q}$ with $E\lhook\joinrel\longrightarrow
M_{n}(D)\simeq\text{End}_{K}^{0}(A)$ be CM and such that $[E:\mathbb{Q}]=g$.
By tensoring the inclusion $E\lhook\joinrel\longrightarrow M_{n}(D)$ up to
$\mathbb{C}$ we deduce that
$E\otimes_{\mathbb{Q}}\mathbb{C}\cong\mathbb{C}^{g}\lhook\joinrel\longrightarrow
M_{n}(D\otimes_{\mathbb{Q}}\mathbb{C})\cong
M_{dn}(\mathbb{C})^{\oplus[F:\mathbb{Q}]}$. Therefore $g\leq
dn\cdot[F:\mathbb{Q}]$. By the Albert classification we have that either
$F/\mathbb{Q}$ is totally real and $d\leq 2$ with
$d\cdot[F:\mathbb{Q}]\,\big{|}\,\dim{B}=\frac{g}{n}$, or else that
$F/\mathbb{Q}$ is imaginary CM and (because we have dealt with the CM case)
$d>1$ with $\frac{d^{2}\cdot[F:\mathbb{Q}]}{2}\,\big{|}\,\dim{B}=\frac{g}{n}$.
We deduce that $d\leq 2$ in both cases, and that
$\frac{g}{n}=d\cdot[F:\mathbb{Q}]$ so that $B/K$ is of $\mathrm{GL}_{2}$-type
over $K$.

Let us now show that the centre $F$ of $D$ is determined up to an explicit
finite set of possibilities depending only on $g$, $K$, and $S$.999This part
of the argument is an effectivization of an argument of Ribet (cf. in
particular his proofs of Propositions $3.5$ and $5.2$ in his [17] or his proof
of Theorem $2.3$ in his [16]).

Let $C\subseteq M_{n}(D)$ be the commutant of $E\lhook\joinrel\longrightarrow
M_{n}(D)$. Of course $F\subseteq C$. We claim that $C=E$. Indeed $C$ is a
division algebra because if $\varphi:B^{\times n}\longrightarrow B^{\times n}$
with $0\neq\varphi\in C$, then its image is $K$-isogenous to $B^{\times k}$
with $k\leq n$, and because $\varphi$ commutes with $E$ it follows that
$E\lhook\joinrel\longrightarrow M_{k}(D)$, which produces (after tensoring
with $\mathbb{C}$ as above) the inequality $g\leq
kd\cdot[F:\mathbb{Q}]=\frac{k}{n}\cdot g$, so $k=n$ and $\varphi$ is
surjective and thus a $K$-isogeny. Moreover, writing $E^{\prime}/E$ for the
centre of $C$, we find in precisely the same way that
$[E^{\prime}:\mathbb{Q}]\leq nd\cdot[F:\mathbb{Q}]=g=[E:\mathbb{Q}]$ so that
$E^{\prime}=E$. Thus $C$ is a division algebra with centre $E$. Writing
$\delta\in\mathbb{Z}^{+}$ for the index of $C$ over $E$, we deduce from
tensoring the inclusion $C\lhook\joinrel\longrightarrow M_{n}(D)$ up to
$\mathbb{C}$ the inclusion
$M_{\delta}(\mathbb{C})^{\oplus[E:\mathbb{Q}]}\lhook\joinrel\longrightarrow
M_{nd}(\mathbb{C})^{\oplus[F:\mathbb{Q}]}$ and thus the inequality $\delta
g\leq nd\cdot[F:\mathbb{Q}]=g$. Thus $\delta=1$ and so $C=E$. In particular
$F\subseteq E$.

Let now $\lambda\subseteq\mathfrak{o}_{E}$ be a prime of $\mathfrak{o}_{E}$
with $\lambda|(\ell)$. Write $\lambda^{\prime}\subseteq\mathfrak{o}_{F}$ with
$\lambda|\lambda^{\prime}$ for the prime of $\mathfrak{o}_{F}$ below
$\lambda$. Let
$\rho_{A,\lambda}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{E,\lambda})$
be the $\lambda$-adic representation corresponding to
$E\lhook\joinrel\longrightarrow\text{End}_{K}^{0}(A)$. Let
$\rho_{B,\lambda^{\prime}}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow(D^{\text{opp.}}\otimes_{F}F_{\lambda^{\prime}})^{\times}\subseteq\mathrm{GL}_{2d}(F_{\lambda^{\prime}})$
be the $\lambda^{\prime}$-adic representation (produced via e.g. the double
centralizer theorem) corresponding to
$D\lhook\joinrel\longrightarrow\text{End}_{K}^{0}(B)$. Write, for
$\mathfrak{q}\in T$,

$a_{\mathfrak{q}}:=\mathrm{tr}(\rho_{A,\lambda}(\mathrm{Frob}_{\mathfrak{q}}))\in\mathfrak{o}_{E}.$

Note that
$a_{\mathfrak{q}}=\mathrm{tr}(\rho_{B,\lambda^{\prime}}(\mathrm{Frob}_{\mathfrak{q}}))\in\mathfrak{o}_{F}$
as well.

We claim that $\mathbb{Q}(\\{a_{\mathfrak{q}}\\}_{\mathfrak{q}\in T})=F$.

We have noted the forward inclusion already, so let us show the reverse
inclusion via an effective form of a standard argument (cf. e.g. Ribet’s proof
of Proposition $3.5$ in his [17]). For
$\sigma:F\lhook\joinrel\longrightarrow\overline{\mathbb{Q}}_{\ell}$, write
$\lambda_{\sigma}^{\prime}|(\ell)$ for the corresponding prime of
$\mathfrak{o}_{F}$. Similarly, for
$\tau:F^{\prime}\lhook\joinrel\longrightarrow\overline{\mathbb{Q}}_{\ell}$,
write $\lambda_{\tau}^{\prime\prime}|(\ell)$ for the corresponding prime of
$\mathfrak{o}_{F^{\prime}}$. Note that then $\sigma$ extends to an embedding
$F_{\lambda_{\sigma}^{\prime}}\lhook\joinrel\longrightarrow\overline{\mathbb{Q}}_{\ell}$,
and similarly $\tau$ extends to an embedding
$F_{\lambda_{\tau}^{\prime\prime}}^{\prime}\lhook\joinrel\longrightarrow\overline{\mathbb{Q}}_{\ell}$.
From the isomorphisms

$\displaystyle\rho_{B,\ell}\otimes_{\mathbb{Q}_{\ell}}\overline{\mathbb{Q}}_{\ell}$
$\displaystyle\simeq\bigoplus_{\tau:F^{\prime}\hookrightarrow\overline{\mathbb{Q}}_{\ell}}\rho_{B,\lambda_{\tau}^{\prime\prime}}\otimes_{F_{\lambda_{\tau}^{\prime\prime}}^{\prime},\tau}\overline{\mathbb{Q}}_{\ell}$
$\displaystyle\simeq\bigoplus_{\sigma:F\hookrightarrow\overline{\mathbb{Q}}_{\ell}}\bigoplus_{\tau:F^{\prime}\hookrightarrow\overline{\mathbb{Q}}_{\ell}\text{
s.t.\,}\tau|_{F}=\sigma}\rho_{B,\lambda_{\tau}^{\prime\prime}}\otimes_{F_{\lambda_{\tau}^{\prime\prime}}^{\prime},\tau}\overline{\mathbb{Q}}_{\ell},$

and

$\text{End}_{\overline{\mathbb{Q}}_{\ell}[\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)]}(\rho_{B,\ell}\otimes_{\mathbb{Q}_{\ell}}\overline{\mathbb{Q}}_{\ell})\simeq\bigoplus_{\sigma:F\hookrightarrow\overline{\mathbb{Q}}_{\ell}}M_{2}(\overline{\mathbb{Q}}_{\ell})$

(via Faltings’ proof of the Tate conjecture for endomorphisms of abelian
varieties), we conclude that, for
$\tau,\tau^{\prime}:F^{\prime}\lhook\joinrel\longrightarrow\overline{\mathbb{Q}}_{\ell}$,
there is an isomorphism of absolutely irreducible representations
$\rho_{B,\lambda_{\tau}^{\prime\prime}}\otimes_{F_{\lambda_{\tau}^{\prime\prime}}^{\prime},\tau}\overline{\mathbb{Q}}_{\ell}\cong\rho_{B,\lambda_{\tau^{\prime}}^{\prime\prime}}\otimes_{F_{\lambda_{\tau^{\prime}}^{\prime\prime}}^{\prime},\tau^{\prime}}\overline{\mathbb{Q}}_{\ell}$
if and only if $\tau|_{F}=\tau^{\prime}|_{F}$. In particular, if
$\tau|_{F}\neq\tau^{\prime}|_{F}$ the representations
$\rho_{B,\lambda_{\tau}^{\prime\prime}}$ and
$\rho_{B,\lambda_{\tau^{\prime}}^{\prime\prime}}$ are not isomorphic.

Now we use Lemma 3.3. For each
$\tau:F^{\prime}\lhook\joinrel\longrightarrow\overline{\mathbb{Q}}_{\ell}$
with $\sigma:=\tau|_{F}$,

$\sigma(a_{\mathfrak{q}})=\mathrm{tr}(\rho_{B,\lambda_{\tau}^{\prime\prime}}(\mathrm{Frob}_{\mathfrak{q}})).$

Because the tuple $(\sigma(a_{\mathfrak{q}}))_{\mathfrak{q}\in T}$ determines
the isomorphism class of the irreducible representation
$\rho_{B,\lambda_{\tau}^{\prime\prime}}$ by our choice of $T$ and Lemma 3.3,
we have proven that
$\sigma(a_{\mathfrak{q}})=\sigma^{\prime}(a_{\mathfrak{q}})$ for all
$\mathfrak{q}\in T$ only if $\sigma=\sigma^{\prime}$ as embeddings
$F\lhook\joinrel\longrightarrow\overline{\mathbb{Q}}_{\ell}$. Therefore
$\mathbb{Q}(\\{a_{\mathfrak{q}}\\}_{\mathfrak{q}\in T})=F$ as desired.

Now because $a_{\mathfrak{q}}\in\mathfrak{o}_{F}$ and also because by Weil’s
[24] for all infinite places $v$ of $F$ we have that
$|a_{\mathfrak{q}}|_{v}\leq 2\sqrt{\mathrm{Nm}\,{\mathfrak{q}}}$, it follows
that all the $a_{\mathfrak{q}}$ are algebraic integers of bounded height. Thus
$F/\mathbb{Q}$ is an extension of bounded degree and discriminant and thus by
Minkowski’s proof of the Hermite-Minkowski theorem lies in an explicit finite
set of possibilities depending only on $g$, $K$, and $S$.

So we have deduced that the centre $F$ of $D$ is determined up to an explicit
finite set of possibilities depending only on $g$, $K$, and $S$. Let us next
show that furthermore the absolute norm of the discriminant of $D/F$ is
$\ll_{g,K,S}1$.

The statement is of course evident when $d=1$ (and thus $D=F$) since said
discriminant is $1$. Thus we need only treat the case $d=2$, i.e. the case
that $D/F$ is a quaternion algebra. Let $F^{\prime}/F$ be a quadratic
extension splitting $D$. Let $p\geq 10^{10}$ be a prime of $\mathbb{Z}$. Let
$\mathfrak{p}\subseteq\mathfrak{o}_{F}$ be a prime of $\mathfrak{o}_{F}$ such
that $\mathfrak{p}|(p)$ and $D$ is ramified at $\mathfrak{p}$, i.e.
$D_{\mathfrak{p}}:=D\otimes_{F}F_{\mathfrak{p}}$ is a division algebra over
$F_{\mathfrak{p}}$. Because $F^{\prime}$ splits $D$ it follows that
$\mathfrak{p}$ is not split in $F^{\prime}$ (else
$F^{\prime}_{\mathfrak{p}^{\prime}}\simeq F_{\mathfrak{p}}$ for all primes
$\mathfrak{p}^{\prime}\subseteq\mathfrak{o}_{F^{\prime}}$ of
$\mathfrak{o}_{F^{\prime}}$ with $\mathfrak{p}^{\prime}|\mathfrak{p}$, and so
$D\otimes_{F}F_{\mathfrak{p}^{\prime}}^{\prime}$ would be a division algebra).
Let $\mathfrak{p}^{\prime}\subseteq\mathfrak{o}_{F^{\prime}}$ with
$\mathfrak{p}^{\prime}|\mathfrak{p}$ be the unique prime of
$\mathfrak{o}_{F^{\prime}}$ above $\mathfrak{p}$. Let $\pi$ be a uniformizer
of $\mathfrak{p}$. Let $u\in\mathfrak{o}_{F,\mathfrak{p}}^{\times}$ be a
nonsquare unit. Recall from the classification of quaternion algebras over
$p$-adic fields that there is a unique quaternion algebra, namely the one with
symbol $(\pi,u)_{\mathfrak{p}}$, which is a division algebra over
$F_{\mathfrak{p}}$, and so $D_{\mathfrak{p}}$ is the quaternion algebra over
$F_{\mathfrak{p}}$ with symbol $(\pi,u)_{\mathfrak{p}}$. Thus
$D_{\mathfrak{p}}$ has $F_{\mathfrak{p}}$-basis $(1,i,j,k)$ with $i^{2}=\pi$,
$j^{2}=u$, and $k:=ij=-ji$. Moreover it has a unique maximal order, namely
$\mathfrak{o}_{D,\mathfrak{p}}:=\mathfrak{o}_{F,\mathfrak{p}}\cdot
1+\mathfrak{o}_{F,\mathfrak{p}}\cdot i+\mathfrak{o}_{F,\mathfrak{p}}\cdot
j+\mathfrak{o}_{F,\mathfrak{p}}\cdot k$ (aka the set of elements with integral
norm).

Now because $\mathfrak{p}$ is not split in $F^{\prime}$ (and $p$ is large) it
follows that either
$F_{\mathfrak{p}^{\prime}}^{\prime}=F_{\mathfrak{p}}(\sqrt{\pi})$ or else
$F_{\mathfrak{p}^{\prime}}^{\prime}=F_{\mathfrak{p}}(\sqrt{u})$. We break into
cases.

First let us deal with the ramified case, i.e. the case
$F_{\mathfrak{p}^{\prime}}^{\prime}=F_{\mathfrak{p}}(\sqrt{\pi})$. Let
$\pi^{\prime}:=\sqrt{\pi}$ be a uniformizer of $\mathfrak{p}^{\prime}$. Recall
that
$\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}=\mathfrak{o}_{F,\mathfrak{p}}[\pi^{\prime}]$
and that
$\mathfrak{o}_{F}/\mathfrak{p}\simeq\mathfrak{o}_{F^{\prime}}/\mathfrak{p}^{\prime}$.
Because $D_{\mathfrak{p}}$ is a division algebra and
$F^{\prime}\lhook\joinrel\longrightarrow D$ (and so
$F_{\mathfrak{p}^{\prime}}^{\prime}\lhook\joinrel\longrightarrow
D_{\mathfrak{p}}$), it follows101010Writing $\alpha\in D$ for the image of
$\sqrt{\pi}\in F_{\mathfrak{p}^{\prime}}^{\prime}$ and
$\ell_{i},r_{\alpha}:D\longrightarrow D$ for the (commuting) $F$-linear
transformations given by $\ell_{i}(x)=i\cdot x$ and
$r_{\alpha}(x)=x\cdot\alpha$, we have that
$(\ell_{i}-r_{\alpha})\cdot(\ell_{i}+r_{\alpha})=0$, whence one of the two
factors has a nonzero kernel, and a nonzero element in said kernel conjugates
$\alpha$ to $\pm i$. that we may without loss of generality take the embedding
$F_{\mathfrak{p}^{\prime}}^{\prime}\lhook\joinrel\longrightarrow
D_{\mathfrak{p}}$ to be via $\pi^{\prime}\mapsto\pm i$. By precomposing with
an element of
$\mathop{\mathrm{Gal}}(F_{\mathfrak{p}^{\prime}}^{\prime}/F_{\mathfrak{p}})=\mathop{\mathrm{Gal}}(F^{\prime}/F)$
if necessary we may and will arrange that the embedding is via
$\pi^{\prime}\mapsto i$. Note then that
$\mathfrak{o}_{D,\mathfrak{p}}=\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}+\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}\cdot
j$.

Using this basis (i.e. $(1,j)$), we see that the action of
$\mathfrak{o}_{D,\mathfrak{p}}$ on $\mathfrak{o}_{D,\mathfrak{p}}$, regarded
as a free $\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}$-module of rank
$2$, is given by
$\mathfrak{o}_{D,\mathfrak{p}}\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}})$
via

$a+bi+cj+dk\mapsto\left(\begin{array}[]{cc}a+b\pi^{\prime}&u\cdot(c+d\pi^{\prime})\\\
c+d\pi^{\prime}&a-b\pi^{\prime}\end{array}\right).$

Therefore the action of
$\mathfrak{o}_{D,\mathfrak{p}}\otimes_{\mathfrak{o}_{F,\mathfrak{p}}}\mathfrak{o}_{F}/\mathfrak{p}$
on
$\mathfrak{o}_{D,\mathfrak{p}}\otimes_{\mathfrak{o}_{F,\mathfrak{p}}}\mathfrak{o}_{F}/\mathfrak{p}=\mathfrak{o}_{D,\mathfrak{p}}\otimes_{\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}}\mathfrak{o}_{F^{\prime}}/\mathfrak{p}^{\prime}$
is given by

$a+bi+cj+dk\mapsto\left(\begin{array}[]{cc}a&u\cdot c\\\
c&a\end{array}\right)\bmod{\mathfrak{p}^{\prime}}\in\mathrm{GL}_{2}(\mathfrak{o}_{F}/\mathfrak{p}),$

which is visibly abelian (indeed the image lies in the nonsplit Cartan) and
thus not absolutely irreducible.

Therefore it follows that the $\mathfrak{p}^{\prime}$-adic representation
$\rho_{B,\mathfrak{p}^{\prime}}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow(\mathfrak{o}_{D,\mathfrak{p}}^{\text{opp.}})^{\times}\lhook\joinrel\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}})$
does not have an absolutely irreducible residual representation. We conclude
from Theorem 3.1 that $p\ll_{g,K,S}1$.

We treat the unramified case, i.e. the case
$F_{\mathfrak{p}^{\prime}}^{\prime}=F_{\mathfrak{p}}(\sqrt{u})$, in the same
way. Now we choose as uniformizer $\pi^{\prime}:=\pi$, observe that
$\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}=\mathfrak{o}_{F,\mathfrak{p}}[\sqrt{u}]$,
and see that, up to precomposing with an element of
$\mathop{\mathrm{Gal}}(F_{\mathfrak{p}^{\prime}}^{\prime}/F_{\mathfrak{p}})=\mathop{\mathrm{Gal}}(F^{\prime}/F)$
if necessary, we may without loss of generality take the embedding
$F_{\mathfrak{p}^{\prime}}^{\prime}\lhook\joinrel\longrightarrow
D_{\mathfrak{p}}$ to be given by $\sqrt{u}\mapsto j$. Thus we may use $(1,i)$
as our $\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}$-basis of
$\mathfrak{o}_{D,\mathfrak{p}}$, and in this basis the action of
$\mathfrak{o}_{D,\mathfrak{p}}$ on $\mathfrak{o}_{D,\mathfrak{p}}$, regarded
as a free $\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}$-module of rank
$2$, is given by

$a+bi+cj+dk\mapsto\left(\begin{array}[]{cc}a+c\sqrt{u}&\pi\cdot(b+d\sqrt{u})\\\
b+d\sqrt{u}&a-c\sqrt{u}\end{array}\right).$

Thus the action of
$\mathfrak{o}_{D,\mathfrak{p}}\otimes_{\mathfrak{o}_{F,\mathfrak{p}}}\mathfrak{o}_{F}/\mathfrak{p}$
on
$\mathfrak{o}_{\mathfrak{p}}\otimes_{\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}}\mathfrak{o}_{F^{\prime}}/\mathfrak{p}^{\prime}$
is given by

$a+bi+cj+dk\mapsto\left(\begin{array}[]{cc}a+c\sqrt{u}&0\\\
b+d\sqrt{u}&a-c\sqrt{u}\end{array}\right)\bmod{\mathfrak{p}^{\prime}}\in\mathrm{GL}_{2}(\mathfrak{o}_{F^{\prime}}/\mathfrak{p}^{\prime}),$

which is again visibly not irreducible since its image lies in a Borel.

Therefore it follows that the $\mathfrak{p}^{\prime}$-adic representation
$\rho_{B,\mathfrak{p}^{\prime}}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow(\mathfrak{o}_{D,\mathfrak{p}}^{\text{opp.}})^{\times}\lhook\joinrel\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}})$
does not have absolutely irreducible residual representation, and so we again
conclude that $p\ll_{g,K,S}1$.

So in sum we have bounded the absolute norm of the discriminant of $D/F$,
since we have shown that the only primes at which $D/F$ may ramify are of norm
$\ll_{g,K,S}1$.

We conclude that there is an explicit finite set of possibilities depending
only on $g$, $K$, and $S$ for $D=\text{End}_{K}^{0}(B)$. We are done. ∎

Let us also record the following corollary.

######  Corollary 4.2.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Then: there is an explicit finite set of
(isomorphism classes of) $\mathbb{Q}$-algebras
$\widetilde{\mathcal{R}}_{g,K,S}^{0}$ depending only on $g$, $K$, and $S$ such
that the following holds.

  * •

Let $A/K$ be a $g$-dimensional abelian variety of $\mathrm{GL}_{2}$-type over
$K$ which has good reduction outside $S$. Then:
$\text{End}_{\overline{\mathbb{Q}}}^{0}(A)\in\widetilde{\mathcal{R}}_{g,K,S}^{0}$.

###### Proof.

Let $K^{\prime}/K$ be the explicit finite Galois extension produced by the
proof of Lemma 3.4 and let
$\widetilde{\mathcal{R}}_{g,K,S}^{0}:=\mathcal{R}_{g,K^{\prime},S}^{0}$. ∎

##  5 Two "large image" propositions.

Now let us state the two intermediate results we will use.

###  5.1 Large primes.

Let us first deal with large primes.

######  Proposition 5.1.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Then: there is an explicit (thus effectively
computable) constant $C_{g,K,S}\in\mathbb{Z}^{+}$ depending only on $g$, $K$,
and $S$ such that the following two statements hold.

  * •

Let $p\geq C_{g,K,S}$ be a prime of $\mathbb{Z}$. Let $F/\mathbb{Q}$ be a
number field of degree $[F:\mathbb{Q}]=g$. Let $A/K$ be a $g$-dimensional
abelian variety over $K$ admitting
$\mathfrak{o}_{F}\simeq\text{End}_{K}(A)=\text{End}_{\overline{\mathbb{Q}}}(A)$
which has good reduction outside $S$ and does not admit sufficiently many
complex multiplications over $\overline{\mathbb{Q}}$. Write
$\rho_{A,p}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{F,p})$
for the $2$-dimensional representation corresponding to the
$\mathfrak{o}_{F}[\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)]$-module
structure of $T_{p}(A)$. Then:
$\mathbb{Z}_{p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=M_{2}(\mathfrak{o}_{F,p})$.

  * •

Let $p\geq C_{g,K,S}$ be a prime of $\mathbb{Z}$. Let $F/\mathbb{Q}$ be a
number field of degree $[F:\mathbb{Q}]=\frac{g}{2}$ and let $D/F$ be a
quaternion algebra over $F$. Let $\mathfrak{o}\subseteq D$ be a maximal order.
Let $A/K$ be a $g$-dimensional abelian variety over $K$ admitting
$\mathfrak{o}\simeq\text{End}_{K}(A)=\text{End}_{\overline{\mathbb{Q}}}(K)$
which has good reduction outside $S$ and does not admit sufficiently many
complex multiplications over $\overline{\mathbb{Q}}$. Write
$\rho_{A,p}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow(\mathfrak{o}_{p}^{\text{opp.}})^{\times}$
for the representation corresponding to the
$\mathfrak{o}[\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)]$-module
structure of $T_{p}(A)$. Then:
$\mathbb{Z}_{p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=\mathfrak{o}_{p}^{\text{opp.}}$.

###### Proof.

Certainly in both cases $A/K$ is $K$-simple.

By Proposition 4.1 it follows that $\text{End}_{K}^{0}(A)$ lies in an explicit
finite set. By the finiteness of the class number, whence type number, of a
quaternion algebra over a number field, it follows that the maximal order
$\text{End}_{K}(A)$ lies in an explicit finite set as well.

Let $N:=\prod_{\mathfrak{p}\in S}(\mathrm{Nm}\,{\mathfrak{p}})$. Let
$\ell\in\mathbb{Z}^{+}$ be the smallest prime of $\mathbb{Z}$ which is prime
to $10^{10}!\cdot N$.

Let $T$ be the finite set of primes produced by Lemma 3.3 with parameters
$(2,K,N,\ell^{10^{10g}})$.

Let, via Minkowski’s proof of the Hermite-Minkowski theorem, $L/K$ be an
explicit finite extension such that, for all finite-order characters
$\psi:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathbb{C}^{\times}$
of conductor dividing $\Delta_{N}:=N^{10^{10g}\cdot[K:\mathbb{Q}]}$,
$\psi|_{\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/L)}=\mathrm{triv}$.

Let us deal with the first case first. Let $A/K$ be a $g$-dimensional abelian
variety over $K$ admitting $\mathfrak{o}_{F}\simeq\text{End}_{K}(A)$ which has
good reduction outside $S$ and which does not admit sufficiently many complex
multiplications over $\overline{\mathbb{Q}}$.

Now $\chi_{p}^{-1}\cdot\det{\rho_{A,p}}$ is finite-order and of conductor
dividing $\Delta_{N}$. Thus
$\det{\rho_{A,p}}|_{\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/L)}=\chi_{p}$
and in particular has image in $\mathbb{Z}_{p}^{\times}$.

It of course suffices to show the claim after restricting to
$\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/L)$, so without loss of
generality $L=K$ and $\det{\rho_{A,p}}$ is valued in
$\mathbb{Z}_{p}^{\times}$.

Now for all $g\in\mathrm{GL}_{2}(\mathfrak{o}_{F,p})$ we have that

$g+(\det{g})\cdot g^{-1}=(\mathrm{tr}\,{g})\cdot\mathop{\mathrm{id}}.$

Applying this identity to all $\mathrm{Frob}_{\mathfrak{q}}$ with
$\mathfrak{q}\in T$ we find that

$\mathbb{Z}_{p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]\supseteq\mathbb{Z}[\\{\mathrm{tr}(\rho_{A,p}(\mathrm{Frob}_{\mathfrak{q}})):\mathfrak{q}\in
T\\}]\otimes_{\mathbb{Z}}\mathbb{Z}_{p}.$

Of course by strict compatibility we have that
$\mathrm{tr}(\rho_{A,p}(\mathrm{Frob}_{\mathfrak{q}}))\in\mathfrak{o}_{F}\lhook\joinrel\longrightarrow\mathfrak{o}_{F,p}$
for all $\mathfrak{q}\in T$.

Now by the second part of Lemma 3.3 it follows that
$\mathbb{Q}_{\ell}[\mathrm{tr}(\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)))]=\mathbb{Q}_{\ell}[\\{\mathrm{tr}(\rho_{A,p}(\mathrm{Frob}_{\mathfrak{q}})):\mathfrak{q}\in
T\\}]$. Writing
$\rho_{A,\ell}\otimes_{\mathbb{Z}_{\ell}}\overline{\mathbb{Q}}_{\ell}=:\bigoplus_{\lambda|(\ell)}\bigoplus_{\sigma:F_{\lambda}\lhook\joinrel\longrightarrow\overline{\mathbb{Q}}_{\ell}}\rho_{A,\lambda}\otimes_{\mathfrak{o}_{F,\lambda},\sigma}\overline{\mathbb{Q}}_{\ell}$
(with the obvious notation), it follows from Faltings’ proof of the Tate
conjecture that the
$\rho_{A,\lambda}\otimes_{\mathfrak{o}_{F,\lambda},\sigma}\overline{\mathbb{Q}}_{\ell}$
are pairwise non-isomorphic as $\overline{\mathbb{Q}}_{\ell}$-representations.

By Lemma 3.3 and Brauer-Nesbitt it follows that, for all embeddings
$\sigma,\sigma^{\prime}:F\lhook\joinrel\longrightarrow\overline{\mathbb{Q}}_{\ell}$,
the equality
$\sigma(\mathrm{tr}(\rho_{A,\ell}(\mathrm{Frob}_{\mathfrak{q}})))=\sigma^{\prime}(\mathrm{tr}(\rho_{A,\ell}(\mathrm{Frob}_{\mathfrak{q}})))$
holds for all $\mathfrak{q}\in T$ if and only if $\sigma=\sigma^{\prime}$.

Consequently
$\mathbb{Z}[\\{\mathrm{tr}(\rho_{A,\ell}(\mathrm{Frob}_{\mathfrak{q}}):\mathfrak{q}\in
T\\}]\subseteq\mathfrak{o}_{F}$ is of finite index. Since by e.g. purity the
generators $\mathrm{tr}(\rho_{A,\ell}(\mathrm{Frob}_{\mathfrak{q}}))$ are of
bounded height, it follows that the discriminant of
$\mathbb{Z}[\\{\mathrm{tr}(\rho_{A,\ell}(\mathrm{Frob}_{\mathfrak{q}}):\mathfrak{q}\in
T\\}]$ is $\ll_{g,K,S}1$, whence the same bound holds for its index in
$\mathfrak{o}_{F}$, whence we have that

$\mathbb{Z}_{p}[\\{\mathrm{tr}(\rho_{A,\ell}(\mathrm{Frob}_{\mathfrak{q}}):\mathfrak{q}\in
T\\}]=\mathfrak{o}_{F,p}.$

We conclude that
$\mathbb{Z}_{p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]\supseteq\mathfrak{o}_{F,p}$,
or in other words that

$\mathbb{Z}_{p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=\mathfrak{o}_{F,p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=\bigoplus_{\mathfrak{p}|(p)}\mathfrak{o}_{F,\mathfrak{p}}[\rho_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))].$

Now by Lemma 3.1 it follows that
$\overline{\rho}_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))$
contains a conjugate of $\mathrm{SL}_{2}(\mathbb{F}_{p})$. Thus evidently
$\mathfrak{o}_{F,\mathfrak{p}}[\overline{\rho}_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]\otimes_{\mathfrak{o}_{F}}\mathfrak{o}_{F}/\mathfrak{p}=M_{2}(\mathfrak{o}_{F}/\mathfrak{p})$.

Thus by Nakayama we find that
$\mathfrak{o}_{F,\mathfrak{p}}[\rho_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=M_{2}(\mathfrak{o}_{F,\mathfrak{p}})$,
whence

$\mathbb{Z}_{p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=M_{2}(\mathfrak{o}_{F,p})$

as desired.

So we have dealt with the first case.

But the above treats the second case as well since $D_{p}\simeq M_{2}(F_{p})$
because $p$ is large (since by Proposition 4.1 the discriminant of
$\mathfrak{o}$ is $\ll_{g,K,S}1$). By uniqueness up to conjugation of the
maximal order $M_{2}(\mathfrak{o}_{F,\mathfrak{p}})$ of
$M_{2}(F_{\mathfrak{p}})$, it follows that, up to conjugation by an element of
$D_{p}^{\times}$, $\mathfrak{o}_{p}\simeq M_{2}(\mathfrak{o}_{F,p})$, and now
the entire argument goes through verbatim. So we are done. ∎

###  5.2 Small primes.

Now let us prove the corresponding statement for small primes.

######  Proposition 5.2.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Let $p$ be a prime of $\mathbb{Z}$. Then: there
is an effectively computable constant $C_{g,K,S,p}\in\mathbb{Z}^{+}$ depending
only on $g$, $K$, $S$, and $p$ such that the following two statements hold.

  * •

Let $F/\mathbb{Q}$ be a number field of degree $[F:\mathbb{Q}]=g$. Let $A/K$
be a split semistable $g$-dimensional abelian variety over $K$ admitting
$\mathfrak{o}_{F}\simeq\text{End}_{K}(A)=\text{End}_{\overline{\mathbb{Q}}}(A)$
which has good reduction outside $S$ and does not admit sufficiently many
complex multiplications over $\overline{\mathbb{Q}}$. Write
$\rho_{A,p}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{F,p})$
for the $2$-dimensional representation corresponding to the
$\mathfrak{o}_{F}[\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)]$-module
structure of $T_{p}(A)$. Then:

$[M_{2}(\mathfrak{o}_{F,p}):\mathbb{Z}_{p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]]\leq
C_{g,K,S,p}.$

  * •

Let $F/\mathbb{Q}$ be a number field of degree $[F:\mathbb{Q}]=\frac{g}{2}$
and let $D/F$ be a quaternion algebra over $F$. Let $\mathfrak{o}\subseteq D$
be a maximal order. Let $A/K$ be a split semistable $g$-dimensional abelian
variety over $K$ admitting
$\mathfrak{o}\simeq\text{End}_{K}(A)=\text{End}_{\overline{\mathbb{Q}}}(K)$
which has good reduction outside $S$ and does not admit sufficiently many
complex multiplications over $\overline{\mathbb{Q}}$. Write
$\rho_{A,p}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow(\mathfrak{o}_{p}^{\text{opp.}})^{\times}$
for the representation corresponding to the
$\mathfrak{o}[\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)]$-module
structure of $T_{p}(A)$. Then:

$[\mathfrak{o}_{p}^{\text{opp.}}:\mathbb{Z}_{p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]]\leq
C_{g,K,S,p}.$

Of course for $p\gg_{g,K,S}1$ Proposition 5.2 follows from Proposition 5.1.

The proposition will follow from the following.

######  Lemma 5.3.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Let $p$ be a prime of $\mathbb{Z}$. Let
$X\in\mathbb{Z}^{+}$. Then: there is an effectively computable constant
$C_{g,K,S,X}\in\mathbb{Z}^{+}$ depending only on $g$, $K$, $S$, and $X$ such
that the following statement holds.

  * •

Let $F/\mathbb{Q}$ be a number field of degree $[F:\mathbb{Q}]\leq g$. Let
$F^{\prime}/F$ be an extension of degree $[F^{\prime}:F]\leq 2$ with relative
discriminant $|\mathrm{Nm}\,{\Delta_{F^{\prime}/F}}|\leq X$. Let
$\mathfrak{p}\subseteq\mathfrak{o}_{F}$ with $\mathfrak{p}|(p)$ be a prime of
$\mathfrak{o}_{F}$. Let
$\mathfrak{p}^{\prime}\subseteq\mathfrak{o}_{F^{\prime}}$ with
$\mathfrak{p}^{\prime}|\mathfrak{p}$ be a prime of
$\mathfrak{o}_{F^{\prime}}$. Let
$\overline{\chi},\overline{\chi}^{\prime}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\left(\mathfrak{o}_{F^{\prime}}/\mathfrak{p}^{\prime
2n\cdot e(\mathfrak{p}^{\prime}/\mathfrak{p})}\right)^{\times}$. Let $A/K$ be
a split semistable $g$-dimensional abelian variety over $K$ admitting
$F\lhook\joinrel\longrightarrow\text{End}_{K}^{0}(A)=\text{End}_{\overline{\mathbb{Q}}}^{0}(A)\in\widetilde{\mathcal{R}}_{g,K,S}^{0}$
which is $K$-simple, has good reduction outside $S$, does not admit
sufficiently many complex multiplications over $\overline{\mathbb{Q}}$, and is
such that $0\longrightarrow\overline{\chi}\longrightarrow
A[\mathfrak{p}^{2n}]\otimes_{\mathfrak{o}_{F,\mathfrak{p}}}\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}\longrightarrow\overline{\chi}^{\prime}\longrightarrow
0$.

Then: $n\leq C_{g,K,S,X}$.

Again for $p\gg_{g,K,S}1$ this follows from Proposition 5.1.

To prove Lemma 5.3 we will essentially repeat verbatim our implicit proof of
Lemma 3.1 via our citation of our [1, 2] — we will lift the semisimplification
to a direct sum of algebraic Hecke characters of bounded conductor (and
weight) and then compare Frobenius traces at a Faltings-Serre set at a
suitable reference prime (in this case just $\mathfrak{p}$), where a
congruence mod $\mathfrak{p}^{n}$ for $n\gg_{g,K,S}1$ would imply equality and
thus reducibility of the $\mathfrak{p}$-adic representation, a contradiction.

However to repeat said proof we need to be able to lift a
mod-$\mathfrak{p}^{n}$ character to an algebraic Hecke character when
$n\gg_{g,K,S}1$. That we can do this will be guaranteed by the following.

######  Lemma 5.4.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let $S$ be a
finite set of places of $K$. Let $p$ be a prime of $\mathbb{Z}$. Let
$X\in\mathbb{Z}^{+}$. Then: there is an effectively computable constant
$C_{g,K,S,X}\in\mathbb{Z}^{+}$ depending only on $g$, $K$, $S$, and $X$ such
that the following statement holds.

  * •

Let $n\geq C_{g,K,S,X}$. Let $F/\mathbb{Q}$ be a number field of degree
$[F:\mathbb{Q}]\leq g$. Let $F^{\prime}/F$ be an extension of degree
$[F^{\prime}:F]\leq 2$ with relative discriminant
$|\mathrm{Nm}\,{\Delta_{F^{\prime}/F}}|\leq X$. Let
$\mathfrak{p}\subseteq\mathfrak{o}_{F}$ with $\mathfrak{p}|(p)$ be a prime of
$\mathfrak{o}_{F}$. Let
$\mathfrak{p}^{\prime}\subseteq\mathfrak{o}_{F^{\prime}}$ with
$\mathfrak{p}^{\prime}|\mathfrak{p}$ be a prime of
$\mathfrak{o}_{F^{\prime}}$. Let
$\overline{\chi}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\left(\mathfrak{o}_{F^{\prime}}/\mathfrak{p}^{\prime
2n\cdot e(\mathfrak{p}^{\prime}/\mathfrak{p})}\right)^{\times}$. Let $A/K$ be
a split semistable $g$-dimensional abelian variety over $K$ admitting
$F\lhook\joinrel\longrightarrow\text{End}_{K}^{0}(A)=\text{End}_{\overline{\mathbb{Q}}}^{0}(A)\in\widetilde{\mathcal{R}}_{g,K,S}^{0}$
which is $K$-simple, has good reduction outside $S$, does not admit
sufficiently many complex multiplications over $\overline{\mathbb{Q}}$, and is
such that $\overline{\chi}\lhook\joinrel\longrightarrow
A[\mathfrak{p}^{2n}]\otimes_{\mathfrak{o}_{F,\mathfrak{p}}}\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}$.

Then: there is an algebraic Hecke character $\chi$ of $K$ of weight $\leq 1$
and conductor dividing $\prod_{\mathfrak{q}\in
S}(\mathrm{Nm}\,{\mathfrak{q}})^{10^{10g}\cdot[K:\mathbb{Q}]}$ valued in an
extension $F^{\prime\prime}/F^{\prime}$ and a prime
$\mathfrak{p}^{\prime\prime}\subseteq\mathfrak{o}_{F^{\prime\prime}}$ with
$\mathfrak{p}^{\prime\prime}|\mathfrak{p}^{\prime}$ such that
$\chi\equiv\overline{\chi}\mkern 4.0mu({\operator@font mod}\mkern
6.0mu\mathfrak{p}^{\prime\prime 2n\cdot
e(\mathfrak{p}^{\prime\prime}/\mathfrak{p})})$, where we have also written
$\chi$ for the $\mathfrak{p}^{\prime\prime}$-adic character corresponding to
said algebraic Hecke character.

In the case of $p\gg_{g,K,S}1$ this was proved by an argument involving class
field theory and height bounds on global units generating
$\mathfrak{o}_{K}^{\times}$ to reduce to the standard classification of
algebraic Hecke characters, all of which are still available when
$p\ll_{g,K,S}1$. What breaks down, however, is that to evaluate the
restrictions of $\overline{\chi}$ to the various inertia groups above $p$ we
used Raynaud’s classification of finite flat group schemes which prolong over
an unramified base (or alternatively Fontaine-Laffaille’s similar
classification).

It would be natural then to turn to the Breuil-Kisin classification (let us
emphasize that we have a finite flat group scheme associated to a character
mod $p^{n}$ with large $n$ when $p\ll_{g,K,S}1$ — of course the statement is
false for e.g. $n=1$).

But we will not need to thanks to a trick.

####  5.2.1 Lemma 5.3 implies Proposition 5.2.

We will first explain how to prove Proposition 5.2 assuming Lemma 5.3.

Let us give a quick sketch in the case of $F\simeq\text{End}_{K}^{0}(A)$
before we begin the proof. We start with the $\mathbb{Z}_{p}$-algebra
generated by the image of $\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)$
acting on $T_{p}(A)$. We will show it is sufficiently close to an
$\mathfrak{o}_{F,p}$-algebra by considering Frobenius traces (which are in
said $\mathbb{Z}_{p}$-algebra by the same trick we used in Proposition 5.1).
This lets us deal with the representations $T_{\mathfrak{p}}(A)$ one by one.

We have shown, so to speak, that our algebra basically contains
$\mathfrak{o}_{F,\mathfrak{p}}\cdot\mathop{\mathrm{id}}$. To get another
"dimension", we consider the actual images (not just traces) of Frobenius
elements, again at a Faltings-Serre set — said images generate the algebra by
Nakayama, so there must certainly be one which does not act by a scalar ($A/K$
is not CM). Again the $\mathfrak{o}_{F,\mathfrak{p}}$-algebra generated by
that Frobenius image is basically the maximal order in the
$F_{\mathfrak{p}}$-algebra generated by the Frobenius image (since its
characteristic polynomial has bounded discriminant).

So we have gotten our algebra to contain a second dimension — a Cartan, which
for simplicity let us say is the split Cartan. Finally we apply Lemma 5.3 to
show that our algebra does not reduce to a Cartan (or even into a Borel) mod
$\mathfrak{p}^{n}$ for $n$ large — thus in this simplified picture it contains
a third element with top right corner of bounded valuation, and applying the
lemma again without loss of generality said element also has bottom left
corner of bounded valuation. Together the elements we have produced span a
subalgebra of $M_{2}(\mathfrak{o}_{F,\mathfrak{p}})$ of bounded index, as
desired.

###### Proof of Proposition 5.2 assuming Lemma 5.3..

Again for $p\gg_{g,K,S}1$ there is nothing to do thanks to Proposition 5.1.
Therefore without loss of generality $p\ll_{g,K,S}1$.

We repeat verbatim the beginning of the proof of Proposition 5.1. In the same
notation, we conclude that
$\mathbb{Z}_{p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]\supseteq\mathbb{Z}[\\{\mathrm{tr}(\mathrm{Frob}_{\mathfrak{q}}):\mathfrak{q}\in
T\\}]\otimes_{\mathbb{Z}}\mathbb{Z}_{p}$. Again we observe that
$\mathbb{Z}[\\{\mathrm{tr}(\mathrm{Frob}_{\mathfrak{q}}):\mathfrak{q}\in
T\\}]\subseteq\mathfrak{o}_{F}$ is an order of index $\ll_{g,K,S}1$. It
therefore follows that the index of
$\mathbb{Z}_{p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]$
inside
$\mathfrak{o}_{F,p}[\rho_{A,p}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]=\bigoplus_{\mathfrak{p}|(p)}\mathfrak{o}_{F,\mathfrak{p}}[\rho_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]$
is $\ll_{g,K,S}1$.

So it suffices to show that, for $\mathfrak{p}\subseteq\mathfrak{o}_{F}$ a
prime of $\mathfrak{o}_{F}$ with $\mathfrak{p}|(p)$, the index of
$\mathfrak{o}_{F,\mathfrak{p}}[\rho_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]$
inside $M_{2}(\mathfrak{o}_{F,\mathfrak{p}})$ is $\ll_{g,K,S}1$.

Now, by the second part of Lemma 3.3 (aka Nakayama), we have that
$\mathfrak{o}_{F,\mathfrak{p}}[\\{\rho_{A,\mathfrak{p}}(\mathrm{Frob}_{\mathfrak{q}}):\mathfrak{q}\in
T\\}]=\mathfrak{o}_{F,\mathfrak{p}}[\rho_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]$.

Let us note before splitting into cases that we may and will expand $T$ so
that for each $D\in\widetilde{\mathcal{R}}_{g,K,S}^{0}$ there is a
$\mathfrak{q}\in T$ which is of degree $1$ in $K$ and which lies over an
unramified prime of the centre of $D$.

Now we bifurcate. Let us first treat the case where
$F\simeq\text{End}_{K}^{0}(A)=\text{End}_{\overline{\mathbb{Q}}}^{0}(K)$.

Let $\mathfrak{m}\in T$ be such that
$\mathrm{Nm}\,{\mathfrak{m}}\in\mathbb{Z}$ is prime and unramified in $F$. Let
$f_{\mathfrak{m}}(t)\in\mathfrak{o}_{F}[t]$ be the characteristic polynomial
of $\rho_{A,\mathfrak{p}}(\mathrm{Frob}_{\mathfrak{m}})$. Since
$\det{(\rho_{A,\mathfrak{p}}(\mathfrak{m}))}=\mathrm{Nm}\,{\mathfrak{m}}$
(since our quoting of our argument beginning the proof of Proposition 5.1
included arranging that $\rho_{A,\mathfrak{p}}$ has cyclotomic determinant),
it follows that the monic quadratic $f_{\mathfrak{m}}(t)$ has nonzero
discriminant (else $\mathrm{Nm}\,{\mathfrak{m}}$ would be a square in $F$ and
thus a prime of ramification of $F$).

Moreover the absolute norm of said discriminant is of course $\ll_{g,K,S}1$,
whence the index of $\mathfrak{o}_{F}[t]/(f_{\mathfrak{m}})$ inside the
maximal order of the quadratic étale algebra $F[t]/(f_{\mathfrak{m}})$ is also
$\ll_{g,K,S}1$. Thus similarly the index of
$\mathfrak{o}_{F,\mathfrak{p}}[\rho_{A,\mathfrak{p}}(\mathrm{Frob}_{\mathfrak{m}})]$
inside the (monogenic) maximal order of the quadratic étale algebra
$F_{\mathfrak{p}}[\rho_{A,\mathfrak{p}}(\mathrm{Frob}_{\mathfrak{m}})]\simeq
F_{\mathfrak{p}}[t]/(f_{\mathfrak{m}})$ is $\ll_{g,K,S}1$.

Therefore there is an $F^{\prime}/F$ of degree $[F^{\prime}:F]\leq 2$ and with
relative discriminant $|\mathrm{Nm}\,{\Delta_{F^{\prime}/F}}|\ll_{g,K,S}1$
such that there is a prime
$\mathfrak{p}^{\prime}\subseteq\mathfrak{o}_{F^{\prime}}$ with
$\mathfrak{p}^{\prime}|\mathfrak{p}$ for which the quadratic étale algebra
$F^{\prime}_{\mathfrak{p}^{\prime}}[\rho_{A,\mathfrak{p}}(\mathrm{Frob}_{\mathfrak{m}})]\simeq
F^{\prime}_{\mathfrak{p}^{\prime}}[t]/(f_{\mathfrak{m}})$ is split.

Moreover it suffices to show that
$\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}[\rho_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]\subseteq
M_{2}(\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}})$ has index
$\ll_{g,K,S}1$ (we have just applied
${-}\otimes_{\mathfrak{o}_{F,\mathfrak{p}}}\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}$
to our previous cokernel).

By diagonalizing the regular semisimple element
$\rho_{A,\mathfrak{p}}(\mathrm{Frob}_{\mathfrak{m}})\in
M_{2}(\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}})$ we find that, in said
basis,
$\left(\begin{array}[]{cc}\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}&0\\\
0&\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}\end{array}\right)\subseteq\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}[\rho_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]$.

By Lemma 5.3 it follows that, in this basis, there is an
$\alpha\in\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}[\rho_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]$
such that $\alpha$ is not diagonal modulo $\mathfrak{p}^{\prime n}$ for an
$n\ll_{g,K,S}1$.

Applying Lemma 5.3 again if necessary (to produce an $\alpha^{\prime}$ and
then replacing $\alpha$ by $\alpha+\alpha^{\prime}$ if necessary), we see that
without loss of generality the $\mathfrak{p}$-adic valuations of the top-left
and bottom-right corners of $\alpha$ are $\ll_{g,K,S}1$.

It follows that there is an $n\ll_{g,K,S}1$ such that $p^{n}\cdot
M_{2}(\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}})\subseteq\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}[\rho_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))]$,
and we are done.

Now for the case of $\text{End}_{K}^{0}(A)=D$ a quaternion algebra over $F$.
But the above argument also works verbatim — so long as we replace
$M_{2}(\mathfrak{o}_{F,\mathfrak{p}})$ and $M_{2}(F_{\mathfrak{p}})$ by
$\mathfrak{o}_{\mathfrak{p}}^{\text{opp.}}:=\mathfrak{o}^{\text{opp.}}\otimes_{\mathfrak{o}_{F}}\mathfrak{o}_{F,\mathfrak{p}}$
and
$D_{\mathfrak{p}}^{\text{opp.}}:=D^{\text{opp.}}\otimes_{F}F_{\mathfrak{p}}$,
respectively — because $F^{\prime}/F$ also splits $D/F$. ∎

####  5.2.2 Lemma 5.4 implies Lemma 5.3.

Let us next prove Lemma 5.3 assuming Lemma 5.4.

###### Proof of Lemma 5.3 assuming Lemma 5.4..

Let, via Lemma 5.4, $\chi$ and $\chi^{\prime}$ be algebraic Hecke characters
of weight $\leq 1$ of conductor dividing $\Delta_{N}:=\prod_{\mathfrak{q}\in
S}(\mathrm{Nm}\,{\mathfrak{q}})^{10^{10g}\cdot[K:\mathbb{Q}]}$ and valued in
an extension $F^{\prime\prime}/F^{\prime}$ with a prime
$\mathfrak{p}^{\prime\prime}|\mathfrak{p}^{\prime}$ such that
$\chi\equiv\overline{\chi}\mkern 4.0mu({\operator@font mod}\mkern
6.0mu\mathfrak{p}^{\prime\prime 2n\cdot
e(\mathfrak{p}^{\prime\prime}/\mathfrak{p})})$ and
$\chi^{\prime}\equiv\overline{\chi}^{\prime}\mkern 4.0mu({\operator@font
mod}\mkern 6.0mu\mathfrak{p}^{\prime\prime 2n\cdot
e(\mathfrak{p}^{\prime\prime}/\mathfrak{p})})$, where we have also written
$\chi$ and $\chi^{\prime}$ for the corresponding
$\mathfrak{p}^{\prime\prime}$-adic characters.

Let $T$ be the finite set of primes produced by Lemma 3.3 with parameters
$(2,K,\Delta_{N},p^{10^{10g}})$.

Because
$\mathrm{tr}{(\rho_{A,\mathfrak{p}}(\mathrm{Frob}_{\mathfrak{m}}))}\equiv\chi(\mathfrak{m})+\chi(\mathfrak{m}^{\prime})\mkern
4.0mu({\operator@font mod}\mkern 6.0mu\mathfrak{p}^{\prime\prime 2n\cdot
e(\mathfrak{p}^{\prime\prime}/\mathfrak{p})})$ for all $\mathfrak{m}\in T$ and
because both sides are algebraic integers of height and degree $\ll_{g,K,S}1$,
it follows that if $n\gg_{g,K,S}1$ were explicitly sufficiently large said
congruence would be an equality for all $\mathfrak{m}\in T$, whence by Lemma
3.3 $\rho_{A,\mathfrak{p}}$ would have semisimplification
$\chi\oplus\chi^{\prime}$ and would in particular be reducible, a
contradiction. ∎

####  5.2.3 Preliminaries for the proof of Lemma 5.4.

To prove Lemma 5.4 we will need a few preliminary lemmas. First we note the
following easy fact.

######  Lemma 5.5.

Let $G$ be a group. Let $F/\mathbb{Q}$ be a number field. Let
$\mathfrak{p}\subseteq\mathfrak{o}_{F}$ be a prime of $\mathfrak{o}_{F}$. Let
$n\in\mathbb{Z}^{+}$. Let
$\chi_{1},\ldots,\chi_{4}:G\longrightarrow(\mathfrak{o}_{F}/\mathfrak{p}^{2n})^{\times}$
be such that $\chi_{1}+\chi_{2}=\chi_{3}+\chi_{4}$ and
$\chi_{1}\cdot\chi_{2}=\chi_{3}\cdot\chi_{4}$ as functions on $G$. Then:
$\\{\chi_{1},\chi_{2}\\}\equiv\\{\chi_{3},\chi_{4}\\}\mkern
4.0mu({\operator@font mod}\mkern 6.0mu\mathfrak{p}^{n})$.

###### Proof.

By replacing each $\chi_{i}$ by $\chi_{i}\cdot\chi_{1}^{-1}$ it suffices to
treat the case where $\chi_{1}=\mathrm{triv}$. Thus
$(t-\chi_{3}(g))\cdot(t-\chi_{4}(g))=(t-1)\cdot(t-\chi_{2}(g))\in(\mathfrak{o}_{F}/\mathfrak{p}^{2n})[t]$
for all $g\in G$, and so taking $t=1$ we conclude that
$(1-\chi_{3}(g))\cdot(1-\chi_{4}(g))=0$ for all $g\in G$, which is to say
that, for all $g\in G$, either $\chi_{3}(g)\equiv 1\mkern
4.0mu({\operator@font mod}\mkern 6.0mu\mathfrak{p}^{n})$ or $\chi_{4}(g)\equiv
1\mkern 4.0mu({\operator@font mod}\mkern 6.0mu\mathfrak{p}^{n})$.

Let $\psi_{i}:=\chi_{i}\mkern 4.0mu({\operator@font mod}\mkern
6.0mu\mathfrak{p}^{n})$, whence
$\psi_{i}:G\longrightarrow(\mathfrak{o}_{F}/\mathfrak{p}^{n})^{\times}$. Let
$H_{i}:=\ker{\psi_{i}}$. Thus we have found that $G=H_{3}\cup H_{4}$. So
either $H_{3}=G$, or else, letting $g\in G-H_{3}$ (and thus $g\in H_{4}$), we
see that $g\cdot H_{3}\subseteq H_{4}$ and so $H_{3}\subseteq H_{4}$, whence
$H_{4}=G$.

So we conclude that either $\psi_{3}=\mathrm{triv}$ or
$\psi_{4}=\mathrm{triv}$. Subtracting from
$\mathrm{triv}+\psi_{2}=\psi_{3}+\psi_{4}$ we find that
$\\{\mathrm{triv},\psi_{2}\\}=\\{\psi_{3},\psi_{4}\\}$, as desired. ∎

Next we will evaluate the inertial restriction of a relevant character at a
prime of bad reduction of the given $A/K$.

######  Lemma 5.6.

Let $K/\mathbb{Q}$ be a number field. Let
$\mathfrak{q}\subseteq\mathfrak{o}_{K}$ be a prime of $K$. Let
$p\in\mathbb{Z}^{+}$ be the prime of $\mathbb{Z}$ with $\mathfrak{q}|(p)$. Let
$A/K_{\mathfrak{q}}$ be an abelian variety over $K_{\mathfrak{q}}$ with split
semistable bad reduction at $\mathfrak{q}$ which is of $\mathrm{GL}_{2}$-type
over $K_{\mathfrak{q}}$. Let $\mathfrak{o}$ be an order in a CM field
$F/\mathbb{Q}$ admitting
$\mathfrak{o}\lhook\joinrel\longrightarrow\text{End}_{K_{\mathfrak{q}}}(A)$
and such that $[F:\mathbb{Q}]=\dim{A}$. Let
$\mathfrak{p}\subseteq\mathfrak{o}$ with $\mathfrak{p}|(p)$ be a prime of
$\mathfrak{o}$ above $p$. Write
$\rho_{A,\mathfrak{p}}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{\mathfrak{p}})$
for the $2$-dimensional representation corresponding to the
$\mathfrak{o}[\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)]$-module
structure on $T_{\mathfrak{p}}(A)$.

Then:
$0\longrightarrow\chi_{p}\longrightarrow\rho_{A,\mathfrak{p}}|_{I_{\mathfrak{q}}}\longrightarrow\mathrm{triv}\longrightarrow
0$ as representations of the inertia group
$I_{\mathfrak{q}}\subseteq\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}_{p}/K_{\mathfrak{q}})$.

In particular if $F^{\prime}/F$ is an extension of degree $[F^{\prime}:F]\leq
2$, $\mathfrak{p}^{\prime}\subseteq\mathfrak{o}_{F^{\prime}}$ with
$\mathfrak{p}^{\prime}|\mathfrak{p}$ is a prime of $\mathfrak{o}_{F^{\prime}}$
above $\mathfrak{p}$, and
$\overline{\chi},\overline{\chi}^{\prime}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}_{p}/K_{\mathfrak{q}})\longrightarrow(\mathfrak{o}_{F^{\prime}}/\mathfrak{p}^{\prime
2n\cdot e(\mathfrak{p}^{\prime}/\mathfrak{p})})^{\times}$ are characters such
that $0\longrightarrow\overline{\chi}\longrightarrow
A[\mathfrak{p}^{2n}]\otimes_{\mathfrak{o}_{\mathfrak{p}}}\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}\longrightarrow\overline{\chi}^{\prime}\longrightarrow
0$, then $\overline{\chi}\equiv\chi_{p}\mkern 4.0mu({\operator@font mod}\mkern
6.0mu\mathfrak{p}^{\prime n\cdot e(\mathfrak{p}^{\prime}/\mathfrak{p})})$ and
$\overline{\chi}^{\prime}\equiv\mathrm{triv}\mkern 4.0mu({\operator@font
mod}\mkern 6.0mu\mathfrak{p}^{\prime n\cdot
e(\mathfrak{p}^{\prime}/\mathfrak{p})})$.

###### Proof.

The second statement follows from the first by Lemma 5.5.

So let us prove the first. Since $A/K_{\mathfrak{q}}$ has split semistable bad
reduction, writing $\bar{A}$ for the special fibre of the connected component
of the identity in the Néron model of $A$ over
$\mathfrak{o}_{K,\mathfrak{q}}$, there is a canonical exact sequence
$0\longrightarrow\left(\mathbb{G}_{m}^{\times
t}\right)_{/(\mathfrak{o}_{K}/\mathfrak{q})}\longrightarrow\bar{A}\longrightarrow
B\longrightarrow 0$ with $B/(\mathfrak{o}_{K}/\mathfrak{q})$ an abelian
variety and $t>0$. But because
$\mathfrak{o}\lhook\joinrel\longrightarrow\text{End}_{K}(A)$ acts functorially
on the Néron model, thus the connected component of its identity, thus its
special fibre, and thus this decomposition, we find that
$\mathfrak{o}\lhook\joinrel\longrightarrow\text{End}_{\mathfrak{o}_{K}/\mathfrak{q}}\left(\left(\mathbb{G}_{m}^{\times
t}\right)_{/(\mathfrak{o}_{K}/\mathfrak{q})}\right)=M_{t}(\mathbb{Z})$. We
conclude that $t=\dim{A}=:g$, i.e. $A/K$ has split totally toric reduction at
$\mathfrak{q}$.

Now, by Raynaud’s uniformization cross, we find that, because $A/K$ has split
totally toric reduction at $\mathfrak{q}$, there is then a split torus
$\left(\mathbb{G}_{m}^{\times g}\right)_{/\mathfrak{o}_{K,\mathfrak{q}}}$
uniformizing $A/K_{\mathfrak{q}}$. (This is nothing but the analogue of the
theory of the Tate curve for $\mathrm{GL}_{2}$-type abelian varieties of
higher dimension.)

The lemma follows from explicitly computing the $p$-adic and thus
$\mathfrak{p}$-adic Tate module of the split torus
$\left(\mathbb{G}_{m}^{\times g}\right)_{/\mathfrak{o}_{K,\mathfrak{q}}}$ by
choosing the evident basis (namely one starting with the basis
$\left((\zeta_{p}^{\delta_{i,j}})_{j=1}^{g}\right)_{i=1}^{g}$ for
$\mu_{p}^{\times g}$) — just as in the elliptic curve case. ∎

Next we explain a corollary of a result of Raynaud which we will in fact not
use except in the discussion following its proof.

######  Lemma 5.7.

Let $p,h,e\in\mathbb{Z}^{+}$ with $p$ prime. Then: there is an explicit (thus
effectively computable) constant $\delta_{p,h,e}\in\mathbb{Z}^{+}$ depending
only on $p$, $h$, and $e$ such that the following holds.

  * •

Let $K/\mathbb{Q}$ be a number field. Let
$\mathfrak{q}\subseteq\mathfrak{o}_{K}$ with $\mathfrak{q}|(p)$ be a prime of
$\mathfrak{o}_{K}$ over $p$ with ramification index $e(\mathfrak{q}/p)\leq e$.
Let $m,n\in\mathbb{Z}^{+}$ with $m,n\geq\delta_{p,h,e}$. Let
$\mathcal{G}/\mathfrak{o}_{K,\mathfrak{q}}$ be a commutative finite flat group
scheme over $\mathfrak{o}_{K,\mathfrak{q}}$ whose generic fibre
$G/K_{\mathfrak{q}}$ corresponds to a Galois module with underlying abelian
group $(\mathbb{Z}/p^{m+n})^{\oplus h}$. Write
$\mathcal{G}_{i}/\mathfrak{o}_{K,\mathfrak{q}}$ for the scheme-theoretic
closure of $G[p^{i}]$ inside $\mathcal{G}$ (thus
$\mathcal{G}_{i}/\mathfrak{o}_{K,\mathfrak{q}}$ is a commutative finite flat
group scheme over $\mathfrak{o}_{K,\mathfrak{q}}$ as well). Write
$\mathcal{G}_{i,j}:=\mathcal{G}_{j}/\mathcal{G}_{i}$, the quotient taken in
the category of commutative finite flat group schemes over
$\mathfrak{o}_{K,\mathfrak{q}}$. Write $G_{i,j}:=p^{i}\cdot G[p^{j}]$ for the
generic fibre of $\mathcal{G}_{i,j}$.

Then: there is a Barsotti-Tate (aka $p$-divisible) group
$\widetilde{\mathcal{G}}/\mathfrak{o}_{K,\mathfrak{q}}$ over
$\mathfrak{o}_{K,\mathfrak{q}}$ such that
$\widetilde{\mathcal{G}}_{n}\cong\mathcal{G}_{m,m+n}$ as commutative finite
flat group schemes over $\mathfrak{o}_{K,\mathfrak{q}}$ — in other words,
$\mathcal{G}_{m,m+n}$ is a truncated Barsotti-Tate group of level $n$ (aka a
$\text{BT}_{n}$) over $\mathfrak{o}_{K,\mathfrak{q}}$. Moreover, the image of
the restriction map
$\text{End}_{\mathfrak{o}_{K,\mathfrak{q}}}(\mathcal{G}_{m,m+n})\longrightarrow\text{End}_{K_{\mathfrak{q}}}(G_{m,m+n})$
contains the image of the canonical map
$\text{End}_{K_{\mathfrak{q}}}(G)\longrightarrow\text{End}_{K_{\mathfrak{q}}}(G_{m,m+n})$.

###### Proof.

All but the last sentence follows from Corollary $3.4.5$ of Raynaud’s [15].

As for the statement about endomorphisms, modulo a technical modification our
argument is essentially the same one Tate uses to prove the Corollary in
Section $4.5$ of his [22], except that we use Corollary $3.3.1$ of Raynaud’s
[15] in place of the uniqueness of prolongations that is available in Tate’s
situation (and which is also due to Raynaud).

Let $\varphi\in\text{End}_{K_{\mathfrak{q}}}(G)$ be a
$\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}_{p}/K_{\mathfrak{q}})$-equivariant
endomorphism of the Galois module corresponding to $G$. Of course $\varphi$
induces a map $G_{m,m+n}\longrightarrow G_{m,m+n}$, which we will also call
$\varphi$. Let $\Gamma_{\varphi}:=G\times_{\varphi}G\subseteq G\times G$ be
the graph of $\varphi$. Thus $G\simeq\Gamma_{\varphi}$. Write, as in e.g. the
Corollary in Section $4.1$ of Tate’s [22], $\mathcal{G}^{-}$ and
$\mathcal{G}^{+}$ for the minimal and maximal prolongations of $G$,
respectively. Thus there are maps
$\mathcal{G}^{+}\longrightarrow\mathcal{G}\longrightarrow\mathcal{G}^{-}$ over
$\mathfrak{o}_{K,\mathfrak{q}}$ inducing the identity on generic fibres.

Let $\mathcal{H}\subseteq\mathcal{G}\times\mathcal{G}$ be the scheme-theoretic
closure of $\Gamma_{\varphi}$ in $\mathcal{G}\times\mathcal{G}$. Then
$\mathcal{H}$ is a commutative finite flat group scheme over
$\mathfrak{o}_{K,\mathfrak{q}}$ prolonging $G$ (as is clear from the
discussion at the beginning of Section $4.2$ of Tate’s [22]). Therefore it
also admits maps
$\mathcal{G}^{+}\longrightarrow\mathcal{H}\longrightarrow\mathcal{G}^{-}$ over
$\mathfrak{o}_{K,\mathfrak{q}}$ inducing the identity on generic fibres. Note
also that
$\mathcal{H}_{m,m+n}\longrightarrow\mathcal{G}_{m,m+n}\times\mathcal{G}_{m,m+n}$
as well (as is clear at the level of coordinate rings), where
$\mathcal{H}_{m,m+n}/\mathfrak{o}_{K,\mathfrak{q}}$ is defined in precisely
the same way as $\mathcal{G}_{m,m+n}$, except with scheme-theoretic closures
taken in $\mathcal{H}$.

These maps in particular induce maps
$\mathcal{G}_{m,m+n}^{+}\longrightarrow\mathcal{G}_{m,m+n}\longrightarrow\mathcal{G}_{m,m+n}^{-}$
and
$\mathcal{G}_{m,m+n}^{+}\longrightarrow\mathcal{H}_{m,m+n}\longrightarrow\mathcal{G}_{m,m+n}^{-}$
over $\mathfrak{o}_{K,\mathfrak{q}}$ inducing the identity on fibres. But now
by Corollary $3.3.1$ of Raynaud’s [15] each finite flat group scheme being
mapped into or out of is a $\text{BT}_{n}$ with $n\geq\delta_{p,h,e}$.
Therefore, because these maps induce the identity on generic fibres and
because $n\geq\delta_{p,h,e}$ is explicitly sufficiently large in terms of
$p$, $h$, and $e$, it follows from Corollary $3.4.5$ of Raynaud’s [15] that
said maps are isomorphisms over $\mathfrak{o}_{K,\mathfrak{q}}$.

We conclude in particular that there is an isomorphism
$\mathcal{G}_{m,m+n}\simeq\mathcal{H}_{m,m+n}$ (namely the inverse of the
restriction to $\mathcal{H}_{m,m+n}$ of the projection onto the first factor
on $\mathcal{G}_{m,m+n}\times\mathcal{G}_{m,m+n}$) inducing the identity on
generic fibres. The desired extension of $\varphi$ is given by
$\mathcal{G}_{m,m+n}\simeq\mathcal{H}_{m,m+n}\longrightarrow\mathcal{G}_{m,m+n}\times\mathcal{G}_{m,m+n}\longrightarrow\mathrel{\mkern-25.0mu}\longrightarrow\mathcal{G}_{m,m+n}$,
where the last map denotes projection onto the second factor. ∎

Finally let us explain our trick.

Even given Lemma 5.7 a priori it is not clear how to produce a Barsotti-Tate
group _with endomorphisms by
$\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}$_ whose Galois representation
lifts our given character. At the level of special fibres there is no problem,
by e.g. a "crystalline boundedness principle" (see e.g. Corollary $1.7$ of
Lau-Nicole-Vasiu’s [12] for one such statement, though earlier work of Vasiu
also contains results sufficient for the discussion) and Krasner. Deformation
from the special fibre is also not an issue _if $F^{\prime}$ is unramified
above $p$_ by Proposition $2.6$ of Wedhorn’s [23]. However the general
situation (of deforming
$\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}$-structure of a BT along with
a given deformation of its corresponding $\text{BT}_{n}$ when $F^{\prime}$ is
ramified above $p$) is not so satisfactory — see e.g. the discussion of "the
main technical obstacle" on page $230$ of Scholze’s [18] for a recent example
of another work facing such an issue.

Now naturally our situation is extremely special, and because of this one
should be able to proceed explicitly via a calculation with Breuil-Kisin
modules.

We will not bother, because of the following trick.

######  Lemma 5.8.

Let $g\in\mathbb{Z}^{+}$. Let $K/\mathbb{Q}$ be a number field. Let
$p\in\mathbb{Z}^{+}$ be a prime. Then: there is an effectively computable
constant $C_{g,K,p}\in\mathbb{Z}^{+}$ depending only on $g$, $K$, and $p$ such
that the following holds.

  * •

Let $n\geq C_{g,K,p}$. Let $\mathfrak{q}\subseteq\mathfrak{o}_{K}$ with
$\mathfrak{q}|(p)$ be a prime of $\mathfrak{o}_{K}$ above $p$. Let
$F/\mathbb{Q}$ be a number field of degree $[F:\mathbb{Q}]\leq g$. Let
$\mathfrak{p}\subseteq\mathfrak{o}_{F}$ with $\mathfrak{p}|(p)$ be a prime of
$\mathfrak{o}_{F}$ above $p$. Let
$\overline{\chi}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}_{p}/K_{\mathfrak{q}})\longrightarrow(\mathfrak{o}_{F,\mathfrak{p}}/p^{n})^{\times}$
be a character such that the Galois module corresponding to $\overline{\chi}$
arises as the generic fibre of a finite flat group scheme over
$\mathfrak{o}_{K,\mathfrak{q}}$. Then: there is a subset
$S\subseteq\mathop{\text{Hom}}_{\mathbb{Q}\text{-alg.}}(K_{\mathfrak{q}},\overline{\mathbb{Q}}_{p})$
such that $\overline{\chi}|_{I_{\mathfrak{q}}}\equiv\prod_{\sigma\in
S}\sigma\mkern 4.0mu({\operator@font mod}\mkern 6.0mup^{n})$.

###### Proof.

There is evidently a finite-time algorithm which determines whether or not an
input finite
$\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}_{p}/K_{\mathfrak{q}})$-module
arises as the generic fibre of a finite flat group scheme over
$\mathfrak{o}_{K,\mathfrak{q}}$ (this amounts to checking whether any of an
explicit finite list of orders in an étale $K_{\mathfrak{q}}$-algebra are
closed under a given comultiplication).

So now let $F^{\prime}/\mathbb{Q}$ be a number field with a prime
$\mathfrak{p}^{\prime}|(p)$ such that $F^{\prime}_{\mathfrak{p}^{\prime}}$
contains all extensions of $\mathbb{Q}_{p}$ of degree at most $g$. Let
$\Phi_{n}$ be the set of characters
$\overline{\chi}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}_{p}/K_{\mathfrak{q}})\longrightarrow(\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}/p^{n})^{\times}$
such that the Galois module corresponding to $\overline{\chi}$ arises as the
generic fibre of a finite flat group scheme over
$\mathfrak{o}_{K,\mathfrak{q}}$. Let $\Phi_{n}^{\prime}\subseteq\Phi_{n}$ be
the subset of characters for which there is no
$S\subseteq\mathop{\text{Hom}}_{\mathbb{Q}\text{-alg.}}(K_{\mathfrak{q}},\overline{\mathbb{Q}}_{p})$
such that $\overline{\chi}|_{I_{\mathfrak{q}}}\equiv\prod_{\sigma\in
S}\sigma\mkern 4.0mu({\operator@font mod}\mkern 6.0mup^{n})$. Of course both
$n\mapsto\Phi_{n}$ and $n\mapsto\Phi_{n}^{\prime}$ are effectively computable
(via local class field theory and the previous remark).

For $n>m$ reduction modulo $p^{m}$ induces a map $f_{n\rightarrow
m}:\Phi_{n}\longrightarrow\Phi_{m}$ with $f_{n\rightarrow
m}(\Phi_{n}^{\prime})\subseteq\Phi_{m}^{\prime}$.

We claim that, for all $m\in\mathbb{Z}^{+}$, $\bigcap_{n\geq m}f_{n\rightarrow
m}(\Phi_{n}^{\prime})=\varnothing$, or in other words (since the
$f_{n\rightarrow m}(\Phi_{n}^{\prime})$ are decreasing) that $f_{n\rightarrow
m}(\Phi_{n}^{\prime})=\varnothing$ for $n$ sufficiently large. In other words,
we claim that, given a compatible sequence
$\overline{\chi}_{n}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}_{p}/K_{\mathfrak{q}})\rightarrow(\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}/p^{n})^{\times}$
of characters whose corresponding Galois modules arise as generic fibres of
finite flat group schemes over $\mathfrak{o}_{K,\mathfrak{q}}$, there is an
$S\subseteq\mathop{\text{Hom}}_{\mathbb{Q}\text{-alg.}}(K_{\mathfrak{q}},\overline{\mathbb{Q}}_{p})$
such that $\overline{\chi}_{n}|_{I_{\mathfrak{q}}}\equiv\prod_{\sigma\in
S}\sigma\mkern 4.0mu({\operator@font mod}\mkern 6.0mup^{n})$ for all $n$. But
such a compatible sequence of characters amounts to a character
$\chi:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}_{p}/K_{\mathfrak{q}})\rightarrow\mathfrak{o}_{F^{\prime},\mathfrak{p}^{\prime}}^{\times}$
whose corresponding Galois module arises as the generic fibre of a
$p$-divisible group over $\mathfrak{o}_{K,\mathfrak{q}}$, and it is standard
that the inertial restrictions of such characters are exactly the characters
of "CM $p$-divisible groups", namely the characters $\prod_{\sigma\in
S}\sigma$ for
$S\subseteq\mathop{\text{Hom}}_{\mathbb{Q}\text{-alg.}}(K_{\mathfrak{q}},\overline{\mathbb{Q}}_{p})$
(for example: $\chi|_{I_{\mathfrak{q}}}$ is crystalline, and so, twisting by a
suitable product of Lubin-Tate characters (which preserves the conclusion),
without loss of generality it has all weights $0$, whence the conclusion
follows from Theorem $2$ in Section $3$ of Tate’s [21]).

Finally it remains only to note that the minimal $n\in\mathbb{Z}^{+}$ for
which $f_{n\rightarrow 1}(\Phi_{n}^{\prime})=\varnothing$ is effectively
computable: starting with $n=1$, if $f_{n\rightarrow
1}(\Phi_{n}^{\prime})\neq\varnothing$ then increment $n\mapsto n+1$ and repeat
— the process will end in finite time exactly because $f_{n\rightarrow
1}(\Phi_{n}^{\prime})=\varnothing$ for $n$ sufficiently large. ∎

####  5.2.4 Proof of Lemma 5.4.

We may now prove Lemma 5.4.

###### Proof of Lemma 5.4..

Repeat verbatim the proof of Lemma $3.9$ in [2], and replace the use of
Fontaine-Laffaille theory to evaluate the relevant inertial restrictions with
Lemma 5.8 for good primes and Lemma 5.6 for bad primes — instead of
$p\gg_{g,K,S}1$ one needs only $p^{n}\gg_{g,K,S}1$ to force equality in the
congruences of global units and then Frobenius traces at the chosen Faltings-
Serre set. ∎

##  6 Proof of Theorem 1.1.

###  6.1 Reversal of arrows.

We prove the following standard fact.

######  Lemma 6.1.

Let $K/\mathbb{Q}$ be a number field. Let $A,B/K$ be abelian varieties over
$K$. Let $\varphi:A\longrightarrow B$ be a $K$-isogeny. Then: there is a
$K$-isogeny $\varphi^{\prime}:B\longrightarrow A$ such that
$\varphi\circ\varphi^{\prime}=\deg{\varphi}\in\text{End}_{K}(B)$ and
$\varphi^{\prime}\circ\varphi=\deg{\varphi}\in\text{End}_{K}(A)$.

###### Proof.

Write $n:=\deg{\varphi}$. Let $G:=\ker{\varphi}$. Thus $G\subseteq A[n]$. Thus
$A[n]/G\subseteq A/G=B$ is a $K$-subgroup of $B/K$. The corresponding quotient
map $\varphi^{\prime}:B\longrightarrow B/(A[n]/G)\simeq A$ is defined over $K$
(since the subgroup is stable under
$\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)$) and evidently satisfies
$\varphi^{\prime}\circ\varphi=n\in\text{End}_{K}(A)$.

Finally
$(\varphi\circ\varphi^{\prime}-n)\circ\varphi=0\in\mathop{\text{Hom}}_{K}(A,B)$
and $\varphi$ is surjective, so
$\varphi\circ\varphi^{\prime}=n\in\text{End}_{K}(B)$ as well. ∎

It follows that if there is a $K$-isogeny $A\longrightarrow B$ of degree $n$,
then there is a $K$-isogeny $B\longrightarrow A$ of degree $n^{2\dim{A}-1}$.

###  6.2 Reduction to the special case when $\text{End}_{K}(A)$ is "maximal".

Let us define a set $\widetilde{\mathcal{R}}_{g,K,S}^{\prime}$ of (isomorphism
classes of) "maximal" relevant endomorphism rings.

Let $\widetilde{\mathcal{R}}_{g,K,S}^{0}$ be the explicit finite set of
$\mathbb{Q}$-algebras produced by the proof of Corollary 4.2. For each
$D\in\widetilde{\mathcal{R}}_{g,K,S}^{0}$, we define
$\widetilde{\mathcal{R}}_{D,K,S}^{\prime}$ as follows.

By Lemma 3.5 it follows that either $D\cong M_{n_{1}}(K_{1})\times
M_{n_{2}}(K_{2})$ with $K_{i}/\mathbb{Q}$ CM and such that
$n_{1}\cdot[K_{1}:\mathbb{Q}]=n_{2}\cdot[K_{2}:\mathbb{Q}]=g$, or else $D$ is
simple, and then moreover $D\cong M_{n}(D^{\prime})$ with $D^{\prime}$ either
itself a CM field of degree $\frac{g}{n}$ or $\frac{2g}{n}$ over $\mathbb{Q}$,
or else a quaternion algebra over a CM field of degree $\frac{g}{2n}$ over
$\mathbb{Q}$.

In the former case, i.e. when $D\cong M_{n_{1}}(K_{1})\times
M_{n_{2}}(K_{2})$, we let
$\widetilde{\mathcal{R}}_{D,K,S}^{\prime}:=\\{M_{n_{1}}(\mathfrak{o}_{K_{1}})\times
M_{n_{2}}(\mathfrak{o}_{K_{2}})\\}$, a singleton. In the latter case, writing
$D\cong M_{n}(D^{\prime})$ with $D^{\prime}$ either a CM field or quaternion
algebra, if $D^{\prime}$ is commutative then its ring of integers
$\mathfrak{o}_{D^{\prime}}$ is its unique maximal order, and we let
$\widetilde{\mathcal{R}}_{D,K,S}^{\prime}:=\\{M_{n}(\mathfrak{o}_{D^{\prime}})\\}$,
again a singleton. Otherwise we choose an explicit finite set of
representatives $\widetilde{\mathcal{R}}_{D^{\prime},K,S}^{\prime}$ of the
conjugacy classes of maximal orders of the quaternion algebra $D^{\prime}$
(note that there are there finitely many such conjugacy classes, by finiteness
of the class number (and thus the type number) of a quaternion algebra over a
number field), and then let
$\widetilde{\mathcal{R}}_{D,K,S}^{\prime}:=\\{M_{n}(\mathfrak{o}):\mathfrak{o}\in\widetilde{\mathcal{R}}_{D^{\prime},K,S}^{\prime}\\}$.

Thus we have defined $\widetilde{\mathcal{R}}_{D,K,S}^{\prime}$ for each
$D\in\widetilde{\mathcal{R}}_{g,K,S}^{0}$. Let

$\widetilde{\mathcal{R}}_{g,K,S}^{\prime}:=\bigcup_{D\in\widetilde{\mathcal{R}}_{g,K,S}^{0}}\widetilde{\mathcal{R}}_{D,K,S}^{\prime}.$

Now let us show that it suffices to prove Theorem 1.1 in the special case
where $\text{End}_{K}(A)\in\widetilde{\mathcal{R}}_{g,K,S}^{\prime}$.

######  Proposition 6.2.

Let $A/K$ be a split semistable $g$-dimensional abelian variety over $K$ with
good reduction outside $S$ and such that
$\text{End}_{K}^{0}(A)=\text{End}_{\overline{\mathbb{Q}}}^{0}(K)\in\widetilde{\mathcal{R}}_{g,K,S}^{0}$.
Then: there is a $B/K$ with
$\text{End}_{K}(B)\in\widetilde{\mathcal{R}}_{g,K,S}^{\prime}$ such that
$A\sim_{K}B$.

###### Proof.

By construction of $\widetilde{\mathcal{R}}_{g,K,S}^{\prime}$ it suffices to
show this for $A/K$ $K$-simple. When
$\text{End}_{K}(A)=\text{End}_{\overline{\mathbb{Q}}}(K)$ is commutative, this
follows from the usual Serre tensor product construction: writing
$F:=\text{End}_{K}^{0}(A)$, automatically
$\text{End}_{K}(A)\subseteq\mathfrak{o}_{F}$ is an order, and
$A\sim_{K}A\otimes_{\text{End}_{K}(A)}\mathfrak{o}_{F}$ as desired.

The only remaining case is the case of $\text{End}_{K}^{0}(A)\cong
D\in\mathcal{R}_{g,K,S}^{0}$ a quaternion algebra. By changing the isomorphism
$D\cong\text{End}_{K}^{0}(A)$ via an automorphism of $D$ without loss of
generality $\text{End}_{K}(A)\lhook\joinrel\longrightarrow\mathfrak{o}$ with
$\mathfrak{o}\in\mathcal{R}_{g,K,S}^{\prime}$ one of our chosen maximal
orders.

Now we again note that $A\sim_{K}A\otimes_{\text{End}_{K}(A)}\mathfrak{o}$,
and we are done, modulo a discussion of the Serre tensor product in this
context.

Now the Serre tensor product is standard for modules over a _commutative_ ring
— see e.g. Proposition $1.7.4.4$ of Chai-Conrad-Oort’s [4]. However in this
situation the relevant ring is noncommutative, and there does not seem to be a
treatment in the literature of the construction $A\mapsto
A\otimes_{\mathfrak{o}^{\prime}}\mathfrak{o}$ for
$\mathfrak{o}^{\prime}\subseteq\mathfrak{o}$ an order. But it too is easy
since we are over a number field: embed into $\mathbb{C}$ and write
$A\cong\mathbb{C}^{g}/\Lambda$ with
$\mathfrak{o}^{\prime}\cdot\Lambda=\Lambda$ and
$\mathfrak{o}\curvearrowright\mathbb{C}^{g}$ via the standard representation
($\mathfrak{o}$ is an order in a quaternion algebra over a number field of
degree $\frac{g}{2}$ in our situation, whence it naturally acts on
$(\mathbb{C}^{\oplus 2})^{\oplus\frac{g}{2}}$). Then the lattice
$\mathfrak{o}\cdot\Lambda$ contains $\Lambda$ with finite index, whence
$A/\mathbb{C}$ is $\mathbb{C}$-isogenous to
$A^{\prime}:=\mathbb{C}^{g}/(\mathfrak{o}\cdot\Lambda)$, whence $A^{\prime}$
is defined over $\overline{\mathbb{Q}}$, whence over a number field $L/K$. But
now $A^{\prime}/L$ represents the functor $R\mapsto
A(R)\otimes_{\mathfrak{o}^{\prime}}\mathfrak{o}$ over $L$, and so it is
uniquely determined up to unique isomorphism. Therefore by Galois descent it
is the base change of a variety over $K$, whence we have shown that the
functor $R\mapsto A(R)\otimes_{\mathfrak{o}^{\prime}}\mathfrak{o}$ over $K$ is
representable (by $A^{\prime}/K$), producing our desired Serre tensor product
(which evidently has endomorphisms by $\mathfrak{o}$ because e.g. it does over
$\mathbb{C}$ and
$\text{End}_{K}^{0}(A^{\prime})=\text{End}_{K}^{0}(A)=\text{End}_{\overline{\mathbb{Q}}}^{0}(A)=\text{End}_{\overline{\mathbb{Q}}}^{0}(A^{\prime})$).
∎

###  6.3 Proof of Theorem 1.1.

Now we may prove Theorem 1.1.

###### Proof of Theorem 1.1..

We first reduce to the case when $A/K$ is split semistable and has all its
geometric endomorphisms defined over $K$, i.e. at every prime of $K$ either
$A$ has good reduction or else has split (i.e. the relevant torus is split)
semistable bad reduction, and also that
$\text{End}_{K}(A)=\text{End}_{\overline{\mathbb{Q}}}(A)$. Let $K^{\prime}/K$
be the explicit finite Galois extension produced by the proof of Lemma 3.4. By
Lemma 3.4, $A/K^{\prime}$ is split semistable and has all its geometric
endomorphisms defined over $K^{\prime}$.

Thus in order to show the claimed reduction we need only show that if
$\mathop{\text{Hom}}_{K^{\prime}}(A,B)$ is generated as an abelian group by
$K^{\prime}$-isogenies of degree $\ll_{g,K,S}1$, then
$\mathop{\text{Hom}}_{K}(A,B)$ is generated as an abelian group by
$K$-isogenies of degree $\ll_{g,K,S}1$. This follows because the (evidently
idempotent and thus surjective) $\mathbb{Z}$-linear projection
$\pi:\mathop{\text{Hom}}_{K^{\prime}}^{0}(A,B)\longrightarrow\mathop{\text{Hom}}_{K}^{0}(A,B)$
via
$\varphi\mapsto\frac{1}{[K^{\prime}:K]}\sum_{\sigma\in\mathop{\mathrm{Gal}}(K^{\prime}/K)}\sigma(\varphi)$
has the property that
$\deg{\left([K^{\prime}:K]\cdot\pi(\varphi)\right)}\ll_{g,K,S,\varphi}1$, and
thus the image of
$[K^{\prime}:K]\cdot\pi:\mathop{\text{Hom}}_{K^{\prime}}(A,B)\longrightarrow\mathop{\text{Hom}}_{K}(A,B)$,
which contains $[K^{\prime}:K]\cdot\mathop{\text{Hom}}_{K}(A,B)$, has index
$\ll_{g,K,S}1$ and is generated as an abelian group by $K$-isogenies of degree
$\ll_{g,K,S}1$. We conclude the reduction by noting that
$\mathop{\text{Hom}}_{K}(A,B)$ is free abelian of rank $\ll_{g}1$.

So we conclude that we may simply prove the claim for $A,B/K^{\prime}$
instead. Thus, replacing $K$ by $K^{\prime}$, we have achieved the desired
reduction: without loss of generality $A/K$ is split semistable and has all
its geometric endomorphisms defined over $K$.

Now let us reduce to the case of $A/K$ with "maximal" endomorphism ring. By
Proposition 6.2, there is an $A^{\prime}/K$ with $A\sim_{K}A^{\prime}$ (and
thus $A^{\prime}\sim_{K}B$) and
$\text{End}_{K}(A^{\prime})\in\widetilde{\mathcal{R}}_{g,K,S}^{\prime}$.

By Lemma 6.1, without loss of generality we may take $A=A^{\prime}$ (indeed,
if we prove the theorem in this case then we produce $K$-isogenies
$A^{\prime}\longrightarrow A$ and $A^{\prime}\longrightarrow B$ of degree
$\ll_{g,K,S}1$, whence by Lemma 6.1 a diagram $A\longrightarrow
A^{\prime}\longrightarrow B$ with each map a $K$-isogeny of degree
$\ll_{g,K,S}1$).

So we have ensured that
$\text{End}_{K}(A)\in\widetilde{\mathcal{R}}_{g,K,S}^{\prime}$ as well.

Now let us complete the proof.

In the non-isotypic case we are done111111We could treat this case in a way
more akin to the rest of the argument and thus avoid using another isogeny
estimate like Theorem 1.11, but we will not bother. — if $A\simeq
A_{1}^{\times n_{1}}\times A_{2}^{\times n_{2}}$ with each $A_{i}/K$
$K$-simple and admitting sufficiently many complex multiplications over $K$,
then $\text{End}_{K}(A_{i})$ is the maximal order in
$\text{End}_{K}^{0}(A_{i})$ and so $h(A_{i})\ll_{g,K}1$ because we may even
construct $A_{i}/\mathbb{C}$. Therefore $h(A)\ll_{g,K}1$ and so the theorem
follows from e.g. Theorem 1.11.

Otherwise we have that $A\simeq\widetilde{A}^{\times n}$ is isotypic.

Let us first treat the case of $\text{End}_{K}^{0}(A)\simeq
M_{n}(F)\in\widetilde{\mathcal{R}}_{g,K,S}^{0}$ with $F/\mathbb{Q}$ a CM field
of degree $g=[F:\mathbb{Q}]$. Thus by construction
$\text{End}_{K}(\widetilde{A})\simeq\mathfrak{o}_{F}$ and
$\text{End}_{K}(A)\simeq M_{n}(\mathfrak{o}_{F})$ under this identification.

So now let $\varphi:A\longrightarrow B$ be a $K$-isogeny, and let
$G:=\ker{\varphi}$ be its kernel. Our task is to show that there is a
$\gamma\in\text{End}_{K}(A)\simeq M_{n}(\mathfrak{o}_{F})$ with
$\ker{\gamma}\supseteq G$ and $[\ker{\gamma}:G]\ll_{g,K,S}1$, because then
$\gamma:A\longrightarrow A$ factors as
$A\xrightarrow{\varphi}B\xrightarrow{\varphi^{\prime}}A$, and
$\deg{\varphi^{\prime}}\ll_{g,K,S}1$.

To produce such a $\gamma\in M_{n}(\mathfrak{o}_{F})$ we do the following.
Write $G=:\bigoplus_{p}\widetilde{G}_{p}$. Let
$G_{p}:=M_{2}(\mathfrak{o}_{F,p})\cdot\widetilde{G}_{p}$ (with
$M_{2}(\mathfrak{o}_{F,p})$ acting diagonally on
$T_{p}(A)=T_{p}(\widetilde{A})^{\oplus n}$). Then by Lemmas 5.1 (for
$p\gg_{g,K,S}1$) and 5.2 (for $p\ll_{g,K,S}1$) we have that

$\prod_{p}[G_{p}:\widetilde{G}_{p}]\ll_{g,K,S}1.$

Let $N_{p}\in\mathbb{Z}^{+}$ be such that $G\subseteq A[p^{N_{p}}]$. Let
$\Gamma_{p}\subseteq T_{p}(A)$ be the preimage of $G\subseteq
A[p^{N_{p}}]\simeq T_{p}(A)/p^{N_{p}}$ in $T_{p}(A)$. Of course
$\Gamma_{p}\subseteq T_{p}(A)$ is of finite index, and
$M_{2}(\mathfrak{o}_{F,p})\cdot\Gamma_{p}=\Gamma_{p}$.

Recall that to define
$\rho_{\widetilde{A},p}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\mathrm{GL}_{2}(\mathfrak{o}_{F,p})$
we implicitly chose an isomorphism
$T_{p}(\widetilde{A})\cong\mathfrak{o}_{F,p}^{\oplus 2}$ as
$\mathfrak{o}_{F,p}$-modules (this is possible because $\mathfrak{o}_{F,p}$ is
a direct sum of principal ideal domains). Thus
$T_{p}(A)=T_{p}(\widetilde{A})^{\oplus n}\cong(\mathfrak{o}_{F,p}^{\oplus
2})^{\oplus n}$ under this choice.

Consequently we may regard $\Gamma_{p}\subseteq(\mathfrak{o}_{F,p}^{\oplus
2})^{\oplus n}$ as an $M_{2}(\mathfrak{o}_{F,p})$-submodule. Let
$e_{1}:=\mathrm{diag}(1,0)\in M_{2}(\mathfrak{o}_{F,p})$. Let
$\widetilde{\Gamma}_{p}:=e_{1}\cdot\Gamma_{p}$, regarded as an
$\mathfrak{o}_{F,p}$-submodule of $\mathfrak{o}_{F,p}^{\oplus
n}\cong\mathfrak{o}_{F,p}^{\oplus n}\oplus 0$.

Then because $M_{2}(\mathfrak{o}_{F,p})\cdot\Gamma_{p}=\Gamma_{p}$ it follows
that $\Gamma_{p}=\widetilde{\Gamma}_{p}^{\oplus 2}$ (since
$\mathrm{diag}(0,1)=\left(\begin{array}[]{cc}0&1\\\ 1&0\end{array}\right)\cdot
e_{1}\cdot\left(\begin{array}[]{cc}0&1\\\ 1&0\end{array}\right)$).

Now because $\mathfrak{o}_{F,p}$ is a direct sum of principal ideal domains it
follows that $\widetilde{\Gamma}_{p}$ is free (thus of rank $n$) and so there
is an $\alpha_{p}\in M_{n}(\mathfrak{o}_{F,p})$ such that
$\widetilde{\Gamma}_{p}=\alpha_{p}\cdot\mathfrak{o}_{F,p}^{\oplus n}$. Thus
$\Gamma_{p}=\alpha_{p}\cdot T_{p}(A)$.

Because $p^{N_{p}}\cdot T_{p}(A)\subseteq\Gamma_{p}$ by definition, it follows
that $\beta_{p}:=p^{N_{p}}\cdot\alpha_{p}^{-1}$ preserves $T_{p}(A)$ and thus
$\beta_{p}\in M_{n}(\mathfrak{o}_{F,p})$ satisfies
$\beta_{p}\cdot\alpha_{p}=p^{N_{p}}\cdot\mathop{\mathrm{id}}$.

Therefore (since $\Gamma_{p}=\alpha_{p}\cdot T_{p}(A)$) we have found that
$\beta_{p}\cdot G_{p}=0$ and indeed $G_{p}=\ker{(\beta_{p}\curvearrowright
A[p^{\infty}])}$. Of course this same property would hold were we to replace
$(\alpha_{p},\beta_{p})$ by $(\alpha_{p}\cdot g^{-1},g\cdot\beta_{p})$ with
$g\in\mathrm{GL}_{n}(\mathfrak{o}_{F,p})$.

Collecting these cosets $\mathrm{GL}_{n}(\mathfrak{o}_{F,p})\cdot\beta_{p}$
over all primes $p$, we have produced an element
$(\beta_{p})_{p}\in\left(\prod_{p}\mathrm{GL}_{n}(\mathfrak{o}_{F,p})\right)\backslash\mathrm{GL}_{n}(\mathfrak{o}_{F}\otimes_{\mathbb{Z}}\mathbb{A}_{\mathbb{Q}}^{\text{fin.}})/\mathrm{GL}_{n}(\mathfrak{o}_{F}\otimes_{\mathbb{Z}}\mathbb{Q})$.
By Minkowski (this is just the class group of $F$) it follows that there is a
$\gamma\in M_{n}(\mathfrak{o}_{F})$ such that $\ker{(\gamma\curvearrowright
A[p^{\infty}])}\supseteq G_{p}$ for all $p$ and

$\prod_{p}[\ker{(\gamma\curvearrowright A[p^{\infty}])}:G_{p}]\ll_{g,K,S}1.$

Hence $\ker{\gamma}\supseteq G$ and $[\ker{\gamma}:G]\ll_{g,K,S}1$ as desired.

So all that is left to be done is to deal with the case of quaternionic
multiplication, i.e. the case when $\text{End}_{K}^{0}(A)\simeq
M_{n}(D)\in\mathcal{R}_{g,K,S}^{0}$ with $D/F$ a quaternion algebra over a CM
field $F/\mathbb{Q}$ with $[F:\mathbb{Q}]=\frac{g}{2}$. Thus by construction
$\text{End}_{K}^{0}(\widetilde{A})\simeq D$,
$\text{End}_{K}(\widetilde{A})\simeq\mathfrak{o}$, and
$\text{End}_{K}(A)\simeq M_{n}(\mathfrak{o})$ with
$\mathfrak{o}\in\widetilde{\mathcal{R}}_{g,K,S}^{\prime}$ a maximal order of
$D$.

When $D$ is split at all primes of $F$ above $p$ the argument producing the
coset $\mathrm{GL}_{n}(\mathfrak{o}_{p})\cdot\beta_{p}$ is exactly the same as
above since $D_{p}\simeq M_{2}(F_{p})$ and $\mathfrak{o}_{p}\simeq
M_{2}(\mathfrak{o}_{F,p})$ under that identification. In particular this is
the case for $p\gg_{g,K,S}1$.

Otherwise $p\ll_{g,K,S}1$ and we proceed as follows. Write
$F_{p}\simeq\bigoplus_{\mathfrak{p}|(p)}F_{\mathfrak{p}}$,
$D_{p}\simeq\bigoplus_{\mathfrak{p}|(p)}D_{\mathfrak{p}}$, and
$\mathfrak{o}_{p}\simeq\bigoplus_{\mathfrak{p}|(p)}\mathfrak{o}_{\mathfrak{p}}$.

Note that again $\mathfrak{o}_{p}$ is a direct sum of principal ideal domains,
though now the summands are noncommutative.121212If $D/F$ is ramified at
$\mathfrak{p}$, then the unique maximal order
$\mathfrak{o}_{\mathfrak{p}}\subseteq D_{\mathfrak{p}}$ is the set of those
elements of $D_{\mathfrak{p}}$ which have integral norm (as can easily be
checked in the explicit basis arising from
$D_{\mathfrak{p}}\simeq(\pi,u)_{\mathfrak{p}}$ as we used in Proposition 4.1).
Therefore it follows that the fractional ideals of
$\mathfrak{o}_{\mathfrak{p}}$ are simply
$i^{k}\cdot\mathfrak{o}_{\mathfrak{p}}$ with $i^{2}=\pi$ the uniformizer of
$\mathfrak{o}_{F,\mathfrak{p}}$ and $k\in\mathbb{Z}$. In particular
$\mathfrak{o}_{\mathfrak{p}}$ is a noncommutative principal ideal domain.

Again let $\varphi:A\longrightarrow B$ be a $K$-isogeny and let
$G:=\ker{\varphi}$. Let $G=:\bigoplus_{p}\widetilde{G}_{p}$ and
$G_{p}:=\mathfrak{o}_{p}^{\text{opp.}}\cdot\widetilde{G}_{p}$ where the left
action of $\mathfrak{o}_{p}^{\text{opp.}}$ arises via
$\mathfrak{o}_{p}^{\text{opp.}}\subseteq D_{p}^{\text{opp.}}$ and the fact
that $D_{p}^{\text{opp.}}\lhook\joinrel\longrightarrow
M_{2gn}(\mathbb{Q}_{p})$ (acting by right multiplication on the
$2gn$-dimensional $\mathbb{Q}_{p}$-vector space $D_{p}^{\oplus n}$) is the
commutant of $\text{End}_{K}^{0}(A)\simeq
M_{n}(D_{p})\lhook\joinrel\longrightarrow M_{2gn}(\mathbb{Q}_{p})$ (acting by
left multiplication on said vector space).

By for example repeating the argument that gives Smith normal form ("Jacobson
normal form") one finds that, for all ramified primes $\mathfrak{p}$ of $D/F$,
all torsion-free finitely-generated modules over $\mathfrak{o}_{\mathfrak{p}}$
are free (choose a generating set over $\mathbb{Z}_{p}$ and then a generating
set over $\mathbb{Z}_{p}$ of the submodule of relations and apply Jacobson
normal form to diagonalize the resulting matrix). In particular it follows
that
$T_{\mathfrak{p}}(\widetilde{A})\cong\mathfrak{o}_{\mathfrak{p}}^{\text{opp.}}$
as $\mathfrak{o}_{\mathfrak{p}}^{\text{opp.}}$-modules when $D/F$ is ramified
at $\mathfrak{p}$, since $T_{\mathfrak{p}}(\widetilde{A})$ is a free
$\mathfrak{o}_{\mathfrak{p}}^{\text{opp.}}$-module by the above. (We already
used this when writing
$\rho_{\widetilde{A},p}:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow(\mathfrak{o}_{p}^{\text{opp.}})^{\times}$.)

Therefore we may simply repeat the same argument. Let $N_{p}\in\mathbb{Z}^{+}$
be such that $G\subseteq A[p^{N_{p}}]\simeq T_{p}(A)/p^{N_{p}}$ and let
$\Gamma_{p}\subseteq T_{p}(A)\simeq T_{p}(\widetilde{A})^{\oplus n}$ be the
preimage of $G$ in $T_{p}(A)$ as before. Thus $\Gamma_{p}$ is a torsion-free
finitely-generated $\mathfrak{o}_{p}^{\text{opp.}}$-module, whence free
(automatically of rank $n$), whence there is again an $\alpha_{p}\in
M_{n}(\mathfrak{o}_{p})$ such that $\Gamma_{p}=\alpha_{p}\cdot T_{p}(A)$. We
again produce $\beta_{p}\in M_{n}(\mathfrak{o}_{p})$ such that
$\beta_{p}\cdot\alpha_{p}=p^{N_{p}}\cdot\mathop{\mathrm{id}}$ and then by
Minkowski (this is a very explicit case of Borel-Harish-Chandra) it follows
after considering the class
$(\beta_{p})_{p}\in\left(\prod_{p}\mathrm{GL}_{n}(\mathfrak{o}\otimes_{\mathbb{Z}}\mathbb{Z}_{p})\right)\backslash\mathrm{GL}_{n}(\mathfrak{o}\otimes_{\mathbb{Z}}\mathbb{A}_{\mathbb{Q}}^{\text{fin.}})/\mathrm{GL}_{n}(\mathfrak{o}\otimes_{\mathbb{Z}}\mathbb{Q})$
that there is a $\gamma\in M_{n}(\mathfrak{o})$ such that
$\ker{\gamma}\supseteq G$ and $[\ker{\gamma}:G]\ll_{g,K,S}1$, exactly as
before.

We are done. ∎

##  7 Proof of Theorem 1.2.

###### Proof of Theorem 1.2..

Apply Theorem 1.1 with $B=A$.131313Alternatively, combine Theorem 1.1, Lemma
3.4, and Propositions 4.1 and 6.2 to upper bound the index of
$\text{End}_{K}(A)$ in one of an explicit finite set of rings. ∎

##  8 Proof of Theorem 1.3.

###### Proof of Theorem 1.3..

The number of $K$-isogeny classes is $\ll_{g,K,S}1$ by Lemma 3.3 and Faltings’
proof of the Tate conjecture for homomorphisms of abelian varieties. Each
$K$-isogeny class contains $\ll_{g,K,S}1$ abelian varieties by Theorem 1.1.
The theorem follows. ∎

##  9 Proof of Corollary 1.4.

###### Proof of Corollary 1.4..

It suffices (by Chevalley-Weil) to bound the number of
$\mathfrak{o}_{K,S}$-points on the Hilbert modular variety with full
level-$10^{10}!$ structure (so that we are actually bounding the number of
points on a variety). By Theorem 1.3 the only things to bound are the number
of embeddings $\mathfrak{o}\lhook\joinrel\longrightarrow\mathfrak{o}^{\prime}$
with $\mathfrak{o}^{\prime}\in\mathcal{R}_{g,K,S}$ (notation as in Theorem
1.2) up to conjugation by $\mathfrak{o}^{\prime\times}$, and, given
$\mathfrak{o}\lhook\joinrel\longrightarrow\text{End}_{K}(A)$, the number of
$\mathfrak{o}$-linear polarizations $A\otimes_{\mathfrak{o}}\mathfrak{a}\simeq
A^{*}$ with $\mathfrak{a}\in\mathrm{Cl}(\mathfrak{o})$. The latter is easy.
The former is straightforward and follows from e.g. an easily effectivized
case of Borel–Harish-Chandra [3] (use e.g. the usual generalization of
Eichler’s trace formula for optimal embeddings). ∎

##  10 Proof of Theorem 1.5.

Let us now prove Theorem 3.2.141414Because we chose to state Theorem 3.2 in a
previous section (namely immediately after Lemma 3.1 in Section 3.1), it is
important to note that no preceding results depend on Theorem 3.2, and so we
are e.g. free to use Proposition 5.1 in the below proof.

###### Proof of Theorem 3.2..

Let $L/K$ be the compositum of all quadratic extensions of $K$ which are
unramified outside $S$ — $L/K$ is an explicit finite extension by Minkowski’s
proof of the Hermite-Minkowski theorem. We take $C_{g,K,N}$ to be the constant
produced by Proposition 5.1 applied to $(g,L,S)$, where $S$ is the finite set
of all places of $L$ which divide $N$. Let then $p\geq C_{g,K,N}$.

By Lemma $3.9$ of our [2] aka Lemma 3.1 above, there is a
$g\in\mathrm{GL}_{2}(\mathfrak{o}_{E}/\mathfrak{p})$ and a subfield
$\mathbb{F}_{q}\subseteq\mathfrak{o}_{E}/\mathfrak{p}$ such that

$g\cdot\mathrm{SL}_{2}(\mathbb{F}_{q})\cdot
g^{-1}\subseteq\overline{\rho}_{A,\mathfrak{p}}(\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K))\subseteq(\mathfrak{o}_{E}/\mathfrak{p})^{\times}\cdot(g\cdot\mathrm{GL}_{2}(\mathbb{F}_{q})\cdot
g^{-1}),$

so that all there is to show is that
$\mathbb{F}_{q}=\mathfrak{o}_{E}/\mathfrak{p}$. Of course by changing basis
(i.e. replacing $\rho_{A,\mathfrak{p}}$ by
$g^{-1}\cdot\rho_{A,\mathfrak{p}}\cdot g$) without loss of generality
$g=\mathop{\mathrm{id}}$.

Let
$\sigma\in\mathop{\mathrm{Gal}}((\mathfrak{o}_{E}/\mathfrak{p})/\mathbb{F}_{q})\subseteq\mathop{\mathrm{Gal}}((\mathfrak{o}_{E}/\mathfrak{p})/\mathbb{F}_{p})\simeq\mathop{\mathrm{Gal}}(E_{\mathfrak{p}}/\mathbb{Q}_{p})$.
Regarding $\sigma\in\mathop{\mathrm{Gal}}(E_{\mathfrak{p}}/\mathbb{Q}_{p})$,
let $\rho_{A,\mathfrak{p}}^{\sigma}:=\sigma\circ\rho_{A,\mathfrak{p}}$ be the
conjugate representation.

Now for each $g\in\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)$ there is a
$\lambda_{g}\in(\mathfrak{o}_{E}/\mathfrak{p})^{\times}$ and an
$f(g)\in\mathrm{GL}_{2}(\mathbb{F}_{q})$ such that
$\overline{\rho}_{A,\mathfrak{p}}(g)=\lambda_{g}\cdot f(g)\mkern
4.0mu({\operator@font mod}\mkern 6.0mu\mathfrak{p})$. (Note that
$g\mapsto\lambda_{g}$ is well-defined modulo $\mathbb{F}_{q}^{\times}$.)
Because
$\lambda_{g}^{2}\cdot\det{f(g)}=\det{\overline{\rho}_{A,\mathfrak{p}}(g)}=\chi_{p}(g)\in\mathbb{F}_{p}^{\times}$,
it follows that, for all $g\in\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)$,
$\lambda_{g}^{2}\in\mathbb{F}_{q}^{\times}$.

Therefore in particular $\sigma(\lambda_{g})=\pm\lambda_{g}$ for all
$g\in\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)$. It follows that, for
each $g\in\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)$, there is a unique
$\varepsilon(g)\in\\{\pm 1\\}$ such that
$\sigma(\overline{\rho}_{A,\mathfrak{p}}(g))\cdot\overline{\rho}_{A,\mathfrak{p}}(g)^{-1}\
=\varepsilon(g)\cdot\mathop{\mathrm{id}}\mkern 4.0mu({\operator@font
mod}\mkern 6.0mu\mathfrak{p})$. Since
$\lambda_{gh}\equiv\lambda_{g}\cdot\lambda_{h}\mkern 4.0mu({\operator@font
mod}\mkern 6.0mu\mathbb{F}_{q}^{\times})$, it follows that
$\varepsilon:\mathop{\mathrm{Gal}}(\overline{\mathbb{Q}}/K)\longrightarrow\\{\pm
1\\}$ is a character.

We claim that $\varepsilon$ is unramified outside $S$. This amounts to the
statement that $\varepsilon|_{I_{\mathfrak{q}}}=\mathrm{triv}$ for
$\mathfrak{q}\subseteq\mathfrak{o}_{K}$ with $\mathfrak{q}|(p)$ a prime of $K$
above $p$ (it is automatic for all other residue characteristics). Of course
(since wild inertia is pro-$p$) $\varepsilon$ is at most tamely ramified at
$\mathfrak{q}$. It then follows that if
$\varepsilon|_{I_{\mathfrak{q}}}\neq\mathrm{triv}$ then
$\varepsilon|_{I_{\mathfrak{q}}}\equiv\chi_{p}|_{I_{\mathfrak{q}}}^{\frac{p-1}{2}}\mkern
4.0mu({\operator@font mod}\mkern 6.0mu\mathfrak{p})$. So we need only rule
this latter possibility out.