# Rational torsion points on abelian surfaces with quaternionic multiplication

Jef Laga  Department of Mathematics, Princeton University, Princeton, NJ
08544, USA<EMAIL_ADDRESS>,  Ciaran Schembri  Department of Mathematics,
Dartmouth College, 6188 Kemeny Hall, Hanover, NH 03755, USA
<EMAIL_ADDRESS>,  Ari Shnidman  Einstein Institute of
Mathematics, Hebrew University of Jerusalem, Israel<EMAIL_ADDRESS>and  John Voight  Department of Mathematics, Dartmouth College, 6188 Kemeny
Hall, Hanover, NH 03755, USA<EMAIL_ADDRESS>
###### Abstract.

Let $A$ be an abelian surface over $\mathbb{Q}$ whose geometric endomorphism
ring is a maximal order in a non-split quaternion algebra. Inspired by Mazur’s
theorem for elliptic curves, we show that the torsion subgroup of
$A(\mathbb{Q})$ is $12$-torsion and has order at most $18$. Under the
additional assumption that $A$ is of $\operatorname{GL}_{2}$-type, we give a
complete classification of the possible torsion subgroups of $A(\mathbb{Q})$.

###### Contents

  1. 1 Introduction
  2. 2 Quaternionic arithmetic
  3. 3 Galois actions, polarizations and endomorphisms
  4. 4 PQM surfaces over local and finite fields
  5. 5 Proof of Theorem 1.4: PQM surfaces of $\operatorname{GL}_{2}$-type
  6. 6 Proof of Theorem 1.1: reduction to $\operatorname{GL}_{2}$-type
  7. 7 Proof of Theorems 1.2 and 1.3: eliminating groups of order $2^{i}3^{j}$
  8. 8 Proof of Theorem 1.5: PQM Jacobians

##  1\. Introduction

###  1.1. Motivation

Let $E$ be an elliptic curve over $\mathbb{Q}$. In [Maz77], Mazur famously
showed that if a prime $\ell$ divides the order of the torsion subgroup
$E(\mathbb{Q})_{\operatorname{tors}}$ of $E(\mathbb{Q})$ then $\ell\leq 7$.
Combining with previous work of Kubert [Kub76], Mazur deduced that
$\\#E(\mathbb{Q})_{\operatorname{tors}}\leq 16$ and that
$E(\mathbb{Q})_{\mathrm{tors}}$ is isomorphic to one of fifteen finite abelian
groups, each of which gives rise to a genus $0$ modular curve with a well
known rational parametrization.

It is not known whether there is a uniform bound on the size of the rational
torsion subgroup of abelian varieties of fixed dimension $g\geq 2$ over a
fixed number field. In fact, there is not even a single integer $N$ for which
it is known that there is no abelian surface over $\mathbb{Q}$ with a torsion
point of order $N$. Indeed, determining rational points on Siegel modular
threefolds with level structure seems challenging in general.

###  1.2. Results

In this paper we study the torsion subgroup of abelian surfaces $A$ over
$\mathbb{Q}$ whose geometric endomorphism ring is large. Namely, we suppose
that the geometric endomorphism ring
$\operatorname{End}(A_{\overline{\mathbb{Q}}})$ is a maximal order
$\mathcal{O}$ in a division quaternion algebra over $\mathbb{Q}$; we refer to
these as $\mathcal{O}$-$\mathrm{PQM}$ surfaces (“potential quaternionic
multiplication”). Such abelian surfaces are geometrically simple, so their
torsion subgroup cannot be studied using torsion subgroups of elliptic curves.
On the other hand, they give rise to rational points on certain Shimura
curves, much as elliptic curves over $\mathbb{Q}$ give rise to rational points
on modular curves. Thus $\mathcal{O}$-$\mathrm{PQM}$ surfaces are a natural
place to explore torsion questions in higher dimension.

Our main results show that the torsion behaviour of $\mathcal{O}$-PQM surfaces
is rather constrained.

######  Theorem 1.1.

Let $A$ be an $\mathcal{O}$-$\mathrm{PQM}$ abelian surface over $\mathbb{Q}$
with a rational point of order $\ell$, where $\ell$ is a prime number. Then
$\ell=2$ or $\ell=3$.

######  Theorem 1.2.

Each $\mathcal{O}$-$\mathrm{PQM}$ abelian surface $A$ over $\mathbb{Q}$ has
$\\#A(\mathbb{Q})_{\operatorname{tors}}\leq 18$.

The fact that the rational torsion on $\mathcal{O}$-PQM surfaces is uniformly
bounded is not new nor is it difficult to prove. Indeed, since
$\mathcal{O}$-$\mathrm{PQM}$ surfaces have everywhere potentially good
reduction (Lemma 4.1.2), local methods quickly show that
$\ell\mid\\#A(\mathbb{Q})_{\operatorname{tors}}$ implies $\ell\leq 19$ and
that $\\#A(\mathbb{Q})_{\operatorname{tors}}\leq 72$ [CX08, Theorem 1.4]. The
goal of this paper is instead to prove results which are as precise as
possible.

Theorems 1.1 and 1.2 are optimal since it is known that each of the seven
groups

(1.2.1)
$\begin{gathered}\\{1\\},\,\mathbb{Z}/2\mathbb{Z},\,\mathbb{Z}/3\mathbb{Z},\,(\mathbb{Z}/2\mathbb{Z})^{2}\\\
\mathbb{Z}/6\mathbb{Z},\,(\mathbb{Z}/3\mathbb{Z})^{2},\,\mathbb{Z}/2\mathbb{Z}\times(\mathbb{Z}/3\mathbb{Z})^{2}\end{gathered}$

is isomorphic to $A(\mathbb{Q})_{\operatorname{tors}}$ for some
$\mathcal{O}$-$\mathrm{PQM}$ surface $A/\mathbb{Q}$, with the largest group
having order $18$. Indeed, each of these groups arises as
$A(\mathbb{Q})_{\mathrm{tors}}$ for infinitely many
$\overline{\mathbb{Q}}$-isomorphism classes of such surfaces by [LS23, Theorem
1.1].

Our methods give the following more precise constraints on the group structure
of $A(\mathbb{Q})_{\operatorname{tors}}$.

######  Theorem 1.3.

Let $A$ be an $\mathcal{O}$-$\mathrm{PQM}$ abelian surface over $\mathbb{Q}$.
Then $A(\mathbb{Q})_{\operatorname{tors}}$ is isomorphic either to one of the
groups in (1.2.1) or to one of the following groups:

(1.2.2)
$\begin{gathered}\mathbb{Z}/4\mathbb{Z},\mathbb{Z}/2\mathbb{Z}\times\mathbb{Z}/4\mathbb{Z},(\mathbb{Z}/2\mathbb{Z})^{3},(\mathbb{Z}/2\mathbb{Z})^{2}\times\mathbb{Z}/3\mathbb{Z},\\\
\mathbb{Z}/4\mathbb{Z}\times\mathbb{Z}/3\mathbb{Z},(\mathbb{Z}/2\mathbb{Z})^{2}\times\mathbb{Z}/4\mathbb{Z},(\mathbb{Z}/4\mathbb{Z})^{2}.\end{gathered}$

We leave open the question of whether any of the groups of (1.2.2) arise as
$A(\mathbb{Q})_{\mathrm{tors}}$ for some $\mathcal{O}$-$\mathrm{PQM}$ surface
or not.

Theorem 1.3 can be interpreted as a non-existence result for non-special
rational points on certain types of Shimura curves with level structure. Since
the discriminant of $\operatorname{End}(A_{\overline{\mathbb{Q}}})$ and level
are unconstrained, the result covers infinitely many distinct such curves.
However, as we explain below, our proof of Theorem 1.3 does not make direct
use of the arithmetic of Shimura curves.

Whereas the theorems above consider general $\mathcal{O}$-$\mathrm{PQM}$
abelian surfaces, one is sometimes interested in surfaces with additional
structure. For example, recall that $A$ is of $\operatorname{GL}_{2}$-type if
the endomorphism ring $\operatorname{End}(A)$ is a quadratic ring. Modularity
results (see Theorem 5.1.1) imply that an abelian variety $A$ of
$\operatorname{GL}_{2}$-type over $\mathbb{Q}$ is a quotient of the modular
Jacobian $J_{1}(N)$ for some $N$. More precisely, the isogeny class of $A$
arises from a cuspidal newform of weight $2$ and level $N$, where $A$ has
conductor $N^{2}$. Specializing our methods to this setting, we obtain the
following complete classification.

######  Theorem 1.4.

Let $A$ be an $\mathcal{O}$-$\mathrm{PQM}$ surface over $\mathbb{Q}$ of
$\operatorname{GL}_{2}$-type. Then $A(\mathbb{Q})_{\operatorname{tors}}$ is
isomorphic to one of the following groups:

$\\{1\\},\mathbb{Z}/2\mathbb{Z},\mathbb{Z}/3\mathbb{Z},(\mathbb{Z}/2\mathbb{Z})^{2},(\mathbb{Z}/3\mathbb{Z})^{2}.$

Every one of these groups arises as $A(\mathbb{Q})_{\operatorname{tors}}$ for
infinitely many $\overline{\mathbb{Q}}$-isomorphism classes of
$\mathcal{O}$-$\mathrm{PQM}$ surfaces $A$ over $\mathbb{Q}$ of
$\operatorname{GL}_{2}$-type.

######  Remark 1.2.3.

The proof shows that if the maximality assumption on $\mathcal{O}$ is omitted,
then a similar classification holds except we do not know whether the group
$(\mathbb{Z}/2\mathbb{Z})^{3}$ arises or not.

Another natural class of abelian surfaces is Jacobians of genus two curves.
Recall that for geometrically simple abelian surfaces, being a Jacobian is
equivalent to carrying a principal polarization. Thus, the following result
gives a near-classification for rational torsion subgroups of genus two
Jacobians over $\mathbb{Q}$ in the $\mathcal{O}$-$\mathrm{PQM}$ locus of the
Siegel modular 3-fold $\mathcal{A}_{2}$ parameterizing principally polarized
abelian surfaces.

######  Theorem 1.5.

Let $J$ be an $\mathcal{O}$-$\mathrm{PQM}$ surface over $\mathbb{Q}$ which is
the Jacobian of a genus two curve over $\mathbb{Q}$. Then
$J(\mathbb{Q})_{\operatorname{tors}}$ is isomorphic to one of the following
groups:

$\displaystyle\\{1\\},\mathbb{Z}/2\mathbb{Z},\mathbb{Z}/3\mathbb{Z},(\mathbb{Z}/2\mathbb{Z})^{2},\mathbb{Z}/6\mathbb{Z},(\mathbb{Z}/3\mathbb{Z})^{2},$
$\displaystyle\mathbb{Z}/4\mathbb{Z},\mathbb{Z}/2\mathbb{Z}\times\mathbb{Z}/4\mathbb{Z},(\mathbb{Z}/2\mathbb{Z})^{2}\times\mathbb{Z}/3\mathbb{Z},\mathbb{Z}/4\mathbb{Z}\times\mathbb{Z}/3\mathbb{Z},(\mathbb{Z}/4\mathbb{Z})^{2}$

In particular, $\\#J(\mathbb{Q})_{\operatorname{tors}}\leq 16$.

The first six groups in the list above can be realized as
$J(\mathbb{Q})_{\operatorname{tors}}$; see Table LABEL:PQMequationstable. We
do not know whether they can be realized infinitely often by
$\mathcal{O}$-$\mathrm{PQM}$ Jacobians over $\mathbb{Q}$.

###  1.3. Methods

We first describe the proof of Theorem 1.4, which is almost entirely local in
nature. Let $A$ be an $\mathcal{O}$-$\mathrm{PQM}$ surface over $\mathbb{Q}$
of $\operatorname{GL}_{2}$-type. We show that $A$ has totally additive
reduction at every prime $p$ of bad reduction, meaning that the identity
component of the special fiber of the Néron model at $p$ is unipotent. It is
well known that in this case the prime-to-$p$ torsion subgroup of
$A(\mathbb{Q}_{p})$ embeds in the Néron component group of $A$ at $p$, and
that this component group is controlled by the smallest field over which $A$
acquires good reduction. Our proof of Theorem 1.4 therefore involves an
analysis of this field extension, in particular we show that its degree is
coprime to $\ell$ for any prime $\ell\geq 5$. Applying these local arguments
requires the existence of suitable primes of bad reduction, and breaks down
when $A$ has conductor of the form $2^{n}$, $3^{n}$, or $6^{4}$. We handle
these cases seperately by invoking the modularity theorem. It turns out there
is a single isogeny class whose conductor is of this form, namely the isogeny
class of conductor $3^{10}$, corresponding to a Galois orbit of newforms of
level $3^{5}=243$, with LMFDB label 243.2.a.d.

To prove Theorem 1.1, we need to exclude the existence of an
$\mathcal{O}$-$\mathrm{PQM}$ surface $A$ over $\mathbb{Q}$ such that
$A[\ell](\mathbb{Q})$ is nontrivial for some prime $\ell\geq 5$. By studying
the interaction between the Galois action on the torsion points of $A$ and the
Galois action on $\operatorname{End}(A_{\overline{\mathbb{Q}}})$, we show that
such an $A$ must necessarily be of $\operatorname{GL}_{2}$-type, so we may
conclude using Theorem 1.4. The methods of this ‘reduction to
$\operatorname{GL}_{2}$-type’ argument are surprisingly elementary. Aside from
some calculations in the quaternion order $\mathcal{O}$, the key observation
is that in the non-$\operatorname{GL}_{2}$-type case, the geometric
endomorphism algebra $\operatorname{End}^{0}(A_{\overline{\mathbb{Q}}})$
contains a (unique) Galois-stable imaginary quadratic subfield, which is
naturally determined by the (unique) polarization defined over $\mathbb{Q}$.

To prove Theorems 1.2 and 1.3, we must constrain the remaining possibilities
for $A(\mathbb{Q})_{\operatorname{tors}}$, which is a group of order
$2^{i}3^{j}$ by Theorem 1.1. Our arguments here are ad hoc, relying on a
careful analysis of the reduction of $A$ modulo various primes via Honda–Tate
theory (with the aid of the LMFDB [LMF23]) to constrain the possible torsion
groups, reduction types, and Galois action on the endomorphism ring. The proof
of Theorem 1.5 is similar, but using the relationship between endomorphisms,
polarizations, and level structures.

###  1.4. Previous work

Rational torsion on $\mathcal{O}$-$\mathrm{PQM}$ surfaces was previously
considered in the Ph.D. thesis of Clark [Cla03, Chapter 5], but see the
author’s caveat emptor, indicating that the proofs of the main results of that
chapter are incomplete.

###  1.5. Future directions

Our methods use the maximality assumption on
$\operatorname{End}(A_{\overline{\mathbb{Q}}})$ in various places. It would be
interesting and desirable to relax this condition, especially since groups of
order 12 and 18 can indeed arise in genus two Jacobians with non-maximal PQM;
see, for example, the curve $y^{2}=24x^{5}+36x^{4}-4x^{3}-12x^{2}+1$ and
[LS23, Remark 7.17]. It would also be interesting to systematically analyze
rational points on (Atkin–Lehner quotients of) Shimura curves with level
structure, for example to determine whether the remaining groups (1.2.2) arise
or not. We hope to address this in future work.

###  1.6. Organization

Sections 2-4 are preliminary, and the remaining sections are devoted to
proving the main theorems of the introduction. As explained in §1.3, we start
by proving Theorem 1.4 because the other theorems depend on it.

Those who wish to take the shortest route to Theorem 1.4 (minus eliminating
$(\mathbb{Z}/2\mathbb{Z})^{3}$) only need to read Sections 3.2, 4 and 5.
Eliminating the last group $(\mathbb{Z}/2\mathbb{Z})^{3}$ in Proposition 5.3.8
requires more algebraic preliminaries from Section 2 and 3.

###  1.7. Acknowledgements

We would like to thank Davide Lombardo for interesting discussions related to
this project. Schembri and Voight were supported by a Simons Collaboration
Grant (550029, to JV). Part of this project was carried out while Laga visited
Shnidman at the Hebrew University of Jerusalem. Shnidman was funded by the
European Research Council (ERC, CurveArithmetic, 101078157).

###  1.8. Notation

We fix the following notation for the remainder of this paper:

  * •

$B$: an indefinite (so
$B\otimes\mathbb{R}\simeq\operatorname{Mat}_{2}(\mathbb{R})$) quaternion
algebra over $\mathbb{Q}$ of discriminant $\operatorname{disc}(B)\neq 1$;

  * •

$\operatorname{trd}(b)$, $\operatorname{nrd}(b)$ and $\bar{b}$: reduced trace,
reduced norm, and canonical involution of an element $b\in B$ respectively;

  * •

$\mathcal{O}$: a choice of maximal order of $B$;

  * •

$\bar{F}$: a choice of algebraic closure of a field $F$;

  * •

$\operatorname{Gal}_{F}$: the absolute Galois group of $F$;

  * •

$\operatorname{End}(A)$: the endomorphism ring of an abelian variety $A$
defined over $F$;

  * •

$\operatorname{End}^{0}(A)=\operatorname{End}(A)\otimes\mathbb{Q}$: the
endomorphism algebra of $A$;

  * •

$\operatorname{NS}(A)$: the Néron–Severi group of $A$;

  * •

$A_{K}$: base change of $A/F$ along a field extension $K/F$;

  * •

$\left(\frac{m,n}{F}\right)$: the quaternion algebra over $F$ with basis
$\\{1,i,j,ij\\}$ such that $i^{2}=m,j^{2}=n$ and $ij=-ji$;

  * •

$D_{n}:$ the dihedral group of order $2n$.

We say an abelian surface $A$ over a field $F$ is an
$\mathcal{O}$-$\mathrm{PQM}$ surface if there is an isomorphism
$\operatorname{End}(A_{\bar{F}})\simeq\mathcal{O}$.
$\mathcal{O}$-$\mathrm{PQM}$ surfaces over $\mathbb{Q}$ are the central object
of interest in this paper, but some of our results apply to abelian surfaces
whose geometric endomorphism ring is a possibly non-maximal order in a non-
split quaternion algebra. We call such surfaces simply PQM surfaces.

We emphasize that this is a restrictive definition of ‘PQM’: we require that
$\operatorname{End}(A_{\bar{F}})$ does not merely contain such a quaternion
order, but is equal to it. In particular, under our terminology, a
$\mathrm{PQM}$ surface $A$ is geometrically simple.

Concerning actions: we will use view Galois actions as _right_ actions. We
will view $\operatorname{End}(A)$ as acting on $A$ on the _left_. If a group
$G$ acts on a set $X$ on the right, we write $X^{G}$ for the set of $G$-fixed
points.

##  2\. Quaternionic arithmetic

This section collects some algebraic calculations in the quaternion order
$\mathcal{O}$. It can be safely skipped on a first pass; the reader can return
back to it when these calculations are used.

###  2.1. The normalizer of a maximal order

We recall the following characterization of the normalizer
$N_{B^{\times}}(\mathcal{O})$ of $\mathcal{O}$ in $B^{\times}$ (with respect
to the conjugation action).

######  Lemma 2.1.1.

An element of $B^{\times}/\mathbb{Q}^{\times}$ lies in
$N_{B^{\times}}(\mathcal{O})/\mathbb{Q}^{\times}$ if and only if it can be
represented by an element of $\mathcal{O}$ of reduced norm dividing
$\operatorname{disc}(B)$.

###### Proof.

An element $b\in B$ lies in $N_{B^{\times}}(\mathcal{O})$ if and only if it
lies in the local normalizer
$N_{(B\otimes\mathbb{Q}_{p})^{\times}}(\mathcal{O}\otimes\mathbb{Z}_{p})$ for
all primes $p$. If $p$ does not divide $\operatorname{disc}(B)$, then this
normalizer group equals
$\mathbb{Q}_{p}^{\times}(\mathcal{O}\otimes\mathbb{Z}_{p})^{\times}$ [Voi21,
(23.2.4)]. If $p$ divides $\operatorname{disc}(B)$, this group equals
$(B\otimes\mathbb{Q}_{p})^{\times}$ ((23.2.8) in op. cit.). If $b$ has norm
dividing $\operatorname{disc}(B)$, then this description shows that $b$ lies
in all local normalizer groups. Conversely, if $b$ normalizes $\mathcal{O}$
then this description shows that there exists a finite adele
$(\lambda_{p})_{p}$ such that
$\lambda_{p}b\in(\mathcal{O}\otimes\mathbb{Z}_{p})^{\times}$ for all
$p\nmid\operatorname{disc}(B)$ and such that
$\operatorname{nrd}(\lambda_{p}b)$ has $p$-adic valuation $\leq 1$ for all
$p\mid\operatorname{disc}(B)$. Since $\mathbb{Z}$ has class number one, there
exists $\lambda\in\mathbb{Q}^{\times}$ such that
$\lambda\lambda_{p}^{-1}\in\mathbb{Z}_{p}^{\times}$ for all $p$ and so
$\lambda b\in\mathcal{O}$ has norm dividing $\operatorname{disc}(B)$, as
desired. ∎

