\documentclass[11pt]{amsart} \usepackage{amsmath,amssymb,graphicx,booktabs} \usepackage[margin=1.15in]{geometry} \usepackage{placeins} \usepackage[hidelinks]{hyperref} \newtheorem{theorem}{Theorem}[section] \newtheorem{proposition}[theorem]{Proposition} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{conjecture}[theorem]{Conjecture} \newtheorem*{theoremA}{Theorem A} \newtheorem*{theoremB}{Theorem B} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \newtheorem*{heuristic}{Heuristic} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newcommand{\R}{\mathbb{R}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\C}{\mathbb{C}} \newcommand{\Hyp}{\mathbb{H}} \newcommand{\PSL}{\mathrm{PSL}} \newcommand{\SL}{\mathrm{SL}} \newcommand{\Rhat}{\widehat{\R}} \newcommand{\dd}{\mathfrak d} \newcommand{\area}{\operatorname{area}} \newcommand{\vol}{\operatorname{vol}} \title{Leopard spots, CM points, and class numbers} \author{Danny Calegari} \address{Department of Mathematics, University of Chicago, Chicago, Illinois, 60637} \begin{document} \begin{abstract} Basmajian's identity writes the area of the totally geodesic boundary of a hyperbolic manifold as a sum over its orthogeodesics. Behind it is a tiling of the boundary, up to measure zero, by round disks, one for each orthogeodesic. We study this tiling in arithmetic examples. Cut the Bianchi orbifold $\Hyp^3/\PSL(2,O_k)$ open along its totally geodesic modular surface. We show that the disks are centred at CM points of the modular surface. More generally, consider all orthogeodesics leaving one side of the surface and returning to it, now allowed to cross it. For $n$ satisfying a congruence condition, the number of them with $\cosh$-length $n$ is the Hurwitz class number $H(4(n^2-1)/|D_k|)$. Combined with the counting of common perpendiculars, this gives, for $k\ne\Q(i)$, \[ \textstyle\sum_{11$. Count the circles $c$ of the Schmidt arrangement in the upper half-plane with $n(c)=n$, up to the action of $\PSL(2,\Z)$, each with weight $1/|\mathrm{Stab}(c)|$. If $n$ is admissible (that is, $2n\in\Z$, $4(n^2-1)/|D|\in\Z$, and a congruence condition holds; Lemma~\ref{lem:adm}), the number is \[ H\Bigl(\frac{4(n^2-1)}{|D|}\Bigr), \] and otherwise it is $0$. For each such circle, the hyperbolic centre of its disk is the root in $\Hyp^2$ of a positive definite form of discriminant $-4(n^2-1)/|D|$, and every such form arises from exactly one circle. \end{theoremA} In other words, the leopard spots of the arrangement, and all the circles nested inside them, are disks centred at CM points; the radius of a disk records the discriminant of the (not necessarily primitive) form attached to it. When $|D|$ is a prime or $8$, every $n\in\frac12\Z$ with $4(n^2-1)/|D|\in\Z$ is admissible; for $k=\Q(i)$, the odd integers are. The remaining $n$ are not lost. They belong to other totally geodesic surfaces $F_\xi$ in $M_k$, isometric to $F$. There are $2^{t-1}$ surfaces $F_\xi$, including $F$, where $t$ is the number of primes dividing $D$: one for each genus of forms of discriminant $D$. For $k=\Q(i)$ there are two (Theorem~\ref{thm:genus}). Theorem~A counts all circles, nested or not. The asymptotic count of common perpendiculars, due to Parkkonen and Paulin \cite{ParkkonenPaulin2017} (see also \cite{DukeRudnickSarnak1993,EskinMcMullen1993,OhShah2013}), then gives: \begin{theoremB}[Corollary~\ref{cor:euler}] For every imaginary quadratic field $k\ne\Q(i)$, \[ \sum_{\substack{10$. Planes are vertical half-planes and hemispheres orthogonal to $\C$, so a plane is determined by its circle at infinity. Isometries are the M\"obius maps $z\mapsto(az+b)/(cz+d)$ of $\C\cup\{\infty\}$, extended to $\Hyp^3$. Let $\pi$ be the vertical plane over $\R$, and identify $\pi$ with the upper half-plane by $(x,t)\mapsto x+it$. The geodesics perpendicular to $\pi$ are the quarter circles in the planes $x=\text{const}$ that join $(x,0,t)\in\pi$ to the point $x+it$ of $\C$. In other words, they rotate the upper half of $\C$ onto $\pi$, about the real axis. So the shadow on $\pi$ of the hemisphere $P$ over a circle $c$ in the upper half-plane is \emph{the disk bounded by $c$ itself}, read in $\pi$ (Figure~\ref{fig:dictionary}). Its hyperbolic centre is the foot of the common perpendicular from $\pi$ to $P$. Its hyperbolic radius $r$ satisfies $\sinh r=1/\sinh\ell$, where $\ell$ is the length of that perpendicular, and \begin{equation}\label{eq:n} \cosh\ell=n(c)=\frac{\operatorname{Im}(\text{centre of }c)}{\text{radius of }c}. \end{equation} Its area is $2\pi(\cosh r-1)=2\pi\bigl(n/\sqrt{n^2-1}-1\bigr)=4\pi/(e^{2\ell}-1)$. \begin{figure}[ht] \centering\includegraphics[width=0.8\textwidth]{figures/dictionary.pdf} \caption{The plane $\pi$ over the real axis, a circle $c$ in $\C$ and the hemisphere $P$ over it. The geodesics perpendicular to $\pi$ (dashed) rotate $\C$ onto $\pi$, so the shadow of $P$ on $\pi$ is the disk of $c$ rotated into $\pi$. The dashed arcs from its boundary to $c$ sweep out the side of the \emph{chimney} over the shadow. The bold arc is the common perpendicular, of length $\ell$ with $\cosh\ell=n$; its foot $p$ is the hyperbolic centre of the shadow.} \label{fig:dictionary} \end{figure} If $M$ has finite volume and cusps, two boundary planes may be asymptotic, touching at a cusp. Then the shadow is a horodisk, and its contribution to Basmajian's identity is the area of a cusp neighbourhood of the boundary rather than a function of an orthogeodesic. \section{The modular surface and Euler's identity} This section is a warm-up in dimension two. It is heuristic, and supported by numerical evidence. We open the cusp of the modular orbifold into a short geodesic and watch Basmajian's identity as the geodesic shrinks back. \subsection{Opening the cusp} For $s>1$ let $G_s$ be the group generated by \[ T(z)=sz,\qquad S(z)=\frac{z-x}{z-1},\qquad x=s-1+\frac1s . \] Then $S^2=(ST)^3=1$. So $S$ is the rotation by $\pi$ about a point $p$, and $ST$ the rotation by $2\pi/3$ about a point $q$. Let $b$ be the geodesic through $p$ and $q$, and $a$ and $c$ the geodesics through $p$ and $q$ making angles $\pi/2$ and $\pi/3$ with $b$, chosen so that $S=r_ar_b$ and $ST=r_br_c$, where $r_x$ is the reflection in $x$. Then $T=r_ar_c$ is hyperbolic, so $a$ and $c$ do not meet, and $G_s$ is the orientation-preserving subgroup of the group generated by $r_a$, $r_b$, $r_c$. The region bounded by $a$, $b$ and $c$ has angles $\pi/2$ and $\pi/3$, so by Poincar\'e's polygon theorem (see \cite[\S9.8]{Beardon1983}) it is a fundamental domain for that reflection group, which is therefore discrete. So $O_s=\Hyp^2/G_s$ is an orbifold with cone points of orders $2$ and $3$ and one geodesic boundary component, the image of the axis $(0,\infty)$ of $T$, of length $L=\log s$. Its area is $\pi/3$. As $s\to1$, after conjugation in $\PSL(2,\R)$, it converges to the modular orbifold $\Hyp^2/\PSL(2,\Z)$, with the boundary shrinking into the cusp. The rule $z\mapsto z+1\ \leadsto T$, $z\mapsto-1/z\ \leadsto S$ identifies $G_s$ with $\PSL(2,\Z)$ as an abstract group. Under it, the lifts of the boundary correspond to the fractions $p/q$, just as the cusps of $\PSL(2,\Z)$ do. For $p/q\in[0,1)$ the lift is a semicircle over an interval $[u,v]\subset[1,s]$, and these intervals are the leopard spots on the axis, rotated onto $\R$ (Figure~\ref{fig:Ot}). Basmajian's identity \eqref{eq:basmajian2} becomes \begin{equation}\label{eq:Ot} \sum_{p/q\in[0,1)}\log\frac{v_{p/q}}{u_{p/q}}=\log s . \end{equation} The endpoints are rational functions of $s$, so \eqref{eq:Ot} is an infinite product $\prod v/u=s$ of rational functions. At $s=2$, for example, the first factors come from $[1,\tfrac32]$, $[\tfrac53,\tfrac95]$ and $[\tfrac{11}7,\tfrac{21}{13}]$, for $0/1$, $1/2$ and $1/3$. \begin{figure}[ht] \centering\includegraphics[width=0.8\textwidth]{figures/Ot_chimneys.pdf} \caption{The orbifold $O_s$ at $s=2$. Top: one period $1\le|z|\le s$ of the cover in which the boundary is the axis $(0,\infty)$, tiled by chimneys, one for each fraction $p/q\in[0,1)$. Bottom: the boundary period in hyperbolic length, cut into its leopard spots.} \label{fig:Ot} \end{figure} \subsection{Closing the cusp} As $s\to1$, every term of \eqref{eq:Ot} tends to $0$ while their sum is $L$. In fact $G_{1/s}=G_s$, so the identity for $-L$ is the identity for $L$, with the same terms, while the sum is $|L|$. So the identity cannot be expanded term by term at $L=0$. The size of the terms is easy to find. \begin{proposition}\label{prop:onen} For $p/q=1/m$, as $L\to0$ with $\lambda=mL$ fixed, \[ \log\frac{v_{1/m}}{u_{1/m}}=\frac{L^2}{m^2}\Bigl(\frac{\lambda/2}{\sinh(\lambda/2)}\Bigr)^2\bigl(1+O(L^2)\bigr). \] \end{proposition} \begin{proof} The lift of $1/m$ is $ST^{-m}S(0,\infty)$, with endpoints $u=(x-E)/(1-E)$ and $v=x(1-E)/(1-xE)$, where $E=s^{-m}=e^{-\lambda}$. Put $\delta=x-1=4\sinh^2(L/2)$. Expanding in $\delta$, $\log(v/u)=\delta^2E/(1-E)^2+O(\delta^3)$, and $E/(1-E)^2=1/(4\sinh^2(\lambda/2))$. \end{proof} The factor $(\lambda/2)/\sinh(\lambda/2)$ suppresses a fraction once its partial quotient $m$ exceeds about $1/L$. Numerically, the same is true for every fraction. For $p/q=[0;a_1,\dots,a_k]$, the term is $(L^2/q^2)\prod_iw(a_iL)$ to leading order, where $w(\lambda)=((\lambda/2)/\sinh(\lambda/2))^2$. So \eqref{eq:Ot}, divided by $L^2$, reads \begin{equation}\label{eq:renorm} \sum_{p/q\in[0,1)}\frac1{q^2}\,W_{p/q}(L)=\frac1L,\qquad W_{p/q}(L)\to1\ \text{as}\ L\to0 . \end{equation} The numbers $1/q^2$ are the diameters of the Ford circles \cite{Ford1938}, and their sum diverges. (Their three-dimensional analogues, the disjoint horoballs of a Bianchi group, are the disjoint spheres that Sullivan used to study approximation of complex numbers by quotients of integers of an imaginary quadratic field \cite{Sullivan1982}.) The deformation regularizes it, with divergence rate exactly $1/L$. \subsection{Where Euler's identity appears} Which fractions carry the mass in \eqref{eq:renorm}? Weight each $p/q$ by its share $\log(v/u)/L$ of the boundary. Two heuristics predict that, under this weighting, $\log q$ is approximately exponentially distributed with mean $\pi^2/(6L)$. \begin{heuristic}[counting] Since $\sum_q\varphi(q)q^{-s}=\zeta(s-1)/\zeta(s)$ has residue $1/\zeta(2)$ at $s=2$, the shares $L/q^2$ add up to $(L/\zeta(2))\log Q$ over the fractions with $q\le Q$. If the cutoff has the memoryless form $q^{-\kappa}$, then \eqref{eq:renorm} forces $\zeta(1+\kappa)/\zeta(2+\kappa)\sim1/L$, that is $\kappa\sim L/\zeta(2)$. So the mean of $\log q$ is $\zeta(2)/L$. \end{heuristic} \begin{heuristic}[dynamics] Continued fractions code the geodesic flow on the modular surface \cite{Series1985}, and $\log q$ grows like half the flow time. By the factor $w$, a boundary point is captured by the convergent just before the first excursion of its geodesic above height about $1/L$ in the cusp. The geodesic flow enters that region at rate $L/(\pi A)$, where $A=\pi/3$ is the area. So the mean of $\log q$ is $\pi A/(2L)=\pi^2/(6L)$. In symbolic language: the factor $w(a_jL)$ removes a partial quotient $a_j$ with probability about \[ \sum_a\frac{1-w(aL)}{a^2\log2}\approx\frac L{\log2}\int_0^\infty\frac{1-w(\lambda)}{\lambda^2}\,d\lambda=\frac L{2\log2}, \] using the Gauss measure $\approx1/(a^2\log2)$ of large partial quotients and $\int_0^\infty(\mu^{-2}-\sinh^{-2}\mu)\,d\mu=1$; and $\log q_j$ grows like $j\,\pi^2/(12\log2)$, by L\'evy's theorem \cite{Levy1929,Khinchin}. \end{heuristic} The two heuristics agree exactly when $\zeta(2)=\frac\pi2\area(\Hyp^2/\PSL(2,\Z))=\pi^2/6$. In this sense Basmajian's identity, read at the cusp, contains Euler's identity. A Monte Carlo test samples boundary points of $O_s$ and finds the leopard spot containing each one exactly. With 4000 samples at each of $L=0.4,0.2,0.1,0.05,0.025$, the mean of $\log q$ fits $a/L+b+cL$ with $a=1.600\pm0.024$ (prediction $\pi^2/6=1.645$, about two standard errors away). The mean continued-fraction depth fits with $a=1.396\pm0.023$ (prediction $2\log2=1.386$). The distribution of $\log q$ approaches an exponential law. \begin{remark} The same reasoning suggests that the limit set of $G_s$ has Hausdorff dimension $\delta_s$ with $1-\delta_s\sim3L/\pi^2$. This matches Hensley's asymptotic $1-\dim E_N\sim6/(\pi^2N)$ for continued fractions with partial quotients at most $N$ \cite{Hensley1992} (see also \cite{McMullen1998}), with $N=2/L$. \end{remark} \section{The modular surface inside a Bianchi orbifold} \subsection{Setup} Let $k=\Q(\sqrt{-m})$, with $m>0$ squarefree, be an imaginary quadratic field. Let $D$ be its discriminant ($D=-m$ if $m\equiv3\bmod4$, and $D=-4m$ otherwise), $O_k=\Z[\omega]$ its ring of integers, where $\omega=\sqrt{-m}$ if $D=-4m$ and $\omega=(1+\sqrt{-m})/2$ if $D=-m$ (so $\operatorname{Im}\omega=\sqrt{|D|}/2$), and $\dd=\sqrt D\,O_k$. The group $\Gamma=\PSL(2,O_k)$ acts on $\Hyp^3$ with quotient the Bianchi orbifold $M_k$, of finite volume \[ \vol(M_k)=\frac{|D|^{3/2}}{4\pi^2}\zeta_k(2)=\frac{|D|^{3/2}}{24}L(2,\chi_D) \] by Humbert's formula \cite{Humbert1919}; a gap in Humbert's proof was filled by Grunewald and K\"uhnlein \cite{GrunewaldKuhnlein1998}, and the formula is stated, for example, in \cite[\S2]{Sengun2014} (see also \cite{EGM1998,MaclachlanReid2003}). The stabilizer of the plane $\pi$ over $\R$ is $\PSL(2,\Z)$, except that for $k=\Q(i)$ it also contains $z\mapsto-z$, which exchanges the two sides of $\pi$. (An element of $\Gamma$ preserving $\Rhat$ is $\lambda A$ with $A$ real. If $\det A<0$ then $\lambda$ is imaginary, so the entries of $\lambda A$ lie in $\sqrt{-m}\,\Z$, and its determinant lies in $m\Z$; this is possible only for $m=1$.) So the image of $\pi$ is a totally geodesic surface $F$: a two-sided copy of the modular surface, of area $\pi/3$, if $k\ne\Q(i)$, and a one-sided surface of area $\pi/6$, covered twice by the modular surface, if $k=\Q(i)$. Totally geodesic surfaces in Bianchi orbifolds are classified by binary Hermitian forms \cite{MaclachlanReid1991,JamesMaclachlan1996,MaclachlanReid2003}. The lifts of $F$ are the planes over the circles $g(\Rhat)$, $g\in\Gamma$. This is the Schmidt arrangement $\mathcal S_k$, studied by A.~L.~Schmidt in connection with continued fractions over $k$ \cite{Schmidt} and by Stange \cite{Stange2018Visualizing,Stange2018Apollonian}. Stange showed that the circles of $\mathcal S_k$ correspond to ideal classes in orders of $k$, the conductor of the order being a fixed multiple of the curvature of the circle, so that they can be counted by class numbers \cite{Stange2018Visualizing}. That count is by curvature, a distance from the point $\infty$. Below we count instead by distance from the circle $\Rhat$, and other class numbers appear. \subsection{Circles as Hermitian matrices} A circle in $\C\cup\{\infty\}$ is the zero set of $A|z|^2+2\operatorname{Re}(\bar Bz)+C$, for a Hermitian matrix $H=\bigl(\begin{smallmatrix}A&B\\\bar B&C\end{smallmatrix}\bigr)$ with $\det H<0$, which we normalize by $\det H=-1$. If $H$ is the matrix of a circle, then $g^*Hg$ is the matrix of its image under $g^{-1}$. The real line has $H_{\Rhat}=\bigl(\begin{smallmatrix}0&i\\-i&0\end{smallmatrix}\bigr)$. For a circle in the upper half-plane, with $A>0$, the quantity $n$ of \eqref{eq:n} is $-\operatorname{Im}B$. For $g=\bigl(\begin{smallmatrix}a&b\\c&d\end{smallmatrix}\bigr)\in\SL(2,O_k)$, a direct computation gives \begin{equation}\label{eq:orbit} g^*H_{\Rhat}g=\begin{pmatrix}\sqrt{|D|}\,\alpha&iX\\-i\bar X&\sqrt{|D|}\,\gamma\end{pmatrix}, \qquad X=\bar ad-\bar cb,\quad \alpha,\gamma\in\Z . \end{equation} Since $ad-bc=1$ and $x\equiv\bar x\bmod\dd$ for $x\in O_k$, we also have $X\equiv1\bmod\dd$. Taking real parts, $\operatorname{Re}X\equiv1\bmod 2m$ when $D=-4m$, and $2\operatorname{Re}X$ is an integer $\equiv2\bmod m$ when $D=-m$. For a circle with matrix \eqref{eq:orbit}, $|\operatorname{Re}X|$ is its inversive product with $\Rhat$: the cosine of the angle of intersection if the two circles cross, and $\cosh$ of the distance between the two planes if they do not. Two circles cross exactly when the inversive product is less than~$1$. \begin{proposition}\label{prop:embedded} If $k\ne\Q(\sqrt{-3})$, no two circles of $\mathcal S_k$ cross. So $F$ is an embedded totally geodesic surface in $M_k$. \end{proposition} \begin{proof} The group $\Gamma$ acts transitively on $\mathcal S_k$ and preserves inversive products, so it suffices to show that no circle of $\mathcal S_k$ crosses $\Rhat$. When $D=-4m$, $\operatorname{Re}X$ is an integer $\equiv1\bmod2m$, so it is not $0$. When $D=-m$, $2\operatorname{Re}X$ is an integer $\equiv2\bmod m$; it can lie in $\{-1,0,1\}$ only if $m\mid3$. So $|\operatorname{Re}X|\ge1$ unless $m=3$. \end{proof} \subsection{The leopard spots} In this subsection $k\ne\Q(\sqrt{-3})$, so that $F$ is embedded. Cut $M_k$ open along $F$. The other boundary planes facing the upper side of $\pi$ are the planes over the \emph{outermost} circles of $\mathcal S_k$ in the upper half-plane, those not contained in any other. By \S2 their leopard spots are the disks they bound, read in $\pi$. These fill $\pi$ up to measure zero, as in \S1.1. Indeed, let $R$ be the region between $\pi$ and the planes over the outermost circles, and $\Gamma'$ its stabilizer in $\Gamma$, so that $R/\Gamma'$ is the cut-open orbifold, of finite volume. The limit set $\Lambda'$ of $\Gamma'$ contains $\Rhat$ and every outermost circle, since the stabilizer in $\Gamma'$ of each of these is a lattice in the isometries of its plane. A point $\zeta$ of the upper half-plane outside every closed outermost disk lies in $\Lambda'$ too. Otherwise a small round disk $D\ni\zeta$ would miss $\Lambda'$, hence miss every outermost circle and lie outside every outermost disk. The half-space over $D$ would then lie in $R$, and, after shrinking $D$, meet only finitely many of its translates by $\Gamma'$, so $R/\Gamma'$ would have infinite volume. Finally, the convex hull of $\Lambda'$ lies in $R$. The faces of $R$ fall into finitely many $\Gamma'$-orbits, whose quotients make up the boundary of the cut-open orbifold, copies of $F$ of finite area; so the $\varepsilon$-collars beyond them have finite volume modulo $\Gamma'$, and every bounded neighbourhood of the convex core of $\Gamma'$ has finite volume; since the orders of the finite subgroups of $\Gamma'$ are bounded, $\Gamma'$ is geometrically finite, in each of the equivalent senses of \cite{Bowditch1993}. By Ahlfors's theorem \cite{Ahlfors1966}, $\Lambda'$, which misses the lower half-plane, has measure zero. The spots tangent to $\R$ are horodisks: the orbit of the half-plane above the line $\operatorname{Im}z=\operatorname{Im}\omega$. (A circle of $\mathcal S_k$ tangent to $\Rhat$ has $n=1$, so the form $q_H$, defined as in Lemma~\ref{lem:forms}, has discriminant $0$, and the point of tangency $u/2\alpha$ is rational. Moving it to $\infty$ by $\PSL(2,\Z)$ turns the circle into a line of $\mathcal S_k$ parallel to $\R$, that is, one of the lines $\operatorname{Im}z=j\operatorname{Im}\omega$, $j\in\Z$, by the end of the proof of Theorem~\ref{thm:transitive}. Only $j=1$ gives an outermost circle.) This orbit contributes area $1/\operatorname{Im}\omega=2/\sqrt{|D|}$ to the upper side of $F$, whose area is $\pi/3$. Basmajian's identity therefore reads: \begin{proposition}\label{prop:basmajian} For $k\ne\Q(\sqrt{-3})$, \[ \sum_{c}\frac1{|\mathrm{Stab}(c)|}\cdot\frac1{e^{2\ell(c)}-1}=\frac1{12}-\frac1{2\pi\sqrt{|D|}}, \] where $c$ runs over the outermost circles of $\mathcal S_k$ in the upper half-plane, not tangent to $\R$, up to the action of $\PSL(2,\Z)$, and $\cosh\ell(c)=n(c)$. \end{proposition} The term $\tfrac1{12}=-\chi(\PSL(2,\Z))/2$ is the cusp-free value \cite{Calegari2010}; the second term is the cusp correction. Numerically, summing the spots of radius at least $1/640$ and extrapolating gives the right side to within $0.2$--$1\%$ for $k=\Q(i),\Q(\sqrt{-2}),\Q(\sqrt{-7})$ and $\Q(\sqrt{-11})$. For $k=\Q(i)$ the outermost circles form the Apollonian strip packing \cite{GLMWY2003,GLMWY2005,KontorovichOh2011,Stange2018Apollonian}. For other $k$ they form other circle packings of the same kind \cite{Stange2018Apollonian,KontorovichNakamura2019,FuchsStangeZhang2019}. In every case the group of the packing has infinite index in $\Gamma$, and so the sum in Proposition~\ref{prop:basmajian} is over a sparse subset of the circles. The arithmetic appears when we count all the circles of $\mathcal S_k$, nested ones included. \begin{figure}[p] \centering \includegraphics[width=0.74\textwidth]{figures/packing_Qi.pdf}\\[2ex] \includegraphics[width=0.74\textwidth]{figures/packing_Qsqrt2.pdf}\\[2ex] \includegraphics[width=0.74\textwidth]{figures/packing_Qsqrt7.pdf} \caption{Leopard spots on the modular surface $F\subset M_k$, for $k=\Q(i)$, $\Q(\sqrt{-2})$ and $\Q(\sqrt{-7})$ (top to bottom). Left: the upper half-plane, with the standard fundamental domain of $\PSL(2,\Z)$ dashed. Right: the same packing in the Poincar\'e disk, centred at $\rho=e^{i\pi/3}$. Grey: the horodisk $\operatorname{Im}z>\operatorname{Im}\omega$ and its images. Other spots are coloured by $n=\cosh\ell$. The largest are $n=7$ at $\rho$ (weight $1/3$) for $\Q(i)$; $n=3$ at $i$ and $n=5$ at $\rho$ for $\Q(\sqrt{-2})$; and $n=5/2$ at $\rho$ for $\Q(\sqrt{-7})$.} \label{fig:packings} \end{figure} \section{The orthospectrum is arithmetic} \subsection{From circles to quadratic forms} Every circle of $\mathcal S_k$ in the upper half-plane is recorded by two numbers: how far it is from $\R$, and where its shadow is centred. The next lemma shows that both are arithmetic. \begin{lemma}\label{lem:forms} Let $H$ be as in \eqref{eq:orbit}, with $\alpha>0$, and write $X=-n+\frac{\sqrt D}2u$ with $u\in\Z$. Suppose $n>1$, that is, the circle lies in the upper half-plane and does not touch $\R$. Put $q_H(x,y)=\alpha x^2-uxy+\gamma y^2$ and $N=4(n^2-1)/|D|$. Then $q_H$ is a positive definite integral form of discriminant $-N$. Its root $(u+i\sqrt N)/2\alpha$ in $\Hyp^2$ is the hyperbolic centre of the shadow of the circle of $H$, and $n$ is $\cosh$ of the length of the perpendicular. The circle is determined by $(n,q_H)$, and $h\in\SL(2,\Z)$ acts by $q\mapsto q\circ h$, fixing $n$. \end{lemma} \begin{proof} Write $\operatorname{Nm}$ for the norm from $k$ to $\Q$. Then $\det H=-1$ says $\operatorname{Nm}(X)=|D|\alpha\gamma+1$, that is $n^2+\frac{|D|}4u^2=|D|\alpha\gamma+1$, which is $u^2-4\alpha\gamma=-N$. The real part of $H$ is $\sqrt{|D|}$ times the matrix of $q_H$, and its imaginary part is $-n$ times that of $H_{\Rhat}$, which $\SL(2,\Z)$ preserves. The centre of the circle is $-iX/\sqrt{|D|}\alpha$ and its radius is $1/\sqrt{|D|}\alpha$, so the hyperbolic centre of its disk is $\frac u{2\alpha}+i\frac{\sqrt{n^2-1}}{\sqrt{|D|}\alpha}$, the root of $q_H$. \end{proof} So the disk of every circle of $\mathcal S_k$ is centred at a CM point, a point of $\Hyp^2$ that satisfies a quadratic equation over $\Q$. Its CM field is $\Q(\sqrt{D(n^2-1)})$. Moreover $e^\ell=\bigl(\nu+\sqrt{\nu^2-4}\bigr)/2$ with $\nu=2n\in\Z$, a unit of norm $1$. Compare Sarnak's count of the closed geodesics of the modular surface: those of trace $\nu$ are counted by class numbers of discriminant $\nu^2-4$ \cite{Sarnak1982}. Here the orthogeodesics of $\cosh$-length $\nu/2$ will be counted by class numbers of discriminant $-(\nu^2-4)/|D|$. \subsection{Which forms occur} Not every $(n,q)$ need come from a circle of $\mathcal S_k$. Let $\Lambda$ be the set of matrices of the shape \eqref{eq:orbit}, with $X\in O_k$, $\det H=-1$ and $X\equiv\pm1\bmod\dd$. By the computation above, the matrices of the circles of $\mathcal S_k$ lie in $\Lambda$. Moreover $\Lambda$ is preserved by $\SL(2,O_k)$. Indeed, let $H\in\Lambda$ and $g=\bigl(\begin{smallmatrix}a&b\\c&d\end{smallmatrix}\bigr)\in\SL(2,O_k)$. The diagonal entries of $g^*Hg$ are $\sqrt{|D|}(\alpha|a|^2+\gamma|c|^2)-2\operatorname{Im}(X\bar ac)$ and the same with $b,d$; they lie in $\sqrt{|D|}\,\Z$ because $2\operatorname{Im}w\in\sqrt{|D|}\,\Z$ for $w\in O_k$. The off-diagonal entry is $iX'$ with \[ X'=X\bar ad-\bar X\bar cb-\sqrt D(\alpha\bar ab+\gamma\bar cd)\in O_k, \] and $X'\equiv X(\bar ad-\bar cb)\equiv X\bmod\dd$, since $\bar X\equiv X$ and $\bar ad-\bar cb\equiv ad-bc=1$. \begin{lemma}\label{lem:adm} Given $n>1$ with $2n\in\Z$, with $N=4(n^2-1)/|D|$ a positive integer, and a form $q$ of discriminant $-N$, the number $X=-n+\frac{\sqrt D}2u$ lies in $O_k$, and its class modulo $\dd$ depends only on $n$. Call $n$ \emph{admissible} if this class is $\pm1$. Explicitly, $n$ is admissible iff $N\equiv0\bmod4$ and $n\equiv\pm1\bmod2m$ (when $D=-4m$), or $2n\equiv\pm2\bmod m$ (when $D=-m$). If $|D|$ is a prime, or $8$, every such $n$ is admissible; if $D=-4$, the odd ones. \end{lemma} \begin{proof} If $D=-4m$, then $n\in\Z$: if $2n$ were odd, $4(n^2-1)=(2n)^2-4$ would be odd and $N$ not an integer. So $X=-n+u\sqrt{-m}$ and $O_k/\dd$ records $(-n\bmod2m,\,u\bmod2)$, with $u\equiv N\bmod2$ because $u^2\equiv-N\bmod4$. If $D=-m$, then $X=(-2n+u\sqrt{-m})/2$, and $2n\equiv u\bmod2$ holds automatically because $u^2\equiv-N\bmod4$ and $mN=(2n)^2-4$; the map $(r+s\sqrt{-m})/2\mapsto r/2$ identifies $O_k/\dd$ with $\Z/m$ and sends $X$ to $-n$. For $|D|$ prime, $N\in\Z$ gives $(2n)^2\equiv4$, hence $2n\equiv\pm2$. For $D=-8$ or $-4$, $N\in\Z$ (resp.\ $N\equiv0\bmod4$) forces $n$ odd, and then $n^2-1\equiv0\bmod8$ and $n\equiv\pm1\bmod2m$. \end{proof} The heart of the matter is to show that every matrix in $\Lambda$ comes from a circle of $\mathcal S_k$. Every circle in $\Lambda$ passes through points of $k$. The key point is that it passes through a point that $\Gamma$ can move to $\infty$, \emph{whatever the class number of $k$}. \begin{lemma}\label{lem:principal} Let $H\in\Lambda$ with $\alpha\ne0$, choose $\varepsilon=\pm1$ with $X\equiv\varepsilon\bmod\dd$, and put $a_0=(X-\varepsilon)/\sqrt D\in O_k$. Then $z^*=a_0/\alpha$ lies on the circle of $H$, and the ideal $(a_0,\alpha)$ of $O_k$ is generated by a rational integer. \end{lemma} \begin{proof} That $z^*$ lies on the circle is a one-line computation using $\operatorname{Nm}(X)=|D|\alpha\gamma+1$. Let $F_H=H/\sqrt{|D|}$ and $v=(a_0,\alpha)^T$. A direct computation gives $v^*F_He_1=\varepsilon\alpha/\sqrt D$ and $v^*F_He_2=-\varepsilon a_0/\sqrt D$, so $v^*F_H\,O_k^2=\dd^{-1}(a_0,\alpha)$. On the other hand $\sqrt D\,F_H$ has entries in $O_k$ and determinant $1$, so $F_HO_k^2=\dd^{-1}O_k^2$ and $v^*F_H\,O_k^2=\dd^{-1}(\bar a_0,\alpha)$. Hence the ideal $\mathfrak a=(a_0,\alpha)$ equals its conjugate. So it is a rational ideal times a product of distinct ramified primes. It remains to see that no ramified prime $\mathfrak p$ occurs to an odd power. Put $\kappa=2(1+\varepsilon n)/|D|$. Then $a_0=(u+\varepsilon\kappa\sqrt D)/2$, $\operatorname{Nm}(a_0)=\alpha\gamma+\kappa$ (so $\kappa\in\Z$), and $4\alpha\gamma-u^2=\kappa(\kappa|D|-4)$. For odd $p$ the valuation of $a_0$ at $\mathfrak p$ is $\min(2v_p(u),2v_p(\kappa)+1)$. If it were odd and at most $2v_p(\alpha)$, then $v_p(\kappa)v_p(\kappa)=v_p(\kappa(\kappa|D|-4))$, a contradiction. At the prime above $2$, when $D=-4m$, write $u=2u'$, so that $a_0=u'+\varepsilon\kappa\sqrt{-m}$ and $\alpha\gamma-u'^2=\kappa(m\kappa-1)$. If $m$ is even, the same argument applies. If $m$ is odd, then $m\equiv1\bmod4$, so $x+y\sqrt{-m}$ has odd norm if exactly one of the integers $x,y$ is odd, and norm $\equiv2\bmod4$ if both are. Hence the valuation of $a_0$ is odd exactly when $u'$ and $\kappa$ have the same $2$-adic valuation $j$, and it is then $2j+1$. If also $2^{j+1}\mid\alpha$, then $\alpha\gamma-u'^2$ is odd while $\kappa(m\kappa-1)$ is even (if $j=0$), or $v_2(\alpha\gamma-u'^2)>j=v_2(\kappa(m\kappa-1))$ (if $j\ge1$). Either way we have a contradiction. \end{proof} \begin{theorem}\label{thm:transitive} For every imaginary quadratic field $k$, the matrices in $\Lambda$ are exactly the matrices $\pm g^*H_{\Rhat}g$, $g\in\SL(2,O_k)$. \end{theorem} \begin{proof} Let $H\in\Lambda$. If $\alpha\ne0$, then by Lemma~\ref{lem:principal}, $z^*=a/c$ with $a,c\in O_k$ generating $O_k$. Complete $\bigl(\begin{smallmatrix}a&\ast\\c&\ast\end{smallmatrix}\bigr)\in\SL(2,O_k)$. This moves $z^*$ to $\infty$, and $\Lambda$ is preserved, so we may assume that $\alpha=0$, that is, the circle of $H$ is a line. Then $\operatorname{Nm}(X)=1$, so $X$ is a unit $\equiv\pm1\bmod\dd$. Hence $X=\pm1$: for $k=\Q(i)$ the units $\pm i$ are not $\equiv\pm1$ modulo $\dd=(2)$. (For $k=\Q(\sqrt{-3})$, first apply a rotation $z\mapsto\zeta z$, $\zeta^3=1$, which multiplies $X$ by a cube root of unity, and change the sign of $H$ if needed.) Now $H=\pm\bigl(\begin{smallmatrix}0&i\\-i&\sqrt{|D|}\gamma\end{smallmatrix}\bigr)$, which is the translate of $H_{\Rhat}$ by $z\mapsto z-\gamma\omega$. \end{proof} \begin{theorem}\label{thm:classnumber} Theorem~A holds. \end{theorem} \begin{proof} By Theorem~\ref{thm:transitive} the circles of $\mathcal S_k$ are those of $\Lambda$. By Lemma~\ref{lem:forms} they inject into pairs $(n,q)$, equivariantly. By Lemma~\ref{lem:adm} every form occurs when $n$ is admissible, and none occurs when it is not. An element of $\PSL(2,\Z)$ fixes a circle iff it fixes its form, so the stabilizers have orders $2$, $3$ or $1$ exactly as in the definition of $H(N)$. \end{proof} Figure~\ref{fig:mult} shows Theorem~A at work. Geometrically, Theorem~A counts the orthogeodesics of $M_k$ that leave $F$ from the upper side of $\pi$ and return to $F$, now allowed to cross $F$ in their interior. Those that do not cross $F$ give the leopard spots of \S4. \begin{figure}[p] \centering \includegraphics[width=0.64\textwidth]{figures/mult_Qi.pdf}\\[2ex] \includegraphics[width=0.8\textwidth]{figures/mult_Qsqrt7.pdf} \caption{Theorem~A for $k=\Q(i)$ (top, $N=n^2-1$) and $k=\Q(\sqrt{-7})$ (bottom, $N=(4n^2-4)/7$). Each panel shows all circles with one value of $n$, as hyperbolic disks of radius $\operatorname{arcsinh}(1/\sqrt{n^2-1})$ about CM points. The disks centred in the fundamental domain are labelled by their reduced forms $(a,b,c)$, and their weighted number is $H(N)$. For $n=7$ and $k=\Q(i)$: $H(48)=10/3$, from $(1,0,12)$, $(2,0,6)$, $(3,0,4)$ and $(4,4,4)$ with weight $1/3$. Filled disks are leopard spots; outlined ones are nested inside larger circles, often inside the cusp horodisk (grey). Faint background: the leopard-spot packing.} \label{fig:mult} \end{figure} \subsection{The other genera} When $n$ is not admissible, the forms of discriminant $-N$ still define circles. Their matrices lie in the larger set $\Lambda_{\rm tot}$ of matrices \eqref{eq:orbit} with $X\in O_k$ and $\det H=-1$, but have $X\equiv\xi\bmod\dd$ with $\xi^2=1$ and $\xi\ne\pm1$. These circles are the lifts of other totally geodesic surfaces, isometric to $F$. \begin{proposition}\label{prop:normalizer} Let $\mathfrak a$ be a product of distinct ramified primes, and let $\alpha_{\mathfrak a}$ be the product of the rational primes below them, so that $\mathfrak a^2=(\alpha_{\mathfrak a})$ with $\alpha_{\mathfrak a}$ a positive integer. Choose $M\in M_2(\mathfrak a)$ with $\det M=\alpha_{\mathfrak a}$. Then $\sigma=M/\sqrt{\alpha_{\mathfrak a}}$ normalizes $\SL(2,O_k)$ and preserves $\Lambda_{\rm tot}$. It multiplies the class of $X$ by a square root $\xi_{\mathfrak a}$ of $1$ modulo $\dd$. The local component of $\xi_{\mathfrak a}$ at a ramified prime is nontrivial (it is $-1$ at odd primes) exactly when the prime divides $\mathfrak a$. \end{proposition} \begin{proof} If $e,f$ generate $\mathfrak a$, then $e\mathfrak a+f\mathfrak a=\mathfrak a^2\ni\alpha_{\mathfrak a}$, so $eh_2-fh_1=\alpha_{\mathfrak a}$ for some $h_1,h_2\in\mathfrak a$, and $M=\bigl(\begin{smallmatrix}e&f\\h_1&h_2\end{smallmatrix}\bigr)$ will do. For $g\in\SL(2,O_k)$, $\sigma g\sigma^{-1}=Mg\operatorname{adj}(M)/\alpha_{\mathfrak a}$ has entries in $\mathfrak a^2/\alpha_{\mathfrak a}=O_k$, and the same holds for $\sigma^{-1}$. Write $\operatorname{adj}M=\bigl(\begin{smallmatrix}a'&b'\\c'&d'\end{smallmatrix}\bigr)$, with entries in $\mathfrak a$. The matrix of $\sigma$ applied to the circle of $H\in\Lambda_{\rm tot}$ is $H'=\operatorname{adj}(M)^*H\operatorname{adj}(M)/\alpha_{\mathfrak a}$, of determinant $-1$. Its diagonal entries have the form $(\sqrt{|D|}\,\alpha|x|^2+\sqrt{|D|}\,\gamma|y|^2+2\operatorname{Re}(iX\bar xy))/\alpha_{\mathfrak a}$ with $x,y\in\mathfrak a$; since $|x|^2,|y|^2\in\alpha_{\mathfrak a}\Z$ and $\bar xy\in\alpha_{\mathfrak a}O_k$, they lie in $\sqrt{|D|}\,\Z$. Its off-diagonal entry is $iX'$ with \[ X'=\bigl(X\bar a'd'-\bar X\bar c'b'-\sqrt D(\alpha\bar a'b'+\gamma\bar c'd')\bigr)/\alpha_{\mathfrak a}\in O_k . \] So $H'\in\Lambda_{\rm tot}$. Since $\bar c'b'/\alpha_{\mathfrak a}\in O_k$ and $\bar X\equiv X\bmod\dd$, we get $X'\equiv X\xi_{\mathfrak a}\bmod\dd$ with $\xi_{\mathfrak a}=(\bar a'd'-\bar c'b')/\alpha_{\mathfrak a}$. At a ramified prime $\mathfrak p\mid\mathfrak a$ with uniformizer $\pi_{\mathfrak p}$, this is congruent to $\bar\pi_{\mathfrak p}/\pi_{\mathfrak p}$, which is $-1$ for odd $p$ (take $\pi_{\mathfrak p}=\sqrt{-m}$) and the non-trivial square root of $1$ at $2$. At $\mathfrak p\nmid\mathfrak a$, $\alpha_{\mathfrak a}$ is a unit at $\mathfrak p$ and $\bar x\equiv x$ modulo the $\mathfrak p$-part of $\dd$, so $\xi_{\mathfrak a}\equiv\det(\operatorname{adj}M)/\alpha_{\mathfrak a}=1$. \end{proof} \begin{theorem}\label{thm:genus} Let $t$ be the number of primes dividing $D$, and $R$ the set of square roots of $1$ in $(O_k/\dd)^\times$ modulo $\pm1$; it has $2^{t-1}$ elements, the number of genera of forms of discriminant $D$ (and $2$ elements if $D=-4$). For each $\xi\in R$ the matrices with $X\equiv\xi$ are the lifts of one totally geodesic surface $F_\xi=\sigma(F)$, isometric to $F$. For every $n>1$ with $2n\in\Z$ and $N=4(n^2-1)/|D|\in\Z$, the forms of discriminant $-N$ (whose weighted number is $H(N)$) correspond to the common perpendiculars, of length $\operatorname{arccosh}n$, leaving $\pi$ on its upper side, from $F$ to the surface $F_\xi$, where $\xi$ is the class of $n$. \end{theorem} \begin{proof} Choose $\mathfrak a$ with $\xi_{\mathfrak a}=\xi$, by Proposition~\ref{prop:normalizer}; the local components show that every $\xi$ occurs. Then $\sigma$ carries $\Lambda=\Gamma\cdot H_{\Rhat}$ into the class $\xi$ part of $\Lambda_{\rm tot}$, and $\sigma^{-1}$, which is of the same kind, carries it back since $\xi^2=1$, and since it normalizes $\Gamma$ it induces an isometry of $M_k$ carrying $F$ to $F_\xi$. The rest is Lemma~\ref{lem:forms}. \end{proof} When $\mathfrak a$ is not principal, $F_\xi$ runs out into a cusp of $M_k$ of class $[\mathfrak a]$. For $k=\Q(\sqrt{-5})$, the even $n$ belong to the surface through the cusp at $(1+\sqrt{-5})/2$. \section{Counting, and Euler's identity in dimension three} \subsection{The count} In dimension two, the fractions $p/q$ index the common perpendiculars from a cusp neighbourhood of the modular surface to itself. Their count $\sum_{q\le Q}\varphi(q)\sim3Q^2/\pi^2$ is Euler's $\zeta(2)=\pi^2/6$ in disguise, and it is a special case of a general theorem: the number of common perpendiculars of length at most $t$ between two finite-volume totally geodesic or horospherical submanifolds of a hyperbolic $d$-manifold is asymptotic to an explicit constant times $e^{(d-1)t}$ \cite{ParkkonenPaulin2017,ParkkonenPaulinSurvey,BAPP2019}. Applying the same theorem to $F\subset M_k$, and counting the common perpendiculars by Theorem~A, gives the three-dimensional analogue. \begin{corollary}\label{cor:euler} For every imaginary quadratic field $k$ and every $\xi\in R$, with $n$ running over $\frac12\Z$, \[ \sum_{\substack{1