\documentclass[11pt,reqno]{amsart} \usepackage{jaswal} \newcommand{\Q}{\mathbb{Q}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\R}{\mathbb{R}} \newcommand{\C}{\mathbb{C}} \newcommand{\FF}{\mathbb{F}} \newcommand{\cO}{\mathcal{O}} \DeclareMathOperator{\Tr}{Tr} \DeclareMathOperator{\Nm}{N} \DeclareMathOperator{\rank}{rank} \DeclareMathOperator{\Gal}{Gal} \DeclareMathOperator{\Sel}{Sel} \DeclareMathOperator{\Imm}{Im} \newcommand{\tors}{\mathrm{tors}} \newcommand{\sq}[1]{[#1]} \begin{document} \title[$\mathbb{Z}$ in totally real fields]{Diophantine definitions of $\texorpdfstring{\boldsymbol{\mathbb{Z}}}{Z}$ in totally real fields from rank-one elliptic curves} \author{Manvir Jaswal} \address{Toronto, Canada} \email{manvirjaswal@icloud.com} \urladdr{https://manvirjaswal.github.io} \date{November 25, 2026} \subjclass[2020]{Primary 11U05; Secondary 03D35, 11G05, 11G18, 11F80} \keywords{Hilbert's tenth problem, Diophantine sets, totally real fields, elliptic curves, Shimura curves, heights} \hypersetup{pdftitle={Diophantine definitions of Z in totally real fields from rank-one elliptic curves},pdfauthor={Manvir Jaswal},pdfkeywords={Hilbert's tenth problem, Diophantine sets, totally real fields, elliptic curves, Shimura curves, heights}} \begin{abstract} Let $K$ be a totally real number field, let $E\colon y^2=x^3-Ax$ be one of four explicit elliptic curves over a real quadratic field $F\not\subseteq K$, and put $L=KF$. We prove that if $E(L)$ has rank one and torsion in $E[2]$, and $2E(L)\subseteq E(F)$, then $\Z$ is Diophantine in $K$, with $25$ unknowns, so Hilbert's tenth problem over $K$ has a negative answer. For a suitable curve these conditions hold for every layer of the cyclotomic $\Z_2$-extension of $\Q$, for infinitely many real quadratic fields and for some further fields of degree at most $8$. The construction is Z.-W. Sun's, from his proofs for $\Q(\sqrt2)$, $\Q(\sqrt3)$ and $\Q(\sqrt6)$, except that our predicate excluding poles of odd order uses the congruent-number twists of our earlier proof for $\Q$. Its main step is a height bound on a $q$-adic tube of a quaternionic Shimura curve. We prove it over every totally real field by Sun's method, with a scalar cochain over $K$, a comparison with Shimura curves over $K$ in every degree and, when $\sqrt3\in K$, a second tube prime. \end{abstract} \maketitle \contents \section{Introduction}\label{sec:intro} A subset $A$ of a commutative ring $R$ is \emph{Diophantine in $R$} if there is a polynomial $f\in\Z[X,Y_1,\dots,Y_k]$ such that, for every $a\in R$, $a\in A$ if and only if $f(a,y_1,\dots,y_k)=0$ for some $y_1,\dots,y_k\in R$. Hilbert's tenth problem over $R$ asks for an algorithm that decides, for every polynomial with integer coefficients, whether it has a zero with coordinates in $R$. Matiyasevich's theorem \cite{Matiyasevich}, completing work of Davis, Putnam and Robinson, makes every recursively enumerable subset of $\Z$ Diophantine in $\Z$, so no such algorithm exists over $\Z$. If $\Z$ is Diophantine in a field $K$ that has a real embedding, then a system of equations over $K$ is equivalent to one equation (a sum of squares), and solvability over $\Z$ reduces to solvability over $K$; so no algorithm exists over $K$ either. For rings of integers the question has a complete answer. Koymans and Pagano proved that $\Z$ is Diophantine in the ring of integers of every number field \cite[Theorem~1.2]{KoymansPagano}, and so did Alpöge, Bhargava, Ho and Shnidman \cite[Theorem~1.1 and Corollary~1.2]{ABHS}. For fields the question is different, because a Diophantine definition of $\Z$ in $K$ has to separate integers from all other elements of $K$, including those whose denominators are divisible only by large primes. For $\Q$, Glazer and collaborators turned OpenAI's proof that Hilbert's tenth problem over $\Q$ has a negative answer \cite{OpenAI} into a Diophantine definition of $\Z$ \cite{Glazer}, and Bhargava and Burungale proved that $\Z$ is Diophantine in $\Q$ \cite[Theorem~A]{BhargavaBurungale}. Our earlier paper \cite{Companion} gives a proof for $\Q$ whose outside inputs are published theorems; here its completeness argument is carried to totally real fields. Sun proved that $\Z$ is Diophantine in $\Q(\sqrt2)$ and in $\Q(\sqrt6)$, with $25$ unknowns, by a construction on an elliptic curve over $\Q(\sqrt3)$ \cite[Theorems~1.2 and~1.4]{Sun}, and in $\Q(\sqrt3)$ \cite[Theorem~1.3]{Sun}. Version~3 of \cite{Sun} (\arXiv{2611.25002v3}, \S13) lowers the count for these three fields to $24$; we follow version~2 and its numbering. We carry that construction to the totally real fields over which that curve, or one of three further curves over $\Q(\sqrt2)$ and $\Q(\sqrt{17})$, has the arithmetic the construction needs. \subsection*{The idea} The construction is Sun's \cite[\S\S1--4, 9, 10, 12, 13]{Sun}: the first index curve, the tube and its seven contacts, the certificate and the order in which its parameters are chosen. It uses the field in two ways. It reads integers off as multiples of one point, so the curve, defined over a real quadratic field $F$, must have rank one over $L=KF$, with the conditions \ref{I2} and \ref{I3} below on torsion and descent. And its soundness rests on a bound for the height of an element of $K$ in a $q$-adic tube in terms of the primes at which it meets seven fixed points of $\mathbf P^1$ to odd order. The rest uses only that $K$ is totally real. We run the construction on Sun's curve over $\Q(\sqrt3)$ and on three further curves $y^2=x^3-Ax$, over $\Q(\sqrt2)$ and $\Q(\sqrt{17})$, as he runs it for $\Q(\sqrt3)$ on the curve \cite[(14.1)]{Sun} over $\Q(\sqrt2)$. The curves differ only in the facts about the curve proved in \cref{sec:curve} and in the prime pattern they need (\cref{thm:pattern,thm:pattern4}). Our main step is the height bound over every totally real field not containing $\sqrt3$ (\cref{thm:height}), and, with a second tube prime, over the fields containing $\sqrt3$ (\cref{thm:height2}). For $\Q(\sqrt3)$ Sun adds a second prime of another kind \cite[(14.8)]{Sun}. We follow Sun's proof over real quadratic fields \cite[\S\S5--8]{Sun}, which carries the method of \cite[\S4]{OpenAI} from $\Q$. A point $z$ of the tube gives an abelian surface with quaternionic multiplication, whose $3$-adic representation, once a sign cocycle is split by a scalar cochain, is shown to be modular and compared with the Jacobian of a Shimura curve of level bounded by a power of the odd-contact primes of $z$. As in his proof, the tube is what makes this work, here over every totally real field not containing $\sqrt3$. On it the residual representation is induced from a character of the CM extension $K\bigl(\sqrt{-g_q(z)}\bigr)$ \cite[Lemmas~8.3 and~8.4]{Sun}, hence modular by automorphic induction, so Gee's lifting theorem \cite{Gee} applies over any totally real $K$. The tube prime also gives a supercuspidal local component, so the comparison can be made on a Shimura curve over $K$ in every degree \cite{Carayol}. The arithmetic of $K$ enters only through the scalar cochain, which we construct with at most $d_2(K)$ auxiliary primes, $d_2(K)$ being the Leopoldt defect of $K$ at $2$ (\cref{prop:cochain}). The scalar cochain over $K$ and the comparison in every degree are what the proof needs beyond Sun's. \subsection*{Results} Let $(F,A)$ be one of the four pairs \[ \bigl(\Q(\sqrt3),(4+\sqrt3)^2\bigr),\quad\bigl(\Q(\sqrt2),(3+6\sqrt2)^2\bigr),\quad\bigl(\Q(\sqrt2),1+2\sqrt2\bigr),\quad\bigl(\Q(\sqrt{17}),\tfrac12(11-7\sqrt{17})\bigr), \] write $F=\Q(\sqrt d)$, so that $d$ is $3$, $2$, $2$ and $17$, and let $E$ be the elliptic curve \begin{equation}\label{eq:E} E\colon y^2=x^3-Ax \end{equation} over $F$. We call $E$ the \emph{first}, \emph{second}, \emph{third} or \emph{fourth index curve}; the first is the curve of Sun's construction \cite[(1.1)]{Sun}. For the first two, $A=a^2$ with $a=4+\sqrt3$, respectively $a=3+6\sqrt2$, and $E[2]\subseteq E(F)$; for the last two, $A$ is not a square in $F$, and $(0,0)$ is the only point of order two in $E(F)$. For a totally real number field $K$ with $\sqrt d\notin K$ put $L=KF$. We consider three conditions: \begin{enumerate}[label=\textup{(I\arabic*)},ref=\textup{(I\arabic*)}] \item\label{I1} $\rank E(L)=1$; \item\label{I2} $E(L)_\tors\subseteq E[2]$; \item\label{I3} $2E(L)\subseteq E(F)$. \end{enumerate} For the first two curves \ref{I2} says that $E(L)_\tors=E[2]$. Condition \ref{I3} follows from \ref{I1} and \ref{I2} when $L/F$ is Galois, in particular when $K/\Q$ is Galois (\cref{lem:I3}). \begin{theorem}\label{thm:main} Let $E$ be one of the index curves, and let $K$ be a totally real number field with $\sqrt d\notin K$, for which \ref{I1}, \ref{I2} and \ref{I3} hold. Then there is a polynomial $\mathbf F\in\Z[X,Y_1,\dots,Y_{25}]$ such that, for every $x\in K$, \[ x\in\Z\iff \mathbf F(x,y_1,\dots,y_{25})=0\text{ for some }y_1,\dots,y_{25}\in K. \] In particular $\Z$ is Diophantine in $K$. \end{theorem} For each $K$ and index curve the polynomial $\mathbf F$ exists, but the proof does not compute it. It depends on the integer $M$ of \ref{F4} (\cref{ssec:fixed}), which is chosen in terms of constants that are only shown to exist, among them the constant $H$ of \cref{thm:height} (of \cref{thm:height2} when $\sqrt3\in K$), which depends on a finite set of parameters with complex multiplication that the proof does not determine. \begin{theorem}\label{thm:fields} \begin{enumerate}[label=\textup{(\alph*)},ref=\textup{(\alph*)}] \item For the first index curve, conditions \ref{I1}, \ref{I2} and \ref{I3} hold for $K=\Q(\sqrt{2m})$ and for $K=\Q(\sqrt{6m})$, where $m\ge1$ is any squarefree integer such that every prime factor $p\ne13$ of $m$ satisfies $p\equiv\pm5\pmod{12}$ and $\bigl(\frac p{13}\bigr)=-1$. \item For the second index curve, they hold for $K=\Q(\sqrt D)$ and for $K=\Q(\sqrt{2D})$, where $D\ne3$ is any positive squarefree integer with $D\equiv\pm3\pmod8$ whose prime factors other than $7$ are all congruent to $3$, $5$, $13$, $19$, $27$ or $45$ modulo $56$. \item For the third index curve, they hold for $K=\Q(\sqrt D)$ and for $K=\Q(\sqrt{2D})$, where $D$ is any positive squarefree integer with $7\mid D$ and $D\equiv\pm1\pmod8$, each of whose prime factors $p\ne7$ is congruent to $3$, $5$, $13$, $19$, $27$ or $45$ modulo $56$, or is congruent to $1$ modulo $8$ with $1+2\sqrt2$ a nonsquare modulo both primes of $\Q(\sqrt2)$ above $p$. \item They hold for the fields $K$ of \cref{tab:fields}, each for the index curve of its row. \end{enumerate} Hence $\Z$ is Diophantine in each of these fields, with $25$ unknowns. \end{theorem} \begin{table}[ht] \caption{The fields of \cref{thm:fields}\textup{(d)}}\label{tab:fields} \begin{tabular}{@{}>{\raggedright\arraybackslash}p{5.4cm} c l l l@{}} \toprule $K$ & $[K:\Q]$ & Curve & $L=KF$ & Proposition\\ \midrule the cyclic cubic fields of conductor $9$, $13$, $19$ and $37$ & $3$ & first & $K(\sqrt3)$ & \ref{prop:five}\\ $\Q(\zeta_{11})^+$ & $5$ & first & $K(\sqrt3)$ & \ref{prop:five}\\ $\Q(\zeta_{16})^+$ & $4$ & first & $\Q(\zeta_{48})^+$ & \ref{prop:five}\\ $\Q\bigl(\sqrt{3(2+\sqrt2)}\bigr)$ & $4$ & first & $\Q(\zeta_{48})^+$ & \ref{prop:twins}\ref{tw:a}\\ $\Q(\zeta_{32})^+$ & $8$ & first & $\Q(\zeta_{96})^+$ & \ref{prop:five}\\ $\Q\bigl(\sqrt{3(2+\sqrt{2+\sqrt2})}\bigr)$ & $8$ & first & $\Q(\zeta_{96})^+$ & \ref{prop:twins}\ref{tw:a}\\ $\Q(\sqrt3)$ & $2$ & second & $\Q(\sqrt2,\sqrt3)$ & \ref{prop:Q3}\\ $\Q(\sqrt D)$, for $77$ integers $D\le10500$ & $2$ & third & $\Q(\sqrt2,\sqrt D)$ & \ref{prop:seventyseven}\\ $\Q(\sqrt{2D})$, for the same $D$ & $2$ & third & $\Q(\sqrt2,\sqrt D)$ & \ref{prop:twins}\ref{tw:c}\\ $\Q(\sqrt2,\sqrt3)$, $\Q(\sqrt2,\sqrt{51})$, $\Q(\sqrt3,\sqrt{34})$, $\Q(\sqrt6,\sqrt{34})$ & $4$ & fourth & $\Q(\sqrt2,\sqrt3,\sqrt{17})$ & \ref{prop:biquad}\\ \bottomrule \end{tabular} \end{table} In \textup{(a)}, $m=1$ gives $\Q(\sqrt2)$ and $\Q(\sqrt6)$, in which $\Z$ is Diophantine by \cite[Theorems~1.2 and~1.4]{Sun}, and \cref{cor:Q6} records this case with explicit tube primes. For $m=13$ the fields are $\Q(\sqrt{26})$ and $\Q(\sqrt{78})$. The primes $p\ne13$ allowed in $m$ are those inert in both $\Q(\sqrt3)$ and $\Q(\sqrt{13})$, a set of primes of density $1/4$. The five least $D$ of \textup{(b)} are $5$, $13$, $19$, $21$ and $35$, and the seven least of \textup{(c)} are $7$, $105$, $273$, $399$, $455$, $665$ and $791=7\cdot113$. A prime $p\ne3$ congruent to $3$, $5$, $13$, $19$, $27$ or $45$ modulo $56$ is one of the $D$ of \textup{(b)}, and $21p$ is one of those of \textup{(c)}, so both sets are infinite, by Dirichlet's theorem. Some fields $\Q(\sqrt{2D})$ of \textup{(b)} are also in \textup{(a)}, such as $\Q(\sqrt{10})$ and $\Q(\sqrt{26})$. Infinitely many are not, the least being $\Q(\sqrt{118})$ (\cref{ssec:thirtytwo}). Three fields of \cref{tab:fields} contain $\sqrt3$: $\Q(\sqrt3)$, in which $\Z$ is Diophantine by \cite[Theorem~1.3]{Sun}, $\Q(\sqrt2,\sqrt3)$ and $\Q(\sqrt3,\sqrt{34})$. \Cref{thm:main} covers them through \cref{sec:sqrt3}. \Cref{tab:fields} lists the single fields for which the descents of \cref{ssec:fields} close. The cyclic cubic fields of conductor below $50$ have conductors $7$, $9$, $13$, $19$, $31$, $37$ and $43$. For $9$, $13$, $19$ and $37$ the $2$-Selmer group of $E$ over $L$ has dimension $3$ and is spanned by the images of $E[2]$ and of Sun's point $P_0$ (\cref{prop:sun14}), so $\rank E(L)=1$. For $7$, $31$ and $43$ it has dimension $5$, and a $2$-descent does not decide the rank. Deciding it would need a further step, such as a search for points or the Cassels--Tate pairing on the Selmer group. In \textup{(b)} and \textup{(c)} the conditions on $D$ are ones under which the $2$-isogeny descents of the twists show rank $0$. \begin{theorem}\label{thm:tower} For $k\ge2$ let $K_{2^k}=\Q(\zeta_{2^k})^+$, and for $k\ge3$ let $K'_{2^k}=\Q\bigl(\sqrt3\,(\zeta_{2^k}+\zeta_{2^k}^{-1})\bigr)$. These fields are totally real and cyclic of degree $2^{k-2}$ over $\Q$, and $\sqrt3$ lies in none of them. For the first index curve, conditions \ref{I1}, \ref{I2} and \ref{I3} hold for $K=K_{2^k}$ for every $k\ge2$ and for $K=K'_{2^k}$ for every $k\ge3$. Hence $\Z$ is Diophantine in each of these fields, with $25$ unknowns. \end{theorem} The fields $K_{2^k}$ are the layers of the cyclotomic $\Z_2$-extension of $\Q$, and the fields $L_{2^k}=K_{2^k}F=\Q(\zeta_{3\cdot2^k})^+$ those of the cyclotomic $\Z_2$-extension of $F$; so $E$ has rank one over every layer of the latter. For $k=2$ and $k=3$ the fields are $\Q$, $\Q(\sqrt2)$ and $K'_8=\Q(\sqrt6)$, in which $\Z$ is already known to be Diophantine (\cref{rem:scope,cor:Q6}); for $k=4,5$ they are $\Q(\zeta_{16})^+$, $\Q(\zeta_{32})^+$ and the two cyclic fields of degrees $4$ and $8$ of \cref{tab:fields}. \Cref{sec:tower} proves that the rank does not grow from $L_{2^{k-1}}$ to $L_{2^k}$ when $k\ge5$, with the relative Selmer groups of Mazur and Rubin \cite{MazurRubinDS} and a computation at the prime above $2$. \needspace{4\baselineskip} \begin{corollary}\label{cor:htp} For each field $K$ of \cref{thm:fields,thm:tower}, there is no algorithm that decides, for an arbitrary polynomial $f\in\Z[X_1,\dots,X_k]$, whether $f$ has a zero in $K^k$. \end{corollary} \begin{proof} By \cref{thm:fields,thm:tower,thm:main}, $\Z$ is Diophantine in $K$; as $K$ has a real embedding, the reduction recalled at the start of this introduction gives the corollary. \end{proof} \needspace{4\baselineskip} \begin{remark}\label{rem:scope} \Cref{thm:main} also applies to $K=\Q$, where $L=F$ and the three conditions are \cref{prop:sun14} for the first curve, \cref{prop:second} for the second and \cref{prop:third,prop:fourth} for the third and fourth; this case recovers the theorem that $\Z$ is Diophantine in $\Q$, and it is the case $k=2$ of \cref{thm:tower}. For this case \cite{Companion} gives a direct proof. \Cref{thm:main} does not apply, with a given curve, to fields that contain its field $F$, for which $L=K$; so no index curve applies to a field that contains $\sqrt2$, $\sqrt3$ and $\sqrt{17}$. For fields that contain $\sqrt3$ the tube of \cref{sec:height} needs a second prime, which \cref{sec:sqrt3} adds. \end{remark} \subsection*{The height bound} The height bound behind \cref{thm:main} holds over every totally real field not containing $\sqrt3$, and we state it in that generality; over fields containing $\sqrt3$ it holds on a smaller tube (\cref{thm:height2}). Let $K$ be a totally real number field of degree $n_K$, and let $h$ be the absolute logarithmic Weil height. For a prime $q\ge7$, \cref{ssec:heightdata} defines, following Sun \cite[(1.3)--(1.7)]{Sun}, a polynomial $g_q\in\Q[z]$ of degree $4$ and a set $\mathcal C_q\subset\mathbf P^1(\Q)$ consisting of $\infty$ and six finite \emph{contacts} $\gamma_1,\dots,\gamma_6$. For a prime $\mathfrak P$ of $K$ and $z\in K\setminus\mathcal C_q$ we say that $z$ has \emph{positive odd contact} with $\gamma_i$ at $\mathfrak P$ if $v_{\mathfrak P}(z-\gamma_i)$ is positive and odd, and with $\infty$ if $v_{\mathfrak P}(1/z)$ is positive and odd. Let $\Sigma$ be a finite set of primes of $K$ containing every prime above a rational prime $p\le324$ (as in \cite[\S1]{Sun}), every prime above $q$, and every prime at which a nonzero finite contact, or the difference of two distinct finite contacts, has nonzero valuation. For $z\in K\setminus\mathcal C_q$ put \[ \mathfrak N_\Sigma(z)=\prod_{\mathfrak P}N\mathfrak P, \] the product over the primes $\mathfrak P\notin\Sigma$ at which $z$ has positive odd contact with a point of $\mathcal C_q$ (an empty product is $1$). For a prime $\mathfrak q$ of $K$ above $q$, the \emph{positive tube} is \[ \mathcal D=\bigl\{z\in K:\ v_{\mathfrak q}(z-1)\ge1\ \text{and}\ g_q(z)\ \text{is totally positive}\bigr\}. \] \needspace{4\baselineskip} \begin{theorem}\label{thm:height} Let $q\equiv7\pmod{12}$ be a prime, let $\mathfrak q$ be a prime of $K$ above $q$ that is unramified over $q$ and has odd residue degree, and let $\Sigma$, $\mathfrak N_\Sigma$ and $\mathcal D$ be as above. Then $\mathcal D\cap\mathcal C_q=\emptyset$, and there are constants $H>0$ and $\kappa>0$ such that \[ h(z)\le H\,\mathfrak N_\Sigma(z)^{\kappa}\qquad\text{for every }z\in\mathcal D. \] \end{theorem} For $K=\Q(\sqrt2)$ and $q=367$ this is the height bound of \cite[Theorem~1.7]{Sun} on the positive tube, and for $K=\Q(\sqrt6)$ and $q=331$ that of \cite[Lemma~15.4]{Sun}. Primes $q$ and $\mathfrak q$ as in the theorem exist when $\sqrt3\notin K$, by \cref{lem:tubeprime}, and only then: a prime $q\equiv7\pmod{12}$ is inert in $\Q(\sqrt3)$, so if $\sqrt3\in K$ every prime of $K$ above $q$ has even residue degree. When $\sqrt3\in K$ we add a second prime to the tube (\cref{sec:sqrt3}). \subsection*{The proof in outline} Let $K$ be as in \cref{thm:main}, for one of the index curves. By \ref{I1}--\ref{I3}, $2E(L)$ is infinite cyclic, generated by a point $P\in E(F)$ (\cref{lem:carrier}), so the points of $2E(L)$ are the multiples $[n]P$ with $n\in\Z$; this is how the definition quantifies over integers. For $x\in K$ put $\beta=3+\delta(x^3+x)$ with $\delta=\pm1$; since $K$ is totally real, $\beta\in\Z$ forces $x\in\Z$ (\cref{lem:rigid}). \begin{enumerate}[label=\textup{(\arabic*)}] \item \emph{The certificate} (\cref{sec:certificate}). The definition asks for nine points of $2E(L)$, each given by the coordinates of a point of $E(L)$ that doubles to it, and for two elements $B_0,B_1$ of $K$ built from them and from $\beta$. It requires that neither $B_0$ nor $B_1$ has a pole of odd order outside a fixed finite set of primes, a condition enforced by a predicate on congruent-number twists (\cref{sec:pole}). \item \emph{Local tests} (\cref{sec:local}). At a prime where an auxiliary parameter has positive odd contact with a point of $\mathcal C_q$, the element $B_j$ has a pole of odd order unless a list of local tests holds there. Through the formal logarithm of $E$, as in Poonen's reading of indices from coordinates \cite{PoonenRankOne}, the tests say that $\beta$ is congruent to an index $n_1$ to high order and that an integer built from the indices is divisible to high order. \item \emph{Soundness} (\cref{sec:soundness}). \Cref{thm:height} (\cref{thm:height2} when $\sqrt3\in K$) bounds the height of the parameter by a power of the product of its odd-contact primes, and a theorem of von Buhren bounds the indices by heights (\cref{lem:aggregate}). The two bounds are incompatible with a solution unless $\beta=n_1$, which is an integer. \item \emph{Completeness} (\cref{sec:completeness}). For $x\in\Z$ the indices are chosen by the Chinese remainder theorem, with primes in a quadratic pattern (\cref{thm:pattern,thm:pattern4}). Then all the points lie in $E(F)$, $B_0$ and $B_1$ are rational, and the predicate holds by \cite[Theorem~1.2]{Companion} (\cref{lem:PQ}). \end{enumerate} \subsection*{Earlier work} Denef proved that $\Z$ is Diophantine in the ring of integers of every totally real number field \cite{Denef}, and Denef and Lipshitz extended this to quadratic extensions of totally real fields \cite{DenefLipshitz}. Denef suggested elliptic curves of rank one in place of Pell's equation \cite{Denef}. Poonen proved that if $F\subseteq K$ are number fields and an elliptic curve over $F$ has rank one over both $F$ and $K$, then the ring of integers of $F$ is Diophantine over that of $K$ \cite{PoonenRankOne}, and Cornelissen, Pheidas and Zahidi gave a related criterion \cite{CPZ}; see Shlapentokh's book \cite{Shlapentokh} for the earlier theory. Mazur and Rubin deduced from this approach, assuming finiteness of Shafarevich--Tate groups, that Hilbert's tenth problem has a negative answer over the ring of integers of every number field \cite{MazurRubin}. Zywina proved that for every quadratic extension $L/K$ of number fields there are infinitely many elliptic curves $E/K$ with $\rank E(K)=\rank E(L)=1$ \cite[Theorem~1.2]{Zywina}. For fields, Robinson defined $\Z$ in $\Q$ by a first-order formula \cite{Robinson}, Poonen by a $\forall\exists$-formula \cite{Poonen}, and Koenigsmann by a universal one \cite{Koenigsmann}; Park defined the ring of integers of every number field by a universal formula \cite{Park}. Over $\Q$ the approach through rank-one curves and local divisibility conditions goes back to Pheidas \cite{Pheidas}, whose work anticipates the predicate excluding poles of odd order \cite[\S1]{Glazer}, \cite[\S1.2]{KPV}; OpenAI's proof follows that strategy. Kozachinskiy, Pasten and Vidaux proved that $\Z$ is Diophantine in $\Q$ if Shafarevich--Tate groups of elliptic curves over $\Q$ have finite $2$-primary part and the $abc$ conjecture and Dickson's conjecture hold \cite[Theorem~1.1]{KPV}. Over other fields, Pasten and Vidaux proved that $\Z$ is Diophantine in a number field $K$ if the $abc$ conjecture holds over $K$ and some elliptic curve over $\Q$ has $0<\rank E(\Q)=\rank E(K)$ \cite[Theorem~1.1]{PastenVidaux}, and that this holds for every quadratic field if the $abc$ conjecture holds over it \cite[Corollary~1.2]{PastenVidaux}. \subsection*{Plan} \Cref{sec:curve} proves what the construction needs about the four index curves, with the facts special to the second in \cref{ssec:second} and to the third and fourth in \cref{ssec:quartic}. Sections~\ref{sec:local}--\ref{sec:proofmain} read the curve only through \ref{E1}--\ref{E3}, \cref{lem:orders,lem:aggregate} and the prime patterns of \cref{thm:pattern,thm:pattern4}. \Cref{sec:height} proves \cref{thm:height} and does not use the index curves. The scalar cochain it needs is constructed in \cref{app:cochain}. \Cref{sec:pattern} proves the prime patterns, with two steps in \cref{app:twosteps}, and \cref{sec:pole} the properties of the pole predicate. \Cref{sec:local} collects the local lemmas, \cref{sec:certificate} writes the certificate, and \cref{sec:soundness,sec:completeness} prove that it holds at $x\in K$ exactly when $x\in\Z$. \Cref{sec:sqrt3} adds a second tube prime for fields containing $\sqrt3$, and \cref{sec:proofmain} deduces \cref{thm:main}, with the count of unknowns in \cref{sec:count}. \Cref{ssec:fields} proves \cref{thm:fields}, from \cref{sec:curve} and $2$-isogeny descents over $F$ for the quadratic and biquadratic fields, and by a complete $2$-descent over $L$ for the others. There \cref{lem:sameL} carries the conditions to the fields with the same $L$. \Cref{sec:tower} proves \cref{thm:tower}. \subsection*{Computations} The proofs use exact computations, in PARI/GP \cite{PARI} and in Python with SymPy: the $2$-descents of \cref{sec:curve,ssec:fields}, the identities in $q$ and $q'$ of \cref{sec:height,sec:sqrt3}, and a few point counts, discriminants and congruences. The programs are in the deposit \cite{Record}, whose README matches each statement to its program. \section{The index curves}\label{sec:curve} \subsection{What the proof uses}\label{ssec:uses} Let $\sigma$ be the nontrivial automorphism of $F$, $\bar A=\sigma(A)$, and $E^\sigma\colon y^2=x^3-\bar Ax$ the conjugate curve; for the first two curves $\bar a=\sigma(a)$, so $\bar A=\bar a^2$. Let $\mathcal P$ be the set of rational primes dividing $2d\Nm_{F/\Q}(A)$. For the four curves $\Nm_{F/\Q}(A)$ is $13^2$, $63^2$, $-7$ and $-178=-2\cdot89$, and $\mathcal P$ is $\{2,3,13\}$, $\{2,3,7\}$, $\{2,7\}$ and $\{2,17,89\}$; every prime of $\mathcal P$ is at most $89$. The following properties of $F$, $E$ and $L$ are proved in this section for each curve; the facts special to the second curve are in \cref{ssec:second}, and those special to the third and fourth in \cref{ssec:quartic}. \begin{enumerate}[label=\textup{(E\arabic*)},ref=\textup{(E\arabic*)}] \item\label{E1} $F$ is a real quadratic field and $\sqrt d\notin K$, so $L=KF$ is totally real, $[L:K]=2$ with basis $1,\sqrt d$, and the nontrivial element $\tau$ of $\Gal(L/K)$ restricts to $\sigma$ on $F$; hence $\Tr_{L/K}(u)=\Tr_{F/\Q}(u)$ for $u\in F$. \item\label{E2} $(0,0)\in E(F)$, and $E[2]\subseteq E(F)$ for the first two curves; the discriminant of \eqref{eq:E} is $64A^3$, so $E$ and $E^\sigma$ have good reduction at every prime of $F$ not above a prime of $\mathcal P$; and \eqref{eq:E} is minimal at every prime of $F$ (\cref{ssec:descent} for the first curve, \cref{lem:minimal2} for the second, \cref{lem:minimal34} for the third and fourth). \item\label{E3} Under \ref{I1}--\ref{I3}, $2E(L)=\Z P$ for a point $P\in E(F)$ of infinite order, and $x([n]P)$ is totally positive for $n\ne0$ (\cref{lem:carrier}). \end{enumerate} \subsection{Descent over \texorpdfstring{$F$}{F}}\label{ssec:descent} For the first curve write $\cO_F=\Z[\sqrt3]$, $\varepsilon=2+\sqrt3$ and $\lambda=1+\sqrt3$; then $\bar a=4-\sqrt3$, $\lambda^2=2\varepsilon$, $a\bar a=13$ and $\varepsilon a=11+6\sqrt3$. The ring $\cO_F$ is a principal ideal domain (the Minkowski bound is $\sqrt3<2$), and $\cO_F^\times=\{\pm\varepsilon^k\}$, since $u^2-3v^2=-1$ has no solution modulo $3$ and $(2,1)$ is the least solution of $u^2-3v^2=1$. The prime $2$ ramifies, $2\cO_F=(\lambda)^2$, and $\sq2=\sq\varepsilon$ in $F^\times/F^{\times2}$. The prime $13$ splits; $\mathfrak a=(a)$ is a prime of norm $13$, and $F_{\mathfrak a}=\Q_{13}$ with $\sqrt3\mapsto-4$, so that $\varepsilon\equiv-2\equiv11\pmod{\mathfrak a}$. Modulo $13$ we take $\iota\equiv5$, a square root of $-1$; then $2\iota\equiv10\equiv6^2$ is a square, and $2$ and $\varepsilon\equiv11$ are not. A prime $p\ge5$ is inert in $F$ exactly when $p\equiv\pm5\pmod{12}$. The equation \eqref{eq:E} is minimal at every prime of $F$: it has good reduction outside $2$ and $13$; its discriminant $64a^6$ has valuation $6$ at $\mathfrak a$ and $0$ at $\sigma\mathfrak a=(\bar a)$, the two primes above $13$; and at the prime above $2$, where it has valuation $12$, no change of variables makes it more integral (a finite search modulo $8$). For the second curve $\varepsilon=1+\sqrt2$ and $\lambda=\sqrt2$, and the corresponding facts are in \cref{ssec:second}. For the first two curves $\cO_F$ is a principal ideal domain, $\cO_F^\times=\{\pm\varepsilon^k\}$, and $2\cO_F=(\lambda)^2$ with $v_\lambda(2)=2$. For $c\in F^\times$ and an extension $M$ of $F$ let \[ E_c\colon y^2=x^3-c^2x,\qquad E'_c\colon y^2=x^3+4c^2x,\qquad \phi_c(x,y)=\Bigl(\frac{y^2}{x^2},\frac{y(-c^2-x^2)}{x^2}\Bigr), \] so $E=E_a$ for the first two curves, and $\phi_c\colon E_c\to E'_c$ is the $2$-isogeny with kernel $\{O,(0,0)\}$ \cite[Example~III.4.5]{Silverman}; let $\hat\phi_c$ be its dual. By \cite[Proposition~X.4.9]{Silverman} there are injective homomorphisms \[ \alpha'_c\colon E'_c(M)/\phi_c(E_c(M))\to M^\times/M^{\times2},\qquad \alpha_c\colon E_c(M)/\hat\phi_c(E'_c(M))\to M^\times/M^{\times2}, \] given by $(x,y)\mapsto\sq x$ for $x\ne0$, with $\alpha'_c(0,0)=\sq{4c^2}=1$ and $\alpha_c(0,0)=\sq{-c^2}=\sq{-1}$ (the second map is the first one for $E'_c$, composed with the isomorphism $(x,y)\mapsto(4x,8y)$ of $E_c$ onto $y^2=x^3-16c^2x$). A class $e$ lies in the image of $\alpha'_c$, respectively $\alpha_c$, exactly when \begin{equation}\label{eq:quartics} W^2=eU^4+\frac{4c^2}{e}V^4,\qquad\text{respectively}\qquad W^2=eU^4-\frac{c^2}{e}V^4, \end{equation} has a solution over $M$ with $(U,V)\ne(0,0)$ \cite[Proposition~X.4.9]{Silverman}. We write $\Imm\alpha_{c,v}$, $\Imm\alpha'_{c,v}$ for the images over a completion $M=F_v$. \begin{lemma}\label{lem:rankformula} Let $M$ be a field of characteristic zero containing $F$, and $c\in F^\times$. Then \[ |E_c(M)/2E_c(M)|=|\Imm\alpha_c|\cdot|\Imm\alpha'_c|. \] In particular, if $M$ is a number field, $2^{\rank E_c(M)}=|\Imm\alpha_c|\cdot|\Imm\alpha'_c|/4$. \end{lemma} \begin{proof} Since $\hat\phi_c\circ\phi_c=[2]$, the sequence \[ 0\to\frac{E'_c(M)[\hat\phi_c]}{\phi_c(E_c(M)[2])}\to\frac{E'_c(M)}{\phi_c(E_c(M))}\xrightarrow{\hat\phi_c}\frac{E_c(M)}{2E_c(M)}\to\frac{E_c(M)}{\hat\phi_c(E'_c(M))}\to0 \] is exact: a point $R$ maps to zero exactly when $\hat\phi_c(R)=\hat\phi_c(\phi_c(Q))$ for some $Q$, that is $R\in\phi_c(E_c(M))+E'_c(M)[\hat\phi_c]$. The first term vanishes, because $\phi_c(c,0)=(0,0)$ and $E'_c[\hat\phi_c]=\phi_c(E_c[2])=\{O,(0,0)\}$. The maps $\alpha_c,\alpha'_c$ are injective, which gives the first formula. Over a number field $E_c(M)[2]=E_c[2]$ has order $4$, so $|E_c(M)/2E_c(M)|=2^{\rank E_c(M)+2}$. \end{proof} \needspace{4\baselineskip} \begin{lemma}[Support]\label{lem:support} Let $c\in F^\times$ and let $v$ be a finite prime of $F$ with either $v\nmid2$ and $v(c)$ even, or $v=(\lambda)$ and $v_\lambda(c)\in\{0,2\}$. Then every class in $\Imm\alpha_{c}$ and in $\Imm\alpha'_{c}$, over $F$ or over $F_v$, has even valuation at $v$. \end{lemma} \begin{proof} For a point $(x,y)$ with $x\ne0$ on $y^2=x(x^2+b)$ with $b\in\{-c^2,4c^2\}$, the valuation $v(b)$ is divisible by $4$ ($2v(c)$ if $v\nmid2$; $0$, $4$ or $8$ at $\lambda$, as $v_\lambda(2)=2$). If $v(x)$ were odd, then $2v(x)\ne v(b)$, so $v(x^2+b)=\min(2v(x),v(b))$ is even and $v(y^2)=v(x)+v(x^2+b)$ would be odd. The torsion classes $1$ and $\sq{-c^2}$ have even valuation. \end{proof} Since $\cO_F$ is a principal ideal domain with units $\pm\varepsilon^{\Z}$, \cref{lem:support} places $\Imm\alpha_c$ and $\Imm\alpha'_c$ in the subgroup of $F^\times/F^{\times2}$ generated by $-1$, $\varepsilon$ and generators of the odd primes dividing $c$ to an odd power, whenever $v_\lambda(c)\in\{0,2\}$. \needspace{4\baselineskip} \begin{lemma}[Odd additive places]\label{lem:oddplace} Let $v$ be a prime of $F$ not above $2$ such that $v(c)$ is odd. If $-1$ is a square in $F_v$, say $\iota^2=-1$, then $\Imm\alpha_{c,v}=\langle\sq c\rangle$ and $\Imm\alpha'_{c,v}=\langle\sq{2\iota c}\rangle$ in $F_v^\times/F_v^{\times2}$. If $-1$ is not a square in $F_v$, then $\Imm\alpha_{c,v}=F_v^\times/F_v^{\times2}$ and $\Imm\alpha'_{c,v}=\{1\}$. \end{lemma} \begin{proof} If $T=(e_1,0)$ is a point of order two on $y^2=(x-e_1)(x-e_2)(x-e_3)$ and $T=2R$ with $R=(x_0,y_0)$ over a field of characteristic not $2$, then $y_0\ne0$, the tangent line $y=\mu(x-x_0)+y_0$ at $R$ meets the curve again at $-2R=T$, so $(x-e_1)(x-e_2)(x-e_3)-(\mu(x-x_0)+y_0)^2=(x-x_0)^2(x-e_1)$, and evaluating at $x=e_2\ne x_0$ shows that $e_1-e_2=\bigl((\mu(e_2-x_0)+y_0)/(e_2-x_0)\bigr)^2$ is a square; likewise $e_1-e_3$. The roots are $0,\pm c$ for $E_c$ and $0,\pm2\iota c$ for $E'_c$, all in $F_v$; the differences $e_1-e_2$ for the three choices of $e_1$ are $\{-c,c\}$ (for $e_1=0$), $\{c,2c\}$, $\{-c,-2c\}$ on $E_c$ and $\{\mp2\iota c\}$, $\{2\iota c,4\iota c\}$, $\{-2\iota c,-4\iota c\}$ on $E'_c$, all of odd valuation. So no point of order two lies in $2E_c(F_v)$ or $2E'_c(F_v)$, and $E_c(F_v)[2]$ injects into $E_c(F_v)/2E_c(F_v)$. For an abelian group $G$ with $G/2G$ and $G[2]$ finite put $\chi(G)=|G/2G|/|G[2]|$; it is multiplicative in short exact sequences and equals $1$ on finite groups. The group $E_c(F_v)$ has a subgroup of finite index isomorphic to the additive group of the ring of integers of $F_v$ \cite[Proposition~VII.6.3]{Silverman}, which is uniquely $2$-divisible, so $\chi(E_c(F_v))=1$ and $|E_c(F_v)/2E_c(F_v)|=4$. Hence $E_c(F_v)/2E_c(F_v)$ is the image of $E_c[2]$, and $\Imm\alpha_{c,v}=\alpha_c(E_c[2])=\{1,\sq{-c^2},\sq c,\sq{-c}\}=\langle\sq c\rangle$ since $-1$ is a square. The same argument for $E'_c$ gives $\Imm\alpha'_{c,v}=\{1,\sq{4c^2},\sq{2\iota c},\sq{-2\iota c}\}=\langle\sq{2\iota c}\rangle$. If $-1$ is not a square in $F_v$, the computation of $\chi$ still gives $|E_c(F_v)/2E_c(F_v)|=4$, so $|\Imm\alpha_{c,v}|\cdot|\Imm\alpha'_{c,v}|=4$ by \cref{lem:rankformula}; and $\Imm\alpha_{c,v}$ contains $\alpha_c(E_c[2])=\{1,\sq{-c^2},\sq c,\sq{-c}\}=\langle\sq{-1},\sq c\rangle$, which is all of $F_v^\times/F_v^{\times2}$, since $\sq{-1}$ is the nontrivial unit class and $\sq c$ has odd valuation. Hence $\Imm\alpha'_{c,v}=\{1\}$. \end{proof} \subsection{The conditions over \texorpdfstring{$F$}{F}}\label{ssec:conditions} \Cref{lem:torsion,prop:sun14} are about the first curve; the corresponding facts for the second are \cref{lem:torsion2,prop:second}, and for the third and fourth \cref{lem:torsion34,prop:third,prop:fourth}. \begin{lemma}\label{lem:torsion} Let $E$ be the first index curve, and let $L\supseteq F$ be a totally real number field. \begin{enumerate}[label=\textup{(\alph*)},ref=\textup{(\alph*)}] \item\label{to:a} If every element of $F\cap L^{\times2}$ has its norm to $\Q$ in $\Q^{\times2}$, then $E(L)$ has no point of order four and none of order three. \item\label{to:b} Let $p\equiv3\pmod4$ be a prime that splits in $F$, and let $\mathfrak P$ be a prime of $L$ above $p$, with residue field $\FF_{p^k}$. Then $E$ has good reduction at $\mathfrak P$, the reduction has $N_k(p)=p^k+1-(i\sqrt p)^k-(-i\sqrt p)^k$ points over $\FF_{p^k}$, and $E(L)[\ell]$ injects into it for every prime $\ell\ne p$. \item\label{to:c} Suppose that $L$ is as in \ref{to:a} and has primes as in \ref{to:b} above two primes $p_1\ne p_2$, with residue fields $\FF_{p_1^{k_1}}$ and $\FF_{p_2^{k_2}}$, such that no prime $\ell\ge5$ divides both $p_1N_{k_1}(p_1)$ and $p_2N_{k_2}(p_2)$. Then $E(L)_\tors=E[2]$. \item\label{to:d} If $L$ is as in \ref{to:a} and $[L:F]\le2$, then $E(L)_\tors=E[2]$. In particular $E(F)_\tors=E[2]$. \end{enumerate} \end{lemma} \begin{proof} \ref{to:a} By the first paragraph of the proof of \cref{lem:oddplace}, a point $T=(e_1,0)$ of $E$ is in $2E(L)$ only if $e_1-e_2$ and $e_1-e_3$ are squares in $L$. For $T=(0,0)$ this needs $-a$ and $a$ to be squares, so $-1$ would be a square in the real field $L$. For $T=(-a,0)$ it needs $-a$ to be a square, but $-a<0$ at every real place. For $T=(a,0)$ it needs $a$ to be a square in $L$, which the hypothesis excludes, as $\Nm_{F/\Q}(a)=13$. As $E[2]\subseteq E(F)$, $E(L)$ has no point of order four. A point $R=(x,y)$ with $y\ne0$ on $E$ has order three exactly when $x(2R)=x(R)$, that is $3x^4-6a^2x^2-a^4=0$. So $x^2=a^2r$ with $r=1\pm\frac23\sqrt3\in F$. If $x\in L$, then $r=(x/a)^2\in F\cap L^{\times2}$, which the hypothesis excludes, as $\Nm_{F/\Q}(r)=-\frac13$. \ref{to:b} As $p\equiv3\pmod4$ and $p$ splits in $F$, $p$ is not $2$, $3$ or $13$, so $E$ has good reduction at $\mathfrak P$ by \ref{E2}. At the prime of $F$ below $\mathfrak P$ the reduction is $y^2=x^3-s^2x$ over $\FF_p$ with $s\ne0$, which has $p+1$ points, as $-1$ is not a square modulo $p$. So its Frobenius has trace $0$ and eigenvalues $\pm i\sqrt p$, which gives the count over $\FF_{p^k}$. The injection is \cite[Proposition~VII.3.1(b)]{Silverman}, over the completion of $L$ at $\mathfrak P$. \ref{to:c} By \ref{to:a}, the $2$-primary part of $E(L)_\tors$ is $E[2]$, and $E(L)[3]=0$. If $E(L)[\ell]\ne0$ for a prime $\ell\ge5$, then by \ref{to:b} $\ell$ divides $N_{k_j}(p_j)$ when $\ell\ne p_j$, so it divides $p_jN_{k_j}(p_j)$ for $j=1,2$, which is excluded. \ref{to:d} The primes $11$ and $23$ are congruent to $3$ modulo $4$ and split in $F$, as $3\equiv5^2\pmod{11}$ and $3\equiv7^2\pmod{23}$. As $[L:F]\le2$, primes of $L$ above them have residue degree $1$ or $2$, and $N_1(p)=p+1$, $N_2(p)=(p+1)^2$. So the prime factors of $11N_{k_1}(11)$ are among $2$, $3$ and $11$, those of $23N_{k_2}(23)$ among $2$, $3$ and $23$, and \ref{to:c} applies. \end{proof} \begin{lemma}\label{lem:cmtors} Let $E$ be one of the index curves, let $L\supseteq F$ be a totally real number field, and let $\ell$ be an odd prime. If $E(L)[\ell]\ne0$, then $L(i)$ contains a root of unity of order $\ell$. \end{lemma} \begin{proof} The curve $E$ has complex multiplication by $\Z[i]$, with $[i](x,y)=(-x,iy)$ defined over $F(i)$. Let $P\in E(L)$ have order $\ell$, and let $c$ be complex conjugation, acting on $E(\overline\Q)\subseteq E(\C)$; it fixes $P$, as $L$ is totally real, and $c([\alpha]Q)=[\bar\alpha]c(Q)$ for $\alpha\in\Z[i]$. So the annihilator of $P$ in $\Z[i]$ is a proper ideal containing $\ell$ and stable under conjugation. As $\ell$ is odd, the primes of $\Z[i]$ above $\ell$ are $\ell\Z[i]$ or two conjugate primes, so this annihilator is $\ell\Z[i]$, and $\Z[i]P$, of order $\ell^2$, is $E[\ell]$. Every element of $\Gal(\overline\Q/L(i))$ fixes $i$ and $P$, hence commutes with $[i]$ and fixes $\Z[i]P=E[\ell]$. By the Galois equivariance of the Weil pairing \cite[\S III.8]{Silverman}, $L(i)$ contains a root of unity of order $\ell$. \end{proof} \needspace{4\baselineskip} \begin{proposition}[{Sun \cite[Theorem~1.6 and Lemma~2.2]{Sun}}]\label{prop:sun14} $\rank E(F)=1$ and $E(F)_\tors=E[2]$; the point \[ P_0=(244+139\sqrt3,\ 5334+3082\sqrt3) \] lies in $E(F)$ and has infinite order. \end{proposition} \begin{proof} Direct expansion shows $P_0\in E(F)$. The only odd prime dividing $a$ is $\mathfrak a$, and $v_\lambda(a)=0$, so by \cref{lem:support} both images for $c=a$ lie in $\langle-1,\varepsilon,a\rangle$. \Cref{lem:oddplace} at $\mathfrak a$ (where $-1$ and $2\iota$ are squares) gives $\Imm\alpha_{a,\mathfrak a}=\Imm\alpha'_{a,\mathfrak a}=\langle\sq a\rangle$. A class $(-1)^h\varepsilon^ia^j$ has coordinates $(j,i)$ at $\mathfrak a$ and $\sq a$ has $(1,0)$, so both images lie in $\langle-1,a\rangle$; the image of $\alpha'_a$ is totally positive, so it lies in $\{1,\sq a\}$. By \cref{lem:rankformula}, $2^{\rank E(F)}\le4\cdot2/4=2$, so $\rank E(F)\le1$. By \cref{lem:torsion}\ref{to:d}, $E(F)_\tors=E[2]$. The point $P_0$ has $y(P_0)\ne0$, so it is not $2$-torsion and has infinite order; $\rank E(F)=1$. \end{proof} \begin{lemma}\label{lem:I3} Let $K$ be totally real with $\sqrt d\notin K$ and $L=KF$, and suppose \ref{I1} and \ref{I2}. If $L/F$ is Galois, in particular if $K/\Q$ is Galois, then \ref{I3} holds. \end{lemma} \begin{proof} By \ref{I1}, $E(L)/E(L)_\tors\cong\Z$, and $\Gal(L/F)$ acts on it through a character with values $\pm1$. A point of $E(F)$ of infinite order (\cref{prop:sun14,prop:second,prop:third,prop:fourth} for the four curves) is fixed, so the character is trivial: $g(Q)-Q\in E(L)_\tors$ for every $g\in\Gal(L/F)$ and $Q\in E(L)$, and $E(L)_\tors\subseteq E[2]$ by \ref{I2}. Then $g(2Q)=2Q$, so $2Q\in E(L)^{\Gal(L/F)}=E(F)$. If $K/\Q$ is Galois, so is $KF/F$. \end{proof} \begin{lemma}\label{lem:carrier} Assume \ref{I1}--\ref{I3}. Then $2E(L)=\Z P$ for a point $P\in E(F)$ of infinite order, unique up to sign; and for every integer $n\ne0$ the point $[n]P$ is $2R$ for some $R\in E(L)$, and $x([n]P)\in F$ is positive at both real embeddings of $F$. \end{lemma} \begin{proof} Compare \cite[Lemma~2.6]{Sun}, where $L$ is biquadratic. By \ref{I2}, $2E(L)$ is torsion-free, and by \ref{I1} it has rank one; so it is infinite cyclic, generated by some $P$, which lies in $E(F)$ by \ref{I3}. Then $[n]P=2[n]R_1$ where $2R_1=P$. For $R=(x_R,y_R)$ with $2R\ne O$ the duplication formula gives $x(2R)=\bigl((x_R^2+A)/(2y_R)\bigr)^2$, a nonzero square in the totally real field $L$ (it is not $0$, since $(0,0)$ is not in $2E(L)$ when $2E(L)$ is torsion-free). Every embedding of $F$ into $\R$ extends to $L$, so $x([n]P)$ is positive at both real embeddings. \end{proof} \subsection{Orders of reductions}\label{ssec:orders} For a Gaussian integer $\pi$ write $\Nm(\pi)=\pi\bar\pi$. We call $\pi$ \emph{primary} if $\pi\equiv1\pmod{2+2i}$. \needspace{6\baselineskip} \begin{lemma}\label{lem:orders} Let $p\equiv1\pmod4$ be a prime, $p\notin\mathcal P$, that splits in $F$, let $\mathfrak Q$ be a prime of $F$ above $p$, and let $\pi$ be a primary Gaussian prime of norm $p$. Identify $\cO_F/\mathfrak Q$ and $\Z[i]/(\pi)$ with $\FF_p$, and let $u_{\mathfrak Q}\in\{\pm1,\pm i\}$ be the unit with $u_{\mathfrak Q}\equiv A^{(p-1)/4}\pmod\pi$. Then $E$ has good reduction at $\mathfrak Q$, \[ \#\tilde E(\cO_F/\mathfrak Q)=\Nm(\pi-u_{\mathfrak Q}), \] and $u_{\mathfrak Q}=\pm1$ exactly when $A$ is a square modulo $\mathfrak Q$. \begin{enumerate}[label=\textup{(\alph*)},ref=\textup{(\alph*)}] \item\label{or:a} Let $E$ be the first or second curve, with $\bigl(\frac{\Nm_{F/\Q}(a)}p\bigr)=-1$. Then the reductions of $E$ at $\mathfrak Q$ and at $\sigma\mathfrak Q$ have orders $\Nm(\pi-1)$ and $\Nm(\pi+1)$ in some order. Every prime $p\equiv1\pmod{48}$ with $p\equiv5\pmod{13}$, for the first curve, or with $p\equiv3\pmod7$, for the second, splits in $F$ and satisfies $\bigl(\frac{\Nm_{F/\Q}(a)}p\bigr)=-1$. \item\label{or:b} Let $E$ be the third or fourth curve, with $\bigl(\frac{\Nm_{F/\Q}(A)}p\bigr)=-1$. Then $A$ is a square modulo exactly one of $\mathfrak Q$ and $\sigma\mathfrak Q$, say $\mathfrak p_+$, and the reductions of $E$ at $\mathfrak p_+$ and at $\sigma\mathfrak p_+$ have orders $\Nm(\pi-\epsilon)$ and $\Nm(\pi-\eta i)$ for some $\epsilon,\eta\in\{1,-1\}$. \end{enumerate} \end{lemma} \begin{proof} Compare \cite[Lemma~10.2]{Sun}. As $p$ splits in $F$ and $p\notin\mathcal P$, $E$ has good reduction at $\mathfrak Q$ \ref{E2}, and the residue field is $\FF_p$; let $D\in\Z$ be prime to $p$ with $D\equiv A\pmod{\mathfrak Q}$. For $p\equiv1\pmod4$ and primary $\pi$ of norm $p$, the curve $y^2=x^3-Dx$ has $p+1-\bar u\pi-u\bar\pi=\Nm(\pi-u)$ points over $\FF_p$, where $u$ is the quartic residue symbol of $D$ modulo $\pi$, so that $u\equiv D^{(p-1)/4}\pmod\pi$ \cite[Chapter~18, \S4, Theorem~5]{IrelandRosen}; this is the first formula. As $u_{\mathfrak Q}^2\equiv D^{(p-1)/2}\pmod\pi$, $u_{\mathfrak Q}=\pm1$ exactly when $D$ is a square modulo $p$. The residue of $A$ modulo $\sigma\mathfrak Q$ is that of $\bar A$ modulo $\mathfrak Q$, so $u_{\mathfrak Q}u_{\sigma\mathfrak Q}\equiv\Nm_{F/\Q}(A)^{(p-1)/4}\pmod\pi$, whose square is $\bigl(\frac{\Nm_{F/\Q}(A)}p\bigr)$. \ref{or:a} Here $A=a^2$, so $u_{\mathfrak Q}=\bigl(\frac a{\mathfrak Q}\bigr)$, the quadratic residue symbol, and $u_{\mathfrak Q}u_{\sigma\mathfrak Q}=\bigl(\frac{\Nm_{F/\Q}(a)}p\bigr)=-1$; this gives the first statement. For the second, let $p\equiv1\pmod{48}$. For the first curve, $\bigl(\frac3p\bigr)=\bigl(\frac p3\bigr)=1$, so $p$ splits in $\Q(\sqrt3)$, and $p\equiv5\pmod{13}$ gives $\bigl(\frac{13}p\bigr)=\bigl(\frac p{13}\bigr)=\bigl(\frac5{13}\bigr)=-1$. For the second, $p\equiv1\pmod8$ gives $\bigl(\frac2p\bigr)=1$, so $p$ splits in $\Q(\sqrt2)$, and as $p\equiv1\pmod4$ and $p\equiv3\pmod7$, $\bigl(\frac{-63}p\bigr)=\bigl(\frac7p\bigr)=\bigl(\frac p7\bigr)=\bigl(\frac37\bigr)=-1$, the squares modulo $7$ being $1$, $2$, $4$. \ref{or:b} Here $(u_{\mathfrak Q}u_{\sigma\mathfrak Q})^2=-1$, so one of $u_{\mathfrak Q}$, $u_{\sigma\mathfrak Q}$ is $\pm1$ and the other is $\pm i$. \end{proof} \subsection{Heights of traces of abscissas}\label{ssec:aggregate} For an elliptic curve over a number field, $\hat h$ is its canonical height, and $h$ is the absolute logarithmic Weil height on $\overline\Q$. \needspace{4\baselineskip} \begin{lemma}\label{lem:aggregate} Suppose that \begin{equation}\label{eq:kummer} A\notin\bar A^{\,k}F(i)^{\times4}\qquad(k=0,1,2,3), \end{equation} and let $P\in E(F)$ be a point of infinite order. There are constants $C_1>0$ and $C_2\ge0$ such that for all nonzero integers $n_1,\dots,n_4$, \[ T=\frac12\Tr_{F/\Q}\Bigl(\sum_{k=1}^4x([n_k]P)\Bigr)\quad\text{satisfies}\quad \max_k n_k^2\le C_1h(T)+C_2. \] \end{lemma} Each index curve satisfies \eqref{eq:kummer}. Let $\mathfrak l$ be $(4+\sqrt3)$, $(1+2\sqrt2)$, $(1+2\sqrt2)$, respectively the prime of $F$ above $89$ that divides $A$. It lies above $13$, $7$, $7$, respectively $89$, so it is unramified in $F(i)$; $v_{\mathfrak l}(A)$ is $2$, $2$, $1$, respectively $1$, and $v_{\mathfrak l}(\bar A)=0$. At a prime of $F(i)$ above $\mathfrak l$ every element of $\bar A^kF(i)^{\times4}$ has valuation divisible by $4$, and $A$ does not. \begin{proof} For the first curve this is \cite[Lemma~10.1]{Sun}, and for the others it is his lemma with the hypothesis \eqref{eq:kummer}; the method is that of \cite[\S A38]{GlazerV15}. Let $E_0\colon Y^2=X^3-X$, choose $s,\bar s\in\overline\Q$ with $s^4=A$ and $\bar s^4=\bar A$, and let $M=F(i,s,\bar s)$. The maps $(x,y)\mapsto(x/s^2,y/s^3)$ and $(x,y)\mapsto(x/\bar s^2,y/\bar s^3)$ are isomorphisms $E\to E_0$ and $E^\sigma\to E_0$ over $M$; let $Q_1,Q_2\in E_0(M)$ be the images of $P$ and of $P^\sigma\in E^\sigma(F)$. Both have infinite order. \emph{$Q_1$ and $Q_2$ are independent over $\operatorname{End}(E_0)=\Z[i]$ modulo torsion.} As $F(i)$ contains the fourth roots of unity, Kummer theory and \eqref{eq:kummer} give $s\notin F(i,\bar s)$; so there is an automorphism $g$ of $M/F(i,\bar s)$ with $g(s)=i^js$ for some $j\in\{1,2,3\}$. It fixes $Q_2$, and $g(Q_1)=[i^j]Q_1$, because $[i](X,Y)=(-X,iY)$ on $E_0$; and it commutes with $\Z[i]$, which is defined over $\Q(i)$. If $\mu Q_1+\nu Q_2$ is torsion with $\mu,\nu\in\Z[i]$, applying $g$ and subtracting shows that $(i^j-1)\mu Q_1$ is torsion, so $\mu=0$, and then $\nu=0$. \emph{The function.} On $\mathcal E=E_0^8$ with coordinates $(U_1,\dots,U_4,V_1,\dots,V_4)$ let \[ \Phi=\frac{s^2}2\sum_{k=1}^4X(U_k)+\frac{\bar s^2}2\sum_{k=1}^4X(V_k), \] a rational map $\mathcal E\to\mathbf P^1$, and $\mathbf q=([n_1]Q_1,\dots,[n_4]Q_1,[n_1]Q_2,\dots,[n_4]Q_2)$. Then $\Phi(\mathbf q)=\frac12\sum_k(x([n_k]P)+x([n_k]P)^\sigma)=T$, and $\mathbf q$ lies in the domain of $\Phi$ since no coordinate is $O$. \emph{No positive-dimensional translate.} Suppose that $\Phi$ is constant on $\mathbf q+B$ for an abelian subvariety $B\ne0$ of $\mathcal E$. Since $\mathcal E$ is a power of $E_0$, $B$ contains the image of a nonzero homomorphism $E_0\to\mathcal E$, $U\mapsto(\mu_1U,\dots,\mu_4U,\nu_1U,\dots,\nu_4U)$ with $\mu_k,\nu_k\in\Z[i]$; so $U\mapsto\Phi(\mathbf q+(\mu_kU,\nu_kU)_k)$ is constant on $E_0$. Suppose some $\mu_k\neq0$, and let $U_0$ satisfy $[n_k]Q_1+\mu_kU_0=O$. If also $[n_l]Q_1+\mu_lU_0=O$, then $n_k\mu_l Q_1=n_l\mu_kQ_1$, so $\mu_l=(n_l/n_k)\mu_k$ as $Q_1$ has infinite order. Near $U_0$, with a local parameter $\zeta$ for which the invariant differential is $d\zeta$, the term $X([n_l]Q_1+\mu_l U)$ has leading part $(\mu_l\zeta)^{-2}$, where $\mu_l$ acts on the tangent space as a complex number; the sum of the leading parts of the first block is $\mu_k^{-2}\zeta^{-2}\sum_l(n_k/n_l)^2\neq0$, the sum over the $l$ with a pole at $U_0$. No term of the second block has a pole at $U_0$: if $[n_l]Q_2+\nu_lU_0=O$, then $n_k\nu_lQ_1-n_l\mu_kQ_2=\nu_l([n_k]Q_1+\mu_kU_0)-\mu_k([n_l]Q_2+\nu_lU_0)=O$ with $n_l\mu_k\ne0$, contrary to independence. So the restriction has a pole at $U_0$, a contradiction. The same argument applies if some $\nu_k\ne0$. Hence no translate of a nonzero abelian subvariety through $\mathbf q$ lies in a fibre of $\Phi$. \emph{Von Buhren's theorem.} Let $V\subseteq\mathcal E\times\mathbf P^1$ be the closure of the graph of $\Phi$, an integral closed subscheme, and $V_t$ its fibre over $t\in\mathbf P^1$. A translate of a nonzero abelian subvariety through $\mathbf q$ inside $V_T$ meets the domain of $\Phi$ in a dense open subset, on which $\Phi=T$; we have just excluded this, so $\mathbf q\in V_T\setminus Z_{V_T}$ in the notation of \cite[p.~307]{vonBuhren}. Let $\Gamma\subseteq\mathcal E(\overline\Q)$ be the subgroup generated by the eight points with one coordinate $Q_1$ or $Q_2$ and the others $O$; it has finite rank and contains $\mathbf q$, so $\mathbf q\in C(\Gamma,\epsilon)$ for every $\epsilon>0$. Von Buhren's theorem \cite[Th\'eor\`eme~1.1]{vonBuhren}, applied to $V\subseteq\mathcal E\times\mathbf P^1$ with the hyperplane bundle on $\mathbf P^1$ and a symmetric very ample bundle on $\mathcal E$ satisfying the normality condition \cite[(1.1)]{vonBuhren} (a sufficiently high power of the product of symmetric ample bundles on the factors), gives $\mu\ge0$ and $\varepsilon>0$ such that for every subgroup $\Gamma\subset\mathcal E(\overline\Q)$ of finite rank there is $\nu\ge0$ with $\hat h_{\mathcal E}(a)\le\mu h(t)+\nu$ for all $t\in\mathbf P^1(\overline\Q)$ and all $a\in(V_t\setminus Z_{V_t})(\overline\Q)\cap C(\Gamma,\varepsilon)$. With our $\Gamma$, $t=T$ and $a=\mathbf q$ it gives $\hat h_{\mathcal E}(\mathbf q)\le\mu h(T)+\nu$, where $\hat h_{\mathcal E}(\mathbf q)$ is a fixed positive multiple of $\sum_k(\hat h([n_k]Q_1)+\hat h([n_k]Q_2))=2\hat h_E(P)\sum_kn_k^2$, because canonical heights are invariant under isomorphisms of elliptic curves and under Galois conjugation. Since $\hat h_E(P)>0$, the lemma follows. \end{proof} \subsection{The second curve}\label{ssec:second} In this subsection $E$ is the second index curve: $F=\Q(\sqrt2)$ and $a=3+6\sqrt2$. Write $\cO_F=\Z[\sqrt2]$, $\varepsilon=1+\sqrt2$, $\lambda=\sqrt2$, $\pi_7=1+2\sqrt2$ and $\bar\pi_7=\sigma(\pi_7)=1-2\sqrt2$, so that $a=3\pi_7$, $\bar a=3\bar\pi_7$, $\Nm_{F/\Q}(\varepsilon)=-1$ and $\Nm_{F/\Q}(\pi_7)=-7$. The ring $\cO_F$ is a principal ideal domain (the Minkowski bound is $\sqrt2<2$), and $\cO_F^\times=\{\pm\varepsilon^k\}$, since a unit $u+v\sqrt2>1$ has $u,v\ge1$ (its conjugate $\pm1/(u+v\sqrt2)$ has absolute value less than $1$). The prime $2$ ramifies, $2\cO_F=(\lambda)^2$, and $\sq2=1$ in $F^\times/F^{\times2}$. A prime $p\equiv\pm3\pmod8$, such as $3$, $5$ or $13$, is inert in $F$, as $\bigl(\frac2p\bigr)=-1$. The prime $7$ splits: $7=-\pi_7\bar\pi_7$, and $(\pi_7)\ne(\bar\pi_7)$ because $\pi_7/\bar\pi_7=-(9+4\sqrt2)/7\notin\cO_F$. For $\mathfrak p_7=(\pi_7)$ we have $F_{\mathfrak p_7}=\Q_7$ with $\sqrt2\mapsto3$, as $\pi_7\equiv0$ gives $\sqrt2\equiv-\frac12\equiv3\pmod{\mathfrak p_7}$, and $3^2\equiv2\pmod7$. The nonzero squares modulo $7$ are $1$, $2$, $4$; so at $\mathfrak p_7$ the unit $\varepsilon\mapsto4$ is a square, and $-1$ and $3$ are not. \needspace{4\baselineskip} \begin{lemma}\label{lem:minimal2} The equation \eqref{eq:E} is minimal at every prime of $F$, and so is its conjugate. Its discriminant is a unit outside $(\lambda)$, $(3)$ and $(\pi_7)$, and that of the conjugate outside $(\lambda)$, $(3)$ and $(\bar\pi_7)$. \end{lemma} \begin{proof} The discriminant is $64a^6=2^63^6\pi_7^6$. At $(3)$ and $(\pi_7)$ its valuation is $6<12$, so the equation is minimal there. At $(\lambda)$ its valuation is $12$, as $a$ is a $\lambda$-unit ($\Nm_{F/\Q}(a)=-63$ is odd); so a more integral model would come from a change of variables with $v_\lambda(u)=1$, say $u=\lambda$ times a unit, which we may take to be $1$. Suppose that $x=\lambda^2x'+r$, $y=\lambda^3y'+\lambda^2sx'+t$ gives an integral model. With $a_1=a_2=a_3=a_6=0$ and $a_4=-a^2$, its coefficients are \cite[\S III.1]{Silverman} \[ a_1'=\frac{2s}\lambda,\quad a_2'=\frac{3r-s^2}{\lambda^2},\quad a_3'=\frac{2t}{\lambda^3},\quad a_4'=\frac{3r^2-a^2-2st}{\lambda^4},\quad a_6'=\frac{r(r^2-a^2)-t^2}{\lambda^6}. \] Write $v=v_\lambda$. First $r$, $s$, $t$ are integral: $b_8'=(3r^4-6a^2r^2-a^4)/\lambda^8$ is integral and $3$ is a unit, so $r$ is integral over $\Z_2[\sqrt2]$, hence in it; then $s^2=3r-\lambda^2a_2'$ and $t^2=r(r^2-a^2)-\lambda^6a_6'$ are integral. Now $a_3'$ gives $v(t)\ge1$, and $a_4'$ gives $v(3r^2-a^2)\ge3$, so $r$ is a unit. Next $a_2'$ gives $s^2\equiv3r\pmod{\lambda^2}$; the square of a unit $w_0+w_1\sqrt2$ ($w_0$ odd) is $w_0^2+2w_1^2+2w_0w_1\sqrt2\equiv1\pmod{\lambda^2}$, so $s$ is a unit and $r\equiv1\pmod{\lambda^2}$. From $a_4'$, $r^2-a^2\equiv-2r^2+2st\pmod{\lambda^4}$, and $v(2r^2)=21$ we have $00$ by \eqref{eq:gq}. (c) $v_{\mathfrak q}(q/s)\ge1$ because $v_{\mathfrak q}(q)=1$, and $q/s>0$ at every real place; apply (b). (d) Put $u=qt$; then $\psi_q(t)-1=q\bigl(10+u/(1+u^2)\bigr)$. The residue field of $\mathfrak q$ has $q^f$ elements with $f$ odd and $q\equiv3\pmod4$, so $-1$ is not a square in it; hence $v_{\mathfrak q}(1+u^2)=\min(0,2v_{\mathfrak q}(u))$, and $u/(1+u^2)$ is $\mathfrak q$-integral. So $v_{\mathfrak q}(\psi_q(t)-1)\ge1$. At every real place $|u/(1+u^2)|\le\frac12$, so $\psi_q(t)\ge 9.5q+1>1$; apply (b). \end{proof} \needspace{4\baselineskip} \begin{lemma}\label{lem:tubelocal} Let $q$ and $\mathfrak q$ be as in \cref{thm:height} and let $z\in K$ with $v_{\mathfrak q}(z-1)\ge1$. Put $j_z=j(x_q(z))$ and $d_z=-(27j_z+16)$. Then $v_{\mathfrak q}(x_q(z))=v_{\mathfrak q}(x_q(z)-4)=-1$, $v_{\mathfrak q}(j_z)=1$, $d_z$ is a $\mathfrak q$-adic unit with $d_z\equiv-16\pmod{\mathfrak q}$, and $g_q(z)$ is a square in the completion $K_{\mathfrak q}$. \end{lemma} \begin{proof} By \eqref{eq:tubeids}, $a_q\equiv-1$ and $b_q\equiv-\frac13$ modulo $q$ (note $D_q\equiv3\pmod q$). Since $z\equiv1$ and $v_{\mathfrak q}(qz^2)=1$, both $a_qz+b_q$ and $a_qz+b_q-4qz^2$ are congruent to $-\frac43$ modulo $\mathfrak q$, a unit. Hence $v_{\mathfrak q}(x_q(z))=v_{\mathfrak q}(x_q(z)-4)=-1$ and $v_{\mathfrak q}(j_z)=2(-1)-3(-1)=1$. Then $27j_z+16\equiv16$, so $d_z\equiv-16$. By the last identity of \eqref{eq:tubeids}, $g_q(z)\cdot s^2=-d_z\equiv16$ with $s=8(x_q(z)+8)/(z^2(x_q(z)-4)^2)\ne0$, so $g_q(z)s^2$ is a unit congruent to a nonzero square modulo $\mathfrak q$, hence a square in $K_{\mathfrak q}$ by Hensel's lemma ($q$ is odd). \end{proof} \subsection{The fibres, the sign cocycle and the representations}\label{ssec:fibres} Let $B=(2,-3)_\Q$ be the quaternion algebra over $\Q$ generated by $\mathbf i,\mathbf j$ with $\mathbf i^2=2$, $\mathbf j^2=-3$, $\mathbf i\mathbf j=-\mathbf j\mathbf i$; it is ramified exactly at $2$ and $3$, and $O=\Z[\mathbf i,(1+\mathbf j)/2]$ is a maximal order. We use the following facts about the Shimura curve of $O$ over $\Q$, proved in \cite[\S\S5, 6, 8]{Sun}. \ref{S1} and \ref{S2} involve neither $K$ nor $q$; \ref{S3}--\ref{S5} are proved there over $\Q(\sqrt2)$; the proofs of \ref{S3} and \ref{S4} are local at one prime and that of \ref{S5} is formal in the base field, so they apply over $K$ as stated. \begin{enumerate}[label=\textup{(S\arabic*)},ref=\textup{(S\arabic*)}] \item\label{S1} \cite[\S5 and Lemma~5.1]{Sun} The quotient of the Shimura curve of $O$ by its full Atkin--Lehner group $W\cong(\Z/2\Z)^2$ is the projective line, with a coordinate $j$ whose elliptic points have orders $4$, $6$ and $2$ above $j=0$, $\infty$ and $-16/27$; the normalisation of $j$ is that of \cite[Example~29]{LinYang}, and the quotient and its intermediate covers are those of \cite[Theorems~2.1, 3.10 and~3.17]{BabaGranath}. \item\label{S2} \cite[Lemma~5.3, proof of Proposition~5.7, Lemma~8.1]{Sun} There is a smooth proper fine moduli scheme $\mathcal X$ over $\Z[1/30]$ of principally polarised abelian surfaces with an action of $O$ and a full level-three structure $\operatorname{Isom}_O(O/3O,A[3])$; it is built from Buzzard's model at an auxiliary level five \cite[Theorem~2.1 and Corollary~2.3]{Buzzard} and Deligne's canonical models \cite[\S4]{Deligne}. A group $\mathcal G$ of order $144$ acts on its generic fibre over the $j$-line, the fibre above a point $j\notin\{0,\infty,-16/27\}$ is a $\mathcal G$-torsor, and $\mathcal G$ has a normal subgroup $U\cong(\Z/3\Z)^2$ with $\mathcal G/U\cong D_8\times\Z/2\Z$ \cite[(8.1)]{Sun}. \item\label{S3} \cite[Proposition~1.8, proved in \S5]{Sun} Let $z\in K\setminus\mathcal C_q$ and let $\mathfrak P\notin\Sigma$ be a prime of $K$. The fibre of $\mathcal X$ above $j(x_q(z))$ is unramified at $\mathfrak P$ unless $z$ has positive odd contact with a point of $\mathcal C_q$ at $\mathfrak P$, and then inertia at $\mathfrak P$ acts on it through a group of order $2$. Sun states this for $q=367$; the proof is local at $\mathfrak P$ and uses only that the seven points of $\mathcal C_q$ and the three elliptic points have distinct reductions modulo $\mathfrak P$ and that $|\mathcal G|$ is prime to the residue characteristic, so it applies to every prime $q\ge7$ with $\Sigma$ as in \cref{sec:intro}. \item\label{S4} \cite[Lemma~5.5 and Proposition~5.7]{Sun} Let $\mathfrak P$ be a prime of $K$ not dividing $30$, and let $j_0\in K$ with $v_{\mathfrak P}(j_0)=1$. Then inertia at $\mathfrak P$ acts on the fibre of $\mathcal X$ above $j_0$ through the class in $\mathcal G$ of $\gamma=1+\mathbf i+\mathbf j$ (up to inverse). Here $\operatorname{Nrd}(\gamma)=2$, the reduced characteristic polynomial of $\gamma$ is $X^2-2X+2$, $\gamma$ has order $4$ modulo the centre, and the ratio of the roots of $X^2-2X+2$ has order $4$ in $\FF_9^\times$. Sun states this for primes of residue characteristic $p>144$ and norm $\equiv-1\pmod4$ \cite[Proposition~5.7]{Sun}; the proof of the inertia statement uses of the prime only that $p$ does not divide $30|\mathcal G|$, that is $p\nmid30$, and that $v_{\mathfrak P}(j_0)=1$. \item\label{S5} \cite[Remark~6.2]{Sun} Let $z\in K\setminus\mathcal C_q$ be such that the abelian surfaces in the fibre above $j_z=j(x_q(z))$ have no complex multiplication, that is, $\operatorname{End}^0(A\otimes\overline K)=B$. Let $K_z$ be the splitting field over $K$ of this fibre, so that $[K_z:K]\le144$, and let $A_z$ be the abelian surface over $K_z$ given by a point of it. All homomorphisms between Galois conjugates of $A_z$ over $\overline K$ are defined over $K_z$. For $g\in G_K$ choose a $B$-linear quasi-isogeny $\mu_g\colon{}^gA_z\to A_z$ (for the labels transported as in \cite[Remark~6.2]{Sun}), depending only on the image of $g$ in $\Gal(K_z/K)$, with $\mu_1=\mathrm{id}$ (this is possible because ${}^gA_z$ and its transported labels depend only on that image); and put $\nu_g=(\deg\mu_g)^{-1/4}\mu_g$. Then $\nu_g\circ{}^g\nu_h=\varsigma(g,h)\,\nu_{gh}$ with $\varsigma(g,h)\in\{\pm1\}$ (Ribet's construction \cite[\S6]{RibetAV}); $\varsigma$ is a normalised $2$-cocycle inflated from $\Gal(K_z/K)$. If $\vartheta\colon G_K\to\mu_\infty$ is continuous with $\delta\vartheta=\varsigma$, where $\delta\vartheta(g,h)=\vartheta(g)\vartheta(h)\vartheta(gh)^{-1}$, then $R_\ell(g)=\vartheta(g)^{-1}\nu_g\circ g$ is a continuous representation of $G_K$ on $V_\ell(A_z)\otimes_{\Q_\ell}E_\ell$ commuting with $B$, where $V_\ell(A_z)=T_\ell(A_z)\otimes\Q_\ell$ and $E_\ell$ is a finite extension of $\Q_\ell$ containing the values of $\vartheta$ and the numbers $(\deg\mu_g)^{1/4}$ (finitely many), embedded once and for all. Taking $E_\ell$ also to split $B$, $R_\ell\cong r_\ell^{\oplus2}$ with $r_\ell$ of dimension two and $\det r_\ell=\chi_{\mathrm{cyc}}\chi^{-1}$, where $\chi=\vartheta^2$ and $\chi_{\mathrm{cyc}}$ is the $\ell$-adic cyclotomic character; and on $G_{K'_z}$, where $K'_z$ is the fixed field of the kernel of $\vartheta|_{G_{K_z}}$, $R_\ell$ is the Galois action on $V_\ell(A_z)$. \end{enumerate} The map $\vartheta$ is provided by \cref{prop:cochain} below, which needs $\varsigma$ to be normalised; with $\mu_1=\mathrm{id}$ it is. We write $\bar r_3$ for the semisimplification of the reduction of $r_3$ and $\mathbb P\bar r_3$ for its image in $\mathrm{PGL}_2(\overline{\FF}_3)$; the latter does not depend on $\vartheta$, since another choice of $\vartheta$ twists $r_3$ by a character. \needspace{4\baselineskip} \begin{lemma}\label{lem:fibre} Let $q$ and $\mathfrak q$ be as in \cref{thm:height}, let $z\in\mathcal D$ be as in \ref{S5}, and let $\vartheta$ and $r_3$ be as there. Let $D_{\mathfrak q}\supset I_{\mathfrak q}$ be decomposition and inertia groups at $\mathfrak q$. \begin{enumerate}[label=\textup{(\alph*)}] \item The images of $I_{\mathfrak q}$ under $\mathbb P\bar r_3$ and in $\mathrm{PGL}_2(E_3)$ under $r_3$ are cyclic of order $4$, and a Frobenius element at $\mathfrak q$ conjugates a generator $\tau$ of either to $\tau^{-1}$. \item $\bar r_3|_{D_{\mathfrak q}}$ is absolutely irreducible, and the Weil--Deligne representation attached to $r_3|_{D_{\mathfrak q}}$ has irreducible Weil part and zero monodromy. \item $\mathbb P\bar r_3(G_K)$ is dihedral of order $8$, and the fixed field of its cyclic subgroup of order $4$ is $M_z=K\bigl(\sqrt{-g_q(z)}\bigr)$, a totally imaginary quadratic extension of $K$. \item $\bar r_3|_{G_{K(\zeta_3)}}$ is absolutely irreducible. \end{enumerate} \end{lemma} \begin{proof} First, $A_z$ has potentially good reduction at every prime of $K_z$: after a finite extension it has semistable reduction, the action of $O$ extends to the N\'eron model and acts on the character group of its toric part, which has rank at most $2$; a nonzero module over the division algebra $B$ has $\Q$-dimension at least $4$, so the toric part is trivial \cite[proof of Lemma~8.5]{Sun}. (a) By \cref{lem:tubelocal}, $v_{\mathfrak q}(j_z)=1$, and $\mathfrak q\nmid30$. By \ref{S4}, inertia at $\mathfrak q$ acts through the class of $\gamma$, whose image under $r_3$ is projectively of order $4$, also after reduction because the ratio of its eigenvalues has order $4$ in $\FF_9^\times$ \cite[Proposition~5.7]{Sun}. The image of $I_{\mathfrak q}$ has order prime to $q$, so it factors through tame inertia, on which a Frobenius acts by raising to the power $N\mathfrak q=q^f$. Since $q\equiv3\pmod4$ and $f$ is odd, $\tau^{N\mathfrak q}=\tau^{-1}$. (b) The element $\tau$ has two fixed points $P_1,P_2$ on $\mathbf P^1(\overline{\FF}_3)$, with multipliers $\lambda$ and $\lambda^{-1}$, where $\lambda$ has order $4$. A Frobenius $\phi$ maps the fixed points of $\tau$ to those of $\phi\tau\phi^{-1}=\tau^{-1}$, which are again $P_1,P_2$, and the multiplier of $\tau^{-1}$ at $\phi(P_1)$ is the multiplier $\lambda$ of $\tau$ at $P_1$; since the multiplier of $\tau^{-1}$ at $P_1$ is $\lambda^{-1}\ne\lambda$, $\phi(P_1)=P_2$. So no point of $\mathbf P^1$ is fixed by the image of $D_{\mathfrak q}$, and $\bar r_3|_{D_{\mathfrak q}}$ is absolutely irreducible. The same argument over $E_3$ shows that the Weil part is irreducible. On an open subgroup of $I_{\mathfrak q}$ that acts trivially on $V_3(A_z)$ (potentially good reduction) $r_3$ is a character of finite order, so the monodromy is zero. (c) This is \cite[Lemmas~8.3 and~8.4]{Sun}, whose proof uses of the tube prime only (a) and (b). By \ref{S2} and \cite[proof of Lemma~8.3]{Sun}, $\Gal(K_z/K)$ embeds in the opposite group of $\mathcal G$. On $G_{K_z}$ the three-torsion of $A_z$ is constant and $R_3(g)=\vartheta(g)^{-1}V_3(A_z)(g)$, so all eigenvalues of $\bar r_3(g)$ coincide and $\mathbb P\bar r_3(G_{K_z})$ is a $3$-group, normal in $\mathbb P\bar r_3(G_K)$. A nontrivial $3$-subgroup of $\mathrm{PGL}_2(\overline{\FF}_3)$ has exactly one fixed point on $\mathbf P^1$, which the whole image would then fix, against (b); so $\mathbb P\bar r_3(G_{K_z})=1$. In the same way the image of $U$ is trivial, so $\mathbb P\bar r_3(G_K)$ is a subquotient of $D_8\times\Z/2\Z$: a $2$-group of order at most $16$ and exponent at most $4$. Finite $2$-subgroups of $\mathrm{PGL}_2(\overline{\FF}_3)$ are cyclic or dihedral, and a cyclic or dihedral group of order $16$ has an element of order $8$; so the image has order at most $8$, and by (a) and (b) it contains a cyclic group of order $4$ and an element outside it inverting it. Hence it is dihedral of order $8$. Sun identifies the rotation subgroup with the image of the kernel of the Atkin--Lehner parity at $3$, which contains the class of $\gamma$ \cite[proof of Lemma~8.3]{Sun}, and Baba and Granath compute the corresponding quadratic cover as $\Q(j)\bigl(\sqrt{-(27j+16)}\bigr)$ \cite[Theorem~3.10, Corollary~3.11, Theorem~3.17]{BabaGranath}, \cite[Lemma~8.4]{Sun}. By \eqref{eq:tubeids} its fibre above $j_z$ gives $M_z=K(\sqrt{d_z})=K\bigl(\sqrt{-g_q(z)}\bigr)$. As $g_q(z)$ is totally positive, $M_z$ is totally imaginary. (d) The group $H=\mathbb P\bar r_3(G_{K(\zeta_3)})$ has index at most $2$ in $D_8$ and order prime to $3$, so $\bar r_3|_{G_{K(\zeta_3)}}$ is absolutely reducible exactly when $H$ fixes a point of $\mathbf P^1$. The dihedral group of order $8$ and its two Klein four-subgroups fix no point (commuting involutions of $\mathrm{PGL}_2$ have disjoint fixed pairs), so reducibility forces $H$ to be the cyclic subgroup of order $4$, that is $K(\zeta_3)=M_z$, that is $3g_q(z)\in K^{\times2}$. But $g_q(z)$ is a square in $K_{\mathfrak q}$ (\cref{lem:tubelocal}) and $3$ is not a square in the residue field $\FF_{q^f}$ of $\mathfrak q$: $f$ is odd and $\bigl(\frac3q\bigr)=-1$ for $q\equiv7\pmod{12}$. \end{proof} \subsection{Scalar cochains over a totally real field}\label{ssec:cochain} Characters are continuous of finite order and are identified by class field theory with characters of $K_v^\times$ or of $\mathbf A_K^\times/K^\times$. A $2$-cochain $\varsigma$ on $G_K$ is \emph{normalised} if $\varsigma(1,g)=\varsigma(g,1)=1$. For a finite prime $v$ of $K$, $U_v^{(0)}=\cO_v^\times$, $U_v^{(i)}=1+\mathfrak p_v^i$, and $e_v$ is the absolute ramification index. Let $S_2$ be the set of dyadic primes of $K$, $\hat E=\cO_K^\times\otimes\Z_2$, $\hat U_2=\prod_{v\in S_2}U_v^{(1)}$, and $\iota\colon\hat E\to\hat U_2$ the diagonal map. The \emph{Leopoldt defect} $d_2(K)$ is the $\Z_2$-rank of the kernel of $\iota$ \cite[(10.3.7)]{NSW} (the real places, at which the $2$-completion of the units is finite, do not change the rank); $d_2(K)=0$ when Leopoldt's conjecture holds for $K$ at $2$, in particular when $K$ is abelian over $\Q$ \cite[(10.3.16)]{NSW}. For $K=\Q$ compare \cite[Lemma~4.5]{OpenAI}, and for $K=\Q(\sqrt2)$ a statement of this kind is \cite[Theorem~1.9]{Sun}. Over a general totally real field the following proposition allows at most $d_2(K)$ auxiliary primes, and none when Leopoldt's conjecture holds for $K$ at $2$. \begin{proposition}\label{prop:cochain} Let $Z$ be a finite set of primes of $K$. There is a constant $C\ge1$, depending only on $K$ and $Z$, with the following property. Let $T_0$ be a finite set of finite primes of $K$ containing $S_2$, let $K_0/K$ be a finite Galois extension unramified at every finite prime outside $T_0$, and let $\varsigma$ be a normalised $2$-cocycle on $G_K$ with values in $\{\pm1\}$, inflated from $\Gal(K_0/K)$, whose class in $\operatorname{Br}(K_v)$ is trivial at every finite prime $v\notin T_0$. Let $T_-$ be the set of odd primes $v\in T_0$ at which this class has invariant $\frac12$, and let $2^\nu=\max_{v\in T_-}2^{v_2(Nv-1)}$ \textup{(}$2^\nu=2$ if $T_-=\emptyset$\textup{)}. Then there are \begin{itemize} \item a set $Q$ of at most $d_2(K)$ odd primes of $K$, disjoint from $Z$, with $N\mathfrak Q\le C\cdot2^{1042\,n_K\nu}$ for $\mathfrak Q\in Q$, and $Q=\emptyset$ if $d_2(K)=0$; \item a character $\chi$ of $G_K$ of order $m\le C\cdot2^\nu$ and a continuous map $\vartheta\colon G_K\to\mu_{2m}$ with $\vartheta^2=\chi$ and $\delta\vartheta=\varsigma$, \end{itemize} such that $\chi$ and $\vartheta|_{G_{K_0}}$ \textup{(}a homomorphism\textup{)} are unramified at every finite prime outside $T_0\cup Q$ and tamely ramified at every odd prime, the conductor exponent of $\chi$ at each $v\in S_2$ is at most $e_v(\nu+C)$, and the fixed field $K'$ of the kernel of $\vartheta|_{G_{K_0}}$ satisfies $[K':K]\le2m[K_0:K]$. \end{proposition} \Cref{prop:cochain} is proved in \cref{app:cochain}. \subsection{Proof of \texorpdfstring{\cref{thm:height}}{Theorem 1.6}}\label{ssec:heightproof} Fix $K$, $q$, $\mathfrak q$ and $\Sigma$. In this subsection $C,C',\dots$ denote positive constants that depend only on these data and on the fixed choices made below, never on $z$. For $z\in\mathcal D$ write $\mathfrak N=\mathfrak N_\Sigma(z)\ge1$. \emph{Step 0.} By \cref{lem:intube}(a), $\mathcal D\cap\mathcal C_q=\emptyset$, so $\mathfrak N_\Sigma$ is defined on $\mathcal D$. For $z\in\mathcal D$, $v_{\mathfrak q}(j_z)=1$ (\cref{lem:tubelocal}), so $j_z\notin\{0,\infty,-16/27\}$. The fibre of $\mathcal X$ above $j_z$ consists of principally polarised abelian surfaces $A$ with $O\subseteq\operatorname{End}(A\otimes\overline K)$, and $\operatorname{End}^0(A\otimes\overline K)$ is either $B$ or $M_2(k)$ for an imaginary quadratic field $k$; in the second case we say that $z$ has \emph{complex multiplication}. Steps 1--8 treat the $z\in\mathcal D$ without complex multiplication, and Step~9 the others. \emph{Step 1 (the cochain and $r_3$).} Let $K_z$, $A_z$ and $\varsigma$ be as in \ref{S5}, and let $T_0$ be the union of $\Sigma$ and the primes $\mathfrak P\notin\Sigma$ at which $z$ has positive odd contact with a point of $\mathcal C_q$. By \ref{S3}, $K_z/K$ is unramified outside $T_0$. At a finite prime $v\notin T_0$ the restriction of $\varsigma$ to a decomposition group is inflated from the unramified quotient $\hat\Z$, whose second cohomology with coefficients $\{\pm1\}$ vanishes, so the Brauer class of $\varsigma$ is trivial at $v$. Apply \cref{prop:cochain} with $Z=\Sigma$ and $K_0=K_z$; it gives $Q$, $\chi$ of order $m$, $\vartheta$ and the field $K'_z$. The primes of $T_-$ outside $\Sigma$ divide $\mathfrak N$, so $2^\nu\le C\mathfrak N$, and therefore \[ m\le C\mathfrak N,\qquad [K'_z:\Q]\le2\cdot144\,n_Km\le C\mathfrak N,\qquad N\mathfrak Q\le C\mathfrak N^{1042n_K}\ \ (\mathfrak Q\in Q). \] Let $r_3$ be the representation of \ref{S5} for this $\vartheta$. It is unramified at every finite prime $v\notin T_0\cup Q$: such a $v$ does not divide $3$, the inertia group $I_v$ lies in $G_{K_z}$, $\vartheta|_{I_v}=1$, and $A_z$ has good reduction over $K_z$ at the primes above $v$, because it has potentially good reduction (proof of \cref{lem:fibre}), so that inertia acts on $T_3(A_z)$ through a finite group, and it acts trivially on $A_z[3]$, while $1+3M_4(\Z_3)$ has no nontrivial element of finite order \cite[Theorems~1 and~2]{SerreTate}. \emph{Step 2 (the tube prime).} \Cref{lem:fibre} applies. Consequently, if $\Pi$ is a cuspidal automorphic representation of $\mathrm{GL}_2(\mathbf A_K)$ whose $3$-adic Galois representation is $r_3$ up to duals and twists by characters, then $\Pi_{\mathfrak q}$ is supercuspidal. Indeed, Skinner's local--global compatibility at primes not above $3$ \cite[p.~242, (1)]{Skinner}, valid for every totally real field, identifies the Frobenius-semisimplified Weil--Deligne representation of that Galois representation at $\mathfrak q$ with the Langlands parameter of $\Pi_{\mathfrak q}\otimes|\det|^{-1/2}$; it is irreducible by \cref{lem:fibre}(b), as duals and twists preserve irreducibility; and an irreducible two-dimensional Weil--Deligne parameter corresponds to a supercuspidal representation \cite[\S\S0.5 and~0.9]{Carayol}. \emph{Step 3 (the primes above $3$).} Let $v$ be a prime of $K$ above $3$; $K_v$ may be any finite extension of $\Q_3$. We show that $r_3|_{G_{K_v}}$ is potentially Barsotti--Tate and not potentially ordinary. Choose a finite extension $F'$ of $K_v$ that contains the completion of $K'_z$ at a place above $v$ and over which $A_z$ has good reduction, and let $\mathcal G_3=A_z[3^\infty]$ over the integers of $F'$. Then $O$ acts on $\mathcal G_3$, and on $G_{F'}$, where $\vartheta=1$, $V_3(\mathcal G_3)\otimes E_3=V_3(A_z)\otimes E_3\cong r_3^{\oplus2}$. \emph{$\mathcal G_3$ has no \'etale part}: $V_3(\mathcal G_3^{\mathrm{et}})$ is a module over $B\otimes\Q_3$, a division algebra of dimension $4$ because $3$ ramifies in $B$, so its dimension is $0$ or at least $4$; the principal polarisation identifies $\mathcal G_3$ with its Cartier dual, which exchanges the \'etale and multiplicative parts, so $2\operatorname{ht}(\mathcal G_3^{\mathrm{et}})\le\operatorname{ht}(\mathcal G_3)=4$; hence $\mathcal G_3^{\mathrm{et}}=0$ \cite[proof of Lemma~8.5]{Sun}, and the same holds after every finite extension of $F'$. \emph{Potentially Barsotti--Tate}: $V_3(\mathcal G_3)$ is crystalline with Hodge--Tate weights $0$ and $1$, and $r_3|_{G_{F'}}$ is a direct summand of $V_3(\mathcal G_3)\otimes E_3$ with determinant the cyclotomic character, so it is crystalline with each of the weights $0,1$ once at each embedding. \emph{Not potentially ordinary}: suppose that for a finite extension $F''$ of $F'$, $r_3|_{G_{F''}}$ had a stable line with unramified quotient. Then $V_3(\mathcal G_3)$ would have a nonzero unramified quotient $V_3(\mathcal G_3)\to W$ as a $\Q_3[G_{F''}]$-module; the scheme-theoretic closure of the kernel gives a $3$-divisible subgroup $\mathcal H\subseteq\mathcal G_3$ over the integers of $F''$ with $V_3(\mathcal G_3/\mathcal H)=W$ \cite[\S4]{Tate}. As $W$ is unramified, it has only the Hodge--Tate weight $0$, so $\mathcal G_3/\mathcal H$ has dimension $0$ \cite[\S4]{Tate}, that is, it is \'etale and nonzero, and $\mathcal G_3\to\mathcal G_3/\mathcal H$ factors through $\mathcal G_3^{\mathrm{et}}=0$: a contradiction. \emph{Step 4 (residual modularity).} By \cref{lem:fibre}(c), $\bar r_3|_{G_{M_z}}$ has cyclic projective image of order $4$, prime to $3$, so it is the sum of two distinct characters, which $G_K\setminus G_{M_z}$ exchanges; hence $\bar r_3\cong\operatorname{Ind}_{G_{M_z}}^{G_K}\bar\theta$ for a character $\bar\theta$ of $G_{M_z}$ with $\bar\theta\ne\bar\theta^c$, $c$ the nontrivial automorphism of $M_z/K$. Choose a CM type $\Phi$ of the CM field $M_z$. On units of $K$ the infinity type $u\mapsto\prod_{\phi\in\Phi}\phi(u)$ equals $\Nm_{K/\Q}(u)\in\{\pm1\}$, and the units of $K$ together with the roots of unity have finite index in the units of $M_z$; so there is an algebraic Hecke character $\psi_0$ of $M_z$ of infinity type $\Phi$. Let $\theta$ be the $3$-adic character of $\psi_0$ multiplied by the Teichm\"uller lift of the finite-order character $\bar\theta\bar\psi_0^{-1}$ (of order prime to $3$). Then $\theta\ne\theta^c$, the automorphic induction $f$ of $\theta$ from $M_z$ to $K$ is cuspidal of parallel weight $2$ \cite[Chapter~3, \S6, Theorem~6.2]{ArthurClozel}, and $\bar\rho_f\cong\bar r_3$; a change in the normalisation of $\rho_f$ replaces $\operatorname{Ind}\bar\theta$ by its dual or by a twist by a power of the cyclotomic character, again induced from a character of $M_z$ of the same kind, so $\theta$ can be chosen to match. \emph{Step 5 (modularity).} Gee's theorem \cite[Theorem~4.1]{Gee}, with the erratum \cite{GeeErratum}, says in the case $p=3$ that a continuous representation $\rho\colon G_K\to\mathrm{GL}_2(\mathcal O)$, where $\mathcal O$ is the ring of integers of a finite extension of $\Q_3$, unramified outside a finite set of primes and with determinant a finite-order character times the $3$-adic cyclotomic character, is modular if (1) $\rho$ is potentially Barsotti--Tate at each $v\mid3$; (2) there is a Hilbert modular form $f$ of parallel weight $2$ over $K$ with $\bar\rho_f\cong\bar\rho$ such that $\rho_f$ is potentially ordinary at each $v\mid3$ at which $\rho$ is; and (3) $\bar\rho|_{G_{K(\zeta_3)}}$ is absolutely irreducible. We apply it to $r_3$ on a stable lattice. It is unramified outside $T_0\cup Q$ (Step~1) with determinant $\chi_{\mathrm{cyc}}\chi^{-1}$; (1) holds by Step~3; (2) holds with the form of Step~4, the ordinarity condition being empty because $r_3$ is not potentially ordinary at any $v\mid3$ (Step~3); and (3) holds by \cref{lem:fibre}(d). So there is a cuspidal automorphic representation $\Pi$ of $\mathrm{GL}_2(\mathbf A_K)$ of parallel weight $2$, with central character of finite order, attached to $r_3$ in the normalisation of \cite[(3.1.3) and (3.4.1)]{Kisin}: for almost all finite $w$ the characteristic polynomial of $r_3$ at an arithmetic Frobenius is $X^2-T_wX+Nw\,S_w$, where $T_w$ and $S_w$ are the eigenvalues on the spherical vector of $\Pi_w$ of the double cosets of $\operatorname{diag}(\varpi_w,1)$ and $\operatorname{diag}(\varpi_w,\varpi_w)$. \emph{Step 6 (the conductor).} We show $\Nm_{K/\Q}(\mathfrak n(\Pi))\le C\mathfrak N^{A}$ with $A=A_0+2084\,n_K\,d_2(K)$, where $A_0$ depends only on the data. By Skinner's local--global compatibility, \cite[p.~242, (1)]{Skinner} at $v\nmid3$ and \cite[Theorem~1]{Skinner} at $v\mid3$, which apply to $\Pi$ (in Skinner's notation $k_i=2$ and $w=0$), the conductor exponent of $\Pi$ at each finite prime $v$ is that of the Weil--Deligne representation of $r_3|_{G_{K_v}}$, defined through $D_{\mathrm{pst}}$ at $v\mid3$; here $r_3$ is the dual of Skinner's $\rho_\Pi$ (compare the Frobenius eigenvalues of Step~5), and conductors do not change under duals. The local exponents are bounded as in \cite[proof of Lemma~7.6]{Sun}, using \cref{prop:cochain}: \begin{itemize} \item at a dyadic $v$ (all in $\Sigma$): $r_3$ restricted to $G_{K_z}$ is the Tate action twisted by $\vartheta^{-1}$, the Tate action is unramified at $v$ over $K_z$ (Step~1 with $\ell=3$), $K_z/K$ has degree at most $144$, so its completions run through finitely many extensions of $K_v$, and the conductor exponent of $\chi$ at $v$ is at most $e_v(\nu+C)\le C'(1+\log\mathfrak N)$; squaring maps sufficiently deep principal units onto deeper ones, so the same bound holds for $\vartheta|_{G_{K_z}}$, and the exponent of $r_3$ at $v$ is at most $C(1+\log\mathfrak N)$; \item at an odd $v\in\Sigma$: $\vartheta$ and $\chi$ are tame, $K_z/K$ runs through finitely many local extensions, and at $v\mid3$ the field $K_z(A_z[5])$ has degree bounded independently of $z$ and $A_z$ has good reduction at its primes $w$ above $v$ (Raynaud's criterion), so on the decomposition group at such a $w$ the representation $r_3$ is crystalline twisted by the tame character $\vartheta^{-1}$, and wild inertia acts on its Weil--Deligne representation through the Galois closure over $K_v$ of the completion of $K_z(A_z[5])$ at $w$, one of finitely many fields; the exponent is at most $C$; \item at $v\in T_0\setminus\Sigma$: the inertia of $K_z/K$ has order at most $2$ by \ref{S3} and $\vartheta$ is tame, so $r_3$ is tamely ramified and its exponent is at most $2$; \item at $\mathfrak Q\in Q\setminus T_0$: the exponent is at most $2$ (tame scalar inertia); elsewhere $r_3$ is unramified (Step~1). \end{itemize} Multiplying, the primes of $\Sigma$ contribute at most $C\mathfrak N^{C'}$, those of $T_0\setminus\Sigma$ at most $\mathfrak N^2$, and those of $Q$ at most $(C\mathfrak N^{1042n_K})^{2d_2(K)}$. \emph{Step 7 (a Shimura curve over $K$).} Suppose first $n_K\ge2$, and let $\tau_1,\dots,\tau_{n_K}$ be the real places of $K$. Let $\mathbf B_K$ be the quaternion algebra over $K$ ramified exactly at $\tau_2,\dots,\tau_{n_K}$ and, when $n_K$ is even, at $\mathfrak q$; the number of these places is even, so $\mathbf B_K$ exists \cite[Main Theorem~14.6.1]{Voight}, and it is the algebra of \cite[\S0.10]{Carayol} with $v=\mathfrak q$. As \cite[(7.1), Proposition~7.4 and Remark~7.5]{Sun} does over $\Q(\sqrt2)$, we make the comparison for the contragredient of $\Pi$. The contragredient $\Pi^\vee$ is cuspidal of parallel weight $2$ with $w=0$ in Carayol's notation \cite[\S0.2]{Carayol}, and when $n_K$ is even $\Pi^\vee_{\mathfrak q}$ is supercuspidal (Step~2), so $\Pi^\vee$ satisfies the hypotheses of \cite[\S0.3]{Carayol}, the only one depending on the degree being the existence of an essentially square-integrable local component when $n_K$ is even. By the Jacquet--Langlands correspondence as used in \cite[\S0.10]{Carayol} (\cite[\S16]{JacquetLanglands}) there is an automorphic representation $\pi'$ of $(\mathbf B_K\otimes\mathbf A_K)^\times$ with $\pi'_{\tau_1}\cong D_{2,0}$, $\pi'_{\tau_i}\cong D'_{2,0}$ for $i\ge2$, and $\pi'_w\cong\Pi^\vee_w$ at every finite $w$ at which $\mathbf B_K$ splits. For a sufficiently small compact open subgroup $U$ with $(\pi'_f)^U\ne0$, Carayol's representation $\sigma_\lambda(\pi')$ \cite[\S\S2.2.3--2.2.4]{Carayol} is a two-dimensional constituent of $H^1_{\mathrm{et}}(M_U\otimes\overline K,E_\lambda)$, where $M_U$ is Carayol's Shimura curve over $K$, proper because $\mathbf B_K$ is a division algebra, and the coefficient sheaf is constant because the weights are $k_i=2$, $w=0$ \cite[\S2.1.1]{Carayol}. At a finite $w\notin T_0\cup Q$ at which $\Pi$ is unramified write $\Pi_w=\operatorname{Ind}(\xi_1,\xi_2)$ (unitary induction) and $\alpha=\xi_1(\varpi_w)$, $\beta_w=\xi_2(\varpi_w)$. By Step~5, $T_w=Nw^{1/2}(\alpha+\beta_w)$ and $S_w=\alpha\beta_w$, so $r_3$ at an arithmetic Frobenius has eigenvalues $Nw^{1/2}\alpha$ and $Nw^{1/2}\beta_w$, and so does $r_3^\vee$ at a geometric Frobenius. On the other side \cite[\S0.5, p.~410]{Carayol} gives, for $\pi_{\mathfrak p}=\operatorname{Ind}(\xi_1,\xi_2)$, \[ \sigma(\pi_{\mathfrak p})=\xi_1^{-1}\cdot\omega_{\mathfrak p}^{-1/2}\oplus\xi_2^{-1}\cdot\omega_{\mathfrak p}^{-1/2},\qquad\omega_{\mathfrak p}=|\cdot|_{\mathfrak p}, \] with geometric Frobenius corresponding to uniformisers \cite[\S0.4]{Carayol}. For $\Pi^\vee_w=\operatorname{Ind}(\xi_1^{-1},\xi_2^{-1})$ this is $\xi_1\omega_w^{-1/2}\oplus\xi_2\omega_w^{-1/2}$, with eigenvalues $Nw^{1/2}\alpha$ and $Nw^{1/2}\beta_w$ at a geometric Frobenius. By \cite[Th\'eor\`eme~(B$'$), p.~412]{Carayol} the restriction of $\sigma_\lambda(\pi')$ to a decomposition group at $w$ is $\sigma(\pi'_w)=\sigma(\Pi^\vee_w)$, so these are its eigenvalues at a geometric Frobenius. Both representations are semisimple, and $r_3$ is irreducible because $\bar r_3$ is; by Chebotarev's theorem and the Brauer--Nesbitt theorem, $\sigma_\lambda(\pi')\cong r_3^\vee$. Dualising, with $V_\lambda(J_U)\cong H^1_{\mathrm{et}}(M_U\otimes\overline K,E_\lambda)^\vee$ for the Jacobian $J_U=\operatorname{Pic}^0_{M_U/K}$ (the product of the Jacobians of the geometric components when $M_U$ is not geometrically connected) \cite[I, Theorem~12.1(a), and III, Corollary~9.6]{MilneAV}, $r_3$ is isomorphic to a two-dimensional $G_K$-constituent of $V_3(J_U)\otimes E_3$. For $n_K$ odd this comparison is made in the same way by Alp\"oge \cite[\S4]{Alpoge}. If $n_K=1$, take for $M_U$ a modular curve and for $H^1$ the parabolic cohomology \cite[\S2.2.1]{Carayol}, which for the constant sheaf is $H^1$ of the smooth compactification $X_U$, and $J_U=\operatorname{Pic}^0(X_U)$; the rest is unchanged. \emph{Step 8 (heights).} We follow von K\"anel's strategy \cite{vonKanel}. (i) By Step~1, $V_3(A_z)\otimes E_3\cong r_3^{\oplus2}$ on $G_{K'_z}$, and by Step~7 and the semisimplicity of $V_3(J_U)$ \cite{Faltings}, $r_3$ is a direct summand of $V_3(J_U)\otimes E_3$; so there is a nonzero $G_{K'_z}$-equivariant map $V_3(A_z)\to V_3(J_U)$, and Faltings's theorem \cite{Faltings} gives $\operatorname{Hom}_{K'_z}(A_z,J_U)\ne0$ \cite[Corollary~7.2]{Sun}. As $A_z$ is geometrically simple, the image $B_z$ of a nonzero homomorphism is a two-dimensional abelian subvariety of $J_U\otimes K'_z$ isogenous to $A_z$ over $K'_z$. (ii) Fix a neat compact open subgroup $U_0$ of $(\mathbf B_K\otimes\mathbf A_{K,f})^\times$ and a Belyi map on each geometric component of $M_{U_0}$; when $n_K=1$, take $U_0=\ker\bigl(\mathrm{GL}_2(\hat\Z)\to\mathrm{GL}_2(\Z/3\Z)\bigr)$ and on each component of $X_{U_0}$ the Belyi map $j/1728$, under which the cusps lie over $\infty$. Choose $U\subseteq U_0$ with $(\pi'_f)^U\ne0$: at a split finite $w$ the principal congruence subgroup of level $w^{a_w(\Pi)}$ fixes the newvector and has index at most $Nw^{4a_w(\Pi)}$; at $\mathfrak q$, when $n_K$ is even, $a_{\mathfrak q}(\Pi)$ is bounded (Step~6) and one fixed depth suffices. So $d_U=[U_0:U]\le C\,\Nm_{K/\Q}(\mathfrak n(\Pi))^4\le C'\mathfrak N^{4A}$. (iii) The map $M_U\to M_{U_0}$ is finite \'etale on geometric components (when $n_K=1$, the map $X_U\to X_{U_0}$ is \'etale outside the cusps, which lie over $\{0,1,\infty\}$); composed with the fixed Belyi maps it gives each component $M_{U,i}$ (of $X_U$ when $n_K=1$) a Belyi map of degree $d_i\le Cd_U$, so that its genus is at most $(d_i-1)/2$ by the Riemann--Hurwitz formula, so Javanpeykar's bound \cite[Theorem~1.1.1]{Javanpeykar} gives $h_F(J_U)\le C\sum_id_i^6\le C'\mathfrak N^{24A}$, where $h_F$ is the stable Faltings height, and $\dim J_U\le C\mathfrak N^{4A}$. (iv) Over $K'_z$, with $[K'_z:\Q]\le C\mathfrak N$, Gaudron and R\'emond's bounds \cite[Corollary~1.5 and Theorem~1.4]{GaudronRemond} give $h_F(B_z)\le h_F(J_U)+\frac12\log\kappa_{\rm GR}(J_U)\le C\mathfrak N^{24A}$ and an isogeny between $B_z$ and $A_z$ of degree at most $\kappa_{\rm GR}(B_z)$ with $\log\kappa_{\rm GR}(B_z)\le C(1+\log\mathfrak N)$, so $h_F(A_z)\le C\mathfrak N^{24A}$ (compare \cite[proof of Proposition~7.7]{Sun}). (v) On the fixed curve, Pazuki's comparison of the theta height with the Faltings height \cite[Theorem~1.1 and Corollary~1.3(2)]{Pazuki} gives $h(j_z)\le C(1+\max(0,h_F(A_z)))$ \cite[proof of Proposition~7.7]{Sun}, and $z\mapsto j(x_q(z))$ is a rational function of degree $6$ over $\Q$, so $h(z)\le\frac16h(j_z)+C$. Hence there is $H_1$ with $h(z)\le H_1\mathfrak N^{24A}$ for every $z\in\mathcal D$ without complex multiplication. \emph{Step 9 (complex multiplication).} Let $z\in\mathcal D$ have complex multiplication. Since $j_z\in K$, the moduli point $P_z$ of the fibre on the Shimura curve $X$ of $O$ over $\Q$ lies above a point of $X/W$ of degree at most $n_K$ over $\Q$, so $[\Q(P_z):\Q]\le4n_K$. The point $P_z$ is a CM point for an optimal embedding of an order $S$ of an imaginary quadratic field $k$ into $O$; it is defined over the ring class field $H_S$ of $S$, and $\Gal(H_S/k)\cong\operatorname{Pic}(S)$ acts on such points with orbits of size at least $h(S)/4$ \cite[\S43.8.2, (43.8.3)--(43.8.4), Corollary~30.4.23]{Voight} (the reduced norm maps $O^\times$ onto $\{\pm1\}$, and an embedding and its conjugate fix the same point). So $h(S)\le4[k(P_z):k]\le16n_K$. There are finitely many imaginary quadratic orders of class number at most $16n_K$ (\cite{Heilbronn}, and the class number formula for orders \cite[Theorem~7.24]{Cox}), finitely many CM points for each, and $z\mapsto j_z$ has degree $6$; so the $z\in\mathcal D$ with complex multiplication are finitely many (compare \cite[Lemma~8.7]{Sun}). Put $H=\max\bigl(H_1,\max h(z)\bigr)$, the inner maximum over these $z$, and $\kappa=24A$. Since $\mathfrak N\ge1$, $h(z)\le H\mathfrak N^\kappa$ for every $z\in\mathcal D$. \qed \section{Primes in a quadratic pattern}\label{sec:pattern} For a Gaussian integer $\pi$ put $d_+(\pi)=\Nm(\pi+1)$ and $d_-(\pi)=\Nm(\pi-1)$. The completeness proof (\cref{sec:completeness}) needs primes $u+c_jw^2$ with prescribed Gaussian generators whose adjacent norms are coprime across the pattern. For $(\ell,r)=(13,1+2i)$ and without the class modulo $N_0$ this is \cite[Proposition~10.3]{Sun}; we need the following form, which we derive from \cite[Theorem~4.1]{Sun48} and the appendix of \cite{Glazer}. \begin{theorem}\label{thm:pattern} Let $(\ell,r)$ be $(13,1+2i)$ or $(7,1+3i)$. Let $k\ge2$, let $c_1,\dots,c_k$ be pairwise distinct integers, let $D_0$ and $Y$ be positive integers, $\Lambda_0>0$ a real number, $N_0$ an odd squarefree positive integer prime to $6\ell$, and $\mathcal S$ a finite set of primes. There are positive integers $u,w$ with $D_0\mid w$ and $u/w^2>\Lambda_0$ such that the numbers $p_j=u+c_jw^2$ are distinct primes greater than $Y$ and not in $\mathcal S$, and each $p_j$ is the norm of a Gaussian prime $\pi_j$ with \begin{enumerate}[label=\textup{(\roman*)}] \item $\pi_j\equiv9\pmod{16}$, $\pi_j\equiv i\pmod3$, $\pi_j\equiv r\pmod\ell$ and $\pi_j\equiv i\pmod{N_0}$; \item $v_2(d_+(\pi_j))=2$, $v_2(d_-(\pi_j))=6$, and $\gcd\bigl(d_+(\pi_j),d_-(\pi_h)\bigr)=4$ for all $j,h$; \item $d_+(\pi_j)d_-(\pi_j)$ is prime to $3\ell N_0$. \end{enumerate} \end{theorem} The congruences (i) also give the following, which is how the theorem is used. \needspace{6\baselineskip} \begin{lemma}\label{lem:patterncong} Let $(\ell,r)$ be $(13,1+2i)$ for the first curve and $(7,1+3i)$ for the second, let $N_0$ be an odd squarefree positive integer prime to $6\ell$, let $\pi$ be a Gaussian prime with $\pi\equiv9\pmod{16}$, $\pi\equiv i\pmod3$, $\pi\equiv r\pmod\ell$ and $\pi\equiv i\pmod{N_0}$, and $p=\Nm(\pi)$. Then $p\equiv1\pmod{48}$, $p\equiv\Nm(r)\pmod\ell$, $\pi$ is primary, $v_2(d_+(\pi))=2$, $v_2(d_-(\pi))=6$, and $d_+(\pi)d_-(\pi)$ is prime to $3\ell N_0$. In particular, by \cref{lem:orders}\ref{or:a}, $p$ splits in $F$ and the reductions of $E$ at the two primes of $F$ above $p$ have orders $d_-(\pi)$ and $d_+(\pi)$. \end{lemma} \begin{proof} Write $\pi=x+yi$ with $x=9+16x'$, $y=16y'$. Then $p\equiv81\equiv1\pmod{16}$, $p\equiv\Nm(i)=1\pmod3$ and $p\equiv\Nm(r)\pmod\ell$, that is $p\equiv\Nm(1+2i)=5\pmod{13}$, respectively $p\equiv\Nm(1+3i)=10\equiv3\pmod7$. Since $\pi-1\equiv8\pmod{16}$ and $8=(2+2i)(2-2i)$, $\pi$ is primary. Next $d_+(\pi)=(x+1)^2+y^2$ with $x+1=2\cdot\mathrm{odd}$, so $d_+(\pi)\equiv4\pmod{32}$, and $d_-(\pi)=(x-1)^2+y^2=64\bigl((1+2x')^2+4y'^2\bigr)$ with an odd second factor. Finally $d_\pm(\pi)\equiv\Nm(i\pm1)=2$ modulo $3$ and modulo every prime of $N_0$, and $d_\pm(\pi)\equiv\Nm(r\pm1)$ modulo $\ell$: these are $\Nm(2+2i)=8$ and $\Nm(2i)=4$ modulo $13$ for $r=1+2i$, and $\Nm(2+3i)=13\equiv6$ and $\Nm(3i)=9\equiv2$ modulo $7$ for $r=1+3i$, all units. \end{proof} \begin{proof}[Proof of \cref{thm:pattern}] We use the appendix ``Simultaneous primes with coprime adjacent norms'' of \cite{Glazer}, which follows the strategy of \cite[\S6]{OpenAI} and \cite{Sun48}. Its main theorem, which is \cite[Theorem~4.1]{Sun48}, reads: for distinct integers $c_1,\dots,c_k$ ($k\ge2$), $q\ge1$, an odd squarefree $M$ with $7\nmid M$, and $H,Y>0$, there are positive integers $u,w$ with $q\mid w$, $u/w^2>H$ and every $p_j=u+c_jw^2>Y$ prime, such that each $p_j$ has a Gaussian prime generator $\pi_j$ with $\pi_j\equiv9\pmod{16}$, $\pi_j\equiv1+3i\pmod7$ and $\pi_j\equiv i\pmod M$; no odd prime divides both $d_-(\pi_j)$ and $d_+(\pi_j)$, nor, for $j\ne h$, both $d_\epsilon(\pi_j)$ and $d_\eta(\pi_h)$ for any signs $\epsilon,\eta$; $v_2(d_-(\pi_j))=6$, $v_2(d_+(\pi_j))=2$ and $\gcd(d_-(\pi_j),d_+(\pi_h))=4$ for all $j,h$; and all these norms are prime to $M$. For $(\ell,r)=(7,1+3i)$ we apply it with $M=3N_0$, which is odd, squarefree and prime to $7$, $q=D_0$, $H=\Lambda_0$, and $Y$ larger than every element of $\mathcal S$. For $(\ell,r)=(13,1+2i)$ we apply it in the same way with $13$ and $1+2i$ in place of $7$ and $1+3i$ (so with $13\nmid M$). The class modulo $7$ enters the proof in three places: the base residue, modulo a multiple of $16\cdot7M$, must be a unit residue that is $1+3i$ modulo $7$; the two complex-conjugate ray classes it determines are distinct (an equality would make the base residue a Gaussian unit times its conjugate; modulo $16$ the unit must be $1$, and then $1+3i\equiv1-3i\pmod7$, which is false); and the adjacent norms of $1+3i$ are units modulo $7$. All three hold for $1+2i$ modulo $13$: $\Nm(1+2i)=5$ is prime to $13$; $1-2i\not\equiv1+2i\pmod{13}$; and $\Nm(2+2i)=8$ and $\Nm(2i)=4$ are units modulo $13$. In both cases $\pi_j\equiv i\pmod3$ because $3\mid M$; distinct $c_j$ give distinct $p_j$; and (ii), (iii) are part of the conclusion and of \cref{lem:patterncong}. The proof of the appendix's theorem, with these substitutions, rests on the following published results, each applied at a fixed ray class field of $\Q(i)$ and a fixed modulus: Mitsui's prime ideal theorem for Hecke characters of a fixed field \cite[\S1, Lemma~15, p.~12]{Mitsui}; the quantitative equidistribution of polynomial orbits on nilmanifolds \cite[Theorem~2.9 and Lemma~4.5]{GreenTaoNil}, the orthogonality of the M\"obius function to nilsequences \cite[\S\S2--3]{GreenTaoMobius} and the inverse theorem for the Gowers norms \cite[Theorem~1.3]{GTZ}; the normal form of linear systems, the linear forms and correlation conditions, the pseudorandom majorant and the generalised von Neumann theorem of \cite[Lemma~4.4, Definitions~6.1--6.3, Propositions~6.4 and~7.1, Appendix~D]{GreenTao}; the inverse theorem for interval norms of \cite[Theorem~5.1]{DodosKanellopoulos}; the dense model and local uniformity theorems and the polynomial forms condition for polynomial patterns of \cite[Theorems~9, 11, 13 and~15, Corollary~3, Proposition~6]{TaoZiegler}; and the sieves for quadrics of \cite[Theorem~4.1]{BrowningLoughran} and \cite[Lemmas~2.1 and~4.1]{BrowningHeathBrown}. The appendix follows the ideal-norm method of Frei and Tinkov\'a \cite[Theorem~1.4]{FreiTinkova}. Two of these results are stated for the modulus $\prod_{p\le w}p$: Tao and Ziegler's theorems, and Green and Tao's majorant. The appendix applies them at the moduli $\Delta\prod_{p\le v,\,p\nmid\Delta}p$ and $V_z=\Delta\prod_{p\le z,\,p\nmid\Delta}p$, where $\Delta$ is its fixed modulus, a multiple of the conductor of the maximal abelian subfield of its ray class field. \Cref{app:twosteps} carries out these two steps (\cref{lem:centring,lem:majorant}). They hold for every fixed $\Delta$, so for both choices of $(\ell,r)$. With them in place of the appendix's two steps, its argument gives the theorem; its conclusion is ineffective, through Siegel zeros in Mitsui's theorem and a qualitative error term. \end{proof} For the third and fourth curves the reductions at the two primes above a pattern prime have orders $\Nm(\pi-\epsilon)$ and $\Nm(\pi-\eta i)$ with unknown signs (\cref{lem:orders}\ref{or:b}), so the pattern has to control all four norms $\Nm(\pi-\alpha)$, $\alpha\in\{\pm1,\pm i\}$. We derive the following from the appendix of \cite{Glazer} in the same way. \begin{theorem}\label{thm:pattern4} Let $(\ell,r)$ be $(7,1+3i)$ or $(89,1+5i)$. Let $k\ge2$, let $c_1,\dots,c_k$ be pairwise distinct integers, let $D_0$ and $Y$ be positive integers, $\Lambda_0>0$ a real number, $N_0$ an odd squarefree positive integer prime to $30\ell$, and $\mathcal S$ a finite set of primes. There are positive integers $u,w$ with $D_0\mid w$ and $u/w^2>\Lambda_0$ such that the numbers $p_j=u+c_jw^2$ are distinct primes greater than $Y$ and not in $\mathcal S$, and each $p_j$ is the norm of a Gaussian prime $\pi_j$ with \begin{enumerate}[label=\textup{(\roman*)}] \item $\pi_j\equiv9\pmod{16}$, $\pi_j\equiv1+i\pmod3$, $\pi_j\equiv6\pmod{25}$, $\pi_j\equiv r\pmod\ell$ and $\pi_j\equiv1+i\pmod{N_0}$; \item for all $j,h$, $j=h$ included, and all $\epsilon,\eta\in\{1,-1\}$, no odd prime divides both $\Nm(\pi_j-\epsilon)$ and $\Nm(\pi_h-\eta i)$; and $v_2(\Nm(\pi_j-1))=6$, $v_2(\Nm(\pi_j+1))=2$, $v_2(\Nm(\pi_j\mp i))=1$; \item $v_5(\Nm(\pi_j-1))=2$, $5$ divides none of $\Nm(\pi_j+1)$, $\Nm(\pi_j-i)$, $\Nm(\pi_j+i)$, and each $\Nm(\pi_j-\alpha)$, $\alpha\in\{\pm1,\pm i\}$, is prime to $3\ell N_0$. \end{enumerate} \end{theorem} \needspace{4\baselineskip} \begin{lemma}\label{lem:patterncong4} Let $(\ell,r)$ be $(7,1+3i)$ for the third curve and $(89,1+5i)$ for the fourth, let $N_0$ be an odd squarefree positive integer prime to $30\ell$, divisible by $17$ for the fourth curve, let $\pi$ be a Gaussian prime with the congruences \textup{(i)} of \cref{thm:pattern4}, and $p=\Nm(\pi)$. Then $p\equiv1\pmod{16}$, $p\equiv2\pmod3$, $p\equiv\Nm(r)\pmod\ell$, $\pi$ is primary, and the four norms $\Nm(\pi-\alpha)$ have the valuations at $2$ and $5$ stated in \cref{thm:pattern4}\textup{(ii)}, \textup{(iii)} and are prime to $3\ell N_0$. Moreover $p$ splits in $F$, $p\notin\mathcal P$ and $\bigl(\frac{\Nm_{F/\Q}(A)}p\bigr)=-1$; so, by \cref{lem:orders}\ref{or:b}, the reductions of $E$ at the prime $\mathfrak p_+$ of $F$ above $p$ at which $A$ is a square and at $\sigma\mathfrak p_+$ have orders $\Nm(\pi-\epsilon)$ and $\Nm(\pi-\eta i)$ for some $\epsilon,\eta\in\{1,-1\}$. \end{lemma} \begin{proof} Write $\pi=x+yi$. As in the proof of \cref{lem:patterncong}, $p\equiv1\pmod{16}$, $\pi$ is primary, $v_2(\Nm(\pi-1))=6$ and $v_2(\Nm(\pi+1))=2$; and $\Nm(\pi\mp i)=x^2+(y\mp1)^2$ with $x$ and $y\mp1$ odd is $2$ modulo $4$. Since $\pi-1=5(1+5t)$ with $t\in\Z[i]$, $\Nm(\pi-1)=25\Nm(1+5t)$ with $\Nm(1+5t)\equiv1\pmod5$; and as $\pi\equiv1\pmod5$, $\Nm(\pi+1)\equiv4$ and $\Nm(\pi\mp i)\equiv2\pmod5$. Modulo $3$ and modulo every prime of $N_0$, $p\equiv\Nm(1+i)=2$, and the norms $\Nm(1+i-\alpha)$ are $1$, $5$, $1$, $5$ for $\alpha=1,-1,i,-i$, units as $5\nmid N_0$. Modulo $\ell$, $p\equiv\Nm(r)$, which is $10\equiv3\pmod7$, respectively $26\pmod{89}$, and the norms $\Nm(r-\alpha)$ are $9$, $13$, $5$, $17$, that is $2$, $6$, $5$, $3$ modulo $7$, respectively $25$, $29$, $17$, $37$, units modulo $89$. For the third curve, $\bigl(\frac2p\bigr)=1$ as $p\equiv1\pmod8$, so $p$ splits in $\Q(\sqrt2)$; $p\ne7$; and $\bigl(\frac{-7}p\bigr)=\bigl(\frac p7\bigr)=\bigl(\frac37\bigr)=-1$. For the fourth, $17\mid N_0$ gives $p\equiv2\pmod{17}$, so $\bigl(\frac{17}p\bigr)=\bigl(\frac2{17}\bigr)=1$ and $p$ splits in $\Q(\sqrt{17})$; $p\notin\{2,17,89\}$; and, as $p\equiv1\pmod8$ and $89\equiv1\pmod4$, $\bigl(\frac{-178}p\bigr)=\bigl(\frac p{89}\bigr)=\bigl(\frac{26}{89}\bigr)=\bigl(\frac{13}{89}\bigr)=\bigl(\frac{11}{13}\bigr)=-1$. \end{proof} \begin{proof}[Proof of \cref{thm:pattern4}] We apply the appendix of \cite{Glazer} as in the proof of \cref{thm:pattern}, with $M=3N_0$, $q=D_0$, $H=\Lambda_0$, $Y$ larger than every element of $\mathcal S$, and $\ell$, $r$ in place of $7$, $1+3i$. The adjacent norms and the base class enter its proof at the following places, which change as stated; the rest of the proof is unchanged. \begin{enumerate}[label=\textup{(\arabic*)}] \item The statement: the classes \textup{(i)} and the conclusions \textup{(ii)}, \textup{(iii)}. The forbidden common divisors are those of \textup{(ii)}: the appendix's condition that no odd prime divide two of the norms $\Nm(\pi_j\pm1)$ is dropped, as $5$ divides every $\Nm(\pi_j-1)$. \item The counts over finite fields and the sieve over medium primes, for two positions. A count in which $\Nm(z'-\eta i)$ vanishes for the second Gaussian integer $z'$ becomes, after the substitution $z'\mapsto-iz'$, the count in which $\Nm(z'+\eta)$ vanishes: the substitution preserves the norm of $z'$, the box and the region of the appendix, and $\Nm(-iz'+\eta)=\Nm(z'+\eta i)$. So the counts, and the bounds the appendix proves for them, are unchanged; the sieve of \cite[Theorem~4.1]{BrowningLoughran} sees the residue sets only through their sizes. \item Large common divisors: the same substitution reduces each new pair of norms to a pair the appendix treats. \item One position: an odd prime dividing both $\Nm(z-\epsilon)=(a-\epsilon)^2+b^2$ and $\Nm(z-\eta i)=a^2+(b-\eta)^2$, $z=a+bi$, divides their difference $2(\eta b-\epsilon a)$; so $b\equiv\epsilon\eta a$ and it divides $2a^2-2\epsilon a+1$. The polynomials $b-\epsilon\eta a$ and $2a^2-2\epsilon a+1$ have no common factor and no common prime content, so \cite[Lemma~2.1]{BrowningHeathBrown} gives the bound of the appendix for this pair. \item The base residue is $9$ modulo $16$, $r$ modulo $\ell$, $6$ modulo $25$, and $1+i$ modulo the other odd primes of the fixed modulus. It is a unit residue, and the two complex-conjugate ray classes it determines are distinct, as in the proof of \cref{thm:pattern}, since $r\not\equiv\bar r\pmod\ell$. \item The abelian fibres: at a cutoff prime the condition is that none of the four norms $\Nm(z-\alpha)$ vanishes. In a fibre of the norm this excludes at most $8$ residues, two for each $\alpha$, and the set of allowed residues is stable under conjugation; so the lower bounds of the appendix hold with $1-8/(\ell'-1)$ and $(\log L)^{-8k}$ in place of $1-4/(\ell'-1)$ and $(\log L)^{-4k}$. \item The final choice of $L$, with $(\log L)^{8k}$ in place of $(\log L)^{4k}$. The ray conditions exclude every odd prime at most $L$ from each of the four norms $\Nm(\pi_j-\alpha)$, except $5$, which divides $\Nm(\pi_j-1)$ only, exactly to the power $2$; the valuations at $2$ and $5$ and the units at $3$, $\ell$ and $N_0$ are those of \cref{lem:patterncong4}. \end{enumerate} The class prime $\ell$ divides the fixed modulus, so it is never a cutoff prime. The proof rests on the published results listed in the proof of \cref{thm:pattern}, with the two steps of \cref{app:twosteps}, which hold for every fixed modulus; its conclusion is ineffective, as there. \end{proof} \section{The pole predicate}\label{sec:pole} Let $\mathcal M=\{\mu_0,\,17\mu_0:\ \mu_0\in\{1,2,3,5,6,7,10,14\}\}$, a set of sixteen positive integers whose prime factors are $2,3,5,7$ and $17$. For a field $k\supseteq\Q$ and $b\in k$, let $\Phi_k(b)$ be the statement: $b=0$, or for some $\mu\in\mathcal M$, with \[ A=\mu b\quad\text{and}\quad H_b=A(A-b^2), \] there are $e,w\in k$ with $A\,e\,H_b\,w\ne0$ such that \begin{equation}\label{eq:pole} A(A-e)(A+e)\qquad\text{and}\qquad A(Aw^2-eH_b)(Aw^2+eH_b) \end{equation} are squares in $k$. This is the predicate of \cite[(3.2)]{OpenAI} in the two-parameter form of \cite[Proposition~2.5]{Sun48}, with the curves $y^2=x(x-e)(x+3e)$ replaced by the congruent-number twists $y^2=x^3-e^2x$ as in \cite{Companion}, and with the list $\mathcal M$. \needspace{4\baselineskip} \begin{lemma}\label{lem:PK} Let $k$ be a number field, $b\in k^\times$ with $\Phi_k(b)$, and $\mathfrak P$ a prime of $k$ not above $2,3,5,7$ or $17$. If $v_{\mathfrak P}(b)<0$, then $v_{\mathfrak P}(b)$ is even. \end{lemma} \begin{proof} Write $v=v_{\mathfrak P}$ and suppose $v(b)=r<0$ is odd; let $\mu$ be the multiplier used, a $\mathfrak P$-unit. Then $v(A)=r$, $v(b^2)=2r0$ then $X\mp L$ are units and $v(X(X-L)(X+L))=v(X)$; if $v(X)<0$ then $v(X\mp L)=v(X)$ and the valuation is $3v(X)$. In both cases it is odd, while $v(Y^2)$ is even. \end{proof} The completeness proof rests on the following theorem. \needspace{4\baselineskip} \begin{theorem}[{\cite[Theorem~1.2]{Companion}}]\label{thm:companion} Let $\beta>1$ and $\theta\ge1$ be coprime squarefree integers with $\beta\equiv\theta\equiv1\pmod8$, such that $\theta$ is a square modulo every prime dividing $\beta$ and $\beta$ is a square modulo every prime dividing $\theta$. Then there is a positive squarefree integer $n$ such that the curves $y^2=x^3-n^2x$ and $y^2=x^3-(n\theta)^2x$ both have analytic rank one and Mordell--Weil rank one, and each has a rational point of infinite order with abscissa in $\beta\Q^{\times2}$. \end{theorem} \begin{lemma}\label{lem:PQ} Let $B\in\Q$ with $0B>0$, and $\beta>1$ as $\mu B$ is not a square. At $2$: $\beta$ is odd and $\equiv1\pmod8$ since $\mu B\in\Q_2^{\times2}$; $v_2(B/\mu)\ge3$, so $1-B/\mu\in1+8\Z_2$ and $\theta\equiv1\pmod8$. At $p\in\{3,5,7,17\}$: $v_p(\mu)\le1$, so $1-B/\mu\in1+p\Z_p$, hence $p\nmid\theta$ and $\theta$ is a nonzero square modulo $p$. At an odd prime $p\notin\{3,5,7,17\}$: if $v_p(B)>0$, then $1-B/\mu\in1+p\Z_p$, so $p\nmid\theta$ and $\theta$ is a square modulo $p$, and $p\mid\beta$ exactly when $v_p(B)$ is odd; if $v_p(B)<0$, it is even, so $p\nmid\beta$, and $1-B/\mu=-(B/\mu)(1-\mu/B)$ has even valuation, so $p\nmid\theta$; if $v_p(B)=0$, then $p\nmid\beta$, and if $p\mid\theta$ then $B\equiv\mu\pmod p$, so $\mu B\equiv\mu^2$ and $\beta$ is a nonzero square modulo $p$. So every prime dividing $\beta$ is prime to $\theta$ and $\theta$ is a square modulo it, and $\beta$ is a square modulo every prime dividing $\theta$. \emph{The witnesses.} \Cref{thm:companion} gives $n$ and points $P_1$ on $y^2=x^3-n^2x$ and $P_2$ on $y^2=x^3-(n\theta)^2x$ with $x(P_1),x(P_2)\in\beta\Q^{\times2}=A\Q^{\times2}$. Write $x(P_1)=A\lambda^2$ and $H_B=\theta c^2$ with $\lambda,c\in\Q^\times$, and put $e=n/\lambda^2$. The map $(x,y)\mapsto(x/\lambda^2,y/\lambda^3)$ takes $y^2=x^3-n^2x$ to $y^2=x^3-e^2x$ and $P_1$ to a point with abscissa $A$, so $A(A-e)(A+e)=(y(P_1)/\lambda^3)^2$. With $\rho=c/\lambda$ we have $eH_B=n\theta\rho^2$, and $(x,y)\mapsto(\rho^2x,\rho^3y)$ takes $y^2=x^3-(n\theta)^2x$ to $y^2=x^3-(eH_B)^2x$ and $P_2$ to a point with abscissa $\rho^2x(P_2)=Aw^2$, $w\in\Q^\times$; then $w^2\cdot A(Aw^2-eH_B)(Aw^2+eH_B)=(\rho^3y(P_2))^2$. Finally $A,e,H_B,w\ne0$. \end{proof} \needspace{8\baselineskip} \section{Local lemmas}\label{sec:local} \subsection{Integers, a Lucas relation and heights} \begin{lemma}[{\cite[Lemma~12.1]{Sun}}]\label{lem:rigid} Let $k$ be a totally real number field and $x\in k$. Then $x^3+x\in\Z$ if and only if $x\in\Z$. \end{lemma} \begin{proof} If $x^3+x=c\in\Z$, then $x$ is a root of $T^3+T-c$, so it is an algebraic integer, and every conjugate of $x$ is a real root of this polynomial. As $t\mapsto t^3+t$ is strictly increasing on $\R$, there is only one real root, so $x$ equals all its conjugates and lies in $\Q$; being integral, $x\in\Z$. The converse is clear. \end{proof} Put \begin{equation}\label{eq:lucas} \mathcal L(X_1,X_2,X_3,X_4)=X_3^2-X_2(X_2-2)X_3X_4+(X_2-2)^2X_4^2-1 , \end{equation} a polynomial that does not involve $X_1$. \begin{lemma}[{\cite[Lemma~12.4]{Sun}, \cite[Lemma~14.9]{GlazerV15}}]\label{lem:lucas} \begin{enumerate}[label=\textup{(\alph*)}] \item If $n_2,n_3,n_4\in\Z$, $|n_2|\ge7$, $n_4\ne0$ and $\mathcal L(X_1,n_2,n_3,n_4)=0$, then $|n_3|>\exp(|n_2|-3)$. \item For every integer $n_2\ge7$ there are positive integers $n_3,n_4$ with $\mathcal L(X_1,n_2,n_3,n_4)=0$. \end{enumerate} \end{lemma} \begin{proof} Put $a=|n_2|$, $w=\operatorname{sgn}(n_2)(n_2-2)n_4$, so that $\mathcal L=0$ reads $n_3^2-an_3w+w^2=1$. Let $U_0=0$, $U_1=1$, $U_{k+1}=aU_k-U_{k-1}$, and $\rho=(a+\sqrt{a^2-4})/2>1$, so that $\rho+\rho^{-1}=a$ and $U_k=(\rho^k-\rho^{-k})/(\rho-\rho^{-1})$. The integer solutions $(t,w)$ of $t^2-atw+w^2=1$ are the pairs with $t-w\rho^{-1}$, or equivalently $t-w\rho$, a unit of norm one of $\Z[\rho]$, and the units of norm one of $\Z[\rho]$ are $\pm\rho^k$, $k\in\Z$: a unit $\upsilon>0$ of norm one can be moved into $[1,\rho)$ by a power of $\rho$, and then $\upsilon=c_0+c_1\rho$ with $c_1=(\upsilon-\upsilon^{-1})/(\rho-\rho^{-1})\in[0,1)\cap\Z=\{0\}$, so $\upsilon=1$. For $k\ge0$, induction gives $\rho^k=U_{k+1}-U_k\rho^{-1}$, hence $\rho^{-k}=U_{k+1}-U_k\rho$ and, with $\rho^{-1}=a-\rho$, $\rho^k=-U_{k-1}+U_k\rho$ for $k\ge1$. So the solutions with $w\ne0$ have $|w|=U_k$ and $|t|\in\{U_{k-1},U_{k+1}\}$ for some $k\ge1$. (a) Here $w\ne0$. Since $a\equiv2\pmod{a-2}$ and $a\equiv-2\pmod{a+2}$, induction gives $U_k\equiv k\pmod{a-2}$ and $U_k\equiv(-1)^{k-1}k\pmod{a+2}$. The integer $|n_2-2|$, which is $a-2$ if $n_2>0$ and $a+2$ if $n_2<0$, divides $w$, hence $U_k$, hence $k$; so $k\ge a-2$. Since $U_{j+1}\ge(a-1)U_j$ for $j\ge1$, $|n_3|\ge U_{k-1}\ge(a-1)^{k-2}\ge(a-1)^{a-4}$, and $(a-1)^{a-4}>e^{a-3}$ for $a\ge7$ (at $a=7$, $216>e^4$, and $(a-4)\log(a-1)-(a-3)$ increases with $a$). (b) Take $a=n_2$, $k=2(n_2-2)$, $n_3=U_{k+1}$ and $n_4=U_k/(n_2-2)$, an integer as $U_k\equiv k\equiv0\pmod{n_2-2}$. Then $\mathcal L=U_{k+1}^2-aU_{k+1}U_k+U_k^2-1=0$, and both are positive. \end{proof} For $\alpha\in K^\times$ let $\mathfrak a(\alpha)=\prod_{v_{\mathfrak P}(\alpha)>0}\mathfrak P^{v_{\mathfrak P}(\alpha)}$ be its numerator ideal. With $h(\alpha)=\frac1{n_K}\sum_v n_v\log\max(1,|\alpha|_v)$, the sum over the places of $K$ with local degrees $n_v$, the product formula gives \begin{equation}\label{eq:numerator} \log\Nm\mathfrak a(\alpha)=\sum_{v_{\mathfrak P}(\alpha)>0}v_{\mathfrak P}(\alpha)\log N\mathfrak P\le\sum_{v\text{ finite}}n_v\log\max(1,|\alpha^{-1}|_v)\le n_Kh(\alpha^{-1})=n_Kh(\alpha). \end{equation} We also use that a rational function $\varphi$ of degree $d$ over $\Q$, a morphism $\mathbb P^1\to\mathbb P^1$ of degree $d$, satisfies $h(\varphi(t))=d\,h(t)+O(1)$ for $t\in\overline\Q$ (\cite[Theorem~VIII.5.6]{Silverman}, after taking logarithms), and the elementary bounds $h(st)\le h(s)+h(t)$ and $h(s+t)\le h(s)+h(t)+\log2$. \subsection{The formal group of the index curve}\label{ssec:formal} For a point $V\ne O$ of $E$ put $\rho(V)=1/x(V)$ and $\mathfrak z(V)=-x(V)/y(V)$ when these are defined, and $\rho(O)=\mathfrak z(O)=0$. Let $\ell(T)=\sum_{t\ge1}(c_t/t)T^t$ be the formal logarithm of $E$ at the parameter $\mathfrak z$, normalised by $c_1=1$; its coefficients lie in $F$, and $\ell_m(T)=\sum_{t\le m}(c_t/t)T^t$ is its truncation in degree $m$. For the conjugate curve $E^\sigma$ the same objects are $\ell^\sigma$, $\ell_m^\sigma$, with conjugate coefficients. \emph{Setting.} Let $\mathcal Q$ be a prime of $L$, or of $F$, above a rational prime $p\ge5$, $p\notin\mathcal P$, with $\mathcal Q$ unramified over $\Q$. Let $R$ be the valuation ring of $L_{\mathcal Q}$, $\mathfrak m$ its maximal ideal and $v$ its valuation, with $v(p)=1$. By \ref{E2} the equation \eqref{eq:E} has good reduction at $\mathcal Q$ and is minimal there, and so does its conjugate. Let $E_1(L_{\mathcal Q})=\{O\}\cup\{V:v(x(V))<0\}$ be the kernel of reduction. From \cite{Silverman}: the formal group of \eqref{eq:E} is defined over $R$ \cite[Example~IV.2.2.3]{Silverman}; its normalised invariant differential has coefficients in $R$ \cite[Proposition~IV.4.2]{Silverman}, so $c_t\in R$ \cite[\S IV.5]{Silverman}; $V\mapsto\mathfrak z(V)$ is an isomorphism of $E_1(L_{\mathcal Q})$ onto the formal group on $\mathfrak m$, with $v(x(V))=-2v(\mathfrak z(V))$ for $V\ne O$ \cite[Proposition~VII.2.2 and Proposition~IV.1.1]{Silverman}; and $\ell$ is a homomorphism from the formal group on $\mathfrak m$ to $L_{\mathcal Q}$ \cite[\S\S IV.5--IV.6]{Silverman}. In particular $V\in E_1(L_{\mathcal Q})$ if and only if $v(\rho(V))\ge1$. \begin{lemma}\label{lem:formal} In the Setting, let $Z\in\mathfrak m$. \begin{enumerate}[label=\textup{(\alph*)}] \item $v(\ell(Z))=v(\ell_m(Z))=v(Z)$ for every $m\ge1$. \item If $p>m+1$, then $v(\ell(Z)-\ell_m(Z))\ge v(Z)+m$. \item Let $Y\in E(L)$, and let $n,n'$ be integers, $n'\ne0$, with $[n]Y,[n']Y\in E_1(L_{\mathcal Q})$ and $[n']Y\ne O$. Then $v(\mathfrak z([n]Y))-v(\mathfrak z([n']Y))=v_p(n/n')$, the quotient $\Lambda=\ell_m(\mathfrak z([n]Y))/\ell_m(\mathfrak z([n']Y))$ is defined and $v(\Lambda)=v_p(n/n')$; and if $p>m+1$ and $v_p(n/n')\ge0$, then $v(\Lambda-n/n')\ge m$. \end{enumerate} The same holds for $E^\sigma$ with $\ell^\sigma,\ell^\sigma_m$. Part~(c) is the analogue of \cite[Proposition~2.2]{OpenAI} for $E$. \end{lemma} \begin{proof} (a) For $t\ge2$, $v((c_t/t)Z^t)\ge v(Z)+(t-1)-v_p(t)>v(Z)$, because $v_p(t)\le\log_3tm+1$ and $v_p(r)\ge0$, then $\ell_m(Z)-r\ell_m(Z')=(\ell_m-\ell)(Z)-r(\ell_m-\ell)(Z')$ has valuation at least $v(Z')+m$ by (b), as $v(Z)\ge v(Z')$; dividing by $\ell_m(Z')$ gives $v(\Lambda-r)\ge m$. \end{proof} For $V\in E(L)$ let $V^\tau\in E^\sigma(L)$ be the point with $\tau$-conjugate coordinates; $\tau$ is a group isomorphism $E(L)\to E^\sigma(L)$. \begin{lemma}[{\cite[Lemma~9.2]{Sun}}]\label{lem:anchor} Let $m\ge1$ and $c_*\ne0$ be integers, and let $\mathcal Q$ be as in the Setting with $p>m+1$ and $p\nmid c_*$. Let $h,u_i,n_i$ $(1\le i\le4)$ be integers with $h\ne0$ and $h\ne c_*$, and put $H=[h]P$, $U_i=[u_i]P$, $P_i=[n_i]P$, $V_0=H-[c_*]P$ and $V_i=U_i-[c_*]P_i$, where $P$ is a point of infinite order of $E(L)$. Suppose that $H,U_i\in E_1(L_{\mathcal Q})$, that $V_0^\tau,V_i^\tau\in E^\sigma_1(L_{\mathcal Q})$, and that \[ L_i=\frac{\ell_m(\mathfrak z(U_i))}{\ell_m(\mathfrak z(H))},\qquad L_i'=\frac{\ell^\sigma_m(\mathfrak z(V_i^\tau))}{\ell^\sigma_m(\mathfrak z(V_0^\tau))} \] satisfy $v(L_i-L_i')\ge m$ for $1\le i\le4$. Then $v(L_i-n_i)\ge m$ for $1\le i\le4$. Consequently $v(f(L_1,\dots,L_4))\ge m$ for $f\in\Z[X_1,\dots,X_4]$ implies $p^m\mid f(n_1,\dots,n_4)$. \end{lemma} Here $V_0^\tau=[h-c_*]P^\tau$ and $V_i^\tau=[u_i-c_*n_i]P^\tau$. The shifted anchor $V_0$ is the device of \cite[Lemma~2.3 and Corollary~6.2]{OpenAI}, with $c_*$ in place of $4$. \begin{proof} Since $p\nmid c_*$, one of $h$, $h-c_*$ is prime to $p$. If $p\nmid h$, \cref{lem:formal}(c) on $E$ with $Y=P$ gives $v(L_i-u_i/h)\ge m$; then $v(L'_i)\ge0$, so by \cref{lem:formal}(c) on $E^\sigma$ with $Y=P^\tau$ the index quotient $(u_i-c_*n_i)/(h-c_*)$ has $v_p\ge0$ and $v(L'_i-(u_i-c_*n_i)/(h-c_*))\ge m$. If $p\nmid h-c_*$ the same argument runs in the other order. In both cases $hL_i\equiv u_i$ and $(h-c_*)L'_i\equiv u_i-c_*n_i$ modulo $\mathfrak m^m$, and therefore \[ c_*L_i=hL_i-(h-c_*)L'_i-(h-c_*)(L_i-L'_i)\equiv c_*n_i\pmod{\mathfrak m^m}. \] Divide by the unit $c_*$. The last assertion follows because $v$ restricts to $v_p$ on $\Q$. \end{proof} \begin{lemma}[{\cite[Lemma~12.3]{Sun}}]\label{lem:scalar} Let $p\ge5$, $p\notin\mathcal P$, be a prime, $m\ge1$, $P\in E(F)$ a point of infinite order, and $h,c$ nonzero integers. Write $\rho([h]P)=G_1+\sqrt d\,G_2$, $\rho([c]P)=G_3+\sqrt d\,G_4$ and $\mathfrak z([c]P)/\mathfrak z([h]P)=G_5+\sqrt d\,G_6$ with $G_k\in\Q$. If $v_p(G_k)\ge1$ for $k\le4$ and $v_p(G_5),v_p(G_6)\ge m$, then $p^m\mid c$. \end{lemma} \begin{proof} Let $\mathfrak Q$ be a prime of $F$ above $p$; it is unramified, $\sqrt d$ is a unit at it, as $p\nmid2d$, and the Setting applies over $F_{\mathfrak Q}$. Then $v_{\mathfrak Q}(\rho([h]P))\ge1$ and $v_{\mathfrak Q}(\rho([c]P))\ge1$, so $[h]P,[c]P\in E_1(F_{\mathfrak Q})$, both $\ne O$; and $v_{\mathfrak Q}(\mathfrak z([c]P)/\mathfrak z([h]P))\ge m$. By \cref{lem:formal}(c), $v_p(c)-v_p(h)\ge m$, so $v_p(c)\ge m$. \end{proof} \subsection{The tube in the certificate}\label{ssec:tubeuse} Fix $q$ and $\mathfrak q$ as in \cref{thm:height}, and put \[ \theta_0=0,\qquad\theta_i=\frac q{\gamma_i-1}\ (1\le i\le6),\qquad\mathcal T=\{\theta_0,\dots,\theta_6\}. \] By \cref{lem:intube}(a) the $\theta_i$ are seven distinct rationals whose denominators are prime to $q$, and they lie in $(-(q+1),0]$, because $\gamma_i<1/(q+1)$ for every $i$ (\cref{lem:fixed}(a)). \begin{lemma}[{\cite[Lemma~9.3 and (12.4)--(12.8)]{Sun}}]\label{lem:shift} \begin{enumerate}[label=\textup{(\alph*)}] \item Let $\eta=a_0^2+b_0^2\ne0$ with $a_0,b_0\in K$, and let $A\in K^{\times2}$ be totally positive. Then $s=A\eta+1/q$ is totally positive and $v_{\mathfrak q}(s)\le-1$. \item Let $s\in K$ be totally positive with $v_{\mathfrak q}(s)\le0$. Then $1+q/s\in\mathcal D$. Let $\Sigma'\supseteq\Sigma$ contain the primes at which some $\theta_i$ $(i\ge1)$ or $1-\gamma_i$ has nonzero valuation. For $\mathfrak P\notin\Sigma'$, $1+q/s$ has positive odd contact with a point of $\mathcal C_q$ at $\mathfrak P$ if and only if $v_{\mathfrak P}(s-\theta)$ is positive and odd for some $\theta\in\mathcal T$; and $|h(1+q/s)-h(s)|\le C$ with $C$ depending only on $q$. \item Let $R_\psi(t)=C_*D(t)\prod_{i=1}^6\bigl((10q+1-\gamma_i)D(t)+q^2t\bigr)$, where $D(t)=1+q^2t^2$ and $C_*$ is the least positive integer with $R_\psi\in\Z[t]$. Then $R_\psi$ has degree $14$ and is positive on $\R$. Let $\Sigma''\supseteq\Sigma$ contain the primes dividing $C_*$, the leading coefficients of the seven quadratic factors, and their pairwise resultants. For $t\in K$ and $\mathfrak P\notin\Sigma''$, $\psi_q(t)$ has positive odd contact with a point of $\mathcal C_q$ at $\mathfrak P$ if and only if $v_{\mathfrak P}(R_\psi(t))$ is positive and odd; and if $v_{\mathfrak P}(t)<0$ then $v_{\mathfrak P}(R_\psi(t))=14v_{\mathfrak P}(t)$. \end{enumerate} \end{lemma} \begin{proof} (a) At every real place $\eta>0$ (a nonzero sum of two real squares), $A>0$ and $1/q>0$. The residue field of $\mathfrak q$ has $q^f$ elements with $f$ odd and $q\equiv3\pmod4$, so $-1$ is not a square in it; with $\mu=\min(v_{\mathfrak q}(a_0),v_{\mathfrak q}(b_0))$ the residues of $a_0\varpi^{-\mu}$ and $b_0\varpi^{-\mu}$ ($\varpi$ a uniformiser) are not both zero, so their squares do not cancel and $v_{\mathfrak q}(\eta)=2\mu$. Hence $v_{\mathfrak q}(A\eta)$ is even while $v_{\mathfrak q}(1/q)=-1$, so $v_{\mathfrak q}(s)=\min(v_{\mathfrak q}(A\eta),-1)\le-1$. (b) The first assertion is \cref{lem:intube}(c). For $1\le i\le6$, $1+q/s-\gamma_i=(1-\gamma_i)(s-\theta_i)/s$, and $1/(1+q/s)=s/(s+q)$. Let $\mathfrak P\notin\Sigma'$, so $q$, $\theta_i$ $(i\ge1)$, $1-\gamma_i$ and the differences of the $\theta$'s are $\mathfrak P$-units (the last as $\Sigma\subseteq\Sigma'$). If $v_{\mathfrak P}(s-\theta_i)>0$ for some $i\ge1$ then $v_{\mathfrak P}(s)=0$ and the contact with $\gamma_i$ is $v_{\mathfrak P}(s-\theta_i)$; if $v_{\mathfrak P}(s)>0$, the contact with $\infty$ is $v_{\mathfrak P}(s)=v_{\mathfrak P}(s-\theta_0)$; and if no $s-\theta$ has positive valuation, then $v_{\mathfrak P}(s)\le0$ and no contact is positive. The height bound holds because $s\mapsto1+q/s$ is a Möbius transformation over $\Q$. (c) Since $10q+1-\gamma_i>10q-1>q/2$, each factor $(10q+1-\gamma_i)(1+u^2)+qu$, $u=qt$, has negative discriminant in $u$, so $R_\psi>0$ on $\R$. Write $f_0=D$ and $f_i=(10q+1-\gamma_i)D+q^2t$, so that $\psi_q(t)-\gamma_i=f_i(t)/D(t)$ and $1/\psi_q(t)=D(t)/((10q+1)D(t)+q^2t)$. Let $\mathfrak P\notin\Sigma''$. If $v_{\mathfrak P}(t)<0$, each $f_i(t)$ has valuation $2v_{\mathfrak P}(t)$ (its leading coefficient is a unit), so $v_{\mathfrak P}(R_\psi(t))=14v_{\mathfrak P}(t)$ and $\psi_q(t)$ has no positive contact. If $v_{\mathfrak P}(t)\ge0$, the $f_i(t)$ are integral and at most one has positive valuation (resultants); if $v_{\mathfrak P}(f_i(t))>0$ with $i\ge1$, the contact of $\psi_q(t)$ with $\gamma_i$ is $v_{\mathfrak P}(f_i(t))$; if $v_{\mathfrak P}(D(t))>0$, then $t$ is a unit, $(10q+1)D(t)+q^2t\equiv q^2t$ is a unit, and the contact with $\infty$ is $v_{\mathfrak P}(D(t))$; in every case $v_{\mathfrak P}(R_\psi(t))$ is the one positive contact, or $0$. \end{proof} \section{The certificate}\label{sec:certificate} Throughout this section and the next two, $K$ is a totally real number field with $\sqrt3\notin K$ and $\sqrt d\notin K$ satisfying \ref{I1}--\ref{I3} (for $\sqrt3\in K$ see \cref{sec:sqrt3}), $n_K=[K:\Q]$, and $P\in E(F)$ is the generator of $2E(L)$ given by \ref{E3} and \cref{lem:carrier}. \subsection{The fixed data}\label{ssec:fixed} The following are chosen once, in this order, before any input. \begin{enumerate}[label=\textup{(F\arabic*)},ref=\textup{(F\arabic*)}] \item\label{F1} A prime $q\equiv7\pmod{12}$ and a prime $\mathfrak q$ of $K$ above $q$, unramified with odd residue degree (\cref{lem:tubeprime}); the contacts $\gamma_i$, the set $\mathcal T$ of \cref{ssec:tubeuse}, $\omega=-1$, $\xi=1$, $\mathcal T^+=\mathcal T\cup\{\omega\}$, $F_8(S)=\prod_{\theta\in\mathcal T^+}(S-\theta)$, $d_0=0$, $d_1=2q+2$, and the polynomial $R_\psi$ of \cref{lem:shift}(c). Let $\Sigma_0$ be the least set $\Sigma$ allowed in \cref{thm:height}, and $\kappa$ the exponent that theorem gives for $\Sigma_0$. \item\label{F2} An integer $m>8n_K\kappa+100$; a positive multiple $c_*$ of $64$; $\Gamma=2^3\cdot3\cdot5\cdot7\cdot17$ and $C=2\cdot3\cdot5\cdot7\cdot13\cdot17\cdot q\cdot\Gamma^2$. \item\label{F3} The finite set $\mathfrak B$ of primes of $K$ lying above: every rational prime $p\le\max(324,m+1)$; $q$; the primes dividing $c_*$, $C$ or $C_*$; the primes ramified in $K/\Q$; and every rational prime at which one of the following rationals has nonzero valuation: the $\gamma_i\ne0$, the $1-\gamma_i$, the $\theta_i\ne0$, the differences of two distinct elements of $(\mathcal T^+\cup\{\xi\})\cup\bigl((\mathcal T^+\cup\{\xi\})-d_1\bigr)\cup\{1/q\}$, and the leading coefficients and pairwise resultants of the seven quadratic factors of $R_\psi$. \item\label{F4} A positive integer $M$, large enough for \cref{prop:sound}. \end{enumerate} \begin{lemma}\label{lem:fixed} \begin{enumerate}[label=\textup{(\alph*)}] \item $\mathcal T^+\cup\{\xi\}\subset(-(q+1),1]$, $(\mathcal T^+\cup\{\xi\})-d_1\subset(-(3q+3),-(2q+1)]$, these two sets are disjoint, $1/q$ lies in neither, $\omega\notin\mathcal T$, and $\mathcal T^+\cup\{\xi\}$ has nine elements. \item Every prime $\mathfrak P\notin\mathfrak B$ lies above a rational prime $p>\max(324,m+1)$ with $p\ne q$, $p\nmid c_*C$, unramified in $L$; and every prime $\mathcal Q$ of $L$ above it is as in the Setting of \cref{ssec:formal}. \item $\Sigma_0\subseteq\mathfrak B$, and for $z\in K\setminus\mathcal C_q$, $\mathfrak N_{\Sigma_0}(z)\le C_{\mathfrak B}\mathfrak N_{\mathfrak B}(z)$ with $C_{\mathfrak B}=\prod_{\mathfrak P\in\mathfrak B\setminus\Sigma_0}N\mathfrak P$. Hence there is $H_{\mathfrak B}$ with $h(z)\le H_{\mathfrak B}\mathfrak N_{\mathfrak B}(z)^\kappa$ for every $z\in\mathcal D$. \end{enumerate} \end{lemma} \begin{proof} (a) For $i\ge1$, $\theta_i=-q/(1-\gamma_i)$ with $1-\gamma_i\in(0,2)$, so $\theta_i<-q/2<-1$; and $\theta_i>-(q+1)$ because $\gamma_i<1/(q+1)$ (the positive contacts are $\gamma_3=(q-1)/D_q$ and $\gamma_5$, both below $1/(q+1)$). With $\theta_0=0$, $\omega=-1$ and $\xi=1$ this gives the first inclusion and $\omega\notin\mathcal T$; the second follows by subtracting $2q+2$; and $0<1/q<1$. (b) The primes ramified in $L/\Q$ lie above a prime that is ramified in $F/\Q$, hence divides $2d$, or in $K/\Q$; and every prime of $\mathcal P$ is at most $89$. (c) $\Sigma_0$ consists of primes above $p\le324$, above $q$, and at which a nonzero finite contact or a difference of two distinct finite contacts has nonzero valuation; the differences $\gamma_i-\gamma_k$ are, up to the units $q$ and $(1-\gamma_i)(1-\gamma_k)$, the differences $\theta_k-\theta_i$ times $q^{-1}$, so these primes are in $\mathfrak B$. Each prime of $\mathfrak B\setminus\Sigma_0$ removes at most the factor $N\mathfrak P$ from $\mathfrak N_{\Sigma_0}(z)$. Then $H_{\mathfrak B}=HC_{\mathfrak B}^\kappa$ works, by \cref{thm:height}. \end{proof} \needspace{8\baselineskip} \subsection{The conditions}\label{ssec:conditions-cert} For $u\in L$ write $u=u^{(0)}+\sqrt d\,u^{(1)}$ with $u^{(0)},u^{(1)}\in K$ \ref{E1}. \begin{definition}\label{def:cert} Let $X\in K$. The \emph{certificate} at $X$ is the statement that there exist \begin{itemize} \item a sign $\delta\in\{1,-1\}$; \item nine points $\mathsf Q,\mathsf N_1,\mathsf N_3,\mathsf N_4,\mathsf H,\mathsf U_1,\dots,\mathsf U_4$ of $2E(L)$; \item $a_0,b_0\in K$, and, for $j=0,1$, elements witnessing $\Phi_K(B_j)$ (\cref{sec:pole}), \end{itemize} such that all quantities defined below are defined (every displayed denominator is nonzero, every point to which $\rho$, $\mathfrak z$ or $\ell_m$ is applied has the needed coordinate nonzero, and $W_j\Theta_j\ne0$), and the following hold: \begin{enumerate}[label=\textup{(C\arabic*)},ref=\textup{(C\arabic*)}] \item\label{C1} $\mathsf Q$, $\mathsf R=[M]\mathsf Q$, $\mathsf N_1,\mathsf N_2,\mathsf N_3,\mathsf N_4$, $\mathsf H$, $\mathsf U_1,\dots,\mathsf U_4$ and $V_0$ are not $O$, where $\mathsf N_2=P+\mathsf R$ and $V_0=\mathsf H-[c_*]P$; \item\label{C3} $\eta=a_0^2+b_0^2\ne0$; \item\label{C4} $\Phi_K(B_0)$ and $\Phi_K(B_1)$. \end{enumerate} \end{definition} The quantities are as follows. Put $\beta=3+\delta(X^3+X)$, $V_i=\mathsf U_i-[c_*]\mathsf N_i$ $(1\le i\le4)$, and \[ L_i=\frac{\ell_m(\mathfrak z(\mathsf U_i))}{\ell_m(\mathfrak z(\mathsf H))},\qquad L'_i=\frac{\ell^\sigma_m(\mathfrak z(V_i^\tau))}{\ell^\sigma_m(\mathfrak z(V_0^\tau))}\qquad(1\le i\le4). \] The tests below, shared by the two parameters, follow \cite{GlazerV19}. The sixteen \emph{comparison tests} $D_1,\dots,D_{16}\in L$, with their \emph{precisions} $k_i$, are \[ \begin{array}{lcc} \text{tests}&\text{number}&\text{precision}\\\midrule \rho(\mathsf H),\ \rho(\mathsf U_1),\dots,\rho(\mathsf U_4)&5&1\\ \rho(V_0^\tau),\ \rho(V_1^\tau),\dots,\rho(V_4^\tau)&5&1\\ L_i-L'_i\ (1\le i\le4)&4&m\\ \mathcal L(L_1,L_2,L_3,L_4)&1&m\\ L_1-\beta&1&m \end{array} \] with $\mathcal L$ as in \eqref{eq:lucas}. The six \emph{scalar tests} $G_1,\dots,G_6\in K$ are the coordinates \[ \rho(\mathsf H)=G_1+\sqrt d\,G_2,\qquad\rho(\mathsf R)=G_3+\sqrt d\,G_4,\qquad\mathfrak z(\mathsf R)/\mathfrak z(\mathsf H)=G_5+\sqrt d\,G_6, \] with precisions $(\ell_1,\dots,\ell_6)=(1,1,1,1,m,m)$. Further, \begin{gather*} T_{\rm ag}=\tfrac12\Tr_{L/K}\bigl(x(\mathsf N_1)+x(\mathsf N_2)+x(\mathsf N_3)+x(\mathsf N_4)\bigr),\qquad r=R_\psi(\beta),\qquad\varpi=\frac{\Gamma^2r}{(1+Cr)^2},\\ A_0=1,\quad A_1=(1+\varpi T_{\rm ag}^2)^2,\quad s_j=A_j\eta+\frac1q,\quad t_j=s_j+d_j-\xi,\\ R_j=\frac{F_8(s_j+d_j)}{t_j^8},\quad\alpha_j=\varpi R_j, \end{gather*} $\Psi_R(v)=Rv/(1+Rv)$, and, for $j=0,1$, \begin{gather*} W_j=\prod_{i=1}^{16}\Bigl(1+\alpha_j\Bigl(\frac{D_i}{t_j^{k_i+1}\alpha_j^{k_i}}\Bigr)^2\Bigr)\prod_{k=1}^{6}\Bigl(1+\alpha_j\Bigl(\frac{\Psi_{R_j}(G_k)}{\varpi^{\ell_k}}\Bigr)^2\Bigr),\\ \Theta_j=\Tr_{L/K}(W_j^{-1}),\qquad B_j=\frac{\alpha_j}{\Theta_j^2}. \end{gather*} The certificate follows that of \cite[\S3]{Sun26} over $\Q$, carried to $\Q(\sqrt2)$ in \cite[\S\S12.1--13.1]{Sun}. \needspace{4\baselineskip} \begin{lemma}\label{lem:certbasic} Suppose the certificate holds at $X\in K$. Then there are integers $n_1,\dots,n_4$, $h$, $u_1,\dots,u_4$ and $k_{\mathsf Q}$ with $\mathsf N_i=[n_i]P$, $\mathsf H=[h]P$, $\mathsf U_i=[u_i]P$ and $\mathsf Q=[k_{\mathsf Q}]P$; $n_2-1=Mk_{\mathsf Q}\ne0$; $n_1,\dots,n_4$, $h$ and $h-c_*$ are nonzero; all nine points and $V_0,V_i$ lie in $E(F)$; $T_{\rm ag}$ and the $G_k$ are rational, and $T_{\rm ag}>0$; and $r$, $\varpi$, $\eta$, $A_j$, $s_j$ and $s_j+d_j$ are totally positive. \end{lemma} \begin{proof} By \ref{E3} and \cref{lem:carrier}, $2E(L)=\Z P$ with $P\in E(F)$; this gives the integers, and $\mathsf N_2=[1+Mk_{\mathsf Q}]P$. \ref{C1} gives the nonvanishing. All points are multiples of $P$, so lie in $E(F)$, and $\tau$ acts on their coordinates as $\sigma$; so $\rho(\mathsf H),\rho(\mathsf R),\mathfrak z(\mathsf R)/\mathfrak z(\mathsf H)\in F$ have rational coordinates, and $\Tr_{L/K}=\Tr_{F/\Q}$ on $F$ \ref{E1}, so $T_{\rm ag}\in\Q$, and $T_{\rm ag}>0$ because each $x([n_i]P)$ is totally positive by \ref{E3} and \cref{lem:carrier}. $R_\psi>0$ on $\R$ and $K$ is totally real, so $r$ is totally positive, hence so are $1+Cr$ and $\varpi$. $\eta\ne0$ is a sum of two squares, hence totally positive; $A_0=1$, and $A_1$ is the square of $1+\varpi T_{\rm ag}^2$, which is totally positive; $1/q>0$ and $d_j\ge0$. \end{proof} \section{Soundness}\label{sec:soundness} \begin{lemma}[{\cite[Lemma~13.1]{Sun}}]\label{lem:selector} Suppose the certificate holds at $X\in K$. Let $\mathfrak P\notin\mathfrak B$ be a prime of $K$ above $p$, $j\in\{0,1\}$, $\mu=v_{\mathfrak P}(\varpi)$, $\nu=v_{\mathfrak P}(R_j)$, and suppose $\alpha=\mu+\nu$ is odd. Then $\alpha>0$, and there is a prime $\mathcal Q$ of $L$ above $\mathfrak P$ with \[ v_{\mathcal Q}\bigl(D_i/t_j^{k_i+1}\bigr)\ge k_i\quad(1\le i\le16),\qquad v_{\mathcal Q}\bigl(\Psi_{R_j}(G_k)\bigr)>\ell_k\mu-\tfrac34\alpha\quad(1\le k\le6). \] If moreover $t_j$ is a $\mathfrak P$-unit, then $v_{\mathcal Q}(D_i)\ge k_i$ for all $i$; if $R_j$ is a $\mathfrak P$-unit and $\mu>0$, then $v_p(G_k)\ge\ell_k$ for all $k$. \end{lemma} \begin{proof} By \cref{lem:fixed}(b), $L/K$ is unramified at $\mathfrak P$, so $v_{\mathcal Q}=v_{\mathfrak P}$ on $K$ for every $\mathcal Q\mid\mathfrak P$, and $v_{\mathfrak P}(\alpha_j)=\alpha$. A factor of $W_j$ is $1+y$ with $y=\alpha_j\bigl(D_i/(t_j^{k_i+1}\alpha_j^{k_i})\bigr)^2$ or $y=\alpha_j\bigl(\Psi_{R_j}(G_k)/\varpi^{\ell_k}\bigr)^2$; if $y\ne0$, then $v_{\mathcal Q}(y)$ is $\alpha$ plus an even integer, hence odd, so $v_{\mathcal Q}(1+y)=\min(0,v_{\mathcal Q}(y))$; if $y=0$ the factor is $1$. So $\lambda_{\mathcal Q}=v_{\mathcal Q}(W_j)\le0$ is the sum of the nonpositive numbers $\min(0,v_{\mathcal Q}(y))$. Let $\lambda=\max_{\mathcal Q\mid\mathfrak P}\lambda_{\mathcal Q}$ and $\pi$ a uniformiser of $K$ at $\mathfrak P$. Then $\pi^{\lambda}W_j^{-1}$ is integral at every $\mathcal Q\mid\mathfrak P$, so its trace $\pi^\lambda\Theta_j$ is $\mathfrak P$-integral, and $v_{\mathfrak P}(\Theta_j)\ge-\lambda\ge0$. Now $v_{\mathfrak P}(B_j)=\alpha-2v_{\mathfrak P}(\Theta_j)$ is odd and $B_j\ne0$, and $\mathfrak P$ is not above $2,3,5,7,17$, so \cref{lem:PK} and $\Phi_K(B_j)$ give $v_{\mathfrak P}(B_j)\ge1$. Hence $\alpha\ge1+2v_{\mathfrak P}(\Theta_j)\ge1$, and $1\le\alpha+2\lambda$, that is $\lambda\ge(1-\alpha)/2$. Choose $\mathcal Q$ with $\lambda_{\mathcal Q}=\lambda$. Every term of the sum defining $\lambda_{\mathcal Q}$ is at least $\lambda$. For a comparison test with $D_i\ne0$ this gives $\alpha(1-2k_i)+2v_{\mathcal Q}(D_i/t_j^{k_i+1})\ge(1-\alpha)/2$, so \[ v_{\mathcal Q}(D_i/t_j^{k_i+1})\ge k_i\alpha-\tfrac{3\alpha-1}4=(k_i-\tfrac34)\alpha+\tfrac14\ge k_i-\tfrac12, \] and $v_{\mathcal Q}(D_i/t_j^{k_i+1})\ge k_i$ as valuations are integers. For a scalar test, $\alpha+2v_{\mathcal Q}(\Psi_{R_j}(G_k))-2\ell_k\mu\ge(1-\alpha)/2$ gives $v_{\mathcal Q}(\Psi_{R_j}(G_k))\ge\ell_k\mu-\frac{3\alpha-1}4$. The third assertion is immediate. For the fourth, $\alpha=\mu\ge1$, so $v_{\mathcal Q}(\Psi_{R_j}(G_k))>(\ell_k-\frac34)\mu\ge\ell_k-\frac34$, hence $\ge\ell_k\ge1$; with $R_j$ a unit, $\Psi_{R_j}(G_k)=R_jG_k/(1+R_jG_k)$ has positive valuation only if $v_{\mathfrak P}(G_k)>0$, and then its valuation is $v_{\mathfrak P}(G_k)$. By \cref{lem:certbasic}, $G_k\in\Q$, and $v_{\mathfrak P}=v_p$ on $\Q$. \end{proof} \needspace{4\baselineskip} \begin{lemma}[{\cite[Lemma~13.2]{Sun}}]\label{lem:unit} Suppose the certificate holds at $X\in K$, and let $\mathfrak P\notin\mathfrak B$ with $v_{\mathfrak P}(\varpi)$ odd. Then $v_{\mathfrak P}(\varpi)=v_{\mathfrak P}(r)>0$, $v_{\mathfrak P}(\beta)\ge0$, and $R_0$ or $R_1$ is a $\mathfrak P$-unit. \end{lemma} \begin{proof} Write $v=v_{\mathfrak P}$; $\Gamma$ and $C$ are $\mathfrak P$-units. If $v(\beta)<0$, then $v(r)=14v(\beta)$ by \cref{lem:shift}(c), $v(1+Cr)=v(r)$, and $v(\varpi)=-v(r)$ is even. So $v(\beta)\ge0$ and $r$ is integral; if $v(r)=0$ then $v(\varpi)=-2v(1+Cr)$ is even; so $v(r)>0$, $1+Cr$ is a unit, and $v(\varpi)=v(r)$. Now $v(\varpi T_{\rm ag}^2)$ is odd. If it is positive, $A_1\equiv1\pmod{\mathfrak P}$. If $v(\eta)<0$, then $v(s_j)=v(\eta)<0$ for both $j$, each factor $s_j+d_j-\theta$ $(\theta\in\mathcal T^+\cup\{\xi\})$ has valuation $v(\eta)$, and $R_j=\prod_{\theta\in\mathcal T^+}(1-\theta/S)/(1-\xi/S)^8$ with $S=s_j+d_j$ is $\equiv1$, a unit. If $v(\eta)\ge0$, then all $s_j$ are integral and $s_1\equiv s_0\pmod{\mathfrak P}$; if neither $R_j$ were a unit, then $s_0\equiv\theta$ and $s_0+d_1\equiv\theta'$ for some $\theta,\theta'\in\mathcal T^+\cup\{\xi\}$, so $\mathfrak P$ would divide the nonzero difference $\theta-(\theta'-d_1)$, which is a unit outside $\mathfrak B$ by \cref{lem:fixed}(a) and \ref{F3}. If $v(\varpi T_{\rm ag}^2)<0$, then $v(A_1)<0$. If $v(\eta)\le0$, then $v(s_1)=v(A_1\eta)<0$ and $R_1\equiv1$ as before. If $v(\eta)>0$, then $s_0\equiv1/q$, and every $s_0-\theta$, $\theta\in\mathcal T^+\cup\{\xi\}$, is a unit because $1/q-\theta$ is; so $R_0$ is a unit. \end{proof} \begin{proposition}\label{prop:sound} If $M$ in \ref{F4} is large enough, then every $X\in K$ at which the certificate holds lies in $\Z$. \end{proposition} \begin{proof} We follow the proof of \cite[Proposition~13.3]{Sun}. Let the certificate hold at $X$, with the integers of \cref{lem:certbasic}, and put $N=\max(1,|n_1|,\dots,|n_4|)$ and $\Delta=\mathcal L(n_1,n_2,n_3,n_4)\in\Z$. Then $|n_2-1|\ge M$, so $N\ge M-1$. Constants $c_1,c_2,\dots$ below depend on $K$, $E$, $P$ and the data \ref{F1}--\ref{F3}, but not on $M$ or $X$. \emph{Step 1 (local alternatives).} Let $\mathfrak P\notin\mathfrak B$ be a prime above $p$. \begin{enumerate}[label=(\roman*)] \item Suppose $v_{\mathfrak P}(s_j+d_j-\theta)$ is positive and odd for some $\theta\in\mathcal T$, and $v_{\mathfrak P}(\varpi)$ is even. The other seven factors $s_j+d_j-\theta'$ $(\theta'\in\mathcal T^+)$ and $t_j$ are $\mathfrak P$-units, since $\theta-\theta'$ and $\theta-\xi$ are; so $v_{\mathfrak P}(R_j)$ is positive and odd and $t_j$ is a unit. By \cref{lem:selector} there is $\mathcal Q\mid\mathfrak P$ with $v_{\mathcal Q}(D_i)\ge k_i$ for all $i$. Thus $\mathsf H,\mathsf U_i\in E_1(L_{\mathcal Q})$ and $V_0^\tau,V_i^\tau\in E^\sigma_1(L_{\mathcal Q})$, and $v_{\mathcal Q}(L_i-L'_i)\ge m$. By \cref{lem:fixed}(b) and \cref{lem:anchor} (with $h\ne0$, $h\ne c_*$), $v_{\mathcal Q}(L_i-n_i)\ge m$; so $v_{\mathcal Q}(\mathcal L(n_1,\dots,n_4))\ge m$, that is $p^m\mid\Delta$, and $v_{\mathfrak P}(\beta-n_1)=v_{\mathcal Q}(\beta-n_1)\ge m$, using $L_1-\beta$. \item Suppose $v_{\mathfrak P}(\varpi)$ is odd. By \cref{lem:unit}, $v_{\mathfrak P}(\varpi)>0$, $v_{\mathfrak P}(\beta)\ge0$, and some $R_{j'}$ is a unit. By \cref{lem:selector} for $j'$, $v_p(G_k)\ge\ell_k$ for all $k$, and by \cref{lem:scalar} (with $h$ and $c=n_2-1$; $p\ge5$, $p\notin\mathcal P$), $p^m\mid n_2-1$. \item Suppose $v_{\mathfrak P}(r)$ is positive and odd. Then $1+Cr$ is a unit and $v_{\mathfrak P}(\varpi)=v_{\mathfrak P}(r)$ is odd, so $p^m\mid n_2-1$ by (ii). \end{enumerate} \emph{Step 2 (counting).} Let $\mathfrak M_j$ be the product of $N\mathfrak P$ over the primes $\mathfrak P\notin\mathfrak B$ at which $v_{\mathfrak P}(s_j+d_j-\theta)$ is positive and odd for some $\theta\in\mathcal T$, and $\mathfrak M_{\rm sc}$ the product of $N\mathfrak P$ over the $\mathfrak P\notin\mathfrak B$ with $v_{\mathfrak P}(r)$ positive and odd. For a rational prime $p$, $\prod_{\mathfrak P\mid p}N\mathfrak P\le p^{n_K}$. By (i) and (ii), if $\Delta\ne0$, then $p^m\mid\Delta(n_2-1)$ for every $p$ below a prime counted in $\mathfrak M_j$, so $\mathfrak M_j^m\le|\Delta(n_2-1)|^{n_K}$. If $\beta\ne n_1$, then $v_{\mathfrak P}((\beta-n_1)(n_2-1))\ge m$ at every prime counted in $\mathfrak M_j$ (in case (ii) because $v_{\mathfrak P}(\beta-n_1)\ge0$ and $v_{\mathfrak P}(n_2-1)=v_p(n_2-1)$), so by \eqref{eq:numerator} \[ \mathfrak M_j^m\le\Nm\mathfrak a\bigl((\beta-n_1)(n_2-1)\bigr)\le\exp\bigl(n_Kh((\beta-n_1)(n_2-1))\bigr). \] By (iii), $\mathfrak M_{\rm sc}^m\le|n_2-1|^{n_K}$. \emph{Step 3 (heights).} By \cref{lem:shift}(a), $s_j$ is totally positive with $v_{\mathfrak q}(s_j)\le-1$, so the same holds for $s_j+d_j$. By \cref{lem:shift}(b), applied with $\Sigma'=\mathfrak B$, $1+q/(s_j+d_j)\in\mathcal D$ and its odd-contact primes outside $\mathfrak B$ are those counted in $\mathfrak M_j$; by \cref{lem:fixed}(c), $h(s_j)\le c_1(1+\mathfrak M_j^\kappa)$. By \cref{lem:intube}(d), $\psi_q(\beta)\in\mathcal D$, and by \cref{lem:shift}(c) its odd-contact primes outside $\mathfrak B$ are those counted in $\mathfrak M_{\rm sc}$; as $\psi_q$ has degree $2$, $h(\beta)\le c_2(1+\mathfrak M_{\rm sc}^\kappa)\le c_2(1+|n_2-1|^{n_K\kappa/m})$. By \cref{lem:aggregate}, $N^2\le c_3h(T_{\rm ag})+c_4$. Since $A_1=(s_1-1/q)/(s_0-1/q)$ and $T_{\rm ag}^2=(\sqrt{A_1}-1)/\varpi$ with $\sqrt{A_1}=1+\varpi T_{\rm ag}^2$, and $h(\varpi)\le c_5(1+h(\beta))$, \[ N^2\le c_6\bigl(1+h(s_0)+h(s_1)+h(\beta)\bigr). \] \emph{Step 4 ($\Delta=0$).} Suppose $\Delta\ne0$. Then $|\Delta|\le14N^4$ and $|n_2-1|\le2N$, so $\mathfrak M_j\le(28N^5)^{n_K/m}$, and Step 3 gives $N^2\le c_7(1+N^{5n_K\kappa/m})$ with $5n_K\kappa/m<5/8$. This fails once $N$ exceeds a bound $N_1$ depending only on the constants; choosing $M>N_1+1$ excludes it. So $\Delta=0$. As $|n_2|\ge M-1\ge7$ and $n_4\ne0$, \cref{lem:lucas}(a) gives $|n_3|>\exp(|n_2|-3)$, so $\log N>|n_2|-3\ge|n_2-1|-4$. \emph{Step 5 ($\beta=n_1$).} Suppose $\beta\ne n_1$. Then $h((\beta-n_1)(n_2-1))\le h(\beta)+3\log(2N)$, so by Steps 2 and 3, with $\epsilon=n_K\kappa/m<1/8$, \[ N^2\le c_8\bigl(1+e^{\epsilon h(\beta)}(2N)^{3\epsilon}+h(\beta)\bigr),\qquad h(\beta)\le c_2\bigl(1+(\log N+4)^{\epsilon}\bigr). \] The second bound gives $e^{\epsilon h(\beta)}\le N^{1/4}$ and $h(\beta)\le\log N$ once $N$ exceeds a bound $N_2$ depending only on the constants, and then $N^2\le c_8(1+2N^{5/8}+\log N)$, which fails for $N$ beyond a bound $N_3$. Since $N>\exp(|n_2|-3)\ge\exp(M-4)$, choosing $M$ with $\exp(M-4)>\max(N_2,N_3)$ excludes it. So $\beta=n_1\in\Z$, hence $X^3+X=\delta(n_1-3)\in\Z$, and $X\in\Z$ by \cref{lem:rigid}. \end{proof} \section{Completeness}\label{sec:completeness} \subsection{Three lemmas} \begin{lemma}[{\cite[Lemma~13.4]{Sun}}]\label{lem:varpi} For every positive integer $r$, the rational number $\varpi=\Gamma^2r/(1+Cr)^2$ satisfies $0<\varpi\le\Gamma^2/(4C)<\frac14$; $v_p(\varpi)=2v_p(\Gamma)+v_p(r)$ for every prime $p\mid C$; and every odd valuation of $\varpi$ is positive. \end{lemma} \begin{proof} $(1+Cr)^2\ge4Cr$ gives the bound, and $C>4\Gamma^2$. If $p\mid C$, $1+Cr$ is a $p$-unit. In general $v_p(\varpi)\equiv v_p(r)\pmod2$; if $v_p(r)$ is odd then $p\mid r$, $1+Cr$ is a $p$-unit and $v_p(\varpi)=2v_p(\Gamma)+v_p(r)>0$. \end{proof} Fix a real embedding $\iota$ of $F$. For $V\in E(F)$ write $V_{\mathbf R}=(\iota(V),\iota(V^\sigma))$, a point of the compact abelian Lie group $\mathbf E=E^\iota(\R)\times E^{\iota\sigma}(\R)$, where $E^\iota$ and $E^{\iota\sigma}$ are the real curves obtained from $E$ by $\iota$ and $\iota\circ\sigma$. Let $G_{\mathbf R}$ be the closure of $\{([k]P)_{\mathbf R}:k\in\Z\}$, $G^0_{\mathbf R}$ its identity component, and $e_{\mathbf R}$ the exponent of the finite group $G_{\mathbf R}/G^0_{\mathbf R}$. \begin{lemma}\label{lem:realorbit} \begin{enumerate}[label=\textup{(\alph*)}] \item Both projections of $G^0_{\mathbf R}$ to the factors of $\mathbf E$ are nontrivial, and for finite sets $Z_1\subset E^\iota(\R)$, $Z_2\subset E^{\iota\sigma}(\R)$ the set of $g\in G^0_{\mathbf R}$ with a coordinate in $Z_1$ or $Z_2$ is closed with empty interior in $G^0_{\mathbf R}$. \item If $h^*$ and $N^*\ne0$ are integers divisible by $e_{\mathbf R}$, then $\{([h^*+kN^*]P)_{\mathbf R}:k\ge1\}$ is dense in $G^0_{\mathbf R}$. \item For every nonzero integer $e$ and every neighbourhood $\mathcal V$ of the identity of $\mathbf E$ there is $k\ge1$ with $([ke]P)_{\mathbf R}\in\mathcal V$. \end{enumerate} \end{lemma} \begin{proof} $G_{\mathbf R}$ is a closed subgroup of a compact abelian Lie group, so $G^0_{\mathbf R}$ is a torus of finite index. (a) The first projection of $G_{\mathbf R}$ is the closure of $\{\iota([k]P)\}$, which is infinite as $P$ has infinite order; its image of $G^0_{\mathbf R}$ is connected and of finite index in it, hence not trivial. The same holds for the second projection, as $P^\sigma$ has infinite order. A fibre of a nontrivial homomorphism from the connected group $G^0_{\mathbf R}$ is a coset of a proper closed subgroup, hence closed with empty interior, and a finite union of such sets has empty interior. (b) In a compact group the closure of the positive multiples of an element is the closure of the subgroup it generates. Let $g_0=([h^*]P)_{\mathbf R}$ and $g_1=([N^*]P)_{\mathbf R}$. The closure of $\langle g_1\rangle$ is $N^*G_{\mathbf R}\supseteq N^*G^0_{\mathbf R}=G^0_{\mathbf R}$, multiplication by $N^*$ being surjective on a torus, and $g_0\in e_{\mathbf R}G_{\mathbf R}\subseteq G^0_{\mathbf R}$; so the closure of $\{g_0+kg_1:k\ge1\}$ contains $g_0+G^0_{\mathbf R}=G^0_{\mathbf R}$. (c) The closure of the positive multiples of $([e]P)_{\mathbf R}$ is the group $eG_{\mathbf R}$, which contains the identity. \end{proof} The following lemma bounds the comparison tests uniformly at the primes of a fixed finite set, a step in the proof of \cite[Proposition~13.6]{Sun}. For a prime $\mathfrak Q$ of $F$ above $p$ let $v=v_{\mathfrak Q}$ be normalised on $F_{\mathfrak Q}$, $e=v(p)\le2$, $R$ the valuation ring and $\mathfrak m$ its maximal ideal. The equation \eqref{eq:E} is minimal at every prime of $F$ \ref{E2}. Hence \cite[Proposition~VII.2.2]{Silverman} identifies $E_1(F_{\mathfrak Q})$ with the formal group on $\mathfrak m$ through $\mathfrak z$; we write $E^{(s)}=\{O\}\cup\{V:v(\mathfrak z(V))\ge s\}$ for $s\ge1$, a subgroup. We use: $[p]E^{(s)}\subseteq E^{(s+1)}$ \cite[\S IV.3]{Silverman}; for an integer $r>e/(p-1)$, $\ell$ and the formal exponential are inverse isomorphisms between $E^{(s)}$ and $\mathfrak m^s$ for every $s\ge r$ \cite[\S IV.6]{Silverman}, so $v(\ell(\mathfrak z(V)))=v(\mathfrak z(V))$ on $E^{(r)}$, and the exponential is continuous on $\mathfrak m^r$ (its $n$-th term has valuation at least $r+(n-1)(r-e/(p-1))$ there, by the estimates of \cite[\S IV.6]{Silverman}); and if $v(Z)>e/(p-1)$ then $v(\ell_m(Z))=v(Z)$, since $v((c_t/t)Z^t)\ge tv(Z)-ev_p(t)>v(Z)$ for $t\ge2$, as $v_p(t)\le(t-1)/(p-1)$. \begin{lemma}\label{lem:fixedS} Let $m\ge1$ and $c_*$ be integers, $n_1,\dots,n_4$ nonzero integers, $\mathcal S$ a finite set of primes, $J$ a positive integer and $a_p$ $(p\in\mathcal S)$ integers such that \begin{enumerate}[label=\textup{(J\arabic*)},ref=\textup{(J\arabic*)}] \item\label{J1} $[J]P\in E_1(F_{\mathfrak Q})$ for every prime $\mathfrak Q$ of $F$ above every $p\in\mathcal S$; \item\label{J2} $a_p\ge v_p(J)+2$ for every $p\in\mathcal S$. \end{enumerate} Let $\mathcal C=\{h\in\Z: J\mid h,\ h\equiv p^{a_p}\pmod{p^{a_p+1}}\text{ for }p\in\mathcal S\}$. For $h\in\mathcal C$ let $D_1(h),\dots,D_{16}(h)$ be the comparison tests of \cref{def:cert} for $\mathsf H=[h]P$, $\mathsf N_i=[n_i]P$, $\mathsf U_i=[n_i]\mathsf H$ and $\beta=n_1$, so that $V_0=[h-c_*]P$ and $V_i=[n_i]V_0$. Then for each $p\in\mathcal S$ there are an integer $b_p\ge a_p+1$, a residue class $\mathcal C'_p$ modulo $p^{b_p}$ contained in $\{h:h\equiv p^{a_p}\pmod{p^{a_p+1}}\}$, and numbers $B_{\mathfrak Q}\ge0$ for the primes $\mathfrak Q\mid p$ of $F$, such that for every $h\in\mathcal C\cap\mathcal C'_p$: \begin{enumerate}[label=\textup{(\alph*)}] \item $\mathsf H$, $\mathsf U_i$, $V_0$, $V_i$ have infinite order, and $\ell_m(\mathfrak z(\mathsf H))\ne0$, $\ell_m(\mathfrak z(V_0))\ne0$; so all sixteen tests are defined; \item $v_{\mathfrak Q}(D_i(h))\ge-B_{\mathfrak Q}$ for every $i\le16$ and every prime $\mathfrak Q\mid p$ of $F$. \end{enumerate} \end{lemma} All points here lie in $E(F)$, so $V^\tau=V^\sigma$ and the tests lie in $F$. \begin{proof} Fix $p\in\mathcal S$. \emph{Step 0 (the class and its depth).} Since $v_p(J)\le a_p$, the condition $J\mid h$ asks for $h\in\mathcal C$ only that the prime-to-$\mathcal S$ part of $J$ divide $h$, so $\mathcal C$ is one residue class $h_0+\tilde J\Z$, $\tilde J=\operatorname{lcm}(J,\prod_{p'\in\mathcal S}p'^{a_{p'}+1})$, with $v_p(\tilde J)=a_p+1$. Let $\mathfrak Q\mid p$ and $r=1+a_p-v_p(J)\ge3$. If $k\ne0$ and $J\mid k$, write $k/J=p^ju$ with $p\nmid u$; by \ref{J1}, $[p]E^{(s)}\subseteq E^{(s+1)}$ and the subgroup property, $[k]P\in E^{(1+j)}$. Hence $H_0=[h_0]P$ and every $[h]P$, $h\in\mathcal C$, lie in $E^{(r)}\setminus\{O\}$, and $P'=[\tilde J]P\in E^{(r+1)}\setminus\{O\}$. As $e\le2$, $r\ge3>e/(p-1)$. \emph{Step 1 (a $p$-adic interpolation).} For $\mu\in\Z_p$ put $t(\mu)=\ell(\mathfrak z(H_0))+\mu\,\ell(\mathfrak z(P'))\in\mathfrak m^r$ and let $\varphi_{\mathfrak Q}(\mu)\in E^{(r)}$ be the point whose parameter is the formal exponential of $t(\mu)$. For $\mu\in\Z$, $\varphi_{\mathfrak Q}(\mu)=[h_0+\tilde J\mu]P$, since $\ell\circ\mathfrak z$ is a homomorphism on $E^{(r)}$ with inverse the exponential. The map $\varphi_{\mathfrak Q}$ is injective, as $\ell(\mathfrak z(P'))\ne0$, and continuous, as $t$ is affine, the exponential is continuous on $\mathfrak m^r$ and $Z\mapsto[Z:-1:w(Z)]$ is continuous on $\mathfrak m$. \emph{Step 2 (the tests at $\mathsf H$ and $\mathsf U_i$).} For $h\in\mathcal C$, $\mathsf H$ and $\mathsf U_i=[n_i]\mathsf H$ lie in $E^{(r)}\setminus\{O\}$, so $v(\rho(\mathsf H)),v(\rho(\mathsf U_i))\ge2r>0$; $v(\ell_m(\mathfrak z(V)))=v(\mathfrak z(V))$ for $V=\mathsf H,\mathsf U_i$, and $\ell(\mathfrak z(\mathsf U_i))=n_i\ell(\mathfrak z(\mathsf H))$ gives $v(\mathfrak z(\mathsf U_i))=ev_p(n_i)+v(\mathfrak z(\mathsf H))$; so $\ell_m(\mathfrak z(\mathsf H))\ne0$ and $v(L_i)=ev_p(n_i)\ge0$. Hence $\mathcal L(L_1,\dots,L_4)$ and $L_1-n_1$ are integral. \emph{Step 3 (the conjugate side).} For $Y\in E$ put $f_0(Y)=\rho(Y)$, $f_i(Y)=\rho([n_i]Y)$ and $g_i(Y)=\ell_m(\mathfrak z([n_i]Y))/\ell_m(\mathfrak z(Y))$, rational functions on $E$ over $F$. Then $\rho(V_0^\sigma)=\sigma(f_0(V_0))$, $\rho(V_i^\sigma)=\sigma(f_i(V_0))$ and $L'_i=\sigma(g_i(V_0))$, and $v_{\mathfrak Q}(\sigma(u))=v_{\sigma\mathfrak Q}(u)$ for $u\in F$. Let $\mathcal Z$ be the set of points $Y$ of $E$ over an algebraic closure of $F_{\mathfrak Q}$ with $Y\in E[2]$, or $[n_i]Y\in E[2]$ for some $i$, or $\ell_m(\mathfrak z(Y))=0$; it is finite, and off $\mathcal Z$ all of $f_0,\dots,f_4,g_1,\dots,g_4$ are regular, hence continuous on $E(F_{\mathfrak Q})\setminus\mathcal Z$. With $G=[c_*]P$, the set $\Lambda=\bigcup_{\mathfrak Q\mid p}\{\mu\in\Z_p:\varphi_{\mathfrak Q}(\mu)-G\in\mathcal Z\}$ is finite, by injectivity of $\varphi_{\mathfrak Q}$. \emph{Step 4 (the refined class).} Choose $\mu_0\in\Z\setminus\Lambda$ and $b\ge0$ with $b>v_p(\mu_0-\lambda)$ for all $\lambda\in\Lambda$; then the ball $\mathcal V=\mu_0+p^b\Z_p$ misses $\Lambda$. Put $b_p=b+a_p+1$ and $\mathcal C'_p=\{h:h\equiv h_0+\tilde J\mu_0\pmod{p^{b_p}}\}$. For $h=h_0+\tilde J\mu\in\mathcal C$, $h\in\mathcal C'_p$ if and only if $\mu\in\mathcal V$, because $v_p(\tilde J)=a_p+1$; and $\mathcal C'_p$ lies in the class of $p^{a_p}$ modulo $p^{a_p+1}$. For each $\mathfrak Q\mid p$ the functions $\mu\mapsto f_i(\varphi_{\mathfrak Q}(\mu)-G)$, $g_i(\varphi_{\mathfrak Q}(\mu)-G)$ are continuous on the compact set $\mathcal V$, so there is $B'_{\mathfrak Q}$ with all their valuations at least $-B'_{\mathfrak Q}$ there. Let $h\in\mathcal C\cap\mathcal C'_p$. Then $V_0=\varphi_{\mathfrak Q}(\mu)-G\notin\mathcal Z$ for every $\mathfrak Q\mid p$; so $V_0\ne O$, hence $V_0$ and $V_i$ have infinite order, and $\ell_m(\mathfrak z(V_0))\ne0$; with Step 2 this is (a). At $\mathfrak Q$, the conjugate-side tests have valuation at least $-B'_{\sigma\mathfrak Q}$, so $v_{\mathfrak Q}(L_i-L'_i)\ge-B'_{\sigma\mathfrak Q}$, and (b) holds with $B_{\mathfrak Q}=\max(B'_{\mathfrak Q},B'_{\sigma\mathfrak Q})$. \end{proof} \subsection{The construction} We use two elementary facts. (Coordinates) If $k\ge0$, $u\in F$ and $v_{\mathfrak Q}(u)\ge k$ at every prime $\mathfrak Q$ of $F$ above $p$, then $u^{(0)}=\frac12\Tr_{F/\Q}(u)$ and $u^{(1)}=\frac12\Tr_{F/\Q}(u/\sqrt d)$ have $v_p\ge k/2-2$. (Depth) Under \ref{J1}, if $J\mid k$ then $[k]P\in E^{(1+v_p(k)-v_p(J))}$ at every prime above $p$, and if $Jp^2\mid k$ then $v(\mathfrak z([k]P))=ev_p(k/(Jp^2))+v(\mathfrak z([Jp^2]P))$; the first is in Step~0 of the proof of \cref{lem:fixedS}, and the second follows from it by the isometry of $\ell$ on $E^{(3)}$. \begin{proposition}\label{prop:complete} For every $X\in\Z$ the certificate holds at $X$. \end{proposition} \begin{proof} We follow the proof of \cite[Proposition~13.6]{Sun}. The choices are made in the following order; each depends only on the earlier ones. \emph{Step 1 (the input).} Let $\delta$ be the sign with $\beta=3+|X^3+X|$; since $X(X^2+1)$ is even, $\beta\ge3$ is odd. Then $r=R_\psi(\beta)$ is a positive integer and $\varpi\in\Q_{>0}$ satisfies \cref{lem:varpi}. Let $\mathcal S$ be the set of rational primes below $\mathfrak B$ together with the primes at which $\varpi$ has nonzero valuation; it contains every prime $p\le324$, among them $2,3,5,7,13,17$ and the primes of $\mathcal P$, and $q$. The prime $q$ may lie in $\mathcal P$ ($q=7$ for the second or third curve); no step uses the reduction of $E$ at $q$. For $p\in\mathcal S$ put $g_p=3+2m|v_p(\varpi)|$. \emph{Step 2 (the class of $h$).} For each prime $\mathfrak Q$ of $F$ above each $p\in\mathcal S$, the group $E(F_{\mathfrak Q})/E_1(F_{\mathfrak Q})$ is finite; let $J_0$ be the least common multiple of the orders of $P$ in these groups, and $J=J_0e_{\mathbf R}$. Then \ref{J1} holds. Choose $a_p\ge v_p(J)+1+g_p$ for $p\in\mathcal S$, with $a_2\ge6$; then \ref{J2} holds. Let $\mathcal C$ be as in \cref{lem:fixedS}. For $h\in\mathcal C$, $[h]P\in E^{(1+a_p-v_p(J))}$ at every prime above $p\in\mathcal S$, so the coordinates $G_1,G_2$ of $\rho([h]P)$ have $v_p\ge g_p$ by (Coordinates). \emph{Step 3 (a real neighbourhood).} Let $\varepsilon_0=\varpi^m/100$. The points $g\in G^0_{\mathbf R}$ near the identity whose coordinates $g_1,g_2$ satisfy $|\rho(g_1)|,|\rho(g_2)|<\varepsilon_0$ form a neighbourhood of the identity in $G^0_{\mathbf R}$; by \cref{lem:realorbit}(a) it contains a point with both coordinates $\ne O$, and hence a nonempty open set $\mathcal U$ whose closure lies in it and avoids the points with a coordinate $O$. By compactness there is $\delta_0>0$ with $|\mathfrak z(g_1)|,|\mathfrak z(g_2)|\ge\delta_0$ on $\mathcal U$. \emph{Step 4 (the index $n_2$).} By \cref{lem:realorbit}(c) choose a positive multiple $c$ of $MJ\prod_{p\in\mathcal S}p^{a_p+2g_p+4}$ such that both coordinates of $([c]P)_{\mathbf R}$ have $|\rho|\le\varepsilon_0$ and $|\mathfrak z|\le\varepsilon_0\delta_0$. Put $n_2=c+1$; then $n_2\ge7$. By (Depth), at every prime above $p\in\mathcal S$ the coordinates $G_3,G_4$ of $\rho([c]P)$ have $v_p\ge g_p$, and for every $h\in\mathcal C$ we have $v(\mathfrak z([c]P)/\mathfrak z([h]P))=e(v_p(c)-a_p)$, so the coordinates $G_5,G_6$ of $\mathfrak z([c]P)/\mathfrak z([h]P)$ have $v_p\ge g_p$. For every $h$ with $([h]P)_{\mathbf R}\in\mathcal U$, all six $G_k$ have absolute value at most $\varepsilon_0$, since $|u^{(0)}|,|u^{(1)}|\le\max(|\iota(u)|,|\iota\sigma(u)|)$. \emph{Step 5 (the other indices).} Put $n_1=\beta$, and choose positive $n_3,n_4$ with $\mathcal L(n_1,n_2,n_3,n_4)=0$ by \cref{lem:lucas}(b). Now $T_{\rm ag}=\frac12\Tr_{F/\Q}\sum_kx([n_k]P)\in\Q_{>0}$ and $A_1=(1+\varpi T_{\rm ag}^2)^2\in\Q$ are fixed. The sixteen comparison tests are, at the real embeddings, rational functions of $([h]P)_{\mathbf R}$ that are regular off the points with a coordinate in a finite set; by \cref{lem:realorbit}(a) there is a nonempty open $\mathcal U_1\subseteq\mathcal U$ with compact closure on which all of them are defined and bounded in absolute value by some $B_{\mathbf R}$. \emph{Step 6 (the classes at $\mathcal S$).} Apply \cref{lem:fixedS} with these $m$, $c_*$, $n_1,\dots,n_4$, $\mathcal S$, $J$, $a_p$; it gives $b_p$, $\mathcal C'_p$ and $B_{\mathfrak Q}$ for $p\in\mathcal S$. \emph{Step 7 (the selected primes).} For $j=0,1$ and $\theta\in\mathcal T^+\cup\{\xi\}$ put $c_{j,\theta}=(1/q+d_j-\theta)/A_j$, a nonzero rational by \cref{lem:fixed}(a); for fixed $j$ the nine values are distinct. Let $D$ be a positive integer with all $D^2c_{j,\theta}\in\Z$. Apply \cref{thm:pattern}, with $(\ell,r)=(13,1+2i)$ for the first curve and $(7,1+3i)$ for the second, or \cref{thm:pattern4}, with $(\ell,r)=(7,1+3i)$ for the third and $(89,1+5i)$ for the fourth, to the distinct integers among $D^2c_{j,\theta}$ $(j=0,1,\ \theta\in\mathcal T^+)$ and $0$, with: $D_0=\prod_{p\in\mathcal S}p^{f_p}$, where $f_p$ is so large that, with $w_0=Dw$ and any $w$ divisible by $D_0$, \begin{align*} &\text{(w1)}\quad v_p(c_{j,\theta}w_0^2)\ge1\quad(j=0,1,\ \theta\in\mathcal T^+\cup\{\xi\}),\\ &\text{(w2)}\quad (2k_i+2)e\bigl(2v_p(w_0)-v_p(A_j)\bigr)\ge3e+2B_{\mathfrak Q}+(2k_i-1)e|v_p(\varpi)|\\ &\hphantom{\text{(w2)}}\quad(\mathfrak Q\mid p,\ e=v_{\mathfrak Q}(p),\ j=0,1,\ i\le16); \end{align*} $N_0$ the product of the odd primes other than $3$ and $\ell$, and other than $5$ for the third and fourth curves, that lie in $\mathcal S$ or divide $J$ (so $17\mid N_0$ for the fourth curve, as \cref{lem:patterncong4} asks); $\mathcal S'$ the set of primes dividing $D$, $c$, $c_*$, a numerator or denominator of $A_1$, of a $c_{j,\theta}$ or of a nonzero difference $c_{j,\theta}-c_{j',\theta'}$, or the norm of a nonzero element among $\rho(V)$, $\mathfrak z(V)$ and their inverses for $V=[c]P,[c_*]P$; $Y$ larger than $m+1$, than every prime of $\mathcal S\cup\mathcal S'$ and than every prime divisor of $J$; and $\Lambda_0$ so large that $u/w^2>\Lambda_0$ implies: $u>400$, every selected prime lies in $(\frac34u,\frac54u)$, and, with $\eta=u/w_0^2$, for $j=0,1$: $|R_j-1|\le\frac1{100}$, $t_j\ge1$, and $\varpi^{1-2m}2^{2m}B_{\mathbf R}^2t_j^{-4}\le\frac1{500}$ (possible because $s_j\to\infty$ as $\eta\to\infty$). We obtain $u,w$; write $w_0=Dw$ and $\eta=u/w_0^2$, let $\pi_0$ be the Gaussian prime of $u$, and put $a_0=\operatorname{Re}(\pi_0)/w_0$ and $b_0=\operatorname{Im}(\pi_0)/w_0$, so \ref{C3} holds. For $\theta\in\mathcal T^+\cup\{\xi\}$, \begin{equation}\label{eq:factorisation} s_j+d_j-\theta=\frac{A_j}{w_0^2}\bigl(u+c_{j,\theta}w_0^2\bigr),\qquad R_j=\frac{\prod_{\theta\in\mathcal T^+}(u+c_{j,\theta}w_0^2)}{(u+c_{j,\xi}w_0^2)^8}, \end{equation} and the numerator factors are the selected primes $p_{j,\theta}=u+D^2c_{j,\theta}w^2$. A selected prime does not divide $w_0$ (it would divide $u$), nor $D$, $A_1$, or a nonzero difference of shifts; so at $p_{j,\theta}$ the other factors of \eqref{eq:factorisation} for the same $j$ and $t_j$ are units, and $v_p(R_j)=1$. \emph{Step 8 (the index $h$).} For each selected prime $p'$ with Gaussian prime $\pi'$, let $\mathfrak p'_+$ and $\mathfrak p'_-=\sigma\mathfrak p'_+$ be the primes of $F$ above $p'$, and $N_\pm(p')=\#\tilde E(\cO_F/\mathfrak p'_\pm)$, with the signs assigned as follows. For the first two curves $\mathfrak p'_\pm$ is the prime at which $E$ has $N_\pm(p')=d_\pm(\pi')$ points (\cref{lem:patterncong}). For the last two, $\mathfrak p'_+$ is the prime $\mathfrak p_+$ of \cref{lem:patterncong4}, and $N_+(p')=\Nm(\pi'-\epsilon)$, $N_-(p')=\Nm(\pi'-\eta i)$ with $\epsilon,\eta\in\{1,-1\}$. Let $L_\pm=\operatorname{lcm}N_\pm(p')$ and $P_{\rm sel}=\prod p'$ over the selected primes. Consider the congruences \[ h\equiv0\pmod{L_+},\quad h\equiv c_*\pmod{L_-},\quad h\equiv0\pmod{P_{\rm sel}},\quad h\in\mathcal C,\quad h\in\mathcal C'_p\ (p\in\mathcal S). \] They are compatible. For the first two curves, by \cref{thm:pattern}(ii), $\gcd(L_+,L_-)=4$ and $64\mid c_*$; at $2$, $v_2(L_+)=2$, $v_2(L_-)=6$, and every $h\in\mathcal C'_2$ has $v_2(h)=a_2\ge6$, as $c_*\equiv0\pmod{64}$; by \cref{thm:pattern}(iii) and the choice of $N_0$, $L_+L_-$ is prime to every odd prime of $\mathcal S$ and of $J$. For the last two, by \cref{thm:pattern4}(ii), $\gcd(L_+,L_-)=2$ and $2\mid c_*$; at $2$, $v_2(L_+)\le6$ and $v_2(L_-)=1$, and every $h\in\mathcal C'_2$ has $v_2(h)=a_2\ge6$; at $5$, $v_5(L_+)\le2$ and $5\nmid L_-$, and every $h\in\mathcal C'_5$ has $v_5(h)=a_5\ge4$ (Step~2); by \cref{thm:pattern4}(iii) and the choice of $N_0$, $L_+L_-$ is prime to every other odd prime of $\mathcal S$ and of $J$. In all cases the selected primes are not in $\mathcal S$, do not divide $J$, and do not divide $L_+L_-$: for selected primes $p'$, $p''$, the number $N_\pm(p'')$ is even, as $(0,0)$ reduces to a point of order two, and $0400$. So the solutions form a progression $h^*+N^*\Z$ with $J\mid h^*$ and $J\mid N^*$. Take $N^*>0$ and $k_0$ with $h^*+k_0N^*>|c_*|$; by \cref{lem:realorbit}(b), applied to $h^*+k_0N^*$ and $N^*$ (both divisible by $e_{\mathbf R}$), choose $h=h^*+k_0N^*+kN^*$ with $k\ge1$ and $([h]P)_{\mathbf R}\in\mathcal U_1$. Put $\mathsf H=[h]P$, $\mathsf U_i=[hn_i]P$, $\mathsf N_i=[n_i]P$ $(i\ne2)$, $\mathsf Q=[c/M]P$; then $\mathsf R=[c]P$, $\mathsf N_2=[n_2]P$, and all nine points lie in $2E(L)=\Z P$. \ref{C1} holds as all indices and $h-c_*$ are nonzero. All tests are defined by \cref{lem:fixedS}(a); all ingredients of $W_j$ lie in $F$ or $\Q$, so $W_j\in F$ and $\Theta_j,B_j\in\Q$. \emph{Step 9 (the real size).} At both real embeddings every summand of every factor of $W_j$ is nonnegative, as $\alpha_j=\varpi R_j>0$. By Step 7, $R_j\in[\frac{99}{100},\frac{101}{100}]$; for a comparison factor the summand is at most $\varpi^{1-2k_i}R_j^{1-2k_i}B_{\mathbf R}^2t_j^{-2k_i-2}\le\frac1{500}$; for a scalar factor, $|G_k|\le\varepsilon_0$ gives $|\Psi_{R_j}(G_k)|\le3|G_k|$ and the summand is at most $2\varpi^{1-2\ell_k}\cdot9\varepsilon_0^2\le\frac1{500}$. So $1\le W_j\le(1+\frac1{500})^{22}<1.05$ at both embeddings, $\Theta_j\in[1.9,2]$, and $00$, so $v_{\mathfrak Q}(\Psi_{R_j}(G_k))=ev_p(G_k)$ and the summand of a scalar factor has valuation at least $e(2g_p-(2m-1)|v_p(\varpi)|)\ge6e$. Hence $W_j\equiv1\pmod{p^3}$ in $F\otimes\Z_p$, $\Theta_j\equiv2\pmod{p^3}$, $v_2(\Theta_j)=1$, and $v_p(\Theta_j)=0$ for odd $p$. So $v_2(B_j)=v_2(\varpi)-2=2v_2(\Gamma)+v_2(r)-2\ge4$ and $v_p(B_j)=v_p(\varpi)=2+v_p(r)\ge2$ for $p=3,5,7,17$ (\cref{lem:varpi}); and for every $p\in\mathcal S$ an odd $v_p(B_j)$ is positive. \emph{Step 11 (the selected primes).} Let $p'$ be a numerator prime of the $j$-th detector, $\pi'$ its Gaussian prime, $\mathfrak p_\pm=\mathfrak p'_\pm$. Then $v_{p'}(\alpha_j)=1$ and $t_j$ is a unit. As $N_+(p')\mid h/p'$ (since $p'\mid h$ and $p'\nmid N_+(p')$), $[h/p']P\in E_1(F_{\mathfrak p_+})$ and $\mathsf H\in E^{(2)}$ at $\mathfrak p_+$; as $N_-(p')\mid h-c_*$, $V_0\in E_1(F_{\mathfrak p_-})$. Since $\sigma\mathfrak p_+=\mathfrak p_-$, at $\mathfrak p_+$: $\rho(\mathsf H),\rho(\mathsf U_i)$ have positive valuation; $\rho(V_0^\sigma),\rho(V_i^\sigma)$ have the valuations of $\rho(V_0),\rho(V_i)$ at $\mathfrak p_-$, which are positive; by \cref{lem:formal}(c), applied over $F_{\mathfrak p_\pm}=\Q_{p'}$ ($p'>m+1$), $L_i\equiv n_i$ at $\mathfrak p_+$ and $L'_i=\sigma(\ell_m(\mathfrak z(V_i))/\ell_m(\mathfrak z(V_0)))\equiv n_i$ at $\mathfrak p_+$, modulo the $m$-th power; so $L_i-L'_i$, $\mathcal L(L_1,\dots,L_4)\equiv\Delta=0$ and $L_1-\beta\equiv n_1-\beta=0$ have valuation at least $m$. So every comparison summand has valuation $1+2v(D_i)-2k_i\ge1$ at $\mathfrak p_+$. For the scalar tests: $p'$ avoids the primes of $\rho([c]P)$, $\mathfrak z([c]P)$, $\rho([c_*]P)$, $\mathfrak z([c_*]P)$ and their inverses, so $\mathsf H$, which reduces to the reduction of $[c_*]P$ at $\mathfrak p_-$, has $\rho(\mathsf H)$ and $\mathfrak z(\mathsf H)$ units there, $\rho(\mathsf H)$ is integral at $\mathfrak p_+$, and $u_5:=\mathfrak z([c]P)/\mathfrak z(\mathsf H)$ has valuation $\le-2$ at $\mathfrak p_+$ and $0$ at $\mathfrak p_-$. As $p'$ splits in $F$ (\cref{lem:patterncong,lem:patterncong4}) and $2\sqrt d$ is a unit at $p'$, $G_1,\dots,G_4$ are $p'$-integral and $v_{p'}(G_5),v_{p'}(G_6)\le-2$. So $v_{p'}(R_jG_k)\ne0$ and $\Psi_{R_j}(G_k)$ is integral, and every scalar summand has valuation $\ge1$ at $\mathfrak p_+$. At $\mathfrak p_-$ every summand has odd valuation. Hence $W_j^{-1}\equiv1$ at $\mathfrak p_+$ and $W_j^{-1}\equiv0$ or $1$ at $\mathfrak p_-$, $\Theta_j\equiv1$ or $2\pmod{p'}$, and $v_{p'}(B_j)=1$. \emph{Step 12 (the predicate).} At a prime $p$ that is neither in $\mathcal S$ nor a numerator prime of the $j$-th detector, $v_p(\varpi)=0$ and $v_p(R_j)=-8v_p(u+c_{j,\xi}w_0^2)$, so $v_p(B_j)$ is even. With Steps 10 and 11, every negative valuation of $B_j$ is even, so its reduced denominator is a square. By Steps 9 and 10, $B_j$ satisfies the hypotheses of \cref{lem:PQ}, which gives $\Phi_\Q(B_j)$ with rational witnesses, hence $\Phi_K(B_j)$: \ref{C4} holds. \end{proof} \section{Fields containing \texorpdfstring{$\sqrt3$}{sqrt3}}\label{sec:sqrt3} For the first index curve $\sqrt d=\sqrt3$, so \cref{thm:main} asks $\sqrt3\notin K$ through $\sqrt d\notin K$. In this section $E$ is the second, third or fourth index curve, and $K$ is a totally real number field with $\sqrt3\in K$ and $\sqrt d\notin K$ satisfying \ref{I1}--\ref{I3}, with $n_K=[K:\Q]$ and $P\in E(F)$ the generator of $2E(L)$ given by \ref{E3} and \cref{lem:carrier}. Then $3$ is a square in every residue field of $K$ of characteristic $p\ge5$, so the tube of \cref{thm:height} is not available: no prime of $K$ above a prime $q\equiv7\pmod{12}$ has odd residue degree, and the last step of the proof of \cref{lem:fibre}(d) fails. We add a second prime to the tube, at which $3g_q(z)$ is not a square. Apart from the tube, \cref{sec:curve,sec:pattern,sec:pole,sec:local,sec:certificate,sec:soundness,sec:completeness} do not use $\sqrt3\notin K$. \needspace{6\baselineskip} \subsection{The height bound at two primes}\label{ssec:twoprimes} \begin{definition}\label{def:twoprime} Let $K$ be a totally real number field. A \emph{tube datum at two primes} for $K$ is a quadruple $(q,\mathfrak q,q',\mathfrak q')$ such that \begin{enumerate}[label=\textup{(T\arabic*)},ref=\textup{(T\arabic*)}] \item\label{tp:one} $q\ge7$ is a prime with $q\equiv3\pmod4$, and $\mathfrak q$ is a prime of $K$ above $q$, unramified over $q$, of residue degree one; \item\label{tp:two} $q'$ is a prime not dividing $6qD_q$, and $\mathfrak q'$ is a prime of $K$ above $q'$, unramified over $q'$, of residue degree one, such that $g_q(1)$ is a $q'$-adic unit and neither $-1$ nor $3g_q(1)$ is a square modulo $\mathfrak q'$. \end{enumerate} We put $\hat q=qq'$ and call \[ \mathcal D'=\bigl\{z\in K:\ v_{\mathfrak q}(z-1)\ge1,\ v_{\mathfrak q'}(z-1)\ge1\ \text{and}\ g_q(z)\ \text{is totally positive}\bigr\} \] the \emph{positive tube at two primes}. \end{definition} By \ref{tp:two}, $q'\equiv3\pmod4$ and $q'\ne q$. If $\sqrt3\in K$, then $3$ is a square modulo $\mathfrak q$ and modulo $\mathfrak q'$, so $q\equiv q'\equiv11\pmod{12}$, and \ref{tp:two} asks that $g_q(1)$ is not a square modulo $\mathfrak q'$. The polynomials $D_q^2(a_qz+b_q-qz^2)$ and $D_q^2(a_qz+b_q-4qz^2)$ lie in $\Z[z]$, as $D_q^2a_q=(q-3)(q+1)D_q$ and $D_q^2b_q=(q-1)(q+3)$, and their product is $4q^2D_q^4g_q$ by \eqref{eq:gq}; as $q'\nmid2qD_q$, the coefficients of $g_q$ are $q'$-integral. Both primes are taken unramified: at a ramified prime of residue degree one the conclusion of \cref{lem:tubelocal} fails (in $\Q(\sqrt3,\sqrt{11})$ the primes above $11$ are such, and $v(j_z)=2$ there for $z=254$). \begin{theorem}\label{thm:height2} Suppose that $\sqrt3\in K$, let $(q,\mathfrak q,q',\mathfrak q')$ be a tube datum at two primes for $K$, and let $\Sigma$ be a set as before \cref{thm:height} that also contains every prime above $q'$. Then $\mathcal D'\cap\mathcal C_q=\emptyset$, and there are constants $H>0$ and $\kappa>0$ such that \[ h(z)\le H\,\mathfrak N_\Sigma(z)^{\kappa}\qquad\text{for every }z\in\mathcal D'. \] \end{theorem} \begin{proof} The proofs of \cref{lem:intube}(a) and \cref{lem:tubelocal} use of $q$ and $\mathfrak q$ only that $q\ge7$ is prime and $\mathfrak q$ is unramified over $q$; the proofs of \cref{lem:fibre}(a)--(c) use in addition only that $N\mathfrak q\equiv3\pmod4$ (so that $\tau^{N\mathfrak q}=\tau^{-1}$ in (a)) and that $g_q(z)$ is totally positive. By \ref{tp:one} these lemmas hold for $q$, $\mathfrak q$ and every $z\in\mathcal D'$, as $\mathcal D'\subseteq\mathcal D$; in particular $\mathcal D'\cap\mathcal C_q=\emptyset$. \Cref{lem:fibre}(d) holds for $z\in\mathcal D'$ as in \ref{S5}: by its proof, if it failed then $3g_q(z)\in K^{\times2}$; but $g_q$ has $q'$-integral coefficients and $z\equiv1\pmod{\mathfrak q'}$, so $3g_q(z)\equiv3g_q(1)\pmod{\mathfrak q'}$ is a $\mathfrak q'$-adic unit that is not a square modulo $\mathfrak q'$, hence not a square in $K_{\mathfrak q'}$. The proof of \cref{thm:height} in \cref{ssec:heightproof} reads the tube only through these lemmas (Steps~0, 2, 4 and~5), through $\mathfrak q$ in Steps~6--8, which use only that $\Pi_{\mathfrak q}$ is supercuspidal (Step~2) and that $\mathfrak q$ is an odd prime of $\Sigma$, and through $\Sigma$ as a finite set of primes. So it proves \cref{thm:height2} with $\mathcal D'$ in place of $\mathcal D$, with $\kappa=24A$ as there. \end{proof} \begin{lemma}\label{lem:tubeprime2} If $\sqrt3\in K$, then $K$ has a tube datum at two primes, with $q\equiv q'\equiv11\pmod{12}$. \end{lemma} \begin{proof} Since $x_q(1)=(a_q+b_q)/q$, \eqref{eq:gq} gives $g_q(1)=G(q)/(4q^2D_q^4)$ with \[ G(q)=(q^2+4)(q^2-q+4)(q^3+4q+3)(4q^3-q^2+10q+3), \] and $g_q(1)>0$, as $01$ at every real place, so $g_q(1+\hat q/s)$ is totally positive by the proof of \cref{lem:intube}(b). (c) As in the proof of \cref{lem:intube}(d), with $u=\hat qt$, at $\mathfrak q$ and at $\mathfrak q'$: $-1$ is not a square in either residue field, as $q\equiv q'\equiv3\pmod4$. \end{proof} \begin{lemma}\label{lem:shift2} Let $\Sigma$ be as in \cref{thm:height2}. Then \cref{lem:shift} holds with $\hat q$ in place of $q$ in $1/q$, $1+q/s$, $1+q^2t^2$, $10q+1$ and $q^2t$, with $\mathcal T$ as above and $\hat\psi$ in place of $\psi_q$, $\mathcal D'$ in place of $\mathcal D$, ``$v_{\mathfrak q}(s)\le-1$ and $v_{\mathfrak q'}(s)\le-1$'' in (a), and ``$v_{\mathfrak q}(s)\le0$ and $v_{\mathfrak q'}(s)\le0$'' in (b). We write $\hat R_\psi$ and $\hat C_*$ for the polynomial and the integer of (c). The leading coefficients and the pairwise resultants of the seven quadratic factors of $\hat R_\psi$ are nonzero. \end{lemma} \begin{proof} (a) The proof of \cref{lem:shift}(a) applies at $\mathfrak q$ and at $\mathfrak q'$: $-1$ is not a square in either residue field, and $v(1/\hat q)=-1$ at both. (b) The first assertion is \cref{lem:intube2}(b). In the rest of the proof of \cref{lem:shift}(b), $1+\hat q/s-\gamma_i=(1-\gamma_i)(s-\theta_i)/s$, and $\hat q$ is a unit at every prime outside $\Sigma$. (c) Since $10\hat q+1-\gamma_i>\hat q/2$, the proof of \cref{lem:shift}(c) applies with $\hat q$. Write $\hat D(t)=1+\hat q^2t^2$ and $f_i=(10\hat q+1-\gamma_i)\hat D+\hat q^2t$. The leading coefficients $\hat q^2$ and $(10\hat q+1-\gamma_i)\hat q^2$ are nonzero. A common root of $\hat D$ and $f_i$ would satisfy $\hat q^2t=0$, but $\hat D(0)=1$; a common root of $f_i$ and $f_k$ with $i\ne k$ would satisfy $(\gamma_k-\gamma_i)\hat D(t)=f_i(t)-f_k(t)=0$, hence $\hat D(t)=0$, and then $\hat q^2t=f_i(t)=0$, again impossible. \end{proof} The fixed data are those of \cref{ssec:fixed}, with \ref{F2} and \ref{F4} unchanged and \ref{F1}, \ref{F3} replaced by: \begin{itemize} \item[(F1$'$)] a tube datum at two primes $(q,\mathfrak q,q',\mathfrak q')$ for $K$ (\cref{lem:tubeprime2}); the contacts $\gamma_i$, the set $\mathcal T$ of this subsection, $\omega=-1$, $\xi=1$, $\mathcal T^+=\mathcal T\cup\{\omega\}$, $F_8(S)=\prod_{\theta\in\mathcal T^+}(S-\theta)$, $d_0=0$, $d_1=2\hat q+2$, and $\hat R_\psi$. Let $\Sigma_0$ be the least set $\Sigma$ allowed in \cref{thm:height2}, and $\kappa$ the exponent that theorem gives for $\Sigma_0$; \item[(F3$'$)] the set $\mathfrak B$ of \ref{F3}, with the primes above $q'$ added, $\hat C_*$ and $\hat R_\psi$ in place of $C_*$ and $R_\psi$, the $\theta_i$, $\mathcal T^+$ and $d_1$ of (F1$'$), and $1/\hat q$ in place of $1/q$ in the list of differences. \end{itemize} \needspace{4\baselineskip} \begin{lemma}\label{lem:fixed2} \Cref{lem:fixed} holds for these data, with $(-q'(q+1),1]$ and $(-q'(q+1)-2\hat q-2,\,-(2\hat q+1)]$ as the two intervals of (a), with $p\notin\{q,q'\}$ in (b), and with $\mathcal D'$ in place of $\mathcal D$ in (c). \end{lemma} \begin{proof} (a) The inclusions follow from \cref{lem:intube2}(a) with $\theta_0=0$, $\omega=-1$ and $\xi=1$, and the two sets are disjoint because $-(2\hat q+1)<-\hat q-q'=-q'(q+1)$; also $0<1/\hat q<1$. (b) As before, as $\mathfrak B$ contains the primes above $q$ and $q'$. (c) $\Sigma_0$ consists of the primes above $p\le324$, above $q$ and $q'$, and at which a nonzero finite contact or the difference of two distinct finite contacts has nonzero valuation, and $\gamma_i-\gamma_k=(\theta_k-\theta_i)(1-\gamma_i)(1-\gamma_k)/\hat q$; so $\Sigma_0\subseteq\mathfrak B$, and the rest is the proof of \cref{lem:fixed}(c) with \cref{thm:height2} in place of \cref{thm:height}. \end{proof} \begin{proposition}\label{prop:sqrt3} Define the certificate at $X\in K$ by \cref{def:cert} with the data (F1$'$), \ref{F2}, (F3$'$), \ref{F4}, with $s_j=A_j\eta+1/\hat q$ in place of $A_j\eta+1/q$ and $r=\hat R_\psi(\beta)$ in place of $R_\psi(\beta)$. If $M$ is large enough, the certificate holds at $X\in K$ if and only if $X\in\Z$. \end{proposition} \begin{proof} The proofs of \cref{lem:certbasic,lem:selector,lem:unit,prop:sound,prop:complete} read $K$ only through \ref{E1}--\ref{E3}, and the tube only as follows; with these replacements they prove the proposition. \begin{itemize} \item \Cref{lem:certbasic}: $1/\hat q>0$, and $\hat R_\psi>0$ on $\R$ (\cref{lem:shift2}). \item \Cref{lem:selector} and Step~1 of \cref{prop:sound}: \cref{lem:fixed2}(b) for \cref{lem:fixed}(b). \item \Cref{lem:unit}: \cref{lem:shift2}(c), \cref{lem:fixed2}(a) and (F3$'$) for \cref{lem:shift}(c), \cref{lem:fixed}(a) and \ref{F3}; and if $v(\eta)>0$ then $s_0\equiv1/\hat q$, and every $s_0-\theta$ is a unit because $1/\hat q-\theta$ is. \item Step~3 of \cref{prop:sound}: by \cref{lem:shift2}(a), $s_j$ is totally positive with $v_{\mathfrak q}(s_j)\le-1$ and $v_{\mathfrak q'}(s_j)\le-1$, and so is $s_j+d_j$; by \cref{lem:shift2}(b) with $\Sigma'=\mathfrak B$, $1+\hat q/(s_j+d_j)\in\mathcal D'$ and its odd-contact primes outside $\mathfrak B$ are those counted in $\mathfrak M_j$, and \cref{lem:fixed2}(c) gives $h(s_j)\le c_1(1+\mathfrak M_j^\kappa)$; by \cref{lem:intube2}(c) and \cref{lem:shift2}(c), $\hat\psi(\beta)\in\mathcal D'$ and its odd-contact primes outside $\mathfrak B$ are those counted in $\mathfrak M_{\rm sc}$; and $A_1=(s_1-1/\hat q)/(s_0-1/\hat q)$. Steps~2, 4 and~5 read the data only through $\kappa$ and \ref{F2}. \item \Cref{prop:complete}: in Step~1, $r=\hat R_\psi(\beta)$ is a positive integer, and $\mathcal S$ contains $q$ and $q'$; in Step~7, $c_{j,\theta}=(1/\hat q+d_j-\theta)/A_j$, a nonzero rational by \cref{lem:fixed2}(a). The other steps do not read the tube.\qedhere \end{itemize} \end{proof} \section{Proof of \texorpdfstring{\cref{thm:main}}{Theorem 1.1}}\label{sec:proofmain} By \cref{prop:sound,prop:complete} when $\sqrt3\notin K$, and by \cref{prop:sqrt3} when $\sqrt3\in K$ (then $E$ is not the first curve, as $\sqrt d\notin K$), for $x\in K$ the certificate of \cref{def:cert} holds at $x$ if and only if $x\in\Z$. \Cref{sec:count} writes the certificate as one polynomial equation with integer coefficients in $x$ and $25$ further unknowns, solvable in $K$ exactly when $x\in\Z$ (\cref{prop:F1} and the end of \cref{sec:count}); this proves \cref{thm:main}. \section{The fields of \texorpdfstring{\cref{thm:fields}}{Theorem 1.2}}\label{ssec:fields} For a totally real field $K$ with $\sqrt d\notin K$, conditions \ref{I1}--\ref{I3} are statements about the index curve over $L=KF$. In \cref{ssec:quadratic,ssec:cubic,ssec:descentL,ssec:fiveproof}, $E$ is the first index curve and $F=\Q(\sqrt3)$. \Cref{ssec:family2} treats the second, \cref{ssec:family3} the third and \cref{ssec:biquad} the fourth, and \cref{ssec:thirtytwo} adds the fields with the same $L$ as a field already treated. \begin{lemma}\label{lem:twist} Let $M$ be a number field, $B\in M^\times$ and $\delta\in M^\times\setminus M^{\times2}$. Let $C\colon y^2=x^3-Bx$ and $C^\delta\colon y^2=x^3-\delta^2Bx$, over $M$, let $M'=M(\sqrt\delta)$, and let $\tau$ be the nontrivial element of $\Gal(M'/M)$. Then $(X,Y)\mapsto(X/\delta,\,Y/(\delta\sqrt\delta))$ with $O\mapsto O$, is a group isomorphism from $C^\delta(M)$ onto $\{Q\in C(M'):\tau Q=-Q\}$, and \[ \rank C(M')=\rank C(M)+\rank C^\delta(M). \] For $C=E_c$ the twist $C^\delta$ is $E_{\delta c}$. \end{lemma} \begin{proof} If $(X,Y)\in C^\delta(M)$, then $(x,y)=(X/\delta,Y/(\delta\sqrt\delta))$ satisfies $y^2=(X^3-\delta^2BX)/\delta^3=x^3-Bx$, and $\tau(x,y)=(x,-y)=-(x,y)$. Conversely, a point $(x,y)\in C(M')$ with $\tau(x,y)=(x,-y)$ has $x\in M$ and $y/\sqrt\delta\in M$, so it comes from $(\delta x,\delta y\sqrt\delta)\in C^\delta(M)$. The map is the restriction of the isomorphism $(X,Y)\mapsto(u^2X,u^3Y)$, $u=1/\sqrt\delta$, of $C^\delta$ onto $C$ over $M'$, so it is a homomorphism. For $Q\in C(M')$ we have $2Q=(Q+\tau Q)+(Q-\tau Q)$, where $Q+\tau Q\in C(M)$ and $\tau$ maps $Q-\tau Q$ to its negative. A point of $C(M)$ that $\tau$ maps to its negative has order at most two. So the map $(R,Q)\mapsto R+Q$ from $C(M)\oplus\{Q\in C(M'):\tau Q=-Q\}$ to $C(M')$ has finite kernel and a cokernel killed by $2$, and the ranks add. \end{proof} \subsection{Real quadratic fields}\label{ssec:quadratic} For $K=\Q(\sqrt{2m})$ or $\Q(\sqrt{6m})$ with $m$ as in \cref{thm:fields}, the field $L$ is $F(\sqrt{2m})$, and by \cref{lem:twist} the rank of $E(L)$ is that of $E(F)$ plus that of the quadratic twist $E_{2ma}$ over $F$. A $2$-isogeny descent over $F$ shows that this twist has rank $0$. Let $F_\lambda=\Q_2(\sqrt3)$, with ring of integers $\Z_2[\sqrt3]$ and $v_\lambda(2)=2$. By Hensel's lemma a unit $u\equiv1\pmod{\lambda^5}$ is a square in $F_\lambda$, as $5>2v_\lambda(2)$. Since $v_\lambda(8)=6$, a unit is therefore a square exactly when it is congruent modulo $8$ to one of the squares of units \begin{equation}\label{eq:unitsq} 1,\qquad 3,\qquad 5+4\sqrt3,\qquad 7+4\sqrt3, \end{equation} the values of $(s+t\sqrt3)^2$ with $s+t$ odd. So $-1\equiv7$ is not a square, while $-5\equiv3$ and $-7\equiv1$ are, and every odd rational integer is a square or minus a square in $F_\lambda$. Neither $\varepsilon a\equiv3+6\sqrt3$ nor $-\varepsilon a\equiv5+2\sqrt3$ is a square, and no product of a nonempty subset of $\{-1,\varepsilon,\varepsilon a\}$ is congruent to an element of \eqref{eq:unitsq}, so $-1$, $\varepsilon$ and $\varepsilon a$ are independent in $F_\lambda^\times/F_\lambda^{\times2}$. \begin{lemma}[The dyadic image]\label{lem:dyadic} Let $c\in F_\lambda^\times$ with $c\in\pm2a F_\lambda^{\times2}$. Then over $F_\lambda$, $\Imm\alpha'_{c}=\{1,\sq{-1}\}$ and $|\Imm\alpha_c|=8$. \end{lemma} \begin{proof} If $c=s u^22a$ with $s=\pm1$, the maps $(x,y)\mapsto(u^2x,u^3y)$ are isomorphisms $E_{2a}\to E_c$ and $E'_{2a}\to E'_c$ (note $E_{-c}=E_c$); they commute with $\phi$, multiply abscissas by a square and fix $(0,0)$, so they preserve both images. We may therefore take $c=2a$. The ring of integers of $F_\lambda$ is isomorphic to $\Z_2^2$, so $\chi(E_c(F_\lambda))=|\Z_2^2/2\Z_2^2|=4$ in the notation of the proof of \cref{lem:oddplace}, and $|E_c(F_\lambda)/2E_c(F_\lambda)|=16$; by \cref{lem:rankformula}, $|\Imm\alpha_c|\cdot|\Imm\alpha'_c|=16$. On $E'_{2a}\colon y^2=x^3+16a^2x$ the abscissa $x=-2/\varepsilon=-4+2\sqrt3$ gives \[ x^3+16a^2x=-\Bigl(\frac{\lambda^3}{\varepsilon^3}\Bigr)^2(917+528\sqrt3), \] and $-(917+528\sqrt3)\equiv3\pmod8$ is a unit square by \eqref{eq:unitsq}; so $\sq{-2/\varepsilon}=\sq{-1}$ lies in $\Imm\alpha'_c$. On $E_{2a}$ the abscissa $x=2$ gives $x^3-4a^2x=16\cdot\bigl(-(9+4\sqrt3)\bigr)$ and $-(9+4\sqrt3)\equiv7+4\sqrt3=\varepsilon^2\pmod 8$, so $\sq2=\sq\varepsilon\in\Imm\alpha_c$. With the torsion classes $\alpha_c(0,0)=\sq{-1}$ and $\alpha_c(2a,0)=\sq{2a}=\sq{\varepsilon a}$, $\Imm\alpha_c$ contains $\langle-1,\varepsilon,\varepsilon a\rangle$, of order $8$, as $-1$, $\varepsilon$ and $\varepsilon a$ are independent. Hence $|\Imm\alpha'_c|\le2$, and since $-1$ is not a square in $F_\lambda$, $\Imm\alpha'_c=\{1,\sq{-1}\}$ and $|\Imm\alpha_c|=8$. \end{proof} \begin{proposition}\label{prop:family} Let $m\ge1$ be a squarefree integer all of whose prime factors $p$ satisfy $p\equiv\pm5\pmod{12}$ and $\bigl(\frac p{13}\bigr)=-1$, and let $c=2ma$. Then $\Imm\alpha'_c=\{1\}$ and $\Imm\alpha_c=\langle\sq{-1},\sq c\rangle$ over $F$, and $\rank E_c(F)=0$. \end{proposition} \begin{proof} Write $m=p_1\cdots p_r$ ($r\ge0$). Each $p_k$ is inert in $F$, so the odd primes dividing $c$ are $\mathfrak a$ and the $(p_k)$, each to the first power, and $v_\lambda(c)=2$. By \cref{lem:support} both images lie in $V=\langle-1,\varepsilon,a,p_1,\dots,p_r\rangle$. Write $e\in V$ as $e=(-1)^{h}\varepsilon^{i}a^{j}\prod_kp_k^{l_k}$ with exponents in $\{0,1\}$. At $v=(p_k)$ the field $F_v$ is unramified of degree two over $\Q_{p_k}$, with residue field $\FF_{p_k^2}$. Every element of $\FF_{p_k}$ is a square in $\FF_{p_k^2}$, so $-1$, $2$, $p_j$ ($j\neq k$) and $\varepsilon=\lambda^2/2$ are squares in $F_v$; a unit of $F_v$ is a square exactly when its norm to $\Q_{p_k}$ is a square modulo $p_k$, and $\Nm_{F/\Q}(a)=13$ is a nonsquare modulo $p_k$ because $\bigl(\frac{13}{p_k}\bigr)=\bigl(\frac{p_k}{13}\bigr)=-1$. Also $\iota=\sqrt{-1}$ and $2\iota$ are squares in $\FF_{p_k^2}$ (as $8\mid p_k^2-1$). At $v=\mathfrak a$, $F_v=\Q_{13}$, $-1$ and $2\iota$ are squares and $2$, $\varepsilon$, $p_k$ are not. So \cref{lem:oddplace} gives $\Imm\alpha_{c,v}=\Imm\alpha'_{c,v}=\langle\sq c\rangle$ at $\mathfrak a$ and at each $(p_k)$. In $F_v^\times/F_v^{\times2}\cong(\Z/2)^2$ use the coordinates (valuation modulo $2$, residue symbol of the unit part with respect to the uniformizer $p_k$, respectively $a$). At $(p_k)$, $\sq c$ has coordinates $(1,1)$ (the unit part $2a\prod_{j\ne k}p_j$ is a nonsquare because of $a$) and $e$ has coordinates $(l_k,j)$; so $e\in\langle\sq c\rangle$ forces $l_k=j$. At $\mathfrak a$, $\sq c$ has coordinates $(1,1+r)$ (unit part $2m$) and $e$ has $(j,i+\sum_kl_k)$; with $l_k=j$ the condition is $i+rj=j(1+r)$, that is $i=j$. Hence both images lie in $\{e\in V: l_k=j\text{ for all }k,\ i=j\}=\langle\sq{-1},\sq{\varepsilon am}\rangle=\langle\sq{-1},\sq c\rangle$, since $\sq c=\sq{2ma}=\sq{\varepsilon ma}$. The torsion gives $\alpha_c(0,0)=\sq{-1}$ and $\alpha_c(c,0)=\sq c$, so $\Imm\alpha_c=\langle\sq{-1},\sq c\rangle$. A class $e$ in $\Imm\alpha'_c$ is totally positive: if $e<0$ at a real place then the right-hand side of the first equation \eqref{eq:quartics} is negative there for $(U,V)\ne(0,0)$. So $\Imm\alpha'_c\subseteq\{1,\sq c\}$. At $\lambda$, $m$ is an odd rational integer, hence a square or minus a square, so $c\in\pm2aF_\lambda^{\times2}$, and \cref{lem:dyadic} gives $\Imm\alpha'_{c,\lambda}=\{1,\sq{-1}\}$; but $\sq c=\sq{\varepsilon a}\sq m$ with $\sq m\in\{1,\sq{-1}\}$, and neither $\varepsilon a$ nor $-\varepsilon a$ is a square in $F_\lambda$. So $\sq c\notin\Imm\alpha'_c$, and $\Imm\alpha'_c=\{1\}$. By \cref{lem:rankformula}, $2^{\rank E_c(F)}=4\cdot1/4=1$. \end{proof} \begin{proposition}[{Sun \cite[Theorem~1.6]{Sun}}]\label{prop:sunL1} For $L_1=\Q(\sqrt2,\sqrt3)$, $\rank E(L_1)=1$, $E(L_1)_\tors=E[2]$ and $2E(L_1)\subseteq E(F)$. \end{proposition} \begin{proof} Here $L_1=F(\sqrt2)$. By \cref{lem:twist} with $M=F$, $B=a^2$ and $\delta=2$, $\rank E(L_1)=\rank E(F)+\rank E_{2a}(F)=1+0$, by \cref{prop:sun14} and by \cref{prop:family} with $m=1$. By Kummer theory $F\cap L_1^{\times2}=F^{\times2}\cup2F^{\times2}$, whose elements have square norms, so \cref{lem:torsion}\ref{to:d} gives $E(L_1)_\tors=E[2]$. Finally \cref{lem:I3} gives $2E(L_1)\subseteq E(F)$. \end{proof} \needspace{6\baselineskip} \begin{proposition}\label{prop:conj} Let $m'\ge1$ be a squarefree integer as in \cref{prop:family}, prime to $13$, and $m=13m'$. Then $\rank E_{2ma}(F)=0$. \end{proposition} \begin{proof} Since $13=a\bar a$, $2ma=2m'\bar a\cdot a^2$, and $(x,y)\mapsto(a^2x,a^3y)$ is an isomorphism $E_{2m'\bar a}\to E_{2ma}$ over $F$. The curve $E_{2m'\bar a}$ is the conjugate of $E_{2m'a}$ under $\sigma$, and $\sigma$ maps $E_{2m'a}(F)$ bijectively onto $E_{2m'\bar a}(F)$. So $\rank E_{2ma}(F)=\rank E_{2m'a}(F)=0$ by \cref{prop:family}. \end{proof} \begin{proof}[Proof of \cref{thm:fields}] For \textup{(a)}, let $m$ be as in \cref{thm:fields} and $K=\Q(\sqrt{2m})$ or $\Q(\sqrt{6m})$. Then $\sqrt3\notin K$, since $6m$ and $18m$ are not squares, and $L=K(\sqrt3)=F(\sqrt{2m})$ in both cases (as $\sqrt{6m}/\sqrt3=\sqrt{2m}$). By \cref{lem:twist} with $M=F$, $B=a^2$ and $\delta=2m$, $\rank E(L)=\rank E(F)+\rank E_{2ma}(F)$, and $\rank E_{2ma}(F)=0$ by \cref{prop:family} if $13\nmid m$ and by \cref{prop:conj} if $13\mid m$. So \ref{I1} holds by \cref{prop:sun14}. By Kummer theory $F\cap L^{\times2}=F^{\times2}\cup2mF^{\times2}$, whose elements have square norms, so \cref{lem:torsion}\ref{to:d} gives \ref{I2}. Since $K/\Q$ is Galois, \cref{lem:I3} gives \ref{I3}. \Cref{thm:main} then gives a Diophantine definition of $\Z$ in $K$ with $25$ unknowns. For the seven cyclic fields of \cref{prop:five}, that proposition gives $\sqrt3\notin K$ and \ref{I1}--\ref{I3}, and \cref{thm:main} applies in the same way. For $K=\Q(\sqrt D)$ in \textup{(b)}, \cref{prop:family2} gives $\sqrt2\notin K$, $\sqrt3\notin K$ and \ref{I1}--\ref{I3} for the second curve, and \cref{thm:main} applies. For $K=\Q(\sqrt3)$, \cref{prop:Q3} gives $\sqrt2\notin K$ and \ref{I1}--\ref{I3}, and \cref{thm:main} applies. For $K=\Q(\sqrt D)$ in \textup{(c)} and for the $77$ fields $\Q(\sqrt D)$ of \cref{tab:fields}, \cref{prop:family3,prop:seventyseven} give $\sqrt2\notin K$ and \ref{I1}--\ref{I3} for the third curve, and \cref{thm:main} applies. For the four biquadratic fields of \cref{tab:fields}, \cref{prop:biquad} gives $\sqrt{17}\notin K$ and \ref{I1}--\ref{I3} for the fourth curve, and \cref{thm:main} applies, through \cref{sec:sqrt3} for the two fields that contain $\sqrt3$. The fields of \cref{prop:twins}, among them $\Q(\sqrt{2D})$, are treated in \cref{ssec:thirtytwo}. \end{proof} \needspace{4\baselineskip} \begin{corollary}[{Sun \cite[Theorems~1.2 and~1.4]{Sun}}]\label{cor:Q6} $\Z$ is Diophantine in $\Q(\sqrt6)$ and in $\Q(\sqrt2)$, with $25$ unknowns. \end{corollary} \begin{proof} This is the case $m=1$ of \cref{thm:fields}. In the proof of \cref{thm:main} one may take the tube prime $q=19$ and $\mathfrak q=(5-\sqrt6)$ for $\Q(\sqrt6)$, where Sun takes $q=331$ \cite[(15.1)]{Sun}, and Sun's $q=367$ \cite[\S1]{Sun}, with $\mathfrak q=(23-9\sqrt2)$, for $\Q(\sqrt2)$; see \cref{lem:tubeprime}. \end{proof} \subsection{Cyclic fields of degrees 3, 4, 5 and 8}\label{ssec:cubic} Let $K_f$ be the cyclic cubic field of conductor $f$ for $f=9$, $13$, $19$ and $37$, and the maximal real subfield $\Q(\zeta_f)^+$ of $\Q(\zeta_f)$ for $f=11$, $16$ and $32$. Put $L_f=K_fF$ and $L_1=\Q(\sqrt2,\sqrt3)$, and write $D_M$ for the discriminant of a number field $M$. For odd $f$ the degree $[L_f:F]$ is odd, and we bound $\rank E(L_f)$ by a complete $2$-descent over $L_f$, as in \cref{ssec:descentL}. The field $L_{16}$ is a quadratic extension of $L_1$, and $L_{32}$ of $L_{16}$, so for them the descent is that of a twist, by \cref{lem:twist}. Torsion is excluded by \cref{lem:torsion}. \needspace{4\baselineskip} \begin{proposition}\label{prop:five} Let $K=K_f$ be one of these seven fields, and $L=L_f$. Then $K=\Q(\theta)$ for a root $\theta$ of the polynomial $g_f$ in the table, and $q$ and $\mathfrak q$ are as there: \[ \begin{array}{lllcl} \toprule K & g_f(t) & \operatorname{disc}(g_f)=D_K & q & \mathfrak q\\ \midrule K_9 & t^3-3t-1 & 3^4 & 19 & (19,\theta-10)\\ K_{13} & t^3-t^2-4t-1 & 13^2 & 31 & (31,\theta-4)\\ K_{19} & t^3-t^2-6t+7 & 19^2 & 7 & (7,\theta)\\ K_{37} & t^3-t^2-12t-11 & 37^2 & 31 & (31,\theta-2)\\ K_{11} & t^5+t^4-4t^3-3t^2+3t+1 & 11^4 & 43 & (43,\theta-4)\\ K_{16} & t^4-4t^2+2 & 2^{11} & 31 & (31,\theta-5)\\ K_{32} & t^8-8t^6+20t^4-16t^2+2 & 2^{31} & 31 & (31,\theta-4)\\ \bottomrule \end{array} \] \begin{enumerate}[label=\textup{(\alph*)},ref=\textup{(\alph*)}] \item\label{five:a} $K$ is totally real and Galois over $\Q$, with cyclic Galois group, and $\sqrt3\notin K$; $L$ is totally real and Galois over $\Q$, of degree $2[K:\Q]$. \item\label{five:b} Conditions \ref{I1}, \ref{I2} and \ref{I3} hold for $K$. \item\label{five:c} $q\equiv7\pmod{12}$, and $\mathfrak q$ is a prime of $K$ above $q$, unramified over $q$, of residue degree one. For $K_9$, $K_{13}$ and $K_{37}$ the prime $7$ is inert, so $(7)$ is also a prime of $K$ unramified over $7$, of odd residue degree $3$. \end{enumerate} \end{proposition} By \ref{five:a} and \ref{five:b}, \cref{thm:main} applies to these fields, and \ref{five:c} gives primes $q$ and $\mathfrak q$ as in \cref{thm:height}, explicit tube primes for its proof, as \cref{cor:Q6} does for $\Q(\sqrt6)$ and $\Q(\sqrt2)$. \begin{lemma}\label{lem:fivefields} Parts \ref{five:a} and \ref{five:c} of \cref{prop:five} hold. Moreover: \begin{enumerate}[label=\textup{(\roman*)},ref=\textup{(\roman*)}] \item\label{ff:i} $K_f$ is the subfield of $\Q(\zeta_f)$ fixed by $H_f$, where $H_f=\{\pm1\}$ for $f=9$, $11$, $16$, $32$ and $H_f$ is the group of cubes in $(\Z/f)^\times$ for $f=13$, $19$, $37$. A prime $p\nmid f$ has residue degree in $K_f$ the order of $p$ in $(\Z/f)^\times/H_f$, and if $p$ splits in $F$, so has every prime of $L_f$ above $p$. The prime $11$ is totally ramified in $K_{11}$. \item\label{ff:ii} $F\cap L_f^{\times2}$ is $F^{\times2}$ for odd $f$, and $F^{\times2}\cup2F^{\times2}$ for $f=16$ and $32$. \item\label{ff:iii} For a root $\theta$ of $g_{16}$ put $\sqrt2=\theta^2-2$. Then $L_{16}=L_1(\theta)$, of degree $2$ over $L_1$, with $\theta^2=2+\sqrt2$. If $\vartheta$ is a root of $g_{32}$, then $\theta=\vartheta^2-2$ is a root of $g_{16}$, and $L_{32}=L_{16}(\vartheta)$, of degree $2$ over $L_{16}$, with $\vartheta^2=\alpha=2+\theta$. \end{enumerate} \end{lemma} \begin{proof} \emph{The fields $K$.} Each cubic $g_f$ has no rational root, as $\pm1$, $\pm7$ and $\pm11$ are not roots, so it is irreducible, and its discriminant is $f^2$. So $K=\Q(\theta)$ is cyclic of degree $3$, and it is totally real, as a real root generates it. As $D_K$ divides $f^2$ with square quotient and a cubic field has $|D_K|\ge23$, $\cO_K=\Z[\theta]$ and $D_K=f^2$, and $K=K_f$ by the conductor--discriminant formula. For $f=11$, $16$ and $32$, $\zeta_f+\zeta_f^{-1}$ is a root of $g_f$: for $f=11$ by $1+\sum_{k=1}^5(\zeta_{11}^k+\zeta_{11}^{-k})=0$, and for $f=16$ and $32$ because $(\zeta_f+\zeta_f^{-1})^2-2=\zeta_f^2+\zeta_f^{-2}$, $\zeta_8+\zeta_8^{-1}=\sqrt2$ and $g_{32}(t)=g_{16}(t^2-2)$. The polynomials $g_{16}$ and $g_{32}$ are Eisenstein at $2$, and $g_{11}(t+2)$ at $11$, the only prime dividing $\operatorname{disc}(g_f)$. So $g_f$ is irreducible, $\cO_K=\Z[\theta]$, $D_K=\operatorname{disc}(g_f)$, and $K=\Q(\zeta_f)^+$ by degrees, with Galois group $(\Z/f)^\times/\{\pm1\}$, cyclic as $(\Z/2^j)^\times=\{\pm1\}\times\langle5\rangle$. In \ref{ff:i}, $K_f$ is the fixed field of $\{\pm1\}$ for $f=11$, $16$ and $32$. A cyclic cubic field of conductor $f$ lies in $\Q(\zeta_f)$, and for $f=9$, $13$, $19$ and $37$ the group $(\Z/f)^\times$ is cyclic, with $H_f$ as its subgroup of index $3$. The residue degree of $p\nmid f$ is the order of its Frobenius, and $11$ is totally ramified in $\Q(\zeta_{11})$. For odd $f$, $[K:\Q]$ is odd. For $f=16$ and $32$ the only quadratic subfield of the cyclic field $K$ is $\Q(\sqrt2)$, as $\theta^2-2=\pm\sqrt2$ lies in $K_{16}\subseteq K_{32}$. So $\sqrt3\notin K$. \emph{The fields $L$.} Since $\sqrt3\notin K$, $[L:K]=2$. As $K\cap F=\Q$, $L$ is Galois over $\Q$ with $\Gal(L/\Q)=\Gal(K/\Q)\times\Gal(F/\Q)$, and it is totally real. A prime $p\nmid f$ that splits in $F$ has Frobenius $(\mathrm{Frob}_K,1)$ at a prime of $L$, which gives the last claim of \ref{ff:i}. Restriction maps $\Gal(L/F)$ isomorphically onto $\Gal(K/\Q)$. For odd $f$, if $x\in L$ and $x^2\in F$, then $[F(x):F]\le2$ divides the odd degree $[L:F]$, so $x\in F$. For $f=16$ and $32$, $L/F$ is cyclic, its only quadratic subextension is $F(\sqrt2)=L_1$, and Kummer theory gives \ref{ff:ii}. For \ref{ff:iii}, $L_{16}=\Q(\theta,\sqrt3)$ contains $\sqrt2=\theta^2-2$, so $L_{16}=L_1(\theta)$, and $g_{16}(\vartheta^2-2)=g_{32}(\vartheta)=0$ and $L_{32}=\Q(\vartheta,\sqrt3)=L_{16}(\vartheta)$; the degrees of $L_1$, $L_{16}$ and $L_{32}$ over $\Q$ are $4$, $8$ and $16$. \emph{Part \ref{five:c}.} Each prime $q$ of the table is congruent to $7$ modulo $12$ and does not divide $\operatorname{disc}(g_f)$, so it is unramified in $K$. The $r$ of $\mathfrak q=(q,\theta-r)$ is a root of $g_f$ modulo $q$, simple as $q\nmid\operatorname{disc}(g_f)$, and since $\cO_K=\Z[\theta]$, Dedekind's criterion makes $\mathfrak q$ a prime of degree one. By \ref{ff:i}, $7$ is inert in $K_9$, $K_{13}$ and $K_{37}$, as $7\not\equiv\pm1\pmod9$ and $7$ is not a cube modulo $13$ or $37$. \end{proof} \subsection{A complete \texorpdfstring{$2$}{2}-descent}\label{ssec:descentL} Let $M$ be a totally real number field containing $F$, of degree $n_M$, and let $c\in\cO_M$ be nonzero. The curve $E_c\colon y^2=x^3-c^2x=x(x-c)(x+c)$ of \cref{ssec:descent}, now over $M$, has its points of order two $(0,0)$, $(c,0)$, $(-c,0)$ defined over $M$, and we bound $\rank E_c(M)$ by a complete $2$-descent. Dimensions are over $\FF_2$. Let $S$ be the set of finite primes of $M$ dividing $2c$, and \[ M(S,2)=\{x\in M^\times/M^{\times2}:\ v(x)\text{ is even for every finite prime }v\notin S\}. \] For a field $k\supseteq M$ let $\partial_k\colon E_c(k)\to(k^\times/k^{\times2})^2$ be the map \[ (x,y)\mapsto(x,\,x-c)\ \ (x\ne0,c),\qquad(0,0)\mapsto(-c^2,-c),\qquad(c,0)\mapsto(c,2c^2),\qquad O\mapsto(1,1), \] and write $\partial=\partial_M$ and $\partial_v=\partial_{M_v}$ for a place $v$ of $M$, with $\cO_v$ the ring of integers of $M_v$ when $v$ is finite. By \cite[Proposition~X.1.4]{Silverman}, with $e_1=0$, $e_2=c$ and $e_3=-c$, the map $\partial_k$ is a homomorphism with kernel $2E_c(k)$ for $k=M$; its values there at $(0,0)$ and $(c,0)$ are $(-1,-c)$ and $(c,2)$, equal modulo squares to those above. The same holds for $k=M_v$, as the proof uses only that $k$ is perfect of characteristic not $2$ with $E_c[2]\subseteq E_c(k)$. As $E_c$ has discriminant $64c^6$, $S$ contains the primes of bad reduction, and the same proposition gives $\partial(E_c(M))\subseteq M(S,2)^2$. So $E_c(M)/2E_c(M)$, of dimension $\rank E_c(M)+2$, embeds in \begin{equation}\label{eq:sel} \Sel(E_c/M)=\bigl\{\xi\in M(S,2)^2:\ \xi_v\in\partial_v(E_c(M_v))\text{ for every }v\in S\text{ and every real place }v\bigr\}, \end{equation} where $\xi_v$ is the image of $\xi$ in $(M_v^\times/M_v^{\times2})^2$. Hence $\rank E_c(M)\le\dim\Sel(E_c/M)-2$. \needspace{4\baselineskip} \begin{lemma}\label{lem:localimages} Let $v$ be a place of $M$. \begin{enumerate}[label=\textup{(\roman*)},ref=\textup{(\roman*)}] \item\label{li:i} If $v$ is finite, then $|E_c(M_v)/2E_c(M_v)|$ is $4\cdot2^{[M_v:\Q_2]}$ if $v\mid2$ and $4$ if $v\nmid2$. So $\partial_v(E_c(M_v))$ has dimension $2+[M_v:\Q_2]$, respectively $2$, and any subspace of it of that dimension is all of it. \item\label{li:ii} If $v$ is real, then $\partial_v(E_c(M_v))=\{(1,1),\,(-1,-c)\}$, of dimension $1$. \item\label{li:iii} If $v$ is finite, with uniformiser $\pi$ and ramification index $e$ over $p$, then $\pi^ku\mapsto(k\bmod2,\ u\bmod v^m)$ ($u\in\cO_v^\times$) induces an isomorphism $M_v^\times/M_v^{\times2}\to\Z/2\times G/G^2$, where $G=(\cO_v/v^m)^\times$ with $m=2e+1$ if $p=2$ and $m=1$ if $p$ is odd. \end{enumerate} \end{lemma} \begin{proof} \ref{li:i} As in the proofs of \cref{lem:oddplace,lem:dyadic}: $\chi(A)=|A/2A|/|A[2]|$ is multiplicative in short exact sequences and $1$ on finite groups, $E_c(M_v)$ has a subgroup of finite index isomorphic to the additive group of $\cO_v$ \cite[Proposition~VII.6.3]{Silverman}, $\chi(\cO_v)=|\cO_v/2\cO_v|$ is $2^{[M_v:\Q_2]}$ if $v\mid2$ and $1$ otherwise, and $E_c(M_v)[2]=E_c[2]$ has order $4$. As $\partial_v$ has kernel $2E_c(M_v)$, it is injective on $E_c(M_v)/2E_c(M_v)$. \ref{li:ii} On $E_c(\R)$ the cubic $x(x-c)(x+c)$ is nonnegative exactly when $-|c|\le x\le0$ or $x\ge|c|$. For $x\ge|c|$ we have $x>0$ and $x-c\ge0$, with $x-c=0$ only at $(c,0)$ when $c>0$, whose image $(c,2c^2)$ is $(1,1)$; so these points map to $(1,1)$. For $-|c|\le x\le0$ we have $x\le0$, and $x-c$ has the sign of $-c$; it vanishes only at $(c,0)$ when $c<0$, whose image is $(c,2c^2)=(-1,1)=(-1,-c)$. So these points map to $(-1,-c)=\partial_v(0,0)$. \ref{li:iii} A unit $u$ with $u\equiv w^2\pmod{v^m}$ has $v(u/w^2-1)\ge m$. For $p=2$, $m=2e+1>2v(2)$, so Hensel's lemma applied to $X^2-u/w^2$ at $X=1$ gives a root; for $p$ odd, a unit that is a square modulo $v$ is a square. So $\cO_v^\times/\cO_v^{\times2}\cong G/G^2$. \end{proof} \needspace{4\baselineskip} \begin{proposition}\label{prop:selmer} For the fields $M$ and the curves $E_c$ in the table, where $\alpha=2+\theta$ for a root $\theta$ of $g_{16}$, every prime ideal of $M$ of norm at most $B_M=(n_M!/n_M^{n_M})\sqrt{|D_M|}$ is principal, and $\Sel(E_c/M)$ has the dimension given there. The column $S$ gives the ramification index and the residue degree of the prime of $M$ above $2$ and of the prime above $\mathfrak a=(a)$, and ``rank'' is the rank of the local conditions that define $\Sel(E_c/M)$ in $M(S,2)^2$. \[ \begin{array}{lcccccc} \toprule M & D_M & S & \dim M(S,2) & c & \text{rank} & \dim\Sel(E_c/M)\\ \midrule L_9 & 2^6\cdot3^9 & (2,3);\,(1,3) & 8 & a & 13 & 3\\ L_{13} & 2^6\cdot3^3\cdot13^4 & (2,3);\,(3,1) & 8 & a & 13 & 3\\ L_{19} & 2^6\cdot3^3\cdot19^4 & (2,3);\,(1,3) & 8 & a & 13 & 3\\ L_{37} & 2^6\cdot3^3\cdot37^4 & (2,3);\,(1,3) & 8 & a & 13 & 3\\ L_{11} & 2^{10}\cdot3^5\cdot11^8 & (2,5);\,(1,5) & 12 & a & 21 & 3\\ L_1 & 2^8\cdot3^2 & (4,1);\,(1,2) & 6 & (2+\sqrt2)a & 10 & 2\\ L_{16} & 2^{24}\cdot3^4 & (8,1);\,(1,4) & 10 & \alpha a & 18 & 2\\ \bottomrule \end{array} \] \end{proposition} \begin{proof} For each prime ideal $\mathfrak p$ of norm at most $B_M$ we find $\beta\in\mathfrak p$ with $|\Nm_{M/\Q}(\beta)|=N\mathfrak p$; then $\mathfrak p\mid(\beta)$ and the norms agree, so $\mathfrak p=(\beta)$. By Minkowski's bound $M$ then has class number one. So $M(S,2)$ is the image of the group of $S$-units, and by Dirichlet's $S$-unit theorem it has dimension $n_M+\#S$, as $M$ is totally real and an $S$-unit that is a square in $M$ is the square of an $S$-unit. We find a basis of $M(S,2)$ consisting of $-1$, $n_M-1$ units and generators of the primes of $S$. Their independence modulo squares is shown by quadratic characters: at a prime $\mathfrak l\notin S$ of degree one at which they are units, $x\mapsto(x\bmod\mathfrak l)^{(N\mathfrak l-1)/2}$ kills squares, and the matrix of these characters at some such primes has full rank. Local classes at a finite place are computed through \cref{lem:localimages}\ref{li:iii}, by discrete logarithms in $(\cO_v/v^m)^\times$, and at a real place they are signs. At the prime above $2$ we find points of $E_c(M_v)$ whose images span a space of the dimension $2+[M_v:\Q_2]=2+n_M$ of \cref{lem:localimages}\ref{li:i}, which is therefore the whole image. At the prime above $\mathfrak a$ the images of $E_c[2]$ span the image, of dimension $2$, and at the real places it is given by \cref{lem:localimages}\ref{li:ii}. So $\Sel(E_c/M)$ is the kernel of $2n_M+4=2\dim M(S,2)$ linear forms on $M(S,2)^2$: $n_M+2$ at the prime above $2$, two at the prime above $\mathfrak a$ and one at each of the $n_M$ real places. We find the ranks in the table. The sets $S$ come from the splitting of $2$ and $13$. For odd $f$, $2$ is inert in $K_f$ by \cref{lem:fivefields}\ref{ff:i}, as $2\not\equiv\pm1$ modulo $9$ and $11$, and $2$ is not a cube modulo $13$, $19$ or $37$. As $2$ ramifies in $F$, $L_f$ has one prime above $2$, with ramification index $2$ and residue degree $[K_f:\Q]$. In $L_{16}$ the prime $2$ is totally ramified. Indeed an inertia group above $2$ maps onto $\Gal(K_{16}/\Q)$, as $g_{16}$ is Eisenstein at $2$, and if it had index $2$ in $\Gal(L_{16}/\Q)$, its fixed field would be a quadratic field unramified at $2$; but the quadratic subfields $\Q(\sqrt2)$, $\Q(\sqrt3)$ and $\Q(\sqrt6)$ of $L_{16}$ all ramify at $2$. The same argument applies to $L_1$, whose quadratic subfields are these three. The prime $\mathfrak a$ is totally ramified in $L_{13}/F$. It is inert in $L_1=F(\sqrt2)$, as $2$ is not a square modulo $13$, and in the other $L_f$ of the table, as $13$ has order $[K_f:\Q]$ in $(\Z/f)^\times/H_f$. For $c=(2+\sqrt2)a$ and $c=\alpha a$ the set $S$ is the same as for $c=a$: $(2+\sqrt2)=(\sqrt2)$ is the prime of $\Q(\sqrt2)$ above $2$, and $\Nm_{K_{16}/\Q}(\alpha)=g_{16}(-2)=2$, so $\alpha\cO_{L_{16}}$ is the square of the prime above $2$. For $M=L_{11}$ the image at the prime $\mathfrak w=\lambda\cO_M$ above $2$ comes from explicit points. Here $M_{\mathfrak w}$ is unramified of degree $5$ over $F_\lambda$, with residue field $k\cong\FF_{32}$, and $a=3+\lambda\equiv1\pmod{\mathfrak w}$, so $x^3-a^2x$ reduces to $x^3+x=x(x+1)^2$. For each of the $31$ elements $r\ne1$ of $k$, let $y_r=\lambda$ if $r=0$, and otherwise let $y_r\in\cO_M$ lift the square root of $r^3+r$ in $k$. Then $r$ is a simple root of $X^3-a^2X-y_r^2$ modulo $\mathfrak w$. Newton's method, run modulo $2^{40}$, gives $\tilde x_r\in\cO_M$ with $\tilde x_r\equiv r\pmod{\mathfrak w}$ such that $\tilde x_r^3-a^2\tilde x_r$ is a nonzero square in $M_{\mathfrak w}$, by \cref{lem:localimages}\ref{li:iii}; so $\tilde x_r$ is the abscissa of a point of $E(M_{\mathfrak w})$. The images of these $31$ points, with $\partial_{\mathfrak w}(0,0)$ and $\partial_{\mathfrak w}(a,0)$, span a space of dimension $12=2+[M_{\mathfrak w}:\Q_2]$, the whole image. \end{proof} \subsection{The conditions over \texorpdfstring{$L$}{L}}\label{ssec:fiveproof} \begin{proof}[Proof of \cref{prop:five}] Parts \ref{five:a} and \ref{five:c} are \cref{lem:fivefields}. We prove \ref{five:b}. \emph{Condition \ref{I1}.} For odd $f$, $\dim\Sel(E/L_f)=3$ by \cref{prop:selmer}, so $\rank E(L_f)\le1$ by \eqref{eq:sel}. The point $P_0\in E(F)\subseteq E(L_f)$ has infinite order by \cref{prop:sun14}, so $\rank E(L_f)=1$. For $f=16$ put $s=2+\sqrt2$, so that $L_{16}=L_1(\theta)$ with $\theta^2=s$, by \cref{lem:fivefields}\ref{ff:iii}. \Cref{lem:twist} with $M=L_1$, $B=a^2$ and $\delta=s$ gives $\rank E(L_{16})=\rank E(L_1)+\rank E_{sa}(L_1)$. Here $\rank E(L_1)=1$ by \cref{prop:sunL1}, and $\dim\Sel(E_{sa}/L_1)=2$ by \cref{prop:selmer}, so $\rank E_{sa}(L_1)=0$ by \eqref{eq:sel}. Hence $\rank E(L_{16})=1$. For $f=32$ the same argument, with $M=L_{16}$, $\delta=\alpha$ and $L_{32}=L_{16}(\vartheta)$, gives $\rank E(L_{32})=\rank E(L_{16})+\rank E_{\alpha a}(L_{16})=1+0$. \emph{Condition \ref{I2}.} By \cref{lem:fivefields}\ref{ff:ii}, every element of $F\cap L^{\times2}$ has its norm in $\Q^{\times2}$. So \cref{lem:torsion}\ref{to:c} gives $E(L)_\tors=E[2]$, with the primes $p_1$, $p_2$ and the residue degrees $k_1$, $k_2$ of the primes of $L$ above them in the following table, for which no prime $\ell\ge5$ divides both $p_1N_{k_1}(p_1)$ and $p_2N_{k_2}(p_2)$: \[ \begin{array}{lccccccc} \toprule f & 9 & 13 & 19 & 37 & 11 & 16 & 32\\ \midrule p_1\ (k_1) & 11\ (3) & 11\ (3) & 11\ (1) & 11\ (1) & 11\ (1) & 11\ (4) & 11\ (8)\\ p_2\ (k_2) & 23\ (3) & 23\ (3) & 23\ (3) & 23\ (1) & 23\ (1) & 23\ (2) & 47\ (2)\\ \bottomrule \end{array} \] The primes $11$, $23$ and $47$ are congruent to $3$ modulo $4$ and split in $F$, as $3$ is $5^2$, $7^2$ and $12^2$ modulo them. The residue degrees come from \cref{lem:fivefields}\ref{ff:i}, except at $11$ in $L_{11}$, where they are one, as $11$ splits in $F$ and is totally ramified in $K_{11}$. For $L_{32}$ the prime $47$ replaces $23$: the primes of $L_{32}$ above $23$ have residue degree $4$, and $N_4(23)=(23^2-1)^2$ is divisible by $11$. \emph{Condition \ref{I3}.} Since $K/\Q$ is Galois, \ref{I3} follows from \ref{I1} and \ref{I2} by \cref{lem:I3}. \end{proof} \subsection{Real quadratic fields for the second curve}\label{ssec:family2} In this subsection $E$ is the second index curve, over $F=\Q(\sqrt2)$, with the notation of \cref{ssec:second}. Let $I^-$ be the set of primes $q$ with $q\equiv\pm3\pmod8$ and $\bigl(\frac q7\bigr)=-1$, that is, $q\equiv3$, $5$, $13$, $19$, $27$ or $45\pmod{56}$. The integers $D$ of \cref{thm:fields}\textup{(b)} are the products $D=7^kq_1\cdots q_r\ne3$ with $k\in\{0,1\}$, $r$ odd and $q_1,\dots,q_r$ distinct primes of $I^-$: a product of $r$ residues in $\{3,5\}$ modulo $8$ lies in $\{3,5\}$ exactly when $r$ is odd, and $7\equiv-1$ exchanges $3$ and $5$. \begin{lemma}[The dyadic place]\label{lem:dyadic2} Let $F_\lambda=\Q_2(\sqrt2)$, with ring of integers $\cO_\lambda=\Z_2[\sqrt2]$ and $v_\lambda(2)=2$. \begin{enumerate}[label=\textup{(\alph*)},ref=\textup{(\alph*)}] \item\label{d2:a} A unit $u=x+y\sqrt2$ of $\cO_\lambda$ ($x$ odd) is a square in $F_\lambda$ if and only if $u\equiv1$ or $3+2\sqrt2\pmod{4\sqrt2}$, that is, $(x\bmod8,\,y\bmod4)$ is $(1,0)$ or $(3,2)$. \item\label{d2:b} In $F_\lambda^\times/F_\lambda^{\times2}$ the subgroup $\langle\sq{-1},\sq5\rangle$ has order $4$ and is the set of classes of units $x+y\sqrt2$ with $y$ even. It contains the classes of $\pi_7$, of $3$ and of every odd rational integer, and $\sq{\pi_7}=\sq3=\sq{-5}$; it contains neither $\sq\varepsilon$ nor $\sq\lambda$. \item\label{d2:c} If $c\in\pm5F_\lambda^{\times2}$, then over $F_\lambda$, $\Imm\alpha_c=\Imm\alpha'_c=\langle\sq{-1},\sq5\rangle$. \end{enumerate} \end{lemma} \begin{proof} \ref{d2:a} If $u\equiv w^2\pmod{4\sqrt2}$ with $w$ a unit, then $u/w^2\equiv1\pmod{\lambda^5}$, and $X^2-u/w^2$ has a root by Hensel's lemma, since $5>2v_\lambda(2)=4$. The squares of units are $(x+y\sqrt2)^2=x^2+2y^2+2xy\sqrt2$, which is $\equiv1$ ($y$ even) or $3+2\sqrt2$ ($y$ odd) modulo $(8,4\sqrt2)$; and the ideal $(4\sqrt2)$ is $\{8n+4n'\sqrt2:n,n'\in\Z_2\}$, so a residue modulo $4\sqrt2$ is the pair $(x\bmod8,\,y\bmod4)$. \ref{d2:b} The residues of $1,-1,5,-5$ are $(1,0)$, $(7,0)$, $(5,0)$, $(3,0)$; multiplied by $3+2\sqrt2$ they give $(3,2)$, $(5,2)$, $(7,2)$, $(1,2)$. These eight residues are distinct, so the four classes are distinct, and together they are all units with $x$ odd and $y$ even. The residue of $\pi_7$ is $(1,2)$, that of $3(3+2\sqrt2)$, so $\sq{\pi_7}=\sq3=\sq{-5}$; an odd rational integer has $y=0$; $\varepsilon$ has $y=1$; and $\lambda$ has odd valuation. \ref{d2:c} The isomorphisms $(x,y)\mapsto(u^2x,u^3y)$ of $E_c$ onto $E_{cu^2}$ and of $E'_c$ onto $E'_{cu^2}$ commute with $\phi$ and multiply abscissas by a square, and $E_{-c}=E_c$, $E'_{-c}=E'_c$; so the images depend only on the class of $c$ in $F_\lambda^\times/\pm F_\lambda^{\times2}$, and we may take $c=5$. As $\cO_\lambda\cong\Z_2^2$, $\chi(E_5(F_\lambda))=4$ in the notation of the proof of \cref{lem:oddplace}, so $|E_5(F_\lambda)/2E_5(F_\lambda)|=16$ and $|\Imm\alpha_5|\cdot|\Imm\alpha'_5|=16$ by \cref{lem:rankformula}. The image of $\alpha_5$ contains $\{1,\sq{-25},\sq5,\sq{-5}\}=\langle\sq{-1},\sq5\rangle$, of order $4$ by \ref{d2:b}. On $E'_5\colon y^2=x^3+100x$ the point $(5,25)$ gives $\sq5\in\Imm\alpha'_5$; and $X_1=-6-4\sqrt2=-2\varepsilon^2$ gives $X_1^3+100X_1=16(-87-60\sqrt2)$, where $-87-60\sqrt2$ has residue $(1,0)$ and is a square by \ref{d2:a}; so there is a local point with abscissa $X_1$, and $\sq{X_1}=\sq{-2\varepsilon^2}=\sq{-1}\in\Imm\alpha'_5$, as $2=\lambda^2$. So $|\Imm\alpha'_5|\ge4$, hence $|\Imm\alpha_5|\le4$ and $\Imm\alpha_5=\langle\sq{-1},\sq5\rangle$; then $|\Imm\alpha'_5|=4$ and $\Imm\alpha'_5=\langle\sq{-1},\sq5\rangle$. \end{proof} \needspace{4\baselineskip} \begin{proposition}\label{prop:c1} Let $s\ge0$ be even, let $q_1,\dots,q_s$ be distinct primes of $I^-$, and put $c_1=\pi_7q_1\cdots q_s$. Then over $F$, $\Imm\alpha'_{c_1}=\{1\}$, $\Imm\alpha_{c_1}=\langle\sq{-1},\sq{c_1}\rangle$ and $\rank E_{c_1}(F)=0$. The same holds for $\bar c_1=\bar\pi_7q_1\cdots q_s$. \end{proposition} \begin{proof} Each $(q_k)$ is a prime of $F$, as $q_k$ is inert. The primes dividing $2c_1$ are $(\lambda)$, $(\pi_7)$ and the $(q_k)$, the odd ones to the first power, and $v_\lambda(c_1)=0$; so by \cref{lem:support} both images lie in $V=\langle-1,\varepsilon,\pi_7,q_1,\dots,q_s\rangle$. At $(\lambda)$, by \cref{lem:dyadic2}\ref{d2:b}, $\sq{\pi_7}=\sq{-5}$ and each $\sq{q_k}$ is $\sq5$ or $\sq{-5}$ (as $q_k\equiv5$ or $3\pmod8$), so $c_1\in\pm5^{s+1}F_\lambda^{\times2}=\pm5F_\lambda^{\times2}$, $s$ being even. By \cref{lem:dyadic2}\ref{d2:c} both local images at $(\lambda)$ are $\langle\sq{-1},\sq5\rangle$, which on $V$ says that the exponent of $\varepsilon$ is $0$, by \cref{lem:dyadic2}\ref{d2:b}. Write the remaining classes as $e=(-1)^h\pi_7^j\prod_kq_k^{l_k}$. At $v=(q_k)$ the field $F_v$ is unramified of degree two over $\Q_{q_k}$, with residue field $\FF_{q_k^2}$. Every element of $\FF_{q_k}$ is a square in $\FF_{q_k^2}$, so $-1$ and every rational integer prime to $q_k$ are squares in $F_v$; so is $2\iota$, as $8\mid q_k^2-1$. The element $\pi_7$ is a unit at $v$, as $\Nm_{F/\Q}(\pi_7)=-7$, and it is not a square: a unit is a square exactly when its residue $z$ satisfies $z^{(q_k^2-1)/2}=1$, and $z^{(q_k^2-1)/2}=(z^{q_k+1})^{(q_k-1)/2}=\Nm(z)^{(q_k-1)/2}$, as the Frobenius of the inert prime acts as $\sigma$; so $\pi_7$ is a square exactly when $\bigl(\frac{-7}{q_k}\bigr)=1$, and $\bigl(\frac{-7}{q_k}\bigr)=\bigl(\frac{q_k}7\bigr)=-1$ by quadratic reciprocity. Since $v(c_1)=1$, \cref{lem:oddplace} gives $\Imm\alpha_{c_1,v}=\Imm\alpha'_{c_1,v}=\langle\sq{c_1}\rangle$; the unit part of $c_1$ at $v$ is $\pi_7$ times a rational integer, a nonsquare. For $\alpha_{c_1}$: the unit part of $e$ at $(q_k)$ is $(-1)^h\pi_7^j$ times a rational number, a square exactly when $j=0$. So $l_k=0$ forces $j=0$, and $l_k=1$ forces $e/c_1$, whose unit part is $(-1)^h\pi_7^{j-1}$ times a rational number, to be a square, that is $j=1$: the condition at $(q_k)$ is $l_k=j$. (For $s=0$ there is nothing to impose: the classes $(-1)^h\pi_7^j$ already form $\langle\sq{-1},\sq{c_1}\rangle$.) Hence $e=(-1)^h(\pi_7q_1\cdots q_s)^j=(-1)^hc_1^j$, and $\Imm\alpha_{c_1}\subseteq\langle\sq{-1},\sq{c_1}\rangle$; equality holds since $\alpha_{c_1}(0,0)=\sq{-1}$ and $\alpha_{c_1}(c_1,0)=\sq{c_1}$. For $\alpha'_{c_1}$: at a real place a point of $y^2=x(x^2+4c_1^2)$ has $x\ge0$, so $e$ is totally positive. Now $-1$ is negative at both real places, $\pi_7$ is negative at $\sqrt2\mapsto-\sqrt2$ and positive at the other, and the $q_k$ are positive; so $h=j=0$ and $e=\prod_kq_k^{l_k}$. At $(q_k)$ the unit part of $e$ is rational, hence a square, so $l_k=1$ would need $e/c_1$, whose unit part is $\pi_7^{-1}$ times a rational number, to be a square, which it is not. So every $l_k=0$, and $\Imm\alpha'_{c_1}=\{1\}$. By \cref{lem:rankformula}, $2^{\rank E_{c_1}(F)}=4\cdot1/4=1$. For $\bar c_1$ apply $\sigma$, which carries $E_{c_1}$ to $E_{\bar c_1}$ and $E_{c_1}(F)$ onto $E_{\bar c_1}(F)$. \end{proof} \begin{proposition}\label{prop:family2} Let $D$ be as in \cref{thm:fields}\textup{(b)}, $K=\Q(\sqrt D)$ and $L=KF=F(\sqrt D)$. Then $\rank E_{Da}(F)=0$, $\sqrt2\notin K$ and $\sqrt3\notin K$, and \ref{I1}, \ref{I2} and \ref{I3} hold for $K$. \end{proposition} \begin{proof} Write $D=7^k3^jm$ with $k,j\in\{0,1\}$ and $m$ prime to $21$, and put $c_1=3^{1-j}m\pi_7$. Since $a=3\pi_7$ and $7\pi_7=-\pi_7^2\bar\pi_7$, we have $Da=(3^j)^2c_1$ if $k=0$, and $Da=-(3^j\pi_7)^2\cdot3^{1-j}m\bar\pi_7=-(3^j\pi_7)^2\bar c_1$ if $k=1$. As $E_{cu^2}\cong E_c$ and $E_{-c}=E_c$, $E_{Da}$ is isomorphic over $F$ to $E_{c_1}$ or to $E_{\bar c_1}$. The primes dividing $c_1/\pi_7$ are $3$ (if $j=0$) and those of $m$; they are distinct and lie in $I^-$ ($3\in I^-$), and with $r$ the number of prime factors of $D$ other than $7$, there are $(1-j)+(r-j)=r+1-2j$ of them, an even number. So $\rank E_{Da}(F)=0$ by \cref{prop:c1}. As $D$ is squarefree and odd and $D\ne3$, $K$ is a real quadratic field other than $\Q(\sqrt2)$ and $\Q(\sqrt3)$, and $D\notin F^{\times2}$, as $F^{\times2}\cap\Q=\Q^{\times2}\cup2\Q^{\times2}$. So \cref{lem:twist} with $M=F$, $B=a^2$ and $\delta=D$ gives $\rank E(L)=\rank E(F)+\rank E_{Da}(F)=1+0$, by \cref{prop:second}; this is \ref{I1}. \Cref{lem:torsion2} gives \ref{I2}, and \cref{lem:I3} gives \ref{I3}, as $L/F$ is Galois. \end{proof} For $D=5$ and $D=13$ one may take the tube prime $q=19$, respectively $q=43$, in the proof of \cref{thm:main}: both are congruent to $7$ modulo $12$ and split in $K$, as $\bigl(\frac5{19}\bigr)=\bigl(\frac{19}5\bigr)=\bigl(\frac45\bigr)=1$ and $\bigl(\frac{13}{43}\bigr)=\bigl(\frac{43}{13}\bigr)=\bigl(\frac4{13}\bigr)=1$, so a prime of $K$ above $q$ is unramified of residue degree one (\cref{lem:tubeprime}). \begin{proposition}\label{prop:Q3} Let $K=\Q(\sqrt3)$ and $L=KF=\Q(\sqrt2,\sqrt3)$. Then $\rank E_{3a}(F)=0$, $\sqrt2\notin K$, and \ref{I1}, \ref{I2} and \ref{I3} hold for $K$. \end{proposition} \begin{proof} The proof of \cref{prop:family2} applies to $D=3$, which is squarefree with $D\equiv3\pmod8$ and $3\in I^-$: there $k=0$, $j=1$, $m=1$, $c_1=\pi_7$ and $3a=3^2c_1$, and the number of primes dividing $c_1/\pi_7$ is $r+1-2j=0$, so \cref{prop:c1} applies with $s=0$. In its second paragraph, $K=\Q(\sqrt3)$ is a real quadratic field other than $\Q(\sqrt2)$, and $3\notin F^{\times2}$ as before; the rest applies as written. \end{proof} For $K=\Q(\sqrt3)$ one may take the tube datum at two primes $q=11$, $q'=23$ (\cref{def:twoprime}), with any primes $\mathfrak q\mid11$ and $\mathfrak q'\mid23$ of $K$: both primes are $11$ modulo $12$ and split in $K$, as $3\equiv5^2\pmod{11}$ and $3\equiv7^2\pmod{23}$; $23\nmid6\cdot11\cdot124$; and $g_{11}(1)=2^{-6}\cdot3^2\cdot5^3\cdot11^{-2}\cdot13\cdot19\cdot31^{-4}\cdot53\cdot443$ is a $23$-adic unit with $3g_{11}(1)\equiv7\pmod{23}$, which, like $-1$, is not a square modulo $23$. Sun proves that $\Z$ is Diophantine in $\Q(\sqrt3)$, with $25$ unknowns, using the curve $y^2=x^3-(15+6\sqrt2)^2x$ over $\Q(\sqrt2)$ and a tube at the primes $347$ and $359$ built on another map, whose second prime acts through ramification \cite[Theorem~1.3, (14.1), (14.5) and (14.8)]{Sun}; \cref{prop:Q3,thm:main} give another proof, with the second index curve and the tube of \cref{def:twoprime} at the primes $11$ and $23$. \needspace{6\baselineskip} \begin{remark}\label{rem:fifteen} The second curve does not serve the fields $K$ with $\sqrt2\notin K$ and $KF=\Q(\sqrt2,\sqrt3,\sqrt5)$, namely $\Q(\sqrt3,\sqrt5)$, $\Q(\sqrt3,\sqrt{10})$, $\Q(\sqrt5,\sqrt6)$ and $\Q(\sqrt6,\sqrt{10})$, nor those with $KF=\Q(\sqrt2,\sqrt3,\sqrt{13})$, namely $\Q(\sqrt3,\sqrt{13})$, $\Q(\sqrt3,\sqrt{26})$, $\Q(\sqrt6,\sqrt{13})$ and $\Q(\sqrt6,\sqrt{26})$: for them \ref{I1} fails. Indeed $15a=3^2\cdot5\pi_7$ and $39a=3^2\cdot13\pi_7$, and the points \begin{gather*} (23-17\sqrt2,\ 168-105\sqrt2)\in E_{5\pi_7}(F),\\ \Bigl(\frac{4120503543+2435996511\sqrt2}{5183^2},\ -\frac{320982675468000+231018578548485\sqrt2}{5183^3}\Bigr)\in E_{13\pi_7}(F) \end{gather*} have infinite order: $(x,y)\mapsto(9x,27y)$ followed by the map of \cref{lem:twist} carries them to points $Q$ of $E(F(\sqrt{15}))$, respectively $E(F(\sqrt{39}))$, with $y(Q)\ne0$, and these groups have torsion $E[2]$ by \cref{lem:torsion2}. By \cref{lem:twist}, $\rank E(L)\ge\rank E(F(\sqrt{15}))=\rank E(F)+\rank E_{15a}(F)\ge2$, respectively with $\sqrt{39}$ and $39a$. \end{remark} \begin{remark}[Odd $D$ and the parity of the rank]\label{rem:parity} In this paper the quadratic fields $\Q(\sqrt D)$ with $D$ odd come only from the second and third index curves, not from Sun's curve: from the second only with $D\equiv\pm3\pmod8$, and from the third with $7\mid D$ and $D\equiv\pm1\pmod8$. Apart from the condition $D\equiv\pm1\pmod8$ for the third curve, which the proof of \cref{prop:family3} uses at $(\lambda)$, the reason is the parity of the rank. Let $F$ be a real quadratic field, $c\in F^\times$, $D$ an odd integer with $\sqrt D\notin F$, and $L=F(\sqrt D)$. The quadratic twist of $E_c$ by $D$ is $E_{cD}$, so the global root number of $E_c$ over $L$ is $w(E_c/F)\,w(E_{cD}/F)$ \cite[Lemma~2.10]{CKD}. Suppose that $D$ is $\pm1$ times a square in $F_v$ at every place $v$ of $F$ above $2$. This holds when $D\equiv\pm1\pmod8$, and for every odd $D$ when $F=\Q(\sqrt3)$, since every odd class of $\Q_2^\times/\Q_2^{\times2}$ lies in $\pm\Q_2(\sqrt3)^{\times2}$. Then $w(E_{cD}/F)=w(E_c/F)$, by comparing local root numbers \cite[Theorem~2.3]{CKD}. Both are $-1$ at the real places. For $v\mid2$, $E_{cD}\cong E_c$ over $F_v$, as $E_{-c}=E_c$ and $E_{ct^2}\cong E_c$. At an odd place $v$, $E_c$ has good reduction if $v(c)$ is even, and type $\mathrm{I}_0^*$ with root number $(-1)^{(Nv-1)/2}$ if $v(c)$ is odd; so the two root numbers differ only at the places where $v(D)$ is odd. These lie above the primes $p$ with $v_p(D)$ odd, and above each such $p$ the ratios multiply to $\bigl(\frac{-1}{p}\bigr)^{n_p}$, where $n_p$ is the number of places $v\mid p$ with odd ramification index and odd residue degree; $n_p$ is even because $[F:\Q]=2$. Hence $E_c$ has root number $+1$ over $L$, and by the theorem of T.~and V.~Dokchitser \cite[Corollary~1.6]{DD} its $2^\infty$-Selmer rank over $L$ is even. So if $\rank E_c(L)=1$, then the $2$-primary part of the Tate--Shafarevich group of $E_c$ over $L$ is infinite, and no $2$-descent can prove \ref{I1}: the bound it gives for $\rank E_c(L)$ also bounds the $2^\infty$-Selmer rank, so a bound $1$ together with a point of infinite order would make that rank $1$, which is odd. The second index curve lies over $\Q(\sqrt2)$, where an odd $D$ is $\pm1$ times a square at the prime above $2$ only if $D\equiv\pm1\pmod8$; for $D\equiv\pm3\pmod8$ the parity is not forced. The third and fourth index curves are not of the form $E_c$. Let $E$ be one of them, over $F$, let $D$ be an odd squarefree integer with $D\equiv\pm1\pmod8$ and $\sqrt D\notin F$, and let $L=F(\sqrt D)$; the twist of $E$ by $D$ is $E^{(D)}\colon y^2=x^3-D^2Ax$. The root number of $E$ over $L$ is $w(E/F)\,w(E^{(D)}/F)$ \cite[Lemma~2.10]{CKD}, and we compare local root numbers \cite[Theorem~2.3(i), (ii), (viii)]{CKD}. At the real places both are $-1$. For $v\mid2$, $D^2$ is a fourth power in $F_v$, as $\pm D\in\Q_2^{\times2}$, so $E^{(D)}\cong E$ over $F_v$. At an odd place $v$, with residue field $k$ and uniformiser $\varpi$, the curve $y^2=x^3-A'x$ is isomorphic to the one with $A'\varpi^4$ for $A'$, and by Tate's algorithm it has type $\mathrm I_0$, $\mathrm{III}$, $\mathrm I_0^*$ or $\mathrm{III}^*$, with root number $1$, $\bigl(\frac{-2}k\bigr)$, $\bigl(\frac{-1}k\bigr)$ or $\bigl(\frac{-2}k\bigr)$, as $v(A')$ is congruent to $0$, $1$, $2$ or $3$ modulo $4$. Since $v(D^2A)=v(A)+2v(D)$, the root numbers of $E$ and $E^{(D)}$ at $v$ agree where $v(D)$ is $0$ or $2$, the latter above the odd primes ramified in $F$; where $v(D)=1$ they agree if $v(A)$ is odd and differ by $\bigl(\frac{-1}k\bigr)$ if $v(A)$ is even. Above a prime $p\mid D$ inert in $F$, $k=\FF_{p^2}$ and $\bigl(\frac{-1}k\bigr)=1$; above a prime $p\mid D$ split in $F$ there are two places, each with $k=\FF_p$. Hence the root number of $E$ over $L$ is the product of $\bigl(\frac{-1}p\bigr)$ over the primes $p\mid D$ split in $F$ such that $v(A)$ is odd at exactly one of the two places above $p$. For the third curve the only odd place at which $v(A)$ is odd is $(\pi_7)$, above the split prime $7$, and $\bigl(\frac{-1}7\bigr)=-1$. So the root number of $E$ over $L$ is $-1$ if $7\mid D$, and parity does not obstruct \ref{I1}; it is $+1$ if $7\nmid D$. For the fourth the only such place is $\mathfrak l$, above the split prime $89\equiv1\pmod4$, so the root number is $+1$ for every such $D$. When the root number of $E$ over $L$ is $+1$, the theorem of T.~and V.~Dokchitser on curves with a rational $2$-isogeny \cite[Theorem~1.8]{DD}, applied to $E$ over $L$ and the isogeny with kernel $\{O,(0,0)\}$, makes the $2^\infty$-Selmer rank of $E$ over $L$ even, hence at least $2$, as it is at least $\rank E(L)\ge\rank E(F)=1$ (\cref{prop:third,prop:fourth}). The bound that a $2$-isogeny descent or a $2^n$-descent gives for $\rank E(L)$ also bounds that Selmer rank, so no such descent can prove \ref{I1}. Thus, among odd $D\equiv\pm1\pmod8$ with $\sqrt D\notin F$, that is, $D\ne1$, and $D\ne17$ for the fourth curve, these descents can prove \ref{I1} over $L=F(\sqrt D)$ for the third curve only when $7\mid D$, and for the fourth curve never. \end{remark} \subsection{Real quadratic fields for the third curve}\label{ssec:family3} In this subsection $E$ is the third index curve, over $F=\Q(\sqrt2)$, with the notation of \cref{ssec:second,ssec:quartic,ssec:family2}: $A=\pi_7=1+2\sqrt2$, $\bar A=\bar\pi_7$, $\varepsilon=1+\sqrt2$, $\lambda=\sqrt2$, $\mathfrak p_7=(\pi_7)$, $F_\lambda=\Q_2(\sqrt2)$ and the set of primes $I^-$. Put $\bar{\mathfrak p}_7=(\bar\pi_7)$, so that $F_{\bar{\mathfrak p}_7}=\Q_7$ with $\sqrt2\mapsto-3\equiv4$. For a positive squarefree integer $D$ the quadratic twist of $E$ by $D$ is $E^{(D)}\colon y^2=x^3-D^2Ax$, and $\alpha'$, $\alpha$ are the maps of \cref{ssec:quartic} for $E^{(D)}$, that is, with $D^2A$ for $A$; so $\alpha'(0,0)=\sq{D^2A}=\sq A$ and $\alpha(0,0)=\sq{-A}$. The integers $D$ of \cref{thm:fields}\textup{(c)} are the products $D=7q_1\cdots q_rp_1\cdots p_s$ with $r$ even, $q_1,\dots,q_r$ distinct primes of $I^-$, and $p_1,\dots,p_s$ distinct primes $p\equiv1\pmod8$ such that $A$ is a nonsquare modulo both primes of $F$ above $p$. The condition $D\equiv\pm1\pmod8$ says that $r$ is even, as the primes of $I^-$ are congruent to $3$ or $5$ modulo $8$, so that $D\equiv-q_1\cdots q_r\pmod8$. \needspace{4\baselineskip} \begin{lemma}[Odd places]\label{lem:oddthird} Let $v$ be a prime of $F$ not above $2$, let $b\in F_v^\times$, and let $(X,Y)$ be a point of $y^2=x^3+bx$ over $F_v$ with $X\ne0$. \begin{enumerate}[label=\textup{(\alph*)},ref=\textup{(\alph*)}] \item\label{ot:a} If $v(b)$ is even, then $v(X)$ is even. \item\label{ot:b} If $v(b)=3$, or if $v(b)=2$ and $-b$ is not a square in $F_v$, then $\sq X\in\{1,\sq b\}$. \end{enumerate} \end{lemma} \begin{proof} Let $k=v(X)$. \ref{ot:a} If $k$ were odd, then $2k\ne v(b)$, so $v(X^2+b)=\min(2k,v(b))$ would be even and $v(Y^2)=k+v(X^2+b)$ odd. \ref{ot:b} As $v\nmid2$, $1+z$ is a square in $F_v$ whenever $v(z)\ge1$, by Hensel's lemma. If $2kv(b)$, then $Y^2=Xb(1+X^2/b)$ with $v(X^2/b)\ge1$, so $\sq X=\sq b$. If $2k=v(b)$, then $v(b)=2$ and $k=1$; with $\pi$ a uniformiser, $X=\pi u$ for a unit $u$, and $X^2+b=\pi^2(u^2+b/\pi^2)$, where $u^2+b/\pi^2$ is a unit, because $-b/\pi^2$ is a unit that is not a square, so its residue is not a square. Then $v(Y^2)=v(X)+v(X^2+b)=3$, which is impossible. \end{proof} The image of $\alpha'$ over $F_v$ consists of $1$, the class $\sq{4D^2A}=\sq A$ of $(0,0)$, and the classes $\sq X$ of abscissas $X\ne0$ of points of $y^2=x^3+bx$ with $b=4D^2A$; the image of $\alpha$ likewise, with $b=-D^2A$ and $\sq{-A}$. \begin{lemma}[Local images]\label{lem:localthird} Let $D$ be a positive squarefree integer with $7\mid D$, and consider $\alpha'$ and $\alpha$ over the completions $F_v$ of $F$. \begin{enumerate}[label=\textup{(\alph*)},ref=\textup{(\alph*)}] \item\label{lt:a} At the real place with $\sqrt2\mapsto\sqrt2$, $\Imm\alpha'=\{1\}$; at the real place with $\sqrt2\mapsto-\sqrt2$, $\Imm\alpha=\{1\}$. \item\label{lt:b} At $\bar{\mathfrak p}_7$, $\Imm\alpha'=\{1\}$; at $\mathfrak p_7$, $\Imm\alpha'\subseteq\{1,\sq A\}$. \item\label{lt:c} If $D\equiv\pm1\pmod8$, then at $(\lambda)$, $\Imm\alpha=\{1,\sq5\}$ and $\Imm\alpha'=\langle\sq{-1},\sq5,\sq\varepsilon\rangle$, of order $8$. \item\label{lt:d} Let $p\ne7$ be a prime factor of $D$ that lies in $I^-$, or satisfies $p\equiv1\pmod8$ with $A$ a nonsquare modulo both primes of $F$ above $p$. At each prime $v$ of $F$ above $p$, $\Imm\alpha\subseteq\{1,\sq{-A}\}$ and $\Imm\alpha'\subseteq\{1,\sq A\}$, and $\sq A$ and $\sq{-A}$ are unit classes. \item\label{lt:e} At each prime $v$ of $F$ not dividing $14D$, every class in $\Imm\alpha$ and in $\Imm\alpha'$ has even valuation. \end{enumerate} \end{lemma} \begin{proof} Put $B=D^2A$. \ref{lt:a} At the first real place $A=1+2\sqrt2>0$, so a point of $y^2=x(x^2+4B)$ with $x\ne0$ has $x>0$, and $\sq A=1$. At the second $A=1-2\sqrt2<0$, so $-B>0$, and the same holds for $y^2=x(x^2-B)$ and $\sq{-A}$. \ref{lt:b} At $\bar{\mathfrak p}_7$, $v(B)=2$, as $v(D)=1$ and $v(A)=0$; the unit $A\equiv1+2\cdot4=9=3^2\pmod{\bar{\mathfrak p}_7}$ is a square in $\Q_7$, and $-1$ is not. So $-4B$ is not a square, and \cref{lem:oddthird}\ref{ot:b} with $b=4B$ gives $\Imm\alpha'\subseteq\{1,\sq{4B}\}=\{1,\sq A\}=\{1\}$. At $\mathfrak p_7$, $v(B)=3$, and \cref{lem:oddthird}\ref{ot:b} gives $\Imm\alpha'\subseteq\{1,\sq A\}$. \ref{lt:c} As $D$ is odd and $D\equiv\pm1\pmod8$, one of $\pm D$ is a square $t^2$ with $t\in\Q_2$, and $B=t^4A$. The maps $(x,y)\mapsto(t^2x,t^3y)$ of $y^2=x^3-Ax$ onto $y^2=x^3-Bx$ and of $y^2=x^3+4Ax$ onto $y^2=x^3+4Bx$ commute with the isogenies, multiply abscissas by a square and fix $(0,0)$; so the images for $E^{(D)}$ are those for $E$. By \cref{lem:dyadic2}\ref{d2:b}, $\sq A=\sq{\pi_7}=\sq{-5}\ne1$ in $F_\lambda^\times/F_\lambda^{\times2}$, so $(0,0)$ is the only point of order two in $E(F_\lambda)$. As $\cO_\lambda\cong\Z_2^2$, $\chi(E(F_\lambda))=4$ in the notation of the proof of \cref{lem:oddplace}, so $|E(F_\lambda)/2E(F_\lambda)|=8$; and the exact sequence in the proof of \cref{lem:rankformula}, whose first term has order $2$ here (\cref{ssec:quartic}), gives $|\Imm\alpha|\cdot|\Imm\alpha'|=2\cdot8=16$. The image of $\alpha'$ contains $\alpha'(0,0)=\sq{-5}$; $\alpha'(Q')=\sq{2\varepsilon}=\sq\varepsilon$ for the point $Q'=(2+2\sqrt2,\,8+4\sqrt2)$ of $y^2=x^3+4Ax$ over $F$ (\cref{prop:third}); and $\sq{-4}=\sq{-1}$, since $X=-4$ gives $X^3+4AX=-16(4+A)=16(-5-2\sqrt2)$, and $-5-2\sqrt2$ has residue $(3,2)$ and is a square by \cref{lem:dyadic2}\ref{d2:a}. These three classes are independent by \cref{lem:dyadic2}\ref{d2:b}, so $|\Imm\alpha'|\ge8$ and $|\Imm\alpha|\le2$. As $\Imm\alpha$ contains $\alpha(0,0)=\sq{-A}=\sq5\ne1$, we get $\Imm\alpha=\{1,\sq5\}$ and $\Imm\alpha'=\langle\sq{-1},\sq5,\sq\varepsilon\rangle$. \ref{lt:d} The prime $p$ is odd, unramified in $F$ and different from $7$, so $v(D)=1$, $v(A)=0$, as $\Nm_{F/\Q}(A)=-7$, and $v(B)=2$. In $F_v$, $-1$ is a square and $A$ is not. If $p\in I^-$, then $p$ is inert, and the residue field of $F_v$ is $\FF_{p^2}$, in which every element of $\FF_p$ is a square; a unit $u$ of $F_v$ is a square exactly when $\Nm_{F_v/\Q_p}(u)$ is a square modulo $p$, since its residue $z$ satisfies $z^{(p^2-1)/2}=(z^{p+1})^{(p-1)/2}$, and $z^{p+1}$ is the residue of that norm; and $\Nm_{F_v/\Q_p}(A)=\Nm_{F/\Q}(A)=-7$, with $\bigl(\frac{-7}p\bigr)=\bigl(\frac p7\bigr)=-1$. If $p\equiv1\pmod8$, then $F_v=\Q_p$, $-1$ is a square as $p\equiv1\pmod4$, and $A$ is not, by hypothesis. Hence neither $B$ nor $-4B$ is a square in $F_v$, and \cref{lem:oddthird}\ref{ot:b}, with $b=-B$ and with $b=4B$, gives $\Imm\alpha\subseteq\{1,\sq{-B}\}=\{1,\sq{-A}\}$ and $\Imm\alpha'\subseteq\{1,\sq{4B}\}=\{1,\sq A\}$; these are unit classes, as $v(A)=0$. \ref{lt:e} Here $v(B)=0$, so \cref{lem:oddthird}\ref{ot:a} applies with $b=4B$ and with $b=-B$, and the classes $\sq A$, $\sq{-A}$ of $(0,0)$ are units at $v$. \end{proof} \begin{proposition}\label{prop:family3} Let $D$ be a positive squarefree integer with $7\mid D$ and $D\equiv\pm1\pmod8$, each of whose prime factors $p\ne7$ lies in $I^-$, or satisfies $p\equiv1\pmod8$ with $A$ a nonsquare modulo both primes of $F$ above $p$. Let $K=\Q(\sqrt D)$ and $L=KF=F(\sqrt D)$. Then over $F$, $\Imm\alpha'=\{1,\sq A\}$ and $\Imm\alpha=\{1,\sq{-A}\}$, and $\rank E^{(D)}(F)=0$; $\sqrt2\notin K$, and \ref{I1}, \ref{I2} and \ref{I3} hold for $K$. \end{proposition} \begin{proof} By \cref{lem:localthird}\ref{lt:d},\ref{lt:e}, every class in $\Imm\alpha$ and in $\Imm\alpha'$ has even valuation at every prime of $F$ not dividing $14$. As $\cO_F$ is a principal ideal domain with units $\pm\varepsilon^{\Z}$, both images lie in $V=\langle-1,\varepsilon,\lambda,\pi_7,\bar\pi_7\rangle$. Write $e\in V$ as $e=(-1)^h\varepsilon^i\lambda^l\pi_7^j\bar\pi_7^k$ with exponents in $\{0,1\}$. At the real place with $\sqrt2\mapsto\sqrt2$, $-1$ and $\bar\pi_7$ are negative and $\varepsilon$, $\lambda$, $\pi_7$ are positive; at the other, $\bar\pi_7$ is positive and the other four are negative. At $\bar{\mathfrak p}_7$ the residues of $-1$, $\varepsilon$, $\lambda$, $\pi_7$ are $6$, $5$, $4$, $2$, and at $\mathfrak p_7$ those of $-1$, $\varepsilon$, $\lambda$, $\bar\pi_7$ are $6$, $4$, $3$, $2$; the nonzero squares modulo $7$ are $1$, $2$, $4$. At $(\lambda)$, $\lambda$ has odd valuation, and $\sq{\pi_7}=\sq{\bar\pi_7}=\sq{-5}$ by \cref{lem:dyadic2}\ref{d2:b}, as $\pi_7\bar\pi_7=-7$ is a square in $\Q_2$. For $\alpha'$: by \cref{lem:localthird}\ref{lt:a}, $e$ is positive at the place $\sqrt2\mapsto\sqrt2$, so $h+k=0$; by \cref{lem:localthird}\ref{lt:b}, $e$ is a square at $\bar{\mathfrak p}_7$, so $k=0$ and $h+i=0$, and $e\in\{1,\sq{\pi_7}\}$ at $\mathfrak p_7$, so $e/\pi_7^j$ is a square there and $h+l=0$. Hence $h=i=l=k=0$, and $\Imm\alpha'\subseteq\{1,\sq A\}$. For $\alpha$: by \cref{lem:localthird}\ref{lt:c}, $e$ lies in $\{1,\sq5\}$ at $(\lambda)$, so $l=0$ and $\sq{(-1)^{h+j+k}5^{j+k}\varepsilon^i}\in\{1,\sq5\}$, which gives $i=0$ and $h+j+k=0$, as $\sq{-1}$, $\sq5$, $\sq\varepsilon$ are independent (\cref{lem:dyadic2}\ref{d2:b}); and by \cref{lem:localthird}\ref{lt:a}, $e$ is positive at the place $\sqrt2\mapsto-\sqrt2$, so $h+i+l+j=0$. Hence $h=j$ and $k=0$, and $\Imm\alpha\subseteq\{1,\sq{-A}\}$. Equality holds in both, since $\alpha'(0,0)=\sq A$ and $\alpha(0,0)=\sq{-A}$ are nontrivial, as $\Nm_{F/\Q}(\pm A)=-7$. As $D^2A\notin F^{\times2}$, \cref{ssec:quartic} gives $2^{\rank E^{(D)}(F)}=2\cdot2/4=1$. As $D$ is odd and squarefree, $K$ is a real quadratic field other than $\Q(\sqrt2)$, and $D\notin F^{\times2}$. So \cref{lem:twist} with $M=F$, $B=A$ and $\delta=D$ gives $\rank E(L)=\rank E(F)+\rank E^{(D)}(F)=1$, by \cref{prop:third}. This is \ref{I1}. \Cref{lem:torsion34} gives \ref{I2}, and \cref{lem:I3} gives \ref{I3}, as $L/F$ is Galois. \end{proof} \begin{proposition}\label{prop:seventyseven} Let $D$ be one of the following $77$ integers, each squarefree, divisible by $7$ and congruent to $\pm1$ modulo $8$, and none as in \cref{prop:family3}: $119$, $217$, $287$, $329$, $609$, $623$, $721$, $777$, $959$, $1015$, $1169$, $1295$, $1393$, $1407$, $1785$, $1799$, $2191$, $2247$, $2289$, $2345$, $2639$, $2681$, $3031$, $3143$, $3255$, $3353$, $3367$, $3689$, $3745$, $3759$, $3815$, $3857$, $4151$, $4207$, $4431$, $4529$, $4711$, $4921$, $4935$, $5033$, $5089$, $5327$, $5593$, $5873$, $6097$, $6209$, $6265$, $6503$, $6671$, $6839$, $6881$, $7161$, $7273$, $7343$, $7385$, $7511$, $7665$, $7903$, $8057$, $8169$, $8351$, $8463$, $8617$, $8687$, $8897$, $8911$, $8953$, $9247$, $9303$, $9737$, $9919$, $10031$, $10185$, $10199$, $10311$, $10423$, $10479$. Let $K=\Q(\sqrt D)$ and $L=KF$. Then $\rank E^{(D)}(F)=0$; $\sqrt2\notin K$, and \ref{I1}, \ref{I2} and \ref{I3} hold for $K$. \end{proposition} \begin{proof} For each $D$, a $2$-isogeny descent over $F$ as in \cref{ssec:quartic}, with $D^2A$ for $A$: we find that the Selmer groups are $\{1,\sq A\}$ and $\{1,\sq{-A}\}$, the images of $(0,0)$; so $\rank E^{(D)}(F)=0$. The last paragraph of the proof of \cref{prop:family3} then applies as written, since it uses only that $D$ is odd, squarefree and divisible by $7$. \end{proof} \subsection{Biquadratic fields}\label{ssec:biquad} In this subsection $E$ is the fourth index curve, $F=\Q(\sqrt{17})$ and $L=\Q(\sqrt2,\sqrt3,\sqrt{17})$. \begin{proposition}\label{prop:biquad} The quadratic twists $E^{(D)}\colon y^2=x^3-D^2Ax$, $D=2,3,6$, have rank $0$ over $F$. Each of $K=\Q(\sqrt2,\sqrt3)$, $\Q(\sqrt2,\sqrt{51})$, $\Q(\sqrt3,\sqrt{34})$ and $\Q(\sqrt6,\sqrt{34})$ has $\sqrt{17}\notin K$ and $KF=L$, and \ref{I1}, \ref{I2} and \ref{I3} hold for it. \end{proposition} \begin{proof} For each $D$, a $2$-isogeny descent over $F$ as in \cref{ssec:quartic}, with $D^2A$ for $A$: we find that the Selmer groups are $\{1,\sq A\}$ and $\{1,\sq{-A}\}$, the images of $(0,0)$; so $\rank E^{(D)}(F)=0$. \Cref{lem:twist}, applied to $L/F(\sqrt2)$ with $\delta=3$ and then to $F(\sqrt2)/F$ with $\delta=2$, for $E$ and for $E^{(3)}$, whose twist by $2$ is $E^{(6)}$, gives $\rank E(L)=\rank E(F)+\sum_D\rank E^{(D)}(F)=1$, by \cref{prop:fourth}. This is \ref{I1}. \Cref{lem:torsion34} gives \ref{I2}, and \cref{lem:I3} gives \ref{I3}, as $L/F$ is Galois. These conditions concern $E(L)$ and $E(F)$ only, so they hold for each of the four fields. Each $K$ is generated by square roots of two integers whose classes, with $17$, span the classes of $2$, $3$ and $17$ in $\Q^\times/\Q^{\times2}$, so $KF=L$; and $17$ is not in the span of the two, so $\sqrt{17}\notin K$ by Kummer theory. \end{proof} \subsection{Fields with the same \texorpdfstring{$L$}{L}}\label{ssec:thirtytwo} In this subsection $E$ is the first index curve and $F=\Q(\sqrt3)$, except in \cref{lem:sameL}, which concerns any index curve, and in \cref{prop:twins}\ref{tw:b} and~\ref{tw:c}, which concern the second and the third. Let $\zeta$ be a primitive $32$nd root of unity. By the proof of \cref{lem:fivefields}, $\vartheta=\zeta+\zeta^{-1}$ is a root of $g_{32}$, with $K_{32}=\Q(\vartheta)$, and $\theta=\vartheta^2-2=\zeta^2+\zeta^{-2}$ is a root of $g=g_{16}$, with $K_{16}=\Q(\theta)$. As in \cref{lem:fivefields}\ref{ff:iii}, $\sqrt2=\theta^2-2$, $\alpha=2+\theta=\vartheta^2$, $L_{16}=L_1(\theta)$ and $L_{32}=L_{16}(\vartheta)$. We take these roots in \cref{prop:five}, which is allowed, since \cref{prop:five} and its proof hold for every root of $g_{16}$ and of $g_{32}$. \needspace{4\baselineskip} \begin{lemma}\label{lem:sameL} Let $E$ be an index curve, over $F=\Q(\sqrt d)$, and let $K$ and $K'$ be totally real number fields with $\sqrt d\notin K$, $\sqrt d\notin K'$ and $K'F=KF$. Then \ref{I1}, \ref{I2} and \ref{I3} hold for $K'$ if and only if they hold for $K$. In particular, if they hold for $K$, then \cref{thm:main} applies to $K'$. \end{lemma} \begin{proof} With $L=KF=K'F$, each of the three conditions is a statement about the groups $E(L)$ and $E(F)$ only, so it is the same statement for $K$ and for $K'$. The hypotheses of \cref{thm:main} on $K'$ are that it is totally real, that $\sqrt d\notin K'$, and \ref{I1}--\ref{I3}. \end{proof} If $K/\Q$ is Galois with cyclic Galois group, and $K'$ is as in \cref{lem:sameL}, then $K'$ is a subfield of the abelian field $L=KF$ with $[L:K']=2$ and $F\not\subseteq K'$, so it is the fixed field of a subgroup of order $2$ of $\Gal(L/\Q)=\Gal(K/\Q)\times\Gal(F/\Q)$ not contained in $\Gal(K/\Q)\times1$. These subgroups are generated by $(1,\rho)$, which gives $K$, and, when $[K:\Q]$ is even, by $(\gamma_0,\rho)$, where $\rho$ generates $\Gal(F/\Q)$ and $\gamma_0$ is the element of order two of $\Gal(K/\Q)$. For the fields of \cref{thm:fields} this pairs $\Q(\sqrt{2m})$ with $\Q(\sqrt{6m})$ and leaves the cyclic cubic fields and $\Q(\zeta_{11})^+$ alone; it pairs $K_{16}$ and $K_{32}$ with the fields $K'_{16}$ and $K'_{32}$ below, and $\Q(\sqrt D)$ with $\Q(\sqrt{2D})$, and $\Q(\sqrt3)$ with $\Q(\sqrt6)$, a field of \textup{(a)}, for the second curve; and $\Q(\sqrt D)$ with $\Q(\sqrt{2D})$ for the third, where $D=7$ gives $\Q(\sqrt7)$ and $\Q(\sqrt{14})$, the second also a field of \textup{(a)}, with $m=7$. \begin{proposition}\label{prop:twins} \begin{enumerate}[label=\textup{(\alph*)},ref=\textup{(\alph*)}] \item\label{tw:a} Let $v=\sqrt3\,\theta\in L_{16}$ and $w=\sqrt3\,\vartheta\in L_{32}$, so that $v^2=3(2+\sqrt2)$ and $w^2=3(2+\theta)$, and let $K'_{16}=\Q(v)$ and $K'_{32}=\Q(w)$. Then $v$ and $w$ are roots of \[ h_{16}=t^4-12t^2+18,\qquad h_{32}=t^8-24t^6+180t^4-432t^2+162. \] The fields $K'_{16}$ and $K'_{32}$ are totally real and Galois over $\Q$, with cyclic Galois groups of orders $4$ and $8$; their only quadratic subfield is $\Q(\sqrt2)$, so $\sqrt3$ lies in neither; and $K'_{16}F=L_{16}$, $K'_{32}F=L_{32}$. For the first index curve, conditions \ref{I1}, \ref{I2} and \ref{I3} hold for $K'_{16}$ and for $K'_{32}$. The prime $q=7$ splits completely in $K'_{16}$ and the prime $q=79$ in $K'_{32}$; both are congruent to $7$ modulo $12$, and $\mathfrak q=(7,v-1)$, respectively $\mathfrak q=(79,w-9)$, is a prime above $q$ of residue degree one. \item\label{tw:b} For the second index curve, let $D$ be as in \cref{thm:fields}\textup{(b)} and $K'=\Q(\sqrt{2D})$. Then $\sqrt2\notin K'$, $\sqrt3\notin K'$, and \ref{I1}, \ref{I2} and \ref{I3} hold for $K'$. \item\label{tw:c} For the third index curve, let $D$ be as in \cref{thm:fields}\textup{(c)} or one of the $77$ integers of \cref{prop:seventyseven}, and $K'=\Q(\sqrt{2D})$. Then $\sqrt2\notin K'$, and \ref{I1}, \ref{I2} and \ref{I3} hold for $K'$. \end{enumerate} \end{proposition} \begin{proof} \ref{tw:a} Since $v^2=3\theta^2=3(2+\sqrt2)$, we have $(v^2-6)^2=18$, that is $h_{16}(v)=0$. Since $w^2/3-2=\vartheta^2-2=\theta$ and $h_{32}(t)=81\,g(t^2/3-2)$, we have $h_{32}(w)=81\,g(\theta)=0$. Both polynomials are Eisenstein at $2$, so $[K'_{16}:\Q]=4$ and $[K'_{32}:\Q]=8$. The fields contain $\sqrt2=v^2/3-2$, respectively $\sqrt2=(w^2/3-2)^2-2$. As subfields of the totally real abelian fields $L_{16}$ and $L_{32}$, they are totally real and Galois over $\Q$. The field $K'_{16}(\sqrt3)$ contains $\theta=v/\sqrt3$, so $K'_{16}F\supseteq\Q(\theta,\sqrt3)=L_{16}$, with equality by degrees; then $[L_{16}:K'_{16}]=2$, and $\sqrt3\notin K'_{16}$. Likewise $K'_{32}F$ contains $\vartheta=w/\sqrt3$, so $K'_{32}F=L_{32}$ and $\sqrt3\notin K'_{32}$. Write $\Gal(L_{32}/\Q)=\langle\gamma\rangle\times\langle\rho\rangle$, where $\gamma$ fixes $\sqrt3$ and has order $8$, and $\rho$ fixes $K_{32}$ and maps $\sqrt3$ to $-\sqrt3$ (proof of \cref{lem:fivefields}). The restriction of $\gamma^4$ to $K_{32}$ is the element of order two of $\Gal(K_{32}/\Q)$, which fixes the subfield $K_{16}$ of degree $4$ and not $\vartheta$; as $\vartheta^2=\alpha\in K_{16}$, $\gamma^4(\vartheta)=-\vartheta$. Hence $\gamma^4\rho$ fixes $w$, $K'_{32}$ is the fixed field of $\langle\gamma^4\rho\rangle$, and $\Gal(K'_{32}/\Q)$ is generated by the image of $\gamma$, of order $8$ because no $\gamma^k$ with $00$ at both real places. For \ref{tc:iii} and \ref{tc:iv} let $v=\mathfrak a$ or $v=(\lambda)$. By \cref{lem:towerfields}\ref{tf:b} the decomposition group of $v$ is all of $G$, so $L_v/F_v$ is cyclic with group $G$, and the objects $I$, $\cO$, $\varpi$, $u$ of the local twist $A_v$ of \cite[\S\S6--7]{MazurRubinDS} for $L_v/F_v$ are those above. Let $\Omega$ be an algebraic closure of $F_v$. By \cite[Proposition~6.3(ii)]{MazurRubinDS}, with $\Omega$ as the Galois extension (as in the proof of \cite[Proposition~6.3(iii)]{MazurRubinDS}), $A_v(\Omega)\cong I\otimes E(\Omega)$, where $\cO$ acts on $I$ and $\sigma\in\Gal(\Omega/F_v)$ acts as $\bar\sigma^{-1}\otimes\sigma$, $\bar\sigma$ being the image of $\sigma$ in $G$. Let $T\in E[2]$; then $\bar u\otimes T\in A_v[\varpi](F_v)$. Put $\tilde u=(2/\varpi^2)(1-\tau)\in I$ (here $N\ge4$ is used), so $\varpi\tilde u=u$, and $S=\tilde u\otimes T$, so $\varpi S=\bar u\otimes T$. If $\bar\sigma=\gamma^j$, then $\bar\gamma^{-j}-1\equiv j\varpi\pmod{\varpi^2}$ in $\cO$, so $\sigma S-S=(\gamma^{-j}-1)\tilde u\otimes T=j\,\bar u\otimes T$, as $\varpi^2\tilde u=2(1-\tau)\in2I$. Hence the Kummer class of $\bar u\otimes T$ is $\sigma\mapsto\chi(\sigma)T$, that is, $(\sq2^{t_1},\sq2^{t_2})$ with $(t_1,t_2)$ the exponents of $\iota(T)$. So $\mathcal H_v$ contains $\langle\sq2\rangle^2$. \ref{tc:iii} At $\mathfrak a$ the residue characteristic is $13$, so $\dim\mathcal H_{\mathfrak a}=\dim E(F_{\mathfrak a})[2]=2$ by \cite[Lemma~7.2(i)]{MazurRubinDS}. Since $2$ is not a square modulo $13$, $\langle\sq2\rangle^2$ has dimension $2$, so it is $\mathcal H_{\mathfrak a}$; and $\sq2$ is the nontrivial class of units of $F_{\mathfrak a}=\Q_{13}$. \ref{tc:iv} Here $L_v=L_{\mathfrak w}$. As $\Gal(\Omega/L_{\mathfrak w})$ acts trivially on $I$, which is free over $\Z$, $A_v(L_{\mathfrak w})=I\otimes E(L_{\mathfrak w})$ and $A_v(F_\lambda)=(I\otimes E(L_{\mathfrak w}))^G$, with $\gamma$ acting as $\gamma^{-1}\otimes\gamma$. Write an element of $I\otimes E(L_{\mathfrak w})$ as $\sum_{j0$.} Put $\nu=x/b$, so $v(\nu)\ge1$ and $\alpha y^2=-b^2x(1-\nu)(1+\nu)$. Then $x=-\alpha s^2u$ with $s=y/(b(1+\nu))$ and $u=(1+\nu)/(1-\nu)\in U_{e+1}\subseteq U_6$; so $\Nm(x)\in2F_\lambda^{\times2}$. \emph{Case $v(x)=0$.} As the residue field is $\FF_2$, $x/b=1+\delta$ with $h=v(\delta)\ge1$, and $\alpha y^2=b^3(1+\delta)\,\delta\,(\delta+2)$. If $he$, then $x=b(1+\delta)$ with $1+\delta\in U_{e+1}\subseteq U_6$, and $\Nm(x)\in F_\lambda^{\times2}$. If $h=e$, then $\delta=2r$ with $r\equiv1$ modulo $\mathfrak m_{k-1}$, so $v(\delta+2)\ge e+1$, and $x=-b\bigl(1-(\delta+2)\bigr)$ with $1-(\delta+2)\in U_6$; so $\Nm(x)\in F_\lambda^{\times2}$. \end{proof} \begin{remark}\label{rem:towerk4} The proof needs $k\ge5$, that is $e\ge8$, only in the cases $h=1$ and $h=e-1$, where the unit lies only in $U_{e-1}$ and \cref{lem:towernorms} needs $U_6$. For $k=4$ ($e=4$) the other cases still go through: as $v(\alpha)=2$, the equation forces the valuations of $x$, of $\delta$ when $h>e$, and of $\delta+2$ when $h=e$, to be even, which puts the units of the proof in $U_{e+2}=U_6$; and $h=2$ is excluded as above. The cases $v(x)=0$, $h\in\{1,3\}$ are left open, and the case $k=4$ of \cref{thm:tower} is \cref{prop:five}. \Cref{prop:towerlocal} is a statement at the prime above $2$ for every unit $b$ of $F_\lambda$; what is special to $E$ is global, the local conditions of \cref{lem:towerconditions} away from $2$ and the space $\langle-1,\varepsilon,\lambda\rangle$ in the proof of \cref{prop:towerselmer}. \end{remark} \begin{proof}[Proof of \cref{thm:tower}] \emph{Condition \ref{I2}.} For $k=2$ this is \cref{prop:sun14}, and for $k\ge3$ \cref{lem:towerfields}\ref{tf:c}. \emph{Condition \ref{I1}.} For $k=2,3,4$ this is \cref{prop:sun14,prop:sunL1,prop:five}. Let $k\ge5$, $L=L_{2^k}$ and $L'=L_{2^{k-1}}$, and let $R\in E(L_{\mathfrak w})\setminus E[2]$ with $\tau R=-R$. By \cref{lem:towerfields}\ref{tf:a} and \cref{lem:towerlocal}\ref{tl:a}, $L_{\mathfrak w}=\Lambda_k=\Lambda_{k-1}(\eta_k)$ and $L'_{\mathfrak w}=\Lambda_{k-1}$, with $\tau(\eta_k)=-\eta_k$ and $\eta_k^2=\alpha_{k-1}$. Write $R=(x,z)$; then $\tau x=x$ and $\tau z=-z$, so $x\in\Lambda_{k-1}$ and $z=y\eta_k$ with $y\in\Lambda_{k-1}$, $y\ne0$, and $\alpha_{k-1}y^2=x(x-a)(x+a)$. By \cref{prop:towerlocal} with $b=a$, $\Nm_{L'_{\mathfrak w}/F_\lambda}(x)\in F_\lambda^{\times2}\cup2F_\lambda^{\times2}$. So \cref{prop:towerselmer} gives $\rank E(L_{2^k})=\rank E(L_{2^{k-1}})$, and by induction $\rank E(L_{2^k})=1$. \emph{Condition \ref{I3}.} $K_{2^k}/\Q$ is Galois, so \cref{lem:I3} applies. \emph{The fields.} $K_{2^k}$ is totally real, and $\sqrt3\notin K_{2^k}$ (\cref{lem:towerfields}\ref{tf:a}; $K_4=\Q$), so \cref{thm:main} applies. Let $k\ge3$. Write $\Gal(L_{2^k}/\Q)=\langle\gamma\rangle\times\langle\rho\rangle$, where $\gamma$ fixes $\sqrt3$ and restricts to a generator of $\Gal(K_{2^k}/\Q)$, and $\rho$ fixes $K_{2^k}$ and maps $\sqrt3$ to $-\sqrt3$; and let $\tau=\gamma^{2^{k-3}}$, the element of order two of $\langle\gamma\rangle$. By \cref{lem:towerfields}\ref{tf:a}, $\tau\rho$ fixes $\sqrt3\,\eta_k$. The fixed field of $\tau\rho$ is totally real as a subfield of $L_{2^k}$, of degree $2^{k-2}$. It contains $\Q(\sqrt3\,\eta_k)$, and $\Q(\sqrt3\,\eta_k)F$ contains $\eta_k$, hence $L_{2^k}$; so the fixed field of $\tau\rho$ is $\Q(\sqrt3\,\eta_k)=K'_{2^k}$, the field of \cref{thm:tower}, and $K'_{2^k}F=L_{2^k}$. As $\tau\rho(\sqrt3)=-\sqrt3$, $\sqrt3\notin K'_{2^k}$. No power $\gamma^m\ne1$ lies in $\langle\tau\rho\rangle$, so the image of $\gamma$ generates $\Gal(K'_{2^k}/\Q)$, which is cyclic. By \cref{lem:sameL}, \ref{I1}--\ref{I3} hold for $K'_{2^k}$, and \cref{thm:main} applies. For $k=3$, $\sqrt3\,\eta_3=\pm\sqrt6$; for $k=4,5$, with $\zeta=\zeta_{32}$ in \cref{ssec:thirtytwo}, $\eta_4=\theta$ and $\eta_5=\vartheta$, so $\sqrt3\,\eta_4$ and $\sqrt3\,\eta_5$ are the elements $v$ and $w$ of \cref{prop:twins}. \end{proof} \appendix \section{Proof of \texorpdfstring{\cref{prop:cochain}}{Proposition 3.5}}\label{app:cochain} We keep the notation of \cref{ssec:cochain}. For $v\in S_2$ let $(-1)_v\in\hat U_2$ be $-1$ at $v$ and $1$ at the other dyadic primes. \begin{lemma}\label{lem:locsq} Let $F_v$ be a finite extension of $\Q_p$ or $F_v=\R$, and $\lambda$ a character of $F_v^\times$. Then $\lambda$ is the square of a character if and only if $\lambda(-1)=1$. Consequently the image of $\lambda$ under the boundary map $H^1(G_{F_v},\mu_\infty)\to H^2(G_{F_v},\mu_2)=\operatorname{Br}(F_v)[2]$ of $1\to\mu_2\to\mu_\infty\xrightarrow{2}\mu_\infty\to1$ has invariant $\frac12$ if and only if $\lambda(-1)=-1$. \end{lemma} \begin{proof} If $\lambda=\psi^2$ then $\lambda(-1)=\psi(1)=1$. Conversely, for $F_v$ non-archimedean write $F_v^\times=\varpi^{\Z}\times\mu(F_v)\times V$ with $V\cong\Z_p^{[F_v:\Q_p]}$; take any square root of $\lambda(\varpi)$; on $V$ the group of finite-order characters is divisible; on the cyclic group $\mu(F_v)$ of even order the squares of characters are the characters trivial on its element of order $2$, which is $-1$. For $F_v=\R$, a finite-order character is trivial or the sign, and the sign is not a square. The image of $\lambda$ vanishes exactly when $\lambda$ is a square, and $\operatorname{Br}(F_v)[2]$ has order $2$. \end{proof} \needspace{4\baselineskip} \begin{lemma}\label{lem:globsq} Let $\varsigma$ be a normalised $2$-cocycle on $G_K$ with values in $\{\pm1\}$, $s_v=(-1)^{2\operatorname{inv}_v[\varsigma]}$, and $\lambda$ a character of $G_K$ of order $m$ with $\lambda_v(-1)=s_v$ at every place $v$. Then there is a continuous $\vartheta\colon G_K\to\mu_{2m}$ with $\vartheta^2=\lambda$, $\delta\vartheta=\varsigma$ and $\vartheta(1)=1$. \end{lemma} \begin{proof} By \cref{lem:locsq} the boundary of $\lambda$ and $[\varsigma]$ have the same local invariants, so they are equal, $\operatorname{Br}(K)\to\bigoplus_v\operatorname{Br}(K_v)$ being injective \cite[(8.1.17)]{NSW}. Choose $b$ with $b^2=\lambda$, constant on the cosets of $\ker\lambda$, with $b(1)=1$; then $\delta b$ takes values in $\mu_2$ and represents the boundary of $\lambda$, so $\delta b=\varsigma\cdot\delta c$ for a continuous $c\colon G_K\to\mu_2$, and $\vartheta=bc^{-1}$ works; $\vartheta(1)=\delta\vartheta(1,1)=\varsigma(1,1)=1$. \end{proof} \needspace{4\baselineskip} \begin{lemma}\label{lem:factor} Let $\varsigma$ be normalised and inflated from $\Gal(K_0/K)$, and $\delta\vartheta=\varsigma$. For $g\in G_K$ and $h\in G_{K_0}$, $\vartheta(gh)=\vartheta(g)\vartheta(h)=\vartheta(hg)$. Hence $\vartheta|_{G_{K_0}}$ is a homomorphism invariant under conjugation by $G_K$, and the fixed field of its kernel is Galois over $K$. \end{lemma} \begin{proof} $\varsigma(g,h)=\varsigma(\bar g,1)=1$ and $\varsigma(h,g)=\varsigma(1,\bar g)=1$ in $\Gal(K_0/K)$, which gives the two equalities; then $\vartheta(ghg^{-1})=\vartheta(h)$ from $gh=(ghg^{-1})g$. \end{proof} \needspace{4\baselineskip} \begin{lemma}\label{lem:inertia} In \cref{lem:factor}, let $v\notin T_0$ be a finite prime at which $\lambda=\vartheta^2$ is unramified, and $I_v\subset D_v$ inertia and decomposition groups at $v$. Then $I_v\subset G_{K_0}$, $\vartheta|_{I_v}$ is a homomorphism of order at most $2$, and it is the restriction of a character of $D_v$; if $v$ is odd and $\vartheta|_{I_v}\ne1$, this character corresponds on $\cO_v^\times$ to the Legendre symbol. \end{lemma} \begin{proof} $K_0$ is unramified at $v$. The restriction of $\varsigma$ to $D_v$ is inflated from $D_v/I_v\cong\hat\Z$, and $H^2(\hat\Z,\mu_2)=0$, so $\varsigma|_{D_v}=\delta c_v$ with $c_v$ inflated from $D_v/I_v$ and normalised; $\vartheta c_v^{-1}$ is a character of $D_v$ that agrees with $\vartheta$ on $I_v$. On $\cO_v^\times$ ($v$ odd) the only nontrivial quadratic character is the Legendre symbol, since $U_v^{(1)}$ is pro-$p$ with $p$ odd. \end{proof} \needspace{4\baselineskip} \begin{lemma}\label{lem:interp} Let $H\subseteq\hat U_2$ be a closed subgroup such that the torsion subgroup of $\hat U_2/H$ has exponent dividing $2^t$. Every character of $H$ with values in $\mu_{2^r}$ extends to a character $\theta$ of $\hat U_2$ with values in $\mu_{2^{r+t}}$, and $\theta$ is trivial on $U_v^{(e_v(r+t+1)+1)}$ for every $v\in S_2$. \end{lemma} \begin{proof} Let $\theta'$ be any extension (Pontryagin duality). Then $\theta'^{2^r}$ is a character of $\hat U_2/H\cong\Z_2^{\rho}\times F$ with $F$ finite of exponent dividing $2^t$; write $\theta'^{2^r}=\lambda_1\lambda_2$ with $\lambda_1$ trivial on $F$ and $\lambda_2$ trivial on $\Z_2^\rho$, and $\lambda_1=\mu^{2^r}$ (the characters of $\Z_2^\rho$ form a divisible group). Then $\theta=\theta'\mu^{-1}$ extends the given character and $\theta^{2^{r+t}}=\lambda_2^{2^t}=1$. For $i>e_v$, squaring maps $U_v^{(i)}$ onto $U_v^{(i+e_v)}$ (if $v(x)=i>e_v$ then $(1+x)^2=1+2x(1+x/2)$, and successive approximation), so the $2^{r+t}$-th powers of $U_v^{(e_v+1)}$ are $U_v^{(e_v(r+t+1)+1)}$, on which $\theta$ is trivial. \end{proof} \begin{lemma}\label{lem:fourth} Let $k$ be a field of characteristic $0$ with $i\notin k$, $k_\infty=k(\mu_{2^\infty})$, and $u\in k^\times$. If $u\in k_\infty^{\times4}$ then $u\in\pm k^{\times2}$. \end{lemma} \begin{proof} $\Gal(k_\infty/k)$ is abelian; let $\omega$ be its action on $\mu_4$ and $c$ an element with $\omega(c)=-1$. Write $u=y^4$ and $\sigma(y)=\zeta(\sigma)y$ with $\zeta(\sigma)\in\mu_4$, so $\zeta(\sigma\tau)=\zeta(\sigma)\sigma(\zeta(\tau))$. From $\sigma c=c\sigma$, $\zeta(\sigma)\sigma(\zeta(c))=\zeta(c)c(\zeta(\sigma))=\zeta(c)\zeta(\sigma)^{-1}$, so $\zeta(\sigma)^2=\zeta(c)^{1-\omega(\sigma)}$. Put $s=y^2$; then $\sigma(s)=\zeta(\sigma)^2s$, so $s$ is fixed by every $\sigma$ with $\omega(\sigma)=1$, that is $s\in k(i)$, and $c(s)=\pm s$. If $c(s)=s$ then $s\in k$ and $u=s^2$; otherwise $s=it$ with $t\in k$ and $u=-t^2$. \end{proof} \begin{proof}[Proof of \cref{prop:cochain}] Write $d_2=d_2(K)$ and $s_v=(-1)^{2\operatorname{inv}_v[\varsigma]}$ for every place $v$; $s_v=1$ at finite $v\notin T_-\cup S_2$ by hypothesis and by the definition of $T_-$, and $\prod_vs_v=1$ \cite[(8.1.17)]{NSW}. \emph{Data depending only on $K$ and $Z$.} Let $\Lambda=\{x\in\hat E:\iota(x)\in\langle(-1)_v:v\in S_2\rangle\}$ and, for $x\in\Lambda$, write $\iota(x)=\prod_v(-1)_v^{a_v(x)}$. Since $\Lambda$ contains $\ker\iota$ with finite index and $\hat E$ has torsion $\{\pm1\}\subset\Lambda$, $\Lambda/\{\pm1\}$ is a free $\Z_2$-module of rank $d_2$. Choose a basis $e_1,\dots,e_{n_K-1}$ of $\hat E/\{\pm1\}$ and integers $0\le c_1\le\dots\le c_{d_2}$ with $\Lambda/\{\pm1\}=\bigoplus_{i\le d_2}2^{c_i}\Z_2e_i$, lifts $z_i\in\hat E$ of $e_i$, and put $\lambda_i=z_i^{2^{c_i}}\in\Lambda$, so that $\Lambda=\{\pm1\}\times\langle\lambda_1,\dots,\lambda_{d_2}\rangle$; let $c=c_{d_2}$ ($c=0$ if $d_2=0$). Let $H=\iota(\hat E)\cdot\langle(-1)_v\rangle$ and let $2^t$ be the exponent of the torsion of $\hat U_2/H$. Fix $M_Z\ge0$ with $2^{M_Z}>N\mathfrak Q$ for every $\mathfrak Q\in Z$. \emph{Step 1 (local data).} For $v\in T_-$ let $\chi_v$ be the character of $K_v^\times$ that is trivial on a fixed uniformiser and on $U_v^{(1)}$ and has exact order $2^{v_2(Nv-1)}$ on $\cO_v^\times$; then $\chi_v(-1)=-1=s_v$. At a real place $v$ let $\chi_v$ be the sign if $s_v=-1$ and trivial otherwise. Let $\Phi_0\colon\hat E\to\mu_{2^\nu}$ extend $u\mapsto\prod_{v\in T_-\cup S_\infty}\chi_v(u)$, and let $\sigma_0\colon\Lambda\to\{\pm1\}$, $\sigma_0(x)=\prod_{v\in S_2}s_v^{a_v(x)}$. Then $\Phi_0(-1)=\prod_{v\in T_-\cup S_\infty}s_v=\prod_{v\in S_2}s_v=\sigma_0(-1)$. Put $\omega_i=\sigma_0(\lambda_i)\Phi_0(\lambda_i)^{-1}\in\mu_{2^\nu}$. \emph{Step 2 (auxiliary primes; only if $d_2>0$).} Put $M=\nu+c+d_2+2+M_Z+\lceil\log_2n_K\rceil$ and $k=K(\mu_{2^M})$. Choose units $u_i\in\cO_K^\times$ with $u_i\equiv z_i$ in $\hat E/\hat E^4$ and let $\Gamma=\langle-1,u_1,\dots,u_{d_2}\rangle$. The $u_i$ are independent in $\cO_K^\times/\pm\cO_K^{\times2}$, so $\Gamma\cap\pm\cO_K^{\times2}=\pm\Gamma^2$. Let $W\subseteq\Gamma/\pm\Gamma^2$ be the classes of elements that are squares in $k$, and change the basis of $\Gamma/\{\pm1\}$ by a matrix in $\mathrm{GL}_{d_2}(\Z)$ to $u'_1,\dots,u'_a,w_1,\dots,w_b$ with the $w_l$ spanning $W$. Then $\Gamma\cap k^{\times4}=\langle-1,w_1^2,\dots,w_b^2,\Gamma^4\rangle$: the inclusion $\supseteq$ holds as $-1=\zeta_{16}^8$; conversely, if $x\in\Gamma\cap k^{\times4}$, \cref{lem:fourth} (with $i\notin K$) gives $x\in\pm K^{\times2}\cap\Gamma=\pm\Gamma^2$, $x=\pm g^2$, and $g^2\in k^{\times4}$ forces $g\in\pm k^{\times2}$, so the class of $g$ lies in $W$. By Kummer theory over $k$, $\Gal(k(\Gamma^{1/4})/k)\cong\operatorname{Hom}\bigl(\Gamma/(\Gamma\cap k^{\times4}),\mu_4\bigr)$ with $\Gamma/(\Gamma\cap k^{\times4})\cong(\Z/4)^a\times(\Z/2)^b$ on the basis $u',w$. Let $h_j$ ($j\le d_2$) be the Kummer character with $h_j(u'_i)=\zeta_4^{[i=j]}$ and $h_j(w_l)=1$ for $j\le a$, and $h_j(u'_i)=1$, $h_j(w_l)=(-1)^{[l=j-a]}$ for $j>a$; let $\sigma_j\in\Gal(k(\Gamma^{1/4})/K)$ be trivial on $k$ with Kummer character $h_j$. Its conjugacy class consists of elements trivial on $k$ with Kummer character $h_j^{\pm1}$, and it meets the abelian subgroup $\Gal(k(\Gamma^{1/4})/K(i))$. The conductor of $k(\Gamma^{1/4})/K(i)$ divides $2^M\prod_{\mathfrak P\mid2}\mathfrak P^{3e(\mathfrak P)+1}$ (a character of order dividing $4$ of a dyadic field with ramification index $e$ is trivial on $U^{(3e+1)}=(U^{(e+1)})^4$), so every character of that group has conductor of norm at most $2^{2n_K(M+4)}$. Thorner and Zaman's bound for the least prime in a Chebotarev class \cite[Theorem~1.1]{ThornerZaman} gives a prime $\mathfrak Q_j$ of $K$, unramified in $k(\Gamma^{1/4})$, with Frobenius class that of $\sigma_j$, and with \[ N\mathfrak Q_j\ll D_{K(i)}^{694}\,2^{2n_K(M+4)\cdot521}+D_{K(i)}^{232}\,2^{2n_K(M+4)\cdot367}(2n_K)^{580n_K}\le C\cdot2^{1042n_K\nu}. \] The $\mathfrak Q_j$ are pairwise distinct; they are odd, because $2^{M-1}>n_K\ge e_v$ for $v\in S_2$, so every dyadic prime ramifies in $k$ (its completions contain $\Q_2(\mu_{2^M})$, of ramification index $2^{M-1}$); $N\mathfrak Q_j\equiv1\pmod{2^M}$, so $N\mathfrak Q_j>2^{M_Z}$ and $\mathfrak Q_j\notin Z$; and the quartic residue symbol $(x/\mathfrak Q_j)_4$ equals $h_j^{\pm1}(x)$ for $x\in\Gamma$. Put $Q=\{\mathfrak Q_1,\dots,\mathfrak Q_{d_2}\}$. \emph{Step 3 (solving on $\Lambda$).} Let $g_j$ generate the $2$-Sylow subgroup of $(\cO_K/\mathfrak Q_j)^\times$, cyclic of order $2^{k_j}$ with $k_j\ge M$, and let $\log_j\colon\hat E\to\Z/2^{k_j}$ be the induced map. Then $\log_j(x)\bmod4$ is determined by $(x/\mathfrak Q_j)_4$, so the matrix $(\log_j(y))$, $y$ running through $u',w$, is congruent modulo $4$ to $D_0U$ with $D_0=\operatorname{diag}(1^a,2^b)$ and $U$ diagonal with odd entries. The matrix $R=(\log_j(z_i))_{i,j}$, lifted to $\Z_2$, satisfies $R\equiv PD_0U\pmod 4$ for some $P\in\mathrm{GL}_{d_2}(\Z)$ (as $z_i\equiv u_i$ modulo fourth powers and $\log_j(-1)\equiv0\pmod 4$), so $R=P(D_0U+4X)$ and $v_2(\det R)=b$. Let $\zeta$ be a primitive $2^{M-1}$-th root of unity and write $\omega_i=\zeta^{y_i}$ with $y_i\in2^{M-1-\nu}\Z$. Then $y'_i=y_i/2^{c_i}\in2^{M-1-\nu-c}\Z\subseteq2^b\Z$, since $M-1-\nu-c>d_2\ge b$, so $x=R^{-1}y'\in\Z_2^{d_2}$ and $\sum_j2^{c_i}R_{ij}x_j=y_i$. Let $\xi_j$ be the character of $(\cO_K/\mathfrak Q_j)^\times$ that is trivial on the odd part and maps $g_j$ to $\zeta^{x_j}$; then $\xi_j(-1)=1$ and $\prod_j\xi_j(\lambda_i)=\omega_i$. So $\Psi=\Phi_0\prod_j\xi_j$ (on $\hat E$, through reduction modulo $\mathfrak Q_j$) satisfies $\Psi|_\Lambda=\sigma_0$ and takes values in $\mu_{2^{M-1}}$. If $d_2=0$, put $Q=\emptyset$, $M=\nu+1$ and $\Psi=\Phi_0$; again $\Psi|_\Lambda=\sigma_0$, as $\Lambda=\{\pm1\}$. \emph{Step 4 (the character).} The rule $\iota(x)\prod_v(-1)_v^{b_v}\mapsto\Psi(x)^{-1}\prod_vs_v^{b_v}$ is a well-defined character of $H$ (its only relations come from $x\in\Lambda$, where $\Psi=\sigma_0$), with values in $\mu_{2^{M-1}}$. By \cref{lem:interp} it extends to a character $\theta$ of $\hat U_2$ with values in $\mu_{2^{M-1+t}}$, trivial on $U_v^{(e_v(M+t)+1)}$ for $v\in S_2$. Consider the character of $\prod_v U_v$ ($U_v=\cO_v^\times$ at finite $v$, $U_v=\R^\times$ at real $v$) equal to $\theta$ composed with the projection $\cO_v^\times\to U_v^{(1)}$ at $v\in S_2$, to $\chi_v$ at $v\in T_-\setminus Q$, to $\chi_v\xi_j$ at $v=\mathfrak Q_j\in T_-$, to $\xi_j$ at $v=\mathfrak Q_j\notin T_-$, to $\chi_v$ at the real places, and trivial elsewhere. On $\cO_K^\times$ it equals $\theta(\iota(u))\Psi(u)=1$, so it is a character of an open subgroup of finite index of $\mathbf A_K^\times/K^\times$; any extension $\chi_1$ to $\mathbf A_K^\times/K^\times$ has order dividing $2^{M-1+t}\exp\operatorname{Cl}(K)$, is unramified outside $T_0\cup Q$, is tame at every odd prime, and has $\chi_{1,v}(-1)=s_v$ at every $v$. \Cref{lem:globsq} gives $\vartheta_1$ with $\vartheta_1^2=\chi_1$ and $\delta\vartheta_1=\varsigma$. \emph{Step 5 (removing ramification outside $T_0\cup Q$).} By \cref{lem:factor}, $\vartheta_1|_{G_{K_0}}$ is a homomorphism of finite order, so the set $\Sigma'$ of finite primes $v\notin T_0\cup Q$ with $\vartheta_1|_{I_v}\ne1$ is finite, and by \cref{lem:inertia} $\vartheta_1|_{I_v}$ comes from the Legendre symbol for $v\in\Sigma'$. Let $\varphi(x)=\prod_{v\in\Sigma'}(x/v)$ on $\hat E$, choose signs $\tau_v$ ($v\in S_2$) with $\prod_v\tau_v=\varphi(-1)$, and let $\sigma'(x)=\prod_v\tau_v^{a_v(x)}$ on $\Lambda$. If $d_2>0$, solve as in Step~3, with the same primes, for characters $\xi'_j$ of $(\cO_K/\mathfrak Q_j)^\times$ with values in $\mu_{2^{M-1}}$ and $\prod_j\xi'_j(\lambda_i)=\sigma'(\lambda_i)\varphi(\lambda_i)^{-1}$; then $\Psi'=\varphi\prod_j\xi'_j$ satisfies $\Psi'|_\Lambda=\sigma'$. As in Step~4, $\iota(x)\prod(-1)_v^{b_v}\mapsto\Psi'(x)^{-1}\prod\tau_v^{b_v}$ extends to a character $\theta'$ of $\hat U_2$ trivial on $U_v^{(e_v(M+t)+1)}$, and the character of $\prod_vU_v$ equal to the Legendre symbol at $v\in\Sigma'$, to $\xi'_j$ at $\mathfrak Q_j$, to $\theta'$ at $S_2$ and trivial elsewhere is trivial on $\cO_K^\times$; it extends to a character $\psi$ of $G_K$ of order dividing $2^{M-1+t}\exp\operatorname{Cl}(K)$, with $\psi|_{I_v}=\vartheta_1|_{I_v}$ for $v\in\Sigma'$ and $\psi$ unramified outside $T_0\cup Q\cup\Sigma'$. Put $\vartheta=\vartheta_1\psi^{-1}$ and $\chi=\chi_1\psi^{-2}$. Then $\delta\vartheta=\varsigma$, $\vartheta^2=\chi$, $\vartheta|_{G_{K_0}}$ and $\chi$ are unramified outside $T_0\cup Q$ ($\psi^2$ is trivial on $\cO_v^\times$ for $v\in\Sigma'$), $\chi$ is tame at every odd prime, and so is $\vartheta|_{G_{K_0}}$ (its square is tame, and wild inertia at an odd prime is pro-odd). The order $m$ of $\chi$ divides $2^{M-1+t}\exp\operatorname{Cl}(K)\le C\cdot2^\nu$; the dyadic conductor exponents of $\chi_1$ and $\psi^2$ are at most $e_v(M+t)+1\le e_v(\nu+C)$; and $[K':K]\le[K':K_0][K_0:K]\le2m[K_0:K]$, because $\vartheta|_{G_{K_0}}$ takes values in $\mu_{2m}$. \end{proof} \section{The number of unknowns}\label{sec:count} We write the certificate of \cref{def:cert} as one polynomial equation in $x$ and $25$ further unknowns, solvable in $K$ exactly when $x\in\Z$ (\cref{prop:F1}). The construction follows \cite[Lemmas~10.4 and~13.7]{Sun} and \cite[\S\S10.3--10.6]{Sun48} (a separating element, a gcd filter and one polynomial that absorbs the inequations). The finite choices here satisfy a triangular system whose fibres need not be reduced; instead of stratifying to reduced fibres, as in \cite[proof of Lemma~10.4]{Sun}, we recover each choice together with its multiplicity (\cref{lem:recover}). \subsection{Coordinates and finite choices}\label{ssec:coords} Each of the nine points of \cref{def:cert} is $V_\iota=[2]V'_\iota$ for a point $V'_\iota\in E(L)$, $1\le\iota\le9$; by \ref{C1}, $V'_\iota\notin E[2]$, so $V'_\iota$ has a finite abscissa $x(V'_\iota)=\xi_{2\iota-1}+\sqrt d\,\xi_{2\iota}$ with $\xi_{2\iota-1},\xi_{2\iota}\in K$. The \emph{structural coordinates} are the $24$ elements \[ \mathbf x=(\xi_1,\dots,\xi_{18},a_0,b_0,e^{(0)},w^{(0)},e^{(1)},w^{(1)})\in K^{24}, \] where $e^{(j)},w^{(j)}$ are the witnesses of $\Phi_K(B_j)$; put $\bar x=(X,\mathbf x)\in K^{25}$. Everything in the certificate is obtained from $\bar x$ by rational operations with coefficients in $F$, together with the following finite choices: \begin{enumerate}[label=\textup{(c\arabic*)}] \item the ordinates $y(V'_\iota)\in L$, roots of $y^2-f(x(V'_\iota))$, where $f(t)=t^3-At$; \item the square roots in $K$ of the two expressions \eqref{eq:pole} for $B_0$ and for $B_1$. \end{enumerate} The finitely many discrete alternatives (the sign $\delta$; for $B_0$ and for $B_1$, the alternative $B_j=0$ or a multiplier $\mu\in\mathcal M$; the cases of coincident or opposite points in each use of the group law) are called \emph{outer branches}. On an outer branch, all conditions of \cref{def:cert} (the definitions of the points by duplication and the group law, \ref{C1}--\ref{C4}, and every guard) become polynomial equations and inequations in $\bar x$ and the choices, after multiplying by guarded denominators. An element $u=u^{(0)}+\sqrt d\,u^{(1)}$ of $L$ is $0$ if and only if $u^{(0)}=u^{(1)}=0$, and nonzero if and only if $(u^{(0)})^2-d(u^{(1)})^2\ne0$, as $\sqrt d\notin K$ \ref{E1}; and $\Tr_{L/K}(u)=2u^{(0)}$. \emph{Scaling.} If $T$ is a root of $a_dT^d+\dots+a_0$ with $a_d\ne0$ (a guard), then $a_dT$ is a root of the monic polynomial $T'^d+\sum_{i0$ and, to begin with, $v$; put $A=W_v^{1/\rho}$, $n=\lfloor N/W_v\rfloor$ and $R=n^\rho$, and for a unit $b$ modulo $W_v$, $1\le b\le W_v$, put \[ f_{j,b}(x)=\tfrac{\varphi(W_v)}{W_v}\Lambda'_j(W_vx+b)\mathbf 1_{R\le x\le n},\qquad\theta_{j,b}(x)=\mu_j(W_vx+b),\qquad g_{j,b}=f_{j,b}-\theta_{j,b}, \] as functions on $\Z/n\Z$ with representatives $1,\dots,n$. As $\Delta'W_v\equiv0\pmod\Delta$, $\theta_{j,b}$ is $\Delta'$-periodic on $\Z$, with values in $[0,1]$. The appendix uses the modulus $\Delta'W_v$ and centres $f_{j,b}$ by a constant; with Tao and Ziegler's modulus $W_v$ the density at $W_vx+b$ depends on $x$ modulo $\Delta'$, and we centre by $\theta_{j,b}$. The norms are the appendix's: $\|\cdot\|_{U^a_{s[J]}}$ is the Gowers norm of order $a$ on $\Z/n\Z$ with differences from the multiset $s(h-h')$, $h,h'\in[J]$. \needspace{6\baselineskip} \begin{lemma}\label{lem:centring} Let $a\ge2$ and $C_1v$ dividing $s$, with product $1+O(1/\log v)$. Centring cancels the common main term, so the ordinary cube on each cell is $\bigl(O(1/\log v)+o_v(1)\bigr)nJ^{2a}$. As $0\le c_\omega\le1$ and the number of cells is bounded, summing over the cells gives the bound. \end{proof} \emph{The transfer.} Theorem~11 and Corollary~3 of \cite{TaoZiegler} apply to $f_{j,b}$: their modulus $\prod_{p\le w}p$ is $W_v$ with $w=v$, their length is $n$, $b$ is a unit modulo $W_v$, and $0\le f_{j,b}\le\lambda_{W_v,b}$ since $\Lambda'_j\le\Lambda'$. With $W_v$ in place of the appendix's modulus, the appendix's choice of their parameters is unchanged. They give a model $f'_{j,b}$, with $0\le f'_{j,b}\le B_*-1$ for a constant $B_*\ge2$ of the fixed data, accurate in the local box norms and in the norms of \cref{lem:centring}. Put $F_{j,b}=(f'_{j,b}-\theta_{j,b})/B_*$, so $|F_{j,b}|\le1$. By the triangle inequality for these norms, the global part of Corollary~3 and \cref{lem:centring}, the global norms of $F_{j,b}$ tend to $0$ in the appendix's diagonal limit. Their Theorem~9, applied to the bounded $F_{j,b}$, gives small local norms for $F_{j,b}$, hence, multiplying by $B_*$ and using the local part of Corollary~3, for $g_{j,b}$. Their Theorem~13 applies to products of factors $f_{j,b_j}$, $\theta_{j,b_j}$ and $g_{j,b_j}$, each bounded in absolute value by $\lambda_{W_v,b_j}+1$, as it requires; so every polynomial average with a factor $g_{j,b_j}$ is $o(1)$. \emph{The main term.} Write $u=W_vx+b$ and $w=W_vm+c$ with $b,c$ modulo $W_v$. Then $u+c_jw^2=W_v\bigl(x+P_j(m)\bigr)+b_j$, where $1\le b_j\le W_v$, $b_j\equiv b+c_jc^2\pmod{W_v}$ and $P_j(m)=c_jW_vm^2+2c_jcm+(b+c_jc^2-b_j)/W_v$, with coefficients $O(W_v)$; only the $(b,c)$ with every $b_j$ a unit contribute. Write $\prod_jf_{j,b_j}(x+P_j(m))=\prod_j(\theta_{j,b_j}+g_{j,b_j})(x+P_j(m))$ and expand. The terms with a factor $g_{j,b_j}$ are $o(1)$ by the transfer, and the end intervals and wrap-around are treated as in the appendix. The remaining term is the average of $\prod_j\theta_{j,b_j}(x+P_j(m))$ over $x\le n$ and $m\le M_0$, where $M_0=\lfloor T/W_v\rfloor$. Its summand depends only on $x$ and $m$ modulo $\Delta'$, as $P_j\in\Z[m]$, so this average is the average of $\prod_j\mu_j\bigl(W_v(x+P_j(m))+b_j\bigr)$ over $x,m$ modulo $\Delta'$, up to $O(\Delta'/M_0+\Delta'/n)$. Here $W_v(x+P_j(m))+b_j=u+c_jw^2$, and as $(b,c)$ runs over $(\Z/W_v\Z)^2$ and $(x,m)$ over $(\Z/\Delta'\Z)^2$, $(u,w)$ runs once over $(\Z/\Delta'W_v\Z)^2$. So the total main term, divided by $NT$, is \[ \Bigl(\frac{W_v}{\varphi(W_v)}\Bigr)^k\,\mathbb E_{u,w\bmod\Delta'W_v}\prod_{j=1}^k\mathbf 1_{\gcd(u+c_jw^2,\,W_v)=1}\,\mu_j(u+c_jw^2). \] As $\Delta'W_v=\Delta\prod_{p\le v,\,p\nmid\Delta}p$, the Chinese remainder theorem splits this average into a factor modulo $\Delta$, where $\mu_j$ vanishes at non-units, and one factor at each $p\le v$ with $p\nmid\Delta$. With $W_v/\varphi(W_v)=\bigl(\Delta/\varphi(\Delta)\bigr)\prod_{p\le v,\,p\nmid\Delta}p/(p-1)$ it equals \[ \Bigl(\frac\Delta{\varphi(\Delta)}\Bigr)^k\,\mathbb E_{u,w\bmod\Delta}\prod_{j=1}^k\mu_j(u+c_jw^2)\prod_{p\le v,\,p\nmid\Delta}\beta_p,\qquad\beta_p=\mathbb E_{u,w\bmod p}\prod_{j=1}^k\frac p{p-1}\mathbf 1_{p\nmid u+c_jw^2}, \] which tends to the appendix's main term $\mathfrak S$ as $v\to\infty$, since $\beta_p=1+O_k(p^{-2})$ for all but finitely many $p$. The admissible residues have total mass $O(1)$, as in the appendix, so summing over them does not amplify the $o(1)$ errors. Hence the appendix's fixed-field polynomial count holds as stated, with its main term $\mathfrak S$. \emph{(B) Green and Tao's majorant at the modulus $V_z$.} For $z$ at least the largest prime factor of $\Delta$, $V_z=\Delta'W_z$. If $\Delta'=1$, then $V_z=W_z$ and \cite[Proposition~6.4]{GreenTao} applies; so let $\Delta'\ge2$. For an integer $\kappa\ge1$, a $\kappa$-pseudorandom measure is one in the sense of \cite[Definitions~6.1--6.3]{GreenTao}, where it is called $D$-pseudorandom, and $C_0(\kappa)$ is the constant of \cite[Proposition~6.4]{GreenTao} at level $\kappa$. The following lemma follows Green and Tao's construction, averaged over the classes modulo $\Delta'$. \needspace{4\baselineskip} \begin{lemma}\label{lem:majorant} Let $\kappa\ge1$, let $b_1,\dots,b_t$ be units modulo $V_z$, and write $b_i=b'_i+W_ze_i$ with $0\le b'_i\Delta'$ is prime, $y\mapsto\Delta'y+s$ is a bijection of $\Z/N'\Z$. (i) The mean of $\nu'$ is that of $\nu$, $1+o(1)$. For the linear forms condition at level $\kappa$ \cite[Definition~6.2]{GreenTao}, let $1\le d\le\kappa$ and $1\le m\le\kappa$, and let $(\psi_1,\dots,\psi_m)$ be a finite complexity system of affine-linear forms on $\Z^d$ with linear coefficients at most $\kappa$ in absolute value. Then \[ \mathbb E_{n\in(\Z/N'\Z)^d}\prod_{i=1}^m\nu'(\psi_i(n))=\Delta'^{-m}\sum_{s_1,\dots,s_m=0}^{\Delta'-1}\mathbb E_{n\in(\Z/N'\Z)^d}\prod_{i=1}^m\nu\bigl(\Delta'\psi_i(n)+s_i\bigr), \] and each system $(\Delta'\psi_i+s_i)_i$ has finite complexity and linear coefficients at most $\kappa\Delta'$ in absolute value, so each average is $1+o(1)$ by the linear forms condition for $\nu$ at level $\kappa\Delta'$. For the correlation condition at level $\kappa$ \cite[Definition~6.3]{GreenTao}, let $1