We recall for future reference that the quotient of
$N_{B^{\times}}(\mathcal{O})/\mathbb{Q}^{\times}$ by the subgroup
$\mathcal{O}^{\times}/\\{\pm 1\\}$ is by definition the Atkin–Lehner group $W$
of $\mathcal{O}$, an elementary abelian $2$-group whose elements can be
identified with positive divisors of $\operatorname{disc}(B)$.

###  2.2. Dihedral actions on $\mathcal{O}$

For reasons that will become clear in §3.2, we are interested in subgroups
$G\subset\operatorname{Aut}(\mathcal{O})$ isomorphic to $D_{n}$ for some
$n\in\\{1,2,3,4,6\\}$. In this section we describe these subgroups very
explicitly.

By the Skolem–Noether theorem, every ring automorphism of $\mathcal{O}$ is of
the form $x\mapsto b^{-1}xb$ for some $b\in B^{\times}$ normalising
$\mathcal{O}$, and $b$ is uniquely determined up to
$\mathbb{Q}^{\times}$-multiples. Therefore
$\operatorname{Aut}(\mathcal{O})\simeq
N_{B^{\times}}(\mathcal{O})/\mathbb{Q}^{\times}$.

If $b\in B^{\times}$, write $[b]$ for its class in
$B^{\times}/\mathbb{Q}^{\times}$.

######  Lemma 2.2.1.

Every element of $N_{B^{\times}}(\mathcal{O})/\mathbb{Q}^{\times}$ of order
$2$ is represented by an element $b\in\mathcal{O}$ such that $b^{2}=m\neq 1$
is an integer dividing $\operatorname{disc}(B)$. Moreover
$\mathcal{O}^{\langle b\rangle}=\\{x\in\mathcal{O}\mid b^{-1}xb=x\\}$ is
isomorphic to an order in $\mathbb{Q}(\sqrt{m})$ containing
$\mathbb{Z}[\sqrt{m}]$.

###### Proof.

By Lemma 2.1.1, we may choose a representative $b\in
N_{B^{\times}}(\mathcal{O})$ lying in $\mathcal{O}$ whose norm
$\operatorname{nrd}(b)$ divides $\operatorname{disc}(B)$. Since the element
has order $2$, $m:=b^{2}=-\operatorname{nrd}(b)$ is an integer. We have $m\neq
1$ since otherwise $b^{2}=1$ hence $b=\pm 1\in\mathbb{Q}^{\times}$, which is
trivial in $N_{B^{\times}}(\mathcal{O})/\mathbb{Q}^{\times}$. This implies
$\mathcal{O}^{\langle b\rangle}=\\{x\in B\mid b^{-1}xb=x\\}$ is an order in
$B^{\langle g\rangle}=\mathbb{Q}(b)$ containing
$\mathbb{Z}[b]\simeq\mathbb{Z}[\sqrt{m}]$, as claimed. ∎

######  Lemma 2.2.2.

Let $G\subset N_{B^{\times}}(\mathcal{O})/\mathbb{Q}^{\times}$ be a subgroup
isomorphic to $D_{2}=C_{2}\times C_{2}$. Then there exist elements
$i,j,k\in\mathcal{O}$ such that $B$ has basis $\\{1,i,j,k\\}$, such that
$i^{2}=m$, $j^{2}=n$ and $k^{2}=t$ all divide $\operatorname{disc}(B)$, such
that $ij=-ji$ and $ij\in\mathbb{Q}^{\times}k$, and such that
$G=\\{1,[i],[j],[k]\\}$. Moreover, $t$ equals $-mn$ up to squares.

###### Proof.

By Lemma 2.2.1, we can pick representatives $i,j,k\in\mathcal{O}$ of the
nontrivial elements of $G$ that each square to an integer dividing
$\operatorname{disc}(B)$. Since $G$ is commutative, $ji=\lambda ij$ for some
$\lambda\in\mathbb{Q}^{\times}$. Comparing norms shows that $\lambda=\pm 1$.
If $\lambda=1$, then $ij=ji$ but this would imply that $B$ is commutative,
contradiction. Therefore $ij=-ji$. Finally, since $[i][j]=[k]$,
$k\in\mathbb{Q}^{\times}ij$. Taking norms, we see that $t$ equals $-mn$ up to
squares. ∎

######  Lemma 2.2.3.

Let $G\subset N_{B^{\times}}(\mathcal{O})/\mathbb{Q}^{\times}$ be a subgroup
isomorphic to $D_{4}$. Then there exists elements $i,j\in\mathcal{O}$ such
that $B$ has basis $\\{1,i,j,ij\\}$, such that $i^{2}=-1$, $j^{2}=m$ divides
$\operatorname{disc}(B)$ and $ij=-ji$, and such that
$G=\langle[1+i],[j]\rangle$. Moreover, $2\mid\operatorname{disc}(B)$.

###### Proof.

The fact that such $i,j\in B$ exist follows from [Voi21, §32.5 and §32.6]
(itself based on results of [CF00]). By $\mathbb{Q}^{\times}$-scaling $j$ we
may assume that $j^{2}=m$ is a squarefree integer. Since $1+i,j\in
N_{B^{\times}}(\mathcal{O})$, Lemma 2.1.1 shows that $i,j\in\mathcal{O}$ and
$m\mid\operatorname{disc}(B)$ and
$\operatorname{nrd}(1+i)=2\mid\operatorname{disc}(B)$. ∎

######  Lemma 2.2.4.

Let $G\subset N_{B^{\times}}(\mathcal{O})/\mathbb{Q}^{\times}$ be a subgroup
isomorphic to $D_{3}$ or $D_{6}$. Then there exist elements
$\omega,j\in\mathcal{O}$ such that $B$ has basis $\\{1,\omega,j,\omega j\\}$,
such that $\omega^{3}=1$, $j^{2}=m\mid\operatorname{disc}(B)$ and $\omega
j=j\bar{\omega}=j(-1-\omega)$, and such that $G=\langle[1+\omega],[j]\rangle$
if $G\simeq D_{3}$ and $G=\langle[1-\omega],[j]\rangle$ if $G\simeq D_{6}$.
Moroever, if $G\simeq D_{6}$ then $3\mid\operatorname{disc}(B)$.

###### Proof.

Identical to that of Lemma 2.2.3, again using [Voi21, §32.5 and §32.6] and
Lemma 2.1.1. ∎

###  2.3. Fixed point subgroups modulo $N$

For reasons similar to those of §2.2, we study the fixed points of $G$-actions
on $\mathcal{O}/N\mathcal{O}$ for subgroups
$G\subset\operatorname{Aut}(\mathcal{O})$ isomorphic to $D_{n}$ for some
$n\in\\{1,2,3,4,6\\}$ and integers $N\geq 1$ of interest.

######  Theorem 2.3.1.

Let $G$ be a subgroup of $\operatorname{Aut}(\mathcal{O})$ isomorphic to
$D_{n}$ for some $n\in\\{1,2,3,4,6\\}$.

  1. (a)

Suppose that $N$ is coprime to $2$ and $3$. Then
$(\mathcal{O}/N\mathcal{O})^{G}$ is isomorphic to
$(\mathbb{Z}/N\mathbb{Z})^{2}$ if $G=D_{1}$ and isomorphic to
$\mathbb{Z}/N\mathbb{Z}$ if $G=D_{2},D_{3},D_{4}$ or $D_{6}$.

  2. (b)

The group $(\mathcal{O}/3\mathcal{O})^{G}$ is isomorphic to
$(\mathbb{Z}/3\mathbb{Z})^{2}$ if $G=D_{1}$; isomorphic to
$\mathbb{Z}/3\mathbb{Z}$ if $G=D_{2},D_{4},D_{6}$; and isomorphic to
$\mathbb{Z}/3\mathbb{Z}$ or $(\mathbb{Z}/3\mathbb{Z})^{2}$ if $G=D_{3}$.

  3. (c)

We have

$\displaystyle(\mathcal{O}/2\mathcal{O})^{G}\simeq\begin{cases}(\mathbb{Z}/2\mathbb{Z})^{2},(\mathbb{Z}/2\mathbb{Z})^{3}\text{
or }(\mathbb{Z}/2\mathbb{Z})^{4}&\text{ if }G=D_{1},\\\
(\mathbb{Z}/2\mathbb{Z})^{2}\text{ or }(\mathbb{Z}/2\mathbb{Z})^{3}&\text{ if
}G=D_{2},\\\ (\mathbb{Z}/2\mathbb{Z})^{2}&\text{ if }G=D_{4},\\\
\mathbb{Z}/2\mathbb{Z}&\text{ if }G=D_{3}\text{ or }D_{6}.\end{cases}$

###### Proof.

The reduction map
$r_{N}\colon\mathcal{O}^{G}\otimes\mathbb{Z}/N\mathbb{Z}\rightarrow(\mathcal{O}/N\mathcal{O})^{G}$
is injective and its cokernel is isomorphic to the $N$-torsion of the group
cohomology $H^{1}(G,\mathcal{O})$. Indeed, this can be seen by taking
$G$-fixed points of the exact sequence
$0\rightarrow\mathcal{O}\rightarrow\mathcal{O}\rightarrow\mathcal{O}/N\rightarrow
0$. The group $\mathcal{O}^{G}$ is isomorphic to $\mathbb{Z}^{2}$ if $G=D_{1}$
and to $\mathbb{Z}$ if $G=D_{2},D_{3},D_{4}$ or $D_{6}$. Since the finite
abelian group $H^{1}(G,\mathcal{O})$ is killed by the order of $G$, Part (a)
immediately follows. To prove (b) and (c), it therefore suffices to prove that
$H^{1}(G,\mathcal{O})[6]$ is a subgroup of $(\mathbb{Z}/2\mathbb{Z})^{2}$ if
$G=D_{1}$; isomorphic to $(\mathbb{Z}/2\mathbb{Z})$ or
$(\mathbb{Z}/2\mathbb{Z})^{2}$ if $G=D_{2}$; a subgroup of
$\mathbb{Z}/3\mathbb{Z}$ if $G=D_{3}$; isomorphic to
$(\mathbb{Z}/2\mathbb{Z})$ if $G=D_{4}$; and trivial if $G=D_{6}$. Since
$H^{1}(G,\mathcal{O}\otimes\mathbb{Z}_{p})\simeq
H^{1}(G,\mathcal{O})\otimes\mathbb{Z}_{p}$ for all primes $p$ and since
$\operatorname{Aut}(\mathcal{O}\otimes\mathbb{Z}_{p})$ has only finitely many
subgroups isomorphic to $G$ up to conjugacy, this is in principle a finite
computation; we give a more detailed proof below.

Case $G=D_{1}$. Since $G=D_{1}=C_{2}$ has order $2$, $H^{1}(G,\mathcal{O})$ is
$2$-torsion and is isomorphic to the cokernel of
$r_{2}\colon\mathcal{O}^{G}\otimes\mathbb{Z}/2\mathbb{Z}\rightarrow(\mathcal{O}/2\mathcal{O})^{G}$.
By Lemma 2.2.1, $\mathcal{O}^{G}\simeq\mathbb{Z}^{2}$ and so this cokernel is
either $0,\mathbb{Z}/2\mathbb{Z}$ or $(\mathbb{Z}/2\mathbb{Z})^{2}$. It
follows that $H^{1}(G,\mathcal{O})\simeq 0,\mathbb{Z}/2\mathbb{Z}$ or
$(\mathbb{Z}/2\mathbb{Z})^{2}$.

Case $G=D_{2}$. By Lemma 2.2.2, there exist $i,j,k\in\mathcal{O}$ such that
$i^{2}=m$, $j^{2}=n$ and $k^{2}=t$ are all integers dividing
$\operatorname{disc}(B)$, such that $ij=-ji$ and $k\in\mathbb{Q}^{\times}ij$
and such that $G=\\{1,[i],[j],[k]\\}$. Let
$S_{i}=\mathcal{O}\cap\mathbb{Q}(i)$, $S_{j}=\mathcal{O}\cap\mathbb{Q}(j)$,
$S_{k}=\mathcal{O}\cap\mathbb{Q}(k)$. Then $S_{i}$ is an order in
$\mathbb{Q}(i)$ containing $\mathbb{Z}[i]$, and similarly for $S_{j}$ and
$S_{k}$. Since $-mn$ equals $t$ up to squares, upon reordering $\\{i,j,k\\}$
we may assume that $\mathbb{Z}[i]$ is maximal at $2$. Therefore
$\mathbb{Z}[\sqrt{m}]\otimes(\mathbb{Z}/2\mathbb{Z})=S_{i}\otimes(\mathbb{Z}/2\mathbb{Z})\subset(\mathcal{O}/2\mathcal{O})$
is a subring on which $G$ acts trivially. It follows that
$(\mathbb{Z}/2\mathbb{Z})^{2}\subset(\mathcal{O}/2\mathcal{O})^{G}$. We will
now show that $G$ acts nontrivially on $(\mathcal{O}/2\mathcal{O})$, so assume
by contradiction that this action is trivial. By the classification of
involutions on finite free $\mathbb{Z}$-modules, every such involution is a
direct sum of involutions of the form $x\mapsto x$, $x\mapsto-x$ and
$(x,y)\mapsto(y,x)$. If $G=\langle[i],[j]\rangle$ acts trivially on
$\mathcal{O}/2\mathcal{O}$, then both
$[i],[j]\in\operatorname{Aut}(\mathcal{O})$ are direct sums of involutions of
the first two kinds. It follows that $\mathcal{O}$ is a direct sum of the
eigenspaces corresponding to the eigenvalues of $[i]$ and $[j]$. It follows
that
$\mathcal{O}=\mathbb{Z}1\oplus\mathbb{Z}i\oplus\mathbb{Z}j\oplus\mathbb{Z}k$.
This implies that the discriminant of $\mathcal{O}$ is $\pm 4u$, contradicting
the fact that $\mathcal{O}$ is maximal at $2$. We conclude that
$(\mathcal{O}/2\mathcal{O})^{G}$ is $(\mathbb{Z}/2\mathbb{Z})^{2}$ or
$(\mathbb{Z}/2\mathbb{Z})^{3}$ and since $G$ is coprime to $3$, this proves
that $H^{1}(G,\mathcal{O})[6]$ is isomorphic to $\mathbb{Z}/2\mathbb{Z}$ or
$(\mathbb{Z}/2\mathbb{Z})^{2}$.

Case $G=D_{4}$. Let $i,j\in\mathcal{O}$ be elements satisfying the conclusion
of Lemma 2.2.3, so $G=\langle[1+i],[j]\rangle$. Since $\mathbb{Z}[i]$ is
maximal at $2$, the map
$\mathbb{Z}[i]\otimes\mathbb{Z}/2\mathbb{Z}\rightarrow\mathcal{O}/2\mathcal{O}$
is injective. Since $G$ acts trivially on the image of this map,
$(\mathcal{O}/2\mathcal{O})^{G}$ contains $(\mathbb{Z}/2\mathbb{Z})^{2}$. We
need to show that
$(\mathcal{O}/2\mathcal{O})^{G}=(\mathbb{Z}/2\mathbb{Z})^{2}$. To prove this,
it is enough to show that $(\mathcal{O}/2\mathcal{O})^{\langle
1+i\rangle}=(\mathbb{Z}/2\mathbb{Z})^{2}$. Since $\mathcal{O}$ is ramified at
$2$, there exists a unique conjugacy class of embeddings
$\mathbb{Z}_{2}[i]\hookrightarrow\mathcal{O}_{\mathbb{Z}_{2}}$ [Voi21,
Proposition 30.5.3]. Therefore it is enough to verify that
$(\mathcal{O}/2\mathcal{O})^{\langle 1+i\rangle}=(\mathbb{Z}/2\mathbb{Z})^{2}$
in a single example, for which this can be checked explicitly. Indeed, one may
take $B=\left(\frac{-1,6}{\mathbb{Q}}\right)$, which has maximal order with
$\mathbb{Z}$-basis $\\{1,(1+i+ij)/2,(1-i+ij)/2,(j+ij)/2\\}$. Since $\\#G$ is
coprime to $3$, we conclude that
$H^{1}(G,\mathcal{O})[6]=\mathbb{Z}/2\mathbb{Z}$.

Case: $G=D_{3},D_{6}$. Let $\omega,j\in\mathcal{O}$ be elements satisfying the
conclusion of Lemma 2.2.4. Let $C_{n}\leq D_{n}$ be the cyclic normal subgroup
of order $n$ for $n\in\\{3,6\\}$. The low terms of the Lyndon–Hochschild–Serre
spectral sequence give rise to the exact sequence

(2.3.2) $\displaystyle 0\rightarrow
H^{1}(C_{2},\mathcal{O}^{C_{n}})\rightarrow H^{1}(G,\mathcal{O})\rightarrow
H^{1}(C_{n},\mathcal{O})^{C_{2}}\rightarrow H^{2}(C_{2},\mathcal{O}^{C_{n}}).$

The subring $\mathcal{O}^{C_{n}}$ equals $\mathcal{O}^{\langle
1\pm\omega\rangle}=\mathbb{Z}[\omega]$ and $C_{2}=D_{n}/C_{n}$ acts on
$\mathcal{O}^{C_{n}}$ via conjugation $\omega\mapsto\bar{\omega}$. A cyclic
group cohomology calculation shows that $H^{i}(C_{2},\mathbb{Z}[\omega])$ is
trivial for all $i\geq 1$. Therefore $H^{1}(G,\mathcal{O})\simeq
H^{1}(C_{n},\mathcal{O})^{C_{2}}$. Assume $G=D_{6}$. Using the analogous exact
sequence to (2.3.2) for the subgroup $C_{3}\leq C_{6}$, we get
$H^{1}(C_{6},\mathcal{O})\simeq H^{1}(C_{3},\mathcal{O})^{C_{2}}$. Since
$C_{2}$ acts trivially on $C_{3}=\\{1,g,g^{2}\\}$ and acts as $-1$ on
$\\{x\in\mathcal{O}\mid x+gx+g^{2}x=0\\}$, it will act as $-1$ on
$H^{1}(C_{3},\mathcal{O})\simeq(\mathbb{Z}/3\mathbb{Z})^{r}$, so
$H^{1}(C_{3},\mathcal{O})^{C_{2}}=0$ and so $H^{1}(G,\mathcal{O})\simeq
H^{1}(C_{6},\mathcal{O})^{C_{2}}\subset H^{1}(C_{6},\mathcal{O})\simeq
H^{1}(C_{3},\mathcal{O})^{C_{2}}$ is zero too in this case. It remains to
consider the case $G=D_{3}$. Then $H^{1}(G,\mathcal{O})\simeq
H^{1}(C_{3},\mathcal{O})^{C_{2}}$. Let $g\in C_{3}$ be a generator, given by
conjugating by $1+\omega$. Let $L=\\{x\in\mathcal{O}\mid x+gx+g^{2}x=0\\}$.
Using the basis $\\{1,\omega,j,\omega\\}$ of $B$, we see that
$L=\mathcal{O}\cap\mathbb{Q}(\omega)\cdot j$. Using the explicit description
of group cohomology of cyclic groups, $H^{1}(C_{3},\mathcal{O})$ is isomorphic
to $L/(1-g)\mathcal{O}$. Since $(1-g)\mathcal{O}$ contains
$(1-g)L=(1-\omega)L$, $H^{1}(C_{3},\mathcal{O})$ is a quotient of
$L/(1-\omega)L$. Since $(1-\omega)^{2}L=3L$ and
$L/3L\simeq(\mathbb{Z}/3\mathbb{Z})^{2}$, $L/(1-\omega)L$ is of order $3$.
This shows that $H^{1}(C_{3},\mathcal{O})=0$ or $\mathbb{Z}/3\mathbb{Z}$, so
$H^{1}(D_{3},\mathcal{O})=0$ or $\mathbb{Z}/3\mathbb{Z}$, as claimed.

∎

######  Remark 2.3.3.

A calculation with the quaternion algebra package in Magma shows that all the
possibilities in Theorem 2.3.1 do indeed occur.

The next three lemmas give some more precise information about subgroups
$G\subset\operatorname{Aut}(\mathcal{O})$ for which
$(\mathcal{O}/2\mathcal{O})^{G}\simeq(\mathbb{Z}/2\mathbb{Z})^{3}$. In these
lemmas, we will use the fact that if $2\mid\operatorname{disc}(B)$, there
exists a unique ring homomorphism
$\mathcal{O}/2\mathcal{O}\rightarrow\mathbb{F}_{4}$, see [Voi21, Theorem
13.3.11].

######  Lemma 2.3.4.

Let $b\in\mathcal{O}\cap N_{B^{\times}}(\mathcal{O})$ be an element with
$b^{2}=m\mid\operatorname{disc}(B)$ and $m\neq 1$. Write
$F\subset\mathcal{O}/2\mathcal{O}$ for the subset centralized by the reduction
of $b$ in $\mathcal{O}/2\mathcal{O}$. Then
$F\simeq(\mathbb{Z}/2\mathbb{Z})^{3}$ if and only if
$2\mid\operatorname{disc}(B)$ and $m\equiv 3\mod 4$. In that case $F$ equals
the subset of elements of $\mathcal{O}/2\mathcal{O}$ whose image under the
ring homomorphism $\mathcal{O}/2\mathcal{O}\rightarrow\mathbb{F}_{4}$ lands in
$\mathbb{F}_{2}$.

###### Proof.

Suppose $F\simeq(\mathbb{Z}/2\mathbb{Z})^{3}$. We first show that
$2\mid\operatorname{disc}(B)$. If not, then $m$ is odd by Lemma 2.2.1,
$\mathcal{O}/2\mathcal{O}\simeq\operatorname{Mat}_{2}(\mathbb{F}_{2})$ and $F$
is the fixed points of conjugating by an element of order dividing $2$ in
$\operatorname{GL}_{2}(\mathbb{F}_{2})$. Since there is only one involution in
$\operatorname{GL}_{2}(\mathbb{F}_{2})$ up to conjugacy, which we may
calculate has centralizer $(\mathbb{Z}/2\mathbb{Z})^{2}$, this shows that
$2\mid\operatorname{disc}(B)$. We now show that $2\nmid m$. If $2\mid m$, then
since $m$ is squarefree $b$ is a $2$-adic uniformizer of
$\mathcal{O}\otimes\mathbb{Z}_{2}$. Then there exists an unramified quadratic
subring $S\subset\mathcal{O}\otimes\mathbb{Z}_{2}$ isomorphic to
$\mathbb{Z}_{2}\left[\frac{-1+\sqrt{-3}}{2}\right]$ such that
$\mathcal{O}\otimes\mathbb{Z}_{2}=S+S\cdot b$ [Voi21, Theorem 13.3.11]. This
shows that conjugation by $b$ acts via $x+yb\mapsto\bar{x}+\bar{y}b$. This map
has $4$ fixed points, hence we obtain a contradiction and $m$ is odd. It
follows that $F$ is given by the fixed points of conjugating by an element of
$(\mathcal{O}/2\mathcal{O})^{\times}$. This element is trivial if and only if
$b\in 1+2\mathcal{O}$. Since $\mathcal{O}\otimes\mathbb{Z}_{2}$ consists of
all integral elements of $B\otimes\mathbb{Q}_{2}$ [Voi21, Proposition 13.3.4]
and since $b\in\mathcal{O}$, this is equivalent to $(b-1)/2$ being integral at
$2$, that is to say to $m\equiv 1\mod 4$. This proves the forward direction of
the lemma. For the other direction, note that
$(\mathcal{O}/2\mathcal{O})^{\times}$ (where $\mathcal{O}$ is ramified at $2$)
has a unique involution up to conjugacy, which can be checked to have
$(\mathbb{Z}/2\mathbb{Z})^{3}$ fixed points in the presentation (6.1.1). ∎

######  Lemma 2.3.5.

Let $b\in\mathcal{O}\cap N_{B^{\times}}(\mathcal{O})$ be an element with
$b^{2}=m\mid\operatorname{disc}(B)$ and $m\neq 1$. Suppose that the
conjugation action of $b$ on $\mathcal{O}/2\mathcal{O}$ has fixed points
$\simeq(\mathbb{Z}/2\mathbb{Z})^{3}$. Then there exists no
$x\in\mathcal{O}/4\mathcal{O}$ with $x\equiv 1\mod 2\mathcal{O}$ and
$b^{-1}xbx=-1$.

###### Proof.

Suppose that $x\in\mathcal{O}/4\mathcal{O}$ is such an element. Let $y=bx$.
Since $mb^{-1}=b$, multiplying the equation $b^{-1}xbx=-1$ by $m$ shows that
$y^{2}=-m$ in $\mathcal{O}/4\mathcal{O}$. By Lemma 2.3.4,
$2\mid\operatorname{disc}(B)$ and $m\equiv 3\mod{4}$, so $y^{2}=1$ in
$\mathcal{O}/4\mathcal{O}$. Since $x\equiv 1\mod 2\mathcal{O}$, $y=bx\equiv
b\mod 2\mathcal{O}$. We may therefore write $y=b+2z$ for some
$z\in\mathcal{O}/4\mathcal{O}$. We compute, in $\mathcal{O}/4\mathcal{O}$,
that

$\displaystyle
y^{2}=(b+2z)(b+2z)=b^{2}+2(bz+zb)+4z^{2}=m+2(bz+zb)=3+2(bz+zb).$

Since $y^{2}=1$, this shows that $2(bz+zb)=2$. Write $\bar{b}$ and $\bar{z}$
for the mod $2$ reductions of $b$ and $z$. Then the above identity implies
that

(2.3.6) $\displaystyle\bar{b}\bar{z}+\bar{z}\bar{b}=1.$

Since $2$ is ramified in $B$ and $\mathcal{O}$ is maximal, there exists a
surjective ring homomorphism
$\lambda\colon\mathcal{O}/2\mathcal{O}\rightarrow\mathbb{F}_{4}$. Applying
$\lambda$ to (2.3.6) shows that
$\lambda(\bar{b})\lambda(\bar{z})+\lambda(\bar{z})\lambda(\bar{b})=\lambda(1)=1$.
Since $\mathbb{F}_{4}$ is commutative, the left hand side of this equation
also equals $2\lambda(\bar{b})\lambda(\bar{z})=0$, which is a contradiction. ∎

Recall from Lemma 2.2.2 that a subgroup $G\leq N_{B^{\times}}(\mathcal{O})$
isomorphic to $C_{2}\times C_{2}$ can be generated by elements
$i,j\in\mathcal{O}$ with $ij=-ji$, $i^{2}=m$, $j^{2}=n$ and
$m,n\mid\operatorname{disc}(B)$.

######  Lemma 2.3.7.

Let $G\subset N_{B^{\times}}(\mathcal{O})$ be a subgroup isomorphic to
$C_{2}\times C_{2}$. Then
$(\mathcal{O}/2\mathcal{O})^{G}\simeq(\mathbb{Z}/2\mathbb{Z})^{3}$ if and only
if (in the above notation) $2\mid\operatorname{disc}(B)$ and $m,n\equiv 3\mod
4$.

###### Proof.

Suppose first that
$(\mathcal{O}/2\mathcal{O})^{G}\simeq(\mathbb{Z}/2\mathbb{Z})^{3}$. Then the
conjugation involutions $[i]$ and $[j]$ have both $2^{3}$ or $2^{4}$ fixed
points on $\mathcal{O}/2\mathcal{O}$. At least one of them, say $j$, has
$2^{3}$ fixed points. By Lemma 2.3.4, $2\mid\operatorname{disc}(B)$ and
$n\equiv 3\mod 4$. If $2\mid m$, then $i$ is a $2$-adic uniformizer and the
action of $i$ on $\mathcal{O}/2\mathcal{O}$ would have $2^{2}$ fixed points
(by an argument similar to the proof of Lemma 2.3.4). So $m$ is odd. If
$m\equiv 1\mod 4$, then the $2$-adic Hilbert symbol of $(m,n)$ is trivial,
contradicting the fact that $2\mid\operatorname{disc}(B)$ and
$B\simeq\left(\frac{m,n}{\mathbb{Q}}\right)$. We conclude that $m\equiv 3\mod
4$. The converse follows from Lemma 2.3.4. ∎

##  3\. Galois actions, polarizations and endomorphisms

This section collects some preliminaries concerning the arithmetic of
$\mathrm{PQM}$ surfaces. In particular, we study the Galois action on the
endomorphism algebra, the set of polarizations, the torsion points and the
interaction between these. The most important subsection is §3.2, where the
endomorphism field of a $\mathrm{PQM}$ surface is introduced.

###  3.1. Abelian surfaces of $\operatorname{GL}_{2}$-type

Recall that an abelian surface $A$ over a number field $F$ is said to be of
$\operatorname{GL}_{2}$-type if $\operatorname{End}^{0}(A)$ is a quadratic
field extension of $\mathbb{Q}$. We will show that if $A$ is geometrically
simple and $F$ admits a real place, then this field must be real quadratic.
(The geometrically simple hypothesis is necessary; for example, the simple
modular abelian surface $J_{1}(13)$ satisfies
$\operatorname{End}^{0}(J_{1}(13))\simeq\mathbb{Q}(\sqrt{-3})$.) This is well
known over $\mathbb{Q}$ (see [Rot08, Lemma 2.3]), which suffices for our
purposes—but we also give an argument that works over any field contained in
$\mathbb{R}$ that might be of independent interest. (We thank Davide Lombardo
for suggesting it.)

######  Lemma 3.1.1.

Let $A/\mathbb{R}$ be an abelian surface. Then
$\operatorname{rk}\,\operatorname{NS}(A)\geq\operatorname{rk}\,\operatorname{NS}(A_{\mathbb{C}})-1$.

###### Proof.

There exists a two-dimensional $\mathbb{R}$-vector space $W$, a lattice
$\Lambda\subset W_{\mathbb{C}}:=W\otimes\mathbb{C}$ stable under the
automorphism $\sigma$ induced by complex conjugation on the second factor, and
a complex analytic isomorphism $A(\mathbb{C})\simeq(W_{\mathbb{C}})/\Lambda$
that intertwines complex conjugation on $A(\mathbb{C})$ with $\sigma$. Under
this isomorphism, $\operatorname{NS}(A_{\mathbb{C}})$ can be identified with
the set of $\mathbb{Z}$-bilinear alternating forms
$E\colon\Lambda\times\Lambda\rightarrow\mathbb{Z}$ with the property that the
$\mathbb{R}$-linear extension $E_{\mathbb{R}}$ of $E$ to $W_{\mathbb{C}}$
satisfies $E_{\mathbb{R}}(iv,iw)=E_{\mathbb{R}}(v,w)$ for all
$v,w\in\Lambda\otimes\mathbb{R}=W_{\mathbb{C}}$. By [Sil89, Chapter IV,
Theorem (3.4)] such an $E$ lies in $\operatorname{NS}(A)$ if and only if the
associated Hermitian form $E_{\mathbb{R}}(iv,w)+iE_{\mathbb{R}}(v,w)$ is
$\mathbb{R}$-valued on $W\times W$, that is to say $E_{\mathbb{R}}(W,W)=0$.
Since the intersection $\Lambda^{\prime}=\Lambda\cap W$ is a lattice in $W$,
the condition $E_{\mathbb{R}}(W,W)=0$ is equivalent to
$E(\Lambda^{\prime},\Lambda^{\prime})=0$. In conclusion,
$\operatorname{NS}(A)=\ker(\operatorname{NS}(A_{\mathbb{C}})\rightarrow\operatorname{Hom}(\wedge^{2}(\Lambda^{\prime}),\mathbb{Z}))$,
where the map sends $E$ to its restriction to
$\Lambda^{\prime}\times\Lambda^{\prime}$. Since the target of this map is
isomorphic to $\mathbb{Z}$, the lemma is proved. ∎

######  Proposition 3.1.2.

Let $A/\mathbb{R}$ be a geometrically simple abelian surface. Then
$\operatorname{End}(A)$ is isomorphic to $\mathbb{Z}$ or an order in a real
quadratic field.

###### Proof.

By the classification of endomorphism algebras of complex abelian surfaces
[BL04, Proposition 5.5.7, Exercise 9.10(1) and Exercise 9.10(4)],
$\operatorname{End}^{0}(A_{\mathbb{C}})$ is isomorphic to either $\mathbb{Q}$,
a real quadratic field, a non-split indefinite quaternion algebra or a quartic
CM field. The proposition is clear in the first two cases, so we may assume
that we are in one of the latter two cases.

Since $\operatorname{End}^{0}(A)$ acts on the $\mathbb{Q}$-homology of
$A(\mathbb{R})^{\circ}\simeq S^{1}\times S^{1}$, there is a (nonzero, hence
injective) map
$\operatorname{End}^{0}(A)\hookrightarrow\operatorname{Mat}_{2}(\mathbb{Q})$.
Since $\operatorname{End}^{0}(A_{\mathbb{C}})$ does not embed in
$\operatorname{Mat}_{2}(\mathbb{Q})$,
$\operatorname{End}^{0}(A)\neq\operatorname{End}^{0}(A_{\mathbb{C}})$ and so
$\operatorname{End}^{0}(A)$ is at most two-dimensional. It remains to exclude
that $\operatorname{End}^{0}(A)$ is an imaginary quadratic field, so assume
for contradiction that this is the case. If
$\operatorname{End}^{0}(A_{\mathbb{C}})$ is a quaternion algebra, Lemma 3.1.1
shows that $\operatorname{rk}(\operatorname{NS}(A))\geq 3-1=2$, contradicting
the fact that $\operatorname{End}^{0}(A)$ is imaginary quadratic. If
$\operatorname{End}(A_{\mathbb{C}})$ is a quartic CM field $F$, this CM field
has at least two quadratic subfields (namely its unique real quadratic
subfield and $\operatorname{End}^{0}(A)$) so it must be a biquadratic
extension of $\mathbb{Q}$. A counting argument then shows that every CM type
of $F$ is imprimitive. This implies [Lan83, Theorem 3.5] that $A_{\mathbb{C}}$
is not simple. We again obtain a contradiction and have completed all cases of
the proof. ∎

###  3.2. The endomorphism field of a $\mathrm{PQM}$ surface

Let $F$ be a field of characteristic zero and $A/F$ a $\mathrm{PQM}$ surface.
The absolute Galois group $\operatorname{Gal}_{F}$ acts on
$\operatorname{End}(A_{\bar{F}})$ on the right by ring automorphisms via
$\phi^{\sigma}(a)=\phi\left(a^{\sigma^{-1}}\right)^{\sigma}$ for
$\sigma\in\operatorname{Gal}_{F}$, $\phi\in\operatorname{End}(A_{\bar{F}})$
and $a\in A(\bar{F})$. The kernel of this action cuts out a Galois extension
$L/F$ over which all the endomorphisms of $A_{\bar{F}}$ are defined. Following
[GK17] we call $L$ the endomorphism field of $A$. This determines an injective
map
$\rho_{\operatorname{End}}\colon\operatorname{Gal}(L/F)\rightarrow\operatorname{Aut}(\operatorname{End}(A_{\bar{F}}))$.
We recall the results of [DR04] studying this map which are relevant for our
purposes. Write $C_{n}$ (resp. $D_{n}$) for the cyclic (resp. dihedral) group
of order $n$ (resp. $2n$). Note the isomorphisms $D_{1}\simeq C_{2}$ and
$D_{2}\simeq C_{2}\times C_{2}$.

######  Proposition 3.2.1.

Let $A/F$ be a $\mathrm{PQM}$ surface with endomorphism field $L$ and let
$G=\operatorname{Gal}(L/F)$. Then $G\simeq C_{n}$ or $D_{n}$ for some
$n\in\\{1,2,3,4,6\\}$. If $F$ admits an embedding into $\mathbb{R}$, then
$G\simeq D_{n}$ for some $n\in\\{1,2,3,4,6\\}$.

###### Proof.

The classification of finite subgroups of $B^{\times}/\mathbb{Q}^{\times}$
shows that $G$ is isomorphic to $C_{n}$ or $D_{n}$ for some
$n\in\\{1,2,3,4,6\\}$ [DR04, Proposition 2.1]. It therefore suffices to
exclude that $G$ is isomorphic to $C_{1},C_{3},C_{4}$ or $C_{6}$ if there
exists an embedding $\iota\colon F\hookrightarrow\mathbb{R}$. If $G$ is
isomorphic to one of these groups, then $\operatorname{End}^{0}(A)$ is
isomorphic to $B$ (if $G$ is trivial) or an imaginary quadratic field [DR04,
Theorem 3.4(C)]. This contradicts Proposition 3.1.2. ∎

######  Lemma 3.2.2.

Let $A$ be a $\mathrm{PQM}$ surface over a number field $F$ admitting a real
place. Then $A$ is of $\operatorname{GL}_{2}$-type if and only if the
endomorphism field $L/F$ is a quadratic extension.

###### Proof.

By Proposition 3.1.2, $A$ is of $\operatorname{GL}_{2}$-type if and only if
$\operatorname{End}(A)\neq\mathbb{Z}$. By [DR04, Theorem 3.4(C)],
$\operatorname{End}(A)\neq\mathbb{Z}$ if and only if $L$ is a cyclic extension
of $F$. By Proposition 3.2.1, $L/F$ is cyclic if and only if it is a quadratic
extension. ∎

Assume now that $A$ is an $\mathcal{O}$-$\mathrm{PQM}$ surface and fix an
isomorphism $\operatorname{End}(A_{\bar{F}})\simeq\mathcal{O}$. By the
Skolem–Noether theorem, every ring automorphism of $\mathcal{O}$ is of the
form $x\mapsto b^{-1}xb$ for some $b\in B^{\times}$ normalising $\mathcal{O}$,
and $b$ is uniquely determined up to $\mathbb{Q}^{\times}$-multiples.
Therefore $\operatorname{Aut}(\mathcal{O})\simeq
N_{B^{\times}}(\mathcal{O})/\mathbb{Q}^{\times}\subset
B^{\times}/\mathbb{Q}^{\times}$, hence the map
$\operatorname{Gal}(L/F)\rightarrow\operatorname{Aut}(\operatorname{End}(A_{\bar{F}}))$
can be viewed as an injective homomorphism

(3.2.3)
$\displaystyle\rho_{\operatorname{End}}\colon\operatorname{Gal}(L/F)\rightarrow\operatorname{Aut}(\mathcal{O})\simeq
N_{B^{\times}}(\mathcal{O})/\mathbb{Q}^{\times}$

whose image is isomorphic to $C_{n}$ or $D_{n}$ for some $n\in\\{1,2,3,4,6\\}$
by Proposition 3.2.1.

######  Remark 3.2.4.

The existence of a polarization of a certain type puts restrictions on the
Galois group of the endomorphism field, see [DR04, Theorem 3.4]. In
particular, that theorem shows that if an $\mathcal{O}$-$\mathrm{PQM}$ surface
$A$ is principally polarized over $F$ then this Galois group is $\\{1\\}$,
$C_{2}$ or $C_{2}\times C_{2}$.

For future reference we record the following result of Silverberg [Sil92,
Proposition 2.2].

######  Proposition 3.2.5 (Silverberg).

Let $N\geq 3$ be an integer and suppose that the
$\operatorname{Gal}_{F}$-action on $A[N]$ is trivial. Then $L=F$.

We also record the useful fact that the endomorphism field is preserved by
quadratic twist.

######  Lemma 3.2.6.

Let $A/F$ be a $\mathrm{PQM}$ surface and $M/F$ a quadratic extension. Let
$A^{M}$ be the quadratic twist of $A$ along $M/F$. Then under the
identification
$\operatorname{End}(A_{\bar{F}})=\operatorname{End}((A^{M})_{\bar{F}})$,
$\rho_{\operatorname{End},A}=\rho_{\operatorname{End},A^{M}}$.

###### Proof.

This follows from the fact that $-1$ is central in
$\operatorname{End}(A_{\bar{F}})$. ∎

###  3.3. Polarizations and positive involutions

Let $A$ be an abelian surface over a field $F$ of characteristic zero. Recall
that a polarization is an ample class $L$ in $\operatorname{NS}(A)$. Such a
class gives rise to an isogeny $\lambda_{L}\colon A\rightarrow A^{\vee}$, and
we frequently identify $L$ with this isogeny. There exists unique positive
integers $d_{1}\mid d_{2}$ such that
$\ker(\lambda_{L})(\bar{F})\simeq(\mathbb{Z}/d_{1})^{2}\times(\mathbb{Z}/d_{2})^{2}$;
the pair $(d_{1},d_{2})$ is called the type of the polarization and the
integer $\deg(L)=d_{1}d_{2}$ is called its degree. We say two polarizations
$L$ and $L^{\prime}$ are $\mathbb{Q}^{\times}$-equivalent if there exist
nonzero integers $m,n$ such that $mL=nL^{\prime}$, and we call a
$\mathbb{Q}^{\times}$-equivalence class of polarizations a
$\mathbb{Q}^{\times}$-polarization. Every $\mathbb{Q}^{\times}$-polarization
contains a unique polarization of type $(1,d)$ for some $d\geq 1$.

Recall that a positive involution of $B$ is a $\mathbb{Q}$-linear involution
$\iota\colon B\rightarrow B$ satisfying $\iota(ab)=\iota(b)\iota(a)$ and
$\operatorname{trd}(a\iota(a))\in\mathbb{Q}_{\geq 0}$ for all $a,b\in B$. By
the Skolem–Noether theorem, every such involution is of the form
$b\mapsto\mu^{-1}\bar{b}\mu$, where $\bar{b}=\operatorname{trd}(b)-b$ denotes
the canonical involution and $\mu\in B^{\times}$ is an element with
$\mu^{2}\in\mathbb{Q}_{<0}$. Two such elements $\mu,\mu^{\prime}\in
B^{\times}$ give rise to the same involution if and only if $\mu$ is a
$\mathbb{Q}^{\times}$-multiple of $\mu^{\prime}$.

To combine these two notions, suppose that
$\operatorname{End}(A)=\operatorname{End}(A_{\bar{F}})\simeq\mathcal{O}$; let
us fix such an isomorphism to identify $\operatorname{End}(A)$ with
$\mathcal{O}$. Given a polarization $L$ of $A$, the Rosati involution on
$\operatorname{End}^{0}(A)$, defined by $f\mapsto\lambda_{L}^{-1}\circ
f^{\vee}\circ\lambda_{L}$, corresponds to a positive involution $\iota_{L}$ of
$B$.

######  Proposition 3.3.1.

The assignment $L\mapsto\iota_{L}$ induces a bijection between the set of
$\mathbb{Q}^{\times}$-polarizations of $A$ and the set of positive involutions
of $B$. In addition, if $L$ is a polarization and $\mu\in B^{\times}$ is an
element such that $\iota_{L}$ is of the form $b\mapsto\mu^{-1}\bar{b}\mu$,
then

(3.3.2)
$\displaystyle\deg(L)\equiv\operatorname{disc}(B)\cdot\operatorname{nrd}(\mu)\mod\mathbb{Q}^{\times
2}.$

###### Proof.

This can be deduced from [DR04, Theorem 3.1], but can also be proved purely
algebraically as follows. Choose an element $\nu\in\mathcal{O}$ with
$\nu^{2}=-\operatorname{disc}(B)$. Then it is well known [Voi21, Lemma
43.6.23] that $A$ has a unique principal polarization $M$ such that
$\iota_{M}(b)=\nu^{-1}\bar{b}\nu$ for all $b\in B$. To determine all
polarizations of $A$, consider the maps

$\displaystyle(\operatorname{NS}(A)\otimes\mathbb{Q})\setminus\\{0\\}\xrightarrow{\alpha}\\{x\in
B^{\times}\mid\nu^{-1}\bar{x}\nu=x\\}\xrightarrow{\beta}\\{\mu\in
B^{\times}\mid\bar{\mu}=-\mu\\},$

where $\alpha(L)=\lambda_{M}^{-1}\circ\lambda_{L}$ and $\beta(x)=\nu x$. Since
$L\mapsto\lambda_{L}$ induces a bijection
$\operatorname{NS}(A)\otimes\mathbb{Q}\rightarrow\\{f\in\operatorname{Hom}(A,A^{\vee})\mid
f^{\vee}=f\\}$, $\alpha$ is a bijection. Moreover, $\beta$ is a bijection by a
direct computation. In addition, one can also compute that the Rosati
involution associated to a Neron–Severi class $L$ is given by conjugation by
$\beta(\alpha(L))$. Both
$(\operatorname{NS}(A)\otimes\mathbb{Q})\setminus\\{0\\}$ and $\\{\mu\in
B^{\times}\mid\bar{\mu}=-\mu\\}$ have evident $\mathbb{Q}^{\times}$-actions,
and their quotients are given by the set of
$\mathbb{Q}^{\times}$-polarizations and the set of positive involutions on $B$
respectively. Combining these observations shows that $L\mapsto\iota_{L}$ is
indeed a bijection between the set of $\mathbb{Q}^{\times}$-polarizations and
the set of positive involutions. To check (3.3.2), we compute that for
$\alpha(L)=x$ and $\mu=\nu x$:
$\deg(L)=\operatorname{nrd}(x)=\operatorname{nrd}(\mu)/\operatorname{nrd}(\nu)\equiv\operatorname{disc}(B)\cdot\operatorname{nrd}(\mu)\mod\mathbb{Q}^{\times
2}$. ∎

######  Remark 3.3.3.

If we want to avoid choosing an isomorphism
$\operatorname{End}(A)\simeq\mathcal{O}$, we may rephrase Proposition 3.3.1 as
saying that there is a bijection between $\mathbb{Q}^{\times}$-polarizations
on $A$ and positive involutions on the quaternion algebra
$\operatorname{End}^{0}(A)$.

Now suppose that $A/F$ is an abelian surface with
$\operatorname{End}(A_{\bar{F}})\simeq\mathcal{O}$. Recall from §3.2 that
$\operatorname{Gal}_{F}$ acts on $\operatorname{End}(A_{\bar{F}})$ by ring
automorphisms. If $L$ is a polarization on $A_{\bar{F}}$, the Rosati
involution associated to $L$ is of the form $b\mapsto\mu^{-1}b\mu$ for some
$\mu\in\operatorname{End}^{0}(A_{\bar{F}})$, uniquely determined up to
$\mathbb{Q}^{\times}$-multiple.. Therefore the imaginary quadratic field
$\mathbb{Q}(\mu)\subset\operatorname{End}^{0}(A_{\bar{F}})$ is independent of
the choice of $\mu$.

######  Corollary 3.3.4.

The map $L\mapsto\mathbb{Q}(\mu)$ constructed above induces a bijection
between $\mathbb{Q}^{\times}$-polarizations of $A_{\bar{F}}$ and imaginary
quadratic fields contained in $\operatorname{End}^{0}(A_{\bar{F}})$. A
polarization descends to $A$ if and only if the imaginary quadratic field is
$\operatorname{Gal}_{F}$-normalized.

###### Proof.

The bijection part immediately follows from Proposition 3.3.1, together with
the fact that the set of positive involutions on
$\operatorname{End}^{0}(A_{\bar{F}})$ is in bijection with the set of
imaginary quadratic subfields of $\operatorname{End}^{0}(A_{\bar{F}})$.

Since taking the Rosati involution is $\operatorname{Gal}_{F}$-equivariant,
this bijection preserves the Galois action on both sides. This induces a
bijection on the $\operatorname{Gal}_{F}$-fixed points on both sides,
justifying the last sentence of the corollary. ∎

###  3.4. The distinguished quadratic subring

If $A/\mathbb{Q}$ is an $\mathcal{O}$-$\mathrm{PQM}$ surface of
$\operatorname{GL}_{2}$-type, then the torsion groups $A[n]$ are modules over
$S/nS$, where $S$ is the real quadratic ring $\operatorname{End}(A)$. If $A$
is not of $\operatorname{GL}_{2}$-type, then
$\operatorname{End}(A)=\mathbb{Z}$, and so it may seem that there is no
structure to exploit. However, we have seen in Corollary 3.3.4 that any
polarization of $A$ determines a $\operatorname{Gal}_{\mathbb{Q}}$-stable
imaginary quadratic subring
$S\subset\operatorname{End}(A_{\overline{\mathbb{Q}}})$.

######  Definition 3.4.1.

Let $A/\mathbb{Q}$ be an $\mathcal{O}$-$\mathrm{PQM}$ surface. If $A$ is of
$\operatorname{GL}_{2}$-type, let $M=\operatorname{End}^{0}(A)$. Otherwise,
let $M\subset\operatorname{End}^{0}(A_{\overline{\mathbb{Q}}})$ be the
imaginary quadratic field corresponding to the unique primitive polarization
on $A$ via Corollary 3.3.4. We call
$M\subset\operatorname{End}^{0}(A_{\overline{\mathbb{Q}}})$ the distinguished
quadratic subfield and $S=M\cap\operatorname{End}(A_{\overline{\mathbb{Q}}})$
the distinguished quadratic subring of $A$.

The next proposition describes the distinguished quadratic subring more
explicitly.

######  Proposition 3.4.2.

Let $A/\mathbb{Q}$ be an $\mathcal{O}$-$\mathrm{PQM}$ surface and let $S$ be
its distinguished quadratic subring, seen as a subring of $\mathcal{O}$ using
an isomorphism
$\mathcal{O}\simeq\operatorname{End}(A_{\overline{\mathbb{Q}}})$. Let $G$ be
the Galois group of the endomorphism field of $A$ (as in §3.2).

  1. (a)

$S$ is isomorphic to an order of $\mathbb{Q}(\sqrt{m})$ containing
$\mathbb{Z}[\sqrt{m}]$ for some $m\in\mathbb{Z}_{\geq 2}$ dividing
$\operatorname{disc}(B)$ if $G=C_{2}$; to an order of $\mathbb{Q}(\sqrt{-m})$
containing $\mathbb{Z}[\sqrt{-m}]$ for some $m\in\mathbb{Z}_{\geq 2}$ dividing
$\operatorname{disc}(B)$ if $G=D_{2}$; to $\mathbb{Z}[i]$ with $i^{2}=-1$ if
$G=D_{4}$; and to $\mathbb{Z}[\omega]$ with $\omega^{3}=1$ if $G=D_{3}$ or
$D_{6}$.

  2. (b)

$S$ is an order in a quadratic field, maximal away from $2$ and unramified
away from $6\operatorname{disc}(B)$.

###### Proof.

The description of $S$ in the $C_{2}$ case follows from Lemma 2.2.1. If
$G\not\simeq C_{2}$ (in other words, if $A$ is not of
$\operatorname{GL}_{2}$-type by Lemma 3.2.2), then Corollary 3.3.4 shows that
$S$ is the unique imaginary quadratic subring of
$\operatorname{End}(A_{\overline{\mathbb{Q}}})$ that is
$\operatorname{Gal}_{\mathbb{Q}}$-stable and that is optimally embedded, i.e.
$(S\otimes\mathbb{Q})\cap\mathcal{O}=S$. So to prove (a) it suffices to find a
subring of $\mathcal{O}$ satisfying the stated conditions. This follows from
the explicit description of the $G$-action given in §2.2. Part (b) immediately
follows from the first part. ∎

###  3.5. The enhanced Galois representation

Let $A$ be an $\mathcal{O}$-$\mathrm{PQM}$ surface over a field $F$ of
characteristic zero, and fix an isomorphism
$\mathcal{O}\simeq\operatorname{End}(A_{\bar{F}})$ so that $\mathcal{O}$ acts
on $A_{\bar{F}}$ on the left. In §3.2 we have described how
$\operatorname{Gal}_{F}$ acts on the endomorphism ring $\mathcal{O}$; this
action is encoded by the homomorphism
$\rho_{\operatorname{End}}\colon\operatorname{Gal}_{F}\rightarrow\operatorname{Aut}(\mathcal{O})$
of Equation 3.2.3. On the other hand $\operatorname{Gal}_{F}$ acts on the
torsion points of $A_{\bar{F}}$. In this section we formalize the interaction
of these two $\operatorname{Gal}_{F}$-actions using a homomorphism that we
call the enhanced Galois representation. This basic definition might be of
independent interest and will be used in the proof of Theorem 1.4, more
specifically to exclude $(\mathbb{Z}/2\mathbb{Z})^{3}$ in the
$\operatorname{GL}_{2}$-type case in Proposition 5.3.8.

Let $I\subset\mathcal{O}$ be a $\operatorname{Gal}_{F}$-stable two-sided
ideal, for example $I=N\cdot\mathcal{O}$ for some integer $N\geq 1$. The
subgroup $A[I](\bar{F})\subset A(\bar{F})$ of points killed by $I$ is a
$\operatorname{Gal}_{F}$-module. Let $\operatorname{GL}(A[I])$ be the group of
$\mathbb{Z}$-module automorphisms of $A[I](\bar{F})$, seen as acting on
$A[I](\bar{F})$ on the right. The $\operatorname{Gal}_{F}$-action on $A[I]$ is
encoded in a homomorphism
$\rho_{I}\colon\operatorname{Gal}_{F}\rightarrow\operatorname{GL}(A[I])$. The
left $\mathcal{O}$-action on $A_{\bar{F}}$ induces an $\mathcal{O}/I$-action
on $A[I](\bar{F})$ such that

(3.5.1) $\displaystyle(a\cdot P)^{\sigma}=a^{\sigma}\cdot P^{\sigma}$

for all $P\in A[I](\bar{F}),\ a\in\mathcal{O}$ and
$\sigma\in\operatorname{Gal}_{F}.$ Let $\operatorname{Aut}^{\circ}(A[I])$ be
the subgroup of pairs
$(\gamma,\varphi)\in\operatorname{Aut}(\mathcal{O})\times\operatorname{GL}(A[I])$
such that $(a\cdot P)^{\varphi}=a^{\gamma}\cdot P^{\varphi}$ for all
$a\in\mathcal{O}$ and $P\in A[I](\bar{F})$. The compatibility (3.5.1) implies
that the product homomorphism
$\rho_{\operatorname{End}}\times\rho_{I}\colon\operatorname{Gal}_{F}\rightarrow\operatorname{Aut}(\mathcal{O})\times\operatorname{GL}(A[I])$
lands in $\operatorname{Aut}^{\circ}(A[I])$, so we obtain a homomorphism

(3.5.2)
$\displaystyle\rho^{\circ}_{I}\colon\operatorname{Gal}_{F}\rightarrow\operatorname{Aut}^{\circ}(A[I]).$

We now identity $\operatorname{Aut}^{\circ}(A[I])$ with an explicit semidirect
product. Consider the group
$\operatorname{Aut}(\mathcal{O})\ltimes(\mathcal{O}/I)^{\times}$, where
$\operatorname{Aut}(\mathcal{O})$ acts on $(\mathcal{O}/I)^{\times}$ via
restricting the standard right $\operatorname{Aut}(\mathcal{O})$-action on
$\mathcal{O}/I$ to $(\mathcal{O}/I)^{\times}$. Multiplication in this group is
given by
$(\gamma_{1},x_{1})\cdot(\gamma_{2},x_{2})=(\gamma_{1}\gamma_{2},x_{1}^{\gamma_{2}}x_{2})$.
The $\mathcal{O}/I$-module $A[I](\bar{F})$ is free of rank $1$ [Oht74]. Let
$Q\in A[I](\bar{F})$ be an $\mathcal{O}/I$-module generator. For every
$(\gamma,x)\in\operatorname{Aut}(\mathcal{O})\ltimes(\mathcal{O}/I)^{\times}$,
let $\varphi_{(\gamma,x)}$ be the element of $\operatorname{GL}(A[I])$ sending
$a\cdot Q$ to $a^{\gamma}x\cdot Q$ for all $a\in\mathcal{O}/I$.

######  Lemma 3.5.3.

The map $(\gamma,x)\mapsto(\gamma,\varphi_{(\gamma,x)})$ induces an
isomorphism
$\operatorname{Aut}(\mathcal{O})\ltimes(\mathcal{O}/I)^{\times}\xrightarrow{\sim}\operatorname{Aut}^{\circ}(A[I])$.

###### Proof.

This is a formal verification. The inverse of this isomorphism is given by
sending $(\gamma,\varphi)$ to $(\gamma,x)$, where
$x\in(\mathcal{O}/I)^{\times}$ is the unique element with $Q^{\varphi}=x\cdot
Q$. ∎

Using Lemma 3.5.3, we may view the homomorphism (3.5.2) as a homomorphism

(3.5.4)
$\displaystyle\rho^{\circ}_{I}\colon\operatorname{Gal}_{F}\rightarrow\operatorname{Aut}(\mathcal{O})\ltimes(\mathcal{O}/I)^{\times}.$

######  Definition 3.5.5.

The homomorphism (3.5.2) or, after a choice of $\mathcal{O}/I$-module
generator of $A[I](\bar{F})$, the homomorphism (3.5.4), is called the enhanced
Galois representation associated to $A$ and $I$.

Since $\operatorname{Aut}^{\circ}(A[I])$ is a subgroup of
$\operatorname{Aut}(\mathcal{O})\times\operatorname{GL}(A[I])$, it comes
equipped with projection homomorphisms
$\pi_{1}\colon\operatorname{Aut}^{\circ}(A[I])\rightarrow\operatorname{Aut}(\mathcal{O})$
and
$\pi_{2}\colon\operatorname{Aut}^{\circ}(A[I])\rightarrow\operatorname{GL}(A[I])$
satisfying $\rho_{\operatorname{End}}=\pi_{1}\circ\rho^{\circ}_{I}$ and
$\rho_{I}=\pi_{2}\circ\rho_{I}^{\circ}$.

######  Remark 3.5.6.

Suppose that $\rho_{\operatorname{End}}$ is trivial, in other words
$\operatorname{End}(A)=\operatorname{End}(A_{\bar{F}})\simeq\mathcal{O}$. Then
the homomorphism (3.5.4) lands in the subgroup
$\\{1\\}\ltimes(\mathcal{O}/I)^{\times}$ and hence simplifies to a
homomorphism $\operatorname{Gal}_{F}\rightarrow(\mathcal{O}/I)^{\times}$. This
recovers the well known description [Oht74] of the Galois representation
$\rho_{I}$ in this case.

We show that usually, $\rho^{\circ}_{I}$ does not contain more information
than $\rho_{I}$ itself, using the following well known lemma.

######  Lemma 3.5.7.

Let $G$ be a finite subgroup of $\operatorname{GL}_{n}(\mathbb{Z})$ for some
$n\geq 1$ and let $\operatorname{red}_{N}\colon
G\rightarrow\operatorname{GL}_{n}(\mathbb{Z}/N\mathbb{Z})$ be the restriction
of the reduction map. Then $\operatorname{red}_{N}$ is injective if $N\geq 3$,
and every element of the kernel of $\operatorname{red}_{2}$ has order $1$ or
$2$.

###### Proof.

This is a classical result of Minkowski [Min87]; see [SZ95, Theorem 4.1] for
an accessible reference. ∎

######  Proposition 3.5.8.

Supppose that $I=N\cdot\mathcal{O}$ for some integer $N\geq 3$. Then $\pi_{2}$
is injective on the image $\rho_{I}^{\circ}$. Consequently, the image of
$\rho_{I}^{\circ}$ is isomorphic to the image of $\rho_{I}$.

###### Proof.

Choose a $\mathcal{O}/N$-module generator $Q\in A[N](\bar{F})$. If
$(\gamma,\varphi)\in\ker(\pi_{2})$, then $\varphi=\text{Id}$ and $a\cdot
Q=a^{\gamma}\cdot Q$ for all $a\in\mathcal{O}/N$. So $a=a^{\gamma}$ for all
$a\in\mathcal{O}/N$. Therefore
$\gamma\in\ker(\operatorname{Aut}(\mathcal{O})\rightarrow\operatorname{Aut}(\mathcal{O}/N))$.
By Lemma 3.5.7, this kernel does not contain any nontrivial element of finite
order. However, the image of $\rho_{\operatorname{End}}$ is finite
(Proposition 3.2.1). We conclude that
$\ker(\pi_{2})\cap\text{image}(\rho_{I}^{\circ})=\\{1\\}$. ∎

######  Remark 3.5.9.

We can also define $\ell$-adic versions of the enhanced Galois representation:
for every prime $\ell$ this is a group homomorphism
$\operatorname{Gal}_{F}\rightarrow\operatorname{Aut}(\mathcal{O})\ltimes(\mathcal{O}\otimes\mathbb{Z}_{\ell})^{\times}$
encoding both the $\operatorname{Gal}_{F}$-action on $\mathcal{O}$ and on the
$\ell$-adic Tate module of $A$.

##  4\. PQM surfaces over local and finite fields

We collect some results about $\mathrm{PQM}$ surfaces $A$ over local and
finite fields, especially the possible reduction types. The most important
facts for our purposes are: a $\mathrm{PQM}$ surface $A/\mathbb{Q}$ of
$\operatorname{GL}_{2}$-type has totally additive reduction at every bad prime
(Corollary 4.1.4); the prime-to-$p$ torsion in the totally additive case is
controlled by the Néron component group (Lemma 4.3.1); and the latter in turn
is controlled by the smallest field extension over which $A$ acquires good
reduction (Proposition 4.2.1).

For the remainder of this section, let $R$ be a henselian discrete valuation
ring with fraction field $F$ of characteristic zero and perfect residue field
$k$ of characteristic $p\geq 0$.

###  4.1. Néron models of PQM surfaces

We first recall some notions in the theory of Néron models. Let $A/F$ be an
abelian variety with Néron model $\mathcal{A}/R$. The special fiber
$\mathcal{A}_{k}$ fits into an exact sequence

$0\rightarrow\mathcal{A}_{k}^{\circ}\rightarrow\mathcal{A}_{k}\rightarrow\Phi\rightarrow
0$

where $\Phi$ is the component group of $\mathcal{A}_{k}$, a finite étale
$k$-group scheme. The identity component $\mathcal{A}_{k}^{0}$ fits into an
exact sequence

(4.1.1) $\displaystyle 0\rightarrow U\times
T\rightarrow\mathcal{A}^{0}_{k}\rightarrow B\rightarrow 0$

where $U$ is a unipotent group, $T$ is a torus and $B$ is an abelian variety
over $k$. The dimensions of $U,T$, and $B$, which we denote by $u,t$, and $b$,
are called the unipotent, toric and abelian ranks of $A$, respectively. We
have $u+t+b=\dim A$, and $A$ has bad reduction if and only if $b<\dim A$.
Similarly, $A$ has potentially good reduction over $F$ if and only if its
toric rank is 0 over every finite extension of $F$.

######  Lemma 4.1.2.

Suppose that $A/F$ is an abelian surface such that
$\operatorname{End}^{0}(A_{\bar{F}})$ contains a non-split quaternion algebra.
Then there exists a finite extension $F^{\prime}/F$ such that $A_{F^{\prime}}$
has good reduction. If $k$ is finite, we may take $F^{\prime}$ to be a totally
ramified extension of $F$.

###### Proof.

The fact that $A$ has potentially good reduction is well known, see e.g.
[CX08, p. 536]. It follows from the fact that a non-split quaternion algebra
does not embed in $\mathrm{Mat}_{2}(\mathbb{Q})$, and hence does not embed in
$\operatorname{End}(T)\otimes\mathbb{Q}$ for any torus $T/k$ of dimension $1$
or $2$.

The last sentence of the lemma can be justified by taking a lift in
$\operatorname{Gal}_{F}$ of the Frobenius in $\operatorname{Gal}_{k}$, in a
manner analogous to [ST68, p. 498]. ∎

######  Proposition 4.1.3.

Suppose that $A/F$ is an abelian surface such that
$\operatorname{End}^{0}(A_{\bar{F}})$ contains a non-split quaternion algebra.
Suppose that $A$ has bad reduction. Then:

  1. (a)

$t=0$.

  2. (b)

If $\operatorname{End}^{0}(A)$ contains a real quadratic field, then $u=\dim
A=2$.

  3. (c)

If $u=1$, then $A_{K}$ has good reduction over any field extension $K/F$ such
that $\operatorname{End}^{0}(A_{K})$ contains a real quadratic field.

###### Proof.

$(a)$ follows from the fact that $A$ has potentially good reduction and the
fact that the toric rank cannot decrease under extension of the base field
[CX08, Proposition 2.4]. For $(b)$, we only need to exclude the possibility
that $u=b=1$, so suppose by contradiction that it holds. Let
$E\subset\operatorname{End}^{0}(A)$ be a real quadratic subfield. Reducing
endomorphisms in (4.1.1) gives a (nonzero, hence injective) map
$E\hookrightarrow\operatorname{End}^{0}(B)$. By assumption, $B$ is an elliptic
curve. However, this contradicts the fact that the endomorphism algebra of an
elliptic curve (over any field) does not contain a real quadratic field.
Finally, $(c)$ follows from $(b)$, since the abelian rank cannot decrease
after base change [CX08, Proposition 2.4]. ∎

When $u=\dim A$ one says that $A$ has totally additive reduction.

######  Corollary 4.1.4.

Let $A/\mathbb{Q}$ be a $\mathrm{PQM}$ surface and $p$ a prime of bad
reduction. Suppose that $A$ is of $\operatorname{GL}_{2}$-type. Then $A$ has
totally additive reduction at $p$.

###### Proof.

This follows from Proposition 4.1.3(b) and the fact that
$\operatorname{End}(A)$ is real quadratic by Proposition 3.1.2. ∎

######  Remark 4.1.5.

One can show that if $p\geq 5$ then the Prym variety of $y^{3}=x^{4}+x^{2}+p$
(which has $\mathrm{PQM}$ by [LS23]) has unipotent rank $1$ over
$\mathbb{Q}_{p}$. So the $\operatorname{GL}_{2}$-type hypothesis cannot be
dropped in general in Corollary 4.1.4.

Finally, we state Raynaud’s criterion for $A/F$ to have semistable reduction,
which in the case of a $\mathrm{PQM}$ surface is necessarily good by
Proposition 4.1.3.

######  Lemma 4.1.6.

Let $A/F$ be a $\mathrm{PQM}$ surface, $n$ an integer not divisible by the
residue characteristic $p$ and suppose that all points in $A[n]$ are defined
over an unramified extension of $F$. Then

  1. (a)

if $n=2$ then $A$ has good reduction over every ramified quadratic extension
of $F$;

  2. (b)

if $n\geq 3$ then $A$ has good reduction over $F$.

###### Proof.

See [SZ95, §7]. ∎

###  4.2. The good reduction field and component group of a PQM surface

Let $A/F$ be an abelian variety with potentially good reduction. If $k$ is
algebraically closed, there exists a smallest field extension $M/F$ such that
$A_{M}$ has good reduction, called the good reduction field of $A$. This is a
Galois extension, equal to $F(A[N])$ for every $N\geq 3$ coprime to $p$ [ST68,
§2, Corollary 3]. It is relevant for us because it controls the size of the
component group, by the following result [ELL96, Theorem 1].

######  Proposition 4.2.1.

Suppose that $k$ is algebraically closed. Let $A/F$ be an abelian variety with
potentially good reduction and reduction field $M/F$. Then the Néron component
group $\Phi$ is killed by $[M:F]$.

The next lemma constrains the good reduction field of a $\mathrm{PQM}$
surface.

######  Lemma 4.2.2.

Suppose that $k$ is algebraically closed. Let $A/F$ be a $\mathrm{PQM}$
surface with good reduction field $M/F$. Then $[M:F]$ divides $24^{2}$. In
particular, $[M:F]$ is coprime to any prime $\ell>3$.

###### Proof.

Let $L$ be the endomorphism field of $A/F$ (Section 3.2). By the
Néron–Ogg–Shafarevich criterion, all prime-to-$p$ torsion is defined over $M$,
hence $L\subset M$ by a result of Silverberg (Proposition 3.2.5). By
Proposition 3.2.1, $[L:F]$ divides $24$. By [JM94, Proposition 4.2] and its
proof (whose notation does not agree with ours), we have $[M:L]\mid 24$. We
conclude that $[M:F]=[M:L][L:F]$ divides $24^{2}$. ∎

######  Lemma 4.2.3.

Let $A/F$ be a $\mathrm{PQM}$ surface and let $\ell\geq 5$. Then the order of
$\Phi$ is not divisible by $\ell$.

###### Proof.

Since formation of Néron models commutes with unramified base change, it is
enough to prove the lemma in the case where $F$ has algebraically closed
residue field. This then follows from Proposition 4.2.1 and Lemma 4.2.2. ∎

We record the following technical lemma that will allow us to sometimes
‘quadratic twist away’ bad primes. This will be useful in the proof of
Proposition 5.2.1.

######  Lemma 4.2.4.

Suppose that $p\neq 2$. Let $A/F$ be an abelian variety with totally additive
reduction. Suppose that $A_{M}$ has good reduction for some quadratic
extension $M/F$. Then the quadratic twist $A^{M}$ of $A$ by $M$ has good
reduction.

###### Proof.

Let $I_{F}$ and $I_{M}$ denote the inertia group of $\operatorname{Gal}_{F}$
and $\operatorname{Gal}_{M}$ respectively. Fix a prime $\ell\neq p$. By the
Néron–Ogg–Shafarevich criterion, the $I_{F}$-action on the $\ell$-adic Tate
module $T_{\ell}A$ factors through a faithful $I_{F}/I_{M}$-action, so acts
via an element $\sigma\in\operatorname{GL}(T_{\ell}A)$ of order $2$. Since $A$
has totally additive reduction, $(T_{\ell}A)^{I_{F}}=0$ and so $\sigma=-1$.
Let $\chi_{M}\colon\operatorname{Gal}_{F}\rightarrow\\{\pm 1\\}$ be the
character corresponding to the extension $M/F$. Then $T_{\ell}(A^{M})\simeq
T_{\ell}A\otimes\chi_{M}$ as $\operatorname{Gal}_{F}$-modules. Therefore
$I_{F}$ acts trivially on $T_{\ell}(A^{M})$ and $A^{M}$ has good reduction. ∎

###  4.3. Component groups and torsion

The relevance of the component group is the following well-known fact, see for
example [Lor93, Remark 1.3]. If $G$ is an abelian group, write $G^{(p)}$ for
its subgroup of elements of finite order prime to $p$.

######  Lemma 4.3.1.

If $A/F$ is an abelian variety with totally additive reduction $($i.e. $u=\dim
A)$, then $A(F)^{(p)}_{\mathrm{tors}}$ is isomorphic to a subgroup of
$\Phi(k)^{(p)}$, where $\Phi$ denotes the component group of
$\mathcal{A}_{k}$.

Lorenzini has studied the component groups of general abelian surfaces with
potentially good reduction and totally additive reduction, which leads to the
following severe constraint on their torsion subgroups [Lor93, Corollary
3.25].

######  Theorem 4.3.2 (Lorenzini).

Let $A/F$ be an abelian surface with totally additive and potentially good
reduction. Then $A(F)^{(p)}_{\mathrm{tors}}$ is a subgroup of one of the
following groups:

$\mathbb{Z}/5\mathbb{Z},\,(\mathbb{Z}/3\mathbb{Z})^{2},\,(\mathbb{Z}/2\mathbb{Z})^{4},\,\mathbb{Z}/2\mathbb{Z}\times\mathbb{Z}/4\mathbb{Z},\,\mathbb{Z}/2\mathbb{Z}\times\mathbb{Z}/6\mathbb{Z}.$

We can say more if $A$ has totally additive reduction over any proper
subextension of the good reduction field. The following slight variant of
[Lor93, Corollary 3.24] will be very useful in classifying torsion in the
$\operatorname{GL}_{2}$-type case.

######  Proposition 4.3.3.

Suppose that the residue field of $F$ is algebraically closed. Let $A/F$ be an
abelian variety with bad and potentially good reduction. Let $M/F$ be the good
reduction field of $A$. Suppose that $A_{F^{\prime}}$ has totally additive
reduction for every $F\subset F^{\prime}\subsetneq M$. Suppose that the prime-
to-$p$ torsion subgroup $A(F)^{(p)}_{\mathrm{tors}}$ of $A(F)$ is nontrivial.
Then there exists a prime number $\ell\neq p$ such that $[M:F]$ is a power of
$\ell$ and $A(F)^{(p)}_{\mathrm{tors}}\simeq(\mathbb{Z}/\ell\mathbb{Z})^{k}$
for some $k\geq 1$.

###### Proof.

Let $G:=\operatorname{Gal}(M/F)$. For every $F\subset F^{\prime}\subsetneq M$,
$A(F)^{(p)}_{\mathrm{tors}}\subset A(F^{\prime})^{(p)}_{\mathrm{tors}}$ is
isomorphic to a subgroup of the component group of $A_{F^{\prime}}$ by Lemma
4.3.1, which is killed by $[F:F^{\prime}]$ by Proposition 4.2.1. By Galois
theory, $A(F)^{(p)}_{\mathrm{tors}}$ is therefore killed by $\\#H$ for every
nontrivial subgroup $H\leq G$. The group $A(F)^{(p)}_{\mathrm{tors}}$ is
nontrivial by assumption; let $\ell$ be a prime dividing its order. We claim
that this $\ell$ satisfies the conclusions of the proposition. Indeed, by
definition of $A(F)^{(p)}_{\mathrm{tors}}$ we have $\ell\neq p$. Moreover if
$\\#G$ is divisible by another prime $\ell^{\prime}$, then by taking $H$ a
Sylow-$\ell^{\prime}$ subgroup of $G$ we get a contradiction, so $\\#G=[M:F]$
is a power of $\ell$. By taking $H$ to be an order $\ell$ subgroup of $G$, we
see that $A(F)^{(p)}_{\mathrm{tors}}$ is killed by $\ell$, as desired. ∎

In the general case (not necessarily totally additive reduction), we have the
following well-known result when $F$ is a finite extension of
$\mathbb{Q}_{p}$, which follows from formal group law considerations [CX08,
§2.5 and Proposition 3.1].

######  Lemma 4.3.4.

Suppose that $F/\mathbb{Q}_{p}$ is a finite extension of ramification degree
$e$. Let $A/F$ be an abelian variety with Néron model $\mathcal{A}/R$. Let
$\operatorname{red}\colon A(F)=\mathcal{A}(R)\rightarrow\mathcal{A}(k)$ be the
reduction map.

  1. (a)

The restriction of $\operatorname{red}$ to prime-to-$p$ part of
$A(F)_{\operatorname{tors}}$ is injective.

  2. (b)

If in addition $e<p-1$, then $\operatorname{red}$ is injective on
$A(F)_{\operatorname{tors}}$.

###  4.4. The conductor of a PQM surface

Recall that the conductor $\mathfrak{f}(A)$ of an abelian variety
$A/\mathbb{Q}$ is a positive integer divisible exactly by the primes of bad
reduction of $A$; see [BK94] for a precise definition and more information. We
may write $\mathfrak{f}(A)=\prod_{p}p^{\mathfrak{f}_{p}(A)}$, where
$\mathfrak{f}_{p}(A)$ denotes the conductor exponent at a prime $p$.

######  Lemma 4.4.1.

Let $A/\mathbb{Q}$ be a $\mathrm{PQM}$ surface of
$\operatorname{GL}_{2}$-type. Let $p$ be a prime such that $A$ has bad
reduction at $p$ but acquires good reduction over a tame extension of
$\mathbb{Q}_{p}$. Then $\mathfrak{f}_{p}(A)=4$.

###### Proof.

In that case $\mathfrak{f}_{p}(A)$ equals the tame conductor exponent at $p$,
which is $2\times(\text{unipotent rank})+(\text{toric rank})$. This equals
$2\times 2+0=4$ by Proposition 4.1.3. ∎

######  Proposition 4.4.2.

Let $A/\mathbb{Q}$ be a $\mathrm{PQM}$ surface of
$\operatorname{GL}_{2}$-type. Then the conductor of $A$ is of the form
$2^{2i}3^{2j}N^{4}$, where $0\leq i\leq 10$, $0\leq j\leq 5$, and $N$ is
squarefree and coprime to $6$.

###### Proof.

By Lemmas 4.2.2 and 4.4.1, $\mathfrak{f}_{p}(A)=4$ for every bad prime $p\geq
5$. The bounds $\mathfrak{f}_{2}(A)\leq 20$ and $\mathfrak{f}_{3}(A)\leq 10$
follow from a general result of Brumer–Kramer [BK94, Theorem 6.2]. The fact
that $\mathfrak{f}_{2}(A)$ and $\mathfrak{f}_{3}(A)$ are even follows from the
fact that $\operatorname{End}^{0}(A)$ is a real quadratic field (Proposition
3.1.2) and [Ser87, (4.7.2)]. ∎

###  4.5. Finite fields

Let $k=\mathbb{F}_{q}$ be a finite field of order $p^{r}$. We will use the
following two statements, whose proof can be found in [Jor86, §2].

######  Lemma 4.5.1.

Let $A/k$ be an abelian surface such that $\operatorname{End}^{0}(A)$ contains
the quaternion algebra $B$. Then the characteristic polynomial of Frobenius is
of the form $(T^{2}+aT+q)^{2}$ for some integer $a\in\mathbb{Z}$ satisfying
$|a|\leq 2\sqrt{q}$.

######  Proposition 4.5.2.

Let $A/k$ be an abelian surface such that $\operatorname{End}^{0}(A)$ contains
the quaternion algebra $B$. If $r$ is odd or $p\nmid\operatorname{disc}(B)$,
then $A$ is isogenous to the square of an elliptic curve over $k$. If $r$ is
even and $p\mid\operatorname{disc}(B)$, $A_{\bar{k}}$ is isogenous to the
square of a supersingular elliptic curve over $\bar{k}$.

##  5\. Proof of Theorem 1.4: PQM surfaces of $\operatorname{GL}_{2}$-type

Before proving Theorems 1.1-1.3, it is useful to first prove Theorem 1.4,
which classifies torsion subgroups of $\mathcal{O}$-PQM abelian surfaces $A$
over $\mathbb{Q}$ which are of $\operatorname{GL}_{2}$-type. At a certain
point in the argument we make use of the modularity of abelian surfaces of
$\operatorname{GL}_{2}$-type, which we recall in §5.1 and classify
$\mathrm{PQM}$ surfaces of $\operatorname{GL}_{2}$-type with good reduction
outside $2$ or $3$. In §5.2, we deduce that a general
$\mathcal{O}$-$\mathrm{PQM}$ surface cannot have a full level $2$-structure
over $\mathbb{Q}$. In §5.3, we prove Theorem 1.4.

###  5.1. Abelian surfaces of $\operatorname{GL}_{2}$-type and modular forms

######  Theorem 5.1.1.

Let $A$ be an abelian surface such that $\operatorname{End}^{0}(A)$ is a real
quadratic field. Then the conductor of $A$ is of the form $N^{2}$ for some
positive integer $N$, and there exists a unique Galois orbit $[f_{A}]\subset
S_{2}(\Gamma_{0}(N))$ having coefficient field
$K\simeq\operatorname{End}^{0}(A)$ whose local $L$-factors agree for each
prime $p$:

(5.1.2) $L_{p}(A,T)=\prod_{\tau\colon
K\hookrightarrow\mathbb{C}}L_{p}(\tau(f_{A}),T)\in 1+T\mathbb{Z}[T].$

Moreover, we have $[f_{A}]=[f_{A^{\prime}}]$ if and only if $A$ is isogenous
to $A^{\prime}$ (over $\mathbb{Q}$).

###### Proof.

As explained by Ribet [Rib04, Theorem (4.4)], the fact that $A$ is of
$\operatorname{GL}_{2}$-type over $\mathbb{Q}$ implies that $A$ is modular
assuming Serre’s modularity conjecture [Ser87, §4.7, Theorem 5], which was
proven by Khare–Wintenberger [KW09]. Thus the equality of $L$-series (5.1.2)
holds for some newform $f_{A}$. Since $\operatorname{End}^{0}(A)$ is real, the
character of $f_{A}$ is trivial [Rib76, Lemma (4.5.1)]. It follows from a
theorem of Carayol [Car86, Theoreme (A)] (local-global compatibility) that $A$
has conductor equal to $N^{2}$, where $N$ is the level of $f_{A}$. Finally,
the fact that the Galois orbit of $f_{A}$ characterizes $A$ up to isogeny
follows from the theorem of Faltings. ∎

Recall that if $f\in S_{2}(\Gamma_{0}(N))$ is a newform and $\psi$ a primitive
Dirichlet character, there exists a unique newform $g=f\otimes\psi$, the twist
of $f$ by $\psi$, whose $q$-expansion satisfies $a_{n}(g)=a_{n}(f)\psi(n)$ for
all $n$ coprime to $N$ and the conductor of $\psi$. If $f=g$, then $g$ is
called a self-twist. If $f$ and $g$ are Galois conjugate, $g$ is called an
inner twist.

######  Proposition 5.1.3.

Let $A$ be an abelian surface over $\mathbb{Q}$ such that
$\operatorname{End}^{0}(A)\simeq\mathbb{Q}(\sqrt{m})$ with $m\geq 2$. Then $A$
has $\mathrm{PQM}$ if and only if all of the following conditions hold:

  1. (i)

$f_{A}$ has no self-twists, equivalently $f_{A}$ is not CM;

  2. (ii)

$f_{A}$ has a nontrivial inner twist by a Dirichlet character associated to a
quadratic field $\mathbb{Q}(\sqrt{d})$; and

  3. (iii)

The quaternion algebra
$B_{d,m}\colonequals\displaystyle{\biggl{(}\frac{d,m}{\mathbb{Q}}\biggr{)}}$
is a division algebra.

If all conditions (i)–(iii) hold, then in fact
$\operatorname{End}^{0}(A_{\overline{\mathbb{Q}}})\simeq B_{d,m}$.

###### Proof.

See Cremona [Cre92, §2]. ∎

This reduces the enumeration of isogeny classes of
$\operatorname{GL}_{2}$-type $\mathrm{PQM}$ surfaces $A$ over $\mathbb{Q}$
with fixed conductor to a computation in a space of modular forms.

######  Corollary 5.1.4.

There are no $\mathrm{PQM}$ surfaces $A$ over $\mathbb{Q}$ of
$\operatorname{GL}_{2}$-type with good reduction outside $\\{2\\}$.

###### Proof.

By Proposition 4.4.2, it is enough to check that there is no eigenform
corresponding to a $\mathrm{PQM}$ surface of level $2^{k}$ for any $k\leq 10$.
This information is contained in the LMFDB [LMF23] or [GG09, Table 1]. ∎

######  Corollary 5.1.5.

There is exactly one isogeny class of $\mathrm{PQM}$ surfaces $A$ over
$\mathbb{Q}$ of $\operatorname{GL}_{2}$-type with good reduction outside
$\\{3\\}$: it has conductor $3^{10}$, any abelian surface $A$ in the isogeny
class satisfies $A(\mathbb{Q})_{\mathrm{tors}}\leq\mathbb{Z}/3\mathbb{Z}$.

###### Proof.

The fact that there is exactly one such isogeny class again follows from
Proposition 4.4.2 and information in the LMFDB or [GG09, Table 1]. The
corresponding Galois orbit of weight two newforms has LMFDB label 243.2.a.d.
From $L_{2}(1)=3$ and $L_{13}(1)=225$ we conclude that
$\\#A(\mathbb{Q})_{\mathrm{tors}}\mid 3$ for every $A$ in this isogeny class.
(In fact, the corresponding optimal quotient of $J_{0}(243)$ has
$\mathbb{Z}/3\mathbb{Z}$ torsion subgroup by considering the image of the
cuspidal subgroup of $J_{0}(243)$.) ∎

######  Remark 5.1.6.

The isogeny class of Corollary 5.1.5 has minimal conductor among all
$\mathrm{PQM}$ surfaces $A$ of $\operatorname{GL}_{2}$-type. It would be
interesting to produce an explicit model over $\mathbb{Q}$; see also [LS23,
Question 2].

######  Proposition 5.1.7.

There are exactly $44$ isogeny classes of $\mathrm{PQM}$ surfaces over
$\mathbb{Q}$ of $\operatorname{GL}_{2}$-type with good reduction outside
$\\{2,3\\}$.

###### Proof.

Again we use Propositions 4.4.2 and 4.4.2 to reduce the question to computing
the number of Galois orbits of newforms in $S_{2}(\Gamma_{0}(N))$, where
$N\mid 2^{10}3^{5}$, with quadratic Hecke coefficient field, having an inner
twist but no self-twist. However, here we need to do a new computation in a
large dimensional space. The code is available at https://github.com/ciaran-
schembri/QM-Mazur; we provide a few details to explain how we proceeded,
referring to the book by Stein [Ste07] on modular symbols and more broadly
[BBB+21] for a survey of methods to compute modular forms.

We work with modular symbols, and we loop over all possible (imaginary)
quadratic characters $\psi$ supported at $2,3$, corresponding to inner twist.
For each character $\psi$, of conductor $d$:

  * •

For a list of split primes $p\geq 5$, we inductively compute the kernels of
$T_{p}-a$ where $|a|\leq 2\sqrt{p}$.

  * •

For a list of inert primes $p\geq 5$, we further inductively compute the
kernels of $T_{p}^{2}-db^{2}$ where $db^{2}\leq 4p$.

The first bound holds since $\psi(p)=1$ so
$a_{p}(f)\psi(p)=\tau(a_{p}(f))=a_{p}(f)$ so $a_{p}(f)\in\mathbb{Z}$, and the
Ramanujan–Petersson bound holds; the second bound holds since $\psi(p)=-1$ now
gives $\tau(a_{p}(f))=-a_{p}(f)$ so $a_{p}(f)=\sqrt{d}b$ with again
$\sqrt{d}|b|\leq 2\sqrt{p}$. It is essential to compute the split primes
first, and only compute the induced action of $T_{p}$ on the kernels computed
in the first step.

To simplify the linear algebra, we work modulo a large prime number $q$,
checking that each Hecke matrix $T_{p}$ (having entries in $\mathbb{Q}$) has
no denominator divisible by $q$. The corresponding decomposition gives us an
‘upper bound’: if we had the desired eigenspace for $T_{p}$, it reduces modulo
$q$, but a priori some of these spaces could accidentally coincide or the
dimension could go down (corresponding to a prime of norm $q$ in the Hecke
field). To certify the ‘lower bound’, we compute a small linear combination of
Hecke operators supported at split primes and use the computed eigenvalues to
recompute the kernel over $\mathbb{Q}$ working with divisors $N^{\prime}\mid
N$, and when we find it we compute the dimension of the oldspace for the form
at level $N^{\prime}$ inside level $N$ and confirm that it matches the
dimension computed modulo $q$.

In fact, we find that $N\mid 2^{8}3^{5}$ or $N\mid 2^{10}3^{4}$. (Indeed, a
careful analysis of the possible endomorphism algebra can be used to show this
a priori.)

To certify that the form is not PCM, we find a coefficient for an inert prime
that is nonzero. That the form has the correct inner twist by $\psi$ is
immediate: the form would again appear somewhere in our list, so once we have
identified the newforms uniquely with coefficients, the inner twist must
match, Sherlock Holmes-style. We similarly discard the forms with PCM.

Finally, we compute the split $\mathrm{PQM}$ forms by identifying the
quaternion algebra above using Proposition 5.1.3. ∎

The complete data is available online (https://github.com/ciaran-schembri/QM-
Mazur); we give a summary in Table LABEL:table:mfs, listing forms in a fixed
level, up to (quadratic) twist.

For example, Table LABEL:table:mfs says that up to twist there are $3$
newforms of level $N=20736=2^{8}3^{4}$, each having $4$ Galois newform orbits
for a total of $12$ newform orbits.

Table 1. Twist classes of modular forms corresponding to PQM abelian surfaces over $\mathbb{Q}$ of $\operatorname{GL}_{2}$-type with good reduction outside $\\{2,3\\}$ |  |  |  |
---|---|---|---|---
$N$ |  $\psi$ |  $\operatorname{disc}B$ |  num |  LMFDB labels
$243=3^{5}$ |  $-3$ |  $6$ |  $1$ |  243.2.a.d
$972=2^{2}3^{5}$ |  $-3$ |  $6$ |  $1$ |  972.2.a.e
$2592=2^{5}3^{4}$ |  $-4$ |  $6$ |  $2$ |  2592.2.a.l, 2592.2.a.p
$2592=2^{5}3^{4}$ |  $-4$ |  $6$ |  $2$ |  2592.2.a.m, 2592.2.a.r
$3888=2^{4}3^{5}$ |  $-3$ |  $6$ |  $2$ |  3888.2.a.b, 3888.2.a.t
$5184=2^{6}3^{4}$ |  $-4$ |  $6$ |  $2$ |  5184.2.a.bl, 5184.2.a.bx
$5184=2^{6}3^{4}$ |  $-4$ |  $6$ |  $2$ |  5184.2.a.bk, 5184.2.a.bv
$15552=2^{6}3^{5}$ |  $-3$ |  $6$ |  $2$ |
$15552=2^{6}3^{5}$ |  $-3$ |  $6$ |  $2$ |
$20736=2^{8}3^{4}$ |  $-4$ |  $6$ |  $4$ |
$20736=2^{8}3^{4}$ |  $-4$ |  $22$ |  $4$ |
$20736=2^{8}3^{4}$ |  $-8$ |  $10$ |  $4$ |
$62208=2^{8}3^{5}$ |  $-3$ |  $6$ |  $4$ |
$62208=2^{8}3^{5}$ |  $-3$ |  $6$ |  $4$ |
$82944=2^{10}3^{4}$ |  $-24$ |  $6$ |  $4$ |
$82944=2^{10}3^{4}$ |  $-24$ |  $6$ |  $4$ |

######  Corollary 5.1.8.

If $A$ is a $\mathrm{PQM}$ abelian surface of $\operatorname{GL}_{2}$-type
over $\mathbb{Q}$ with good reduction outside $\\{2,3\\}$ and
$\\#A(\mathbb{Q})_{\textup{tors}}$ nontrivial, then $A$ corresponds to either
243.2.a.d or 972.2.a.e. In particular, $\\#A(\mathbb{Q})_{\textup{tors}}\leq
9$.

###### Proof.

Direct calculation as in Corollary 5.1.5. ∎

###  5.2. Full level $2$-structure

Before imposing the $\operatorname{GL}_{2}$-type assumption in the next
subsection, we show that $\mathcal{O}$-$\mathrm{PQM}$ surfaces cannot have
full level $2$-structure over $\mathbb{Q}$.

######  Proposition 5.2.1.

Let $A/\mathbb{Q}$ be an $\mathcal{O}$-$\mathrm{PQM}$ surface. Then
$A(\mathbb{Q})[2]\not\simeq(\mathbb{Z}/2\mathbb{Z})^{4}$.

###### Proof.

Suppose $A(\mathbb{Q})[2]\simeq(\mathbb{Z}/2\mathbb{Z})^{4}$. Since $A[2]$ is
free of rank one as an $\mathcal{O}/2\mathcal{O}$-module and contains a
$\mathbb{Q}$-rational generator, we have $A[2]\simeq\mathcal{O}/2\mathcal{O}$
as $\operatorname{Gal}_{\mathbb{Q}}$-modules. By Theorem 2.3.1 and Proposition
3.2.1, this implies that the endomorphism field $L/\mathbb{Q}$ is quadratic,
so that $A$ has $\operatorname{GL}_{2}$-type by Lemma 3.2.2.

Let $K$ be a quadratic field ramified at all primes $p\geq 3$ of bad reduction
of $A$ and unramified at all primes $p\geq 3$ of good reduction. Corollary
4.1.4 and Lemmas 4.1.6(a), 4.2.4 and 3.2.6 show that the quadratic twist of
$A$ by $K$ is an $\mathcal{O}$-$\mathrm{PQM}$ surface of
$\operatorname{GL}_{2}$-type with good reduction outside $\\{2\\}$. But by
Corollary 5.1.4, no such surface exists. ∎

###  5.3. Torsion classification in the $\operatorname{GL}_{2}$-type case

Now we assume $A/\mathbb{Q}$ is a $\mathrm{PQM}$ surface of
$\operatorname{GL}_{2}$-type. By Lemma 3.2.2, there exists a quadratic
extension $L/\mathbb{Q}$ (the endomorphism field) such that
$\operatorname{End}(A_{L})=\operatorname{End}(A_{\overline{\mathbb{Q}}})$.

######  Lemma 5.3.1.

If $\ell$ is a prime such that $A[\ell](\mathbb{Q})\neq 0$, then $\ell\leq 7$.

###### Proof.

By Lemma 4.1.2, there exists a finite extension $L^{\prime}/L$ that is totally
ramified at $2$ and such that $A_{L^{\prime}}$ has good reduction. Let
$\mathfrak{q}$ be a prime in $L^{\prime}$ above $2$ and let $k$ be its residue
field. Since $L/\mathbb{Q}$ is quadratic, $k$ is isomorphic to
$\mathbb{F}_{2}$ or $\mathbb{F}_{4}$. Therefore the reduction of
$A_{L^{\prime}}$ at $\mathfrak{q}$ is an abelian surface $B$ over $k$ such
that $\operatorname{End}^{0}(B)$ contains $\operatorname{End}^{0}(A_{L})$. By
Lemma 4.3.4, $B[\ell](k)\neq 0$ and so $\ell$ divides $\\#B(\mathbb{F}_{4})$.
On the other hand, Lemma 4.5.1 shows that the $L$-polynomial of
$B_{\mathbb{F}_{4}}$ is of the form $(T^{2}+aT+4)^{2}$ with $a\in\mathbb{Z}$
satisfying $|a|\leq 2\sqrt{4}=4$. Therefore $\ell$ divides $(1+a+4)^{2}$,
hence $\ell$ divides $(1+a+4)\leq 9$, hence $\ell\leq 9$. ∎

######  Lemma 5.3.2.

If $\ell\geq 5$ is a prime such that $A[\ell](\mathbb{Q})\neq 0$, then
$A/\mathbb{Q}$ has good reduction away from $\ell$.

###### Proof.

Let $p$ be a prime of bad reduction of $A$. Since $A$ is of
$\operatorname{GL}_{2}$-type, the algebra $\operatorname{End}^{0}(A)$ is a
quadratic field; it is real quadratic by Proposition 3.1.2. Proposition
4.1.3(c) implies that $A$ has totally additive reduction at $p$. By Lemmas
4.2.3 and 4.3.1, we must have $p=\ell$. We conclude that $A$ has good
reduction outside $\\{\ell\\}$. ∎

######  Proposition 5.3.3.

If $\ell$ is a prime such that $A[\ell](\mathbb{Q})\neq 0$, then
$\ell\in\\{2,3\\}$.

###### Proof.

Suppose that $\ell\geq 5$. By Proposition 3.1.2, the quadratic extension
$L/\mathbb{Q}$ is imaginary quadratic. Moreover, by a result of Silverberg
[Sil92, Theorem 4.2], the surface $A$ has bad reduction at all primes
ramifying in $L$. By Lemma 5.3.2, $L$ is therefore only ramified at $\ell$. If
$\ell=5$, this is already a contradiction since there are no imaginary
quadratic fields ramified only at $5$. If $\ell=7$, then we conclude that
$L=\mathbb{Q}(\sqrt{-7})$. Since $2$ splits in $L$, this means that the
residue field in the proof of Lemma 5.3.1 is equal to $\mathbb{F}_{2}$.
Continuing with the proof there, we deduce the stronger inequality $|a|\leq
2\sqrt{2}$, and we find that $\ell$ divides $1+a+2<6$, which is a
contradiction. ∎

######  Remark 5.3.4.

We can also deduce Proposition 5.3.3 from Lemma 5.3.2 by invoking modularity
(Proposition 5.1.3), the fact that such an abelian surface must have conductor
$\ell^{4}$ (Proposition 4.4.2) and the fact that there are no $\mathrm{PQM}$
eigenforms in $S_{2}(\Gamma_{0}(25))$ or $S_{2}(\Gamma_{0}(49))$. We also note
that Schoof has proven that there are no abelian varieties with everywhere
good reduction over $\mathbb{Q}(\zeta_{\ell})$ for various small $\ell$,
including $5$ and $7$ [Sch03].

######  Proposition 5.3.5.

Either
$A(\mathbb{Q})_{\operatorname{tors}}\subset(\mathbb{Z}/2\mathbb{Z})^{3}$ or
$A(\mathbb{Q})_{\operatorname{tors}}\subset(\mathbb{Z}/3\mathbb{Z})^{2}$.

###### Proof.

By Proposition 5.3.3, $A(\mathbb{Q})_{\operatorname{tors}}$ is a group of
order $2^{i}3^{j}$. We may assume that $A(\mathbb{Q})_{\mathrm{tors}}\neq 0$;
let $\ell\in\\{2,3\\}$ be such that $A[\ell](\mathbb{Q})\neq 0$.

Suppose there exists a prime $p\geq 5$ of bad reduction. Then $A$ has totally
additive reduction over every finite extension $F/\mathbb{Q}_{p}$ over which
it has bad reduction by Proposition 4.1.3. Therefore the assumptions of
Proposition 4.3.3 apply for $F=\mathbb{Q}_{p}^{\mathrm{nr}}$ (the maximal
unramified extension of $\mathbb{Q}_{p}$), and so
$A(\mathbb{Q})_{\mathrm{tors}}=A(\mathbb{Q})_{\mathrm{tors}}^{(p)}\subset
A(\mathbb{Q}_{p}^{\mathrm{nr}})_{\mathrm{tors}}^{(p)}\simeq(\mathbb{Z}/\ell\mathbb{Z})^{k}$
for some $1\leq k\leq 4$. If $\ell=2$, then $k\leq 3$ by Proposition 5.2.1. If
$\ell=3$, then $k\leq 2$, since
$A(\mathbb{Q})^{(2)}_{\mathrm{tors}}\hookrightarrow A_{2}(\mathbb{F}_{2})$ for
some abelian surface $A_{2}/\mathbb{F}_{2}$ (using Lemmas 4.1.2 and 4.3.4) and
$\\#A_{2}(\mathbb{F}_{2})\leq 25$ for all such surfaces. We conclude
$A(\mathbb{Q})_{\operatorname{tors}}\subset(\mathbb{Z}/2\mathbb{Z})^{3}$ or
$A(\mathbb{Q})_{\operatorname{tors}}\subset(\mathbb{Z}/3\mathbb{Z})^{2}$, as
desired.

It remains to consider the case that $A$ has good reduction outside
$\\{2,3\\}$. A computation with modular forms of level dividing $2^{10}\cdot
3^{5}$ shows that $\\#A(\mathbb{Q})_{\operatorname{tors}}\mid 9$ for such
surfaces by Corollary 5.1.8, but we give an argument that only involves
computing modular forms of much smaller level. We may assume $A$ has bad
reduction at both of these primes by Corollaries 5.1.4 and 5.1.5. If
$A[2](\mathbb{Q})=0$, then Proposition 4.3.3 shows again that
$A(\mathbb{Q})_{\mathrm{tors}}=A(\mathbb{Q})_{\mathrm{tors}}^{(2)}\subset
A(\mathbb{Q}_{2}^{\mathrm{nr}})_{\mathrm{tors}}^{(2)}\subset(\mathbb{Z}/3\mathbb{Z})^{2}$.
Similarly $A(\mathbb{Q})_{\mathrm{tors}}\subset(\mathbb{Z}/2\mathbb{Z})^{3}$
if $A[3](\mathbb{Q})=0$. Thus, it remains to rule out the possibility that
$A(\mathbb{Q})$ contains a point of order $6$. In that case, Proposition 4.3.3
shows that the extensions $M_{2}/\mathbb{Q}^{\mathrm{nr}}_{2}$ and
$M_{3}/\mathbb{Q}^{\mathrm{nr}}_{3}$ over which $A$ attains good reduction
have degrees that are powers of $3$ and $2$ respectively, and hence are tamely
ramified. Hence $A$ has conductor $2^{4}3^{4}$ by Lemma 4.4.1 and corresponds
to an eigenform of level $2^{2}3^{2}=36$, by Theorem 5.1.1. However, there are
no $\mathrm{PQM}$ eigenforms of level $36$ [GG09, Table 1]. ∎

Next we constrain the torsion even further and show that
$(\mathbb{Z}/2\mathbb{Z})^{3}$ does not occur. For this, we combine a cute
fact from linear algebra with a purely local proposition that makes use of the
enhanced Galois representation of §3.5.

######  Lemma 5.3.6.

Let $k$ be a field and
$V\subset\mathcal{O}_{k}:=\mathcal{O}\otimes_{\mathbb{Z}}k$ a $3$-dimensional
$k$-subspace. Then $V$ contains an $\mathcal{O}_{k}$-module generator of
$\mathcal{O}_{k}$.

###### Proof.

If $\mathcal{O}_{k}$ is a division algebra, every nonzero element of $V$ is an
$\mathcal{O}_{k}$-generator. If the characteristic of $k$ divides
$\operatorname{disc}(B)$, the lemma follows from Lemma 6.1.3 and the fact that
the ideal $J$ described there is $2$-dimensional. It suffices to consider the
case when $\mathcal{O}_{k}\simeq\operatorname{Mat}_{2}(k)$ and to prove that
in this case $V$ contains an invertible matrix. (This is well known, we give a
quick proof here.) Suppose otherwise. If $k$ admits a quadratic field
extension $k^{\prime}$, then embedding $k^{\prime}\subset\mathrm{Mat}_{2}(k)$,
we compute $\dim(V+k^{\prime})=\dim V+\dim k^{\prime}-\dim(V\cap
k^{\prime})=3+2-0=5$, which is a contradiction. In general, the subspace $V$
is defined over a subfield $k^{\prime\prime}$ of $k$ which is finitely
generated over its prime field. The previous argument then applies over
$k^{\prime\prime}$. ∎

Recall that $\mathbb{Q}_{p}^{\mathrm{nr}}$ denotes the maximal unramified
extension of $\mathbb{Q}_{p}$.

######  Proposition 5.3.7.

Let $p$ be an odd prime, $F$ a finite extension of
$\mathbb{Q}_{p}^{\mathrm{nr}}$ and $A/F$ an $\mathcal{O}-\mathrm{PQM}$ surface
with $(\mathbb{Z}/2\mathbb{Z})^{3}\subset A[2](F)$. Then $A$ acquires good
reduction over every quadratic extension of $F$.

###### Proof.

If $A[2](F)\simeq(\mathbb{Z}/2\mathbb{Z})^{4}$, this immediately follows from
Raynaud’s criterion (Lemma 4.1.6(a)), so assume that
$A[2](F)\simeq(\mathbb{Z}/2\mathbb{Z})^{3}$. By Lemma 5.3.6, there exists an
$F$-rational $\mathcal{O}/2\mathcal{O}$-generator $P\in A[2](F)$, and hence
$A[2]\simeq\mathcal{O}/2\mathcal{O}$ as $\operatorname{Gal}_{F}$-modules.

Let $L/F$ be the endomorphism field of $A_{F}$ and let $M/F$ be the smallest
field over which $A_{F}$ acquires good reduction. By the Néron-Ogg-Shafarevich
criterion, $M=F(A[4])$. By Proposition 3.2.5, $L\subset M$. Since
$A[2]\simeq\mathcal{O}/2\mathcal{O}$ as
$\operatorname{Gal}_{\mathbb{Q}}$-modules, $F(A[2])\subset L$. We therefore
have a chain of inclusions $F\subset F(A[2])\subset L\subset M=F(A[4])$. Since
$A[2](\mathbb{Q})\simeq(\mathbb{Z}/2\mathbb{Z})^{3}$, $F(A[2])/F$ is a
$(2,2,\dots,2)$-extension. The same is true for $F(A[4])/F(A[2])$. Since $p$
is odd and the residue field is algebraically closed, both these extensions
are cyclic, so at most quadratic. Therefore $F(A[2])/F$ is a quadratic
extension. If $L\neq F(A[2])$, then $L/F$ would be cyclic of order $4$, and
there would be an order $4$ element $g\in\operatorname{Aut}(\mathcal{O})$
whose fixed points on $\mathcal{O}/2\mathcal{O}$ is
$(\mathbb{Z}/2\mathbb{Z})^{3}$. A calculation similar to the proof of the
$D_{4}$ case in Theorem 2.3.1 shows that this is not possible. We conclude
that $L=F(A[2])$ and that $M/L$ is at most quadratic.

To prove the proposition, it suffices to prove that $M/F$ is quadratic, so
assume by contradiction that this is not the case. Then $M/L$ and $L/F$ are
both quadratic and $\operatorname{Gal}(M/F)=\\{1,g,g^{2},g^{3}\\}$ is cyclic
of order $4$.

Consider the mod $4$ Galois representation
$\rho\colon\operatorname{Gal}_{F}\rightarrow\operatorname{GL}(A[4])$, which
factors through $\operatorname{Gal}_{F}\rightarrow\operatorname{Gal}(M/F)$.
Let $Q\in A[4](M)$ be a lift of the $\mathcal{O}/2\mathcal{O}$-generator $P\in
A[2](F)$. Then $Q$ is an $\mathcal{O}/4\mathcal{O}$-generator for $A[4]$, and
hence by the enhanced Galois representation construction, we know that
$\rho\simeq\rho_{4}^{\circ}$ lands in
$\operatorname{Gal}(L/F)\ltimes(\mathcal{O}/4\mathcal{O})^{\times}$ (see §3.5
and Proposition 3.5.8). The situation can be summarized as follows:

${{\operatorname{Gal}(M/L)}}$${{(\mathcal{O}/4\mathcal{O})^{\times}}}$${{\operatorname{Gal}(M/F)}}$${{\operatorname{Gal}(L/F)\ltimes(\mathcal{O}/4\mathcal{O})^{\times}}}$${{\operatorname{Gal}(L/F)}}$${{\operatorname{Gal}(L/F)\ltimes(\mathcal{O}/2\mathcal{O})^{\times}}}$$\scriptstyle{\rho_{4}^{\circ}}$$\scriptstyle{\rho_{2}^{\circ}}$$\scriptstyle{\rho_{4}^{\circ}|_{\operatorname{Gal}_{L}}}$

The horizontal maps are the enhanced Galois representations for $L$ mod $4$,
$F$ mod $4$ and $F$ mod $2$ respectively. Write
$\operatorname{Gal}(L/F)=\\{1,\sigma\\}$. Since $P$ is $F$-rational, the
bottom map sends $\sigma$ to $(\sigma,1)$. By commutativity of the bottom
square, $\rho_{4}^{\circ}(g)=(\sigma,x)$, where
$x\in(\mathcal{O}/4\mathcal{O})$ satisfies $x\equiv 1\mod 2\mathcal{O}$. Since
$A_{L}$ has bad and hence totally additive reduction by Proposition 4.1.3, the
nontrivial element of $\operatorname{Gal}(M/L)$ maps to $-1$ in
$(\mathcal{O}/4\mathcal{O})^{\times}$. (In fact, the generator of
$\operatorname{Gal}(M/L)$ even maps to $-1$ in $\operatorname{GL}(T_{2}A)$ by
an argument identical to the proof of Lemma 4.2.4.) By the commutativity of
the top diagram, $(\sigma,x)^{2}=(1,-1)$. The involution $\sigma$ acts on
$(\mathcal{O}/4\mathcal{O})^{\times}$ by conjugating by an element
$b\in\mathcal{O}\cap N_{B^{\times}}(\mathcal{O})$ whose fixed points on
$\mathcal{O}/2\mathcal{O}$ are $(\mathbb{Z}/2\mathbb{Z})^{3}$. Therefore
$(\sigma,x)^{2}=(1,-1)$ is equivalent to $b^{-1}xbx=-1$. By Lemma 2.3.5, no
such $x$ exists, obtaining the desired contradiction. ∎

######  Proposition 5.3.8.

Let $A/\mathbb{Q}$ be an $\mathcal{O}$-$\mathrm{PQM}$ surface of
$\operatorname{GL}_{2}$-type. Then $(\mathbb{Z}/2\mathbb{Z})^{3}\not\subset
A(\mathbb{Q})[2]$.

###### Proof.

Let $K$ be a quadratic field ramified at all primes $p\geq 3$ of bad reduction
of $A$ and unramified at all primes $p\geq 3$ of good reduction. Corollary
4.1.4, Proposition 5.3.7 and Lemmas 4.2.4 and 3.2.6 show that the quadratic
twist of $A$ by $K$ is an $\mathcal{O}$-$\mathrm{PQM}$ surface of
$\operatorname{GL}_{2}$-type with good reduction outside $\\{2\\}$. But no
such $\mathcal{O}$-$\mathrm{PQM}$ surface exists by Corollary 5.1.4. ∎

We are finally ready to prove our classification result for torsion subgroups
of $\mathcal{O}$-$\mathrm{PQM}$ surfaces of $\operatorname{GL}_{2}$-type.

###### Proof of Theorem 1.4.

By Propositions 5.3.5 and 5.3.8, we have ruled out all groups aside from those
listed in the theorem. It remains to exhibit infinitely many abelian surfaces
$A/\mathbb{Q}$ of $\operatorname{GL}_{2}$-type with torsion subgroups
isomorphic to each of the groups

$\\{0\\},\mathbb{Z}/2\mathbb{Z},\mathbb{Z}/3\mathbb{Z},(\mathbb{Z}/2\mathbb{Z})^{2},(\mathbb{Z}/3\mathbb{Z})^{2}.$

Let $\mathcal{O}_{6}$ be the maximal quaternion order of reduced discriminant
$6$ (unique up to isomorphism). In [LS23, §9], one-parameter families of
$\operatorname{GL}_{2}$-type $\mathcal{O}_{6}$-PQM surfaces with generic
torsion subgroups $\\{0\\},\mathbb{Z}/2\mathbb{Z}$, $\mathbb{Z}/3\mathbb{Z}$
and $(\mathbb{Z}/3\mathbb{Z})^{2}$ are given among Prym surfaces of bielliptic
Picard curves. In Proposition 5.3.9 below, we give a one-parameter family of
$\operatorname{GL}_{2}$-type $\mathcal{O}_{6}$-PQM Jacobians $J$ with
$(\mathbb{Z}/2\mathbb{Z})^{2}\subset J(\mathbb{Q})_{\operatorname{tors}}$. ∎

To state the next result, we define the rational functions

$\displaystyle j(T)$
$\displaystyle=\frac{(-64T^{20}+256T^{16}-384T^{12}+256T^{8}-64T^{4})}{(T^{24}+42T^{20}+591T^{16}+2828T^{12}+591T^{8}+42T^{4}+1)};$
$\displaystyle J_{2}(T)$ $\displaystyle=12(j+1);$ $\displaystyle J_{4}(T)$
$\displaystyle=6(j^{2}+j+1);$ $\displaystyle J_{6}(T)$
$\displaystyle=4(j^{3}-2j^{2}+1);$ $\displaystyle J_{8}(T)$
$\displaystyle=(J_{2}J_{6}-J_{4}^{2})/4;$ $\displaystyle J_{10}(T)$
$\displaystyle=j^{3}.$

######  Proposition 5.3.9.

For all but finitely many $t\in\mathbb{Q}$, there exists a genus two curve
$C_{t}/\mathbb{Q}$ with Igusa invariants
$(J_{2}(t):J_{4}(t):J_{6}(t):J_{8}(t):J_{10}(t))$, whose Jacobian
$J_{t}/\mathbb{Q}$ is an $\mathcal{O}_{6}$-$\mathrm{PQM}$ surface of
$\operatorname{GL}_{2}$-type and satisfies
$J_{t}(\mathbb{Q})_{\operatorname{tors}}\supset(\mathbb{Z}/2\mathbb{Z})^{2}$.

###### Proof.

In [BG08, p.742], the authors have an expression for Igusa-Clebsch invariants
(which we have translated to Igusa invariants) of genus 2 curves defining
$\mathcal{O}$-$\mathrm{PQM}$ surfaces for every value of a parameter $j$
(which is a coordinate on the full Atkin-Lehner quotient of the discriminant 6
Shimura curve). The field of moduli for $k_{R_{3}}$, in their notation, is
$\mathbb{Q}(\sqrt{-27-16j^{-1}})$ and the obstruction for these genus 2 curves
to be defined over $\mathbb{Q}$ is given by the Mestre obstruction
$\Big{(}\frac{-6j,-2(27j+16)}{\mathbb{Q}}\Big{)}.$ A short computation for the
family $j(T)$ shows that $-27-16j^{-1}$ is a square in
$\mathbb{Q}(T)^{\times}$, and hence $k_{R_{3}}=\mathbb{Q}$ for all non-
singular specializations. Furthermore, one checks that the Mestre obstruction
also vanishes for all such $t$. Thus, the Igusa invariants in the statement of
the proposition give an infinite family of $\mathcal{O}$-$\mathrm{PQM}$
Jacobians $J/\mathbb{Q}$ of $\operatorname{GL}_{2}$-type with
$\operatorname{End}^{0}(J)\simeq\mathbb{Q}(\sqrt{3}).$ (Only finitely many
$j\in\mathbb{Q}$ correspond to CM points [BG08, §5, Table 1], so $J$ is
geometrically simple for all but finitely many $t\in\mathbb{Q}$.)

Using Magma, one can write down an explicit sextic polynomial $f_{T}(x)$ such
that $C_{t}$ has model $y^{2}=f_{t}(x)$. The coefficients of $f_{T}(x)$ are
too large to include here, but we have posted them here. We find that there is
a factoriztion

$f_{T}(x)=q_{1,T}(x)q_{2,T}(x)q_{3,T}(x)$

where each $q_{i,T}$ is a quadratic polynomial in $\mathbb{Q}(T)[x]$. From
this we see that for all but finitely many $t$, the group
$(\mathbb{Z}/2\mathbb{Z})^{2}$ is a subgroup of
$J_{t}(\mathbb{Q})_{\operatorname{tors}}.$ Indeed,
$J_{t}=\operatorname{Pic}_{0}(C_{t})$ and for each $i\in\\{1,2,3\\}$, the
divisor class $(\alpha,0)-(\alpha^{\prime},0)$, where
$q_{i,t}(x)=(x-\alpha)(x-\alpha^{\prime})$, is defined over $\mathbb{Q}$ and
has order $2$. In future work, we will explain how the special family $j(T)$
was found using the arithmetic of Shimura curves. ∎

##  6\. Proof of Theorem 1.1: reduction to $\operatorname{GL}_{2}$-type

In this section, we prove Theorem 1.1. By Theorem 1.4, it is enough to prove:

######  Theorem 6.0.1.

Let $A/\mathbb{Q}$ be an $\mathcal{O}$-$\mathrm{PQM}$ surface, and let
$\ell\geq 5$ be a prime number such that $A[\ell](\mathbb{Q})\neq 0$. Then $A$
is of $\operatorname{GL}_{2}$-type.

Theorem 6.0.1 follows from combining Propositions 6.2.5 and 6.2.7 below. The
proofs consist mostly of careful semi-linear algebra over non-commutative
rings, combined with a small drop of global arithmetic input.

###  6.1. Linear algebra

Let $\ell$ be a prime and
$\mathcal{O}_{\ell}:=\mathcal{O}\otimes\mathbb{F}_{\ell}$. If
$\ell\nmid\operatorname{disc}(B)$, then
$\mathcal{O}_{\ell}\simeq\operatorname{Mat}_{2}(\mathbb{F}_{\ell})$, since
$\mathcal{O}$ is maximal. If $\ell\mid\operatorname{disc}(B)$, then
$\mathcal{O}_{\ell}$ is isomorphic to the nonsemisimple algebra [Jor86, §4]

(6.1.1) $\displaystyle\left\\{\begin{pmatrix}\alpha&\beta\\\
0&\alpha^{\ell}\end{pmatrix}\mid\alpha,\beta\in\mathbb{F}_{{\ell}^{2}}\right\\}\subset\operatorname{Mat}_{2}(\mathbb{F}_{\ell^{2}}).$

In both cases, we will describe all left ideals of $\mathcal{O}_{\ell}$.
Equivalently, given a left $\mathcal{O}_{\ell}$-module $M$, free of rank one,
we will describe all its (left) $\mathcal{O}_{\ell}$-submodules.

First we suppose that $\ell\nmid\operatorname{disc}(B)$; fix an isomorphism
$\mathcal{O}_{\ell}\simeq\operatorname{Mat}_{2}(\mathbb{F}_{\ell})$ and a free
rank one left $\mathcal{O}_{\ell}$-module $M$. Let $e_{1},e_{2},w$ be the
elements of $\mathcal{O}_{\ell}$ corresponding to the matrices

$\displaystyle\begin{pmatrix}1&0\\\ 0&0\end{pmatrix},\begin{pmatrix}0&0\\\
0&1\end{pmatrix},\begin{pmatrix}0&1\\\ 1&0\end{pmatrix}$

respectively. Then $e_{1}$,$e_{2}$ are idempotents satisfying $e_{1}e_{2}=0$,
$e_{1}+e_{2}=1$ and $e_{1}w=we_{2}$. Set $M_{i}=\ker(e_{i}\colon M\rightarrow
M)\subset M$. Then $M=M_{1}\oplus M_{2}$ and $w$ induces mutually inverse
bijections $M_{1}\rightarrow M_{2}$ and $M_{2}\rightarrow M_{1}$. Given an
$\mathcal{O}_{\ell}$-submodule $N\subset M$, define $N_{i}:=N\cap M_{i}$.
Since $N$ is $\mathcal{O}_{\ell}$-stable, $N=N_{1}\oplus N_{2}$ and
$w(N_{1})=N_{2}$.

######  Lemma 6.1.2 (Unramified case).

The map $N\mapsto(N_{1},N_{2})$ induces a bijection between left
$\mathcal{O}_{\ell}$-submodules of $M$ and pairs of
$\mathbb{F}_{\ell}$-subspaces $(N_{1}\subset M_{1},N_{2}\subset M_{2})$
satisfying $w(N_{1})=N_{2}$.

###### Proof.

This is elementary, using the fact that $\mathcal{O}_{\ell}$ is generated (as
a ring) by $e_{1},e_{2}$ and $w$. ∎

Next suppose that $\ell$ divides $\operatorname{disc}(B)$ and fix an
isomorphism between $\mathcal{O}_{\ell}$ and the ring described in (6.1.1).
The set of strictly upper triangular matrices is a two-sided ideal
$J\subset\mathcal{O}_{\ell}$ that satisfies
$\mathcal{O}_{\ell}/J\simeq\mathbb{F}_{\ell^{2}}$. The following lemma is
easily verified [Jor86, §4].

######  Lemma 6.1.3 (Ramified case).

The only proper left ideal of $\mathcal{O}_{\ell}$ is $J$. Consequently, the
only proper $\mathcal{O}_{\ell}$-submodule of $M$ is $M[J]=\\{m\in M\mid
j\cdot m=0\text{ for all }j\in J\\}$.

###  6.2. The subgroup generated by a torsion point

Let $A/\mathbb{Q}$ be an $\mathcal{O}$-$\mathrm{PQM}$ surface and $\ell$ be a
prime number. Let $\mathcal{O}_{\ell}:=\mathcal{O}\otimes\mathbb{F}_{\ell}$
and $M:=A[\ell](\bar{\mathbb{Q}})$. Then $M$ is a free
$\mathcal{O}_{\ell}$-module of rank one, and $\operatorname{Gal}_{\mathbb{Q}}$
acts on $\mathcal{O}_{\ell}$ by ring automorphisms (as studied in §3.2) and on
$M$ by $\mathbb{F}_{\ell}$-linear automorphisms. These actions satisfy
$(a\cdot m)^{\sigma}=a^{\sigma}\cdot m^{\sigma}$ for all
$\sigma\in\operatorname{Gal}_{\mathbb{Q}},a\in\mathcal{O}_{\ell}$ and $m\in
M$.

######  Lemma 6.2.1.

Suppose that the $\operatorname{Gal}_{\mathbb{Q}}$-modules
$\mathcal{O}_{\ell}$ and $M$ are isomorphic. Then $\ell\leq 3$.

###### Proof.

This follows by comparing determinants. On one hand, the
$\operatorname{Gal}_{\mathbb{Q}}$-action on $\mathcal{O}_{\ell}$ has
determinant $1$. Indeed, the determinant of left/right multiplication by $b\in
B$ acting on $B$ is the square of the reduced norm, so conjugation has
determinant 1. On the other hand, the determinant of the
$\operatorname{Gal}_{\mathbb{Q}}$-action on $M$ is the square of the mod
$\ell$ cyclotomic character $\bar{\chi}_{\ell}$. This implies that
$\bar{\chi}_{\ell}^{2}=1$, so
$\mathbb{Q}(\zeta_{\ell}+\zeta_{\ell}^{-1})=\mathbb{Q}$, so $\ell\leq 3$. ∎

######  Remark 6.2.2.

When $\ell=3$, we know of no examples of $\mathcal{O}$-$\mathrm{PQM}$ surfaces
over $\mathbb{Q}$ with $\mathcal{O}_{\ell}\simeq M$ as
$\operatorname{Gal}_{\mathbb{Q}}$-modules. Such examples do exist for
$\ell=2$; see [LS23, Corollary 7.5].

######  Lemma 6.2.3.

If $m\in M^{\operatorname{Gal}_{\mathbb{Q}}}$ is nonzero and $\ell\geq 5$,
then $\mathcal{O}_{\ell}\cdot m\subset M$ has order $\ell^{2}$.

###### Proof.

By Lemmas 6.1.2 and 6.1.3, it suffices to show that $\mathcal{O}_{\ell}\cdot
m\neq M$. But if $\mathcal{O}_{\ell}\cdot m=M$, then
$\mathcal{O}_{\ell}\rightarrow M,x\mapsto x\cdot m$ is an isomorphism,
contradicting Lemma 6.2.1. ∎

To analyze the case $\ell\mid\operatorname{disc}(B)$, we use the following
theorem attributed to Ohta.

######  Theorem 6.2.4.

Let $F$ be a number field and let $A/F$ be an abelian variety with
$\operatorname{End}(A)\simeq\mathcal{O}$. Suppose $\mathcal{O}$ is ramified at
a prime $\ell$ and let $J\subset\mathcal{O}$ be the maximal ideal above
$\ell$. Then the composition of the Galois representation
$\operatorname{Gal}_{F}\to\operatorname{Aut}_{\mathbb{F}_{\ell^{2}}}A[J]\simeq\mathbb{F}_{\ell^{2}}^{\times}$
with the norm $\mathbb{F}_{\ell^{2}}^{\times}\to\mathbb{F}_{\ell}^{\times}$ is
equal to the mod $\ell$ cyclotomic character
$\operatorname{Gal}_{F}\to\operatorname{Aut}(\mu_{\ell})\simeq\mathbb{F}_{\ell}^{\times}$.

###### Proof.

See [Jor86, Proposition 4.6]. ∎

######  Proposition 6.2.5.

If $\ell\mid\operatorname{disc}(B)$ and
$M^{\operatorname{Gal}_{\mathbb{Q}}}\neq 0$, then $\ell\leq 3$.

###### Proof.

Choose a nonzero $m\in M^{\operatorname{Gal}_{\mathbb{Q}}}$ and suppose that
$\ell\geq 5$. By the previous lemma, $\mathcal{O}_{\ell}\cdot m$ is a proper
submodule of $M$. Therefore $\mathcal{O}_{\ell}\cdot m=M[J]$ by Lemma 6.1.3.
Let $L/\mathbb{Q}$ be the endomorphism field of $A$. Then the
$\operatorname{Gal}_{\mathbb{Q}}$-action on $M$ restricts to a
$\operatorname{Gal}_{L}$-action on $M[J]$ through elements of
$\mathbb{F}_{\ell^{2}}^{\times}$ (after choosing an isomorphism
$\mathcal{O}_{\ell}/J\simeq\mathbb{F}_{\ell^{2}}$), giving a homomorphism
$\epsilon\colon\operatorname{Gal}_{L}\rightarrow\mathbb{F}_{\ell^{2}}^{\times}$.
Since $m$ is $\operatorname{Gal}_{\mathbb{Q}}$-invariant, the
$\operatorname{Gal}_{L}$-action on $M[J]$ is trivial, so $\epsilon$ is
trivial. On the other hand, the composition
$N_{\mathbb{F}_{\ell^{2}}/\mathbb{F}_{\ell}}\circ\epsilon\colon\operatorname{Gal}_{L}\rightarrow\mathbb{F}_{\ell}^{\times}$
equals the mod $\ell$ cyclotomic character $\bar{\chi}_{\ell}$, by Theorem
6.2.4. It follows that $\bar{\chi}_{\ell}|_{\operatorname{Gal}_{L}}=1$, or in
other words $\mathbb{Q}(\zeta_{\ell})\subset L$. Thus
$\operatorname{Gal}(L/\mathbb{Q})$ surjects onto
$\operatorname{Gal}(\mathbb{Q}(\zeta_{\ell})/\mathbb{Q})\simeq(\mathbb{Z}/\ell\mathbb{Z})^{\times}\simeq\mathbb{Z}/(\ell-1)\mathbb{Z}$.
Since $\operatorname{Gal}(L/\mathbb{Q})$ is dihedral (Proposition 3.2.1),
every nontrivial cyclic quotient of $\operatorname{Gal}(L/\mathbb{Q})$ has
order $2$, and we conclude that $\ell\leq 3$. ∎

We now treat the unramified case, using the following key linear-algebraic
lemma, which we call the ‘torus trick’.

######  Lemma 6.2.6.

Suppose that $\ell\nmid\operatorname{disc}(B)$. Let
$S\subset\mathcal{O}_{\ell}$ be a $2$-dimensional semisimple commutative
$\operatorname{Gal}_{\mathbb{Q}}$-stable subalgebra such that $S\cdot
m=\mathcal{O}_{\ell}\cdot m$ for some nonzero $m\in
M^{\operatorname{Gal}_{\mathbb{Q}}}$. Then every
$\sigma\in\operatorname{Gal}_{\mathbb{Q}}$ acting trivially on $S$ also acts
trivially on $\mathcal{O}_{\ell}$.

###### Proof.

Let $\sigma\in\operatorname{Gal}_{\mathbb{Q}}$ be an element acting trivially
on $S$ and let $m\in M^{\operatorname{Gal}_{\mathbb{Q}}}\setminus\\{0\\}$ be
an element such that $S\cdot m=\mathcal{O}_{\ell}\cdot m$. Let
$k=\bar{\mathbb{F}}_{\ell}$. It suffices to prove that $\sigma$ acts trivially
on $\mathcal{O}_{k}:=\mathcal{O}_{\ell}\otimes_{\mathbb{F}_{\ell}}k$. The
assumptions imply that $S_{k}\simeq k\times k$, and we may fix an isomorphism
$\mathcal{O}_{k}\simeq\operatorname{Mat}_{2}(k)$ of $k$-algebras such that
$S_{k}$ is identified with the subalgebra of diagonal matrices of
$\operatorname{Mat}_{2}(k)$. Lemma 6.1.2 and the fact that $S_{k}$ is
$2$-dimensional shows that $\dim_{k}(S_{k}\cdot
m)=\dim_{k}(\mathcal{O}_{k}\cdot m)=2$. Let $I=\\{x\in\mathcal{O}_{k}\mid
x\cdot m=0\\}$ be the annihilator of $m$, an ideal of $\mathcal{O}_{k}$ of
dimension $2$. Using the analogue of Lemma 6.1.2 over $k$, such an ideal is
necessarily of the form

$\displaystyle\left\\{\begin{pmatrix}ax&bx\\\ ay&by\end{pmatrix}\mid x,y\in
k\right\\}$

for some $a,b\in k$ which are not both zero. The assumption that $S\cdot
m=\mathcal{O}_{\ell}\cdot m$ implies that $S_{k}\cap I=0$. It follows that $a$
and $b$ must be nonzero and $\mathcal{O}_{k}=S_{k}\oplus I$ as
$\operatorname{Gal}_{\mathbb{Q}}$-modules. Let $N\subset\mathcal{O}_{k}$ be
the subspace normalising but not centralising $S_{k}$. Then the above
calculation also shows that $N\cap I=0$. Moreover $N$ is
$\operatorname{Gal}_{\mathbb{Q}}$-stable since $S$ is. The relation
$\mathcal{O}_{k}=S_{k}\oplus I$ shows that $\sigma(x)-x\in I$ for all
$x\in\mathcal{O}_{k}$. It follows that $\sigma(x)-x\in I\cap N=0$ for all
$x\in N$. Since $\mathcal{O}_{k}$ is spanned by $S_{k}$ and $N$, the claim
follows. ∎

######  Proposition 6.2.7.

Suppose that $\ell\nmid\operatorname{disc}(B)$ and
$M^{\operatorname{Gal}_{\mathbb{Q}}}\neq 0$ and $\ell\geq 5$. Then $A$ is of
$\operatorname{GL}_{2}$-type.

###### Proof.

We apply the torus trick using the distinguished quadratic subring
$S\subset\mathcal{O}$ of $A$ (Definition 3.4.1). Write
$S_{\ell}=S\otimes_{\mathbb{Z}}\mathbb{F}_{\ell}$. Then
$S_{\ell}\subset\mathcal{O}_{\ell}$ is a commutative semisimple subalgebra
since $S$ is unramified at $\ell$ by Proposition 3.4.2. Suppose that $A$ is
not of $\operatorname{GL}_{2}$-type. Then $\operatorname{Gal}_{\mathbb{Q}}$
acts nontrivially on $S$ since $\operatorname{End}(A)=\mathbb{Z}$; let
$K/\mathbb{Q}$ be the quadratic extension splitting this action. We claim that
the $\operatorname{Gal}_{K}$-action on $\mathcal{O}_{\ell}$ is trivial.
Indeed, let $m\in M^{\operatorname{Gal}_{\mathbb{Q}}}$ be a nonzero element.
By Lemma 6.2.6 it suffices to prove that $S_{\ell}\cdot
m=\mathcal{O}_{\ell}\cdot m$. But the set $\\{x\in S_{\ell}\mid x\cdot m=0\\}$
is a proper $\operatorname{Gal}_{\mathbb{Q}}$-invariant ideal of $S_{\ell}$.
Since the only such ideal is $0$ (using the fact that the
$\operatorname{Gal}_{\mathbb{Q}}$-action on $S$ is nontrivial and $\ell\neq
2$), the map $S\cdot m\rightarrow\mathcal{O}\cdot m$ is injective and hence by
dimension reasons (and Lemma 6.2.3) it must be surjective. This proves that
the $\operatorname{Gal}_{K}$-action on $\mathcal{O}_{\ell}$ is trivial. By
Lemma 3.5.7, this even implies that that $\operatorname{Gal}_{K}$-action on
$\mathcal{O}$ is trivial. We conclude that the quadratic field $K$ is the
endomorphism field of $A$, hence $A$ is of $\operatorname{GL}_{2}$-type by
Lemma 3.2.2, contradiction. ∎

##  7\. Proof of Theorems 1.2 and 1.3: eliminating groups of order
$2^{i}3^{j}$

Let $A/\mathbb{Q}$ be an $\mathcal{O}$-$\mathrm{PQM}$ surface. By Theorem 1.1,
we have $\\#A(\mathbb{Q})_{\operatorname{tors}}=2^{i}3^{j}$ for some $i,j\geq
0$. Since $A$ has potentially good reduction, local methods show that
$2^{i}3^{j}\leq 72$ [CX08, Theorem 1.4]. In this section, we will improve this
bound and constrain the group structure of $A(\mathbb{Q})_{\mathrm{tors}}$ as
much as possible using the $\mathcal{O}$-action on
$A_{\overline{\mathbb{Q}}}$. We may assume $A$ is not of
$\operatorname{GL}_{2}$-type since we have already proven Theorem 1.4.

For each prime $p$, there exists a totally ramified extension
$K/\mathbb{Q}_{p}$ such that $A_{K}$ has good reduction (Lemma 4.1.2). The
special fiber of the Néron model of $A_{K}$ is an abelian surface over
$\mathbb{F}_{p}$ which we denote by $A_{p}$. We call $A_{p}$ the good
reduction of $A$ at $p$, though it is only uniquely determined up to twists
(since a different choice of totally ramified extension $K^{\prime}$ would
give rise to a possibly non-isomorphic twist of $A_{p}$).

Lemma 4.3.4 shows that the prime-to-$p$ subgroup of
$A(\mathbb{Q})_{\mathrm{tors}}$ injects into $A_{p}(\mathbb{F}_{p})$. Moreover
$\operatorname{End}(A_{\overline{\mathbb{Q}}})\subset\operatorname{End}(A_{\bar{\mathbb{F}}_{p}})$
hence $A_{p}$ is $\bar{\mathbb{F}}_{p}$-isogenous to the square of an elliptic
curve $E/\bar{\mathbb{F}}_{p}$ by Proposition 4.5.2, so its isogeny class is
rather constrained. This leads to the following slight strengthening of [CX08,
Theorem 1.4] in our case:

######  Proposition 7.0.1.

We have $\\#A(\mathbb{Q})_{\operatorname{tors}}=2^{i}3^{j}$ for some
$i\in\\{0,1,2,3,4\\}$ and $j\in\\{0,1,2\\}$. Moreover,
$\\#A(\mathbb{Q})_{\operatorname{tors}}\leq 48$.

###### Proof.

By the above remarks, to bound the prime-to-$2$ (resp. prime-to-3) torsion, it
is enough to bound $X(\mathbb{F}_{2})[3^{\infty}]$ (resp.
$X(\mathbb{F}_{3})[2^{\infty}]$), as $X$ varies over all abelian surfaces over
$\mathbb{F}_{2}$ (resp. $\mathbb{F}_{3}$) that are geometrically isogenous to
the square of an elliptic curve. For this it is enough to compute
$\max_{X}\gcd(f_{X}(1),3^{100})$ (resp. $\max_{X}\gcd(f_{X}(1),2^{100})$),
where $f_{X}$ is the $L$-polynomial of $X$ and the maximum is over all the
aforementioned isogeny classes. This computation is easily done with the help
of the LMFDB’s database of isogeny classes of abelian varieties over finite
fields [LMF23], and the conclusion is the first sentence of the proposition.

The second sentence is equivalent to the claim that
$\\#A(\mathbb{Q})_{\operatorname{tors}}$ cannot equal $144$ nor $72$. We
cannot have $144$ since $\\#A_{5}(\mathbb{F}_{5})\leq 100$, and we cannot have
$72$ since the only isogeny class of abelian surfaces $X/\mathbb{F}_{5}$ with
$72\mid\\#X(\mathbb{F}_{5})$ (which has LMFDB label $2.5.f_{q}$) is not
geometrically isogenous to a square of an elliptic curve. ∎

The remainder of the proof of Theorems 1.2 and 1.3 will be similar (but more
difficult) to that of 7.0.1, using the good reduction model $A_{p}$ at various
primes $p$ and the $\mathcal{O}$-action. In what follows, we will freely use
the Honda-Tate computations conveniently recorded in the LMFDB [LMF23], so the
careful reader will want to follow along in a web browser. We use the LMFDB’s
method of labeling isogeny classes, e.g. $2.5.d_{e}$ is an isogeny class of
abelian surfaces over $\mathbb{F}_{5}$ with label $d_{e}$.

###  7.1. Torsion constraints arising from the endomorphism field

Before analyzing specific groups, we state the following useful proposition,
which uses techniques similar to the proof of Theorem 6.0.1, including the
torus trick.

######  Proposition 7.1.1.

Let $G$ be the Galois group of the endomorphism field $L/\mathbb{Q}$.

  1. (a)

If $G\simeq D_{3}$ or $D_{6}$, then
$A[2](\mathbb{Q})\subset\mathbb{Z}/2\mathbb{Z}$. If in addition
$A[2](\mathbb{Q})=\mathbb{Z}/2\mathbb{Z}$, then
$A[2]\simeq\mathcal{O}/2\mathcal{O}$ as
$\operatorname{Gal}_{\mathbb{Q}}$-modules or $2\mid\operatorname{disc}(B)$.

  2. (b)

If $G\simeq D_{2}$ or $D_{4}$, then
$A[3](\mathbb{Q})\subset\mathbb{Z}/3\mathbb{Z}$. If in addition
$A[3](\mathbb{Q})=\mathbb{Z}/3\mathbb{Z}$, then
$A[3]\simeq\mathcal{O}/3\mathcal{O}$ as
$\operatorname{Gal}_{\mathbb{Q}}$-modules or $3\mid\operatorname{disc}(B)$.

###### Proof.

  1. (a)

Let $S\subset\mathcal{O}$ be the distinguished quadratic subring of $A$
(Definition 3.4.1). By Proposition 3.4.2, $S\simeq\mathbb{Z}[\omega]$ where
$\omega^{2}+\omega+1=0$. Let $K/\mathbb{Q}$ be the quadratic field
trivializing the Galois action on $S$, so $\operatorname{End}(A_{K})=S$. Let
$S_{2}:=S\otimes\mathbb{F}_{2}$ and
$\mathcal{O}_{2}:=\mathcal{O}\otimes\mathbb{F}_{2}$. If
$A[2]\simeq\mathcal{O}_{2}$ as $\operatorname{Gal}_{\mathbb{Q}}$-modules, then
$A[2](\mathbb{Q})\simeq(\mathcal{O}/2\mathcal{O})^{\operatorname{Gal}_{\mathbb{Q}}}$
is isomorphic to $\mathbb{Z}/2\mathbb{Z}$ by Theorem 2.3.1, so indeed
$A[2](\mathbb{Q})\subset\mathbb{Z}/2\mathbb{Z}$ in this case. We may therefore
assume that $A[2](\mathbb{Q})\not\simeq\mathcal{O}_{2}$ in what follows.

It suffices to show that if there exists a nonzero $m\in A[2](\mathbb{Q})$,
then $A[2](\mathbb{Q})$ has order $2$. By the classification of
$\mathcal{O}_{2}$-submodules of $A[2]$ of §6.1 and the fact that
$\mathcal{O}_{2}$ is not isomorphic to $A[2]$, the submodule
$\mathcal{O}_{2}\cdot m\subset A[2]$ has order $4$. Since
$S_{2}\simeq\mathbb{F}_{4}$ has no $\operatorname{Gal}_{\mathbb{Q}}$-stable
nonzero proper ideals, the map $S_{2}\rightarrow A[2],x\mapsto x\cdot m$ is
injective, hence $S_{2}\cdot m\subset\mathcal{O}_{2}\cdot m$ has order $4$
too. Therefore $S_{2}\cdot m=\mathcal{O}_{2}\cdot m$. Suppose first that
$2\nmid\operatorname{disc}(B)$. We can then apply Lemma 6.2.6 to conclude that
$\operatorname{Gal}_{K}$ acts trivially on $\mathcal{O}_{2}$. Since
$\operatorname{Gal}_{K}$ acts on $\mathcal{O}_{2}$ through
$\operatorname{Gal}(L/K)\simeq C_{3}$ or $C_{6}$, this contradicts Lemma 3.5.7
and proves the second claim of (a). It remains to consider the case
$2\mid\operatorname{disc}(B)$. In that case there exists a unique proper
nonzero left ideal $J$ of $\mathcal{O}_{2}$, and $A[J]$ is the unique nonzero
proper $\mathcal{O}_{2}$-submodule of $A[2]$ (Lemma 6.1.3). It follows that
$S_{2}\cdot m=\mathcal{O}_{2}\cdot m=A[J]$. Since
$A[2]\not\simeq\mathcal{O}_{2}$ as $\operatorname{Gal}_{\mathbb{Q}}$-modules,
no element of $A[2](\mathbb{Q})$ is an $\mathcal{O}_{2}$-generator, so
$A[2](\mathbb{Q})=A[J](\mathbb{Q})$. On the other hand, the equality
$S_{2}\cdot m=A[J]$ shows that $S_{2}\simeq A[J]$ as
$\operatorname{Gal}_{\mathbb{Q}}$-modules. Since
$\operatorname{Gal}_{\mathbb{Q}}$ acts nontrivially on $S_{2}=\mathbb{F}_{4}$,
$A[J](\mathbb{Q})=A[2](\mathbb{Q})$ has order $2$.

  2. (b)

The argument is very similar to the proof of (a), using that in the $D_{4}$
case, the distinguished quadratic subring $\mathbb{Z}[i]$ is unramified at
$3$. In the $D_{2}$ case, the distinguished quadratic subring might be
ramified at $3$, but by Lemma 2.2.2 there exist three squarefree integers
$m,n,t$ and embeddings of $\mathbb{Z}[\sqrt{m}]$, $\mathbb{Z}[\sqrt{n}]$ and
$\mathbb{Z}[\sqrt{t}]$ into $\operatorname{Gal}_{\mathbb{Q}}$ whose image is
$\operatorname{Gal}_{\mathbb{Q}}$-stable. Since $t=-mn$ up to squares, at
least one of these three subrings is unramified at $3$, and the argument of
(a) can be carried out using this subring.

∎

###  7.2. Groups of order $48$

######  Lemma 7.2.1.

Let $E$ be an elliptic curve over the finite field $\mathbb{F}_{p^{n}}$, and
assume either that $E$ is ordinary or that $n=1$. Then any abelian surface
$X/\mathbb{F}$ isogenous to $E^{2}$ is isomorphic to a product of elliptic
curves over $\mathbb{F}$.

###### Proof.

Let $\pi\in\operatorname{End}(E)$ be the Frobenius. Replacing $E$ by an
isogenous elliptic curve, we may assume that
$\operatorname{End}(E)=\mathbb{Z}[\pi]$ [JKP+18, §7.2-7.3]. By [JKP+18,
Theorem 1.1], the functor $X\mapsto\operatorname{Hom}(X,E)$ is an equivalence
between the category of abelian varieties isogenous to a power of $E$ and
isomorphism classes of finitely generated torsion-free
$\operatorname{End}(E)$-modules. Since $\operatorname{End}(E)$ is an order in
a quadratic field, any finitely generated torsion-free
$\operatorname{End}(E)$-module is a direct sum of rank $1$ modules [JKP+18,
Theorem 3.2], so the lemma follows. ∎

######  Lemma 7.2.2.

If $G\subset A(\mathbb{Q})_{\operatorname{tors}}$ is a subgroup of order $16$,
then $G$ is isomorphic to $(\mathbb{Z}/4\mathbb{Z})^{2}$ or
$(\mathbb{Z}/2\mathbb{Z})^{2}\times\mathbb{Z}/4\mathbb{Z}$.

###### Proof.

There is a unique isogeny class of abelian surfaces $X$ over $\mathbb{F}_{3}$
with $16\mid\\#X(\mathbb{F}_{3})$, namely the square of the elliptic curve
$E/\mathbb{F}_{3}$ with
$\operatorname{End}_{\mathbb{F}_{p}}(E)\simeq\mathbb{Z}[\sqrt{-3}]$ and
$\\#E(\mathbb{F}_{3})=4$. By Lemma 7.2.1, $A_{p}$ is isomorphic to a product
of two elliptic curves both of which have four $\mathbb{F}_{3}$-rational
points. Since such an elliptic curve has its group of $\mathbb{F}_{3}$-points
isomorphic to either $\mathbb{Z}/4\mathbb{Z}$ or
$(\mathbb{Z}/2\mathbb{Z})^{2}$, $A_{p}(\mathbb{F}_{3})$ is isomorphic to
$(\mathbb{Z}/4\mathbb{Z})^{2}$ or
$(\mathbb{Z}/4\mathbb{Z})\times(\mathbb{Z}/2\mathbb{Z})^{2}$ or
$(\mathbb{Z}/2\mathbb{Z})^{4}$. By Proposition 5.2.1, the latter cannot
happen. The lemma now follows since $A(\mathbb{Q})[16]\hookrightarrow
A_{p}(\mathbb{F}_{3})$. ∎

######  Proposition 7.2.3.

$\\#A(\mathbb{Q})_{\operatorname{tors}}<48$.

###### Proof.

By Proposition 7.0.1 it is enough to show that
$A(\mathbb{Q})_{\operatorname{tors}}\neq 48$. Assume for the sake of
contradiction that $\\#A(\mathbb{Q})_{\mathrm{tors}}=48$. The reduction
$A_{5}/\mathbb{F}_{5}$ must then be in the isogeny class $2.5.d_{e}$. We see
that $\operatorname{End}^{0}((A_{p})_{\mathbb{F}_{5^{n}}})$ contains a
quaternion algebra if and only if $3$ divides $n$. Therefore the Galois group
of the endomorphism field of $A$ has order divisible by $3$, so by Proposition
3.2.1 must be $D_{3}$ or $D_{6}$. Proposition 7.1.1 then implies
$A[2](\mathbb{Q})\subset\mathbb{Z}/2\mathbb{Z}$, contradicting the fact that
$A[2](\mathbb{Q})$ has size $\geq 4$ (Lemma 7.2.2). ∎

###  7.3. Groups of order $36$

######  Lemma 7.3.1.

If $36\mid\\#A(\mathbb{Q})_{\mathrm{tors}}$, then
$A(\mathbb{Q})_{\mathrm{tors}}\simeq(\mathbb{Z}/6\mathbb{Z})^{2}$.

###### Proof.

Over $\mathbb{F}_{5}$ there is exactly one isogeny class of abelian surface
$X$ with $36\mid\\#X(\mathbb{F}_{5})$ and whose geometric endomorphism algebra
contains a quaternion algebra, namely $2.5.a_{k}$, which is isogenous to the
square of an elliptic curve. Thus the reduction $A_{5}$ is isomorphic to a
product of two elliptic curves (Lemma 7.2.1). Every elliptic curve in this
isogeny class has $E(\mathbb{F}_{5})\simeq\mathbb{Z}/6\mathbb{Z}$, hence
$A_{5}(\mathbb{F}_{5})\simeq(\mathbb{Z}/6\mathbb{Z})^{2}$. ∎

######  Proposition 7.3.2.

$\\#A(\mathbb{Q})_{\operatorname{tors}}<36$.

###### Proof.

By Proposition 7.2.3 and Proposition 7.0.1, it is enough to show that
$A(\mathbb{Q})_{\operatorname{tors}}$ does not have order $36$. By Lemma 7.3.1
such an $A$ would have
$A(\mathbb{Q})_{\operatorname{tors}}\simeq(\mathbb{Z}/6\mathbb{Z})^{2}$. By
Proposition 7.1.1, $A$ cannot have endomorphism field $D_{n}$ for every
$n\in\\{2,3,4,6\\}$ so $A$ has $\operatorname{GL}_{2}$-type, which we have
also already ruled out. ∎

It follows that $\\#A(\mathbb{Q})_{\operatorname{tors}}\leq 24$. Before we
show that this inequality is strict, we rule out the existence of rational