{"text":"\\section{Introduction}\nThe \\emph{Kepler} space telescope collected continuous photometric data for nearly 3.5 years from a small 0.25\\% patch of the celestial sphere \\citep{koc10,bor16}. This uniform monitoring of 150,000 stars enabled the discovery of over 4700 transiting exoplanet candidates through an automated detection pipeline \\citep{jen10}.\\footnote{\\url{https:\/\/exoplanetarchive.ipac.caltech.edu\/docs\/counts_detail.html}} Removing the human component from the signal vetting process ({\\tt Robovetter}; \\citealt{tho18}), enabled the first homogeneous transiting small planet sample suitable for exoplanet population studies. Through full automation, the sample completeness can be measured via transit injection\/recovery procedures \\citep{pet13b,chr15,dres15,chr17,chr20}. Here, artificial transit signals are injected into the raw light curves, enabling quantification of the pipeline's detection efficiency as a function of, for instance, the injection signal strength. In addition, the final \\emph{Kepler} catalog (DR25) also provided a measure of the sample reliability (the rate of false alarm signals) by testing the software's ability to remove systematics from the final catalog \\citep{cou17b}. \n\nWith these catalog measurements available, the underlying planet population can be extracted by correcting for the detection and orbital selection effects. Many studies have used \\emph{Kepler} automated planet catalogs to identify a remarkable surplus of sub-Neptunes and super-Earths at short periods (FGK Dwarfs: \\citealt{you11,how12,pet13b,muld18,hsu19,zin19,he19}; M Dwarfs: \\citealt{dres13,mui15,dres15,har19}), despite their absence in the solar system. Several other population features have been discovered using the \\emph{Kepler} catalog. For example, the apparent deficit of planets near the 1.5--$2 R_\\Earth$ range, colloquially known as the ``radius valley'' \\citep{ful17}. This flux-dependent population feature indicates some underlying formation or evolution mechanism must be at play, separating the super-Earth and sub-Neptune populations \\citep{owe17,gup18}. Nearly 500 multi-planet systems were identified in the \\emph{Kepler} data, enabling examination of intra-system trends. Remarkably, very minor dispersion in planet radii is observed within each system \\citep{cia13}. By examining the intra-system mass values from planetary systems that have measurable transit-timing variations (TTVs), a similar uniformity has been identified for planet mass \\citep{mil17}. Moreover, the orbital period spacing of planets appears far more compact than the planets within the solar system. These transiting multi-planet systems also appear to have relatively homogeneous spacing, indicative of an unvaried dynamic history. This combination of intra-system uniformity in orbital spacing and radii is known as the \"peas-in-a-pod\" finding \\citep{wei18}. \n\n\nOne of the main objectives of the \\emph{Kepler} mission was to provide a baseline measurement for the occurrence of Earth analogs ($\\eta_\\Earth$). Despite the scarce completeness in this area of parameter space, several studies have extrapolated from more populated regions, providing measurements ranging from 0.1--0.4 Earth-like planets per main-sequence star \\citep{cat11,tra12,pet13b,sil15,bur15,zin19b,kun20,bry20b}. Currently, it remains unclear what planet features are important for habitability, making precise measurements unattainable. Moreover, these extrapolations are model dependent and require a more empirical sampling of the Earth-like region of parameter space to reduce our uncertainty. Unfortunately, the continuous photometric data collection of the \\emph{Kepler} field was terminated due to mechanical issues on-board the spacecraft after 3.5 years, limiting the completeness of these long-period small planets.\n\nUpon the failure of two (out of four) reaction wheels on the spacecraft, the telescope was no longer able to collect data from the \\emph{Kepler} field, due to drift from solar radiation pressure. By focusing on fields (Campaigns) along the ecliptic plane, this drift was minimized, giving rise to the \\emph{K2} mission \\citep{how14, cle16}. Each of the 18 Campaigns were observed for roughly 80 days, enabling the analysis of transiting exoplanet populations from different regions of the local Galaxy. However, the remaining solar pressure experienced by the spacecraft still required a telescope pointing adjustment every $\\sim$6 hours. This drift and correction led to unique systematic features in the light curves, which the \\emph{Kepler} automated detection pipeline was not designed to overcome. As a result, all transiting \\emph{K2} planet candidates to date have required some amount of visual assessment. Despite this barrier, nearly 1000 candidates have been identified in the \\emph{K2} light curves (e.g., \\citealt{van16b,bar16,ada16,cro16,pop16,dres17,pet18,liv18,may18,ye18,kru19,zin19c}). However, this assortment of planet detections lacks the homogeneity necessary for demographics research. Attempts have been made to replicate the automation of the \\emph{Kepler} pipeline for \\emph{K2} planet detection \\citep[e.g.,][]{kos19,dat19}, but these procedures still required some amount of visual inspection. \\citet{zin20a} developed the first fully automated \\emph{K2} planet detection pipeline, using the {\\tt EDI-Vetter} suite of vetting metrics to combat the unique \\emph{K2} systematics. This pilot study was carried out on a single \\emph{K2} field (Campaign 5; C5 henceforth) and detected 75 planet candidates. The automation enabled injection\/recovery analysis of the stellar sample, providing an assessment of the planet catalog completeness. Additionally, the reliability (rate of false alarms) was quantified by passing inverted light curves---nullifying existing transit signals---through the automated procedure, analogous to what was done for the \\emph{Kepler} DR25 catalog. Any false candidates identified through this procedure are indicative of the underlying false alarm contamination rate. \n\n\\begin{figure*}\n\\centering \\includegraphics[width=\\textwidth]{kepStell.pdf}\n\\caption{The distribution of \\emph{Kepler} \\citep{ber20} and \\emph{K2} \\citep{hub16,har20} targets as a function of surface gravity ($\\log(g)$), effective stellar temperature ($T_\\textrm{eff}$) and stellar metallicity ([Fe\/H]). \n\\label{fig:HR}}\n\\end{figure*}\n\nWith corresponding measures of sample completeness and reliability for C5, \\cite{zin20b} carried out the first assessment of small transiting planet occurrence outside of the \\emph{Kepler} field, finding a minor reduction in planet occurrence in this metal-poor FGK stellar sample. This provided evidence that stellar metallicity may be linked to the formation of small planets; however, the weak trend detected requires additional data for verification. \n\n\n\nThis paper is a continuation of the Scaling \\emph{K2} series \\citep{har20,zin20a,zin20b}, which aims to leverage \\emph{K2} photometry to expand our exoplanet occurrence rate capabilities and disentangle underlying formation mechanisms. The intent of this study is to derive a uniform catalog of \\emph{K2} planets for all 18 Campaigns (with exception to C9, which observed the crowded galactic plane, and C19, which suffered significantly from low fuel levels), and provide corresponding measurements of the sample completeness and reliability. The underlying target sample and the corresponding stellar properties are discussed in Section \\ref{sec:stellarSample}. \nIn Section \\ref{sec:pipe} we outline the automated pipeline implemented in our uniform planet detection routine. We then procure a homogeneous planet sample and consider the interesting candidates and systems in Section \\ref{sec:catalog}. In Sections \\ref{sec:complete} and \\ref{sec:reli} we provide the corresponding measures of sample completeness and reliability for this catalog of transiting \\emph{K2} planet candidates. Finally, we offer suggestions for occurrence analysis and summarize our findings in Sections \\ref{sec:suggest} and \\ref{sec:summary}. \n\n\n\\section{Target Sample}\n\\label{sec:stellarSample}\n\n\n\nWe first downloaded the most up-to-date raw target pixel files (TPFs) from MAST\\footnote{\\href{https:\/\/archive.stsci.edu\/k2\/}{https:\/\/archive.stsci.edu\/k2\/}}, which recently underwent a full reprocessing using a uniform procedure \\citep{cad20}. To ensure consistency among our data set, we used the final data release (V9.3) for all available campaigns considered in this paper.\\footnote{C8, C12, and C14 were released after our analysis was performed. Thus, a previous version (V9.2) was used for this catalog. Overall, we expect the differences to be minor and leave inclusion of these updated TPFs for future iterations of the catalog.} We began our search using the entire EPIC target list (381,923 targets; \\citealt{hub16}). Of this list, we found 212 targets have FITS file issues our software could not rectify. For all remaining targets we used the {\\tt K2SFF} aperture \\#15 \\citep{van16b}, which is derived from the \\emph{Kepler} pixel response function and varies in size in accordance with the target's brightness. Circular apertures exceeding $10\\arcsec$ radii are prone to significant contamination from nearby sources. Our vetting software, {\\tt EDI-Vetter}, is able to account for this additional flux, but the software's accuracy begins to decay beyond a radius of $20\\arcsec$. Additionally, large apertures have a tendency to contain multiple bright sources, providing further complications. To address this issue, we put an upper limit on the target aperture size (79 pixels; $\\sim20\\arcsec$ radius). This cut removed 4548 targets that have apertures we deemed too large. Of these rejected targets, 492 are in Campaign 11, which contains the crowded galactic bulge field. After applying these cuts, 377,163 targets remained and were then used as our baseline stellar sample.\n\n\n\\begin{figure*}\n\\centering \\includegraphics[height=7cm]{K2_Galaxy.png}\n\\caption{The galactic distribution of \\emph{K2} target stars. The disk structure follows the interpretation provided by \\cite{hay15}. The thick disk consists of stars with a heightened abundance of $\\alpha$-chain elements (O, Ne, Mg, Si, S, Ar, Ca, and Ti) compared to the stars in the thin disk \\citep{wal62}. Additionally, the $\\alpha$-poor disk begins to flare up beyond the solar neighborhood. The galactic coordinates presented here have been calculated using \\emph{Gaia} DR2 \\citep{gai18}.\n\\label{fig:galaxy}}\n\\end{figure*}\n\nTo parameterize this list of targets we relied on the values derived by \\cite{har20}, which used a random forest classifier, trained on LAMOST spectra \\citep{su04}, to derive stellar parameters from photometric data (222,088 unique targets). Additionally, the available \\emph{Gaia} DR2 parallax information was incorporated to significantly improve our understanding of the stellar radii. From this catalog, additional measurements of stellar mass, metallicity, effective temperature ($T_{\\text{eff}}$), and surface gravity ($\\log(g)$) were provided and used in this study. In cases where stellar parameters were not available in \\cite{har20} (typically due to their absence in the \\emph{Gaia} DR2 catalog or not meeting strict photometric selection criteria), we used the stellar parameters derived for the EPIC catalog \\citep{hub16} (94,769 targets). Finally, we used solar values for targets that lack parameterization in both catalogs (41,061 targets).\\footnote{\\cite{zin20b} showed that systematic differences between stellar catalogs are minor. Additionally, we emphasize our pipeline's agnosticism to stellar parameterization.}\n\n\nExcluding the 41,061 targets without stellar parameters, we isolated 223,075 stars that appear to be main-sequence dwarfs based on their surface gravity ($\\log(g)>4$). Within this subset we identified 48,702 targets as M dwarfs ($T_{\\text{eff}}<4000K$), 164,569 as FGK dwarfs ($40006500K$). This abundance of M dwarfs is nearly 17 times that of the \\emph{Kepler} sample (2808 M dwarfs; \\citealt{ber20}) and can be clearly seen in Figure \\ref{fig:HR}. Another noteworthy feature of the \\emph{K2} stellar sample is the wide range of galactic latitudes covered by the 18 campaigns. This enabled \\emph{K2} to probe different regions of the galactic sub-structure. In contrast, a majority of the \\emph{Kepler} stellar sample was bounded within the thin disk (see Figure 1 of \\citealt{zin20b} for a comparison). In Figure \\ref{fig:galaxy} we show this galactic sub-structure span for \\emph{K2}. Making broad cuts in galactic radius ($R_g$) and height ($b$) we can distinguish thick disk ($R_g<8$kpc and $|b|>0.5$kpc) from thin disk stars ($|b|<0.5$kpc). Overall, we found 191,002 dwarfs located in the thin disk, while 17,123 dwarfs reside in the thick disk. This sample distinction is interesting and may warrant further consideration in future occurrence studies.\n\n\nThe underlying stellar sample is important because it is the population from which the planet candidates are drawn. However, the stellar parameters are subject to change as more comprehensive data and more precise measurements become available (i.e., the upcoming \\emph{Gaia} DR3). To ensure our catalog remains relevant upon improved stellar parameterization, we take an agnostic approach to the available stellar features throughout our pipeline. In other words, each light curve is treated consistently regardless of the underlying target parameters. The only caveat to this claim is our treatment of the transit limb-darkening. Our transit model fitting routine requires quadratic limb-darkening parameters. We derived the appropriate values using the ATLAS model coefficients for the \\emph{Kepler} bandpasses \\citep{cla12}, in concert with the available stellar parameters. This minor reliance on our measured stellar values will have negligible effects on the presented catalog. In the case where a signal is transiting with a high impact parameter, this limb darkening choice can be important, modifying the inferred radius ratio by an order of 1\\%. However, this boundary case is well within the uncertainty of our measured radius ratio values ($\\sim4\\%$) and therefore not significantly impacting our inferred radius measurements. All other detection and vetting metrics in our pipeline are independent of this parameterization. \n\n\n\n\\section{The Automated Pipeline}\n\\label{sec:pipe}\nOur automated light curve analysis pipeline consists of four major components: pre-processing, detrending, signal detection, and signal vetting. In Figure \\ref{fig:diagram} we provide a visual overview of this procedure, and now briefly summarize the execution of each step.\n\n\\begin{figure}\n\\centering \\includegraphics[width=\\columnwidth{}]{figureDiagramsmall.pdf}\n\\caption{ An overview schematic of the automated detection pipeline used in the current study to identify \\emph{K2} planet candidates. This follows the same procedure described in \\cite{zin20a}. The effects of pre-processing and detrending have also been depicted for EPIC 211422469, illustrating the importance of the corresponding steps. \n\\label{fig:diagram}}\n\\end{figure}\n\n\\subsection{Pre-Processing}\nThe raw flux measurements from \\emph{K2} are riddled with systematic noise components due to the thruster firing approximately every six hours (required to re-align the telescope pointing) and the momentum dumps every two days. This spacecraft movement smears the target across several different pixels, all with unique noise and sensitivity properties, leading to a significant increase in the overall light curve noise. We passed all raw light curves through the {\\tt EVEREST} software \\citep{lug16,lug18}, which minimizes this flux dispersion issue using pixel-level decorrelation (PLD) to fit and remove noise attributed to the spacecraft roll. In Figure \\ref{fig:diagram} we show how {\\tt EVEREST} reduces the noise, as measured by the root mean-square (RMS), of the EPIC 211422469 light curve by a factor of four. However, this pre-processing also has the ability to reduce transit signals or remove them completely. Thus, it is essential that any injection\/recovery tests address this concern by injecting signals into the data before this pre-processing, as we later discuss in Section \\ref{sec:complete}.\n\n\n\n\\subsection{Detrending}\nIn the example light curve for EPIC 211422469 (Figure \\ref{fig:diagram}) there is a clear long-term trend remaining in the data after pre-processing. The goal of detrending is to remove this red-noise component and any stellar variability, producing a clean, white-noise dominated, time series. We used two Gaussian process (GP) models, with ``rotation'' kernels, to remove these long- and medium-term trends. These kernels use a series of harmonics to match and remove periodic and red-noise trends in the photometry. The first pass GP looked for general flux drifting (periods $>10$ days), subtracting the appropriate model. The second pass GP identified and removed medium-term trends (5 days $<$ period $<10$ days) often associated with stellar variability. In testing, we found these two GP passes were effective in removing red-noise from the data without significantly impacting transit signals. The Ljung-Box test (a portmanteau test for all autocorrelation lags; \\citealt{lju78}) found that $67\\%$ of our processed light curve residuals produced p-values greater than 0.001, indicating a lack of statistically significant short-term correlated structure. However, stellar harmonics with short periods (usually $<0.5$ days) continued to contaminate the remaining 33\\% of our light curves. To address these trends we fit and removed sine waves with periods less than $0.5$ days. These signals are all below the 0.5 period requirement threshold for planet candidacy, but still have the ability to contaminate the light curve. In an effort to minimize over-fitting, we required the signal amplitude to be at least $10\\sigma$ in strength. If this requirement was not met, the harmonic removal was not applied. \n\nThe period limits used for both the GP models and the harmonic fitter attempted to preserve transit signals, avoiding periods which are prone to transit removal (0.5 days $<$ period $<5$ days). Unfortunately, some stellar variability exists in this forbidden period range, making it difficult to address every unique situation. Using an auto-regressive integrated moving average algorithm (as suggested by \\citet{cac19a,cac19b}) may reduce some of these remaining correlated residuals, but this methodology also has limitations in dealing with stellar variability and is beyond the scope of this paper.\n\nIn addition, these detrending mechanisms are capable of reducing or (in the case of very deep transits) removing the signal altogether (i.e., the \\emph{Kepler} harmonic removal highlighted by \\citealt{chr13}).We acknowledge these costs in performing our automated detrending procedure, knowing the effects will be accounted for in our catalog completeness measurements (see Section \\ref{sec:complete}). \n\n\\subsection{Signal Detection}\nOnce the light curve has been scrubbed with our pre-processing and detrending routine, the flux measurements can be examined for transit signals with {\\tt TERRA} \\citep{pet13b}. This algorithm uses a box shape to look for dips in the light curve, enabling a quick examination of each target. To measure the signal strength we rely on the same metric used for the \\emph{Kepler} transiting planet search (TPS), the multiple event statistic \\citep[MES;][]{je02}, which assumes a linear ephemeris to indicate the strength of the whitened signal. For our detection threshold we require a signal MES value greater than $8.68\\sigma$. This threshold, which is higher than that of the \\emph{Kepler} TPS ($7.1\\sigma$), was arbitrarily selected to reduce the total signal count to 20\\% of our total target sample. We also bound the period search of {\\tt TERRA}, ranging from 0.5 days to a period where three transits could be detected (nominally 40 days, varying slightly from campaign to campaign). Any signal above our MES threshold and between these period ranges is given the label of threshold-crossing event (TCE). \n\n\n\\subsubsection{Multi-planet systems}\n\nMulti-planet systems are rich in information, but require careful consideration when attempting to identify these asynchronous signals. Ideally, a model of the first detected signal would be fit and subtracted from the light curve before re-searching the data for additional signals. However, real data are noisy, making such a task difficult to automate. Should the signal be incorrectly fit, the model subtraction will leave significant residuals, which will continuously trigger a detection upon reexamination. Moreover, false positives that do not fit the transit model will also leave significant residuals. Finally, astrophysical transit timing variations (TTVs) are not easily accounted for in an automated routine \\citep{wu13,had14,had17}. Thus, deviations from simple periodicity will leave significant residuals. Dealing with these complex signals, without loss of data, remains a point of continuous discussion (e.g. \\citealt{sch17}).\n\nAs was done in many previous pipelines, we relied on masking of the signal after each iterative TCE detection \\citep{jen02,dres15,sin16,kru19,zin20a}. This method has its own faults, as it requires some photometry to be discarded upon each signal detection. \\citet{zin19} showed that this $3\\times$ the transit duration removal has the ability to make multi-planet systems more difficult to detect. To mitigate this loss of data, we used a mask of $2.5\\times$ the transit duration ($1.25\\times$ the transit duration on either side of the transit midpoint) after each signal was detected. At this point the light curve was reexamined for an additional signal. This process was repeated six times or until the light curve lacked a TCE, enabling this pipeline to detect up to six planet systems.\n\n\\subsubsection{Skye Excess TCE Identification}\n\n\\begin{figure}\n\\centering \\includegraphics[width=\\columnwidth{}]{Skyplot_C04.pdf}\n\\caption{ An illustration of the Skye excess TCE identification process for Campaign 4. The expected white noise range for this number of cadences is plotted in green ($3.63\\sigma$). The median number of TCEs is shown by a central blue dotted line. We highlight the rejected cadences with a red x. These 16 cadences exceed the Skye excess limit and are masked in our final signal search. \n\\label{fig:sky}}\n\\end{figure}\n\nCertain cadences are prone to triggering TCEs within the population of light curves. These can usually be attributed to spacecraft issues and are likely not astrophysical. Inspired by the ``Skye'' metric used in \\citet{tho18}, we minimized this source of contamination by considering the total number of TCEs with transits that fall on each cadence. The median value and expected white noise range was then calculated using:\n\n\\begin{equation}\n\\sqrt{2}\\; \\text{erfcinv}(1\/N_{\\text{cad}}) \\; \\sigma,\n\\label{eq:sky}\n\\end{equation}\nwhere erfcinv is the inverse complementary error function, $N_{\\text{cad}}$ is the total number of cadences in the campaign, and $\\sigma$ is the median absolute deviation in the number of TCEs detected at each cadence. This calculated value represents the largest deviation expected from this number of cadences under the assumption of perfect Gaussian noise. Any cadences that exceed this limit are likely faulty and warrant masking. In Figure \\ref{fig:sky} we provide an example of this procedure for Campaign 4. To further assist future studies we made the Skye mask for each campaign publicly available.\\footnote{\\href{http:\/\/www.jonzink.com\/scalingk2.html}{http:\/\/www.jonzink.com\/scalingk2.html}}\n\nOnce established, the Skye mask was used to reanalyze all light curves, removing problematic cadences. The resulting list of significant signals were then given the official TCE label and allowed to continue through our pipeline. Overall, we found 140,046 TCEs from 52,192 targets. However, a vast majority of these signals are false positives and required thorough vetting.\n\n\n\\subsection{Signal Vetting}\nTo parse through the 140,046 TCEs and identify the real planet candidates, we employed our vetting software {\\tt EDI-Vetter} \\citep{zin20a}. This routine builds upon the metrics developed for the \\emph{Kepler} TPS ({\\tt RoboVetter}; \\citealt{tho18}), with additional diagnostics created to address \\emph{K2} specific issues (i.e., the systematics caused by the spacecraft). These metrics attempt to replicate human vetting, by looking for specific transit features used to discern false positive signals. We now briefly discuss our planet candidacy requirements, but encourage readers to refer to \\citet{zin20a} for a more thorough discussion. \n\n\n\n\\subsubsection{Previous Planet Check}\nThis test looks to identify duplicate signals in the light curve (as originally discussed in Section 3.2.2 of \\citealt{cou16}). This test was only applied if the light curve produced more than one TCE. In such cases, the period and ephemeris were tested to ensure the second signal was truly unique. If not, this repeat identification was labeled a false positive. The goal of this test was to remove detections of the previous signal's secondary eclipse and signals that were not properly masked, leading to their re-detection.\n\n\\subsubsection{Binary Blending}\n\\label{sec:bblend}\nThe goal of this metric is to remove eclipsing binary (EB) contaminants from our catalog. There are two attributes that make EB events unique from planet transits: a deep transit depth and a high impact parameter ($b$). Leveraging these two features, we used the formula first derived by \\citet{bat13} and then modified by \\cite{tho18} to identify these contaminants, while remaining agnostic to the underlying stellar parameters:\n\n\\begin{equation}\n\\frac{R_{pl}}{R_\\star} + b\\le 1.04,\n\\label{eq:EB}\n\\end{equation}\nwhere $R_{pl}\/R_{\\star}$ represents the ratio of the transiting planet and the stellar host radii. Should this metric be exceeded, the TCE would be flagged as a false positive, removing most EBs from our sample.\n\nHowever, this diagnostic assumes the transit depth provides an accurate measure of $R_{pl}\/R_{\\star}$. If an additional source is within the target photometric aperture, the depth of the transit can be diluted by this additional flux, leading to an underestimation of $R_{pl}\/R_{\\star}$. To address this potential flux blending issue, we cross-referenced our target list against the \\emph{Gaia} DR2 catalog \\citep{gai18}. If an additional source is in or near the aperture, we calculated the expected flux contamination using available photometry from \\emph{Gaia} and \\emph{2MASS} \\citep{skr06}, correcting the $R_{pl}\/R_{\\star}$ value accordingly. If Equation \\ref{eq:EB} was not satisfied, the TCE was labeled as a false positive.\n\nOur inferred flux dilution correction assumed the signal in question originated from the brightest source encased by the target aperture. \\footnote{This assumption was enforced by our pipeline, which selected the brightest \\emph{Gaia} target within the aperture.} Therefore, transits emanating from a dimmer background star would experience a greater flux dilution and could avert this metric. We provide further discussion of this potential contamination rate in Section \\ref{sec:astrFP}.\n\n\n\\subsubsection{Transit Outliers}\nThis diagnostic was developed to deal with systematics specific to \\emph{K2}. We expect real candidates to produce dips in the stellar flux, but retain comparable light curve noise properties during the eclipse. In contrast, systematic events can produce a dip with noise properties independent of the light curve, producing a heightened RMS during the event. By measuring the RMS in and out of transit, we can identify significant changes, and flag signals that have false positive-like RMS properties.\n\n\\subsubsection{Individual Transit Check}\n\\label{sec:ITC}\nUsing the formalism developed by \\citet{mul16} (the ``Marshall'' test), we look to identify individual transit events that appear problematic. If one of the transits is either dominating the signal strength or does not fit a transit profile appropriately, it is indicative of a systematic false alarm. By fitting each individual transit signals with any of the four common systematic models (Flat, Logistic, Logistic-exponential, or Double-logistic), we looked for events that did not have an astrophysical origin. If an individual transit fit a systematic model better, that transit was masked and the light curve was re-analyzed to ensure the signal MES still remained above the $8.68\\sigma$ threshold before proceeding. In addition, we made sure the total signal strength is spread evenly among each observed transit. In cases where a single event dominated the signal strength, the TCE was labeled as a false positive. \n\n\\subsubsection{Even\/Odd Transit Test}\nThis vetting test looks for EBs that produce a strong secondary eclipse (SE). In some cases these SEs can be deep enough to trigger a signal detection at half the true period, folding the SE on top of the transit. To identify such contaminants, we separated every other individual transit into odd and even groups. We then re-fit the transit depth within each group and looked for significant discrepancies. In cases where the disparity is greater than $5\\sigma$, the signal was labeled as a false positive.\n\n\\subsubsection{Uniqueness Test}\nThis diagnostic is based on the ``model-shift uniqueness test'' \\citep{row15, mul15, cou16, tho18} and compares the noise profile of the folded light curve with that of the TCE in question. If the folded light curve contains several transit-like features, it is indicative of a systematic false alarm. We compared the strength of the next largest dip, beyond the initial signal and any potential secondary eclipse, in the phase-folded data to the transit in question, assessing the uniqueness and significance of the periodic event. If another similar magnitude dip existed in the folded time series, it likely originated from light curve noise and the TCE was deemed a false positive. \n\n\n\n\\subsubsection{Check for Secondary Eclipse}\nFollowing the methodology presented in Section A.4.1.2 and A.4.1.3 of \\citet{tho18}, we examined the transit signal for a secondary eclipse (SE). As previously noted, deep SE signals are a notable signature of an EB. However, some hot Jupiters are also capable of producing a SE, therefore detection of a SE is not in itself justification for exclusion. TCEs with a meaningful SE must exhibit a transit impact parameter of less than 0.8 or the SE must be less than 10\\% of the transit depth. If neither of these criteria were satisfied, the TCE was labeled as a false positive.\n\n\\subsubsection{Ephemeris Wandering}\nHarmonic signals have the ability to falsely trigger a TCE detection, but their inability to match the transit model leads to significant movement of the measured ephemeris. If the signal's transit mid-point, as detected by {\\tt TERRA}, changed by more than half the transit duration when optimized with our MCMC routine, the TCE earned a false positive label. \n\n\\subsubsection{Harmonic Test}\nIn addition to the ephemeris wandering metric, we also attempted to fit the light curve with a sine wave at the period of the detected TCE. If the amplitude of this harmonic signal was comparable to the TCE depth, or the strength of the harmonic signal was greater than $50\\sigma$, the TCE received a false positive label. To avoid misclassification due to period aliasing, we examined periods of $2\\times$ and $\\frac{1}{2}\\times$ the TCE. Additionally, harmonic signals tend to trigger TCEs with long transit durations, which often correspond to the sine wave period. Therefore, we also tested harmonics with periods equaling $1\\times$, $2\\times$, and $3\\times$ the transit duration. If any of the examined phases exceeded our harmonic metric threshold, the TCE achieved a false positive label.\n\n \n\n\n\n\\subsubsection{Phase Coverage Test}\nIt is important that the transit signal has good phase coverage with the available \\emph{K2} data. In certain cases, a few outlier points can be folded, near an integer multiple of the \\emph{K2} cadence, and trigger a TCE. These limited data signals are not meaningful and warrant a false positive label. In addition, the masking applied by our automated pipeline may remove large fractions of the TCE. To ensure we have good signal phase coverage, we examined the gap sizes in the phase folded light curve. If large portions (more than roughly 30 mins.) of photometry are missing during ingress or egress, we labeled these signals as false positives. \n\n\n\n\\subsubsection{Period and Transit Duration Limits}\nWe limit the {\\tt TERRA} software to period ranges beyond 0.5 days. However, this search algorithm is still able to identify periodic signals just below this user defined threshold.\\footnote{This phenomenon is due to the method in which {\\tt TERRA} steps through period space, moving in cadence integers until it exceeds the period limits.} These boundary case signals are usually astrophysical false positives and are difficult to distinguish from real planet candidates. Thus, we remove any TCEs with periods less than 0.5 days. Furthermore, we imposed a strict limit on the transit duration. If the TCE transit duration was greater than 10\\% of the period of the signal, we deemed it a false positive, as these signals are often misidentified harmonics. Moreover, a transiting signal with a duration that exceeds this limit would represent a planet orbiting within three times the radius of the host star for a short period eclipsing binary. Thus, removing these signals improves the purity of our sample.\n\n\n\\subsubsection{Period Alias Check}\nMis-folding a real transiting signal on an integer multiple of the true signal period will trigger many of the previously described false positive flags. To avoid this misclassification we tested period factors of $2\\times$, $\\frac{1}{2}\\times$, $3\\times$, and $\\frac{1}{3}\\times$ against the original signal. If any of the alternative models produced a likelihood value greater than 1.05 times the original period fit, we reran the entire vetting analysis, using the new corrected period.\n\n\\subsubsection{Ephemeris Match}\nDeep transit signals from bright sources (the parent) can pollute neighboring target apertures (the child) and produce transit artifacts. These signals can be identified by their nearly identical period and ephemeris measurements. We followed the procedures of \\citet{cou14b} and Section A.6 of \\citet{tho18} to identify these false positives, testing our candidate list against itself and our full TCE sample, ensuring previously rejected deep eclipsing binary signals were considered.\n\nWith an ephemeris match it is important to deduce the signal's true origin, since both the parent and child targets will be identified by the matching algorithm. It is expected that the child signal will be significantly polluted by stray starlight, reducing the expected transit depth. Thus, we assign parenthood to the target with the largest transit depth signal and label all additional matches as false positives.\n\nOverall, the implementation of the ephemeris match vetting metric only reduced our catalog by $\\sim2\\%$, considerably less than the $\\sim6\\%$ reduction found for the \\emph{Kepler} DR25. This discrepancy can be attributed to the \\emph{Kepler} field's higher target density, which was dominated by faint stars that are more susceptible to this type of false positive. Therefore, the increased average brightness of \\emph{K2} targets and the reduced target density, explain this reduction in ephemeris matches. \n\n\\begin{figure*}\n\\centering \\includegraphics[height=6.5cm]{hostStarBright.pdf}\n\\caption{The brightness and planet radius distributions of the \\emph{Kepler} and \\emph{K2} host stars, colored by host star effective temperature. The left panel shows the \\emph{Kepler} candidates as described in \\cite{ber20} and the right panel shows the catalog presented in this paper. \\emph{K2} targets tend to be slightly brighter---with larger planets, due to the reduced completeness---than \\emph{Kepler} targets, making them better candidates for follow-up surveys. \n\\label{fig:host}}\n\\end{figure*}\n\n\\subsubsection{Consistency Score}\nFinally, if the TCE passed all of the described vetting diagnostics without achieving a false positive flag, the light curve was reanalyzed---including detrending and signal detection---50 times. This final test measures the stochastic nature of the detrending and the MCMC parameter estimation. Any signal near one of the vetting thresholds would likely be pushed over during these reexaminations. The consistency score was then calculated as the number of times a given TCE was able to pass all the vetting metrics over the number of times tested. Any TCE able to achieve a consistency score greater than 50\\% was granted planet candidacy. Of the 1046 TCEs that initially passed all the {\\tt EDI-Vetter} thresholds, 806 met this final consistency requirement. \n\n\n\n\\section{The Planet Catalog}\n\\label{sec:catalog}\nUsing our fully automated pipeline, we achieved a sample of \\emph{K2} transiting planets suitable for demographics. Within this catalog we found:\n\\begin{itemize}\n \\item 806 transit signals\n \\item 747 unique planet candidates\n \\item 57 multi-planet candidate systems (113 candidates)\n \\item 366 newly detected planet candidates\n \\item 18 newly identified multi-planet candidate systems (38 candidates).\n\\end{itemize}\nThe majority of new candidates were found in campaigns not exhaustively searched (C10-18), with a few new candidates identified with low MES in early campaigns. Of the 806 transiting signals identified, 51 signals were detected in multiple, overlapping, campaigns. In the subsequent sections we discuss how the parameters of the planets were derived and the unique systems and candidates found in this catalog. \n\n\n\\subsection{Planet Parameterization}\nTo maintain the homogeneity of our sample, we used an automated routine to fit and estimate the planet and orbital features. As discussed in Section \\ref{sec:stellarSample} we assume the stellar parameters derived by \\citet{har20}, but found 130 of the 747 detected planets did not have stellar characterization available. Fortunately, our pipeline is agnostic to changes in stellar features, enabling subsequent parameter revision. To avoid the assumption of solar values and provide the most current stellar parameters, we used the \\citet{har20} methodology, equipped with APASS (DR9; \\citealt{hen16}) and SkyMapper \\citep{onk19} photometry, to characterize 59 of the remaining host stars. The final 71 targets, which did not have the necessary photometric coverage and\/or parallax measurements for the aforementioned classification, were parameterized using the {\\tt iscochrones} stellar modeling package \\citep{mor15},\\footnote{In order to maintain stellar parameter uniformity we ran the other 628 planet hosts through {\\tt isochrones}. We fit a linear offset on these targets between our parameters and the {\\tt isochrones} parameters, and applied these offsets to the 71 {\\tt isochrones}-only targets.} ensuring all planets in our catalog have corresponding stellar measurements. Using the {\\tt emcee} software package \\citep{goo10, for13}, we measured the posterior distribution of the transiting planet parameters: The ephemeris, the radius ratio, the transit impact parameter, the period, the semi-major axis to stellar radius ratio (apl), the transit duration (tdur), and the vetting consistency score (score). These values were all derived under the assumption of circular orbits. Furthermore, we provide diagnostic plots for each candidate. In Figure \\ref{fig:newExample} we show an example plot for a new sub-Neptune (EPIC 211679060.01), enabling swift visual inspection. However, it is important to clarify that all planets in our sample have been detected through our fully automated pipeline. These plots are only meant to help prioritize follow-up efforts. Figure \\ref{fig:host} shows how the distribution of \\emph{K2} host targets is skewed toward brighter stars, compared to the \\emph{Kepler} candidate hosts, enabling follow-up efforts for a majority of our catalog. \n\n\nWith careful consideration of the transit radius ratio ($R_{fit}$), the planet radius can be extracted. $R_{fit}$ is directly measured by the MCMC routine, but estimates of the true planet radii ($R_{pl}$) required we take into account the stellar radii measurements ($R_{\\star}$) and potential contamination from nearby sources ($\\frac{F_{total}}{F_{\\star}}$). To attain our best estimate we used the following procedure:\n\\begin{equation}\nR_{pl} =R_{\\textrm{fit}}\\; R_{\\star}\\; \\sqrt{\\frac{F_{\\textrm{total}}}{F_{\\star}}},\\\\\n\\end{equation}\n where $\\frac{F_{total}}{F_{\\star}}$ was calculated using the \\emph{Gaia} DR2 stellar catalog to identify contaminants in and near the photometric aperture and a Gaussian point-source function was implemented to estimate the corresponding magnitude of contamination. \\footnote{We do not impose an upper $R_{pl}$ limit in our catalog, retaining our stellar parameter agnosticism. Therefore, 28 candidates exceed $30R_{pl}$. We provide suggestions for dealing with these candidates in Section \\ref{sec:summary}.} In addition to the aforementioned flux complications, \\cite{zin20a} also showed that the required detrending of \\emph{K2} photometry underestimates the radius ratio by a median value of 2.3\\%. We did not adjust our estimates of the planet radius to reflect this tendency, as the mode of this distribution indicated a majority of the measured radii ratios are accurate (see Figure 14 of \\citealt{zin20a}). However, we increased the uncertainty in our planet radius measurements to account for this additional detrending complication. The overall planet radius uncertainty ($\\sigma_R$) was calculated by assuming parameter independence and adding all of these relevant factors in quadrature,\n\\begin{equation}\n\\begin{aligned}[t]\n\\sigma_R &= \\sqrt{\\sigma_{\\textrm{fit}}^2+\\sigma_{\\star}^2+\\sigma_F^2+\\sigma_{\\textrm{Off}}^2} \\;,& \\textrm{where}\\\\\n\\sigma_{\\textrm{Off}} & = 0.023\\; R_{pl} & \\textrm{and}\\\\\n\\sigma_F & = R_{pl}\\;\\frac{F_{\\textrm{total}}-F_{\\star}}{3.76\\; F_{\\textrm{total}}}\\;. &\n\\end{aligned}\n\\end{equation}\nHere, $\\sigma_{\\textrm{Off}}$ and $\\sigma_F$ represent the uncertainty due to detrending and flux contamination respectively (see Section 8.2 of \\citealt{zin20a} for a thorough explanation and derivation of these parameters). Despite these additional contributions, the majority of uncertainty stems from the radius ratio fit ($\\sigma_{\\textrm{fit}}$; $\\sim4\\%$) and the stellar radius measurement ($\\sigma_{\\star}$; $\\sim6\\%$). For most targets $\\sigma_F$ contributes of order $10^{-3}\\%$ uncertainty, however, the most extreme candidate (EPIC 247384685.01) had a measured $F_{\\star}$ that is only 70\\% of $F_{\\textrm{total}}$, contributing an additional $7\\%$ uncertainty to the radius measurements.\n\n\\begin{figure}\n\\centering \\includegraphics[width=\\columnwidth{}]{211679060.pdf}\n\\caption{A sample diagnostic plot for EPIC 211679060.01; the remaining candidate plots are available \\href{http:\/\/www.jonzink.com\/scalingk2.html}{online}. This planet is a new sub-Neptune found in C18. The grey points represent the light curve data used to extract the signal. The purple points show the binned average (with a bin width equal to 1\/6 the transit duration). \\label{fig:newExample}}\n\\end{figure}\n\n\n\n\\begin{deluxetable*}{lcc}\n\\tablecaption{The homogeneous catalog of \\emph{K2} planet candidates and their associated planet and stellar parameters. The visual inspection flags were manually assigned to help prioritize follow-up efforts. These indicators had no impact on the analysis performed by this pipeline. The known planet (KP) flag indicates a confirmed or validated planet. The planet candidate (PC) flag identifies an unconfirmed candidate and the low priority planet candidate (LPPC) flag designates a weak or more difficult to validate candidate. Finally, the false positive (FP) flag specifies candidates that are likely not planets. \\label{tab:catalog}}\n\\tablehead{\\colhead{Column} & \\colhead{Units} & \\colhead{Explanation}} \n\\startdata\n1 & --- & EPIC Identifier \\\\\n2 & --- & Campaign \\\\\n3 & --- & Candidate ID\\\\\n4 & --- & Found in Multiple Campaigns Flag \\\\\n5 & --- & Consistency Score \\\\\n6 & d & Orbital Period \\\\\n7 & d & Lower Uncertainty in Period \\\\\n8 & d & Upper Uncertainty in Period \\\\\n9 & --- & Planetary to Stellar Radii Ratio \\\\\n10 & --- & Lower Uncertainty in Ratio \\\\\n11 & --- & Upper Uncertainty in Ratio \\\\\n12 & $R_\\earth$ & Planet radius ($R_{pl}$) \\\\\n13 & $R_\\earth$ & Lower Uncertainty in $R_{pl}$ \\\\\n14 & $R_\\earth$ & Upper Uncertainty in $R_{pl}$ \\\\\n15 & d & Transit ephemeris ($t_0$) \\\\\n16 & d & Lower Uncertainty in $t_0$ \\\\\n17 & d & Upper Uncertainty in $t_0$ \\\\\n18 & --- & Impact parameter (b) \\\\\n19 & --- & Lower Uncertainty in b \\\\\n20 & --- & Upper Uncertainty in b \\\\\n21 & --- & Semi-major Axis to Stellar Radii Ratio ($a\/R_\\star$) \\\\\n22 & --- & Lower Uncertainty in $a\/R_\\star$ \\\\\n23 & --- & Upper Uncertainty in $a\/R_\\star$ \\\\\n24 & d & Transit Duration \\\\\n25 & $R_\\sun$ & Stellar Radius ($R_\\star$) \\\\\n26 & $R_\\sun$ & Lower Uncertainty in $R_\\star$ \\\\\n27 & $R_\\sun$ & Upper Uncertainty in $R_\\star$ \\\\\n28 & $M_\\sun$ & Stellar Mass ($M_\\star$) \\\\\n29 & $M_\\sun$ & Lower Uncertainty in $M_\\star$ \\\\\n30 & $M_\\sun$ & Upper Uncertainty in $M_\\star$ \\\\\n31 & K & Stellar Effective Temperature ($T_\\textrm{eff}$) \\\\\n32 & K & Uncertainty $T_\\textrm{eff}$ \\\\\n33 & dex & Stellar Surface Gravity (log(g)) \\\\\n34 & dex & Uncertainty log(g) \\\\\n35 & dex & Stellar Metallicity [Fe\/H] \\\\\n36 & dex & Uncertainty [Fe\/H] \\\\\n37 & --- & Stellar Spectral Classification \\\\\n38 & --- & Visual Inspection Classification \\\\\n\\enddata\n\\tablecomments{This table is available in its entirety in machine-readable form.}\n\\end{deluxetable*}\n\nWe provide our list of planetary parameters for this catalog with corresponding measurements of uncertainty in Table \\ref{tab:catalog}. A plot of the resulting planet period and radius distribution is provided in Figure \\ref{fig:catPl}. The deficit of planets near $2R_\\earth$ is in alignment with the radius gap identified with \\emph{Kepler} data \\citep{ful17} and with previously discovered \\emph{K2} candidates \\citep{har20}. This gap appears to be indicative of some planetary formation or evolution mechanism, the exact origin of which remains unclear. One theory suggests stellar photoevaporation removes the envelope of weakly bound atmospheres in this region of parameter space \\citep{owe17}, separating the super-Earths from the sub-Neptunes. Alternatively, the hot cores of young planets may retain enough energy to expel the atmosphere for planets within this gap (core-powered mass-loss; \\citealt{gup18}). However, these two mechanisms require additional demographic data to parse out the main source of this valley. The catalog derived here provides additional planets and the necessary sample homogeneity needed to examine this feature with greater detail, but such a task is beyond the scope of the current work.\n\n\n\n\\begin{figure}\n\\centering \\includegraphics[width=\\columnwidth{}]{CatalogPlanet.pdf}\n\\caption{The planet sample detected through our fully automated pipeline. The round markers show the new planet candidates (PCs) and + markers show the previously known PCs. The new candidates are uniformly distributed throughout the plot, because many of them come from campaigns not previously examined. The markers have been colored by consistency score to show that most candidates consistently passed the vetting metrics. \n\\label{fig:catPl}}\n\\end{figure}\n\n\n\n\n\n\n\n\\subsection{Multi-Planet Yield}\n\\label{sec:mult}\n\n\n\n\nMulti-planet systems provide a unique opportunity to understand the underlying system architecture and test intra-system formation mechanisms (e.g., \\citealt{owe19}). Furthermore, these planets are more reliable, due to the unlikely probability of identifying two false positives in a light curve \\citep{lis14, sin16}. In our sample we detected 57 unique multi-planet systems, with three systems independently identified in more than one campaign (EPIC 211428897, 212012119, 212072539). In Figure \\ref{fig:multHist} we show the total observed multiplicity distribution for our catalog. Within this sample we did not find any multi-planet systems around A stars, but we identify 17 M dwarf systems and 40 FGK dwarf systems. In consideration of galactic latitude, we found 21 systems that lie greater than $40\\degr$ above\/below the galactic plane. EPIC 206135682, 206209135, and 248545986 all host three planet systems, while the remaining 18 systems only host two. This multi-planet sample provides unique coverage of galactic substructure.\n\n\n\n\n\\subsubsection{Unique Systems}\n\nOur highest multiplicity system is EPIC 211428897, with four Earth-sized planets orbiting an M dwarf (system first identified by \\citealt{dre17}). Our pipeline found this system independently in two of the overlapping fields (C5 and C18), further strengthening its validity. In addition, \\citet{kru19} identified a fifth candidate with a period of 3.28 days. Despite the clear abundance of planet candidates, the \\emph{K2} pixels span $3.98\\arcsec$ and \\emph{Gaia} DR2, which {\\tt EDI-Vetter} uses to identify flux contamination, can only resolve binaries down to $1\\arcsec$ for $\\Delta \\mathrm{mag}\\lesssim3$ \\citep{fur17}. Thus, high-resolution imaging is necessary for system validation. \\citet{dre17} observed this system using Keck NIRC2 and Gemini DSSI, and found a companion star within $0.5\\arcsec$. Since these planets are small, the likely $\\sim \\sqrt{2}$ radii increase, due to flux contamination, will not invalidate their candidacy \\citep{cia17,fur17}. However, it remains unclear whether all of the planets are orbiting one of the stars or some mixture of the two. This will require further follow-up, and remains the subject of future work.\n\n\n\nThrough our analysis we identified 18 new multi-planet systems. EPIC 211502222 had been previously identified as hosting a single sub-Neptune with a period of 22.99 days by \\citet{ye18}. Our pipeline discovered an additional super-Earth at 9.40 days, promoting this G dwarf to a multi-planet host. The remaining 17 systems are entirely new planet candidate discoveries, existing in campaigns not exhaustively searched (C12-C18). Notably, the K dwarf EPIC 249559552 hosts two sub-Neptunes which appear in a 5:2 mean-motion resonance. These resonant systems are important because of the potential detection of additional planets through transit-timing variations (e.g. \\citealt{hol16}). EPIC 249731291 is also interesting since it is an early-type F dwarf (or sub-giant) system, with two short period gas giants.\n\n\\begin{figure}\n\\centering \\includegraphics[width=\\columnwidth{}]{multEdit.pdf}\n\\caption{ A histogram showing the observed system multiplicity distributions of our catalog (Scaling \\emph{K2}) and the \\emph{Kepler} DR25 \\citep{tho18}. The longer data span and reduced noise properties enabled \\emph{Kepler} to identify higher multiplicity systems. In addition, we provide the distributions as a function of stellar spectral type (M: $T_{\\text{eff}}<4000K$; FGK: $4000\\le T_{\\text{eff}}\\le 6500K$; A: $T_{\\text{eff}}>6500K$). \n\\label{fig:multHist}}\n\\end{figure}\n\n\\subsection{Low-Metallicity Planet Host Stars}\nThe core-accretion model indicates a link between stellar metallicity and planet formation \\citep{pol96}. Observational evidence of this connection was first identified with gas giants \\citep{san04, fis05}. However, the recent findings of \\citet{tes19} complicates this narrative, by showing a lack of correlation between planetary residual metallicity and stellar metallicity. Additionally, direct comparison of metal-rich and metal-poor planet hosts in the \\emph{Kepler} super-Earth and sub-Neptune populations, found no clear difference in planet occurrence \\citep{pet18}. This is further indicative of a complex formation process. Thus, identification of low-metallicity planet hosts enables us to test our understanding of formation theories and to identify subtle features. Within our sample of planets, we found four candidates orbiting host stars with abnormally low stellar metallicity ([Fe\/H]$<-0.75$). Upon further examination, two of these candidates (EPIC 212844216.01 and 220299658.01) have radii greater than $30R_\\Earth$, indicative of an astrophysical false positive. The remaining two super-Earth sized planets orbit a low stellar metallicity M dwarf (EPIC 210897587; [Fe\/H]$=-0.831\\pm0.051$). This system has previously been validated using WIYN\/NESSI high resolution speckle imaging \\citep{hir18} and appears in tension with the expectations of core-accretion in-situ formation, providing constraints for planet formation models.\n\n\n\n\n\\section{Measuring Completeness}\n\\label{sec:complete}\n\nAny catalog of planets will inherit some selection effects due to the methodology of detection, limitations of the instrument, and stellar noise. These biases will affect the sample completeness and must be accounted for when conducting a demographic analysis. The selection of transiting planets can be addressed using analytic arguments, but the instrument and stellar noise contributions to the sample completeness are dependent on the stellar sample and the specifics of the instrument. With an automated detection pipeline this detection efficiency mapping can be achieved through the implementation of an injection\/recovery test. Here, artificial signals are injected into the raw photometry and run through the automated software to test the pipeline's recovery capabilities, directly measuring the impact of instrument and stellar noise on the catalog. Many previous studies have used this technique on \\emph{Kepler} data, yielding meaningful completeness measurements \\citep{pet13b,chr13,chr15,chr20,bur17}. \n\n\n\\subsection{Measuring CDPP}\n\\label{sec:cdpp}\nThe first step in computing the detection efficiency is to establish a noise profile for each target light curve. With these values available, the signal strength can be estimated given the transit parameters. The ability to make these calculations enables one to understand the likelihood of detection for a given signal. \\emph{Kepler} used the combined differential photometric precision (CDPP) metric to quantify the expected target stellar variability and systematic noise, as described in \\citet{chr12}. For all targets we provide CDPP measurements for following transit durations: 1, 1.5, 2, 2.5, 3, 4, 5, 6, 7, 8, 9, and 10 hours, spanning the range of occultation timescales expected for \\emph{K2} planet candidates.\n\nTo compute these values we randomly injected a weak ($3\\sigma$) transit signal, with the appropriate transit duration, into each detrended light curve. The strength of the recovered signal, normalized by the injected signal depth, provided a measure of the target CDPP. This process was carried out 450 times to ensure a thorough and robust examination of the light curve, sampling the full light curve for four hour transits ($\\sim$20 day period) and 25\\% of the light curve for one hour transits ($\\sim$0.5 day period). To measure the impact of differing transit durations, this process was executed for each respective CDPP timescale. For a detailed account of this procedure see Section 4 of \\citet{zin20a}. \n\nIn Figure \\ref{fig:cdpp} we show the measured 8h CDPP for the targets within this sample. Overall, there is a clear correlation with photometric magnitude, demonstrating our ability to quantify the light curve noise properties. Moreover, despite the introduction of additional systematic noise from the spacecraft pointing, the detrended \\emph{K2} photometry is still near the theoretical noise limit at the brighter magnitudes. The complete set of measurements are available in Table \\ref{tab:cdpp}.\n\n\\begin{figure}\n\\centering \\includegraphics[width=\\columnwidth{}]{cdppMag.pdf}\n\\caption{The light curve noise (the 8-hour CDPP measurements) for our target sample as a function of the \\emph{Kepler} broadband magnitude measurement. The median CDPP markers represent the median within a one magnitude bin and the corresponding bin standard deviation. The \\emph{Kepler} noise floor represents the shot and read noise expected from the detector alone \\citep{jen10b}.\n\\label{fig:cdpp}}\n\\end{figure}\n\n\\begin{deluxetable*}{lcc}\n\\tablecaption{Description of the CDPP measurements of each stellar target. \\label{tab:cdpp}}\n\\tablehead{\\colhead{Column} & \\colhead{Units} & \\colhead{Explanation}} \n\\startdata\n1 & ... & EPIC identifier\\\\\n2 & ... & Campaign\\\\\n3 & ppm & CDPP RMS Value for Transit of 1.0 hr \\\\\n4 & ppm & CDPP RMS Value for Transit of 1.5 hr \\\\\n5 & ppm & CDPP RMS Value for Transit of 2.0 hr \\\\\n6 & ppm & CDPP RMS Value for Transit of 2.5 hr \\\\\n7 & ppm & CDPP RMS Value for Transit of 3.0 hr \\\\\n8 & ppm & CDPP RMS Value for Transit of 4.0 hr \\\\\n9 & ppm & CDPP RMS Value for Transit of 5.0 hr \\\\\n10 & ppm & CDPP RMS Value for Transit of 6.0 hr \\\\\n11 & ppm & CDPP RMS Value for Transit of 7.0 hr \\\\\n12 & ppm & CDPP RMS Value for Transit of 8.0 hr \\\\\n13 & ppm & CDPP RMS Value for Transit of 9.0 hr \\\\\n14 & ppm & CDPP RMS Value for Transit of 10.0 hr \\\\\n\\enddata\n\\tablecomments{This table is available in its entirety in machine-readable form.}\n\\end{deluxetable*}\n\n\n\\subsection{Injection\/Recovery}\n\nThere are several points along the pipeline at which the signal can be injected. Ideally, injections would be made on the rawest form of photometry (at the pixel-level), but doing so is computationally expensive and provides a marginal gain in completeness accuracy (see \\citealt{chr17} for the effects on the \\emph{Kepler} data set). Moving just one step downstream, the injections can be more easily made at the light curve-level. Here, the artificial signal is introduced into the aperture-integrated flux measurements, followed by pre-processing, detrending and signal detection. Finally, the most accessible, but least accurate, method is by injecting signals after pre-processing (e.g., \\citealt{clo20}). Since the pre-processed {\\tt EVEREST} light curves are readily available, this method requires minimal computational overhead. However, it fails to capture the impact of pre-processing on the sample completeness. These effects are especially important for \\emph{K2} photometry, which undergoes significant modification before being searched. Following the procedures of our previous study \\citep{zin20a}, we injected our artificial signals into the aperture-integrated light curves (before pre-processing; see Figure \\ref{fig:diagram}). In the next few paragraphs we briefly outline our methodology, but suggest interested readers reference Section 5 of our previous work for a more detailed account.\n\nUsing the {\\tt batman} Python package \\citep{kre15}, we created and injected artificial transits in the raw flux data. For each target, we uniformly drew a period from [0.5, 40] days and an $R_{pl}\/R_{\\star}$ from a log-uniform distribution with a range [0.01,0.1]. The ephemeris was uniformly selected, with the requirement that at least three transits reside within the span of the light curve, and the impact parameter was uniformly drawn from [0,1].\\footnote{In the current iteration of this pipeline we have removed the eclipsing binary impact parameter limit mentioned in Section 5 of \\citet{zin20a}. In doing so, we provide a more accurate accounting of the impact of grazing transits.} All injections were assumed to have zero eccentricity. This assumption is motivated by the short period range of detectable \\emph{K2} planets, which many have likely undergone tidal circularization. In addition, eccentricity only affects the transit duration, making its impact on completeness minor. The limb-darkening parameters for the artificial transits were dictated by the stellar parameters discussed in Section \\ref{sec:stellarSample}. Using the ATLAS model coefficients for the \\emph{Kepler} bandpasses \\citep{cla12}, we derived the corresponding quadratic limb-darkening parameters based on their stellar attributes. In cases where stellar parameters did not exist, we assumed solar values.\n\nWe expect the pipeline's recovery capabilities scale as a function of the signal strength. In order to quantify this effect, one must have a measure of the expected injection signal strength (MES). Equipped with our CDPP measurements, this value is directly related to the transit depth (depth) and can be analytically found using:\n\\begin{equation}\n\\text{MES}=C\\;\\frac{\\text{depth}}{\\text{CDPP}_{\\text{t}_{\\text{dur}}}}\\;\\sqrt{N_{\\text{tr}}},\n\\label{eq:MES}\n\\end{equation}\nwhere $\\text{CDPP}_{\\text{t}_{\\text{dur}}}$ represents the targets CDPP measures for a given transit duration (achieved through interpolation of the measured CDPP values discussed in Section \\ref{sec:cdpp}) and $N_{\\text{tr}}$ is the number of available transits within the data span. The $C$ value is a global correction factor that renormalizes the analytic equation to match the detected signal values. For this data set we found $C=0.9488$. Using this equation, we calculated the expected MES values for all injections and measured the sample completeness.\n\n\nOnce our injections were performed, we passed this altered photometry through the software pipeline, testing our recovery capabilities. We considered a planet successfully recovered if it met the following criteria: the detected signal period and ephemeris were within $3\\sigma$ of the injected values and the signal passes all of the vetting metrics. The results of this test can be seen in the completeness map in Figure \\ref{fig:TCEcomplete}. To quantify our detection efficiency as a function of injected MES, we used a uniform kernel density estimator (KDE; width of 0.25 MES) to measure our software's recovery fraction. These values were then fit with a logistic function of the form:\n\\begin{equation}\nf(x)=\\frac{a}{1+e^{-k(x-l)}}.\n\\end{equation}\nThe best fit values of $a$, $k$, and $l$ are listed in Table \\ref{tab:complete}.\n\nWhile MES is closely related to completeness, additional signal parameters can play a role. \\citet{chr20} tested the effects of stellar effective temperature ($T_{\\text{eff}}$), period, $N_{\\text{tr}}$, and photometric magnitude on the completeness of the analogous \\emph{Kepler} injections, finding the strongest effect linked to $N_{\\text{tr}}$. In Figure \\ref{fig:TCEcomplete} we show two of these completeness features for the \\emph{K2} injections: spectral class and $N_{\\text{tr}}$. \\citet{chr15} noted a significant drop ($\\sim4\\%$) in detection efficiency for cooler M dwarfs, which exhibit higher stellar variability. Remarkably, we did not find a significant difference between the AFGK dwarfs ($T_{\\text{eff}}>4000K$) and the M dwarfs ($T_{\\text{eff}}<4000K$). It is likely that the increased systematic noise of \\emph{K2} blurs this completeness feature, making the two populations indistinguishable. We also considered the additional noise contributions expected for young stars. In looking at 8033 targets associated with young star clusters, as indicated by {\\tt BANYAN $\\Sigma$} \\citep{gag18}, we could not identify a significant completeness difference. Like the \\emph{Kepler} TPS, we found $N_{\\text{tr}}$ has the strongest effect on our \\emph{K2} planet sample completeness. Here, a significant drop in detection efficiency was expected for signals near the minimum transit threshold. In light of the pipeline's three transit requirement, these marginal signals were more susceptible to systematics and vetting misclassification. In other words, if any of the three transits were discarded by the vetting, it would immediately receive a false positive label. We also parsed the data into larger $N_{\\text{tr}}$ value bins, but found little difference in completeness between $N_{\\text{tr}}$ equal to four, five, and six; the vetting was unlikely to discard more than one meaningful transit. Furthermore, we considered the effects of the signal period. While this parameter is strongly correlated with $N_{\\text{tr}}$, it has the potential to describe period-dependent detrending and data processing issues. Separating the injected signals at a period of 26 days (see Table \\ref{tab:complete}), we found a loss of completeness ($\\Delta a\\sim0.20$) that was comparable to the $N_{\\text{tr}}$ partition ($\\Delta a\\sim0.21$). This similarity indicates a strong correlation between parameters, suggesting either of the two features would appropriately account for the reduced completeness in this region of parameter space. Since $N_{\\text{tr}}$ provides a slightly larger deficit, we suggest using this function for future demographic analysis of our catalog. \n\nCompleteness measurements provide a natural test of {\\tt EDI-Vetter}'s classification capabilities. The introduction of systematics from the telescope makes signal vetting more difficult, when compared to the \\emph{Kepler} TPS, requiring more drastic vetting metrics. This could lead to significant misclassification, discarding an abundance of meaningful planet candidates. Fortunately, in Figure \\ref{fig:TCEcomplete} we identify a $\\sim13\\%$ loss of completeness due to the vetting metrics, which is comparable to the \\emph{Kepler} {\\tt Robovetter} ($\\sim10\\%$ loss; \\citealt{cou17b}). Ideally, this difference would be zero, but such a minimal loss is acceptable and, more importantly, quantifiable. \n\nWe have provided the completeness parameters necessary for a demographic analysis of this catalog. However, the injections carried out here are computationally expensive and hold significant value for research beyond the scope of this catalog. Therefore, we provide, in addition, the injected {\\tt EVEREST}-processed light curves and a summary table of the injection\/recovery test.\\footnote{\\href{http:\/\/www.jonzink.com\/scalingk2.html}{http:\/\/www.jonzink.com\/scalingk2.html}} These data products enable users to set custom completeness limits and to test their own vetting software with significantly reduced overhead. \n\n\n\\begin{figure*}\n\\centering \\includegraphics[width=\\textwidth{}]{completenessTable.pdf}\n\\caption{Plots of the measured completeness, resulting from our injection\/recovery test, for the presented planet sample. To show the effects of characteristic stellar noise, the number of transits, and the loss of planets due to our vetting software, we provide several slices of the data. The corresponding logistic function parameters are available in Table \\ref{tab:complete}. The heat map shows the overall vetted completeness as a function of planet radius ratio and the transit period. For our stellar sample, the radii ratios of 0.01, 0.03, and 0.1 correspond to median planet radii of 1.1, 3.4, and 11.3 $R_\\Earth$ respectively. \n\\label{fig:TCEcomplete}}\n\\end{figure*}\n\n\n\n\n\\begin{deluxetable}{lccc}\n\\tablecaption{The logistic parameters for the corresponding completeness functions shown in Figures \\ref{fig:TCEcomplete} \\& \\ref{fig:complete_lat}. Additionally, we include the completeness parameters for a separation of 26 day period signals. It is important to highlight that $a$ represents the maximum completeness for high MES signals. \\label{tab:complete}}\n\\tablehead{\\colhead{Model} & \\colhead{a} & \\colhead{k} & \\colhead{l}} \n\\startdata\n\\textbf{Unvetted} & 0.7407 & 0.6859 & 9.7407 \\\\\n\\textbf{Vetted} & 0.6093 & 0.6369 & 10.8531 \\\\\n\\\\\n\\textbf{>3 Transits} & 0.6868 & 0.6347 & 10.9473\\\\\n\\textbf{=3 Transits} & 0.4788 & 0.6497 & 10.5598\\\\\n\\\\\n\\textbf{<26d Periods} & 0.6619 & 0.6231 & 10.9072\\\\\n\\textbf{>26d Periods} & 0.4635 & 0.6607 & 10.5441\\\\\n\\\\\n\\textbf{AFGK Dwarf} & 0.6095 & 0.6088 & 10.8986\\\\\n\\textbf{M Dwarf} & 0.6039 & 0.8455 & 10.5636 \\\\\n\\\\\n\\textbf{C1} & 0.3923 & 0.7654 & 11.3914\\\\\n\\textbf{C2} & 0.6430 & 0.7173 & 10.8544 \\\\\n\\textbf{C3} & 0.7462 & 0.6689 & 10.5701 \\\\\n\\textbf{C4} & 0.6734 & 0.6344 & 11.1443 \\\\\n\\textbf{C5} & 0.4425 & 0.5923 & 11.3923 \\\\\n\\textbf{C6} & 0.7654 & 0.5759 & 10.8772 \\\\\n\\textbf{C7} & 0.3941 & 0.6052 & 11.7002 \\\\\n\\textbf{C8} & 0.6669 & 0.5726 & 10.0560 \\\\\n\\textbf{C10} & 0.5572 & 0.6469 & 10.0056 \\\\\n\\textbf{C11} & 0.2171 & 0.4759 & 12.3882 \\\\\n\\textbf{C12} & 0.6192 & 0.7341 & 10.6272 \\\\\n\\textbf{C13} & 0.6853 & 0.5698 & 11.3878 \\\\\n\\textbf{C14} & 0.7505 & 0.6596 & 10.9776 \\\\\n\\textbf{C15} & 0.6067 & 0.6480 & 10.4673 \\\\\n\\textbf{C16} & 0.6809 & 0.7256 & 10.5453 \\\\\n\\textbf{C17} & 0.5848 & 0.6633 & 10.3635 \\\\\n\\textbf{C18} & 0.6116 & 0.4676 & 11.5783 \\\\\n\\enddata\n\n\\end{deluxetable}\n\n\\subsection{Completeness and Galactic Latitude}\n\\label{sec:comLat}\nEach \\emph{K2} campaign probed a different region along the ecliptic. These fields correspond to unique galactic latitudes, where distinct noise features may spawn differences in inter-campaign completeness. To address these potential variations, we consider the completeness as a function of campaign in Figure \\ref{fig:complete_lat}.\n\nOverall, there is significant scatter among the lower absolute galactic latitude campaigns ($\\mid b \\mid<40\\degr$). This trend is indicative of target crowding near the galactic plane \\citep{gil15}. In these low latitude fields the photometric apertures are more contaminated by background sources, contributing additional noise, variability, and flux dilution, making transit detection more onerous. This is highlighted by Campaign 11, which is the closest field to the galactic plane ($b\\sim9\\degr$) that we analyzed, thus providing the lowest completeness of all campaigns ($a=0.22$). Conversely, Campaign 6 with $b\\sim48\\degr$ has the highest completeness ($a=0.77$).\n\n\\begin{figure*}\n\\centering \\includegraphics[width=\\textwidth{}]{latCom.pdf}\n\\caption{The calculated vetted completeness for the low (left; $\\mid b \\mid<40\\degr$) and high (right; $\\mid b \\mid>40\\degr$) galactic latitude Campaigns. The corresponding logistic function parameters are available in Table \\ref{tab:complete}. \n\\label{fig:complete_lat}}\n\\end{figure*}\n\nIn the high galactic latitude campaigns ($\\mid b \\mid>40\\degr$), this crowding effect is less salient, reducing the inter-campaign completeness scatter. Furthermore, these well isolated targets, provide high quality photometry and yield the highest completeness of all \\emph{K2} campaigns ($a\\sim 0.70$).\n\nThese inter-campaign differences are meaningful, however the limited number of targets (and synthetic transit injections) within each campaign, subjects these completeness measurements to further uncertainty. Therefore, the values provided for the global completeness assessment (for Figure \\ref{fig:TCEcomplete}) are more robust and should be used for full catalog occurrence analysis.\n\n\n\n\n\n\\section{Measuring Reliability}\n\\label{sec:reli}\nDespite efforts to remove problematic cadences, instrument systematics pollute the light curves, creating artificial dips that can be erroneously characterized as a transit signal.\nTo measure the reliability in a homogeneous catalog of planets, the rate of these false alarms (FAs) must be quantified. \\citet{bry19} showed that proper accounting of the sample FA rate is essential in extracting meaningful and consistent planet occurrence measurements. \n\nThe main goal of {\\tt EDI-Vetter} (and its predecessor {\\tt Robovetter}) is to parse through all TCEs and remove FAs without eliminating true planet candidates. However, this process is difficult to automate and requires a method of testing the software's capability to achieve this goal. Accomplishing such a task necessitates an equivalent data set that captures all the unique noise properties, which contributes to FAs, without the existence of any true astrophysical signals. With such data available, the light curves can be processed through the detection pipeline. If the vetting algorithm worked perfectly, nothing would be identified as a planet candidate. Therefore, any signals capable of achieving planet candidacy would be an authentic FA and provide insight into the software's capabilities. \n\n\\citet{cou17b} explored two methods for simulating this necessary data using the existing light curves: data scrambling and light curve inversion. The first method takes large portions of the real light curve data and randomizes the order, retaining all of the noise properties while scrambling out true periodic planet signatures. Using this method \\citep{tho18} was able to replicate the real long period TCE distribution of the \\emph{Kepler} DR25 catalog. The second method inverts the light curve flux measurements. Upon this manipulation, the existing real transit signals will now be seen as flux brightening events, rendering them unidentifiable by the transit search algorithm. Under the assumption that many systematic issues are symmetric upon a flux inversion, the photometry will retain its noise properties without containing any real transit signals. This method was used by \\citet{tho18} to replicate the real short period TCE distribution of the \\emph{Kepler} DR25 catalog, while maintaining the quasi-sinusoidal features, like the rolling bands that repeat due to the spacecraft's temperature fluctuations (see Section 6.7.1 of \\citet{van16} for further detail on this effect).\n\n\\begin{figure}\n\\centering \\includegraphics[width=\\columnwidth{}]{FullCat.pdf}\n\\caption{The distribution of TCEs from the real light curves and the distribution of inverted TCEs from the FA simulation. This shows consistency among the two distributions with a minor surplus of inverted TCEs at longer periods and a deficiency at the 3rd harmonic of the thruster firing (18 hours).\n\\label{fig:TCEreliability}}\n\\end{figure}\n\n\nSince the spacecraft also underwent quasi-periodic roll motion during the \\emph{K2} mission, leading to cyclical instrument systematics, we chose the light curve inversion method. In Figure \\ref{fig:TCEreliability} we assess our ability to capture the noise features using this method. By comparing the distribution of TCEs from the real light curves with those of the inverted light curves, we can identify regions of parameter space where the inversions over- or under-represent systematic noise properties. Overall, the two distributions (108,379 TCEs and 110,548 inverted TCEs)\\footnote{The individual transit check described in Section \\ref{sec:ITC} was the dominant vetting metric for both the TCEs and the inverted TCEs, discarding non-transit shaped signals} are well aligned, providing an adequate simulation of the data set's noise characteristics. However, the inverted TCEs are slightly over-represented at long periods and under-represented at the 3rd harmonic of the 6 hour thruster firing. While we acknowledge these minor discrepancies, their impact will be small on the overall measure of the catalog reliability. \n\nAfter running the inverted light curves through our pipeline we identify 77 FA signals as planet candidates ( 806 candidates were identified in the real light curves). We used this information, alongside the formalism described in Section 4.1 of \\citet{tho18}, to quantify our sample reliability. The first step in achieving this measurement requires an understanding of the vetting routines FA removal efficiency ($E$). From the inverted light curve test we can estimate $E$ as\n\\begin{equation}\nE\\approx\\frac{N_{FP_{\\mathrm{inv}}}}{T_{TCE_{\\mathrm{inv}}}},\n\\end{equation}\nwhere $N_{FP_{\\mathrm{inv}}}$ is the number of TCEs that were accurately flagged as false positives and $T_{TCE_{\\mathrm{inv}}}$ is the total number of TCEs found in the inversion test. For the total data set, we found {\\tt EDI-Vetter} has a 99.9\\% efficiency in removing FA signals. However, this extreme competence must be balanced by the abundance of TCEs found by our pipeline. \n\n\\begin{figure}\n\\centering \\includegraphics[width=\\columnwidth{}]{Reliability_94.1.pdf}\n\\caption{The calculated reliability of our planet sample as a function of orbital period and planet radius. The reliability percent and the number of candidates have been listed in each corresponding box. The white regions represent areas of parameter space where the number of candidates and FAs are sparse, making accurate measurements of reliability unachievable. \n\\label{fig:reliability}}\n\\end{figure}\n\nWe can determine the reliability fraction ($R$) of our catalog using the number of TCEs flagged as false positive ($N_{FP}$) in the real light curves and the number of planet candidates ($N_{PC}$):\n\\begin{equation}\nR=1-\\frac{N_{FP}}{N_{PC}}\\Bigg(\\frac{1-E}{E}\\Bigg).\n\\label{eq:reli}\n\\end{equation}\nOverall, we found the planet catalog provided here is 91\\% reliable. This is slightly lower than the 97\\% reliability of the \\emph{Kepler} DR25 catalog \\citep{tho18}. However, this \\emph{Kepler} value is greatly improved by the extensive data baseline. A more appropriate comparison would consider a period range with a comparable number of transits (\\emph{Kepler} candidates with periods greater than 10 days have a similar number of transits). In this region of parameter space the {\\tt Robovetter} has a reliability of 95\\%, which is closer to the value reported for {\\tt EDI-Vetter}. Moreover, these broad summary statistics fail to capture the complexity of this metric.\n\n\\begin{figure*}\n\\centering \\includegraphics[height=7cm]{latReli.pdf}\n\\caption{The calculated reliability for the low and high galactic latitude Campaigns. The reliability percent and the number of candidates have been listed in each corresponding box. The white regions represent areas of parameter space where the number of candidates and FAs are sparse, making accurate measurements of reliability unachievable. \n\\label{fig:reliability_lat}}\n\\end{figure*}\n\nWe found 8 of the FAs detected in our inversion simulation are hosted by sub-giant and giant stars, which have notably more active stellar surfaces. By excluding all giants with $\\log(g)$ less than 4, we focus on the dwarf star population (in Figure \\ref{fig:reliability}) and consider how reliability changes as a function of period and planet radius. At longer periods the reliability drops. The reduced number of transits available for a given candidate more easily enables systematic features to line up and create a FA signal. Smaller planet radius regions are also more susceptible to FAs due to their weak signal strength, which can be replicated by noise within the data set. When accounting for this period and radius dependence we expect 94\\% of our dwarf host candidates to be real astrophysical signals.\n\n\\subsection{Reliability and Galactic Latitude}\n\\label{sec:galRelib}\n\n\nLike completeness, reliability may also exhibit inter-campaign differences. However, the number of FAs detected by inversion are not significant enough to enable thorough campaign by campaign analysis. Since Section \\ref{sec:comLat} showed that a majority of field differences could be attributed to galactic latitude, we considered differences in reliability for high ($\\mid b \\mid>40\\degr$) and low ($\\mid b \\mid<40\\degr$) absolute galactic latitudes in Figure \\ref{fig:reliability_lat}. Overall, we found that both low and high absolute galactic latitude campaigns produce a very similar reliability, 95\\% and 94\\% respectively. Upon examination of these two stellar populations, no significant differences were identified, thus these changes in reliability are likely due to statistical fluctuations from the reduced number of FAs (34 in low latitudes and 35 in high latitudes). Therefore, we encourage future population analysis to use the full reliability calculation provided in Figure \\ref{fig:reliability}.\n\n\n\\subsection{Astrophysical False Positives}\n\\label{sec:astrFP}\nIt is important to highlight that reliability is a measure of the systematic FA contamination rate. There exist non-planetary astrophysical sources capable of producing a transit signal. For example, dim background eclipsing binaries (EBs) may experience significant flux dilution from the primary target, manifesting a shallow depth transit. This planetary signal mimicry may lead to candidate misclassification \\citep{fre13,san16,mor16,mat18}. The \\emph{Kepler} DR25 relied on the centroid offset test \\citep{mul17} to identify these contaminants. This test considered the TCE's flux difference in and out of transit for each aperture pixel. Larger differences near the edge (or away from the center) of the aperture indicated a non-target star origin, enabling the identification of contaminants to within $1\\arcsec$. Although it is possible that such signals were of planetary nature \\citep{bry13}, the expected flux dilution makes classification difficult. Thus, candidates with centroid offsets were removed from the DR25 candidate catalog. Employing a similar test for \\emph{K2} would be difficult given the spacecraft's roll motion. The {\\tt DAVE} algorithm \\cite{kos19} considered each individual cadence (instead of the entire transit) to carry out a similar procedure for \\emph{K2} and was able to identify 96 centroid offsets from the list of known candidates. While this method is helpful, it lacks the statistical strength of the original centroid test. Instead, we choose to leverage the \\emph{Gaia} DR2 catalog to identify these sub-pixel background sources. Doing so, we are able to identify potential contaminates to within $1\\arcsec$ of the target star \\citep{zie18}, the equivalent limit of the \\emph{Kepler} DR25 centroid offset test.\\footnote{\\emph{Gaia's} spatial resolution reduces to $2\\arcsec$ for magnitude difference greater than 5.} \n\n\\begin{figure}\n\\centering \\includegraphics[width=\\columnwidth{}]{seperation.pdf}\n\\caption{The number of \\emph{Gaia} DR2 sources within a one arcminute radius of each planet candidate. This plot shows that \\emph{K2} candidate hosts (green) generally occupy more isolated fields than \\emph{Kepler} candidate hosts (blue). A characteristic aligned with the fact that $92\\%$ of our \\emph{K2} candidates are observed at an absolute galactic latitudes greater than the edge of the \\emph{Kepler} field ($\\mid b \\mid>22\\degr$), where stellar density subsides.\n\\label{fig:seperation}}\n\\end{figure}\n\nTo estimate the rate of contamination in our sample we consider the \\emph{Kepler} certified false positive (CFP) table \\citep{bry17} alongside the \\emph{Kepler} DR25 candidate catalog. The \\emph{Kepler} CFPs represents a sample of 3,590 \\emph{Kepler} signals not granted candidacy and thoroughly investigated to ensure a non-planetary origin. Carrying out all of our vetting procedures (including the contaminant identification from \\emph{Gaia} DR2) to both the CFP table and the DR25 candidate list, we would expect to find 169 CFPs and 3,470 DR25 candidates (a $\\sim4.6\\%$ contamination rate). However, this rate is likely an upper limit. The astrophysical false positive rate for background EBs should recede with increased distance from the galactic plane, given the expected change in aperture crowding as a function of galactic latitude. Overall, the \\emph{Kepler} target stars are closer to the galactic plane ($b \\lesssim 20\\degr$) compared to the \\emph{K2} targets, which largely occupy a higher absolute galactic latitude ($\\mid b \\mid\\gtrsim 20\\degr$). This apparent density distinction is shown in Figure \\ref{fig:seperation}, where we present the number of \\emph{Gaia} sources within a one arcminute radius of each candidate host. The \\emph{Kepler} candidates clearly occupy a more crowded field than a majority of our \\emph{K2} candidates, subjecting \\emph{Kepler} targets to a heightened occurrence of background contaminating sources. Overall, the CFP table is unique to the \\emph{Kepler} prime mission and differences in instrument performance, catalog construction, and stellar fields limit our ability to make precise contamination rate estimates for our \\emph{K2} catalog.\n\n\n\\begin{figure}\n\\centering \\includegraphics[width=\\columnwidth{}]{fluxDilution.pdf}\n\\caption{The expected Equation \\ref{eq:EB} values for the candidates within our catalog, conservatively assuming that the signals originated from the dimmest aperture-encased sources (Diluted). These quantities are plotted against the catalog values, which assume the signal host was the brightest aperture-encased source (Catalog). The yellow regions, which includes 18 candidates, indicate signals that could be astrophysical false positives ($R_{\\mathrm{pl}}\/R_{\\star}+b>1.04$) with their transit signal diluted. We also found an additional 11 candidates that would have produced a $R_{\\mathrm{pl}}\/R_{\\star}$ greater than 0.3 under this worse-case scenario assumption, presenting EB like properties and warranting rejection from our catalog. Signals that exceed either of these thresholds have been colored in green to indicate a potential background EB signal.\n\\label{fig:fluxDilution}}\n\\end{figure}\n\n\nTo further assess our ability to remove background EBs, we can perform a worst-case scenario test. The \\emph{Gaia} DR2 source catalog is essentially complete \\footnote{Visual companions, who are not spatially resolved, are an exception to this completeness claim.} for photometric $G$-band (comparable to the $Kepler$-band) sources brighter than 17 magnitudes, reducing to $\\sim80\\%$ completeness for $G=20$ targets \\citep{bou20}. Correspondingly, in Figure \\ref{fig:cdpp} it is shown that our CDPP values increase as a function of magnitude, reducing our pipeline's ability to detect signals around these dim targets. For example, a Kep.$=17$ star requires an occultation that exceeds $1\\%$ to qualify as a TCE ($8.68\\sigma$), increasing to $40\\%$ for targets with Kep.$=20$. When these dim stars are within the aperture of a brighter source, the photometric noise floor is further elevated by the noise contribution from both stars. By combining the low probability of greater than $40\\%$ eclipses and the $80\\%$ stellar completeness at $G=20$, \\emph{Gaia} provides sufficient coverage of the parameter space where background EBs could be hidden, yet still detectable by our pipeline. Thus, we can bound our contamination rate by making a conservative assumption that all of our candidate signals originate from the dimmest aperture-encased \\emph{Gaia} DR2 identified source. Currently, our candidate catalog assumes each transit signal corresponds to the brightest star within the aperture, however, such an assumption may misidentify diluted background EBs. Our worse-case scenario test helps quantify the magnitude of this contamination and the corresponding results are displayed in Figure \\ref{fig:fluxDilution}. We found 74 of our candidate targets contain additional aperture-encased \\emph{Gaia} source. Nine of these targets exhibit transits that can only be physically explained by a signal from the brightest star. In other words, the transit brightness reduction exceeds that of the entire flux contribution from the background stars. We found 17 candidates that would exhibit $R_{\\mathrm{pl}}\/R_{\\star}+b$ values greater than our catalog threshold (1.04) and an additional 13 candidates that would not meet our $R_{\\mathrm{pl}}\/R_{\\star}\/le0.3$ requirement. If we assume all 30 of these signals originated from a background source, we establish a background EB contamination rate of $4.0\\%$. However, the true parent source of these candidates remains unclear, thus this estimation is again an upper limit. In addition, we acknowledge that our detection metrics could remain averted by small radius-ratio non-grazing EBs, but we expect such cases to be rare. Overall, we expect contamination from background EBs to make up less than 5\\% of our candidate list.\n\n\n\n\\section{Occurrence Rate Recommendations}\n\\label{sec:suggest}\nAll exoplanet demographic analyses require defining an underlying stellar sample of interest. Our catalog used nearly the entire \\emph{K2} target sample, which may be too broad for future analysis. The completeness measurements given here may not accurately reflect that of a reduced target list. Therefore, we recommend users select their own stellar sample and consult the injection\/recovery summary table to assess the completeness of their selected targets for the highest degree of accuracy.\\footnote{\\label{noteWeb}\\url{www.jonzink.com\/scalingk2.html}} However, the completeness parameters provided in Table \\ref{tab:complete} are robust to minor sample selection modifications. Evidence of this claim is provided by the fact that the M dwarf and AFGK dwarf samples provide consistent results, see Figure \\ref{fig:TCEcomplete}, despite known differences. \n\nIn addition, 41,061 targets in our sample lacked stellar parameters, requiring the assumption of solar values. This may modify the results once these parameters become available. The remaining stellar parameters were provided by \\cite{hub16} for 94,769 targets and \\cite{har20} for 222,088 targets. While \\cite{zin20b} showed the offset between these two methods is minimal, making this mixture of catalogs reasonable, a uniform stellar parameterization would provide more homogeneous results. Fortunately, the pipeline's stellar agnosticism makes parameter updating uncomplicated. As additional data from the forthcoming \\emph{Gaia} DR3 becomes available, it will likely modify many of these stellar values and alter the underlying sample of dwarf stars. We suggest users implement the most up-to-date stellar parameters along with the injection\/recovery summary table to evaluate sample completeness.\n\nUpon close inspection, the \\emph{K2} population appears more stochastic along the main sequence (see Figure \\ref{fig:HR}). This is largely attributed to the guest observing selection process for the \\emph{K2} fields, where individual proposals each applied their own target selection criteria to construct target lists that addressed their specific science goals. This could lead, for instance, to situations where the G dwarfs in a given campaign represent a distinct population from the G dwarfs in another campaign (e.g. probing different ranges of stellar metallicity, which is known to impact planet occurrence rates), or from a given population of field G dwarfs. \\citet{zin20b} looked at the stellar population around Campaign 5 and found this latter selection effect did not provide a biased sample of FGK dwarfs for C5. However, for occurrence rate calculations, similar inspection of other campaigns should be carried out to ensure each campaign provides a uniform representation of their respective region of the sky. Where that does not appear to be true, users of this catalog are encouraged to independently select a set of targets from the full set of available targets (using, for instance, \\emph{Gaia} properties) that more clearly represents an unbiased sample of the desired population.\n\n\nIncorporating \\emph{Gaia} DR2 into our pipeline enabled us to provide more accurate planet radii measurements. \\citet{cia17} showed that non-transiting stellar multiplicity can artificially reduce transiting planet depths, leading to an overestimation in the occurrence of Earth-sized planets by 15-20\\%. Our pipeline used the \\emph{Gaia} DR2 to account for neighboring flux contamination, improving the precision of our radii measurements and the accuracy of future occurrence estimates. However, planet radius is markedly dependent on the underlying stellar radius measurements and our catalog is derived independent of such parameterization. Therefore, we did not impose any strict upper limits on planet radius and found 28 of our candidates have planet radii exceeding $30R_\\Earth$. These candidates are likely astrophysical false positives. We suggest users consider an upper radius bound when carrying out occurrence analyses. Users may also consider using the \\emph{Gaia} renormalized unit weight error (RUWE) values to further purify their sample of interest, as suggested by \\citep{bel20}. \n\nIdeally, the reliability would also be updated as additional information on stellar and planetary parameters are made available. This is possible using the reliability summary table, but given the small number FAs found we expect very minor changes to occur.\n\nIt is important to note that our completeness measurements do not address the window function, which requires three transits occur within the available photometry. All injections were required to have at least three transits occurring within this window, removing this detection probability from the calculated completeness. In testing, we found most light curves follow the expected analytic probability formula ($prob$):\n\n\\begin{equation}\n\\label{eq:win}\n\\begin{aligned}[t]\nprob & =1; & P t_{\\text{span}}\/2,\n\\end{aligned}\n\\end{equation}\nwhere $P$ is the signal period and $t_{\\text{span}}$ is the total span of the data (see Figure 11 of \\citealt{zin20a}). However, intra-campaign data gaps exist and should be carefully considered in any occurrence rate calculations.\n\n\\section{Summary}\n\\label{sec:summary}\nWe provide a catalog of transiting exoplanet candidates using \\emph{K2} photometry from Campaign 1-8 and 10-18, derived using a fully automated detection pipeline. This demographic sample includes 747 unique planets, 366 of which were previously unidentified. Additionally, we found 57 multi-planet candidate systems, of which 18 are newly identified. These discovered systems include a K dwarf (EPIC 249559552) hosting two sub-Neptune candidates in a 5:2 mean-motion resonance, and an early-type F dwarf (EPIC 249731291) with two short period gas giant candidates, providing an interesting constraint on formation and migration mechanisms. Follow-up observations and validation of these and a number of the other new candidates presented in this catalog is currently underway (Christiansen et al. in prep).\n\nWe employed an automated detection routine to achieve this catalog, enabling measurements of sample completeness and reliability. By injecting artificial transit signals before {\\tt EVEREST} pre-processing, we provide the most accurate measurements of \\emph{K2} sample completeness. Additionally, we used the inverted light curves to measure our vetting software's ability to remove systematic false alarms from our catalog of planets, providing a quantitative assessment of sample reliability. Using this planet sample, and the corresponding completeness and reliability measurements, exoplanet occurrence rate calculations can now be performed using \\emph{K2} planet candidates, which will be the subject of the next papers in the Scaling K2 series. With careful consideration of each data set's unique window functions, the \\emph{Kepler} and \\emph{K2} planet samples can now be combined, maximizing our ability to measure transiting planet occurrence rates throughout the local galaxy.\n\n\\section{Acknowledgements}\n\nWe thank the anonymous referee for their thoughtful feedback. This work made use of the gaia-kepler.fun crossmatch database created by Megan Bedell. The simulations described here were performed on the UCLA Hoffman2 shared computing cluster and using the resources provided by the Bhaumik Institute. This research has made use of the NASA Exoplanet Archive and the Exoplanet Follow-up Observation Program website, which are operated by the California Institute of Technology, under contract with the National Aeronautics and Space Administration under the Exoplanet Exploration Program. This paper includes data collected by the \\emph{Kepler} mission and obtained from the MAST data archive at the Space Telescope Science Institute (STScI). Funding for the \\emph{Kepler} mission is provided by the NASA Science Mission Directorate. STScI is operated by the Association of Universities for Research in Astronomy, Inc., under NASA contract NAS 5\u201326555. J. Z. acknowledges funding from NASA ADAP grant 443820HN21811. K. H-U and J. C. acknowledge funding from NASA ADAP grant 80NSSC18K0431.\n\n\n\\software{{\\tt EVEREST} \\citep{lug16,lug18}, {\\tt TERRA} \\citep{pet13b}, {\\tt EDI-Vetter} \\citep{zin20a}, {\\tt PyMC3} \\citep{sal15}, {\\tt Exoplanet} \\citep{for19}, {\\tt RoboVetter} \\citep{tho18}, {\\tt batman} \\cite{kre15}, {\\tt emcee} \\citep{for13}}\n\n\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} {"text":"\\section{Introduction}\n\nThe game of Cops and Robbers (defined, along with all the standard notation, later in this section) is usually studied in the context of the {\\em cop number}, the minimum number of cops needed to ensure a winning strategy. The cop number is often challenging to analyze; establishing upper bounds for this parameter is the focus of Meyniel's conjecture that the cop number of a connected $n$-vertex graph is $O(\\sqrt{n}).$ For additional background on Cops and Robbers and Meyniel's conjecture, see the book~\\cite{bonato}.\n\nA number of variants of Cops and Robbers have been studied. For example, we may allow a cop to capture the robber from a distance $k$, where $k$ is a non-negative integer~\\cite{bonato4}, play on edges~\\cite{pawel}, allow one or both players to move with different speeds~\\cite{NogaAbbas, fkl} or to teleport, allow the robber to capture the cops~\\cite{bonato0}, make the robber invisible or drunk~\\cite{drunk1,drunk2}, or allow at most one cop to move in any given round~\\cite{oo, hypercube, lazy_gnp}. See Chapter~8 of~\\cite{bonato} for a non-comprehensive survey of variants of Cops and Robbers.\n\n\\bigskip\n\nIn this paper, we consider a variant of the game of Cops and Robbers, called \\emph{Containment}, introduced recently by Komarov and Mackey~\\cite{komarov}. In this version, cops move from edge to adjacent edge, the robber moves as in the classic game, from vertex to adjacent vertex (but cannot move along an edge occupied by a cop). Formally, the game is played on a finite, simple, and undetected graph. There are two players, a set of \\emph{cops} and a single \\emph{robber}. The game is played over a sequence of discrete time-steps or \\emph{turns}, with the cops going first on turn $0$ and then playing on alternate time-steps. A \\emph{round} of the game is a cop move together with the subsequent robber move. The cops occupy edges and the robber occupies vertices; for simplicity, we often identify the player with the vertex\/edge they occupy. When the robber is ready to move in a round, she can move to a neighbouring vertex but cannot move along an edge occupied by a cop, cops can move to an edge that is incident to their current location. Players can always \\emph{pass}, that is, remain on their own vertices\/edges. Observe that any subset of cops may move in a given round. The cops win if after some finite number of rounds, all edges incident with the robber are occupied by cops. This is called a \\emph{capture}. The robber wins if she can evade capture indefinitely. A \\emph{winning strategy for the cops} is a set of rules that if followed, result in a win for the cops. A \\emph{winning strategy for the robber} is defined analogously. As stated earlier, the original game of \\emph{Cops and Robbers} is defined almost exactly as this one, with the exception that all players occupy vertices.\n\nIf we place a cop at each edge, then the cops are guaranteed to win. Therefore, the minimum number of cops required to win in a graph $G$ is a well-defined positive integer, named the \\emph{containability number} of the graph $G.$ Following the notation introduced in~\\cite{komarov}, we write $\\xi(G)$ for the containability number of a graph $G$ and $c(G)$ for the original \\emph{cop-number} of $G$.\n\n\\bigskip\n\nIn~\\cite{komarov}, Komarov and Mackey proved that for every graph $G$, \n$$\nc(G) \\le \\xi(G) \\le \\gamma(G) \\Delta(G), \n$$\nwhere $\\gamma(G)$ and $\\Delta(G)$ are the domination number and the maximum degree of $G$, respectively. It was conjectured that the upper bound can be strengthened and, in fact, the following holds.\n\n\\begin{conjecture}[\\cite{komarov}]\\label{con:komarov}\nFor every graph $G$, $\\xi(G) \\le c(G) \\Delta(G)$. \n\\end{conjecture}\n\n\\noindent Observe that, trivially, $c(G) \\le \\gamma(G)$ so this would imply the previous result. This seems to be the main question for this variant of the game at the moment. By investigating expansion properties, we provide asymptotically almost sure bounds on the containability number of binomial random graphs ${\\mathcal{G}}(n,p)$ for a wide range of $p=p(n)$, proving that the conjecture holds for some ranges of $p$ (or holds up to a constant or an $O(\\log n)$ multiplicative factors for some other ranges of $p$). However, before we state the result, let us introduce the probability space we deal with and mention a few results for the classic cop-number that will be needed to examine the conjecture (since the corresponding upper bound is a function of the cop number).\n\n\\bigskip\n\nThe \\emph{random graph} ${\\mathcal{G}}(n,p)$ consists of the probability space $(\\Omega, \\mathcal{F}, \\mathbb{P})$, where $\\Omega$ is the set of all graphs with vertex set $\\{1,2,\\dots,n\\}$, $\\mathcal{F}$ is the family of all subsets of $\\Omega$, and for every $G \\in \\Omega$,\n$$\n\\mathbb{P}(G) = p^{|E(G)|} (1-p)^{{n \\choose 2} - |E(G)|} \\,.\n$$\nThis space may be viewed as the set of outcomes of ${n \\choose 2}$ independent coin flips, one for each pair $(u,v)$ of vertices, where the probability of success (that is, adding edge $uv$) is $p.$ Note that $p=p(n)$ may (and usually does) tend to zero as $n$ tends to infinity. All asymptotics throughout are as $n \\rightarrow \\infty $ (we emphasize that the notations $o(\\cdot)$ and $O(\\cdot)$ refer to functions of $n$, not necessarily positive, whose growth is bounded). We say that an event in a probability space holds \\emph{asymptotically almost surely} (or \\emph{a.a.s.}) if the probability that it holds tends to $1$ as $n$ goes to infinity.\n\n\\bigskip\n\nLet us now briefly describe some known results on the (classic) cop-number of ${\\mathcal{G}}(n,p)$. Bonato, Wang, and the author of this paper investigated such games in ${\\mathcal{G}}(n,p)$ random graphs and in generalizations used to model complex networks with power-law degree distributions (see~\\cite{bpw}). From their results it follows that if $2 \\log n \/ \\sqrt{n} \\le p < 1-\\eps$ for some $\\eps>0$, then a.a.s. we have that\n\\begin{equation*\nc({\\mathcal{G}}(n,p))= \\Theta(\\log n\/p),\n\\end{equation*}\nso Meyniel's conjecture holds a.a.s.\\ for such $p$. In fact, for $p=n^{-o(1)}$ we have that a.a.s.\\ $c({\\mathcal{G}}(n,p))=(1+o(1)) \\log_{1\/(1-p)} n$. A simple argument using dominating sets shows that Meyniel's conjecture also holds a.a.s.\\ if $p$ tends to 1 as $n$ goes to infinity (see~\\cite{p} for this and stronger results). Bollob\\'as, Kun and Leader~\\cite{bkl} showed that if $p(n) \\ge 2.1 \\log n \/n$, then a.a.s.\n$$\n\\frac{1}{(pn)^2}n^{ 1\/2 - 9\/(2\\log\\log (pn)) } \\le c({\\mathcal{G}}(n,p))\\le 160000\\sqrt n \\log n\\,.\n$$\nFrom these results, if $np \\ge 2.1 \\log n$ and either $np=n^{o(1)}$ or $np=n^{1\/2+o(1)}$, then a.a.s.\\ $c({\\mathcal{G}}(n,p))= n^{1\/2+o(1)}$. Somewhat surprisingly, between these values it was shown by \\L{}uczak and the author of this paper~\\cite{lp2} that the cop number has more complicated behaviour. It follows that a.a.s.\\ $\\log_n c({\\mathcal{G}}(n,n^{x-1}))$ is asymptotic to the function $f(x)$ shown in Figure~\\ref{fig1} (denoted in blue).\n\\begin{figure}[h]\n\\begin{center}\n\\includegraphics[width=3.3in]{zig-zag}\n\\end{center}\n\\caption{The ``zigzag'' functions representing the ordinary cop number (blue) and the containability number (red).}\\label{fig1}\n\\end{figure}\n\nFormally, the following result holds for the classic game.\n\n\\begin{theorem}[\\cite{lp2, bpw}]\\label{thm:zz}\nLet $0<\\alpha<1$ and $d=d(n)=np=n^{\\alpha+o(1)}$.\n\\begin{enumerate}\n\\item If $\\frac{1}{2j+1}<\\alpha<\\frac{1}{2j}$ for some integer $j\\ge 1$, then a.a.s.\\\n$$\nc({\\mathcal{G}}(n,p))= \\Theta(d^j)\\,.\n$$\n\\item If $\\frac{1}{2j}<\\alpha<\\frac{1}{2j-1}$ for some integer $j\\ge 2$, then a.a.s.\\\n\\begin{eqnarray*}\nc({\\mathcal{G}}(n,p)) &=& \\Omega \\left( \\frac{n}{d^j} \\right), \\text{ and } \\\\\nc({\\mathcal{G}}(n,p)) &=& O \\left( \\frac{n \\log n}{d^j} \\right)\\,.\n\\end{eqnarray*}\n\\item If $1\/2 < \\alpha < 1$, then a.a.s.\\\n$$\nc({\\mathcal{G}}(n,p)) = \\Theta \\left( \\frac {n \\log n}{d} \\right).\n$$\n\\end{enumerate}\n\\end{theorem}\n\nThe above result shows that Meyniel's conjecture holds a.a.s.\\ for random graphs except perhaps when $np=n^{1\/(2k)+o(1)}$ for some $k \\in {\\mathbb N}$, or when $np=n^{o(1)}$. The author of this paper and Wormald showed recently that the conjecture holds a.a.s.\\ in ${\\mathcal{G}}(n,p)$~\\cite{PW_gnp} as well as in random $d$-regular graphs~\\cite{PW_gnd}.\n\n\\bigskip\n\nFinally, we are able to state the result of this paper.\n\n\\begin{theorem}\\label{thm:main}\nLet $0<\\alpha<1$ and $d=d(n)=np=n^{\\alpha+o(1)}$.\n\\begin{enumerate}\n\\item If $\\frac{1}{2j+1}<\\alpha<\\frac{1}{2j}$ for some integer $j\\ge 1$, then a.a.s.\\\n$$\n\\xi({\\mathcal{G}}(n,p))= \\Theta(d^{j+1}) = \\Theta(c({\\mathcal{G}}(n,p)) \\cdot \\Delta( {\\mathcal{G}}(n,p) ) )\\,.\n$$\nHence, a.a.s.\\ Conjecture~\\ref{con:komarov} holds (up to a multiplicative constant factor).\n\\item If $\\frac{1}{2j}<\\alpha<\\frac{1}{2j-1}$ for some integer $j\\ge 2$, then a.a.s.\\\n\\begin{eqnarray*}\n\\xi({\\mathcal{G}}(n,p)) &=& \\Omega \\left( \\frac{n}{d^{j-1}} \\right), \\text{ and } \\\\\n\\xi({\\mathcal{G}}(n,p)) &=& O \\left( \\frac{n \\log n}{d^{j-1}} \\right) = O(c({\\mathcal{G}}(n,p)) \\cdot \\Delta( {\\mathcal{G}}(n,p) ) \\cdot \\log n )\\,.\n\\end{eqnarray*}\nHence, a.a.s.\\ Conjecture~\\ref{con:komarov} holds (up to a multiplicative $O(\\log n)$ factor).\n\\item If $1\/2 < \\alpha < 1$, then a.a.s.\\\n$$\n\\xi({\\mathcal{G}}(n,p)) = \\Theta(n) = \\Theta (c({\\mathcal{G}}(n,p)) \\cdot \\Delta( {\\mathcal{G}}(n,p) ) \/ \\log n ) \\le c({\\mathcal{G}}(n,p)) \\cdot \\Delta( {\\mathcal{G}}(n,p).\n$$\nHence, a.a.s.\\ Conjecture~\\ref{con:komarov} holds.\n\\end{enumerate}\n\\end{theorem}\n\nIt follows that a.a.s.\\ $\\log_n \\xi({\\mathcal{G}}(n,n^{x-1}))$ is asymptotic to the function $g(x)$ shown in Figure~\\ref{fig1} (denoted in red). The fact the conjecture holds is associated with the observation that $g(x) - f(x) = x$, which is equivalent to saying that a.a.s.\\ the ratio $\\xi({\\mathcal{G}}(n,p)) \/ c({\\mathcal{G}}(n,p)) = d n^{o(1)} = \\Delta({\\mathcal{G}}(n,p)) \\cdot n^{o(1)}$. Moreover, let us mention that Theorem~\\ref{thm:main} implies that the conjecture is best possible (again, up to a constant or an $O(\\log n)$ multiplicative factors for corresponding ranges of $p$).\n\n\\bigskip\n\nNote that in the above result we skip the case when $np=n^{1\/k+o(1)}$ for some positive integer $k$ or $np=n^{o(1)}$. It is done for a technical reason: an argument for the lower bound for $\\xi({\\mathcal{G}}(n,p))$ uses a technical lemma from~\\cite{lp2} that, in turn, uses Corollary 2.6 from~\\cite{Vu} which is stated only for $np=n^{\\alpha+o(1)}$, where $\\alpha \\neq 1\/k$ for any positive integer $k$. Clearly, one can repeat the argument given in~\\cite{Vu}, which is a very nice but slightly technical application of the polynomial concentration method inequality by Kim and Vu. However, in order to make the paper easier and more compact, a ready-to-use lemma from~\\cite{lp2} is used and we concentrate on the ``linear'' parts of the graph of the zigzag function. Nonetheless, similarly to the corresponding result for $c({\\mathcal{G}}(n,p))$, one can expect that, up to a factor of $\\log^{O(1)}n$, the result extends naturally also to the case $np=n^{1\/k+o(1)}$ as well. \n\nOn the other hand, there is no problem with the upper bound so the case when $np=n^{1\/k+o(1)}$ for some positive integer $k$ is also investigated (see below for a precise statement). Moreover, some expansion properties that were used to prove that Meyniel's conjecture holds for ${\\mathcal{G}}(n,p)$~\\cite{PW_gnp} are incorporated here to investigate sparser graphs. \n\nThe rest of the paper is devoted to prove Theorem~\\ref{thm:main}.\n\n\\section{Proof of Theorem~\\ref{thm:main}}\n\n\\subsection{Typical properties of ${\\mathcal{G}}(n,p)$ and useful inequalities}\n\nLet us start by listing some typical properties of ${\\mathcal{G}}(n,p)$. These observations are part of folklore and can be found in many places, so we will usually skip proofs, pointing to corresponding results in existing literature. Let $N_i(v)$ denote the set of vertices at distance $i$ from $v$, and let $N_i[v]$ denote the set of vertices within distance $i$ of $v$, that is, $N_i[v] = \\bigcup_{0 \\le j \\le i} N_j(v)$. For simplicity, we use $N[v]$ to denote $N_1[v]$, and $N(v)$ to denote $N_1(v)$. Since cops occupy edges but the robber occupies vertices, we will need to investigate the set of edges at ``distance'' $i$ from a given vertex $v$ that we denote by $E_i(v)$. Formally, $E_i(v)$ consists of edges between $N_{i-1}(v)$ and $N_i(v)$, and within $N_{i-1}(v)$. In particular, $E_1(v)$ is the set of edges incident to $v$. Finally, let $P_i(v,w)$ denote the number of paths of length $i$ joining $v$ and $w$.\n\n\\bigskip \n\nLet us start with the following lemma. \n\n\\begin{lemma}\\label{lem:elem1}\nLet $d=d(n) = p(n-1) \\ge \\log^3 n$. Then, there exists a positive constant $c$ such that a.a.s.\\ the following properties hold in ${\\mathcal{G}}(n,p) = (V,E)$.\n\\begin{enumerate}\n\\item Let $S \\subseteq V$ be any set of $s=|S|$ vertices, and let $r \\in {\\mathbb N}$. Then\n$$\n\\left| \\bigcup_{v \\in S} N_r[v] \\right| \\ge c \\min\\{s d^r, n \\}.\n$$\nMoreover, if $s$ and $r$ are such that $s d^r < n \/ \\log n$, then\n$$\n\\left| \\bigcup_{v \\in S} N_r[v] \\right| = (1+o(1)) s d^r.\n$$\n\\item ${\\mathcal{G}}(n,p)$ is connected.\n\\item Let $r = r(n)$ be the largest integer such that $d^r \\le \\sqrt{n \\log n}$. Then, for every vertex $v \\in V$ and $w \\in N_{r+1}(v)$, the number of edges from $w$ to $N_r(v)$ is at most $b$, where \n$$\nb = \n\\begin{cases}\n250 & \\text{ if } d \\le n^{0.49} \\\\\n\\frac {3 \\log n}{\\log \\log n} & \\text{ if } n^{0.49} < d \\le \\sqrt{n}.\n\\end{cases}\n$$\n\\end{enumerate}\n\\end{lemma}\n\\begin{proof}\nThe proof of part (i) can be found in~\\cite{PW_gnp}. The fact that ${\\mathcal{G}}(n,p)$ is connected is well known (see, for example,~\\cite{JLR}). In fact, the (sharp) threshold for connectivity is $p = \\log n \/ n$ so this property holds for even sparser graphs. \n\nFor part (iii), let us first expose the $r$th neighbourhood of $v$. By part (i), we may assume that $|N_r[v]|=(1+o(1)) d^{r} < 2 d^r$. For any $w \\in V \\setminus N_r[v]$, the probability that there are at least $b$ edges joining $w$ to $N_r(v)$ is at most\n$$\nq := {2 d^r \\choose b} p^b \\le \\left( \\frac{2ed^r}{b} \\right)^b \\left( \\frac dn \\right)^b = \\left( \\frac{2ed^{r+1}}{bn} \\right)^b.\n$$\nIf $d \\le n^{0.49}$, then\n$$\nq \\le \\left( \\frac{2e d \\sqrt{n \\log n}}{bn} \\right)^b \\le n^{-0.005 b} = o(n^{-2}),\n$$\nprovided that $b$ is large enough (say, $b = 250$). For $n^{0.49} < d \\le \\sqrt{n}$ (and so $r=1$), we observe that\n$$\nq \\le \\left( \\frac{2e}{b} \\right)^b = \\exp \\left( - (1+o(1)) b \\log b \\right) = o(n^{-2}),\n$$\nprovided $b = 3 \\log n \/ \\log \\log n$. The claim follows by the union bound over all pairs $v, w$. The proof of the lemma is finished.\n\\end{proof}\n\n\\bigskip \n\nThe next lemma can be found in~\\cite{lp2}. (See also~\\cite{lazy_gnp} for its extension.)\n\n\\begin{lemma}\\label{lem:elem2}\nLet $\\eps$ and $\\alpha$ be constants such that $0<\\eps<0.1$, $\\eps<\\alpha<1-\\eps$, and let $d=d(n)=p(n-1)=n^{\\alpha+o(1)}$. Let $\\ell \\in {\\mathbb N}$ be the largest integer such that $\\ell < 1\/\\alpha$. Then, a.a.s.\\ for every vertex $v$ of ${\\mathcal{G}}(n,p)$ the following properties hold.\n\\begin{enumerate}\n\\item [(i)] If $w\\in N_i[v]$ for some $i$ with $2\\le i \\le \\ell$, then $P_i(v,w) \\le \\frac {3}{1-i\\alpha}$.\n\\item [(ii)] If $w\\in N_{\\ell+1}[v]$ and $d^{\\ell+1} \\ge 7 n \\log n$, then $P_{\\ell+1}(v,w) \\le \\frac{6}{1-\\ell \\alpha}\\frac{d^{\\ell+1}}{n}$.\n\\item [(iii)] If $w\\in N_{\\ell+1}[v]$ and $d^{\\ell+1} < 7 n \\log n$, then $P_{\\ell+1}(v,w) \\le \\frac{42}{1-\\ell \\alpha} \\log n$.\n\\end{enumerate}\nMoreover, a.a.s.\\\n\\begin{enumerate}\n\\item [(iv)] Every edge of ${\\mathcal{G}}(n,p)$ is contained in at most $\\eps d$ cycles of length at most $\\ell+2$.\n\\end{enumerate}\n\\end{lemma}\n\n\\bigskip\n\nWe will also use the following variant of Chernoff's bound (see, for example,~\\cite{JLR}):\n\\begin{lemma}[\\textbf{Chernoff Bound}]\nIf $X$ is a binomial random variable with expectation $\\mu$, and $0<\\delta<1$, then \n$$\n\\Pr[X < (1-\\delta)\\mu] \\le \\exp \\left( -\\frac{\\delta^2 \\mu}{2} \\right)\n$$ \nand if $\\delta > 0$,\n$$\n\\Pr [X > (1+\\delta)\\mu] \\le \\exp \\left(-\\frac{\\delta^2 \\mu}{2+\\delta} \\right).\n$$\n\\end{lemma}\n\n\\subsection{Upper bound}\n\nFirst, let us deal with dense graphs that correspond to part (iii) of Theorem~\\ref{thm:main}. In fact, we are going to make a simple observation that the containability number is linear if $G$ has a perfect or a near-perfect matching. The result will follow since it is well-known that for $p=p(n)$ such that $pn - \\log n \\to \\infty$, ${\\mathcal{G}}(n,p)$ has a perfect (or a near-perfect) matching a.a.s. (As usual, see~\\cite{JLR}, for more details.)\n\n\\begin{lemma}\\label{lem:perfect}\nSuppose that $G$ on $n$ vertices has a perfect matching ($n$ is even) or a near-perfect matching ($n$ is odd). Then, $\\xi(G) \\le n$.\n\\end{lemma}\n\\begin{proof}\nSuppose first that $n$ is even. The cops start on the edges of a perfect matching; two cops occupy any edge of the matching for a total of $n$ cops. All vertices of $G$ can be associated with unique cops. The robber starts on some vertex $v$. One edge incident to $v$ (the edge $vv'$ that belongs to the perfect matching used) is already occupied by a cop (in fact, by two cops, associated with $v$ and $v'$). Moreover, the remaining cops can move so that all edges incident to $v$ are protected and the game ends. Indeed, for each edge $vu$, the cop associated with $u$ moves to $vu$. \n\nThe case when $n$ is odd is also very easy. Two cops start on each edge of a near-perfect matching which matches all vertices but $u$. If $u$ is isolated, we may simply remove it from $G$ and arrive back to the case when $n$ is even. (Recall that the cops win if all edges incident with the robber are occupied by cops. As this property is vacuously true when the robber starts on an isolated vertex, we may assume that she does not start on $u$.) Hence, we may assume that $u$ is not isolated. We introduce one more cop on some edge incident to $u$. The total number of cops is at most $2 \\cdot \\frac {n-1}{2} + 1 = n$; again, each vertex of $G$ can be associated with a unique cop and the proof goes as before.\n\\end{proof}\n\n\\bigskip\n\nNow, let us move to the following lemma that yields part (i) of Theorem~\\ref{thm:main}. We combine and adjust ideas from both~\\cite{lp2} and~\\cite{PW_gnp} in order to include much sparser graphs. Cases when $\\alpha = 1\/k$ for some positive integer $k$ are also covered. \n\n\\begin{lemma}\nLet $d=d(n) = p(n-1) \\ge \\log^3 n$. Suppose that there exists a positive integer $r=r(n)$ such that \n$$\n(n \\log n)^{\\frac {1}{2r+1}} \\le d \\le (n \\log n)^{\\frac {1}{2r}}.\n$$\nThen, a.a.s.\\ \n$$\n\\xi({\\mathcal{G}}(n,p)) = O(d^{r+1}).\n$$\n\\end{lemma}\n\n\\begin{proof}\nSince our aim is to prove that the desired bound holds a.a.s.\\ for ${\\mathcal{G}}(n,p)$, we may assume, without loss of generality, that a graph $G$ the players play on satisfies the properties stated in Lemma~\\ref{lem:elem1}. A team of cops is determined by independently choosing each edge of $e \\in E(G)$ to be occupied by a cop with probability $Cd^r\/n$, where $C$ is a (large) constant to be determined soon. It follows from Lemma~\\ref{lem:elem1}(i) that $G$ has $(1+o(1)) dn\/2$ edges. Hence, the expected number of cops is equal to\n$$\n(1+o(1)) \\frac {dn}{2} \\cdot \\frac {Cd^r}{n} = (1+o(1)) \\frac {Cd^{r+1}}{2} .\n$$\nIt follows from Chernoff's bound that the total number of cops is $\\Theta(d^{r+1})$ a.a.s.\n\nThe robber appears at some vertex $v \\in V(G)$. Let $X \\subseteq E(G)$ be the set of edges between $N_r(v)$ and $N_{r+1}(v)$. It follows from Lemma~\\ref{lem:elem1}(i) that \n$$\n|X| \\le (1+o(1)) d |N_r(v)| \\le 2 d^{r+1}.\n$$\nOur goal is to show that with probability $1-o(n^{-1})$ it is possible to assign distinct cops to all edges $e$ in $X$ such that a cop assigned to $e$ is within distance $(r+1)$ of $e$. (Note that here, the probability refers to the randomness in distributing the cops; the graph $G$ is fixed.) If this can be done, then after the robber appears these cops can begin moving straight to their assigned destinations in $X$. Since the first move belongs to the cops, they have $(r+1)$ steps, after which the robber must still be inside $N_r[v]$, which is fully occupied by cops. She is ``trapped'' inside $N_r[v]$, so we can send an auxiliary team of, say, $2 d^{r+1}$ cops to go to every edge in the graph induced by $N_r[v]$, and the game ends. Hence, the cops will win with probability $1-o(n^{-1})$, for each possible starting vertex $v \\in V(G)$. It will follow that the strategy gives a win for the cops a.a.s. \n\nLet $Y$ be the (random) set of edges occupied by cops. Instead of showing that the desired assignment between $X$ and $Y$ exists, we will show that it is possible to assign $b(u)$ distinct cops to all vertices $u$ of $N_{r+1}(v)$, where $b(u)$ is the number of neighbours of $u$ that are in $N_r(v)$ (that is, the number of edges of $X$ incident to $u$) and such that each cop assigned to $u$ is within distance $(r+1)$ from $u$. \n(Note that this time ``distance'' is measured between vertex $u$ and edges which is non-standard. In this paper, we define it as follows: edge $e$ is at distance at most $(r+1)$ from $u$ if $e$ is at distance at most $r$ from some edge adjacent to $u$.)\nIndeed, if this can be done, assigned cops run to $u$, after $r$ rounds they are incident to $u$, and then spread to edges between $u$ and $N_r(v)$; the entire $X$ is occupied by cops. In order to show that the required assignment between $N_{r+1}(v)$ and $Y$ exists with probability $1-o(n^{-1})$, we show that with this probability, $N_{r+1}(v)$ satisfies Hall's condition for matchings in bipartite graphs. \n\nSuppose first that $d \\le n^{0.49}$ and fix $b=250$. It follows from Lemma~\\ref{lem:elem1}(iii) that $b(u) \\le b$ for every $u \\in N_{r+1}(v)$. Set \n$$\nk_0 = \\max \\{ k : k d^{r} < n \\}.\n$$ \nLet $K \\subseteq N_{r+1}(v)$ with $|K|=k \\le k_0$. We may apply Lemma~\\ref{lem:elem1}(i) to bound the size of $\\bigcup_{u \\in K} N_r[u]$ and the number of edges incident to each vertex. It follows that the number of edges of $Y$ that are incident to some vertex in $\\bigcup_{u \\in K} N_r[u]$ can be stochastically bounded from below by the binomial random variable ${\\rm Bin}(\\lfloor c k d^r \\cdot (d\/3) \\rfloor, Cd^r\/n)$, whose expected value is asymptotic to $(Cc\/3) k d^{2r+1} \/ n \\ge (Cc\/3) k \\log n$. Using Chernoff's bound we get that the probability that there are fewer than $bk$ edges of $Y$ incident to this set of vertices is less than $\\exp(-4k \\log n)$ when $C$ is a sufficiently large constant. Hence, the probability that the sufficient condition in the statement of Hall's theorem fails for at least one set $K$ with $|K|\\le k_0$ is at most\n$$\n\\sum_{k=1}^{k_0} {|N_{r+1}(v)| \\choose k} \\exp( - 4 k \\log n) \\le \\sum_{k=1}^{k_0} n^k \\exp( - 4 k \\log n) = o(n^{-1}).\n$$\n\nNow consider any set $K \\subseteq N_{r+1}(v)$ with $k_0 < |K| = k \\le |N_{r+1}(v)| \\le 2 d^{r+1}$ (if such a set exists). Lemma~\\ref{lem:elem1}(i) implies that the size of $\\bigcup_{u \\in K} N_r[u]$ is at least $cn$, so we expect at least $cn \\cdot (d\/3) \\cdot Cd^r\/n = (Cc\/3) d^{r+1}$ edges of $Y$ incident to this set. Again using Chernoff's bound, we deduce that the number of edges of $Y$ incident to this set is at least $2 b d^{r+1} \\ge b |N_{r+1}(v)| \\ge bk$ with probability at least $1-\\exp(- 4 d^{r+1})$, by taking the constant $C$ to be large enough. Since\n$$\n\\sum_{k=k_0+1}^{|N_{r+1}(v)|} {|N_{r+1}(v)| \\choose k} \\exp( - 4 d^{r+1} ) \\le 2^{2 d^{r+1}} \\exp( - 4 d^{r+1} ) = o(n^{-1}),\n$$\nthe necessary condition in Hall's theorem holds with probability $1 - o(n^{-1})$. \n\nFinally, suppose that $d > n^{0.49}$. Since Lemma~\\ref{lem:perfect} implies that the result holds for $d > \\sqrt{n}$, we may assume that $d \\le \\sqrt{n}$. (In fact, for $d > \\sqrt{n}$ we get a better bound of $n$ rather than $O(d^2)$ that we aim for.) This time, set $b = 3 \\log \\log n \/ \\log n$ to make sure $b(u) \\le b$ for all $u \\in N_{r+1}(v)$. The proof is almost the same as before. For small sets of size at most $k_0 = \\Theta(n\/d)$, we expect $(Cc\/3) k d^{3} \/ n \\ge (Cc\/3) k n^{0.47}$ edges, much more than we actually need, namely, $b k$. For large sets of size more than $k_0$, we modify the argument slightly and instead of assigning $b$ cops to each vertex of $N_{r+1}(v)$, we notice that the number of cops needed to assign is equal to $\\sum_{u \\in K} b(u) \\le |X| \\le 2 d^{r+1}$. (There might be some vertices of $N_{r+1}(v)$ that are incident to $b$ edges of $X$ but the total number of incident edges to $K$ is clearly at most $|X|$.) The rest is not affected and the proof is finished.\n\\end{proof}\n\n\\bigskip\n\nThe next lemma takes care of part (ii) of Theorem~\\ref{thm:main}.\n\n\\begin{lemma}\nLet $d=d(n) = p(n-1) \\ge \\log^3 n$. Suppose that there exists an integer $r=r(n) \\ge 2$ such that \n$$\n(n \\log n)^{\\frac {1}{2r}} \\le d \\le (n \\log n)^{\\frac {1}{2r-1}}.\n$$\nThen, a.a.s.\\ \n$$\n\\xi({\\mathcal{G}}(n,p)) = O \\left( \\frac {n \\log n}{d^{r-1}} \\right).\n$$\n\\end{lemma}\n\\begin{proof}\nWe mimic the proof of the previous lemma so we skip details focusing only on differences. A team of cops is determined by independently choosing each edge of $e \\in E(G)$ to be occupied by a cop with probability $C \\log n \/ d^r$, for the total number of cops $\\Theta(n \\log n \/ d^{r-1})$ a.a.s.\n\nThe robber appears at some vertex $v \\in V(G)$. This time, $X \\subseteq E(G)$ is the set of edges between $N_{r-1}(v)$ and $N_{r}(v)$ and $|X| \\le 2 d^r$. We show that it is possible to assign $b=250$ distinct cops to all vertices $u$ of $N_r(v)$ such that a cop assigned to $u$ is within ``distance'' $r$ from $u$. The definition of $k_0$ has to be adjusted. Set \n$$\nk_0 = \\max \\{ k : k d^{r-1} < n \\}.\n$$ \nLet $K \\subseteq N_{r}(v)$ with $|K|=k \\le k_0$. The expected number of edges of $Y$ that are incident to some vertex in $\\bigcup_{u \\in K} N_{r-1}[u]$ is at least $(ckd^{r-1}) (d\/3) (C \\log n \/ d^r) = (Cc\/3) k \\log n$, and the rest of the argument is not affected. Now consider any set $K \\subseteq N_{r}(v)$ with $k_0 < |K| = k \\le |N_{r}(v)| \\le 2 d^{r}$ (if such a set exists). The size of $\\bigcup_{u \\in K} N_{r-1}[u]$ is at least $cn$, so we expect at least \n$$\n(cn) \\left(\\frac {d}{3} \\right) \\left( \\frac {C \\log n}{d^r} \\right) = \\frac {Cc d^r n \\log n}{3 d^{2r-1}} \\ge \\frac {Cc d^r }{3} \n$$ \nedges of $Y$ incident to this set. Hence, the number of edges of $Y$ incident to this set is at least $2 b d^{r} \\ge b |N_{r}(v)| \\ge bk$ with probability at least $1-\\exp(- 4 d^{r})$, by taking the constant $C$ to be large enough. The argument we had before works again, and the proof is finished.\n\\end{proof}\n\n\\subsection{Lower bound}\n\nThe proof of the lower bound is an adaptation of the proof used for the classic cop number in~\\cite{lp2}. The two bounds, corresponding to parts (i) and (ii) in Theorem~\\ref{thm:main}, are proved independently in the following two lemmas. \n\n\\begin{lemma}\\label{lemma:lowerbound1}\nLet $\\frac{1}{2j+1}<\\alpha<\\frac{1}{2j}$ for some integer $j\\ge 1$, $c=c(j,\\alpha)=\\frac{3}{1-2j \\alpha}$, and $d=d(n)=np=n^{\\alpha+o(1)}$. Then, a.a.s.\\\n$$\n\\xi({\\mathcal{G}}(n,p)) > K := \\left( \\frac{d}{30c(2j+1)} \\right)^{j+1}\\,.\n$$\n\\end{lemma}\n\n\\begin{proof}\nSince our aim is to prove that the desired bound holds a.a.s.\\ for ${\\mathcal{G}}(n,p)$, we may assume, without loss of generality, that a graph $G$ the players play on satisfies the properties stated in Lemmas~\\ref{lem:elem1} and~\\ref{lem:elem2}. Suppose that the robber is chased by $K$ cops. Our goal is to provide a winning strategy for the robber on $G$. For vertices $x_1,x_2,\\dots,x_s$, let $\\textrm{C}^{x_1,x_2,\\dots,x_s}_i(v)$ denote the number of cops in $E_i(v)$ (that is, at distance $i$ from $v$) in the graph $G \\setminus \\{x_1,x_2, \\dots,x_s\\}$.\n\nRight before the robber makes her move, we say that the vertex $v$ occupied by the robber is \\emph{safe}, if for some neighbour $x$ of $v$ we have $\\textrm{C}^x_1(v) \\le\\frac{d}{30c(2j+1)}$, and\n$$\n\\textrm{C}_{2i}^x(v), \\textrm{C}_{2i+1}^x(v)\\le \\left( \\frac{d}{30c(2j+1)} \\right)^{i+1}\n$$\nfor $i=1,2,\\dots,j-1$ (such a vertex $x$ will be called a \\emph{deadly neighbour} of $v$). The reason for introducing deadly neighbours is to deal with a situation that many cops apply a greedy strategy and always decrease the distance between them and the robber. As a result, there might be many cops ``right behind'' the robber but they are not so dangerous unless she makes a step ``backwards'' by moving to a vertex she came from in the previous round, a deadly neighbour! Moreover, note that a vertex is called safe for a reason: if the robber occupies a safe vertex, then the game is definitely not over since the condition for $C_1^x(v)$ guarantees that at most a small fraction of incident edges are occupied by cops.\n\nSince a.a.s.\\ $G$ is connected (see Lemma~\\ref{lem:elem1}(ii)), without loss of generality we may assume that at the beginning of the game all cops begin at the same edge, $e$. Subsequently, the robber may choose a vertex $v$ so that $e$ is at distance $2j+2$ from $v$ (see Lemma~\\ref{lem:elem1}(i) applied with $r=2j+1$ to see that almost all vertices are at distance $2j+1$ from both endpoints of $e$). Hence, even if all cops will move from $e$ to $E_{2j+1}(v)$ after this move, $v$ will remain safe as no bound is required for $\\textrm{C}_{2j+1}^x(v)$. (Of course, again, without loss of generality we may assume that all cops pass for the next round and stay at $e$ before starting applying their best strategy against the robber.) Hence, in order to prove the lemma, it is enough to show that if the robber's current vertex $v$ is safe, then she can move along an unoccupied edge to a neighbour $y$ so that no matter how the cops move in the next round, $y$ remains safe.\n\nFor $0 \\le r \\le 2j$, we say that a neighbour $y$ of $v$ is {\\em $r$-dangerous} if\n\\begin{itemize}\n\\item [(i)] an edge $vy$ is occupied by a cop (for $r=0$)\\,, or\n\\item [(ii)] $\\textrm{C}^{v,x}_r(y) \\ge \\frac 13 \\left( \\frac{d}{30c(2j+1)} \\right)^{i}$ (for $r=2i$ or $r=2i-1$, where $i = 1,2, \\ldots, j$)\\,,\n\\end{itemize}\nwhere $x$ is a deadly neighbour of $v$. We will check that for every $r \\in \\{0, 1, \\ldots, 2j\\}$, the number of $r$-dangerous neighbours of $v$, which we denote by $\\textrm{dang}(r)$, is smaller than $\\frac {d}{2(2j+1)}$. Clearly, since $v$ is safe, \n$$\n\\textrm{dang}(0) \\le \\textrm{C}^x_1(v) \\le \\frac{d}{30c(2j+1)} \\le \\frac {d}{2(2j+1)}.\n$$\nSuppose then that $r=2i$ or $r=2i-1$ for some $i \\in \\{1,2,\\ldots, j\\}$. Every $r$-dangerous neighbour of $v$ has at least $\\frac 13 \\left( \\frac{d}{30c(2j+1)} \\right)^i$ cops occupying $E_{\\le (r+1)}(v)$. On the other hand, every edge from $E_{\\le (r+1)}(v)$ is incident to at most $2$ vertices at distance at most $r$ from $v$. Moreover, Lemma~\\ref{lem:elem2}(i) implies that there are at most $c$ paths between $v$ and any $w \\in N_{\\le r}(v)$. Finally, by the assumption that $v$ is safe, we have $\\textrm{C}^{x}_{2i}(v), \\textrm{C}^{x}_{2i+1}(v) \\le \\left( \\frac{d}{30c(2j+1)} \\right)^{i+1}$, provided that $i \\le j-1$; the corresponding conditions for $\\textrm{C}_{2j}^x(v)$ and $\\textrm{C}_{2j+1}^x(v)$ are trivially true, since both can be bounded from above by $K$, the total number of cops. Combining all of these yields\n\\begin{eqnarray*}\n\\frac 13 \\left( \\frac{d}{30c(2j+1)} \\right)^i \\cdot \\textrm{dang}(r) &\\le& 2c \\cdot \\textrm{C}_{\\le (r+1)}^x(v) \\le 2c \\cdot (2+o(1)) \\textrm{C}_{r+1}^x(v) \\\\\n&\\le& 5 c \\cdot \\left( \\frac{d}{30c(2j+1)} \\right)^{i+1},\n\\end{eqnarray*}\nand consequently $\\textrm{dang}(r) \\le \\frac {d}{2(2j+1)}$, as required. Thus, there at most $d\/2$ of neighbours of $v$ are $r$-dangerous for some $r \\in \\{0,1,\\dots,2j\\}$. \n\nSince we have $(1+o(1)) d$ neighbours to choose from (see Lemma~\\ref{lem:elem1}(i)), there are plenty of neighbours of $v$ which are not $r$-dangerous for any $r=0,1,\\dots,2j$ and the robber might want to move to one of them. However, there is one small issue we have to deal with. In the definition of being dangerous, we consider the graph $G \\setminus \\{v,x\\}$ whereas in the definition of being safe we want to use $G \\setminus \\{v\\}$ instead. Fortunately, Lemma~\\ref{lem:elem2}(iv) implies that we can find a neighbour $y$ of $v$ that is not only not dangerous but also $x$ does not belong to the $2j$-neighbourhood of $y$ in $G\\setminus \\{v\\}$. It follows that $vy$ is not occupied by a cop and $\\textrm{C}^{v}_r(y) < \\frac 13 \\left( \\frac{d}{30c(2j+1)} \\right)^{i}$ for $r=2i$ or $r=2i-1$, where $i = 1,2, \\ldots, j$. We move the robber to $y$.\n\nNow, it is time for the cops to make their move. Because of our choice of the vertex $y$, we can assure that the desired upper bound for $\\textrm{C}_r^v(y)$ required for $y$ to be safe will hold for $r \\in \\{1,2,\\dots,2j-1\\}$. Indeed, the best that the cops can do to try to fail the condition for $\\textrm{C}_r^v(y)$ is to move all cops at distance $r-1$ and $r+1$ from $y$ to $r$-neighbourhood of $y$, and to make cops at distance $r$ stay put, but this would not be enough. Thus, regardless of the strategy used by the cops, $y$ is safe and the proof is finished.\n\\end{proof}\n\n\\begin{lemma}\\label{lemma:lowerbound2}\nLet $\\frac{1}{2j}<\\alpha<\\frac{1}{2j-1}$ for some integer $j\\ge 1$, $\\bar c=\\bar c(\\alpha)=\\frac{6}{1-(2j-1) \\alpha}$ and $d=d(n)=np=n^{\\alpha+o(1)}$. Then, a.a.s.\\\n$$\n\\xi({\\mathcal{G}}(n,p))\\ge \\bar{K} := \\left( \\frac{d}{30 \\bar c (2j+1)} \\right)^{j+1} \\frac{n}{d^{2j}}\\,.\n$$\n\\end{lemma}\n\n\\begin{proof}\nThe proof is very similar to that of Lemma~\\ref{lemma:lowerbound1}. The only difference is that checking the desired bounds for $\\textrm{dang}(2j-1)$ and $\\textrm{dang}(2j)$ is slightly more complicated. As before, we do not control the number of cops in $E_{2j}(v)$ and $E_{2j+1}(v)$, clearly $\\textrm{C}^x_{2j}(v)$ and $\\textrm{C}^x_{2j+1}(v)$ are bounded from above by $\\bar{K}$, the total number of cops. We get\n\\begin{eqnarray*}\n\\frac 13 \\left( \\frac{d}{30\\bar c(2j+1)} \\right)^j \\cdot \\textrm{dang}(2j-1) &\\le& 2\\bar c \\cdot \\textrm{C}_{\\le (2j)}^x(v) \\le 2\\bar c \\cdot (2+o(1)) \\bar{K} \\\\\n&\\le& 5\\bar c \\cdot \\left( \\frac{d}{30\\bar c(2j+1)} \\right)^{j+1},\n\\end{eqnarray*}\nand consequently $\\textrm{dang}(2j-1) \\le \\frac {d}{2(2j+1)}$, as required. (Note that we have room to spare here but we cannot take advantage of it so we do not modify the definition of being $(2j-1)$-dangerous.)\n\nLet us now notice that a cop at distance $2j+1$ from $v$ can contribute to the ``dangerousness'' of more than $\\bar c$ neighbours of $v$. However, the number of paths of length $2j$ joining $v$ and $w$ is bounded from above by $\\bar c d^{2j}\/n$ (see Lemma~\\ref{lem:elem2}(ii) and note that $d^{2j} = n^{2j \\alpha + o(1)} \\ge 7 n \\log n$, since $2j \\alpha > 1$). Hence,\n\\begin{eqnarray*}\n\\frac 13 \\left( \\frac{d}{30\\bar c(2j+1)} \\right)^j \\cdot \\textrm{dang}(2j) &\\le& \\frac {2 \\bar c d^{2j}}{n} \\cdot \\textrm{C}_{\\le (2j+1)}^x(v) \\le \\frac {2 \\bar c d^{2j}}{n} \\cdot (2+o(1)) \\bar{K} \\\\\n&\\le& 5 \\bar c \\cdot \\left( \\frac{d}{30\\bar c(2j+1)} \\right)^{j+1},\n\\end{eqnarray*}\nand, as desired, $\\textrm{dang}(2j)\\le \\frac{d}{2(2j+1)}$. Besides this modification the argument remains basically the same.\n\\end{proof}\n\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} {"text":"\\section{Introduction}\n\n\n\\subsection{The spherical sup-norm problem}\nThe sup-norm problem on arithmetic Riemannian manifolds is a question at the interface of harmonic analysis and number theory that intrinsically combines techniques from both areas. Let $X = \\Gamma \\backslash G\/K$ be a locally symmetric space of finite volume, where $\\Gamma$ is an arithmetic subgroup. Arithmetically and analytically, the most interesting functions in $L^2(X)$ are joint eigenfunctions $\\phi$ of all invariant differential operators and the Hecke operators: these are precisely the functions that arise from (spherical) automorphic forms. The sup-norm problem asks for a quantitative comparison of the $L^2$-norm ${\\|\\phi\\|}_2$ and the sup-norm ${\\|\\phi\\|}_{\\infty}$, most classically in terms of the Laplace eigenvalue $\\lambda_{\\phi}$, but depending on the application also in terms of the volume of $X$ or other relevant quantities. Upper bounds for the sup-norm in terms of the Laplace eigenvalue are a measure for the equidistribution of the mass of high energy eigenfunctions which sheds light on the question to what extent these eigenstates can localize (``scarring''). Besides the quantum mechanical interpretation, the sup-norm problem in its various incarnations has connections to the multiplicity problem, zero sets and nodal lines of automorphic functions, and bounds for Faltings' delta function, to name just a few. See \\cite{Sarnak2004Morawetz, Rudnick2005, GhoshReznikovSarnak2013, JorgensonKramer2004}.\n\nIf $X$ is compact, the most general upper bound is due to Sarnak \\cite{Sarnak2004Morawetz}:\n\\begin{equation}\\label{sa}\n{\\|\\phi\\|}_{\\infty} \\ll_X \\lambda_{\\phi}^{(\\dim X - \\rk X)\/4}{\\|\\phi\\|}_2,\n\\end{equation}\na bound which does not use the Hecke property and is in fact sharp (for general $X$) under these weaker assumptions. Sarnak derives this bound from asymptotics of spherical functions. A slightly different but ultimately related argument proceeds via a pre-trace inequality that bounds ${\\|\\phi\\|}_{\\infty}^2$ by a sum of an automorphic kernel over $\\gamma \\in \\Gamma$. If the test function is an appropriate Paley--Wiener function, only the identity contributes to this sum, and one obtains as a (``trivial'') upper bound for ${\\|\\phi\\|}_{\\infty}$ the square-root of the spectral density as given in terms of the Harish-Chandra $\\textbf{c}$-function. If the Langlands parameters of $\\phi$ are in generic position, this coincides with \\eqref{sa}.\n\nTo go beyond \\eqref{sa}, one uses a test function that localizes not only the archimedean Langlands parameters, but in addition the parameters at a large number of finite places (where ``large'' means a function tending to infinity as a small and carefully chosen power of $\\lambda_{\\phi}$). This is called the amplification technique and leads, after estimating the automorphic kernel, to a problem in the geometry of numbers: count the elements of $G$ which appear in Hecke correspondences and lie in regions of $G$ according to the size of the kernel (such as counting rescaled integer matrices lying close to $K$). It has been implemented successfully in a variety of cases, see e.g.\\ \\cite{IwaniecSarnak1995, HarcosTemplier2013, BlomerPohl2016, BlomerMaga2016, Marshall2014a, Templier2015, Saha2017a, BlomerHarcosMagaMilicevic2020} and the references therein.\n\n\\subsection{Automorphic forms with $K$-types}\nIn this paper we want to open a new perspective on the sup-norm problem and propose a version of higher complexity. The sup-norm problem makes perfect sense not only on the level of symmetric spaces, but also on the level of groups, and a priori there is no reason why one should restrict to spherical, i.e.\\ right $K$-invariant automorphic forms. Let $\\tau$ be an irreducible unitary representation of $K$ on some finite-dimensional complex vector space $V^{\\tau}$, and consider the homogeneous vector bundle over $G\/K$ defined by $\\tau$. A cross-section may then be identified with a vector-valued function $f:G\\to V^{\\tau}$ which transforms on the right by $K$ with respect to $\\tau$:\n\\[ f(gk) = \\tau(k^{-1})f(g),\\qquad g\\in G,\\quad k \\in K. \\]\nIt is now an interesting question to bound the sup-norm of $f$ or, more delicately, its components as the \\emph{dimension} of $V^{\\tau}$ gets large. Such a situation cannot be realized in the classical case $G = \\SL_2(\\RR)$, since $K = \\SO_2(\\RR)$ is abelian, hence each $V^{\\tau}$ is one-dimensional. In this paper, we offer a detailed investigation of the first nontrivial case $G = \\SL_2(\\CC)$. For concreteness, we choose the congruence lattice $\\Gamma = \\SL_2(\\ZZ[i])$, although our results extend to more general arithmetic quotients of $G$ using the techniques in \\cite{BlomerHarcosMagaMilicevic2020}.\n\nNontrivial irreducible unitary representations of $G$ are principal series representations parametrized by certain pairs $(\\nu, p) \\in \\mfa^{\\ast}_{\\CC} \\times \\frac{1}{2}\\ZZ$, where as usual $\\mfa$ is the Lie algebra of the subgroup of positive diagonal matrices; see \\S\\ref{SL2C-subsec}. (By a small abuse of notation we will later interpret $\\nu$ simply as a complex number.) Each representation space $V$ of $G$ decomposes as a Hilbert space direct sum\n\\begin{equation}\\label{decomp}\nV = \\bigoplus_{\\substack{\\ell\\geq|p|\\\\\\ell\\equiv p\\one}} V^{\\ell}\n= \\bigoplus_{\\substack{\\ell\\geq|p|\\\\\\ell\\equiv p\\one}} \\ \\bigoplus_{\\substack{|q| \\leq \\ell\\\\q\\equiv\\ell\\one}}V^{\\ell,q},\n\\end{equation}\nwhere $V^{\\ell,q}$ is one-dimensional. Here and later, $\\ell\\in\\frac{1}{2}\\ZZ_{\\geq 0}$ parametrizes the $K$-type, i.e.\\ the $(2\\ell+1)$-dimensional representation $\\tau_{\\ell}$ of $K$, and the diagonal matrix $\\diag(e^{i\\varrho}, e^{-i\\varrho})\\in K$ acts on $V^{\\ell,q}$ by $e^{2qi\\varrho}$. (The upper index $\\ell$ in $V^\\ell$ should not be mistaken for $\\ell$-th power.) \n\nRepresentations occurring in $L^2(\\Gamma\\backslash G)$ consist of even functions on $G$ and have $p\\in\\ZZ$. A representation contains a spherical vector only if $p = 0$. In particular, the forms with $p\\neq 0$ are untouched by any of the spherical sup-norm literature. For $p \\neq 0$, no complementary series exists, so $\\nu \\in i\\mfa^{\\ast}$.\n\n\\subsection{Main results I: vector-valued forms}\\label{main-results-intro-sec}\nAs explained above, we are interested in ``big'' $K$-types which occur for all representation parameters $|p| \\leq \\ell$, but arguably the most interesting case is when the $K$-type is ``new'' and no lower $K$-types appear in the same automorphic representation space. Hence from now on we restrict to $p = \\ell$. The sup-norm problem for large $\\nu$ was studied in detail in \\cite{BlomerHarcosMagaMilicevic2020}, so here we keep $\\nu$ in a fixed compact subset $I\\subset i\\RR$ and let $\\ell$ vary. The spectral density is a constant multiple of $p^2 - \\nu^2$. In particular, for a given $K$-type $\\tau_{\\ell}$, there are $\\OO_I(\\ell^2)$ cuspidal automorphic representations $V\\subset L^2(\\Gamma\\backslash G)$ with spectral parameter $\\nu\\in I$ and $p = \\ell$ (see \\cite{dever2020ambient}), and in the light of the trace formula this bound is expected to be sharp. In each of these we consider the $(2\\ell+1)$-dimensional subspace $V^{\\ell}$. Let us choose an orthonormal basis $\\{ \\phi_q : |q| \\leq \\ell\\}$ of $V^{\\ell}$, with $\\phi_q\\in V^{\\ell,q}$ as in \\eqref{decomp}. The function $G\\to\\CC^{2\\ell+1}$ given by\n\\begin{equation}\\label{eq:vectorvalued}\ng\\mapsto\\left(\\phi_{-\\ell}(g), \\dotsc, \\phi_\\ell(g)\\right)^{\\top}\n\\end{equation}\nis a vector-valued automorphic form for the group $\\Gamma$ with spectral parameter $\\nu$ and $K$-type $\\tau_{\\ell}$.\nThe Hermitian norm of this function,\n\\[\\Phi(g):=\\Bigl(\\sum_{|q|\\leq \\ell} |\\phi_q(g)|^2\\Bigr)^{1\/2},\\qquad g\\in G,\\]\nis independent of the choice of the orthonormal basis, and it satisfies ${\\|\\Phi\\|}_2=(2\\ell+1)^{1\/2}$. Let us fix a compact subset $\\Omega\\subset G$. Our remarks on spectral density and dimension suggest that\n\\begin{equation}\\label{3\/2-exp}\n {\\| \\Phi|_{\\Omega} \\|}_{\\infty} :=\\Bigl\\| \\sum_{|q| \\leq \\ell} |\\phi_q|_{\\Omega}|^2\\Bigr\\|^{1\/2}_{\\infty}\\ll_{\\Omega, I} \\ell^{3\/2}\n \\end{equation}\nshould be regarded as the ``trivial'' bound; cf.~Remark~\\ref{non-arith}. Our first result is a power-saving improvement.\n\n\\begin{theorem}\\label{thm1} Let $\\ell\\geq 1$ be an integer, $I\\subset i\\RR$ and $\\Omega\\subset G$ be compact sets.\nLet $V\\subset L^2(\\Gamma\\backslash G)$ be a cuspidal automorphic representation with minimal $K$-type $\\tau_{\\ell}$ and spectral parameter $\\nu_V\\in I$. Then for any $\\eps>0$ we have\n\\[ {\\| \\Phi|_{\\Omega} \\|}_{\\infty} \\ll_{\\eps,I,\\Omega} \\ell^{4\/3+\\eps}. \\]\n\\end{theorem}\n\nWe will explain some ideas of the proof in a moment, but we remark already at this point that the exponent is the best possible, given that we sacrifice cancellation of the terms on the geometric side of the pre-trace formula and given our\ncurrent knowledge on the construction of the most efficient amplifier. In other words, under these conditions we solve the arising matrix counting problem in a best possible way.\nSince we trivially have ${\\|\\Phi\\|}_{\\infty}\\gg\\ell^{1\/2}$, the above bound is one-sixth of the way from the trivial down to the best possible exponent (absent the possibility of some escape of mass into a cusp). This matches (after a renormalization) the original and still the best available subconvexity exponent $5\/24$ of Iwaniec--Sarnak~\\cite{IwaniecSarnak1995} for the sup-norms of spherical Maa{\\ss} forms of large Laplace eigenvalue on arithmetic hyperbolic surfaces.\n\n\\subsection{Main results II: individual vectors}\nIt is a much more subtle endeavour to investigate the sup-norm of the individual basis elements $\\phi_q$. Here one must contend with the inherent high multiplicity, a known serious barrier in the sup-norm problem. Indeed, a straightforward construction \\cite{Sarnak2004Morawetz} shows that\nsome scalar-valued $L^2$-normalized form $\\phi\\in V^{\\ell}$ (essentially the projection of the vector-valued form \\eqref{eq:vectorvalued} in the modulus-maximizing direction) has sup-norm on $\\Omega$ as large as ${\\|\\Phi|_{\\Omega}\\|}_{\\infty}$ in Theorem~\\ref{thm1}. However, our natural basis $\\{\\phi_q : |q| \\leq \\ell\\}$ of $V^{\\ell}$ is distinguished by consisting of eigenfunctions under the action of the group $\\{\\diag(e^{i\\theta}, e^{-i\\theta}) : \\theta \\in \\RR\\}$ of diagonal matrices in $K$. This is the classical basis with respect to which the representation $\\tau_\\ell$ is given by the Wigner $D$-matrix. By a similar heuristic reasoning as for \\eqref{3\/2-exp}, one might expect that the baseline bound should be ${\\| \\phi_q |_{\\Omega} \\|}_{\\infty} \\ll \\ell$. Indeed, we prove this bound up to a factor of $\\ell^{\\eps}$ (cf.\\ Remark~\\ref{non-arith} below), noting that it is not ``trivial'' in any sense other than that it does not require arithmeticity. Moreover, as shown by the next theorem, we are in fact able to break this barrier.\n\n\\begin{theorem}\\label{thm2}\nUnder the assumptions of Theorem~\\ref{thm1}, we have\n\\[\\max_{|q|\\leq\\ell}\\, {\\| \\phi_q |_{\\Omega} \\|}_{\\infty} \\ll_{\\eps,I,\\Omega} \\ell^{26\/27+\\eps}.\\]\n\\end{theorem}\n\nFor special values of $q$ we can improve on the exponent considerably. The central vector $\\phi_{0}$ is distinguished as can the ``archimedean newvector'' \\cite{Popa2008} in the sense that its Whittaker function determines the archimedean $L$-factor of the underlying representation. Another interesting situation is the extreme case of the vector $\\phi_{\\pm\\ell}$.\n\n\\begin{theorem}\\label{thm3} Keep the assumptions of Theorem~\\ref{thm1}. \n\\begin{enumerate}[(a)]\n\\item\\label{thm3-a}\nFor $q = 0$ we have\n\\[ {\\| \\phi_{0} |_{\\Omega} \\|}_{\\infty} \\ll_{\\eps,I,\\Omega} \\ell^{7\/8+\\eps}.\\]\n\\item\\label{thm3-b}\nSuppose that $V$ lifts to an automorphic representation for $\\PGL_2(\\ZZ[i])\\backslash\\PGL_2(\\CC)$. For $q = \\pm \\ell$ we have\n\\[{\\| \\phi_{\\pm \\ell} |_{\\Omega} \\|}_{\\infty} \\ll_{\\eps,I,\\Omega} \\ell^{1\/2+\\eps}. \\]\n\\end{enumerate}\n\\end{theorem}\n\nThe strong numerical saving in the case $q = \\pm \\ell$, going far beyond the Weyl exponent, is quite remarkable, in particular in view of the seemingly weaker saving in Theorem~\\ref{thm1} which might be regarded as an easier case. We will discuss this in \\S \\ref{KS-intro}. The assumption that $V$ is associated to a representation of $\\PGL_2$ rather than $\\SL_2$ is only for technical simplicity and not essential to the method, cf.\\ \\S \\ref{RSSection}. This assumption holds if and only if the elements of $V$ are fixed by the Hecke operator $T_i$ (which is an involution on $L^2(\\Gamma\\backslash G)$).\n\n\\begin{remark} In the case of the spherical sup-norm problem, Sarnak~\\cite{Sarnak2004Morawetz} put forward the purity conjecture that the accumulation points of the set\n\\[ \\left\\{\\frac{\\log {\\|\\psi\\|}_{\\infty}}{\\log \\lambda_{\\psi}}:\\text{$\\psi$ is a joint eigenfunction}\\right\\} \\]\nlie in $\\frac{1}{4}\\ZZ$. It would be very interesting to see if an analogous conjecture may be expected in the $K$-aspect, and even if there may be examples exhibiting different layers of power growth as in \\cite{Milicevic2011,Blomer2020,BrumleyMarshall2020}. In particular, the savings in Theorem~\\ref{thm3} produce already a considerable ``exponent gap''.\n\\end{remark}\n\n\\begin{remark}\\label{non-arith}\nWe record that our essentially best possible estimates on the spherical trace function in \\S\\ref{gen-sph-fun-intro-sec}, which are of purely analytic nature, coupled with the formalism of the pre-trace inequality, yield what might be considered ``trivial'' geometric estimates: for any co-finite Kleinian subgroup $\\Gamma\\leq G$, without any arithmeticity assumption, we have\n\\[ {\\|\\Phi|_{\\Omega}\\|}_{\\infty}\\ll_{I,\\Omega,\\Gamma}\\ell^{3\/2}\\qquad\\text{and}\\qquad\n{\\|\\phi_q|_{\\Omega}\\|}_{\\infty}\\ll_{\\eps,I,\\Omega,\\Gamma}\\ell^{1+\\eps} \\]\nfor any $L^2$-normalized vector-valued Maa{\\ss} eigenform $(\\phi_{-\\ell},\\dots,\\phi_{\\ell})^{\\top}$ with spectral parameter $\\nu\\in I$ and $K$-type $\\tau_{\\ell}$ (with $\\phi_q\\in V^{\\ell,q}$ as before).\n\\end{remark}\n\nOur Theorems~\\ref{thm1}--\\ref{thm3} above, and the non-spherical sup-norm problem in general, come with several novelties of representation theoretic, analytic and arithmetic nature that we discuss briefly in the following subsections.\n\n\\subsection{Generalized spherical functions}\\label{gen-sph-fun-intro-sec}\nThe classical pre-trace formula features on the geometric side the Harish-Chandra transform $\\widecheck{h}$ of the test function $h$ on the spectral side. This transform is a bi-$K$-invariant function obtained by integrating $h$ against the elementary spherical functions (which themselves are bi-$K$-invariant, and hence in the case of $G = \\SL_2(\\CC)$ simply a function of one real variable). In typical applications there is no cancellation in this integral, so an asymptotic analysis of spherical functions is the first key step (see \\cite{BlomerPohl2016} for a general result in this direction). Our set-up requires a generalized version for homogeneous vector bundles over $G\/K$. For $G = \\SL_2(\\CC)$, the corresponding \\emph{spherical trace function} equals (see \\S \\ref{section:sphericaltransform} for details)\n\\begin{equation}\\label{spherical-def}\n\\varphi_{\\nu,\\ell}^{\\ell}(g) =\n(2\\ell+1)\\int_K \\psi_{\\ell}(\\kappa(k^{-1} g k))\\,e^{(\\nu-1)\\rho(H(gk))}\\,\\dd k,\n\\end{equation}\nwhere $\\dd k$ is the probability Haar measure on $K$, $\\rho$ is the unique positive root, $\\kappa$ (resp.\\ $H$) is the $KAN$ Iwasawa projection onto $K$ (resp.\\ $\\mfa$), and\n\\begin{equation}\\label{chi-ell}\n\\psi_{\\ell}\\left( \\begin{pmatrix} \\alpha &\\beta \\\\ - \\bar{\\beta} & \\bar{\\alpha} \\end{pmatrix} \\right) := \\bar{\\alpha}^{2\\ell}, \\qquad \\left( \\begin{matrix} \\alpha &\\beta \\\\ - \\bar{\\beta} & \\bar{\\alpha} \\end{matrix} \\right) \\in K.\n\\end{equation}\nThe trivial bound is $|\\varphi_{\\nu,\\ell}^{\\ell}(g)|\\leq 2\\ell+1$, which is sharp for $g = \\pm\\id$, and the key question is how quickly $\\varphi_{\\nu,\\ell}^{\\ell}(g)$ decays, uniformly in $\\ell$, as $g\\in G$ moves away from $\\pm\\id$. We observe that $\\varphi_{\\nu,\\ell}^{\\ell}(g)$ is invariant under conjugation by $K$, hence it suffices to investigate it for upper triangular matrices $g\\in G$. We shall use the Frobenius norm\n$\\|g\\|:= \\sqrt{\\tr(gg^*)}$, and we note that for $g\\in G$ this is always at least $\\sqrt{2}$. The following bound is new and most likely sharp for fixed $\\nu\\in i\\RR$ (up to factors $\\ell^{\\eps}$ and powers of $\\| g \\|$).\n\n\\begin{theorem}\\label{thm4} Let $\\ell\\geq 1$ be an integer, and let $g = \\left(\\begin{smallmatrix} z & u\\\\ & z^{-1}\\end{smallmatrix}\\right) \\in G$ be upper triangular. Then for any $\\nu\\in i\\RR$, $k \\in K$, $\\eps>0$, we have\n\\[ \\varphi_{\\nu,\\ell}^{\\ell}(k^{-1}gk) \\ll_{\\eps} \n\\min\\left(\\ell, \\frac{\\ell^\\eps\\|g\\|^6}{|z^2 - 1|^2}, \\frac{\\ell^{1\/2+\\eps}\\|g\\|^3}{|u|}\\right). \\]\n\\end{theorem}\n\nThe proof shows that the factor $\\ell^{\\varepsilon}$ can be replaced with a suitable power of $\\log 2\\ell$. The same remark applies to Theorems~\\ref{thm6} and \\ref{thm5} below. \n \nThe spherical trace function $\\varphi_{\\nu,\\ell}^{\\ell}$ can be used to analyze the vector-valued function\n\\eqref{eq:vectorvalued}. It is, unfortunately, unable to identify the individual components $\\phi_q$, and there does not seem to exist a general theory of spherical functions covering such cases. As the components are eigenfunctions of the action of the diagonal elements, we can single out $\\phi_q$ by considering\n\\begin{equation}\\label{spherical-averaged}\n\\varphi_{\\nu,\\ell}^{\\ell,q}(g):=\\frac1{2\\pi}\\int_0^{2\\pi}\\varphi_{\\nu,\\ell}^{\\ell}\\left(g\\diag(e^{i\\varrho},e^{-i\\varrho})\\right)\\,e^{-2qi\\varrho}\\,\\dd \\varrho.\n\\end{equation}\nThe function $\\varphi_{\\nu,\\ell}^{\\ell,q}$ is an interesting object that does not seem to have been considered before. It is not conjugation invariant anymore, so it needs to be analyzed on the entire $6$-dimensional group $G = \\SL_2(\\CC)$, and little preliminary reduction is possible. When restricted to $K$, it is not hard to see that $\\varphi_{\\nu,\\ell}^{\\ell,q}(k)$, for $k = k[u,v,w]\\in K$ written in terms of Euler angles (cf.\\ \\eqref{decomp-K}), is essentially a Jacobi polynomial in $\\cos 2v$. We refer to \\S \\ref{thm5a-proof-sec} for a more detailed discussion. In particular,\n$\\varphi_{\\nu,\\ell}^{\\ell,q}(\\pm\\id)=1$. Therefore, at least heuristically, a safe baseline bound should be\n\\begin{equation}\\label{trivial-q}\n\\varphi_{\\nu,\\ell}^{\\ell,q}(g) \\ll_\\eps \\ell^\\eps.\n\\end{equation}\nUnlike in the bi-$K$-invariant case, where the trivial bound is just an application of the triangle inequality and hence is indeed trivial, the expected baseline bound \\eqref{trivial-q} turns out to be hard to prove. It requires very strong cancellation in the $\\varrho$-integral, along with the decay properties of $\\varphi_{\\nu,\\ell}^{\\ell}$. Taking \\eqref{trivial-q} for granted, we wish to investigate in what directions and with what speed we can identify decay as we move away from $\\pm\\id\\in G$. Interestingly, this is extremely sensitive to the value of $q$.\n\nLet $\\mcD\\subset G$ be the set of diagonal matrices, $\\mcS$ the normalizer of $A$ in $K$ (which consists of the diagonal and the skew-diagonal matrices lying in $K$), and\n\\begin{equation}\\label{adbc}\n\\mcN:=\\left\\{\\begin{pmatrix}a & b\\\\ c & d \\end{pmatrix}\\in G: |a| = |d|, \\ |b| = |c|\\right\\}.\n\\end{equation}\nIt is clear that $\\mcS\\subset K\\subset\\mcN\\subset G$. For $g \\in G$ and non-empty $\\mcH \\subset G$, we shall write $\\dist(g,\\mcH)$ for their distance $\\inf_{h\\in\\mcH}\\|g-h\\|$. Note that here $\\|g-h\\|=\\|g^{-1}-h^{-1}\\|$, hence also\n\\begin{equation}\\label{distinvariance}\n\\dist(g,\\mcH)=\\dist(g^{-1},\\mcH^{-1}).\n\\end{equation}\nAs an alternative to $\\dist(g,\\mcN)$, we shall also use\n\\begin{equation}\\label{Dgdef}\nD(g):=\\left||a|^2-|d|^2\\right|+\\left||b|^2-|c|^2\\right|.\n\\end{equation}\nFor orientation, we remark the elementary inequality\n\\[\\dist(g,\\mcN)^2\\leq D(g)\\leq 2\\|g\\|\\dist(g,\\mcN).\\]\nIn the spirit of \\cite[Th.~2]{BlomerPohl2016}, we use a soft argument that provides some decay of $\\varphi_{\\nu,\\ell}^{\\ell,q}(g)$ in generic ranges and considerable uniformity.\n\\begin{theorem}\\label{thm6} Let $\\ell,q\\in\\ZZ$ be such that $\\ell\\geq\\max(1,|q|)$. Let $\\nu\\in i\\RR$ and $g \\in G$.\nThen for any $\\eps>0$ and $\\Lambda>0$, we have\n\\begin{equation}\\label{thm6bound}\n\\varphi_{\\nu,\\ell}^{\\ell,q}(g) \\ll_{\\eps,\\Lambda}\\ell^{\\eps}\\min\\left(1,\\frac{\\| g \\|}{\\sqrt{\\ell}\\dist(g,K)^2\\dist(g,\\mcD)}\\right) + \\ell^{-\\Lambda}.\n\\end{equation}\n\\end{theorem}\nIn the special case $q\\in\\{-\\ell,0,\\ell\\}$, we use more elaborate arguments for stronger bounds.\n\n\\begin{theorem}\\label{thm5} Let $\\ell\\geq 1$ be an integer, $\\nu\\in i\\RR$ and $g\\in G$. Let $\\eps>0$ and $\\Lambda>0$ be two parameters.\n\\begin{enumerate}[(a)]\n\\item\\label{thm5-a}\nWe have\n\\begin{equation}\\label{thm5boundq=0}\n\\varphi_{\\nu,\\ell}^{\\ell,0}(g) \\ll_{\\eps,\\Lambda}\n\\ell^{\\eps}\\min\\left(1, \\frac{1}{\\sqrt{\\ell} \\dist(g, \\mcS)}\\right)+\\ell^{-\\Lambda}.\n\\end{equation}\nMoreover, $\\varphi_{\\nu,\\ell}^{\\ell,0}(g) \\ll_{\\Lambda} \\ell^{-\\Lambda}$ holds unless $D(g)\\ll_\\Lambda\\|g\\|^2(\\log\\ell)\/\\sqrt{\\ell}$.\n\\item\\label{thm5-b}\nWe have\n\\begin{equation}\\label{thm5boundq=ell}\n\\varphi_{\\nu,\\ell}^{\\ell,\\pm \\ell}(g) \\ll_{\\eps} \\| g \\|^{-2+\\eps} \\ell^{\\eps}.\n\\end{equation}\nMoreover, $\\varphi_{\\nu,\\ell}^{\\ell,\\pm \\ell}(g) \\ll_{\\Lambda} \\ell^{-\\Lambda}$ holds unless\n$\\dist(g, \\mcD) \\ll_\\Lambda\\| g \\|\\sqrt{\\log\\ell}\/\\sqrt{\\ell}$.\n\\end{enumerate}\n\\end{theorem}\n\nWe expect that the bounds in Theorem~\\ref{thm5} are essentially best possible, possibly up to powers of $\\ell^{\\varepsilon}$ and $\\| g \\|$. The proof requires detailed analysis that could in principle be applied to all values of $q$ and would detect, for instance, further Airy-type bumps in certain regions and for certain choices of parameters.\n\n\\begin{remark}\\label{remark3}\nLess precise results but in a more general setting were obtained by Ramacher~\\cite{Ramacher2018} using operator theoretical methods. Combined with an argument of Marshall~\\cite{Marshall2014a}, these were applied by Ramacher--Wakatsuki~\\cite{RamacherWakatsuki2017a} to the sup-norm problem with $K$-types. For compact arithmetic quotients of $\\SL_2(\\CC)$, and for $\\phi\\in V^{\\ell}$ as before,\n\\cite[Th.~7.12]{RamacherWakatsuki2017a} yields ${\\| \\phi \\|}_{\\infty} \\ll \\ell^{5\/2 - \\delta}$ with an unspecified\nconstant $\\delta>0$; this does not even recover the baseline bound.\n\\end{remark}\n\n\\subsection{Paley--Wiener theory}\nFor a reductive Lie group $G$, Paley--Wiener theory characterizes the image of $C_c^{\\infty}(G)$ under the Harish-Chandra transform. For bi-$K$-invariant functions, this is a famous result of Gangolli~\\cite{MR289724}: the image consists of entire, Weyl group invariant functions satisfying certain growth conditions. For general $K$-finite functions, the picture is much more complicated: any linear relation that holds for the matrix coefficients of generalized principal series also needs to hold for the matrix coefficients of the operator-valued Fourier transform (and hence for the $\\tau$-spherical transforms for $\\tau\\in\\widehat{K}$). A complete list of these ``Arthur--Campoli relations'' requires a full knowledge of all the irreducible subquotients of the non-unitary principal series, which in general is not available. Arthur~\\cite{MR697608} describes them as a sequence of successive residues of certain meromorphic functions; see also \\cite{Campoli1979}. Needless to say, a good knowledge of available functions on the spectral side is crucial for the quantitative analysis of the pre-trace formula in the sup-norm problem.\n\nFor the case of $G = \\SL_2(\\CC)$, in a somewhat neglected paper, Wang~\\cite{Wang1974} devised an elegant argument to establish a completely explicit Paley--Wiener theorem for the $\\tau_{\\ell}$-spherical transform acting on $C_c^{\\infty}(G)$: in addition to the Weyl group symmetry, we have the additional symmetry $(\\nu, p) \\leftrightarrow (p, \\nu)$ whenever $\\nu \\equiv p\\pmod{1}$ and $|\\nu|, |p| \\leq \\ell$; see Theorem~\\ref{thm10} in \\S \\ref{section:sphericaltransform}. The additional symmetry is counter-intuitive at first (the pairs $(\\nu,p)\\neq(0,0)$ satisfying $\\nu\\equiv p\\pmod{1}$ correspond to a discrete set of non-unitary representations), but it enters the picture as it fixes the eigenvalues $\\nu^2+p^2$ and $\\nu p$ of two generators of $Z(\\mathcal{U}(\\mfg))$, and hence the infinitesimal character. See \\cite[Cor.~2]{Wang1974} and its proof. A more conceptual explanation, along the lines of irreducible subquotients, can be found after \\eqref{eq:tau-ell-isotypical-decomposition-algebraic}. Wang's remarkable result is that these are \\emph{all} relations.\n\nThe extra symmetry makes the application of the pre-trace formula more delicate. For instance, it appears impossible to single out an individual value of $p$ by a manageable test function on the spectral side. We circumvent this problem by employing a carefully chosen Gaussian \\eqref{eq:def-gaussian-spectral-weight} that at least asymptotically singles out our preferred value $p=\\ell$. The price to pay for this maneuver is that we lose compact support. As a result of independent interest, we prove a new Paley--Wiener theorem for $K$-finite Schwartz class functions on $G = \\SL_2(\\CC)$. For the notation, see \\S \\ref{section:sphericaltransform}.\n\n\\begin{theorem}\\label{thm:pws} For $f\\in\\mcH(\\tau_{\\ell})$, the following two conditions are equivalent (with implied constants depending on $f$).\n\\begin{enumerate}[(a)]\n\\item\\label{pws-a} The function $f(g)$ is smooth, and for any $m\\in\\ZZ_{\\geq 0}$ and $A>0$ we have\n\\begin{equation}\\label{eq:mAbound}\n\\frac{\\partial^m}{\\partial h^m}f(k_1 a_h k_2)\\ll_{m,A} e^{-A|h|},\\qquad h\\in\\RR,\\quad k_1,k_2\\in K.\n\\end{equation}\n\\item\\label{pws-b} The function $\\widehat{f}(\\nu,p)$ extends holomorphically to $\\CC\\times\\tfrac12\\ZZ$ such that\n\\begin{equation}\\label{eq:symmetry}\\widehat{f}(\\nu,p)=\\widehat{f}(p,\\nu),\\qquad\\nu\\equiv p\\one,\\quad|\\nu|,|p|\\leq\\ell,\n\\end{equation}\nand for any $B,C>0$ we have\n\\begin{equation}\\label{eq:BCbound}\n\\widehat{f}(\\nu,p)\\ll_{B,C} (1+|\\nu|)^{-C},\\qquad|\\Re\\nu|\\leq B,\\quad p\\in\\tfrac12\\ZZ.\n\\end{equation}\n\\end{enumerate}\n\\end{theorem}\n\nThe Schwartz space offers a lot more flexibility in applications. A less precise result for more general groups is given in \\cite[Th.~3]{MR1111747}, and we refer the reader to the introduction of that paper for additional discussion and motivation of Paley--Wiener type theorems for rapidly decaying functions.\n\n\\subsection{Beyond the pre-trace formula: a fourth moment}\\label{KS-intro}\nWe still owe an explanation for the sub-Weyl exponent in Theorem~\\ref{thm3}\\ref{thm3-b}, where $q = \\pm \\ell$. The proof of this bound is different from the other results: it is inspired by a brilliant recent idea of Steiner and Khayutin--Steiner~\\cite{St, KhayutinSteiner2020} in the \\emph{weight} aspect for the groups $\\SO_3(\\RR)$ and $\\SL_2(\\RR)$. The starting point is the desire to choose the amplifier so long that it works as self-amplification. In this way, the amplifier can be made independent of the well-known but inefficient trick of using the Hecke relation $\\lambda_p^2 - \\lambda_{p^2} = 1$. A self-amplified second moment is in effect a fourth moment, and the key observation is that it can be realized as the diagonal term in a \\emph{double} pre-trace formula. This only has a chance to work if the corresponding geometric side can be analyzed sufficiently accurately, and to this end, two extra features are necessary: a special behaviour of spherical functions with rapid decay conditions (such as, for instance, the Bergman kernel for $\\SL_2(\\RR)$) and the possibility for a \\emph{second moment} count on the geometric side, i.e.\\ pairs of matrices, in a best possible way.\n\nFor the proof of Theorem~\\ref{thm3}\\ref{thm3-b}, we implement this idea for first time in the context of principal series representations. Our proof proceeds differently than both of \\cite{St} and \\cite{KhayutinSteiner2020}. We avoid the theta correspondence and instead detect the diagonal term in the double pre-trace formula by an argument that is reminiscent of the Voronoi formula for Rankin--Selberg $L$-functions over $\\QQ[i]$, cf.\\ \\S \\ref{sec28}. As we lose positivity, we have to use the full power of the pre-trace formula, unlike our other results where the softer pre-trace inequality suffices. The argument is analytically subtle, since we also lose the possibility to choose the test function in the pre-trace formula freely: part of it is now given to us by the gamma kernel in the Voronoi summation formula (a new feature compared to \\cite{St} and \\cite{KhayutinSteiner2020}). At this point we need a very precise understanding of the Harish-Chandra transform in Theorem~\\ref{thm:pws} with complete uniformity in the auxiliary complex parameters, and the reader may observe that in the end only the strong $g$-dependence in \\eqref{thm5boundq=ell} saves the final bound.\n\n\\subsection{Matrix counting}\nHaving discussed some of the analytic and representation theoretic novelties, we finally comment briefly on the arithmetic part. In all previous instances of the sup-norm problem, the analysis of the geometric side of the pre-trace formula amounts to counting matrices close to $K$, because the elementary spherical function is bi-$K$-invariant and decays away from $K$. Given the results on spherical trace functions in \\S \\ref{gen-sph-fun-intro-sec}, it is clear that from an arithmetic point of view the sup-norm problem with big $K$-types is conceptually very different from the spherical sup-norm problem.\n\nThe localization behaviour of generalized spherical functions has distinct features as reflected by Theorems~\\ref{thm4} and \\ref{thm5}. The spherical trace function $\\varphi_{\\nu,\\ell}^{\\ell}$ concentrates close to the identity. The functions $\\varphi_{\\nu,\\ell}^{\\ell,\\pm\\ell}$ localize sharply around diagonal matrices (but not necessarily within $K$). For $\\varphi_{\\nu,\\ell}^{\\ell,0}$, there is localization on diagonal and skew-diagonal matrices within $K$, then there is a gradual transition to a second layer in a neighbourhood of the 4-dimensional manifold $\\mcN$ defined by \\eqref{adbc}, and outside this neighbourhood we see sharp decay. Theorem~\\ref{thm6} is in some sense a combination of these two extreme cases. Correspondingly, the counting techniques in \\S\\S \\ref{thm1-proof-sec}--\\ref{sec-proof2} are still based on the geometry of numbers, but they differ conceptually and technically from the earlier treatment of the spherical sup-norm problem. In particular, as mentioned in \\S \\ref{KS-intro}, for the proof of Theorem~\\ref{thm3}\\ref{thm3-b} we have to achieve a best possible double matrix count, cf.\\ Lemma~\\ref{lemma-ell-count}.\n\n\\subsection{Acknowledgements}\nThis work began during D.M.'s term as Director's Mathematician in Residence at the Budapest Semesters of Mathematics program in the summer of 2018; D.M. would like to thank BSM, the Alfr\\'ed R\\'enyi Institute of Mathematics, as well as the Max Planck Institute for Mathematics for their hospitality and excellent working conditions.\n\n\\section{Preliminaries}\n\n\\subsection{Representations of $\\SU_2(\\CC)$}\\label{SU2-subsec}\nIn this subsection, we review the representation theory of the maximal compact subgroup\n\\[ K=\\SU_2(\\CC)=\\left\\{ k[\\alpha,\\beta]:=\\begin{pmatrix}\\alpha&\\beta\\\\-\\bar{\\beta}&\\bar{\\alpha}\\end{pmatrix}:|\\alpha|^2+|\\beta|^2=1\\right\\} \\]\nof $G=\\SL_2(\\CC)$. We use \\cite[\\S2.1.1,2.2]{Lokvenec-Guleska2004} as a convenient reference.\n\nFor $u,v,w\\in\\RR$, we parametrize $K$ using essentially Euler angles $(2u,2v,2w)$ as follows:\n\\begin{equation}\\label{decomp-K}\nk[u,v,w]:=\\begin{pmatrix}e^{iu}&\\\\&e^{-iu}\\end{pmatrix}\\begin{pmatrix}\\cos v&i\\sin v\\\\i\\sin v&\\cos v\\end{pmatrix}\\begin{pmatrix}e^{iw}&\\\\&e^{-iw}\\end{pmatrix}.\n\\end{equation}\nGenerating an equivalence relation $\\sim$ on $\\RR^3$ by\n\\begin{equation}\\label{angleequiv}\n(u,v,w)\\ \\sim\\ (u+2\\pi,v,w),\\ (u,v,w+2\\pi),\\ (u+\\pi,v+\\pi,w),\\ (u+\\pi\/2,-v,w-\\pi\/2)\n\\end{equation}\nwe may parametrize $\\SU_2(\\CC)$ by $\\RR^3\/\\!\\sim$, or by a specific fundamental domain such as $[0,\\pi)\\times[0,\\pi\/2]\\times[-\\pi,\\pi)$, in which each point in $\\SU_2(\\CC)$ has exactly one pre-image other than those with $v\\in\\frac{\\pi}2\\ZZ$. The probability Haar measure on $\\SU_2(\\CC)$ is given by\n\\begin{equation}\\label{dk}\n\\dd k=(2\\pi^2)^{-1}\\sin 2v\\,\\dd u\\,\\dd v\\,\\dd w.\n\\end{equation}\n\nThe irreducible representations of $K=\\SU_2(\\CC)$ are classified as $(2\\ell+1)$-dimensional representations $\\tau_{\\ell}$, for $\\ell\\in\\frac12\\ZZ_{\\geq 0}$, described explicitly as the space $V_{2\\ell}$ of polynomials of degree at most $2\\ell$, with a basis given by $\\{z^{\\ell-q}:|q|\\leq\\ell,\\,q\\equiv\\ell\\pmod{1}\\}$ and $\\SU_2(\\CC)$ action given by\n\\begin{equation}\\label{matrix-coeff}\n\\tau_{\\ell}(k[\\alpha,\\beta])z^{\\ell-q}=(\\alpha z-\\bar{\\beta})^{\\ell-q}(\\beta z+\\bar{\\alpha})^{\\ell+q}=\\sum_{\\substack{|p|\\leq\\ell\\\\p\\equiv\\ell\\one}}\\Phi_{p,q}^{\\ell}(k[\\alpha,\\beta])z^{\\ell-p}.\\end{equation}\nA $K$-invariant scalar product on $V_{2\\ell}$ is given by $(z^{\\ell-q},z^{\\ell-p})=(\\ell-q)!(\\ell+q)!\\delta_{q=p}$, so that $\\Phi_{p,q}^{\\ell}$ are (unnormalized) matrix coefficients of $\\tau_{\\ell}$. Moreover,\n\\[\\left\\{\\Phi_{p,q}^{\\ell}\\,:\\,\\text{$p,q,\\ell\\in\\tfrac12\\ZZ$ and $|p|,|q|\\leq\\ell$ and $p,q\\equiv\\ell\\one$}\\right\\}\\]\nis an orthogonal basis of $L^2(K)$. In harmony with \\cite[\\S4.4.2]{Warner1972a}, we denote by $\\xi_{\\ell}$ the character of $\\tau_{\\ell}$, by $d_{\\ell}=2\\ell+1$ the dimension of $\\tau_\\ell$, and by $\\chi_{\\ell}=d_{\\ell}\\xi_{\\ell}$ the normalized character of $\\tau_\\ell$. Finally, we denote by $\\widehat{K}=\\{\\tau_{\\ell}:\\ell\\in\\frac12\\ZZ_{\\geq 0}\\}$ the unitary dual of $K$.\n\n\\subsection{Representations of $\\SL_2(\\CC)$}\\label{SL2C-subsec}\nFor compatibility with the existing literature, we shall use the Iwasawa decomposition of $G=\\SL_2(\\CC)$ in two forms, $G=NAK$ and $G=KAN$, where $N$ (resp.\\ $A$) is the subgroup of unipotent upper-triangular (resp.\\ positive diagonal) matrices, and $K=\\SU_2(\\CC)$ is the standard maximal compact subgroup.\n\nWe fix a Haar measure on $G$ by setting\n\\[\n\\dd g=|\\dd z|\\frac{\\dd r}{r^5}\\dd k\\quad\\text{for } g=\\begin{pmatrix}1&z\\\\&1\\end{pmatrix}\\begin{pmatrix}r&\\\\&r^{-1}\\end{pmatrix}k, \\quad z\\in\\CC,\\,\\,r>0,\\,\\,k\\in K,\n\\]\nwhere $|\\dd z|=\\dd x\\,\\dd y$ for $z=x+iy$, $x,y\\in\\RR$, and $\\dd k$ is as in \\eqref{dk}.\n\nWe write $\\mfa\\simeq\\RR$ for the Lie algebra of $A$, $\\rho$ for the root on $\\mfa$ mapping\n$\\big(\\begin{smallmatrix}x&\\\\&-x\\end{smallmatrix}\\big)$ to $2x$,\n$\\exp:\\mfa\\to A$ for the exponential map, and $\\kappa:G\\to K$ and $H:G\\to\\mfa$ for\nthe projection and height maps defined by $g\\in\\kappa(g)\\exp(H(g)) N$ for every $g\\in G$.\nThus explicitly, for $g=\\left(\\begin{smallmatrix}a&b\\\\c&d\\end{smallmatrix}\\right)\\in G$ we have\n\\begin{equation}\\label{eq:kappaH}\n\\kappa(g)=\\begin{pmatrix}a\/\\sqrt{|a|^2+|c|^2}&\\ast\\\\c\/\\sqrt{|a|^2+|c|^2}&\\ast\\end{pmatrix},\\quad \\exp(H(g))=\\begin{pmatrix}\\sqrt{|a|^2+|c|^2}&\\\\&1\/\\sqrt{|a|^2+|c|^2}\\end{pmatrix}.\n\\end{equation}\nFinally, let $M\\simeq S^1$ be the centralizer of $A$ in $K$, which consists of diagonal matrices in $K$.\n\nFollowing \\cite[Ch.~III]{GGV}, we introduce for every pair $(\\nu,p)\\in\\CC\\times\\frac12\\ZZ$\nthe (generalized) principal series representation $\\pi_{\\nu,p}$. Let us denote by $C^\\infty(\\CC)$ the set of functions $\\CC\\to\\CC$ that are smooth when regarded as functions $\\RR^2\\to\\CC$. The representation space $V_{\\nu,p}$ consists of those functions $v\\in C^\\infty(\\CC)$ for which the transformed functions\n\\begin{equation}\\label{transformedfunctions}\n\\pi_{\\nu,p}\\left(\\begin{pmatrix}a&b\\\\c&d\\end{pmatrix}\\right)v(z)\n=|bz+d|^{2p+2\\nu-2}(bz+d)^{-2p}v\\left(\\frac{az+c}{bz+d}\\right),\\qquad\n\\begin{pmatrix}a&b\\\\c&d\\end{pmatrix}\\in G,\n\\end{equation}\nextend to elements of $C^\\infty(\\CC)$. The above display then actually defines the representation $\\pi_{\\nu,p}:G\\to\\GL(V_{\\nu,p})$. The space $V_{\\nu,p}$ is complete with respect to the countable family of seminorms\n\\[\\sup\\bigl\\{\\bigl|v^{(a,b)}(x+yi)\\bigr|+\\bigl|\\widehat{v}^{(a,b)}(x+yi)\\bigr|:x^2+y^2\\leq c\\bigr\\},\\qquad (a,b,c)\\in\\NN^3,\\]\nwhere we abbreviate $\\widehat{v}:=\\pi_{\\nu,p}\\left(\\big(\\begin{smallmatrix}&-1\\\\1&\\end{smallmatrix}\\big)\\right)v$ for $v\\in V_{\\nu,p}$. The action of $G$ is continuous in the topology induced by these seminorms; thus, $\\pi_{\\nu,p}$ is a Fr\\'echet space representation.\n\nUsing the action of $K=\\SU_2(\\CC)$ and its diagonal subgroup $\\left\\{\\diag(e^{i\\varrho},e^{-i\\varrho}):\\varrho\\in\\RR\\right\\}$, we can decompose the $K$-finite part of $V_{\\nu,p}$ into an \\emph{algebraic direct sum} of finite-dimensional subspaces and further into one-dimensional subspaces:\n\\begin{equation}\\label{eq:tau-ell-isotypical-decomposition-algebraic}\nV_{\\nu,p}^{\\text{$K$-finite}} = \\bigoplus_{\\substack{\\ell\\geq|p|\\\\\\ell\\equiv p\\one}}V_{\\nu,p}^{\\ell}\n= \\bigoplus_{\\substack{\\ell\\geq|p|\\\\\\ell\\equiv p\\one}}\n\\ \\bigoplus_{\\substack{|q|\\leq\\ell\\\\q\\equiv\\ell\\one}}V_{\\nu,p}^{\\ell,q}.\n\\end{equation}\nPrecisely, $V_{\\nu,p}^\\ell$ is a $(2\\ell+1)$-dimensional subspace on which $\\pi_{\\nu,p}|_K$ acts by $\\tau_\\ell\\in\\widehat{K}$.\n\nIf $\\nu\\not\\equiv p\\pmod{1}$ or $|\\nu|\\leq|p|$, then $\\pi_{\\nu,p}\\cong\\pi_{-\\nu,-p}$ is irreducible, and these are all the equivalences among the representations $\\pi_{\\nu,p}$. If $\\nu\\equiv p\\pmod{1}$ and $|\\nu|>|p|$, then $\\pi_{\\nu,p}$ and $\\pi_{-\\nu,-p}$ are reducible. Assume $\\nu>0$, say. Then the sum of $V_{\\nu,p}^{\\ell}$ with $|p|\\leq\\ell<\\nu$ is a closed invariant subspace of $V_{\\nu,p}$, and the representation induced on the quotient is irreducible. The closure of the sum of $V_{-\\nu,-p}^{\\ell}$ with $\\ell\\geq\\nu$ is an invariant subspace of $V_{-\\nu,-p}$, and the representation induced on it is irreducible. Both of these representations of $G$ are isomorphic to $\\pi_{p,\\nu}\\cong\\pi_{-p,-\\nu}$. This observation will become relevant in \\eqref{eq:spherical-function-symmetry-2} below.\n\nThe space $V_{\\nu,p}$ has a $G$-invariant Hermitian inner product if and only if $\\nu\\in i\\RR$, or $p=0$ and $\\nu\\in(-1,0)\\cup(0,1)$. In the first case, we say that $\\pi_{\\nu,p}$ belongs to the (tempered) unitary principal series. In the second case, we say that $\\pi_{\\nu,p}$ belongs to the (non-tempered) complementary series. In either case, the Fr\\'echet space representation $\\pi_{\\nu,p}$ induces an irreducible unitary representation on the Hilbert space completion\n$\\widehat{V_{\\nu,p}}$ that we shall still denote by $\\pi_{\\nu,p}$. The only equivalences among these unitary representations are $\\pi_{\\nu,p}\\simeq\\pi_{-\\nu,-p}$. The equivalence classes, along with the trivial representation, form the unitary dual $\\widehat{G}$ of $G$.\n\nFor $\\pi\\simeq\\pi_{\\nu,p}\\in\\widehat{G}$ we write\n\\[V_\\pi:=\\widehat{V_{\\nu,p}},\\qquad V_\\pi^\\ell:=V_{\\nu,p}^\\ell,\\qquad V_\\pi^{\\ell,q}:=V_{\\nu,p}^{\\ell,q},\\]\nand then \\eqref{eq:tau-ell-isotypical-decomposition-algebraic} is equivalent to the orthogonal Hilbert space decomposition\n(cf.~\\eqref{decomp}):\n\\[V_\\pi = \\bigoplus_{\\substack{\\ell\\geq|p|\\\\\\ell\\equiv p\\one}}V_\\pi^{\\ell}\n= \\bigoplus_{\\substack{\\ell\\geq|p|\\\\\\ell\\equiv p\\one}}\n\\ \\bigoplus_{\\substack{|q|\\leq\\ell\\\\q\\equiv\\ell\\one}}V_\\pi^{\\ell,q}.\\]\nThe projection $V_\\pi\\to V_{\\pi}^{\\ell}$ is realized by the operator\n\\begin{equation}\\label{eq:projectionbychi}\n\\pi(\\ov{\\chi_\\ell}):=\\int_K \\ov{\\chi_\\ell}(k)\\pi(k)\\,\\dd k\\in \\End(V_\\pi),\n\\end{equation}\nwhere $\\End(V_\\pi)$ denotes the Hilbert space of Hilbert--Schmidt operators on $V_\\pi$ endowed with the Hilbert--Schmidt norm. This leads to the ``block matrix decomposition''\n\\begin{equation}\\label{eq:block-decomposition}\n\\End(V_\\pi)=\\bigoplus_{\\substack{m,n\\geq|p|\\\\ m,n\\equiv p\\one}}\\Hom(V_{\\pi}^{m},V_{\\pi}^{n}),\n\\end{equation}\nwhere the direct sum is meant in the Hilbert space sense. Hence, for $f\\in C_c(G)$, the $(m,n)$-component of the Hilbert--Schmidt operator (cf.\\ \\cite[Th.~2]{GelfandNaimark})\n\\begin{equation}\\label{eq:pif}\n\\pi(f):=\\int_G f(g)\\pi(g)\\,\\dd g\\in\\End(V_\\pi)\n\\end{equation}\nequals\n\\begin{equation}\\label{eq:tau-projection}\n\\pi(\\ov{\\chi_n})\\pi(f)\\pi(\\ov{\\chi_m})=\\pi(\\ov{\\chi_n}\\star f\\star\\ov{\\chi_m})\\in\\Hom(V_{\\pi}^{m},V_{\\pi}^{n}),\n\\end{equation}\nwhere the convolutions are meant over $K$.\n\n\\subsection{Plancherel theorem}\\label{subsec:plancherel}\nIn this subsection, we review the Plancherel theorem for $G=\\SL_2(\\CC)$ pioneered by Gelfand and Naimark, following the original sources \\cite{GelfandNaimark,GelfandNaimark2} and their translations \\cite{GelfandNaimarkTranslated,GelfandNaimark2Translated}. We note that the list of unitary representations given in \\cite{GelfandNaimark2} is incomplete for higher rank groups (cf.\\ \\cite{Stein,Vogan,Tadic}), but this does not affect the results we are quoting. In addition, we warn the reader that the translations contain some misprints not present in the originals, e.g.\\ in the crucial formulae \\cite[(137)--(138)]{GelfandNaimarkTranslated}.\n\nWe identify once and for all (non-canonically) the \\emph{tempered unitary dual} $\\Gtemp$ with the set\n\\[\\left\\{\\pi_{it,p}:(t,p)\\in\\left(\\RR_{>0}\\times\\tfrac12\\ZZ\\right)\\cup\\left(\\{0\\}\\times\\tfrac12\\ZZ_{\\geq 0}\\right)\\right\\},\\]\nwith topology inherited from the standard topology on $\\RR^2$. The \\emph{Plancherel measure} on $\\widehat{G}$ is supported on $\\Gtemp$, and it is given explicitly as\n\\begin{equation}\\label{eq:concrete-plancherel-measure}\n\\dd\\mupl(\\pi_{it,p}):=\\frac{1}{\\pi^2}(t^2+p^2)\\,\\dd t.\n\\end{equation}\nFor $\\pi_{it,p}\\in\\Gtemp$, the underlying Hilbert space $\\widehat{V_{it,p}}$ is independent of the parameters: it equals $\\Vcan:=L^2(\\CC)$. On this common representation space, \\eqref{transformedfunctions} defines the unitary action $\\pi_{it,p}:G\\to\\U(\\Vcan)$ that agrees with \\cite[(65)]{GelfandNaimark} for $(n,\\rho)=(2p,2t)$. The \\emph{operator-valued spherical transform} of $f\\in C_c(G)$ is the map $\\Gtemp\\to\\End(\\Vcan)$ given by $\\pi\\mapsto\\pi(f)$ as in \\eqref{eq:pif}. The Plancherel theorem for $G$ concerns the extension of this transform to $L^2(G)$, and characterizes its image.\n\n\\begin{theorem}[Gelfand--Naimark]\\label{thm:abstract-isomorphism}\nThe map given by \\eqref{eq:pif} extends (uniquely) to an $L^2$-isometry\n\\[L^2(G)\\longrightarrow L^2(\\Gtemp\\to\\End(\\Vcan)),\\]\nwhere the operator-valued $L^2$-space on the right-hand side is meant with respect to the Hilbert--Schmidt norm ${\\|\\cdot\\|}_{\\mathrm{HS}}$ on\n$\\End(\\Vcan)$ and the Plancherel measure $\\mupl$ on $\\Gtemp$. In particular, for every $f\\in L^2(G)$, the following Plancherel formula holds:\n\\begin{equation}\\label{eq:abstract-plancherel}\n\\int_G |f(g)|^2\\,\\dd g = \\int_{\\Gtemp} {\\|\\pi(f)\\|}_{\\mathrm{HS}}^2\\,\\dd \\mupl(\\pi).\n\\end{equation}\n\\end{theorem}\n\n\\begin{proof}\nThe theorem follows from \\cite[Th.~5]{GelfandNaimark}; we only need to check that our Plancherel measure corresponds to the one in \\cite[(137)]{GelfandNaimark}. We do this in four steps.\n\\newline\\emph{Step 1.}\nWe observe that the constant $(8\\pi^4)^{-1}$ in \\cite[(137)]{GelfandNaimark} should be $(16\\pi^4)^{-1}$ due to a small oversight in the derivation of \\cite[(130)]{GelfandNaimark} from \\cite[(129)]{GelfandNaimark}. The oversight is that the change of variables\n\\[(w_1,w_2,\\lambda)\\mapsto(\\zeta_1,\\zeta_2,\\zeta_3):=(w_2,w_1\\bar\\lambda+w_2\/\\bar\\lambda,w_1)\\]\ncoming from \\cite[(123)]{GelfandNaimark} is not 1-to-1 but 2-to-1.\n\\newline\\emph{Step 2.}\nWe rewrite the corrected right-hand side of \\cite[(137)]{GelfandNaimark} as a sum over $p\\in\\frac{1}{2}\\ZZ$ and an integral over $t>0$, keeping in mind that $(n,\\rho)$ in \\cite{GelfandNaimark} is $(2p,2t)$ in our notation.\n\\newline\\noindent\\emph{Step 3.}\nWe observe that the Haar measure $\\dd\\mu(g)$ used by Gelfand--Naimark is $2\\pi^2\\dd g$. Indeed, applying\n\\cite[(40)]{GelfandNaimark} to a right $K$-invariant test function $f\\in C_c(G)$, we obtain by several changes of variables that\n\\begin{align*}\\int_G f(g)\\,\\dd\\mu(g)\n&=\\int_{\\CC\\times\\CC^\\times\\times\\CC}f\\left(\\begin{pmatrix}w^{-1}&z\\\\&w\\end{pmatrix}\n\\begin{pmatrix}1&\\\\v&1\\end{pmatrix}\\right)|\\dd v|\\,|\\dd w|\\,|\\dd z|\\\\[4pt]\n&=\\int_{\\CC\\times\\CC^\\times\\times\\CC}f\\left(\\begin{pmatrix}w^{-1}&z\\\\&w\\end{pmatrix}\n\\begin{pmatrix}1\/\\sqrt{1+|v|^2}&\\bar v\/\\sqrt{1+|v|^2}\\\\&\\sqrt{1+|v|^2}\\end{pmatrix}\\right)|\\dd v|\\,|\\dd w|\\,|\\dd z|\\\\[4pt]\n&=\\int_{\\CC\\times\\CC^\\times\\times\\CC}f\\left(\\begin{pmatrix}w^{-1}&z\\\\&w\\end{pmatrix}\\right)\n\\frac{|\\dd v|\\,|\\dd w|\\,|\\dd z|}{(1+|v|^2)^2}\\\\[4pt]\n&= \\pi \\int_{\\CC^\\times\\times\\CC}f\\left(\\begin{pmatrix}1&z\\\\&1\\end{pmatrix}\n\\begin{pmatrix}w&\\\\&w^{-1}\\end{pmatrix}\\right)\\frac{|\\dd w|\\,|\\dd z|}{|w|^6} = 2\\pi^2\\int_G f(g)\\,\\dd g.\n\\end{align*}\n\\emph{Step 4.}\nPutting everything together, the corrected version of \\cite[(137)]{GelfandNaimark} yields\n\\[\\int_G |f(g)|^2\\,2\\pi^2\\dd g = \\frac{1}{16\\pi^4}\\sum_p\\int_0^\\infty{\\|2\\pi^2\\pi_{it,p}(f)\\|}_{\\mathrm{HS}}^2\\,(4t^2+4p^2)\\,2\\dd t.\\]\nThis formula is equivalent to \\eqref{eq:abstract-plancherel}, hence we are done.\n\\end{proof}\n\n\\begin{remark}\\label{remark:Plancherel} In the proof above, we claimed that the Plancherel measure in \\cite[Th.~5]{GelfandNaimark} is off by a factor of $2$. For double checking this claim, we looked at \\cite[Th.~11.2]{Knapp}, and we found (to our dismay) that the Plancherel measure there is off by a factor of $\\pi$. For example, for the test function $f(g):=1\/\\tr(gg^*)^2$, the Fourier transform given by \\cite[(11.14)]{Knapp} equals $F_f^T(t)=\\pi\/\\tr(tt^*)$, hence in \\cite[(11.17)]{Knapp} the left-hand side is $\\pi^2$, while the right-hand side is $\\pi$. For triple checking our claim, we verified that our Plancherel measure yields the correct inversion formula for the classical spherical transform (for bi-$K$-invariant functions), as in \\cite[\\S 3.3]{FHMM}.\n\\end{remark}\n\n\\begin{theorem}[Gelfand--Naimark]\\label{thm:general-inversion-formula}\nLet $f\\in C_c^\\infty(G)$. For every $\\pi\\in\\Gtemp$, the operator $\\pi(f)\\in\\End(\\Vcan)$ is of trace class, and the following inversion formula holds:\n\\begin{equation}\\label{eq:general-inversion-formula}\nf(g)=\\int_{\\Gtemp} \\tr(\\pi(f)\\pi(g^{-1}))\\,\\dd\\mupl(\\pi).\n\\end{equation}\n\\end{theorem}\n\n\\begin{proof}\nThe theorem follows from \\cite[Th.~19]{GelfandNaimark2} applied to $n=2$ and $x=R(g)f$, or from \\cite[Th.~11.2]{Knapp}, with appropriate correction of the Plancherel measure (cf.\\ Remark~\\ref{remark:Plancherel}).\n\\end{proof}\n\n\\subsection{The \\texorpdfstring{$\\tau_{\\ell}$}{tau-ell}-spherical transform}\\label{section:sphericaltransform}\nFor a given $\\ell\\in\\frac{1}{2}\\ZZ_{\\geq 0}$, it is interesting to see what Theorems~\\ref{thm:abstract-isomorphism} and \\ref{thm:general-inversion-formula} yield for test functions $f\\in L^2(G)$ with the following property: for almost every $\\pi\\in\\Gtemp$, the operator $\\pi(f)$ acts by a scalar on $V_{\\pi}^{\\ell}$ and by zero on its orthocomplement $V_{\\pi}^{\\ell,\\perp}$. In the light of \\eqref{eq:block-decomposition}, \\eqref{eq:tau-projection}, \\eqref{eq:abstract-plancherel}, and Schur's lemma, these test functions form the Hilbert subspace $\\mcH(\\tau_{\\ell})\\subset L^2(G)$ defined by the conditions\n\\begin{itemize}\n\\item $f(g)=f(kgk^{-1})$ for almost every $g\\in G$ and $k\\in K$;\n\\item $f=\\ov{\\chi_\\ell} \\star f \\star\\ov{\\chi_\\ell}$.\n\\end{itemize}\n\nLet $\\Gtemp(\\tau_{\\ell})$ be the set of $\\pi\\in\\Gtemp$ whose restriction to $K$ contains $\\tau_{\\ell}$. For $f\\in\\mcH(\\tau_{\\ell})$, the operator-valued function $\\pi\\mapsto\\pi(f)$ is supported on $\\Gtemp(\\tau_{\\ell})$, and there it is simply determined by the scalar-valued function $\\pi\\mapsto\\tr(\\pi(f))$ via\n\\begin{equation}\\label{eq:opfromtr}\n\\pi(f)|_{V_{\\pi}^{\\ell}}= \\frac{\\tr(\\pi(f))}{2\\ell+1}\\cdot \\id_{V_{\\pi}^{\\ell}}\n\\qquad\\text{and}\\qquad\\pi(f)|_{V_{\\pi}^{\\ell,\\perp}}=0.\n\\end{equation}\nIn particular, for $\\pi\\in\\Gtemp(\\tau_{\\ell})$ and $f\\in\\mcH(\\tau_{\\ell})$,\n\\begin{equation}\\label{eq:HSfromtr}\n{\\|\\pi(f)\\|}_{\\mathrm{HS}}^2 = \\tr(\\pi(f)\\pi(f)^*)= \\frac{|\\tr(\\pi(f))|^2}{2\\ell+1}.\n\\end{equation}\nFor $(\\nu,p)\\in i\\RR\\times\\frac12\\ZZ$, the condition $\\pi_{\\nu,p}\\in\\Gtemp(\\tau_{\\ell})$ is equivalent to $|p|\\leq\\ell$ and $p\\equiv\\ell\\pmod{1}$. Moreover, for $f\\in L^1(G)\\cap\\mcH(\\tau_{\\ell})$, the trace of $\\pi_{\\nu,p}(f)$ can be expressed\nin terms of the \\emph{$\\tau_\\ell$-spherical trace function}\n\\begin{equation}\\label{eq:def-spherical-function}\n\\varphi_{\\nu,p}^{\\ell}(g):=\\tr(\\pi_{\\nu,p}(\\ov{\\chi_\\ell})\\pi_{\\nu,p}(g)\\pi_{\\nu,p}(\\ov{\\chi_\\ell}))\n\\end{equation}\nas (cf.\\ \\eqref{eq:pif} and \\eqref{eq:tau-projection})\n\\begin{equation}\\label{eq:trpif}\n\\widehat{f}(\\nu,p):=\\tr(\\pi_{\\nu,p}(f)) = \\int_G f(g)\\,\\varphi_{\\nu,p}^{\\ell}(g)\\,\\dd g.\n\\end{equation}\n\nThe function $\\varphi_{\\nu,p}^{\\ell}:G\\to\\CC$ vanishes unless $|p|\\leq\\ell$ and $p\\equiv\\ell\\pmod{1}$, for else $\\tau_{\\ell}$ does not appear in $\\pi_{\\nu,p}$, and $\\varphi_{\\nu,p}^{\\ell}(\\id)=2\\ell+1$ in this latter case. Moreover, we have the integral representation of Harish-Chandra \\cite[Cor.~6.2.2.3]{Warner1972}:\n\\[\\varphi_{\\nu,p}^{\\ell}(g)=\\int_K\\left(\\chi_\\ell\\star\\eta_p\\right)(\\kappa(k^{-1}gk))\\,\ne^{(\\nu-1)\\rho(H(gk))}\\,\\dd k.\\]\nHere, $\\eta_p:M\\simeq S^1\\to\\CC^{\\times}$ is the unitary character $\\eta_p(z)=z^{-2p}$, the convolution is over $M$, and $\\kappa$, $\\rho$, and $H$ are as in \\S\\ref{SL2C-subsec}. For computational purposes, we spell out the $\\chi_\\ell\\star\\eta_p$ term explicitly, cf.~\\eqref{matrix-coeff}, \\cite[(10) \\& Lemma~3.2]{Wang1974}, \\cite[Th.~29.18]{HewittRoss}:\n\\[\\begin{aligned}\n\\left(\\chi_\\ell\\star\\eta_p\\right)(k[\\alpha,\\beta])\n&=(2\\ell+1)\\Phi_{p,p}^{\\ell}(k[\\alpha,\\beta])\\\\\n&=(2\\ell+1)\\sum_{r=0}^{\\ell-|p|}(-1)^r\\binom{\\ell+p}{r}\\binom{\\ell-p}{r}\n\\alpha^{\\ell-p-r}{\\bar\\alpha}^{\\ell+p-r}|\\beta|^{2r}.\n\\end{aligned}\\]\nWe collect further useful properties of $\\varphi_{\\nu,p}^{\\ell}:G\\to\\CC$ in the next lemma, where we write\n\\[a_h:= \\diag(e^{h\/2}, e^{-h\/2}),\\qquad h\\in\\RR.\\]\n\n\\begin{lemma} The $\\tau_\\ell$-spherical trace function $\\varphi_{\\nu,p}^{\\ell}(g)$ extends holomorphically to $\\nu\\in\\CC$, and it satisfies the bound\n\\begin{equation}\\label{eq:spherical-function-bound}\n\\bigl|\\varphi_{\\sigma+it,p}^{\\ell}(k_1a_hk_2)\\bigr|\\leq(2\\ell+1)\\frac{\\sinh(\\sigma h)}{\\sigma\\sinh(h)},\n\\qquad \\sigma,t,h\\in\\RR,\\quad k_1,k_2\\in K.\n\\end{equation}\n(For $\\sigma=0$ or $h=0$, the fraction on the right-hand side is understood as $1$.)\nThe extended function has the symmetries\n\\begin{equation}\\label{eq:spherical-function-symmetry}\n\\varphi_{\\nu,p}^{\\ell}(g)=\\ov{\\varphi_{-\\ov{\\nu},p}^{\\ell}(g)}=\\varphi_{\\nu,p}^{\\ell}(g^{-1}),\n\\end{equation}\n\\begin{equation}\\label{eq:spherical-function-symmetry-2}\n\\varphi_{\\nu,p}^{\\ell}(g)=\\varphi_{p,\\nu}^{\\ell}(g),\\qquad\\nu\\equiv p\\one,\\quad|\\nu|,|p|\\leq\\ell.\n\\end{equation}\n\\end{lemma}\n\n\\begin{proof}\nThe holomorphic extension of $\\varphi_{\\nu,p}^{\\ell}(g)$ and the bound \\eqref{eq:spherical-function-bound} are\na straightforward generalization of \\cite[Prop.~3.4]{Wang1974} and its proof. The identity $\\ov{\\varphi_{-\\ov{\\nu},p}^{\\ell}(g)}=\\varphi_{\\nu,p}^{\\ell}(g^{-1})$ follows from \\eqref{eq:def-spherical-function} and $\\pi(g)^*=\\pi(g^{-1})$ for $\\nu\\in i\\RR$, and then also for $\\nu\\in\\CC$ by the uniqueness of analytic continuation. The identity\n$\\varphi_{\\nu,p}^{\\ell}(g)=\\varphi_{\\nu,p}^{\\ell}(g^{-1})$ is \\cite[Lemma~3.2]{Wang1974}. Finally, the remarkable symmetry \\eqref{eq:spherical-function-symmetry-2} follows from \\cite[Cor.~2]{Wang1974}, or more conceptually from the discussion below \\eqref{eq:tau-ell-isotypical-decomposition-algebraic}.\n\\end{proof}\n\nAs we shall see in Theorem~\\ref{thm:tr-plancherel} below, the \\emph{$\\tau_\\ell$-spherical transform} defined by \\eqref{eq:trpif} is inverted by the following \\emph{inverse $\\tau_\\ell$-spherical transform}. For $h\\in L^1(\\Gtemp(\\tau_{\\ell}))\\cap L^2(\\Gtemp(\\tau_{\\ell}))$ and $g\\in G$, we define\n\\begin{equation}\\label{eq:inverse-tauell-transform}\n\\widecheck{h}(g):=\\frac{1}{(2\\ell+1)\\pi^2}\\sum_{\\substack{|p|\\leq\\ell\\\\p\\equiv\\ell\\one}}\n\\int_{0}^{\\infty} h(it,p)\\,\\varphi_{it,p}^{\\ell}(g^{-1})\\,(t^2+p^2)\\,\\dd t.\n\\end{equation}\n\n\\begin{theorem}\\label{thm:tr-plancherel} The transforms defined by \\eqref{eq:trpif} and \\eqref{eq:inverse-tauell-transform} extend (uniquely) to a pair of inverse Hilbert space isometries\n\\[\\mcH(\\tau_{\\ell})\\longleftrightarrow L^2(\\Gtemp(\\tau_{\\ell})).\\]\nIn particular, for $f\\in \\mcH(\\tau_{\\ell})$, the following Plancherel formula holds:\n\\begin{equation}\\label{eq:tr-plancherel}\n\\int_G |f(g)|^2\\,\\dd g = \\frac{1}{(2\\ell+1)\\pi^2}\n\\sum_{\\substack{|p|\\leq\\ell\\\\p\\equiv\\ell\\one}}\\int_{0}^{\\infty}\n|\\widehat{f}(it,p)|^2\\,(t^2+p^2)\\,\\dd t.\n\\end{equation}\n\\end{theorem}\n\n\\begin{proof} The fact that $\\ \\widehat{}\\ $ extends to a Hilbert space isomorphism $\\mcH(\\tau_{\\ell})\\to L^2(\\Gtemp(\\tau_\\ell))$ follows from Theorem~\\ref{thm:abstract-isomorphism} and our discussion above. In particular, \\eqref{eq:tr-plancherel} is a special case of \\eqref{eq:abstract-plancherel} in the light of \\eqref{eq:concrete-plancherel-measure}, \\eqref{eq:HSfromtr}, \\eqref{eq:trpif}. We are left with proving that $\\ \\widecheck{}\\ $ is the inverse of $\\ \\widehat{}\\ $, and for this it suffices to verify that $\\ \\widecheck{}\\ $ applied after $\\ \\widehat{}\\ $ is the identity on the dense subset $C_c^{\\infty}(G)\\cap\\mcH(\\tau_{\\ell})$ of the Hilbert space $\\mcH(\\tau_{\\ell})$. For $f\\in C_c^{\\infty}(G)\\cap \\mcH(\\tau_{\\ell})$, \\eqref{eq:projectionbychi}, \\eqref{eq:pif}, \\eqref{eq:concrete-plancherel-measure}, \\eqref{eq:general-inversion-formula}, \\eqref{eq:opfromtr}, \\eqref{eq:def-spherical-function}, \\eqref{eq:trpif} yield\n\\begin{align*}f(g)\n&=\\int_{\\Gtemp}\\tr(\\pi(f)\\pi(g^{-1}))\\,\\dd\\mupl=\\frac{1}{2\\ell+1}\\int_{\\Gtemp}\\tr(\\pi(f))\\tr(\\pi(\\ov{\\chi_\\ell})\\pi(g^{-1}))\\,\\dd\\mupl\\\\\n&=\\frac{1}{(2\\ell+1)\\pi^2} \\sum_{\\substack{|p|\\leq \\ell \\\\ p\\equiv \\ell\\one}} \\int_{0}^{\\infty} \\widehat{f}(it,p)\\, \\varphi_{it,p}^{\\ell}(g^{-1})\\,(t^2+p^2)\\,\\dd t.\n\\end{align*}\nThe proof is complete.\n\\end{proof}\n\nWang~\\cite{Wang1974} proved an analogue of the Paley--Wiener theorem for the $\\tau_\\ell$-spherical transform, and in particular characterized the image of $\\mcH(\\tau_{\\ell})\\cap C_c^\\infty(G)$ under the transform. The following is \\cite[Prop.~4.5]{Wang1974} and should be compared to Theorem~\\ref{thm:pws} in the introduction.\n\n\\begin{theorem}[Wang]\\label{thm10}\nLet $f\\in\\mcH(\\tau_{\\ell})$ be a test function, and let $R>0$ be a radius. Then the following two conditions are equivalent.\n\\begin{enumerate}[(a)]\n\\item The function $f(g)$ is smooth, and\n\\[f(k_1 a_h k_2)=0,\\qquad |h|>R,\\quad k_1,k_2\\in K.\\]\n\\item The function $\\widehat{f}(\\nu,p)$ extends holomorphically to $\\CC\\times\\tfrac12\\ZZ$ such that\n\\[\\widehat{f}(\\nu,p)=\\widehat{f}(p,\\nu),\\qquad\\nu\\equiv p\\one,\\quad|\\nu|,|p|\\leq\\ell,\\]\nand for any $C>0$ we have\n\\[\\widehat{f}(\\nu,p)\\ll_C (1+|\\nu|)^{-C}e^{R|\\Re\\nu|},\\qquad \\nu\\in\\CC,\\quad p\\in\\tfrac12\\ZZ.\\]\n\\end{enumerate}\n\\end{theorem}\n\nWe now prove a Schwartz class version of this result as stated in Theorem~\\ref{thm:pws}.\n\n\\begin{proof}[Proof of Theorem~\\ref{thm:pws}]\nAssume condition \\ref{pws-a}. The holomorphic extension of $\\widehat{f}(\\nu,p)$ follows from \\eqref{eq:spherical-function-bound} coupled with \\eqref{eq:mAbound} for $m=0$, and then \\eqref{eq:symmetry} is immediate from \\eqref{eq:spherical-function-symmetry-2}. In order to derive \\eqref{eq:BCbound}, we use an alternate representation of $\\widehat{f}(\\nu,p)$. We shall assume that $|p|\\leq\\ell$ and $p\\equiv\\ell\\pmod{1}$, for else $\\widehat{f}(\\nu,p)=0$. By the second display on \\cite[p.~621]{Wang1974}, we see that the (unique) holomorphic extension is also provided by\n\\begin{equation}\\label{eq:sphericalviaAbel}\n\\widehat{f}(\\nu,p)=\\frac{2\\ell+1}{2}\\int_{-\\infty}^\\infty\\breve{f}(h,p)\\,e^{\\nu h}\\,\\dd h,\n\\end{equation}\nwhere\n\\begin{equation}\\label{eq:Abelnew}\n\\breve{f}(h,p):=e^h\\int_K\\int_N f(ka_hn)\\,\\Phi_{p,p}^{\\ell}(k)\\,\\dd k\\,\\dd n.\n\\end{equation}\nWe claim that, for any $m\\in\\ZZ_{\\geq 0}$ and $A>0$, we have\n\\begin{equation}\\label{eq:Abelbound}\n\\frac{\\partial^m}{\\partial h^m}\\breve{f}(h,p)\\ll_{m,A} e^{-A|h|},\\qquad h\\in\\RR,\\quad |p|\\leq\\ell,\\quad p\\equiv\\ell\\one.\n\\end{equation}\nFor $|h|>1$ this follows by writing $a_hn=k_1a_{h'}k_2$ in \\eqref{eq:Abelnew}, and then combining \\eqref{eq:mAbound} with some calculus to keep track of the dependence of $h'\\in\\RR$ and $k_1,k_2\\in K$ on $h\\in\\RR$. For $|h|\\leq 1$ we proceed similarly for the part of the integral in \\eqref{eq:Abelnew} that corresponds to $n=\\big(\\begin{smallmatrix}1&z\\\\& 1\\end{smallmatrix}\\big)$ with $|z|>1$, while we estimate the ($h$-derivatives of the) remaining integral directly by the smoothness of $f(g)$. With \\eqref{eq:Abelbound} at hand, \\eqref{eq:BCbound} follows from \\eqref{eq:sphericalviaAbel} via integration by parts. We proved that \\ref{pws-a} implies \\ref{pws-b}.\n\nAssume condition \\ref{pws-b}. By Theorem~\\ref{thm:tr-plancherel},\n\\[f(g)=\\frac{1}{(2\\ell+1)\\pi^2} \\sum_{\\substack{|p|\\leq \\ell \\\\ p\\equiv \\ell\\one}} \\int_{0}^{\\infty} \\widehat{f}(it,p)\\, \\varphi_{it,p}^{\\ell}(g^{-1})\\,(t^2+p^2)\\,\\dd t.\\]\nLet us restrict, without loss of generality, to $g=k_1a_hk_2$ with $h>0$. Using the display below \\cite[(29)]{Wang1974}, we infer\n\\[f(g)=\\frac{1}{4\\pi^2\\sinh(h)}\\sum_{\\substack{|p|,|j|\\leq \\ell \\\\ p,j\\equiv\\ell\\one}}\n\\int_{-h}^h \\widetilde{f}(s,p) \\,\n\\Phi_{-p,j}^{\\ell}(v_{\\theta}^{-1})\\Phi_{j,j}^{\\ell}(k_1k_2) \\Phi_{j,-p}^{\\ell}(v_{\\theta'})\n\\,\\dd s,\\]\nwhere $\\Phi_{-p,j}^{\\ell}(v_{\\theta}^{-1})$ and $\\Phi_{j,-p}^{\\ell}(v_{\\theta'})$ can be explicated using \\cite[(5) \\& (28)]{Wang1974}, and\n\\begin{equation}\\label{eq:def-tilde-f-s-p}\n\\widetilde{f}(s,p):=\\int_{-\\infty}^\\infty\\widehat{f}(it,p)\\,e^{-its}\\,(t^2+p^2)\\,\\dd t,\\qquad s\\in\\RR.\n\\end{equation}\nBy \\eqref{eq:BCbound} and Cauchy's theorem, it follows for any $n\\in\\ZZ_{\\geq 0}$ and $D>0$ that\n\\begin{equation}\\label{eq:nDbound}\n\\frac{\\partial^n}{\\partial s^n}\\widetilde{f}(s,p)\\ll_{n,D} e^{-D|s|},\\qquad s\\in\\RR.\n\\end{equation}\nThe smoothness of $f(g)$ is now straightforward, and this automatically verifies \\eqref{eq:mAbound} for $|h|\\leq 1$. From now on we can assume, without loss of generality, that $h>1$. From \\eqref{eq:symmetry}, \\eqref{eq:nDbound}, and the calculation around \\cite[(38)--(41)]{Wang1974}, we see that\n\\[\\sum_{\\substack{|p|,|j|\\leq \\ell \\\\ p,j\\equiv\\ell\\one}}\n\\int_{-\\infty}^\\infty \\widetilde{f}(s,p) \\,\n\\Phi_{-p,j}^{\\ell}(v_{\\theta}^{-1})\\Phi_{j,j}^{\\ell}(k_1k_2) \\Phi_{j,-p}^{\\ell}(v_{\\theta'})\n\\,\\dd s=0,\\]\nhence in fact\n\\[f(g)=\\frac{-1}{4\\pi^2\\sinh(h)}\\sum_{\\substack{|p|,|j|\\leq \\ell \\\\ p,j\\equiv\\ell\\one}}\n\\left(\\int_{-\\infty}^{-h}+\\int_h^\\infty\\right)\\widetilde{f}(s,p) \\,\n\\Phi_{-p,j}^{\\ell}(v_{\\theta}^{-1})\\Phi_{j,j}^{\\ell}(k_1k_2) \\Phi_{j,-p}^{\\ell}(v_{\\theta'})\n\\,\\dd s.\\]\nFrom here it is straightforward to deduce \\eqref{eq:mAbound} for $h>1$, using \\eqref{eq:nDbound} and the remarks above it. We proved that \\ref{pws-b} implies \\ref{pws-a}.\n\\end{proof}\n\nWe shall denote by $\\mcH(\\tau_{\\ell})_{\\infty}$ the set of functions satisfying the equivalent conditions \\ref{pws-a} and \\ref{pws-b} of Theorem~\\ref{thm:pws}. It is clear that $\\mcH(\\tau_{\\ell})_{\\infty}$ is a convolution subalgebra of $L^1(G)\\cap L^2(G)$.\n\n\\begin{remark} The last display combined with the observation $\\widetilde{f}(s,p)=\\widetilde{f}(-s,-p)$ yields the following refinement of \\eqref{eq:mAbound} when $m=0$:\n\\begin{equation}\\label{eq:inverse-spherical-transform-estimate}\n\\bigl|f(k_1a_hk_2)\\bigr|\\leq\\sum_{\\substack{|p|\\leq \\ell \\\\ p\\equiv\\ell\\one}}\n\\int_h^\\infty \\bigl|\\widetilde{f}(s,p)\\bigr|\\,\\dd s,\\qquad h>1,\\quad k_1,k_2\\in K. \n\\end{equation}\n\\end{remark}\n\nWe end this subsection by stating a two-variable version of some of the previous definitions and results. Taking (topological) tensor products of Hilbert spaces, we can identify $\\mcH(\\tau_{\\ell}) \\hat{\\otimes} \\mcH(\\tau_{\\ell})$ with the space of functions $f \\in L^2(G \\times G)$ satisfying\n\\begin{itemize}\n\\item $f(g_1, g_2) = f(k_1g_1k_1^{-1}, k_2g_2k_2^{-1})$ for almost every\n$g_1, g_2 \\in G$ and $k_1, k_2 \\in K$;\n\\item $(\\ov{\\chi_\\ell},\\ov{\\chi_\\ell}) \\star f \\star (\\ov{\\chi_\\ell},\\ov{\\chi_\\ell})$.\n\\end{itemize}\nThis can be seen by projecting the isomorphism between $L^2(G)\\hat{\\otimes} L^2(G)$ and $L^2(G\\times G)$ (see e.g.\\ \\cite[Cor.~4.11.9]{Simon2015}) to $\\mcH(\\tau_{\\ell}) \\hat{\\otimes} \\mcH(\\tau_{\\ell})$ and the (closed) subspace of functions in question. By Theorem~\\ref{thm:tr-plancherel}, this space is isometrically isomorphic to $L^2(\\Gtemp(\\tau_{\\ell})^2)$ via the obvious extension of the map \\eqref{eq:trpif}:\n\\begin{equation}\\label{doubletransform}\n\\widehat{f}(\\nu_1, p_1, \\nu_2, p_2) := \\int_{G_1\\times G_2} f(g_1, g_2) \\,\n\\varphi_{\\nu_1, p_1}^{\\ell}(g_1)\\varphi_{\\nu_2, p_2}^{\\ell}(g_2) \\, \\dd g_1\\dd g_2.\n\\end{equation}\nFor $h\\in L^2(\\Gtemp(\\tau_{\\ell})^2)\\cap L^2(\\Gtemp(\\tau_{\\ell})^2)$, the \ninverse transform is given as in \\eqref{eq:inverse-tauell-transform}:\n\\begin{equation}\\label{inversedoubletransform}\n\\begin{split}\n\\widecheck{h}(g_1, g_2) := \\frac{1}{(2\\ell+ 1)^2\\pi^4}&\n\\sum_{\\substack{|p_1|, |p_2|\\leq\\ell\\\\p_1 \\equiv p_2\\equiv\\ell\\one}}\n\\int_{0}^{\\infty}\\int_{0}^{\\infty} h(it_1,p_1, it_2, p_2)\\\\\n&\\qquad\\varphi_{it_1,p_1}^{\\ell}(g_1^{-1})\\varphi_{it_2,p_2}^{\\ell}(g_2^{-1})\\,(t_1^2+p_1^2)(t_2^2+p_2^2)\\,\\dd t_1\\,\\dd t_2.\n\\end{split}\n\\end{equation}\nIt is straightforward to adapt the above presented proof of Theorem~\\ref{thm:pws} to obtain the following variant for $\\mcH(\\tau_{\\ell}) \\hat{\\otimes} \\mcH(\\tau_{\\ell})$:\n\\begin{theorem}\\label{thm:pws2} For $f\\in\\mcH(\\tau_{\\ell}) \\hat{\\otimes} \\mcH(\\tau_{\\ell})$, the following two conditions are equivalent (with implied constants depending on $f$).\n\\begin{enumerate}[(a)]\n\\item\\label{pws-a} The function $f(g_1,g_2)$ is smooth, and for any $m\\in\\ZZ_{\\geq 0}$ and $A>0$ we have\n\\[\\frac{\\partial^{2m}}{\\partial h_1^m\\partial h_2^m}f(k_1 a_{h_1} k_2,k_3 a_{h_2} k_4)\\ll_{m,A} e^{-A(|h_1|+|h_2|)},\n\\qquad h_1,h_2\\in\\RR,\\quad k_1,k_2,k_3,k_4\\in K.\\]\n\\item\\label{pws-b} The function $\\widehat{f}(\\nu_1,p_1,\\nu_2,p_2)$ extends holomorphically to $\\CC\\times\\tfrac12\\ZZ\\times\\CC\\times\\tfrac12\\ZZ$ such that\n\\begin{align*}\n\\widehat{f}(\\nu_1,p_1,\\nu_2,p_2) &= \\widehat{f}(p_1,\\nu_1,\\nu_2,p_2),\n\\qquad \\nu_1 \\equiv p_1\\pmod{1},\\quad |\\nu_1|, |p_1| \\leq \\ell,\\\\\n\\widehat{f}(\\nu_1,p_1,\\nu_2,p_2) &= \\widehat{f}(\\nu_1,p_1,p_2,\\nu_2),\n\\qquad \\nu_2 \\equiv p_2\\pmod{1},\\quad |\\nu_2|, |p_2| \\leq \\ell,\n\\end{align*}\nand for any $B,C>0$ we have\n\\[\\widehat{f}(\\nu_1,p_1,\\nu_2,p_2) \\ll_{B, C} (1+|\\nu_1|+|\\nu_2|)^{-C},\n\\qquad |\\Re\\nu_1|,|\\Re\\nu_2|\\leq B,\\quad p_1,p_2\\in\\tfrac{1}{2}\\ZZ.\\]\n\\end{enumerate}\n\\end{theorem}\n\n\n\\subsection{Hecke operators}\nThe arithmetic quotient $\\Gamma\\backslash G$ comes equipped with a rich family of Hecke correspondences, which we now describe, referring to \\cite{BlomerHarcosMilicevic2016} for further details and references. For every $n\\in\\ZZ[i]\\setminus\\{0\\}$, consider the set\n\\[ \\Gamma_n:=\\left\\{\\begin{pmatrix} a&b\\\\c&d\\end{pmatrix}\\in\\MM_2(\\ZZ[i]):ad-bc=n\\right\\}. \\]\nIn particular, $\\Gamma_1=\\Gamma$. Then we may define the Hecke operator $T_n$ acting on functions $\\phi:\\Gamma\\backslash G\\to\\CC$ by\n\\begin{equation}\\label{Hecke-def}\n(T_n\\phi)(g):=\\frac1{|n|}\\sum_{\\gamma\\in\\Gamma\\backslash\\Gamma_n}\\phi\\left(\\frac1{\\sqrt{n}}\\gamma g\\right)=\\frac1{4|n|}\\sum_{ad=n}\\sum_{b\\bmod d}\\phi\\left(\\frac1{\\sqrt{n}}\\begin{pmatrix}a&b\\\\0&d\\end{pmatrix}g\\right),\n\\end{equation}\nwhere the result is independent of the choice of the square-root since $\\pm\\id\\in\\Gamma$. In particular, since $\\Gamma_{-1}=\\Gamma\\cdot\\big(\\begin{smallmatrix}-1&\\\\&1\\end{smallmatrix}\\big)$ and $\\frac{1}{i}\\big(\\begin{smallmatrix}-1&\\\\&1\\end{smallmatrix}\\big)=\\big(\\begin{smallmatrix}i&\\\\&-i\\end{smallmatrix}\\big)\\in\\Gamma$, we have $T_{-1}=T_1=\\id$. We also observe that, as $\\gamma$ ranges through a set of representatives of $\\Gamma\\backslash\\Gamma_n$, $n\\gamma^{-1}$ ranges through a set of representatives of $\\Gamma_n\/\\Gamma$.\n\nThese Hecke operators are self-adjoint on $L^2(\\Gamma\\backslash G)$, commute with each other and the Laplace operator; thus they act by constants $\\lambda_n(V)$ on each irreducible component $V\\subset L^2(\\Gamma\\backslash G)$, with non-zero vectors in each $V$ being joint Hecke--Maa{\\ss} eigenfunctions. They also satisfy the multiplicativity relation\n\\begin{equation}\\label{hecke-mult}\nT_mT_n=\\sum_{(d)\\mid(m,n)}T_{mn\/d^2},\\qquad m,n\\in\\ZZ[i]\\setminus\\{0\\},\n\\end{equation}\nwhere it is clear that the right-hand side does not depend on the choice of the generator $d$. Finally we have the Rankin--Selberg bound\n\\begin{equation}\\label{RS-bound}\n\\sum_{|n|^2\\leq x}|\\lambda_n(V)|^2\\ll_Vx.\n\\end{equation}\n\n\\subsection{Eisenstein series and spectral decomposition}\\label{Eisenstein-subsec}\nIn this subsection, we review the construction and properties of the (not necessarily spherical) Eisenstein series on $\\Gamma\\backslash G$. The quotient $\\Gamma\\backslash G$ has a unique cusp at $\\infty$. For $\\ell\\in\\ZZ_{\\geq 0}$, $p,q\\in\\ZZ$ with $2\\mid p$ and $|p|,|q|\\leq\\ell$, and $\\nu\\in\\CC$ with $\\Re\\nu>1$, we define the Eisenstein series of type $(\\ell,q)$ at $\\infty$ as in \\cite[Def.~3.3.1]{Lokvenec-Guleska2004} by the absolutely and locally uniformly convergent series\n\\begin{equation}\\label{Eisdef}\nE_{\\ell,q}(\\nu,p)(g):=\\sum_{\\gamma\\in\\Gamma_{\\infty}\\backslash\\Gamma}\\phi_{\\ell,q}(\\nu,p)(\\gamma g),\n\\end{equation}\nwhere $\\Gamma_{\\infty}$ is the subgroup of upper-triangular matrices in $\\Gamma$ (the stabilizer of $\\infty$ in $\\Gamma$), and\n\\begin{equation}\\label{eq:phi-ell-q-nu-p}\n\\phi_{\\ell,q}(\\nu,p)\\left(\\begin{pmatrix}r&\\ast\\\\&r^{-1}\\end{pmatrix}k\\right):=r^{2(1+\\nu)}\\Phi_{p,q}^{\\ell}(k),\\qquad r>0,\\quad k\\in K.\n\\end{equation}\nThese Eisenstein series possess a meromorphic continuation to $\\nu\\in\\CC$, which is holomorphic along $i\\RR$ \\cite[\\S5.1]{Lokvenec-Guleska2004}. An easy calculation with \\eqref{Hecke-def} and \\eqref{matrix-coeff} shows that they are also eigenfunctions of the Hecke operators $T_n$ with\n\\begin{equation}\n\\label{Eisenstein-Hecke-eigen}\nT_nE_{\\ell,q}(\\nu,p)=\\lambda_n(E(\\nu,p))E_{\\ell,q}(\\nu,p),\\quad \\lambda_n(E(\\nu,p)):=\\frac{1}{4}\\sum_{n=ad}\\chi_{\\nu,p}(a)\\chi_{-\\nu,-p}(d),\n\\end{equation}\nwhere $\\chi_{\\nu,p}(z):=|z|^{\\nu}(z\/|z|)^{-p}$. In particular,\n\\begin{equation}\\label{eq:hecke-i-eigenvalue-eisenstein}\n\\lambda_{in}(E(\\nu,p))=(-1)^{p\/2}\\lambda_n(E(\\nu,p)).\n\\end{equation}\nWhile $E_{\\ell,q}(\\nu,p)$ for individual $\\nu\\in i\\RR$ (barely) fail to lie in $L^2(\\Gamma\\backslash G)$, their averages against $C_c(i\\RR)$ weights $f(\\nu)$ comfortably do, and upon taking the Hilbert space closure of their span and orthocomplements one obtains the familiar orthogonal decomposition\n\\begin{equation}\\label{eq:spectral-decomposition}\nL^2(\\Gamma\\backslash G)=\\CC\\cdot 1\\oplus L^2(\\Gamma\\backslash G)_{\\cusp}\\oplus L^2(\\Gamma\\backslash G)_{\\Eis}.\n\\end{equation}\n\nLet $H(\\nu,p)$ be the linear span of all $\\phi_{\\ell,q}(\\nu,p)$ with $|p|,|q|\\leq\\ell$. By \\eqref{eq:phi-ell-q-nu-p}, the functions $f\\in H(\\nu,p)$ satisfy\n\\[f\\left(\\begin{pmatrix}z&\\ast\\\\&z^{-1}\\end{pmatrix}g\\right)=|z|^2\\chi_{\\nu,p}(z^2)f(g),\\qquad z\\in\\CC^\\times,\\quad g\\in G,\\]\nand they are determined by their restriction to $K$. In fact $H(\\nu,p)$ as a $(\\mfg,K)$-module is isomorphic to the \n$K$-finite part of $\\pi_{\\nu,p}$ featured in \\eqref{eq:tau-ell-isotypical-decomposition-algebraic}. That is, the appropriate completion of $H(\\nu,p)$ serves as a model of the Fr\u00e9chet\/Hilbert space representation $\\pi_{\\nu,p}$, and we shall denote by \n$H^\\infty(\\nu,p)$ the dense subspace of smooth vectors in this completion.\n\nDenoting by $C^K(\\Gamma\\backslash G)$ the space of $K$-finite smooth functions on $\\Gamma\\backslash G$, an automorphic representation of type $(\\nu,p)$ for $\\Gamma\\backslash G$ may be realized as a $(\\mfg,K)$-module homomorphism $T:H(\\nu,p)\\to C^K(\\Gamma\\backslash G)$, cf.\\ \\cite[\\S3.4]{Lokvenec-Guleska2004}. Such a $T$ may arise as $T_V$ for a cuspidal consituent $V\\simeq\\pi_{\\nu,p}$ occurring discretely in $L^2(\\Gamma\\backslash G)_{\\cusp}$, or from the Eisenstein series via\n\\[T_{E(\\nu,p)}\\phi_{\\ell,q}(\\nu,p):=E_{\\ell,q}(\\nu,p),\\qquad |p|,|q|\\leq\\ell.\\]\nIndeed, by \\eqref{Eisdef}, the last display defines a $(\\mfg,K)$-module homomorphism for $\\Re\\nu>1$, hence by analytic continuation for all $\\nu\\in\\CC$ where the relevant Eisenstein series have no pole. Following custom, we lighten the notation by denoting a generic automorphic representation of type $(\\nu,p)$, whether of type $T_V$ or $T_{E(\\nu,p)}$, as $V$, and its associated Hecke eigenvalues as $\\lambda_n(V)$. Finally, we shall use that the above $(\\mfg,K)$-module homomorphism extends uniquely to a $G$-module homomorphism $H^\\infty(\\nu,p)\\to C^\\infty(\\Gamma\\backslash G)$, and its image consists of functions of moderate growth.\n\nNow \\eqref{eq:spectral-decomposition} is explicated by the following two spectral identities. For $f$ in the space $C^{\\infty}_0(\\Gamma\\backslash G)$ of smooth complex-valued functions on $\\Gamma\\backslash G$ with all rapidly decaying derivatives, we have\n\\begin{equation}\\label{eq:spectral-decomposition-EGM}\n\\begin{split}\nf= \\frac{\\langle f, 1\\rangle }{\\vol(\\Gamma \\backslash G)} & + \\sum_{\\text{$V$ cuspidal}} \\sum_{\\substack{q,\\ell\\in \\ZZ \\\\ |p_V|,|q|\\leq \\ell}} \\frac{\\langle f,T_V \\phi_{\\ell,q}(\\nu_V,p_V) \\rangle}{{\\|\\Phi_{p_V,q}^{\\ell}\\|}_K^2} T_V \\phi_{\\ell,q}(\\nu_V,p_V)\\\\ & + \\frac{1}{\\pi i} \\int_{(0)} \\sum_{p\\in 2\\ZZ} \\sum_{\\substack{q,\\ell\\in \\ZZ \\\\ |p|,|q|\\leq \\ell}} \\frac{\\langle f,E_{\\ell,q}(\\nu,p) \\rangle}{{\\|\\Phi_{p,q}\n^{\\ell}\\|}_K^2} E_{\\ell,q}(\\nu,p) \\,\\dd\\nu,\n\\end{split}\n\\end{equation}\nwith the obvious interpretation of $\\langle f,E_{\\ell,q}(\\nu,p) \\rangle$. For\n$f_1,f_2\\in C^{\\infty}_0(\\Gamma \\backslash G)$, we have with the same interpretation\n\\begin{equation}\\label{eq:spectral-decomposition-plancherel}\n\\begin{split}\n\\langle f_1,f_2 \\rangle = \\frac{ \\langle f_1, 1\\rangle \\langle 1, f_2\\rangle}{\\vol(\\Gamma \\backslash G)} & + \\sum_{\\text{$V$ cuspidal}} \\sum_{\\substack{q,\\ell\\in \\ZZ \\\\ |p_V|,|q|\\leq \\ell}} \\frac{\\langle f_1,T_V \\phi_{\\ell,q}(\\nu_V,p_V) \\rangle \\langle T_V \\phi_{\\ell,q}(\\nu_V,p_V), f_2 \\rangle}{{\\|\\Phi_{p_V,q}^{\\ell}\\|}_K^2} \\\\ & + \\frac{1}{\\pi i} \\int_{(0)} \\sum_{p\\in 2\\ZZ} \\sum_{\\substack{q,\\ell\\in \\ZZ \\\\ |p|,|q|\\leq \\ell}} \\frac{\\langle f_1,E_{\\ell,q}(\\nu,p) \\rangle \\langle E_{\\ell,q}(\\nu,p),f_2 \\rangle}{{\\|\\Phi_{p,q}\n^{\\ell}\\|}_K^2} \\,\\dd\\nu.\n\\end{split}\n\\end{equation}\nCompare with \\cite[Ch.~6, Th.~3.4]{ElstrodtGrunewaldMennicke1998} and \\cite[Th.~8.1]{Lokvenec-Guleska2004}.\n\nWe shorten the notation in two ways. First, for an automorphic representation $V$ (cuspidal or Eisenstein) of type $(\\nu,p)$ occurring in $L^2(\\Gamma\\backslash G)$, we write\n\\[\\phi_{\\ell,q}^{V}:=\\frac{T_V\\phi_{\\ell,q}(\\nu,p)}{{\\|\\Phi_{p,q}^{\\ell}\\|}_K},\\qquad |p|,|q|\\leq\\ell.\\] \nIn particular, when at least one of two such $V$ and $V'$ is cuspidal, $\\langle\\phi_{\\ell,q}^V,\\phi_{\\ell',q'}^{V'}\\rangle$ equals $\\delta_{(\\ell,q,V)=(\\ell',q',V')}$. Second, while the decompositions in \\eqref{eq:spectral-decomposition-EGM} and \\eqref{eq:spectral-decomposition-plancherel} are over all automorphic representations $V$ (cuspidal or Eisenstein) occurring in $L^2(\\Gamma\\backslash G)$, keeping in mind the $\\tau_{\\ell}$-spherical transform of \\S\\ref{section:sphericaltransform}, it will be useful to introduce the shorthand notation $\\int_{[\\ell]}\\,\\dd V$ for the sum-integral over those $V$ of type $(\\nu,p)$ such that $\\pi_{\\nu,p}\\in\\widehat{G}(\\tau_{\\ell})$ (that is, with $|p|\\leq\\ell$ as well as $p\\in 2\\ZZ$ for $V$ Eisenstein). Thus, for example, \\eqref{eq:spectral-decomposition-EGM} may be rewritten in the more compact form\n\\begin{equation}\n\\label{compactform}\nf=\\frac{\\langle f,1\\rangle}{\\vol(\\Gamma \\backslash G)}+\\sum_{\\ell\\geq 0}\\int_{[\\ell]}\\sum_{|q|\\leq\\ell}\\langle f,\\phi_{\\ell,q}^{V}\\rangle\\phi_{\\ell,q}^{V}\\,\\dd V.\n\\end{equation}\n\n\\subsection{Rankin--Selberg convolutions}\\label{RSSection}\nIn this subsection, we review briefly the properties of Rankin--Selberg $L$-functions. We shall restrict to automorphic representations for $\\Gamma\\backslash G$ on which the Hecke operator $T_i$ acts trivially, so that they lift to automorphic representations for $\\PGL_2(\\ZZ[i])\\backslash\\PGL_2(\\CC)$. This allows us to refer to the theory of $\\GL_2$.\n\nThe Rankin--Selberg $L$-function of two automorphic representations $V_j$ of type\n$(\\nu_j,p_j)\\in i\\RR\\times \\ZZ$ for $\\Gamma\\backslash G$ is defined by the absolutely convergent series (cf.~\\eqref{RS-bound})\n\\begin{equation}\\label{RSdef}\nL(s, V_1\\times V_2) = \\frac{1}{4}\\zeta_{\\QQ(i)}(2s)\\sum_{n \\in \\ZZ[i] \\setminus \\{0\\}}\n\\frac{\\lambda_n(V_1)\\lambda_n(V_2)}{(|n|^2)^s}, \\qquad \\Re s > 1.\n\\end{equation}\nThis can be verified by matching the Euler factors on the two sides, using \\cite[Th.~15.1]{Jacquet1972}, \\cite[Prop.~3.5]{JacquetLanglands}, \\cite[(3.1.3)]{Tate1977}, and \\cite[Lemma~1.6.1]{Bump1997}.\nIn particular,\n\\[L(s,V\\times E(\\nu,p))=L(s-\\tfrac{1}{2}\\nu,V\\otimes\\chi_p)L(s+\\tfrac{1}{2}\\nu,V\\otimes\\chi_{-p})\\]\nfor $V$ cuspidal and $(\\nu,p)\\in i\\RR\\times 4\\ZZ$ according to \\eqref{eq:hecke-i-eigenvalue-eisenstein}, as well as\n\\[ L\\big(s,E(\\nu_1,p_1)\\times E(\\nu_2,p_2)\\big)=\\prod_{\\epsilon_1,\\epsilon_2\\in\\{\\pm 1\\}}L\\big(s+\\tfrac{1}{2}(\\epsilon_1\\nu_1+\\epsilon_2\\nu_2),\\chi_{-\\epsilon_1p_1-\\epsilon_2p_2}\\big),\\]\nwith $(\\nu_j,p_j)\\in i\\RR\\times 4\\ZZ$ and $\\chi_p(z):=(z\/|z|)^{-p}$. All $L$-functions are meant over $\\QQ(i)$.\n\nThe Rankin--Selberg $L$-function $L(s,V_1\\times V_2)$ possesses a meromorphic continuation to the entire complex plane with the exception of finitely many possible poles along the line $\\Re s=1$. It is in fact entire except as follows (cf.\\ \\cite[Th.~2.2]{GelbartJacquet}):\n\\begin{itemize}\n\\item If $V_1 = V_2\\,(=V)$ is cuspidal of type $(\\nu,p)$ (that is, $(\\nu_1,p_1)=\\pm(\\nu_2,p_2)$), there is a simple pole at $s=1$ with (strictly) positive residue\n\\begin{equation}\\label{RS-res}\n\\mathop{\\mathrm{res}}_{s=1} L(s, V\\times V) = \\frac{\\pi}{4}\\cdot L(1,\\mathrm{ad^2}V) \\gg_{\\eps} \\big((1 + |p|)(1+ |\\nu|)\\big)^{-\\eps},\n\\end{equation}\nwhere the lower bound follows from \\cite[Prop.~3.2]{Maga2013}.\n\\item If $V_1$ and $V_2$ are both Eisenstein series with $p_1 = \\epsilon p_2$ for some $\\epsilon\\in\\{\\pm 1\\}$, there are simple poles at $s = 1+\\eta(\\nu_1 - \\epsilon\\nu_2)\/2$ for $\\eta\\in\\{\\pm 1\\}$ with residue\n\\begin{equation}\n\\label{RS-res-Eis}\n\\mcL_{\\eta} (V_1,V_2):=\\frac{\\pi}{4}\\cdot\\zeta_{\\QQ(i)}(1+\\eta(\\nu_1-\\epsilon\\nu_2))L(1+\\eta \\nu_1,\\chi_{-2\\eta p_1})L(1-\\eta\\epsilon\\nu_2,\\chi_{2\\eta\\epsilon p_2}),\n\\end{equation}\nunless $\\nu_1=\\pm\\nu_2$ or $\\nu_1=0$ or $\\nu_2=0$, in which case, however, the definition still makes sense as a meromorphic function of $\\nu_1,\\nu_2\\in\\CC$.\n\\end{itemize}\n\nFinally, the associated completed $L$-function satisfies the familiar functional equation\n\\begin{equation}\\label{func-eq}\n\\Lambda(s, V_1 \\times V_2) := 16^sL(s, V_1\\times V_2)L_{\\infty} (s, V_1\\times V_2) = \\Lambda(1-s, V_1 \\times V_2),\n\\end{equation}\nwhere the exponential factor $16^s$ coming from the discriminant of $\\QQ(i)$ is included for convenience, and the factor at infinity is given by\n\\begin{align}\n\\notag L_{\\infty}(s, V_1\\times V_2) = \\Gamma(s,\\vec{\\nu},\\vec{p})\n:&=\\prod_{\\epsilon_1,\\epsilon_2\\in\\{\\pm 1\\}}\nL_\\infty(s,\\chi_{\\epsilon_1\\nu_1,\\epsilon_1p_1}\\cdot\\chi_{\\epsilon_2\\nu_2,\\epsilon_2p_2})\\\\\n\\label{inffactor} &=\\prod_{\\epsilon_1,\\epsilon_2\\in\\{\\pm 1\\}}\n\\Gamma_{\\CC}\\left(s+\\textstyle\\frac{1}{2}(\\epsilon_1\\nu_1+\\epsilon_2\\nu_2)+\\textstyle\\frac{1}{2}|\\epsilon_1p_1+\\epsilon_2p_2|\\right).\n\\end{align}\nHere we used the abbreviations\n\\[\\Gamma_{\\CC}(s):=2(2\\pi)^{-s}\\Gamma(s),\\qquad\\vec{\\nu}:=(\\nu_1,\\nu_2),\\qquad\\vec{p}:=(p_1,p_2).\\]\nIndeed, \\eqref{inffactor} follows from \\cite[Prop.~18.2]{Jacquet1972}, \\cite[\\S 3]{Tate1977}, \\cite[Prop.~6 in \\S VII-2]{Weil1974} and its proof, upon noting that $V_j$ is isomorphic to the principal series representation induced from the pair of characters $(\\chi_{-\\nu_j,-p_j},\\chi_{\\nu_j,p_j})$.\n\n\\begin{lemma}\\label{eis-pos}\nLet $f : i\\RR \\rightarrow \\CC$ be a function decaying as $f(\\nu)\\ll (1+|\\nu|)^{-3}$, and let $p \\in \\ZZ$. Then\n\\[\\int_{(0)}\\int_{(0)}\\sum_{\\eta \\in \\{\\pm 1\\}}\nf(\\nu_1)\\ov{f(\\nu_2)}\\,\\mcL_{\\eta}((\\nu_1,p),(\\nu_2,p))\\,\\frac{\\dd\\nu_1}{\\pi i}\\,\\frac{\\dd\\nu_2}{\\pi i}\\geq 0.\\]\n\\end{lemma}\n\n\\begin{proof} First we note that the $\\eta$-sum cancels the individual poles of $\\mcL_{\\eta}((\\nu_1, p), (\\nu_2, p))$ at $\\nu_1 = \\nu_2$. For $\\eps > 0$ and $V_j = (\\nu_j,p)$ with $j\\in\\{1,2\\}$ define\n\\[\\mcL(V_1, V_2, \\eps):=\\sum_{\\eta\\in\\{\\pm 1\\}}\\frac{\\pi}{4}\\zeta_{\\QQ(i)}(1+\\eps+\\eta(\\nu_1-\\nu_2))\nL(1+\\eta\\nu_1,\\chi_{-2\\eta p})L(1-\\eta\\nu_2,\\chi_{2\\eta p})\\]\nand\n\\[\\mcI(\\eps):=\\int_{(0)}\\int_{(0)}\\sum_{\\eta\\in\\{\\pm 1\\}}\nf(\\nu_1)\\ov{f(\\nu_2)}\\,\\mcL_{\\eta}(V_1,V_2,\\eps)\\,\\frac{\\dd\\nu_1}{\\pi i}\\,\\frac{\\dd\\nu_2}{\\pi i}.\\]\nThis function is continuous at $\\eps = 0$, so it suffices to show $\\mcI(\\eps) \\geq 0$ for $\\eps > 0$.\nInserting the definition and opening the Dedekind zeta function, we see that\n\\[\\mcI(\\eps) = \\frac{\\pi}{16} \\sum_{\\eta \\in \\{\\pm 1\\}} \\sum_{n \\in \\ZZ[i]\\setminus\\{0\\}}\n\\frac{1}{|n|^{2+2\\eps}}\n\\biggl|\\int_{(0)} \\frac{1}{|n|^{2\\eta\\nu}} L(1 + \\eta \\nu, \\chi_{-2\\eta p}) f(\\nu) \\frac{\\dd\\nu}{\\pi i} \\biggr|^2 \\geq 0\\]\nas desired.\n\\end{proof}\n\n\\subsection{Diagonal detection of Voronoi type}\\label{sec28}\nIn this subsection, we prove a Voronoi-type formula that allows us to detect equality of two automorphic representations occurring in $L^2(\\Gamma\\backslash G)$ in terms of a certain weighted orthogonality relation between their Hecke eigenvalues.\nWe shall use that only tempered representations occur in $L^2(\\Gamma\\backslash G)$, e.g.\\ by \\cite[Ch.~7, Prop.~6.2]{ElstrodtGrunewaldMennicke1998}.\n\n\\begin{lemma}\\label{lemma-vor}\nLet $P \\geq 1$ be a parameter. There exists a function\n\\[W_P:\\RR_{>0}\\times\\CC^2\\times\\ZZ^2\\to\\CC,\\]\ngiven explicitly by \\eqref{defW}, with the following properties.\n\\begin{enumerate}[(a)]\n\\item\\label{vor-a} $W_{P}(x,\\vec{\\nu},\\vec{p})$ is an entire function of $\\vec{\\nu}=(\\nu_1,\\nu_2)\\in\\CC^2$, and it is invariant under\n\\[ (\\nu_j,p_j)\\mapsto (-\\nu_j,-p_j)\\quad\\text{as well as}\\quad (\\nu_j,p_j)\\mapsto (p_j,\\nu_j)\\quad (\\nu_j\\in \\ZZ). \\]\n\\item\\label{vor-b} Let us abbreviate $\\tilde P:=\\bigl(1+|p_1+p_2|\\bigr)\\bigl(1+|p_1-p_2|\\bigr)$. Then for every\n$A>|\\Re\\nu_1|+|\\Re\\nu_2|$ we have\n\\begin{equation}\\label{W1}\nW_{P}(x,\\vec{\\nu},\\vec{p})\\ll_{A,\\Re\\nu_1,\\Re\\nu_2}\\bigl(1+(\\tilde P\/P)^{2A-2}\\bigr)\\bigl(1+|\\nu_1|+|\\nu_2|\\bigr)^{4A}x^{-A}.\n\\end{equation}\n\\item\\label{vor-c} For every two automorphic representations $V_j$ of type $(\\nu_j,p_j)\\in i\\RR\\times\\ZZ$ for $\\Gamma\\backslash G$ we have\n\\begin{equation}\\label{vor-formula}\n\\begin{split}\n&\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}W_P\\left(\\frac{|n|}{P},\\vec{\\nu},\\vec{p}\\right)\\lambda_n(V_1)\\lambda_n(V_2)\\\\\n&=\\begin{cases}\n\\frac{\\pi}{4}L(1,\\mathrm{ad^2}V_1)P^2,&V_1=V_2\\text{ cuspidal};\\\\\n\\sum_{\\eta\\in\\{\\pm 1\\}}\\mcL_{\\eta}(V_1,V_2)P^{2+\\eta(\\nu_1-\\epsilon\\nu_2)},&V_1,V_2\\text{ Eisenstein, }p_1=\\epsilon p_2,\\,\\,\\epsilon\\in\\{\\pm 1\\};\\\\\n0,&\\text{otherwise,}\n\\end{cases}\n\\end{split}\n\\end{equation}\nwhere $L(1,\\mathrm{ad^2}V_1)$ and $\\mcL_{\\eta}(V_1,V_2)$ are as in \\eqref{RS-res} and \\eqref{RS-res-Eis}.\n\\end{enumerate}\n\\end{lemma}\n\n\\begin{proof}\nLet $w:\\RR_{>0}\\to\\CC$ be a smooth function supported inside $[1,2]$, and normalized so that its Mellin transform $\\widehat{w}(s)=\\int_0^{\\infty}w(x)x^s\\,\\dd x\/x$ satisfies $\\widehat{w}(1)=1$. We define\n\\begin{equation}\\label{defW}\nW_P(x,\\vec{\\nu},\\vec{p}):=\\frac1{8\\pi i}\\int_{(2)}\\zeta_{\\QQ(i)}(2s)\\left(\\widehat{w}(s)-P^{2-4s}\\frac{16^{2s-1}\\Gamma(s,\\vec{\\nu},\\vec{p})}{\\Gamma(1-s,\\vec{\\nu},\\vec{p})}\\widehat{w}(1-s)\\right)x^{-2s}\\,\\dd s,\n\\end{equation}\nwhere $\\Gamma(s,\\vec{\\nu},\\vec{p})$ is as in \\eqref{inffactor}.\n\nShifting the contour to the far right, we see that $W_P(x,\\vec{\\nu},\\vec{p})$ is entire in $\\vec{\\nu}$. The symmetry with respect to $(\\nu_j, p_j) \\mapsto (-\\nu_j, -p_j)$ is obvious from \\eqref{inffactor}. For $r\\in\\frac{1}{2}\\ZZ$ we have the equality\n\\[\\frac{\\Gamma(z+r)}{\\Gamma(1-z+r)}\n= \\frac{\\Gamma(z-r)}{\\Gamma(1-z-r)}\\cdot\\frac{\\sin(\\pi(z-r))}{\\sin(\\pi(z+r))}\n= (-1)^{2r}\\frac{\\Gamma(z-r)}{\\Gamma(1-z-r)}\\]\nof meromorphic functions in $z\\in\\CC$. This shows that (cf.\\ \\eqref{inffactor})\n\\begin{align*}\n\\frac{\\Gamma(s,\\vec{\\nu},\\vec{p})}{\\Gamma(1-s,\\vec{\\nu},\\vec{p})}\n&=\\prod_{\\epsilon_1,\\epsilon_2\\in\\{\\pm 1\\}}\n\\frac{\\Gamma_{\\CC}\\left(s+\\frac{1}{2}(\\epsilon_1\\nu_1+\\epsilon_2\\nu_2) + \\frac{1}{2}|\\epsilon_1p_1+\\epsilon_2p_2|\\right)}\n{\\Gamma_{\\CC}\\left(1-s-\\frac{1}{2}(\\epsilon_1\\nu_1+\\epsilon_2\\nu_2)+\\frac{1}{2}|\\epsilon_1p_1+\\epsilon_2p_2|\\right)}\\\\\n&=\\prod_{\\epsilon_1,\\epsilon_2\\in\\{\\pm 1\\}}\n\\frac{\\Gamma_{\\CC}\\left(s+\\frac{1}{2}(\\epsilon_1\\nu_1+\\epsilon_2\\nu_2) + \\frac{1}{2}(\\epsilon_1p_1+\\epsilon_2p_2)\\right)}\n{\\Gamma_{\\CC}\\left(1-s-\\frac{1}{2}(\\epsilon_1\\nu_1+\\epsilon_2\\nu_2)+\\frac{1}{2}(\\epsilon_1p_1+\\epsilon_2p_2)\\right)}\n\\end{align*}\nis symmetric with respect to $(\\nu_j, p_j) \\mapsto (p_j, \\nu_j)$, completing the proof of \\ref{vor-a}.\n\nCombining the first line of the previous display with \\cite[Lemma~3.2]{Harcos2002}, we infer for $\\Re(s)>\\frac{1}{2}|\\Re\\nu_1|+\\frac{1}{2}|\\Re\\nu_2|$ that\n\\begin{align*}\n&\\left|\\frac{\\Gamma(s,\\vec{\\nu},\\vec{p})}{\\Gamma(1-s,\\vec{\\nu},\\vec{p})}\\right|\n=\\prod_{\\epsilon_1,\\epsilon_2\\in\\{\\pm 1\\}}\n\\left|\\frac{\\Gamma_{\\CC}\\left(s+\\frac{1}{2}(\\epsilon_1\\nu_1+\\epsilon_2\\nu_2) + \\frac{1}{2}|\\epsilon_1p_1+\\epsilon_2p_2|\\right)}\n{\\Gamma_{\\CC}\\left(1-\\ov{s}-\\frac{1}{2}(\\epsilon_1\\ov{\\nu_1}+\\epsilon_2\\ov{\\nu_2})+\\frac{1}{2}|\\epsilon_1p_1+\\epsilon_2p_2|\\right)}\\right|\\\\\n&\\qquad\\ll_{\\Re s,\\Re\\nu_1,\\Re\\nu_2}\\prod_{\\epsilon_1,\\epsilon_2\\in\\{\\pm 1\\}}\n\\left|s+\\tfrac12(\\epsilon_1\\nu_1+\\epsilon_2\\nu_2) + \n\\tfrac12|\\epsilon_1p_1+\\epsilon_2p_2|\\right|^{\\Re(2s+\\epsilon_1\\nu_1+\\epsilon_2\\nu_2)-1}\\\\\n&\\qquad\\ll_{\\Re s,\\Re\\nu_1,\\Re\\nu_2}\\prod_{\\epsilon_1,\\epsilon_2\\in\\{\\pm 1\\}}\n\\left(1+|\\epsilon_1p_1+\\epsilon_2p_2|\\right)^{\\Re(2s+\\epsilon_1\\nu_1+\\epsilon_2\\nu_2)-1}\n\\left(|s|+|\\nu_1|+|\\nu_2|\\right)^{\\Re(2s+\\epsilon_1\\nu_1+\\epsilon_2\\nu_2)}\\\\\n&\\qquad=\\left(1+|p_1+p_2|\\right)^{4\\Re s-2}\\left(1+|p_1-p_2|\\right)^{4\\Re s-2}\\left(|s|+|\\nu_1|+|\\nu_2|\\right)^{8\\Re s}.\n\\end{align*}\nTurning back to \\eqref{defW}, the singularity of the integrand at $s = 1\/2$ is removable, so we can shift the contour to $\\Re s = A\/2$. The bound \\eqref{W1} follows upon noting that\nthat\n\\begin{itemize}\n\\setlength\\itemsep{3pt}\n\\item $\\widehat{w}(s) \\ll_{C, \\Re s} (1 + |s|)^{-C}$ for all $C > 0$ and $s\\in\\CC$;\n\\item $\\zeta_{\\QQ(i)}(2s) \\ll (1 + |s|)^2$ for $\\Re s > 0$ and $|2s-1|>1$.\n\\end{itemize}\n\nFinally, to show \\ref{vor-c}, we start from the following identity, a consequence of \\eqref{RSdef}:\n\\[\\frac{1}{16}\\sum_{m,n\\in\\ZZ[i]\\setminus\\{0\\}}w\\left(\\frac{|m|^4|n|^2}{P^2}\\right)\\lambda_n(V_1)\\lambda_n(V_2)\n= \\frac{1}{2\\pi i}\\int_{(2)} L(s, V_1 \\times V_2) \\widehat{w}(s) P^{2s} \\,\\dd s.\\]\nWe shift the contour to $\\Re s = -1$; the contribution of the possible poles (on the line $\\Re s = 1$) is recorded on the right-hand side of \\eqref{vor-formula}. In the remaining integral we apply the functional equation \\eqref{func-eq} and change variables $s \\mapsto 1-s$ getting\n$$\\frac{1}{2\\pi i}\\int_{(2)} L(s, V_1 \\times V_2) P^{2-4s} \\frac{16^s\\Gamma(s,\\vec{\\nu},\\vec{p})}{16^{1-s}\\Gamma(1-s,\\vec{\\nu},\\vec{p})}\\widehat{w}(1-s) P^{2s}\\,\\dd s.$$\nMoving this term to the other side, we obtain the desired formula \\eqref{vor-formula}, first for $(\\nu_1, p_1) \\neq \\pm (\\nu_2, p_2)$, but then by analytic continuation everywhere.\nThis completes the proof of \\ref{vor-c}.\n\\end{proof}\n\n\\section{Pre-trace formula and amplification}\n\n\\subsection{Amplified pre-trace formula}\\label{sec31}\nIn this subsection, we prove an amplified pre-trace formula based on the theory of Eisenstein series and the spectral decomposition of $L^2(\\Gamma\\backslash G)$ (see \\S\\ref{Eisenstein-subsec}). This is a familiar identity between spectral and geometric data, and its full force will be needed in the proof of Theorem~\\ref{thm3}\\ref{thm3-b}; in fact, as an even more general version, we shall use a double pre-trace formula (see \\S\\ref{sec:double-pre-trace-formula}) in two variables. In many situations, however, all the spectral terms are nonnegative, in which case the pre-trace formula is simply used as an inequality. This is the case for the proof of Theorems~\\ref{thm1},~\\ref{thm2}~and~\\ref{thm3}\\ref{thm3-a}. An amplified pre-trace inequality can be derived with a less heavy machine. In the next subsection, we make a point of methodology by deriving these inequalities more directly, in a special case that is sufficient for us.\n\nLet $A$ be a bounded operator on $L^2(\\Gamma\\backslash G)$ preserving the subspace $C_0^{\\infty}(\\Gamma\\backslash G)$ of smooth functions with all rapidly decreasing derivatives. Assume that for the basis forms $\\phi_{\\ell,q}^{V}$, indexed as in \\eqref{compactform} by $V$ occurring in $L^2(\\Gamma\\backslash G)$ (cuspidal or Eisenstein) and $\\ell,q\\in\\ZZ$ satisfying $\\ell\\geq\\max(|p_V|,|q|)$, there are constants $c_{\\ell,q}^{V}(A)\\in\\CC$ such that\n\\begin{equation}\\label{newconstants}\n\\langle A\\psi,\\phi_{\\ell,q}^{V}\\rangle=c_{\\ell,q}^{V}(A)\\langle \\psi,\\phi_{\\ell,q}^{V}\\rangle,\\qquad\n\\psi\\in C^{\\infty}_0(\\Gamma\\backslash G).\n\\end{equation}\nThen \\eqref{eq:spectral-decomposition-plancherel} yields, for every $\\psi\\in C^{\\infty}_0(\\Gamma\\backslash G)$,\n\\begin{equation}\\label{Apsi-psi}\n\\langle A\\psi,\\psi\\rangle=\\frac{\\langle A\\psi,1\\rangle\\langle 1,\\psi\\rangle}{\\vol(\\Gamma\\backslash G)}+\\sum_{\\ell\\geq 0}\\int_{[\\ell]}\\sum_{|q|\\leq\\ell}c_{\\ell,q}^{V}(A)|\\langle\\psi,\\phi_{\\ell,q}^{V}\\rangle|^2\\,\\dd V.\n\\end{equation}\n\nFor $f\\in C_0(G)$ a rapidly decaying continuous function on $G$, and $\\psi\\in L^2(\\Gamma\\backslash G)$, we may consider the function $R(f)\\psi\\in L^2(\\Gamma\\backslash G)$ defined by\n\\begin{align*}\n(R(f)\\psi)(g)&:=\\int_Gf(h)\\psi(gh)\\,\\dd h=\\int_Gf(g^{-1}h)\\psi(h)\\,\\dd h\\\\\n&=\\int_{\\Gamma\\backslash G}k_f(g,h)\\psi(h)\\,\\dd h,\\qquad k_f(g,h):=\\sum_{\\gamma\\in\\Gamma}f(g^{-1}\\gamma h).\n\\end{align*}\nThus $R(f)$ is a bounded integral operator on $L^2(\\Gamma\\backslash G)$ with kernel $k_f$. It is clear that $R(f)$ preserves $C_0^{\\infty}(\\Gamma\\backslash G)$, and its adjoint equals $R(f)^\\ast=R(f^\\ast)$ with\n\\[f^\\ast(g):=\\ov{f(g^{-1})},\\qquad g\\in G.\\]\nFurther, for a finitely supported sequence of complex coefficients $x=(x_n)_{n\\in\\ZZ[i]\\setminus\\{0\\}}$, let $R_{\\fin}(x)$ be the operator on $L^2(\\Gamma\\backslash G)$ given by\n\\begin{equation}\\label{eq:def-amplifier}\nR_{\\fin}(x):=\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}x_nT_n.\n\\end{equation}\nThe adjoint of this operator equals $R_{\\fin}(x)^\\ast=R_{\\fin}(\\ov{x})$.\n\nLet us now fix an integer $\\ell\\geq 1$. Let $f\\in\\mcH(\\tau_{\\ell})_{\\infty}$ be such that $f=f^\\ast$, and let $x=(x_n)$ be as above such that $x=\\ov{x}$. Further, let $V$ be a non-identity (cuspidal or Eisenstein) automorphic representation of arbitrary type $(\\nu_V,p_V)$ occurring in $L^2(\\Gamma\\backslash G)$, and let $\\ell',q\\in\\ZZ$ be such that $\\ell'\\geq\\max(|p_V|,|q|)$. For $V$ cuspidal, \\eqref{eq:opfromtr} and \\eqref{eq:trpif} show that\n\\begin{equation}\\label{joint-eigenfunctions}\n\\begin{aligned}\nR(f)\\phi_{\\ell',q}^{V}&=\\delta_{\\ell'=\\ell}\\frac{\\widehat{f}(V)}{2\\ell+1}\\phi_{\\ell',q}^{V}, & & & & & \\widehat{f}(V)&:=\\widehat{f}(\\nu_V,p_V);\\\\\nR_{\\fin}(x)\\phi_{\\ell',q}^{V}&=\\widehat{x}(V)\\phi_{\\ell',q}^{V}, & & & & & \\widehat{x}(V)&:=\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}x_n\\lambda_n(V).\n\\end{aligned}\n\\end{equation}\nFor $V$ Eisenstein, these equations are still valid with the obvious extension of $R(f)$ and $R_{\\fin}(x)$ to functions in $C^\\infty(\\Gamma\\backslash G)$ of moderate growth, as follows from \\eqref{Eisenstein-Hecke-eigen} and the discussion between \\eqref{eq:spectral-decomposition} and \\eqref{eq:spectral-decomposition-EGM}. Therefore, following the usual argument that $R(f)$ and $R_{\\fin}(x)$ are self-adjoint, we obtain that $A:=R(f)R_{\\fin}(x)$ satisfies \\eqref{newconstants} with\n\\[ c_{\\ell',q}^{V}(A)=\\delta_{\\ell'=\\ell}\\frac{\\widehat{f}(V)\\widehat{x}(V)}{2\\ell+1}.\\]\nHence \\eqref{Apsi-psi} holds with these coefficients and $\\ell$-summation replaced by $\\ell'$-summation. We note that the coefficients decay rapidly in $\\nu$ by Theorem~\\ref{thm:pws}. Moreover, $A(1)=R(f)(1)$ vanishes by $f=f\\star\\overline{\\chi_{\\ell}}$ and the orthogonality of characters (recalling that $\\ell\\geq 1$).\n\nApplying \\eqref{Apsi-psi} and recalling our observation below \\eqref{Hecke-def} about $n\\gamma^{-1}$ as $\\gamma\\in\\Gamma\\setminus\\Gamma_n$, we obtain for every $\\psi\\in C_0^{\\infty}(\\Gamma\\backslash G)$ that\n\\begin{align*}\n\\int_{[\\ell]}\\sum_{|q|\\leq\\ell}c_{\\ell,q}^{V}(A)|\\langle\\psi,\\phi_{\\ell,q}^{V}\\rangle|^2\\,\\dd V\n&=\\iint_{(\\Gamma\\backslash G)^2}k_f(g,h) \\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}x_n T_n\\psi(h)\\overline{\\psi(g)}\\,\\dd g\\dd h\\\\\n&=\\iint_{(\\Gamma\\backslash G)^2}\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}\\frac{x_n}{|n|}\\sum_{\\gamma\\in\\Gamma_n}f(g^{-1}\\tilde{\\gamma}h)\\overline{\\psi(g)}\\psi(h)\\,\\dd g\\dd h,\n\\end{align*}\nwhere $\\tilde\\gamma$ abbreviates $\\gamma\/\\sqrt{\\det\\gamma}$. Letting $\\psi$ range through smooth, nonnegative, $L^{1}$-normalized functions supported in increasingly small open neighborhoods of a fixed point $\\Gamma g\\in\\Gamma\\backslash G$, and taking limits using the rapid decay of $c_{\\ell,q}^{V}(A)$, we obtain the desired \\emph{amplified pre-trace formula}\n\\begin{equation}\\label{APTF}\n\\int_{[\\ell]}\\frac{\\widehat{f}(V)\\widehat{x}(V)}{2\\ell+1}\\sum_{|q|\\leq\\ell}|\\phi_{\\ell,q}^{V}(g)|^2\\,\\dd V=\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}\\frac{x_n}{|n|}\\sum_{\\gamma\\in\\Gamma_n}f(g^{-1}\\tilde{\\gamma}g).\n\\end{equation}\n\nThe pre-trace formula \\eqref{APTF} isolates forms $\\phi_{\\ell,q}^{V}$ with a specific value of $\\ell$ (thus, forms in the \nchosen constituent $V^{\\ell}$ in the decomposition \\eqref{decomp} for various $V$'s), a starting point for a proof of Theorem~\\ref{thm1}. To further isolate eigenforms in the specific constituent $V^{\\ell,q}$ (for a fixed $|q|\\leqslant\\ell$), starting from our earlier $f\\in\\mcH(\\tau_{\\ell})_{\\infty}$ satisfying $f=f^\\ast$, we define a smooth function $f_q\\in C_0(G)$ by\n\\begin{equation}\\label{fqg-average-2}\nf_q(g):=\\frac1{2\\pi}\\int_0^{2\\pi}f\\big(g\\diag(e^{i\\varrho},e^{-i\\varrho})\\big)\\,e^{2qi\\varrho}\\,\\dd \\varrho =\\frac1{2\\pi}\\int_0^{2\\pi}f\\big(\\diag(e^{i\\varrho},e^{-i\\varrho})g\\big)\\,e^{2qi\\varrho}\\,\\dd \\varrho.\n\\end{equation}\nWe note that $f_q=f_q^\\ast$, but $f_q$ need not lie in $\\mcH(\\tau_{\\ell})_{\\infty}$. By the orthogonality of characters on $\\RR\/\\ZZ$, we have\n\\begin{equation}\\label{projectq}\nR(f_q)=R(f)\\Pi_q=\\Pi_q R(f),\n\\end{equation}\nwhere $\\Pi_q$ is the projection onto the closed subspace consisting of $\\psi\\in L^2(\\Gamma \\backslash G)$ such that $\\psi(g\\diag(e^{i\\varrho},e^{-i\\varrho}))=e^{2qi\\varrho}\\psi(g)$. In particular, $R(f_q)$ is a bounded, self-adjoint operator, which preserves $C_0^{\\infty}(\\Gamma\\backslash G)$. Moreover, by \\eqref{joint-eigenfunctions} and the surrounding discussion,\n\\[R(f_q)\\phi_{\\ell',q'}^{V}= \\delta_{(\\ell',q')=(\\ell,q)}\\frac{\\widehat{f}(V)}{2\\ell+1}\\phi_{\\ell',q'}^{V}\\]\nholds for $V$ cuspidal, and also for $V$ Eisenstein with the obvious extension of $R(f_q)$ to functions in $C^\\infty(\\Gamma\\backslash G)$ of moderate growth. Thus, applying as above \\eqref{Apsi-psi} with $A=R(f_q)R_{\\fin}(x)$, we obtain the following amplified pre-trace formula for individual forms:\n\\begin{equation}\\label{APTF-single-form}\n\\int_{[\\ell]}\\frac{\\widehat{f}(V)\\widehat{x}(V)}{2\\ell+1}|\\phi_{\\ell,q}^{V}(g)|^2\\,\\dd V=\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}\\frac{x_n}{|n|}\\sum_{\\gamma\\in\\Gamma_n}f_q(g^{-1}\\tilde{\\gamma}g).\n\\end{equation}\n\nWe proved \\eqref{APTF} and \\eqref{APTF-single-form} for every $f\\in\\mcH(\\tau_{\\ell})_{\\infty}$ and finitely supported $x=(x_n)$ under the assumption that $f=f^\\ast$ and $x=\\ov{x}$. In fact \\eqref{APTF} and \\eqref{APTF-single-form} hold without this assumption, because both sides are $\\CC$-linear in $f$ and $x$. Alternatively, one can modify the above proof to work without the self-adjointness assumption, starting with the analogue of \\eqref{joint-eigenfunctions} for $R(f^\\ast)\\phi_{\\ell',q}^{V}$ and $R_\\fin(\\ov{x})\\phi_{\\ell',q}^{V}$.\n\n\\subsection{Positivity and amplified pre-trace inequality}\\label{sec31b}\nIf the coefficients on the left hand side of \\eqref{APTF} and \\eqref{APTF-single-form} are nonnegative, then by dropping \ncertain terms, we obtain useful inequalities. In this subsection, we derive these inequalities in a streamlined way, drawing inspiration from \\cite[\\S 3]{BlomerHarcosMagaMilicevic2020}.\n\nLet $A$ be a positive operator operator on $L^2(\\Gamma\\backslash G)$, and let $\\mfB$ be a finite orthonormal system of eigenfunctions $\\phi$ of $A$ with (not necessarily distinct) eigenvalues $(c_{\\phi}(A))_{\\phi\\in\\mfB}$. Then, $A$ preserves the orthodecomposition\n\\[L^2(\\Gamma\\backslash G)=\\mathrm{Span}(\\mfB)\\oplus\\mathrm{Span}(\\mfB)^{\\perp},\\]\nand for any $\\psi\\in L^2(\\Gamma\\backslash G)$ the corresponding decomposition $\\psi=\\psi_1+\\psi_2$ with\n\\[\\psi_1:=\\sum_{\\phi\\in\\mfB}\\langle\\psi,\\phi\\rangle\\phi\\qquad \\text{and} \\qquad \\psi_2:=\\psi-\\psi_1\\]\ngives\n\\begin{equation}\\label{positivity}\n\\langle A\\psi,\\psi\\rangle=\\langle A\\psi_1,\\psi_1\\rangle+\\langle A\\psi_2,\\psi_2\\rangle\n\\geq\\langle A\\psi_1,\\psi_1\\rangle=\\sum_{\\phi\\in\\mfB}c_{\\phi}(A)|\\langle\\psi,\\phi\\rangle|^2.\n\\end{equation}\n\nWe will apply this positivity argument to the operators $A=R(f) R_{\\fin}(x)$ and $A=R(f_q) R_{\\fin}(x)$, where $f\\in\\mcH(\\tau_{\\ell})_{\\infty}$ and $x=(x_n)$ are as in the previous subsection. Positivity is achieved by making the operators $R(f)$ and $R_{\\fin}(x)$ individually positive, because Hecke operators commute with integral operators, and $\\Pi_q$ in \\eqref{projectq} is a positive operator commuting with $R(f)$. For the positivity $R(f)$, it suffices that\n\\begin{equation}\\label{positivity-assumption}\nf=u\\star u\\qquad\\text{for some $u\\in\\mcH(\\tau_{\\ell})_{\\infty}$ satisfying $u=u^\\ast$}.\n\\end{equation}\nFor the positivity of $R_{\\fin}(x)$, it suffices that\n\\begin{equation}\n\\label{gen-amplifier}\n\\begin{gathered}\nR_{\\fin}(x)=\\Bigl(\\sum_{l\\in P}y_lT_l\\Bigr) \\star \\Bigl(\\sum_{m\\in P}\\ov{y_m}T_m\\Bigr) +\n\\Bigl(\\sum_{l\\in P}z_lT_{l^2}\\Bigr) \\star \\Bigl(\\sum_{m\\in P}\\ov{z_m}T_{m^2}\\Bigr),\\\\[4pt]\nx_n:=\\sum_{\\substack{l,m\\in P\\\\ (d)|(l,m)\\\\ lm\/d^2=n}}y_l\\overline{y_m}+\n\\sum_{\\substack{l,m\\in P\\\\ (d)|(l^2,m^2)\\\\ l^2m^2\/d^2=n}}z_l\\overline{z_m},\n\\end{gathered}\n\\end{equation}\nwhere $(y_l)_{l\\in P}$ and $(z_l)_{l\\in P}$ are arbitrary complex coefficients supported on a finite set\n$P\\subset\\ZZ[i]\\setminus\\{0\\}$. Here we used that each Hecke operator $T_n$ is self-adjoint.\n\nNow, let $V$ be a cuspidal automorphic representation that occurs in $L^2(\\Gamma\\backslash G)$ and contains $\\tau_{\\ell}$-type vectors. Let $\\mfB=\\{ \\phi_q : |q| \\leq \\ell\\}$ be an orthonormal basis of $V^\\ell$, with $\\phi_q\\in V^{\\ell,q}$. As in the previous subsection, we evaluate the left hand side of \\eqref{positivity} geometrically, and then apply a limit in $\\psi$ to both sides. This way we obtain the following \\emph{amplified pre-trace inequalities} in place of \\eqref{APTF} and \\eqref{APTF-single-form}:\n\\begin{equation}\\label{APTI}\n\\frac{\\widehat{f}(V)\\widehat{x}(V)}{2\\ell+1}\\sum_{\\phi\\in\\mfB}|\\phi(g)|^2\\leq\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}\\frac{x_n}{|n|}\\sum_{\\gamma\\in\\Gamma_n}f(g^{-1}\\tilde{\\gamma}g)\n\\end{equation}\nand\n\\begin{equation}\\label{APTI-single-form}\n\\frac{\\widehat{f}(V)\\widehat{x}(V)}{2\\ell+1}|\\phi_q(g)|^2\\leq\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}\\frac{x_n}{|n|}\\sum_{\\gamma\\in\\Gamma_n}f_q(g^{-1}\\tilde{\\gamma}g).\n\\end{equation}\n\n\\subsection{Test functions and amplifier}\nThe main idea of the amplified pre-trace inequality \\eqref{APTI} is that it can provide a good upper bound for $\\sum_{\\phi\\in\\mfB}|\\phi(g)|^2$ as long as the test function $f\\in\\mcH(\\tau_{\\ell})_{\\infty}$ and the amplifier $x=(x_n)$ in \\S\\ref{sec31b} are chosen so that $\\widehat{f}(V)$ and $\\widehat{x}(V)$ are sizeable while the right-hand side is not too large. In this subsection, we make these choices.\n\nAs in Theorems~\\ref{thm1},~\\ref{thm2}~and~\\ref{thm3}, let $\\ell\\geq 1$ be an integer, $I\\subset i\\RR$ and $\\Omega\\subset G$ be compact sets. Let $V\\subset L^2(\\Gamma\\backslash G)$ be a cuspidal automorphic representation with minimal $K$-type $\\tau_{\\ell}$ and spectral parameter $\\nu_V\\in I$. Let us introduce the spectral weights\n\\begin{equation}\\label{eq:def-gaussian-spectral-weight}\nh(\\nu,p):=\\begin{cases} e^{(p^2-\\ell^2+\\nu^2)\/2},\\qquad &\\text{$\\nu\\in\\CC$, \\quad $p\\in \\frac1{2}\\ZZ$, \\quad $|p|\\leq\\ell$,}\\\\ 0,&\\text{$\\nu\\in\\CC$, \\quad $p\\in \\frac1{2}\\ZZ$, \\quad $|p|>\\ell$.}\\end{cases}\n\\end{equation}\nAccording to Theorems~\\ref{thm:tr-plancherel}~and~\\ref{thm:pws}, the inverse $\\tau_\\ell$-spherical transform $f:=\\widecheck{h}$ given by \\eqref{eq:inverse-tauell-transform} belongs to $\\mcH(\\tau_{\\ell})_{\\infty}$, and it satisfies $\\widehat{f}=h$. Moreover, if we set $u:=\\widecheck{v}$ with\n\\[v(\\nu,p):=\\begin{cases} (2\\ell+1)^{1\/2}e^{(p^2-\\ell^2+\\nu^2)\/4},\\qquad &\\text{$\\nu\\in\\CC$, \\quad $p\\in \\frac1{2}\\ZZ$, \\quad $|p|\\leq\\ell$,}\\\\ 0,&\\text{$\\nu\\in\\CC$, \\quad $p\\in \\frac1{2}\\ZZ$, \\quad $|p|>\\ell$,}\\end{cases}\\]\nthen $u\\in\\mcH(\\tau_{\\ell})_{\\infty}$, $u=u^\\ast$ by \\eqref{eq:spherical-function-symmetry} and \\eqref{eq:inverse-tauell-transform}, and $\\widehat{f}=\\widehat{u}^2\/(2\\ell+1)=\\widehat{u\\star u}$. This shows that \\eqref{positivity-assumption} is satisfied. Hence $R(f)$ is the kind of positive operator considered in \\S\\ref{sec31b}, and\nby \\eqref{joint-eigenfunctions} we have\n\\begin{equation}\\label{lower-bd-arch}\n\\widehat{f}(V)=h(\\nu_V,\\ell)\\gg_I 1.\n\\end{equation}\nWith the notation \\eqref{eq:def-tilde-f-s-p}, we have\n\\[\n\\widetilde{f}(s,p)=\\sqrt{2\\pi}(p^2+1-s^2)e^{(p^2-\\ell^2-s^2)\/2},\n\\]\nwhence by \\eqref{eq:inverse-spherical-transform-estimate}, \\eqref{eq:inverse-tauell-transform}, and the trivial bound\n$\\bigl|\\varphi_{\\nu,p}^{\\ell}(g^{-1})\\bigr|\\leq 2\\ell+1$, we have\n\\begin{equation}\\label{better-be-bounded}\nf(g) \\ll \\ell^2e^{-\\log^2\\|g\\|}.\n\\end{equation}\nWe shall also use the following supplement, a consequence of \\eqref{eq:spherical-function-symmetry}\nand \\eqref{eq:inverse-tauell-transform}:\n\\begin{equation}\\label{in-the-bulk}\nf(g)\\ll \\ell\\sup_{\\nu\\in i\\RR}\\,\\bigl|\\varphi_{\\nu,\\ell}^{\\ell}(g)\\bigr|+\\ell^{-50}.\n\\end{equation}\n\nWe now choose our amplifier, which we do as in \\cite[\\S5]{BlomerHarcosMilicevic2016}. Let $L\\geq 7$ be a parameter, to be chosen at the very end of the proof of Theorems~\\ref{thm1},~\\ref{thm2}~and~\\ref{thm3}, and set\n\\begin{gather*}\nP(L):=\\left\\{\\text{$l\\in\\ZZ[i]$ prime : $0<\\arg(l)<\\tfrac{\\pi}4$ and $L\\leq |l|^2\\leq 2L$}\\right\\};\\\\\ny_l:=\\sgn(\\lambda_{l}(V)),\\qquad z_l:=\\sgn(\\lambda_{l^2}(V)),\\qquad l\\in P(L).\n\\end{gather*}\nIt follows from the thesis of Erd\\H os~\\cite{Erdos} that $P(L)\\neq\\emptyset$, while\nin \\eqref{eq:def-amplifier} and \\eqref{gen-amplifier} we have\n\\begin{equation}\n\\label{ampl-expand}\nx_n=\\begin{cases}\n\\sum\\nolimits_{l\\in P(L)}(y_l^2+z_l{}^2)\\ll L\/\\log L,&n=1;\\\\\n(1+\\delta_{l_1\\neq l_2})y_{l_1}y_{l_2}+\\delta_{l_1=l_2}z_{l_1}z_{l_2}\\ll 1,&\\text{$n=l_1l_2$ for some $l_1,l_2\\in P(L)$};\\\\\n(1+\\delta_{l_1\\neq l_2})z_{l_1}z_{l_2}\\ll 1,&\n\\text{$n=l_1^2l_2^2$ for some $l_1,l_2\\in P(L)$};\\\\\n0,&\\text{otherwise}.\n\\end{cases}\n\\end{equation}\nThis formula is the analogue of \\cite[(9.16)]{BlomerHarcosMagaMilicevic2020}, except that we forgot to insert the factors $1+\\delta_{l_1\\neq l_2}$ there.\nIn particular, by the inequality $|\\lambda_{l}(V)|+|\\lambda_{l^2}(V)|>1\/2$ that follows from \\eqref{hecke-mult}, we have\n\\begin{equation}\n\\label{lower-bd-non-arch}\n\\widehat{x}(V)=\\Bigl(\\sum_{l\\in P(L)}|\\lambda_{l}(V)|\\Bigr)^2+\n\\Bigl(\\sum_{l\\in P(L)}|\\lambda_{l^2}(V)|\\Bigr)^2\\gg \\frac{L^2}{\\log^2L}.\n\\end{equation}\n\nLet $\\mfB$ be an orthonormal basis of $V^\\ell$. Entering the lower bounds \\eqref{lower-bd-arch} and \\eqref{lower-bd-non-arch} into the amplified pre-trace inequality \\eqref{APTI}, we obtain\n\\begin{equation}\\label{pre-APTI-done}\n\\frac{L^{2-\\eps}}{\\ell}\\sum_{\\phi\\in\\mfB}|\\phi(g)|^2\\ll_{\\eps,I}\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}\\frac{|x_n|}{|n|}\\sum_{\\gamma\\in\\Gamma_n}|f(g^{-1}\\tilde\\gamma g)|.\n\\end{equation}\nLet us assume that $g\\in\\Omega$. A straightforward counting combined with the divisor bound shows that\n\\begin{equation}\\label{straightforward}\n\\#\\left\\{\\gamma\\in\\Gamma_n:\\|g^{-1}\\tilde\\gamma g\\|\\leq R\\right\\}\\ll_{\\eps,\\Omega} R^{4+\\eps}|n|^{2+\\eps},\n\\end{equation}\nso that, splitting into dyadic ranges for $\\|g^{-1}\\tilde\\gamma g\\|$ and using \\eqref{better-be-bounded}, we obtain\n\\[ \\sum_{\\substack{\\gamma\\in\\Gamma_n\\\\\\log\\|g^{-1}\\tilde\\gamma g\\|>8\\sqrt{\\log\\ell}}}\n|f(g^{-1}\\tilde\\gamma g)|\n\\ll_{\\eps,\\Omega} \\ell^{-50}|n|^{2+\\eps}. \\]\nThus from \\eqref{in-the-bulk} and \\eqref{pre-APTI-done} we conclude that\n\\begin{equation}\\label{pre-APTI-done-2}\n\\begin{aligned}\n&\\sum_{\\phi\\in\\mfB}|\\phi(g)|^2\\ll_{\\eps,I,\\Omega}L^{-2+\\eps}\\ell^2\\sum_{\\substack{n\\in\\ZZ[i]\\setminus\\{0\\} \\\\ \\gamma\\in\\Gamma_n\\\\\\log\\|g^{-1}\\tilde\\gamma g\\|\\leq 8\\sqrt{\\log\\ell}}}\\frac{|x_n|}{|n|}\n\\sup_{\\nu\\in i\\RR}|\\varphi_{\\nu,\\ell}^{\\ell}(g^{-1}\\tilde\\gamma g)|+L^{2+\\eps}\\ell^{-48}.\n\\end{aligned}\n\\end{equation}\nThe bound \\eqref{pre-APTI-done-2} explicitly reduces the non-spherical sup-norm problem of estimating $\\sum_{\\phi\\in\\mfB}|\\phi(g)|^2$ via the amplification method to two ingredients:\n\\begin{itemize}\n\\item estimates on $\\varphi_{\\nu,\\ell}^{\\ell}(g^{-1}\\tilde\\gamma g)$ for $g^{-1}\\tilde\\gamma g\\in G$ of moderate size;\n\\item counting $\\gamma\\in\\Gamma_n$ according to the size of $\\varphi_{\\nu,\\ell}^{\\ell}(g^{-1}\\tilde\\gamma g)$.\n\\end{itemize}\n\nWe now also derive a version of \\eqref{pre-APTI-done-2} adapted to estimating a single form $|\\phi_q(g)|^2$ for some $|q|\\leq\\ell$. With the specific $f\\in\\mcH(\\tau_{\\ell})_{\\infty}$ provided by \\eqref{eq:inverse-tauell-transform} and \\eqref{eq:def-gaussian-spectral-weight}, we obtain by averaging as in \\eqref{fqg-average-2} the test function\n\\[ f_q(g):=\\frac1{(2\\ell+1)\\pi^2}\\sum_{|p|\\leq\\ell}\\int_{0}^{\\infty}e^{(p^2-\\ell^2-t^2)\/2}\\,\\varphi_{it,p}^{\\ell,q}(g^{-1})\\,(t^2+p^2)\\,\\dd t, \\]\nwhere\n\\[\\varphi_{\\nu,p}^{\\ell,q}(g):=\\frac1{2\\pi}\\int_0^{2\\pi}\n\\varphi_{\\nu,p}^{\\ell}\\bigl(g\\diag(e^{i\\varrho},e^{-i\\varrho})\\bigr)\\,e^{-2qi\\varrho}\\,\\dd \\varrho.\\]\nIn particular, this definition generalizes \\eqref{spherical-averaged}, and\nby \\eqref{eq:spherical-function-symmetry} we have the symmetry\n\\begin{equation}\\label{eq:averaged-spherical-function-symmetry}\n\\varphi_{\\nu,p}^{\\ell,-q}(g)=\\ov{\\varphi_{-\\ov{\\nu},p}^{\\ell,q}(g)}=\\varphi_{\\nu,p}^{\\ell,q}(g^{-1}).\n\\end{equation}\nThe analogues of \\eqref{better-be-bounded}--\\eqref{in-the-bulk} clearly hold for the $\\RR\/\\ZZ$-average $f_q$, hence by \\eqref{APTI-single-form} the following analogue of \\eqref{pre-APTI-done-2} holds as well:\n\\begin{equation}\n\\label{pre-APTI-done-2-single-form}\n\\begin{aligned}\n&|\\phi_q(g)|^2\\ll_{\\eps,I,\\Omega} L^{-2+\\eps}\\ell^2\\sum_{\\substack{n\\in\\ZZ[i]\\setminus\\{0\\} \\\\ \\gamma\\in\\Gamma_n\\\\\\log\\|g^{-1}\\tilde\\gamma g\\|\\leq 8\\sqrt{\\log\\ell}}}\\frac{|x_n|}{|n|}\n\\sup_{\\nu\\in i\\RR}|\\varphi_{\\nu,\\ell}^{\\ell,q}(g^{-1}\\tilde\\gamma g)|+L^{2+\\eps}\\ell^{-48}.\n\\end{aligned}\n\\end{equation}\n\n\\subsection{A double pre-trace formula and a fourth moment}\\label{sec:double-pre-trace-formula}\nLet us fix two integers $\\ell,q\\in\\ZZ$ with $\\ell\\geq\\max(1,|q|)$. Let $n\\in\\ZZ[i]\\setminus\\{0\\}$ and $g\\in G$. By \\eqref{APTF-single-form} and the remarks below it, for any $f\\in\\mcH(\\tau_{\\ell})_{\\infty}$ we have\n\\[\\int_{[\\ell]}\\widehat{f}(V)\\lambda_n(V)|\\phi_{\\ell,q}^{V}(g)|^2\\,\\dd V=\\frac{2\\ell+1}{|n|}\\sum_{\\gamma\\in\\Gamma_n}f_q(g^{-1}\\tilde{\\gamma}g).\\]\nIt is straightforward to adapt the proof of this formula to yield the following two-variable version.\nLet $n_1,n_2\\in\\ZZ[i]\\setminus\\{0\\}$ and $g_1,g_2\\in G$. Then for any $f\\in\\mcH(\\tau_{\\ell}) \\hat{\\otimes} \\mcH(\\tau_{\\ell})$ we have\n\\begin{equation}\\label{two-var}\n\\begin{split}\n&\\int_{[\\ell]}\\int_{[\\ell]} \\widehat{f}(V_1, V_2)\\lambda_{n_1}(V_1)\\lambda_{n_2}(V_2) |\\phi^{V_1}_{\\ell,q}(g_1)|^2|\\phi^{V_2}_{\\ell,q}(g_2)|^2 \\,\\dd V_1 \\,\\dd V_2\\\\\n&=\\frac{(2\\ell+1)^2}{|n_1n_2|}\\sum_{\\gamma_1 \\in \\Gamma_{n_1}}\\sum_{\\gamma_2 \\in \\Gamma_{n_2}}\nf_q(g_1^{-1}\\tilde{\\gamma}_1 g_1, g_2^{-1}\\tilde{\\gamma}_2 g_2),\n\\end{split}\n\\end{equation}\nwhere $\\widehat{f}(V_1, V_2)$ is given by \\eqref{doubletransform} when $V_j$ is of type $(\\nu_j,p_j)\\in i\\RR\\times\\ZZ$, and\n\\[f_{q}(g_1, g_2):=\\frac1{(2\\pi)^2}\\int_0^{2\\pi}\\int_0^{2\\pi} f\\big(g_1\\diag(e^{i\\varrho_1},e^{-i\\varrho_1}), g_2\\diag(e^{i\\varrho_2},e^{-i\\varrho_2})\\big) \\,e^{2q i(\\varrho_1 + \\varrho_2)}\\,\\dd \\varrho_1 \\,\\dd \\varrho_2.\\]\nIn \\eqref{two-var}, we can restrict to pairs $(V_1,V_2)$ satisfying $\\lambda_i(V_j)=1$ by introducing an averaging over $\\{n_1,in_1\\}\\times\\{n_2,in_2\\}$:\n\\begin{equation}\\label{two-var-PGL}\n\\begin{split}\n&\\int_{[\\ell]'}\\int_{[\\ell]'} \\widehat{f}(V_1, V_2)\\lambda_{n_1}(V_1)\\lambda_{n_2}(V_2) |\\phi^{V_1}_{\\ell,q}(g_1)|^2|\\phi^{V_2}_{\\ell,q}(g_2)|^2 \\,\\dd V_1 \\,\\dd V_2\\\\\n&=\\frac{(2\\ell+1)^2}{4|n_1n_2|}\\sum_{\\gamma_1\\in\\Gamma_{n_1}\\cup\\Gamma_{in_1}}\\sum_{\\gamma_2\\in\\Gamma_{n_2}\\cup\\Gamma_{in_2}}\nf_q(g_1^{-1}\\tilde{\\gamma}_1 g_1, g_2^{-1}\\tilde{\\gamma}_2 g_2).\n\\end{split}\n\\end{equation}\nThe prime symbol in $[\\ell]'$ indicates that we sum-integrate over automorphic representations with a lift to $\\PGL_2(\\ZZ[i])\\backslash\\PGL_2(\\CC)$, so that the results of \\S\\ref{RSSection} and \\S\\ref{sec28} are applicable.\n\nNow we consider, for any $n\\in\\ZZ[i]\\setminus\\{0\\}$, the spectral weights\n\\[H(V_1,V_2;n):=h(\\nu_1,p_1)h(\\nu_2,p_2)W_\\ell\\left(\\frac{|n|}{\\ell},\\vec{\\nu},\\vec{p}\\right),\\]\nwhere $h$ is as in \\eqref{eq:def-gaussian-spectral-weight} and $W_\\ell$ is as in Lemma~\\ref{lemma-vor}. Combining \nthe Hilbert space isomorphism\n\\[\\mcH(\\tau_{\\ell}) \\hat{\\otimes} \\mcH(\\tau_{\\ell})\n\\longleftrightarrow L^2(\\Gtemp(\\tau_{\\ell})\\times \\Gtemp(\\tau_{\\ell}))\\]\ninduced by Theorem~\\ref{thm:tr-plancherel} with Theorem~\\ref{thm:pws2} and parts \\ref{vor-a}--\\ref{vor-b} of Lemma~\\ref{lemma-vor}, we see that the function $(g_1,g_2)\\mapsto\\widecheck{H}(g_1,g_2;n)$ given by \\eqref{inversedoubletransform} belongs to $\\mcH(\\tau_{\\ell}) \\hat{\\otimes} \\mcH(\\tau_{\\ell})$, and its double $\\tau_\\ell$-spherical transform equals $H(V_1,V_2;n)$. Therefore, applying \\eqref{two-var-PGL} for $n_1=n_2=n$ and $g_1=g_2=g$, and then summing up over $n$, we arrive at\n\\begin{equation}\\label{eval}\n\\begin{split}\n&\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}\\int_{[\\ell]'}\\int_{[\\ell]'}\nH(V_1,V_2;n)\\lambda_n(V_1)\\lambda_n(V_2)|\\phi^{V_1}_{\\ell,q}(g)|^2|\\phi^{V_2}_{\\ell,q}(g)|^2\\,\\dd V_1\\,\\dd V_2\\\\\n&=\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}\\frac{(2\\ell+1)^2}{4|n|^2}\\sum_{\\gamma_1,\\gamma_2\\in\\Gamma_n\\cup\\Gamma_{in}}\n\\widecheck{H}_q(g^{-1}\\tilde{\\gamma}_1 g, g^{-1}\\tilde{\\gamma}_2 g;n).\n\\end{split}\n\\end{equation}\nBy Lemma~\\ref{lemma-vor}\\ref{vor-c}, the left-hand side of \\eqref{eval} equals\n\\[\\frac{\\pi}{4}\\ell^2\\sum_{\\substack{\\text{$V$ cuspidal} \\\\T_i(V)=1,\\ |p_V|\\leq \\ell}}\nh(\\nu_V, p_V)^2 \\,L(1,\\mathrm{ad^2} V)\\,|\\phi^{V}_{\\ell,q}(g)|^4\\ +\\ \\text{Eis},\\]\nwhere the term $\\text{Eis}$ is the contribution of Eisenstein representations:\n\\begin{equation}\\label{eval-cusp}\n\\begin{split}\n\\text{Eis}=\\ell^2\\sum_{\\epsilon,\\eta\\in\\{\\pm 1\\}}\\sum_{\\substack{p\\in 4\\ZZ\\\\|p|\\leq\\ell}}\\int_{(0)}\\int_{(0)}\n&\\ell^{\\eta(\\nu_1-\\epsilon \\nu_2)}\\,h(\\nu_1,\\epsilon p) h(\\nu_2,p)\\,\\mcL_{\\eta}((\\nu_1,\\epsilon p),(\\nu_2,p))\\\\\n&|\\phi^{E(\\nu_1,\\epsilon p)}_{\\ell,q}(g)|^2|\\phi^{E(\\nu_2,p)}_{\\ell,q}(g)|^2\n\\,\\frac{\\dd\\nu_1}{\\pi i}\\,\\frac{\\dd\\nu_2}{\\pi i}.\n\\end{split}\n\\end{equation}\nWe make a change of variable $(\\nu_1,\\nu_2,p)\\mapsto(\\eta\\nu_1,\\eta\\epsilon\\nu_2,\\eta\\epsilon p)$. By invariance, we can replace the resulting pairs $(\\eta\\nu_1,\\eta p)$ and $(\\eta\\epsilon\\nu_2,\\eta\\epsilon p)$ by $(\\nu_1,p)$ and $(\\nu_2,p)$, respectively. In this way we see that\n\\[\\begin{split}\n\\text{Eis}=4\\ell^2\\sum_{\\substack{p\\in 4\\ZZ\\\\|p|\\leq\\ell}}\\int_{(0)}\\int_{(0)}\n&\\ell^{\\nu_1-\\nu_2}\\,h(\\nu_1,p) h(\\nu_2,p)\\,\\mcL_{\\eta}((\\nu_1,p),(\\nu_2,p))\\\\\n&|\\phi^{E(\\nu_1,p)}_{\\ell,q}(g)|^2|\\phi^{E(\\nu_2,p)}_{\\ell,q}(g)|^2\n\\,\\frac{\\dd\\nu_1}{\\pi i}\\,\\frac{\\dd\\nu_2}{\\pi i}.\n\\end{split}\\]\nBy Lemma~\\ref{eis-pos}, we conclude that $\\text{Eis}\\geq 0$. In particular, the right-hand side of \\eqref{eval} is real, and it provides an upper bound for the contribution of each cuspidal $V$ in \\eqref{eval-cusp}:\n\\[h(\\nu_V, p_V)^2 \\,L(1,\\mathrm{ad^2} V)\\,|\\phi^{V}_{\\ell,q}(g)|^4\n\\ll\\sum_{n\\in\\ZZ[i]\\setminus\\{0\\}}\\frac{1}{|n|^2}\\sum_{\\gamma_1,\\gamma_2\\in\\Gamma_n\\cup\\Gamma_{in}}\n\\widecheck{H}_q(g^{-1}\\tilde{\\gamma}_1 g, g^{-1}\\tilde{\\gamma}_2 g;n).\\]\nHere we can restrict the $n$-sum to $|n|\\leq\\ell^{1+\\eps}$ at the cost of an error of $\\OO_\\eps(\\ell^{-50})$. Indeed, the contribution of $|n|>\\ell^{1+\\eps}$ on the two sides of \\eqref{eval} are equal, and this contribution is $\\OO_\\eps(\\ell^{-50})$ thanks to the bound $H(V_1, V_2;n)\\ll_A(|n|\/\\ell)^{-A}$ for any $A > 0$ that follows from Lemma~\\ref{lemma-vor}\\ref{vor-b}.\n\nAs before, let $I\\subset i\\RR$ and $\\Omega\\subset G$ be compact subsets. We fix a cuspidal automorphic representation\n$V\\subset L^2(\\Gamma\\backslash G)$ with $\\nu_V\\in I$, $p_V=\\ell$, $\\lambda_i(V)=1$, and we pick a cusp form $\\phi_q\\in V^{\\ell,q}$ with ${\\|\\phi_q\\|}_2=1$. We shall also assume that $g\\in\\Omega$. By \\eqref{RS-res} and our findings above,\n\\begin{equation}\\label{almostdone}\n|\\phi_q(g)|^4\\ll_{\\eps,I}\\ell^\\eps\\sum_{\\substack{n\\in\\ZZ[i]\\setminus\\{0\\}\\\\|n|\\leq\\ell^{1+\\eps}}}\\frac{1}{|n|^2}\\sum_{\\gamma_1,\\gamma_2\\in\\Gamma_n\\cup\\Gamma_{in}}\\widecheck{H}_q(g^{-1}\\tilde{\\gamma}_1 g, g^{-1}\\tilde{\\gamma}_2 g;n)+\\ell^{-50}.\n\\end{equation}\nWe estimate $\\widecheck{H}$ (hence also $\\widecheck{H}_q$) in terms of Cartan coordinates using the two-dimensional analogue of \\eqref{eq:inverse-spherical-transform-estimate}:\n\\[\\begin{split}\n\\big|\\widecheck{H}(k_1a_{h_1}k_2,k_3a_{h_2}k_4;n)\\big|\\leq\n& \\sum_{|p_1|,|p_2|\\leq\\ell}\\ \\ \\iint\\limits_{\\substack{s_1>h_1\\\\s_2>h_2}}\\,\n\\Bigg|\\ \\iint\\limits_{\\substack{t_1\\in\\RR\\\\t_2\\in\\RR}}\nW_\\ell\\left(\\frac{|n|}{\\ell},(it_1, it_2),(p_1,p_2)\\right)\\\\\ne^{-\\ell^2+(p_1^2+p_2^2)\/2}\\,& e^{-(t_1^2 + t_2^2)\/2}\\,e^{-it_1s_1-it_2s_2}\\,(t_1^2+p_1^2)(t_2^2+p_2^2)\n\\,\\dd t_1\\dd t_2\\,\\Bigg|\\,\\dd s_1\\dd s_2.\n\\end{split}\\]\nThis estimate holds for $k_j\\in K$ and $h_j>1$. We restrict the sum to $|p_1|=|p_2|=\\ell$ at the cost of an error of $\\OO_\\eps(\\ell^{-80})$. Then we utilize Lemma~\\ref{lemma-vor}\\ref{vor-a} to further restrict the sum to $p_1=p_2=\\ell$ at the cost of extending the outer double integral to $|s_1|,|s_2|>\\ell$. We arrive at\n\\[\\begin{split}\n\\widecheck{H}(k_1a_{h_1}k_2,k_3a_{h_2}k_4;n)\\ll\n&\\iint\\limits_{\\substack{|s_1|>h_1\\\\|s_2|>h_2}}\\,\n\\Bigg|\\ \\iint\\limits_{\\substack{t_1\\in\\RR\\\\t_2\\in\\RR}}\nW_\\ell\\left(\\frac{|n|}{\\ell},(it_1, it_2),(\\ell,\\ell)\\right)\\\\\n& e^{-(t_1^2 + t_2^2)\/2}\\,e^{-it_1s_1-it_2s_2}\\,(t_1^2+\\ell^2)(t_2^2+\\ell^2)\n\\,\\dd t_1\\dd t_2\\,\\Bigg|\\,\\dd s_1\\dd s_2 + \\ell^{-80}.\n\\end{split}\\]\nWe consider the inner double integral,\nand assume without loss of generality $|s_1| \\geq |s_2|$, the other case being analogous. Shifting the $t_1$-contour downwards if $s_1 > 0$ and upwards if $s_1 < 0$, we conclude from Lemma~\\ref{lemma-vor}\\ref{vor-b} the bound\n\\[\\ll_{\\eps,B}\n\\ell^4 e^{-B|s_1|} \\left(\\frac{|n|}{\\ell}\\right)^{-B-\\eps} = \n\\ell^4 e^{-B\\max(|s_1|,|s_2|)} \\left(\\frac{|n|}{\\ell}\\right)^{-B-\\eps}\\]\nfor the inner double integral, and so\n\\[\\widecheck{H}(k_1a_{h_1}k_2,k_3a_{h_2}k_4;n) \n\\ll_{\\eps,B} \\ell^4 e^{-B\\max(h_1,h_2)} \\left(\\frac{|n|}{\\ell}\\right)^{-B-\\eps} + \\ell^{-80}\\]\nfor any $\\eps, B > 0$ and $h_1, h_2 > 1$. This estimate remains true for general $h_1, h_2 \\geq 0$, as can be seen by using \\eqref{eq:inverse-tauell-transform} instead of \\eqref{eq:inverse-spherical-transform-estimate} for the respective variable if one or both of $h_1, h_2$ are\nat most $1$. The same bound applies for $\\widecheck{H}_q$, hence in particular\n\\[\\widecheck{H}_q(g_1,g_2;n)\n\\ll_{\\eps,C}\\ell^{4+\\eps}\\left(\\frac{\\sqrt{\\ell\/|n|}}{\\|g_1\\|+\\|g_2\\|}\\right)^C + \\ell^{-80}\\]\nfor any $\\eps, C > 0$ and $g_1,g_2\\in G$. So we can refine \\eqref{almostdone} to\n\\[|\\phi_q(g)|^4\\ll_{\\eps,I,\\Omega}\\ell^\\eps\\sum_{\\substack{n\\in\\ZZ[i]\\setminus\\{0\\}\\\\|n|\\leq\\ell^{1+\\eps}}}\n\\sum_{\\substack{\\gamma_1,\\gamma_2\\in\\Gamma_n\\cup\\Gamma_{in}\\\\\\| g^{-1}\\tilde{\\gamma}_j g\\|\\leq\\ell^{\\eps}\\sqrt{\\ell\/|n|}}}\\widecheck{H}_q(g^{-1}\\tilde{\\gamma}_1 g, g^{-1}\\tilde{\\gamma}_2 g;n)+\\ell^{-50}.\\]\n\nIn the last sum, we estimate the terms more directly by \\eqref{inversedoubletransform}, \\eqref{eq:averaged-spherical-function-symmetry}, and Lemma~\\ref{lemma-vor}\\ref{vor-b}:\n\\[\\widecheck{H}_q(g^{-1}\\tilde{\\gamma}_1 g,g^{-1}\\tilde{\\gamma}_2 g;n)\n\\ll_\\eps\\ell^{2+\\eps} F(\\gamma_1)F(\\gamma_2)+\\ell^{-80},\\]\nwhere we abbreviated (suppressing $g$ and $q$ from the notation)\n\\[F(\\gamma):=\\sup_{\\nu\\in i\\RR}|\\varphi_{\\nu,\\ell}^{\\ell,q}(g^{-1}\\tilde{\\gamma}g)|,\\qquad\\gamma\\in\\GL_2(\\CC).\\]\nRecalling also \\eqref{straightforward}, we obtain an inequality of bilinear type:\n\\[|\\phi_q(g)|^4\\ll_{\\eps,I,\\Omega}\\ell^{2+\\eps}\\sum_{\\substack{n\\in\\ZZ[i]\\setminus\\{0\\}\\\\|n|\\leq\\ell^{1+\\eps}}}\n\\sum_{\\substack{\\gamma_1,\\gamma_2\\in\\Gamma_n\\cup\\Gamma_{in}\\\\\\|g^{-1}\\tilde{\\gamma}_j g\\|\\leq\\ell^{\\eps}\\sqrt{\\ell\/|n|}}}F(\\gamma_1)F(\\gamma_2)+\\ell^{-50}.\\]\nIntroducing the notation\n\\[S(n):=\\sum_{\\substack{\\gamma\\in\\Gamma_n\\\\\\| g^{-1}\\tilde{\\gamma} g\\|\\leq\\ell^{\\eps}\\sqrt{\\ell\/|n|}}}F(\\gamma),\\]\nwe arrive at\n\\begin{alignat*}{3}\n|\\phi_q(g)|^4\n&\\ll_{\\eps,I,\\Omega}\\ &&\\ell^{2+\\eps}\\sum_{\\substack{n\\in\\ZZ[i]\\setminus\\{0\\}\\\\|n|\\leq\\ell^{1+\\eps}}}\n\\bigl(S(n)+S(in)\\bigr)^2&&+\\ell^{-50}\\\\\n&\\ll &&\\ell^{2+\\eps}\\sum_{\\substack{n\\in\\ZZ[i]\\setminus\\{0\\}\\\\|n|\\leq\\ell^{1+\\eps}}}\n\\bigl(S(n)^2+S(in)^2\\bigr)&&+\\ell^{-50}.\n\\end{alignat*}\nOf course, the contributions of $S(n)^2$ and $S(in)^2$ are the same. In the end, we conclude\n\\begin{equation}\\label{conclude-KS}\n|\\phi_q(g)|^4\\ll_{\\eps,I,\\Omega}\\ell^{2+\\eps}\\sum_{\\substack{n\\in\\ZZ[i]\\setminus\\{0\\}\\\\|n|\\leq\\ell^{1+\\eps}}}\n\\sum_{\\substack{\\gamma_1,\\gamma_2\\in\\Gamma_n\\\\\\|g^{-1}\\tilde{\\gamma}_j g\\|\\leq\\ell^{\\eps}\\sqrt{\\ell\/|n|}}}\n\\prod_{j=1}^2\\sup_{\\nu\\in i\\RR}|\\varphi_{\\nu,\\ell}^{\\ell,q}(g^{-1}\\tilde{\\gamma}_j g)|+\\ell^{-50},\n\\end{equation}\nwhich serves as an analogue of \\eqref{pre-APTI-done-2-single-form}.\n\n\\subsection{Reduction to Diophantine counting}\\label{reduction}\nIn this subsection, we input into the preliminary estimates \\eqref{pre-APTI-done-2}, \\eqref{pre-APTI-done-2-single-form} and \\eqref{conclude-KS} the results of Theorems~\\ref{thm4},~\\ref{thm6}~and~\\ref{thm5}, which provide the desired estimates on spherical trace functions. We shall assume (as we can) that $\\ell$ is sufficiently large in terms of $\\eps$.\n\nWe begin by explicating the estimate \\eqref{pre-APTI-done-2} using \\eqref{ampl-expand} and Theorem~\\ref{thm4}. For $\\mcL\\geq 1$ and $\\vec{\\delta}=(\\delta_1,\\delta_2)\\in\\RR^{2}_{>0}$, let\n\\[ D(L,\\mcL):=\\left\\{n\\in\\ZZ[i]:\n\\text{$\\mcL\\leq |n|^2\\leq 16\\mcL$, $n=1$ or $n=l_1l_2$ or $n=l_1^2l_2^2$ for some $l_1,l_2\\in P(L)$}\\right\\}, \\]\n\\begin{align*}\nM(g,L,\\mcL,\\vec{\\delta}):=\\sum_{n\\in D(L,\\mcL)}\\#\\bigg\\{\\gamma\\in\\Gamma_n:\\ \n&\\text{$g^{-1}\\tilde{\\gamma}g=k\\begin{pmatrix} z&u\\\\&z^{-1}\\end{pmatrix}k^{-1}$ for some $k\\in K$}\\\\\n&\\text{such that $|z|\\geq 1$, $\\min|z\\pm 1|\\leq\\delta_1$, $|u|\\leq\\delta_2$}\\bigg\\}.\n\\end{align*}\n\nTo each $\\gamma$ occurring in \\eqref{pre-APTI-done-2} we may associate a dyadic vector $\\vec{\\delta}=(\\delta_1,\\delta_2)$ (that is, $\\log_{2}\\delta_{j}\\in\\ZZ$) such that $1\/\\sqrt{\\ell}\\leq\\delta_j\\leq\\ell^\\eps$ and $\\delta_{j}$ are minimal such that $\\gamma$ is counted in the corresponding $M(g,L,\\mcL,\\vec{\\delta})$. Therefore, applying \\eqref{ampl-expand} and the estimates of Theorem~\\ref{thm4} in \\eqref{pre-APTI-done-2} leads to the following result.\n\n\\begin{lemma}\\label{APTI-done-lemma}\nLet $\\ell\\geq 1$ be an integer, $I\\subset i\\RR$ and $\\Omega\\subset G$ be compact sets. Let $V\\subset L^2(\\Gamma\\backslash G)$ be a cuspidal automorphic representation with minimal $K$-type $\\tau_{\\ell}$ and spectral parameter $\\nu_V\\in I$. Let $\\mfB$ be an orthonormal basis of $V^\\ell$, and let $g\\in\\Omega$. Then for any $L\\geq 7$ and $\\eps>0$ we have\n\\begin{align*}\n\\sum_{\\phi\\in\\mfB}|\\phi(g)|^2\n&\\ll_{\\eps,I,\\Omega}\\ell^{3+\\eps}L^{\\eps}\\sum_{\\substack{\\vec{\\delta}\\textnormal{ dyadic}\\\\1\/\\sqrt{\\ell}\\leq\\delta_j\\leq \\ell^{\\eps}}}\\min\\left(\\frac1{\\ell\\delta_1^2},\\frac1{\\sqrt{\\ell}\\delta_2}\\right)\\\\\n&\\qquad\\times\\left(\\frac{M(g,L,1,\\vec{\\delta})}{L}+\\frac{M(g,L,L^2,\\vec{\\delta})}{L^3}+\\frac{M(g,L,L^4,\\vec{\\delta})}{L^4}\\right)+L^{2+\\eps}\\ell^{-48}.\n\\end{align*}\n\\end{lemma}\n\nLemma~\\ref{APTI-done-lemma} is free of any choices of the test function, amplifier, and spherical trace function. It reduces the estimation of $\\sum_{\\phi\\in\\mfB}|\\phi(g)|^2$ to the Diophantine counting problem of estimating $M(g,L,\\mcL,\\vec{\\delta})$ uniformly in $L$, $\\mcL$, and $\\vec{\\delta}$.\n\nNow, we similarly explicate the estimate \\eqref{pre-APTI-done-2-single-form} using \\eqref{ampl-expand} and Theorems~\\ref{thm6}--\\ref{thm5}\\ref{thm5-a}. Recall the sets $\\mcD\\subset G$ and $\\mcS\\subset K\\subset\\mcN\\subset G$ introduced before Theorem~\\ref{thm5}. With $D(L,\\mcL)$ as above, we define for $|q|\\leq\\ell$, $\\mcL\\geq 1$, $\\delta>0$, and $\\vec{\\delta}=(\\delta_1,\\delta_2)\\in\\RR_{>0}^{2}$, the matrix counts\n\\begin{align*}\nM^{\\ast}_0(g,L,\\mcL,\\delta)&:=\\sum_{n\\in D(L,\\mcL)}\\#\\left\\{\\gamma\\in\\Gamma_n:\\dist(g^{-1}\\tilde\\gamma g,\\mcS)\\leq\\delta,\\,\\,\\frac{D(g^{-1}\\tilde\\gamma g)}{\\|g^{-1}\\tilde\\gamma g\\|^2}\\ll\\frac{\\log\\ell}{\\sqrt{\\ell}}\\right\\},\\\\\nM^\\ast(g,L,\\mcL,\\vec{\\delta})&:=\\sum_{n\\in D(L,\\mcL)}\\#\\left\\{\\gamma\\in\\Gamma_n:\\dist\\left(g^{-1}\\tilde\\gamma g,K\\right)\\leq\\delta_1,\\,\\,\\dist(g^{-1}\\tilde\\gamma g,\\mcD)\\leq\\delta_2\\right\\},\n\\end{align*}\nwith a sufficiently large implied constant in the definition of $M^{\\ast}_0(g,L,\\mcL,\\delta)$.\n\nFor $q=0$, we estimate the size of $\\varphi_{\\nu,\\ell}^{\\ell,q}(g^{-1}\\tilde\\gamma g)$ in \\eqref{pre-APTI-done-2-single-form} using Theorem~\\ref{thm5}\\ref{thm5-a}. Since there are at most $\\OO_{\\eps,\\Omega}(\\ell^\\eps|n|^{2+\\eps})$ elements $\\gamma\\in\\Gamma_n$ contributing to the right-hand side of \\eqref{pre-APTI-done-2-single-form}, the total contribution of those elements which fail to satisfy $D(g^{-1}\\tilde\\gamma g)\\ll\\|g^{-1}\\tilde\\gamma g\\|^2(\\log\\ell)\/\\sqrt{\\ell}$ with a sufficiently large implied constant may be absorbed into the existing $\\OO_{\\eps,I,\\Omega}(L^{2+\\eps}\\ell^{-48})$ error term. We may thus restrict to $\\gamma\\in\\Gamma_n$ satisfying these conditions. We associate to each remaining $\\gamma$ in \\eqref{pre-APTI-done-2-single-form} the smallest dyadic $1\/\\sqrt{\\ell}\\leq\\delta\\leq\\ell^{\\eps}$ such that $\\gamma$ is counted in the corresponding $M_0^{\\ast}(g,L,\\mcL,\\delta)$. For a general $|q|\\leq\\ell$, we associate to each $\\gamma$ in \\eqref{pre-APTI-done-2-single-form} the\nlexicographically smallest dyadic vector $\\vec{\\delta}=(\\delta_1,\\delta_2)$ such that $\\delta_j\\leq\\ell^\\eps$ and $\\delta_1^2\\delta_2\\geq 1\/\\sqrt{\\ell}$ and $\\gamma$ is counted in the corresponding $M_q(g,L,\\mcL,\\vec{\\delta})$. Applying \\eqref{ampl-expand} and the estimates of Theorems~\\ref{thm6}--\\ref{thm5}\\ref{thm5-a} in \\eqref{pre-APTI-done-2-single-form} leads to the following result.\n\n\\begin{lemma}\\label{APTI-done-lemma-single-form}\nLet $\\ell\\geq 1$ be an integer, $I\\subset i\\RR$ and $\\Omega\\subset G$ be compact sets. Let $V\\subset L^2(\\Gamma\\backslash G)$ be a cuspidal automorphic representation with minimal $K$-type $\\tau_{\\ell}$ and spectral parameter $\\nu_V\\in I$. Let $\\phi_q\\in V^{\\ell,q}$ such that ${\\|\\phi_q\\|}_2=1$ and let $g\\in\\Omega$. Then for any $L\\geq 7$ and $\\eps>0$ we have\n\\begin{align*}\n|\\phi_0(g)|^2\n&\\ll_{\\eps,I,\\Omega}\\ell^{2+\\eps}L^{\\eps}\\sum_{\\substack{\\delta\\textnormal{ dyadic}\\\\1\/\\sqrt{\\ell}\\leq\\delta\\leq\\ell^{\\eps}}}\\frac1{\\sqrt{\\ell}\\delta}\\\\\n&\\qquad\\times\\left(\\frac{M_0^{\\ast}(g,L,1,\\delta)}{L}+\\frac{M_0^{\\ast}(g,L,L^2,\\delta)}{L^3}+\\frac{M_0^{\\ast}(g,L,L^4,\\delta)}{L^4}\\right)+L^{2+\\eps}\\ell^{-48}.\n\\end{align*}\nMoreover, for $|q|\\leq\\ell$ we have\n\\begin{align*}\n|\\phi_q(g)|^2\n&\\ll_{\\eps,I,\\Omega}\\ell^{2+\\eps}L^{\\eps}\\sum_{\\substack{\\vec{\\delta}\\textnormal{ dyadic},\\,\\,\n\\delta_j\\leq\\ell^{\\eps}\\\\\\delta_1^2\\delta_2\\geq 1\/\\sqrt{\\ell}}}\n \\frac{1}{\\sqrt{\\ell} \\delta_1^2 \\delta_2}\\\\\n&\\qquad\\times\\left(\\frac{M^\\ast(g,L,1,\\vec{\\delta})}{L}+\\frac{M^\\ast(g,L,L^2,\\vec{\\delta})}{L^3}+\\frac{M^\\ast(g,L,L^4,\\vec{\\delta})}{L^4}\\right)+L^{2+\\eps}\\ell^{-48}.\n\\end{align*}\n\\end{lemma}\n\nSimilarly, we explicate \\eqref{conclude-KS} using Theorem~\\ref{thm5}\\ref{thm5-b}. Here we introduce the double matrix count\n\\begin{align*}\nQ(g,L,H_1, H_2):=\\sum_{L \\leq |n| \\leq 2L} \\#\\Bigg\\{(\\gamma_1, \\gamma_2) \\in\\Gamma_n^2 :\\ \n&\\|g^{-1}\\tilde\\gamma_jg\\|\\leq \\sqrt{\\frac{H_j}{L}},\\\\\n&\\,\\dist(g^{-1}\\tilde\\gamma_jg,\\mcD)\\ll\\sqrt{\\frac{H_j\\log\\ell}{L\\ell}}\\Bigg\\},\n\\end{align*}\nwith a sufficiently large implied constant in the distance condition.\n\n\\begin{lemma}\\label{q=ell-case}\nLet $\\ell\\geq 1$ be an integer, $I\\subset i\\RR$ and $\\Omega\\subset G$ be compact sets. Let $V\\subset L^2(\\Gamma\\backslash G)$ be a cuspidal automorphic representation with minimal $K$-type $\\tau_{\\ell}$ and spectral parameter $\\nu_V\\in I$. Suppose that $V$ lifts to an automorphic representation for $\\PGL_2(\\ZZ[i])\\backslash\\PGL_2(\\CC)$.\nLet $\\phi_{\\pm \\ell}\\in V^{\\ell,\\pm\\ell}$ such that ${\\|\\phi_{\\pm \\ell}\\|}_2=1$ and let $g\\in\\Omega$. Then for any $\\eps > 0$ we have\n\\[|\\phi_{\\pm \\ell}(g)|^4\\ll_{ \\eps,I,\\Omega}\\ell^{2+ \\eps} \\max_{1 \\leq L, H_1, H_2 \\leq \\ell^{1+\\eps}} \\frac{Q(g,L,H_1, H_2) }{H_1H_2}+\\ell^{-50}.\\]\n\\end{lemma}\n\n\\section{Proof of Theorem~\\ref{thm4}}\nIn this section, we prove Theorem~\\ref{thm4}. It is clear from the definition \\eqref{eq:def-spherical-function}\nthat we can restrict to $k=1$ without loss of generality, and the first bound holds in the stronger form $|\\varphi_{\\nu,\\ell}^{\\ell}(g)|\\leq 2\\ell+1$. In particular, Theorem~\\ref{thm4} is trivial for $\\ell=1$, hence we shall assume (for notational simplicity) that $\\ell\\geq 2$. In addition, the exponential factor in \\eqref{spherical-def} has absolute value less than $\\|g\\|^2$ thanks to\n\\eqref{eq:kappaH} and the identity\n\\[|ad-bc|^2+|a\\bar b+c\\bar d|^2=(|a|^2+|c|^2)(|b|^2+|d|^2),\\]\nhence it suffices to prove that\n\\begin{equation}\\label{suffices}\n\\int_K |\\psi_{\\ell}(\\kappa(k^{-1} g k))|\\, \\dd k \\ll_\\eps \\ell^\\eps\n\\min\\left(\\frac{\\|g\\|^4}{|z^2 - 1|^2\\ell}, \\frac{\\|g\\|}{|u|\\sqrt{\\ell}}\\right).\n\\end{equation}\nFinally, we shall use the obvious fact that\n\\begin{equation}\\label{eq:bounded_z_z(-1)_u}\n|u|,|z|,|z^{-1}|\\leq\\|g\\|.\n\\end{equation}\n\nWriting $k=k[\\phi,\\theta,\\psi]$ in Euler angles as in \\eqref{decomp-K}, and setting\n\\[\nx:= (z^2 - 1)\\cos\\theta + i e ^{-2i\\phi} uz \\sin\\theta,\n\\]\none computes\n\\[\nk[\\phi, \\theta, \\psi]^{-1} g k[\\phi, \\theta, \\psi] = \\left(\\begin{matrix} (1 + x \\cos\\theta )\/z & \\ast\\\\ \\ -ie^{2i\\psi}x \\sin \\theta \/z& \\ast\\end{matrix}\\right).\n\\]\nOur goal is to estimate then\n\\begin{equation}\\label{eq:thm4_integral_to_bound}\n\\int_0^{\\pi} \\int_0^{\\pi\/2} \\int_{-\\pi}^{\\pi} \\left|\\psi_{\\ell}\\left(\\kappa\\left(\\begin{pmatrix} (1 + x \\cos\\theta )\/z & \\ast\\\\ \\ -ie^{2i\\psi}x \\sin \\theta \/z& \\ast\\end{pmatrix}\\right)\\right)\\right| \\sin 2\\theta\\,\\dd \\psi\\,\\dd \\theta\\,\\dd \\phi.\n\\end{equation}\nWe introduce the notation $\\lambda:=\\sqrt{\\log\\ell}$.\n\n\\subsection{Small values of the integrand}\nFirst we identify a region where $|\\psi_\\ell|$ in the integral \\eqref{eq:thm4_integral_to_bound} is small. Assume that\n\\begin{equation}\\label{tiny}\n\\min\\bigl(\\tan\\theta,|x|\\sin\\theta\\bigr)>\\frac{4\\lambda}{\\sqrt{\\ell}}.\n\\end{equation}\nThen in\n\\[\n\\kappa\\left(\\begin{pmatrix} (1 + x \\cos\\theta )\/z & \\ast\\\\ \\ -ie^{2i\\psi}x \\sin \\theta \/z& \\ast\\end{pmatrix}\\right)=\\begin{pmatrix} \\frac{1 + x \\cos\\theta}{\\sqrt{|1 + x \\cos\\theta|^2+|x\\sin\\theta|^2}}& \\ast \\\\ \\ast & \\ast \\end{pmatrix}\\in K\n\\]\nthe upper left entry has absolute square less than $1-\\lambda^2\/\\ell$, hence\n\\[\\left|\\psi_{\\ell}\\left(\\kappa\\left(\\begin{pmatrix} (1 + x \\cos\\theta )\/z & \\ast\\\\ \\ -ie^{2i\\psi}x \\sin \\theta \/z& \\ast\\end{pmatrix}\\right)\\right)\\right| < \\left(1-\\frac{\\log \\ell}{\\ell}\\right)^{\\ell}<\\frac{1}{\\ell}.\\]\nIn view of \\eqref{eq:bounded_z_z(-1)_u}, this is admissible for \\eqref{suffices}. In the next subsection, we consider the case when \\eqref{tiny} fails.\n\n\\subsection{Large values of the integrand}\nAssume first that $\\tan\\theta\\leq 4\\lambda\/\\sqrt{\\ell}$. Then $\\theta\\leq 4\\lambda\/\\sqrt{\\ell}$, hence the corresponding contribution to \\eqref{eq:thm4_integral_to_bound} is $\\ll\\lambda^2\/\\ell$. This is admissible for \\eqref{suffices} in the light of \\eqref{eq:bounded_z_z(-1)_u}.\n\nNow assume that $|x|\\sin\\theta\\leq 4\\lambda\/\\sqrt{\\ell}$, and decompose the relevant integration domain for $\\theta$ as follows. For any $m,n\\in\\ZZ_{\\geq 0}$ and $\\phi\\in[0,\\pi]$, let\n\\[I(m,n,\\phi):=\\left\\{\\theta\\in\\left(0,\\frac{\\pi}{2}\\right)\\,:\\,\n|x|\\sin\\theta\\leq\\frac{4\\lambda}{\\sqrt{\\ell}},\\\n\\frac{1}{2}<2^m\\sin\\theta\\leq 1,\\ \\frac{1}{2}<2^n\\cos\\theta\\leq 1\\right\\}.\\]\nIf $\\theta\\notin I(m,n,\\phi)$ holds for every $0\\leq m,n\\leq 2\\log\\ell$, then $\\sin 2\\theta=2\\sin\\theta\\cos\\theta\\leq 1\/\\ell$, which is admissible for \\eqref{suffices}. Therefore, by \\eqref{eq:bounded_z_z(-1)_u} and \\eqref{eq:thm4_integral_to_bound}, it suffices to prove the bound\n\\begin{equation}\\label{eq:integral_large_psi}\n\\int_0^{\\pi} \\int_{I(m,n,\\phi)} \\sin 2\\theta\\,\\dd\\theta\\,\\dd\\phi \\ll \\min\\left(\\frac{\\lambda^2}{\\ell|z^2-1|^{2}},\\frac{\\lambda}{\\ell^{1\/2}|uz|}\\right)\n\\end{equation}\nfor every $0\\leq m,n\\leq 2\\log\\ell$. We shall assume that $\\min(m,n)=0$, for otherwise $I(m,n,\\phi)=\\emptyset$.\nWe record also that the Lebesgue measure of $I(m,n,\\phi)$ is $\\OO(2^{-m-n})$, because if $n=0$, then $\\sin\\theta\\asymp \\theta$, while if $m=0$, then $\\cos\\theta\\asymp \\pi\/2-\\theta$. Hence, for any $\\phi\\in[0,\\pi]$, we have\n\\[\\int_{I(m,n,\\phi)} \\sin 2\\theta\\,\\dd \\theta = \\int_{I(m,n,\\phi)} 2\\sin\\theta\\cos\\theta\\,\\dd \\theta \\ll 2^{-2m-2n}.\\]\n\nFirst consider the case when in $x=(z^2 - 1)\\cos\\theta + i e ^{-2i\\phi} uz \\sin\\theta$, whose absolute value does not exceed $2^{m+3}\\lambda\/\\sqrt{\\ell}$, neither of the two summands is large:\n\\[\n|z^2 - 1|2^{-n} \\leq 2^{m+6} \\frac{\\lambda}{\\sqrt{\\ell}},\\qquad |uz|2^{-m}\\leq 2^{m+6} \\frac{\\lambda}{\\sqrt{\\ell}}.\n\\]\nRecalling $\\min(m,n)=0$, the previous two displays imply for any $\\phi\\in[0,\\pi]$ that\n\\[\\int_{I(m,n,\\phi)}\\sin 2\\theta\\,\\dd\\theta \\ll \\min\\left(\\frac{\\lambda^2}{\\ell|z^2-1|^{2}},\\frac{\\lambda}{\\ell^{1\/2}|uz|}\\right).\\]\nSo in this case \\eqref{eq:integral_large_psi} is clear.\n\nNow consider the case when in $x=(z^2 - 1)\\cos\\theta + i e ^{-2i\\phi} uz \\sin\\theta$,\nwhose absolute value does not exceed $2^{m+3}\\lambda\/\\sqrt{\\ell}$, the two summands are individually large:\n\\begin{equation}\\label{eq:triangle_large_sides}\n|z^2 - 1|2^{-n}> 2^{m+4} \\frac{\\lambda}{\\sqrt{\\ell}},\\qquad |uz|2^{-m}> 2^{m+4} \\frac{\\lambda}{\\sqrt{\\ell}}, \\qquad |z^2-1|2^{-n}\\asymp |uz|2^{-m}.\n\\end{equation}\nWe claim that this localizes $\\phi$. Indeed, setting\n\\[\n2\\phi_0=\\arg(iuz)-\\arg(z^2-1),\n\\]\nwe see that\n\\[\n|z^2-1|\\cos \\theta + e^{2i(\\phi_0-\\phi)}|uz|\\sin \\theta \\ll 2^m\\frac{\\lambda}{\\sqrt{\\ell}},\n\\]\nand comparing the imaginary parts, we have that\n\\[\n\\sin(2\\phi-2\\phi_0)\\ll\\frac{2^{2m}\\lambda}{|uz|\\sqrt{\\ell}},\\quad\\text{and so}\\quad\n\\phi\\equiv\\phi_0+\\OO\\left(\\frac{2^{2m}\\lambda}{|uz|\\sqrt{\\ell}}\\right)\\!\\!\\!\\pmod{\\pi\/2}.\n\\]\nAlso, $\\theta$ is localized, since\n\\[\n|z^2-1|\\cos \\theta - |uz|\\sin \\theta \\ll 2^m\\frac{\\lambda}{\\sqrt{\\ell}},\n\\]\nand the first term here is monotone decreasing, the second one is monotone increasing in $\\theta$. We see that $\\theta$ is localized to an interval of length $\n\\OO(2^m\\lambda\/|uz|\\sqrt{\\ell})$ for $\\sin\\theta\\leq \\cos\\theta$ (in which case $n=0$), and to an interval of length $\\OO(\\lambda\/|z^2-1|\\sqrt{\\ell})$ for $\\cos\\theta\\leq\\sin\\theta$ (in which case $m=0$).\n\nWe estimate the left-hand side of \\eqref{eq:integral_large_psi} by exploiting the above localizations and all three parts of \\eqref{eq:triangle_large_sides}. If $\\sin\\theta\\leq\\cos\\theta$, then $n=0$ and $\\sin 2\\theta\\leq 2^{1-m}$, so altogether we obtain a contribution to \\eqref{eq:integral_large_psi} of size\n\\[\\ll 2^{-m} \\cdot \\frac{2^m \\lambda}{|uz|\\sqrt{\\ell}}\\cdot \\frac{2^{2m}\\lambda}{|uz|\\sqrt{\\ell}}\n\\ll \\min\\left(\\frac{\\lambda^2}{|z^2-1|^2\\ell},\\frac{\\lambda}{|uz|\\sqrt{\\ell}}\\right).\\]\nSimilarly, if $\\cos\\theta\\leq\\sin\\theta$, then $m=0$ and $\\sin 2\\theta\\leq 2^{1-n}$, so altogether we obtain a contribution to \\eqref{eq:integral_large_psi} of size\n\\[\\ll2^{-n} \\cdot\\frac{\\lambda}{|z^2-1|\\sqrt{\\ell}}\\cdot\\frac{\\lambda}{|uz|\\sqrt{\\ell}}\n\\ll \\min\\left(\\frac{\\lambda^2}{|z^2-1|^2\\ell},\\frac{\\lambda}{|uz|\\sqrt{\\ell}}\\right).\\]\n\nThe proof of Theorem~\\ref{thm4} is complete.\n\n\\section{Proof of Theorems~\\ref{thm6} and \\ref{thm5}}\nIn this section, we prove Theorems~\\ref{thm6}~and~\\ref{thm5}. We recall that the key player is the function\n\\begin{equation}\\label{varphi-def-proof}\n\\varphi_{\\nu,\\ell}^{\\ell,q}(g) := \\frac{1}{2\\pi} \\int_{0}^{2\\pi} \\varphi_{\\nu,\\ell}^{\\ell}\\big(gk[0, 0, \\varrho]\\big) \\,e^{-2qi\\varrho} \\,\\dd\\varrho,\n\\end{equation}\nwhere\n\\[\\varphi_{\\nu,\\ell}^{\\ell}(g):=(2\\ell+1)\n\\int_K \\psi_{\\ell}(\\kappa(k^{-1} g k)) \\,e^{(\\nu-1)\\rho(H(gk))}\\,\\dd k.\\]\nThe function $\\psi_\\ell:K\\to\\CC$ was defined in \\eqref{chi-ell}, but for calculational purposes we extend it now to $\\GL_2(\\CC)$:\n\\begin{equation}\\label{psidef}\\psi_{\\ell}\\left( \\begin{pmatrix} \\alpha &\\beta \\\\ \\gamma & \\delta \\end{pmatrix} \\right) :=\n\\bar{\\alpha}^{2\\ell}, \\qquad \\left( \\begin{matrix} \\alpha &\\beta \\\\ \\gamma & \\delta \\end{matrix} \\right) \\in\\GL_2(\\CC).\n\\end{equation}\n\n\\subsection{Preliminary computations}\\label{sec:preliminary-computations}\nWe write $g$ in Cartan form\n\\begin{equation}\\label{g}\ng=k[u_1,v_1,w_1]\\begin{pmatrix}r & \\\\ & r^{-1}\\end{pmatrix} k[u_2,v_2,w_2],\n\\end{equation}\nwhere $r\\geq 1$, and we allow $u_j,v_j,w_j\\in\\RR$ to be arbitrary for convenience.\nSpelling out the definitions, and using that the height in the Iwasawa decomposition is left $K$-invariant, we see that $\\varphi_{\\nu,\\ell}^{\\ell,q}(g)$ equals\n\\[\\begin{split}\n\\frac{d_{\\ell}}{4\\pi^3}\\int_{\\substack{0\\leq u\\leq \\pi \\\\ 0\\leq v\\leq \\pi\/2 \\\\ 0\\leq w\\leq 2\\pi \\\\ 0\\leq \\varrho\\leq 2\\pi}} & \\psi_{\\ell}\\left( k[-w,-v,-u]k[u_1,v_1,w_1] \\kappa\\left(\\begin{pmatrix}r&\\\\&r^{-1}\\end{pmatrix} k[u_2,v_2,w_2]k[0,0,\\varrho] k[u,v,w] \\right)\\right)\\\\\n& \\cdot e^{-2iq\\varrho} \\, e^{(\\nu-1)\\rho\\left(H\\left(\\left(\\begin{smallmatrix}r&\\\\&r^{-1}\\end{smallmatrix}\\right) k[u_2,v_2,w_2]k[0,0,\\varrho]k[u,v,w]\\right)\\right)} \\sin 2v \\,\\dd u\\,\\dd v\\,\\dd w\\,\\dd \\varrho.\n\\end{split}\\]\nWith a change of variables $k[u_2,v_2,w_2]k[0,0,\\rho] k[u,v,w] \\mapsto k[u,v,w]$ and dropping the normalized $w$-integration (which is legitimate since the conjugation by $k[0,0,w]$ does not alter the $\\psi_{\\ell}$-value, and the height in the Iwasawa decomposition is also unaffected by right-multiplication by $k[0,0,w]$), we arrive at\n\\[\\begin{split}\n\\frac{d_{\\ell}}{2\\pi^2}\\int_{\\substack{0\\leq u\\leq \\pi \\\\ 0\\leq v\\leq \\pi\/2 \\\\ 0\\leq \\varrho\\leq 2\\pi}} & \\psi_{\\ell}\\left( k[0,-v,-u] k[u_2,v_2,w_2]k[0,0,\\varrho] k[u_1,v_1,w_1] \\kappa\\left(\\begin{pmatrix}r&\\\\&r^{-1}\\end{pmatrix}k[u,v,0]\\right)\\right)\\\\\n& \\cdot e^{-2iq\\varrho} \\, e^{(\\nu-1)\\rho\\left(H\\left(\\left(\\begin{smallmatrix}r&\\\\&r^{-1}\\end{smallmatrix}\\right) k[u,v,0]\\right)\\right)} \\sin 2v \\,\\dd u\\,\\dd v\\,\\dd\\varrho.\n\\end{split}\\]\nThe sum of absolute squares in the first column of $\\diag(r, r^{-1})k[u,v,0]$ equals\n\\[h(r,v):=r^2\\cos^2v+r^{-2}\\sin^2v,\\]\nhence recalling the definitions \\eqref{eq:kappaH} and \\eqref{psidef}, we can rewrite the integral as\n\\[\\begin{split}\n\\frac{d_{\\ell}}{2\\pi^2}\\int_{\\substack{0\\leq u\\leq \\pi \\\\ 0\\leq v\\leq \\pi\/2 \\\\ 0\\leq \\varrho\\leq 2\\pi}} & \\psi_{\\ell}\\left( k[0,-v,-u] k[u_2,v_2,w_2]k[0,0,\\varrho] k[u_1,v_1,w_1]\n\\begin{pmatrix}r&\\\\&r^{-1}\\end{pmatrix}k[u,v,0]\\right) \\\\\n& \\cdot e^{-2iq\\varrho} \\, h(r,v)^{\\nu-1-\\ell} \\sin 2v \\,\\dd u\\,\\dd v\\,\\dd\\varrho.\n\\end{split}\\]\nReplacing $\\varrho$ by $\\varrho-u_1-w_2$, the integral further simplifies to\n\\[\\begin{split}\n\\frac{d_{\\ell}e^{2iq(u_1+w_2)}}{2\\pi^2}\\int_{\\substack{0\\leq u\\leq \\pi \\\\ 0\\leq v\\leq \\pi\/2 \\\\ 0\\leq \\varrho\\leq 2\\pi}} & \\psi_{\\ell}\\left( \\left(\\begin{matrix} e^{-i\\varrho} I + e^{i\\varrho}J & \\ast \\\\ \\ast & \\ast \\end{matrix}\\right)\\right) e^{-2iq\\varrho} \\, h(r,v)^{\\nu-1-\\ell} \\sin 2v \\,\\dd u\\,\\dd v\\,\\dd \\varrho,\n\\end{split}\\]\nwhere\n\\begin{align*}\nI:=&\\left(r^{-1}e^{-2iu-iw_1}\\sin v\\cos v_1+re^{iw_1}\\cos v\\sin v_1\\right)\n\\left(e^{2iu-iu_2}\\sin v\\cos v_2-e^{iu_2}\\cos v\\sin v_2\\right),\\\\\nJ:=&\\left(-r^{-1}e^{-2iu-iw_1}\\sin v\\sin v_1+re^{iw_1}\\cos v\\cos v_1\\right)\n\\left(e^{2iu-iu_2}\\sin v\\sin v_2+e^{iu_2}\\cos v\\cos v_2\\right).\\end{align*}\nEvaluating the $\\varrho$-integral, we obtain\n\\begin{equation}\\label{post-expansion}\n\\varphi_{\\nu,\\ell}^{\\ell,q}(g) = \\frac{d_{\\ell}e^{2iq(u_1+w_2)}}{\\pi}\\binom{2\\ell}{\\ell + q}\n\\int_{\\substack{0\\leq u\\leq \\pi \\\\ 0\\leq v\\leq \\pi\/2 } } \\frac{\\sin 2v}{h(r,v)^{\\ell+1-\\nu}}\n\\,\\bar{I}^{\\ell + q} \\bar{J}^{\\ell - q}\\,\\dd u\\,\\dd v.\n\\end{equation}\nTaking the complex conjugate of the right-hand side, and introducing the new variables $t:=r^{-1}\\tan v$ and $\\phi:=2u$, we get\n\\begin{align*}\n\\bigl|\\varphi_{\\nu,\\ell}^{\\ell,q}(g)\\bigr| = \\frac{d_{\\ell}}{\\pi}&\\binom{2\\ell}{\\ell+q}\n\\bigg|\\int_0^{\\infty}\\int_0^{2\\pi} \\frac{t}{(1 + (t\/r)^2)^{\\ell+1+\\nu}(1+(tr)^2)^{\\ell+1-\\nu}}\\\\\n&\\left(e^{-i\\phi-2iw_1}(t\/r)\\cos v_1+\\sin v_1\\right)^{\\ell+q}\n\\left(e^{i\\phi-2iu_2}(tr)\\cos v_2-\\sin v_2\\right)^{\\ell+q}\\\\\n&\\left(e^{-i\\phi-2iw_1}(t\/r)\\sin v_1-\\cos v_1\\right)^{\\ell-q}\n\\left(e^{i\\phi-2iu_2}(tr)\\sin v_2+\\cos v_2\\right)^{\\ell-q}\\,\\dd\\phi\\,\\dd t\\bigg|.\n\\end{align*}\nNow comes the last key step: in the inner $\\phi$-integral, we can remove the $r$'s. This is so because $e^{-i\\phi}$ must be chosen equally many times as $e^{i\\phi}$, and the $r$'s will cancel out in all terms surviving the integration. Another way to see the same thing is to shift the contour as in $\\phi\\mapsto\\phi+i\\log r$ where the boundary terms cancel out by $2\\pi$-periodicity. Either way, using also the opportunity to replace $\\phi\\mapsto\\phi+u_2-w_1$,\nand writing $\\Delta:=u_2+w_1$, we finally obtain\n\\begin{align*}\n\\bigl|\\varphi_{\\nu,\\ell}^{\\ell,q}(g)\\bigr| \\leq \\frac{d_{\\ell}}{\\pi} \\binom{2\\ell}{\\ell+q}\n\\int_{0}^{\\infty}&\\frac{t}{((1 + (t\/r)^2)(1+(tr)^2))^{\\ell+1}}\\\\\n\\times\\int_0^{2\\pi}\n&\\bigl|e^{i\\phi+i\\Delta}t\\cos v_1+\\sin v_1\\bigr|^{\\ell+q}\n\\bigl|e^{i\\phi -i\\Delta}t\\cos v_2-\\sin v_2\\bigr|^{\\ell+q}\\\\\n&\\bigl|e^{i\\phi+i\\Delta}t\\sin v_1-\\cos v_1\\bigr|^{\\ell-q}\n\\bigl|e^{i\\phi -i\\Delta}t\\sin v_2+\\cos v_2\\bigr|^{\\ell-q}\\,\\dd\\phi\\,\\dd t.\n\\end{align*}\n\nWe estimate the inner integrand using the following lemma, which is purely about inequalities. We state it formally so as to clearly separate issues. (In the case $q=\\pm\\ell$, all expressions raised to exponent 0 should simply be omitted.) As in the previous section, we introduce the notation $\\lambda:=\\sqrt{\\log \\ell}$.\n\n\\begin{lemma}\\label{young}\nLet $\\ell,q\\in\\ZZ$ be such that $\\ell\\geq\\max(1,|q|)$. Let $X>0$ and $\\Lambda>0$.\n\\begin{enumerate}[label=(\\alph*)]\n\\item\\label{part-a}\nIf $A,B\\geq 0$ satisfy $A^2+B^2=X^2$, then\n\\begin{equation}\n\\label{ineq-two-terms}\n\\left(\\frac{2\\ell}{\\ell+q}\\right)^{(\\ell+q)\/2}\\left(\\frac{2\\ell}{\\ell-q}\\right)^{(\\ell-q)\/2}A^{\\ell+q}B^{\\ell-q}\\leq X^{2\\ell}.\n\\end{equation}\nMoreover, the left-hand side is $\\OO_\\Lambda(X^{2\\ell}\\ell^{-\\Lambda})$ unless\n\\begin{equation}\\label{cases-of-eq}\n\\begin{split}\nA^2&=\\frac{\\ell+q}{2\\ell}X^2+\\OO_{\\Lambda}\\left(X^2\\frac{\\lambda^2+\\lambda\\sqrt{\\ell-|q|}}{\\ell}\\right),\\\\\nB^2&=\\frac{\\ell-q}{2\\ell}X^2+\\OO_{\\Lambda}\\left(X^2\\frac{\\lambda^2+\\lambda\\sqrt{\\ell-|q|}}{\\ell}\\right).\n\\end{split}\n\\end{equation}\n\\item\\label{part-b}\nIf $A,B,C,D\\geq 0$ satisfy $A^2+B^2=C^2+D^2=X^2$, then\n\\[ \\binom{2\\ell}{\\ell+q}A^{\\ell+q}B^{\\ell-q}C^{\\ell+q}D^{\\ell-q} \\ll\\frac{X^{4\\ell}}{ 1+\\sqrt{\\ell-|q|}}. \\]\nMoreover, the left-hand side is $\\OO_\\Lambda(X^{4\\ell}\\ell^{-\\Lambda})$ unless \\eqref{cases-of-eq} and the analogous estimates for $C$, $D$ are satisfied.\n\\end{enumerate}\n\\end{lemma}\n\n\\begin{proof}\nLet us first assume $|q| < \\ell$. We use Young's inequality\n\\[xy \\leq \\frac{x^a}{a} + \\frac{y^b}{b} , \\qquad \\frac{1}{a} + \\frac{1}{b}=1,\\]\nto conclude with\n\\begin{equation}\\label{xy}\nx := \\left(\\sqrt{\\frac{2\\ell}{\\ell+q}}\\frac{A}{X}\\right)^{\\frac{\\ell+q}{\\ell}}, \\quad\ny := \\left(\\sqrt{\\frac{2\\ell}{\\ell-q}}\\frac{B}{X}\\right)^{\\frac{\\ell-q}{\\ell}}, \\quad\na := \\frac{2\\ell}{\\ell + q}, \\quad\nb := \\frac{2\\ell}{\\ell - q}\n\\end{equation}\nthat\n\\[\n\\left(\\sqrt{\\frac{2\\ell}{\\ell+q}}\\frac{A}{X}\\right)^{\\frac{\\ell+q}{\\ell}}\n\\left(\\sqrt{\\frac{2\\ell}{\\ell-q}}\\frac{B}{X}\\right)^{\\frac{\\ell-q}{\\ell}}\n\\leq \\frac{A^2+B^2}{X^2}=1.\n\\]\nThis is equivalent to \\eqref{ineq-two-terms}. We also conclude (still using the notation \\eqref{xy}) that the left-hand side of \\eqref{ineq-two-terms} is $\\OO_\\Lambda(X^{2\\ell}\\ell^{-\\Lambda})$ unless\n\\begin{equation}\\label{ineq}\nxy>1\/2,\\qquad xy=1+\\OO_\\Lambda(\\delta),\\qquad\\delta:=\\lambda^2\/\\ell.\n\\end{equation}\n\nLet us explore the consequences of \\eqref{ineq}. First, by $x^a\/a+y^b\/b=1$ we have\n\\[1\/31$ or $b\\delta<1$. Then $y^b\\gg_\\Lambda 1$, whence $y-y_0\\ll_\\Lambda\\sqrt{\\delta\/b}$ by the previous display. From here and \\eqref{ineq} we get the following two approximations for $bxy$:\n\\begin{align*}\nbxy&=bxy_0+\\OO_\\Lambda(\\sqrt{b\\delta})=bx^a+\\OO_\\Lambda(\\sqrt{b\\delta}),\\\\\nbxy&=b+\\OO_\\Lambda(b\\delta)=(b-1)x^a+y^b+\\OO_\\Lambda(b\\delta).\n\\end{align*}\nComparing the right-hand sides, we conclude that\n\\begin{equation}\\label{eq:xayb}\nx^a-y^b\\ll_\\Lambda b\\delta+\\sqrt{b\\delta}.\n\\end{equation}\nIn the remaining case when $y^b\\leq 1$ and $b\\delta\\geq 1$, the inequality \\eqref{eq:xayb} holds automatically in the stronger form $|x^a-y^b|<2\\leq 2b\\delta$.\n\nWe proved that \\eqref{ineq} implies \\eqref{eq:xayb} in all ranges. For our specific set-up \\eqref{xy}, the inequality \\eqref{eq:xayb} says that\n\\[aA^2-bB^2\\ll_\\Lambda X^2(b\\delta+\\sqrt{b\\delta}),\\]\nand this is equivalent to \\eqref{cases-of-eq} in the light of $A^2+B^2=X^2$.\nThis shows \\ref{part-a} under the assumption $0\\leq q<\\ell$, but it is easily seen to continue to hold also for $q = \\ell$ in which case \\eqref{ineq} simply reads $A^2 = X^2 + \\OO_\\Lambda(X^2\\delta)$. The argument for $- \\ell \\leq q < 0$ is identical.\n\nTurning to \\ref{part-b}, we conclude from \\ref{part-a} that\n\\[ \\left(\\frac{2\\ell}{\\ell+q}\\right)^{\\ell+q}\\left(\\frac{2\\ell}{\\ell-q}\\right)^{\\ell-q}A^{\\ell+q}B^{\\ell-q}C^{\\ell+q}D^{\\ell-q}\\leq X^{4\\ell}. \\]\nOn the other hand, using Stirling's formula $n!\\sim(n\/e)^n\\sqrt{2\\pi n}$, we have for $|q|<\\ell$ that\n\\[ \\binom{2\\ell}{\\ell+q}\\asymp\\frac{(2\\ell)^{2\\ell}}{(\\ell+q)^{\\ell+q}(\\ell-q)^{\\ell-q}}\\sqrt{\\frac{2\\ell}{(\\ell+q)( \\ell-q)}}, \\]\nand so combining the two most recent displays we have the announced bound\n \\[ \\binom{2\\ell}{\\ell+q}A^{\\ell+q}B^{\\ell-q}C^{\\ell+q}D^{\\ell-q} \\ll\\frac{X^{4\\ell}}{ 1+\\sqrt{\\ell-|q|}}. \\]\nWe added artificially the $1+$ term in the denominator, so that the inequality also holds for the previously excluded case $|q| = \\ell$ in view of $AC, BD \\leq X^2$ (which follows directly from $A^2 + C^2 = B^2 +D^2 = X^2$). The claim that the left-hand side is negligible unless \\eqref{cases-of-eq} holds for $(A,B)$ and $(C,D)$ is immediate from \\ref{part-a}.\n\\end{proof}\n\nWe now return to the double integral in the upper bound for $\\varphi_{\\nu,\\ell}^{\\ell,q}(g)$.\nWe estimate\nthe inner integral by writing the integrand as $A^{\\ell + q} B^{\\ell - q} C^{\\ell + q} D^{\\ell - q}$ in the obvious way and applying Lemma~\\ref{young}, where\n\\[A^2+B^2=C^2+D^2=X^2=1+t^2,\\]\nand\n\\[ A^2=\\frac{1+t^2}{2}+\\frac{t^2-1}{2}\\cos 2v_1+t\\sin 2v_1\\cos(\\phi+\\Delta), \\]\nwith analogous expressions for $B^2$, $C^2$, and $D^2$. Since\n\\[\\frac{(1 + (t\/r)^2)(1+(tr)^2)}{(1 + t^2)^2} = 1 + \\left(\\frac{r - r^{-1}}{t + t^{-1}}\\right)^2,\\]\nwe conclude that the contribution of the inner integral is $\\OO_\\Lambda(\\ell^{-\\Lambda})$ unless\n\\begin{equation}\\label{r}\n\\min(t,t^{-1})\\ll_\\Lambda\\frac{\\lambda}{(r-1)\\sqrt{\\ell}}.\n\\end{equation}\nFor $r=1$ we treat the right-hand side as infinity. We may then summarize our findings as follows.\n\n\\begin{lemma}\\label{lem1} Let $\\Lambda\\in\\NN$. Let $\\ell,q\\in\\ZZ$ be such that $\\ell\\geq\\max(1,|q|)$, and let $\\nu\\in i\\RR$. Assume that $g\\in\\SL_2(\\CC)$ is given by \\eqref{g}. Let us abbreviate $\\Delta:= u_2 + w_1$ and $\\lambda := \\sqrt{\\log \\ell}$. Let $\\mcM = \\mcM(v_1,v_2,\\Delta,r,\\Lambda)$ be the set of $(\\phi, t) \\in [0, 2\\pi] \\times [0, \\infty)$ satisfying \\eqref{r} as well as\n\\begin{equation}\\label{eq}\n\\begin{split}\n2t\\sin 2v_1\\cos(\\phi+\\Delta)&=(1-t^2)\\cos 2v_1+\\frac{q}{\\ell}(1+t^2)+\\OO_{\\Lambda}\\left((1+t^2)\\frac{\\lambda^2+ \\lambda\\sqrt{\\ell-|q|}}{\\ell} \\right),\\\\\n2t\\sin 2v_2\\cos(\\phi-\\Delta)&=(t^2-1)\\cos 2v_2-\\frac{q}{\\ell}(1+t^2)+\\OO_{\\Lambda}\\left((1+t^2)\\frac{\\lambda^2 + \\lambda\\sqrt{\\ell-|q|}}{\\ell} \\right),\\\\\n\\end{split}\n\\end{equation}\nwith a sufficiently large (but fixed) implied constant depending on $\\Lambda$. Then\n\\begin{equation}\\label{keyupperbound}\n\\varphi_{\\nu,\\ell}^{\\ell,q}(g) \\ll_\\Lambda \\frac{\\ell}{1 + \\sqrt{\\ell - |q|}}\n\\int_{\\mcM} \\frac{t}{(1+t^2)^2} \\, \\dd \\phi\\, \\dd t + \\ell^{-\\Lambda}.\n\\end{equation}\n\\end{lemma}\n\n\\subsection{Simplifying assumptions}\\label{simplifying-section}\nFor the proof of Theorems~\\ref{thm6}~and~\\ref{thm5}, we can and we shall assume that $|\\Delta|\\leq\\pi\/4$. Indeed, using the last relation in \\eqref{angleequiv} multiple times, we can choose the coordinates in \\eqref{g} so that this bound is satisfied. Moreover, we can replace $g$ by\n\\[g^{-1}=k\\left[\\frac{\\pi}{2}-w_2,v_2-\\frac{\\pi}{2},u_2+\\frac{\\pi}{2}\\right]\n\\begin{pmatrix}r & \\\\ & r^{-1}\\end{pmatrix}\nk\\left[w_1-\\frac{\\pi}{2},v_1-\\frac{\\pi}{2},\\frac{\\pi}{2}-u_1\\right]\\]\nif needed, because the quantities $\\Delta$, $\\|g\\|$, $D(g)$ do not change under this replacement, \n$\\bigl|\\varphi_{\\nu,\\ell}^{\\ell,q}(g)\\bigr|=\\bigl|\\varphi_{\\nu,\\ell}^{\\ell,q}(g^{-1})\\bigr|$ holds by \\eqref{eq:averaged-spherical-function-symmetry}, and\n\\[\\dist(g,\\mcH)=\\dist(g^{-1},\\mcH),\\qquad\\mcH\\in\\{K,\\mcD,\\mcS\\}\\]\nholds by \\eqref{distinvariance}.\n\nWe shall derive (most of) the bounds in Theorems~\\ref{thm6}~and~\\ref{thm5} from \\eqref{keyupperbound}. In Lemma~\\ref{lem1}, the pair $(\\Delta,r)$ does not change under the above discussed replacement $g\\mapsto g^{-1}$, while\nthe corresponding integration domains $\\mcM$ are related by\n\\[(\\phi,t)\\in\\mcM\\left(v_2-\\frac{\\pi}{2},v_1-\\frac{\\pi}{2},\\Delta,r,\\Lambda\\right)\\quad\\Longleftrightarrow\\quad\n(\\phi,t^{-1})\\in\\mcM(v_1,v_2,\\Delta,r,\\Lambda).\\]\nMoreover, the integrand in \\eqref{keyupperbound} is invariant under $t\\mapsto t^{-1}$, hence we can assume that the contribution of $t\\leq 1$ is not smaller than the contribution of $t>1$. So from now on we restrict $\\mcM$ in \\eqref{keyupperbound} to the corresponding subset of $[0, 2\\pi] \\times [0, 1]$. On this subset we have, by \\eqref{r},\n\\begin{equation}\\label{r1}\nt\\in[0,1]\\qquad\\text{and}\\qquad t \\ll_\\Lambda \\frac{\\lambda}{(r-1)\\sqrt{\\ell}}.\n\\end{equation}\n\n\\subsection{Proof of Theorem~\\ref{thm6}}\nThe bound \\eqref{thm6bound} is trivial for $\\ell\\ll_\\Lambda 1$, hence we shall assume that $\\ell$ is sufficiently large in terms of $\\Lambda$. With the notation\n\\[\\alpha := \\dist(g, K) \\asymp r-1\\qquad\\text{and}\\qquad\\beta := \\dist(g, \\mcD),\\]\nit follows from \\eqref{keyupperbound} and the previous subsection that it suffices to show\n\\begin{equation}\\label{beginThm6}\n\\frac{\\ell}{1 + \\sqrt{\\ell - |q|}}\\int_{\\mcM} t \\, \\dd \\phi\\, \\dd t \\ll_{\\eps,\\Lambda}\n\\ell^{\\eps}\\min\\left(1,\\frac{\\| g \\|}{\\sqrt{\\ell}\\alpha^2\\beta}\\right),\n\\end{equation}\nwhere $\\mcM$ is now restricted by \\eqref{r1}. In fact our arguments below will show that $\\ell^\\eps$ can be replaced by $(\\log\\ell)^3$.\n\nWe start with the first bound of \\eqref{beginThm6}. With the notation\n\\[\\sigma:=\\lambda^2+\\lambda\\sqrt{\\ell-|q|},\\qquad\n\\mu:=\\frac{q}{\\ell} - \\cos 2v_1,\\qquad \\rho:=\\sin 2 v_1,\\]\nthe first equation in \\eqref{eq} becomes\n\\begin{equation}\\label{tquadratic}\n\\mu t^2 - 2t\\rho\\cos(\\phi+\\Delta) + \\frac{2q}{\\ell}-\\mu+\\OO_\\Lambda\\left(\\frac{\\sigma}{\\ell}\\right)=0.\n\\end{equation}\nWithout loss of generality, $\\mu\\neq 0$, and then we can view \\eqref{tquadratic} as a quadratic equation for $t$. Multiplying by $\\mu$ and completing the square, we obtain the alternative form\n\\begin{equation}\\label{compl}\n\\bigl(\\mu t - \\rho\\cos(\\phi + \\Delta)\\bigr)^2+\\bigl(\\rho\\sin(\\phi + \\Delta)\\bigr)^2\n=1-\\frac{q^2}{\\ell^2}+\\OO_\\Lambda\\left(\\frac{|\\mu|\\sigma}{\\ell}\\right).\n\\end{equation}\nIn particular, the discriminant of \\eqref{tquadratic} equals $4D(\\phi)+\\OO_\\Lambda(|\\mu|\\sigma\/\\ell)$, where\n\\begin{equation}\\label{disc-q}\nD(\\phi) := 1-\\frac{q^2}{\\ell^2}-\\bigl(\\rho\\sin(\\phi + \\Delta)\\bigr)^2\n\\end{equation}\nWe assume first that $|q|\/\\ell\\leq 5\/6$, and decompose $\\mcM$ into two parts $\\mcM^\\pm$ according as\n$|\\rho\\sin(\\phi+\\Delta)|$ exceeds $1\/2$ or not. On $\\mcM^+$, the equation \\eqref{tquadratic} localizes $\\phi$ within $\\ll_\\Lambda\\sigma\/(\\ell t)$ for each given $t\\in[0,1]$. On $\\mcM^-$, we have $D(\\phi)\\geq 1\/18$, hence the equation \\eqref{compl} localizes $t$ within $\\ll_\\Lambda\\sigma\/\\ell$ for each given $\\phi\\in[0,2\\pi]$. This shows that\n\\[\\int_\\mcM t\\,\\dd\\phi\\,\\dd t\\ll_\\Lambda\\int_0^1 t\\,\\frac{\\sigma}{\\ell t}\\,\\dd t+\\int_0^{2\\pi}\\frac{\\sigma}{\\ell}\\,\\dd\\phi\n\\ll\\frac{\\sigma}{\\ell},\\]\nhence the first bound of \\eqref{beginThm6} follows in stronger form. From now on we assume that $|q|\/\\ell>5\/6$. We decompose $\\mcM$ into two parts $\\mcM^\\pm$ according as $D(\\phi)$ is positive or not, and we make two initial observations. First, $\\mcM^+$ is clearly empty when $|q|=\\ell$. Second, $|\\mu|>1\/6$ holds for large $\\ell$, because \\eqref{tquadratic} coupled with $t\\in[0,1]$ yields\n\\[\\frac{2|q|}{\\ell}-|\\mu|-\\OO_\\Lambda\\left(\\frac{\\sigma}{\\ell}\\right)\\leq 2t|\\rho|\n\\leq 2\\sqrt{1 - \\left( \\frac{q}{\\ell} - \\mu\\right)^2}.\\]\nIn order to estimate the contribution of $\\mcM^+$ in \\eqref{beginThm6}, we decompose $\\mcM^+$\ninto pieces\n\\[\\mcM^{+}({\\mtD},\\eta):=\\left\\{(\\phi,t)\\in\\mcM^+:\n\\text{$D(\\phi) \\asymp {\\mtD}$ and $|\\cos(\\phi + \\Delta)| \\asymp \\eta$}\n\\right\\}.\\]\nIf $\\eta \\leq \\ell^{-10}$, we can estimate trivially, so there are only $\\OO(\\log \\ell)$ relevant values for $\\eta$. If $\\rho \\geq \\ell^{-10}$, then by the same argument there are only $\\OO(\\log \\ell)$ relevant values for ${\\mtD}$. If $\\rho < \\ell^{-10}$, then ${\\mtD} > \\ell^{-1}$ by $|q|<\\ell$, hence again\nthere are only $\\OO(\\log \\ell)$ relevant values for ${\\mtD}$. So in all cases it suffices to restrict to $\\OO((\\log \\ell)^2)$ pairs $({\\mtD},\\eta)$. Our current assumptions localize $\\sin(\\phi+\\Delta)$ within\n$\\ll\\sqrt{{\\mtD}}\/|\\rho|$, and hence $\\phi$ within $\\ll\\min(1,\\sqrt{\\mtD}\/|\\rho\\eta|)$, independently of $t$. On the other hand, given $\\phi$, the equation \\eqref{compl} localizes $t$ within $\\ll_\\Lambda\\min((\\sigma\/\\ell){\\mtD}^{-1\/2},\\sqrt{\\sigma\/\\ell})$.\nSuch $t$ are of size $\\ll_\\Lambda |\\rho\\eta| + \\sqrt{\\mtD} + \\sqrt{\\sigma\/\\ell}$, so that\n\\[\\int_{\\mcM^+({\\mtD},\\eta)} t\\,\\dd\\phi\\,\\dd t \\ll_\\Lambda \\left( |\\rho\\eta|+ \\sqrt{\\mtD} + \\sqrt{\\frac{\\sigma}{\\ell}} \\right)\\min\\left( \\frac{\\sigma}{\\ell \\sqrt{\\mtD} }, \\sqrt{\\frac{\\sigma}{\\ell}}\\right) \\min\\left(1, \\frac{\\sqrt{\\mtD} }{|\\rho \\eta|}\\right)\n\\ll\\frac{\\sigma}{\\ell}.\\]\nThis contribution is admissible for the first bound of \\eqref{beginThm6}.\nIt remains to estimate the contribution of $\\mcM^-$ in \\eqref{beginThm6}. On this set we have\n\\[0\\leq -D(\\phi)\\ll_\\Lambda\\frac{\\sigma}{\\ell}\\]\nby \\eqref{compl}. The argument is similar as for $\\mcM^+$, in fact simpler as we only need $\\OO(\\log \\ell)$ pieces $\\mcM^{-}(\\eta)$ defined by $|\\cos(\\phi+\\Delta)|\\asymp\\eta$. Initially we localize $\\phi$ within $\\ll\\min(1,|\\rho\\eta|^{-1}\\sqrt{\\sigma\/\\ell})$, independently of $t$. The equation \\eqref{compl} localizes $t$ within $\\ll_\\Lambda\\sqrt{\\sigma\/\\ell}$, and such $t$ are of size $\\ll_\\Lambda |\\rho\\eta| + \\sqrt{\\sigma\/\\ell}$. We obtain altogether\n\\[\\int_{\\mcM^-(\\eta)} t\\,\\dd\\phi\\,\\dd t \\ll_\\Lambda \\left(|\\rho \\eta| + \\sqrt{\\frac{\\sigma}{\\ell}}\\right)\n\\sqrt{\\frac{\\sigma}{\\ell}}\\min\\left(1, \\frac{1}{|\\rho\\eta|}\\sqrt{\\frac{\\sigma}{\\ell}}\\right) \\ll \\frac{\\sigma}{\\ell},\\]\nwhich is again admissible for the first bound of \\eqref{beginThm6}.\n\nWe now turn to the second bound of \\eqref{beginThm6}. We shall assume (as we can) that $\\mcM\\neq\\emptyset$ and $\\sqrt{\\ell}\\alpha^2\\beta>\\| g \\|$. We pick an arbitrary point $(\\phi,t)\\in\\mcM$. Combining \\eqref{eq} and \\eqref{r1}, we get\n\\[\\cos 2v_j = - \\text{sgn}(q) + \\OO(t)\\sin 2v_j + \\OO_\\Lambda\\left(t^2 +\\frac{\\lambda^2+ \\ell - |q|}{\\ell}\\right),\\]\nwhere for $q=0$ we can replace $\\sgn(q)$ by $1$. After squaring and solving for $\\sin 2v_j$, then feeding back the result into the previous display, we get\n\\[\\sin 2v_j=\\OO_\\Lambda\\left(t +\\frac{\\lambda+ \\sqrt{\\ell - |q|}}{\\sqrt{\\ell}}\\right),\\qquad\n\\cos 2v_j = - \\text{sgn}(q) + \\OO_\\Lambda\\left(t^2 +\\frac{\\lambda^2+ \\ell - |q|}{\\ell}\\right).\\]\nRecalling also \\eqref{g}, and using \\eqref{r1} again, we infer that\n\\[\\beta \\ll_\\Lambda\\|g\\|\\left(\\frac{\\lambda}{\\alpha\\sqrt{\\ell}} +\\frac{\\lambda+ \\sqrt{\\ell - |q|}}{\\sqrt{\\ell}}\\right).\\]\nHence we always have\n\\[1 \\ll_\\Lambda \\frac{\\|g\\|\\lambda}{\\alpha\\beta\\sqrt{\\ell}}\n\\qquad \\text{or} \\qquad 1 \\ll_\\Lambda \\|g\\|\\lambda\\frac{1+\\sqrt{\\ell - |q|}}{\\beta\\sqrt{\\ell}}.\\]\nIn either case, for any $c > 0$, the previous display combined with \\eqref{r1} yields that\n\\begin{align*}\n\\frac{\\ell}{1 + \\sqrt{\\ell - |q|}}\\int_{\\mcM} t \\, \\dd \\phi\\, \\dd t\n&\\ll_{\\Lambda,c}\\frac{\\lambda^2}{(1+\\sqrt{\\ell - |q|})\\alpha^2}\n\\left(\\left(\\frac{\\|g\\|\\lambda}{\\alpha\\beta\\sqrt{\\ell}}\\right)^c+ \\|g \\|\\lambda\\frac{1+\\sqrt{\\ell - |q|}}{\\beta\\sqrt{\\ell}}\\right)\\\\[4pt]\n& \\ll_{\\eps,\\Lambda,c} \\ell^\\eps\\left(\\frac{\\| g \\|^c}{\\ell^{c\/2} \\alpha^{2 + c} \\beta^c}+\\frac{\\| g \\|}{\\sqrt{\\ell} \\alpha^2 \\beta}\\right).\n\\end{align*}\nChoosing $c = 2$, and recalling our initial assumption $\\sqrt{\\ell}\\alpha^2\\beta>\\| g \\|$,\nwe obtain the second bound of \\eqref{beginThm6} in stronger form.\n\nThe proof of Theorem~\\ref{thm6} is complete.\n\n\\subsection{Proof of Theorem~\\ref{thm5}\\ref{thm5-a}}\\label{thm5a-proof-sec}\nThe averaged spherical trace function $\\varphi_{\\nu,\\ell}^{\\ell, q}(g)$ exhibits starkly different behavior depending on the value of $-\\ell\\leq q\\leq\\ell$. Some of these features are already visible along $K=\\SU_2(\\CC)$. From \\eqref{varphi-def-proof} and \\eqref{post-expansion} we can see that, in the notation of \\eqref{decomp-K} and \\eqref{matrix-coeff},\n\\[\\varphi_{\\nu,\\ell}^{\\ell,q}(k[u,v,w])=\\Phi_{q,q}^{\\ell}(k[u,v,w])=\ne^{2\\pi i q(u+w)}(\\cos v)^{2q}P_{\\ell-q}^{(0,2q)}(\\cos 2v).\\]\nThe absolute value of the right-hand side exhibits a primary peak at $v\\in\\pi\\ZZ$ of size 1. For $q=\\pm\\ell$, this is followed by a sharp drop to $\\OO_N(\\ell^{-N})$ after a range of length about $\\ell^{-1\/2}$. For a generic $q$, the drop becomes soft through a highly oscillatory range of magnitude $\\ell^{-1\/2}$ (faster and more oscillatory for smaller $q$) and a secondary, Airy-type peak of size about $\\ell^{-1\/3}$ before the delayed sharp drop. For $q=0$, the secondary peak grows to a full peak of size 1 at $v\\in\\frac12\\pi+\\pi\\ZZ$ (corresponding to skew-diagonal matrices in $K$) and the sharp drop disappears. These varying features, which are illustrated in Figure~\\ref{Jacobi-figure}, become vastly more complicated off $K$, where the hard work in Theorems~\\ref{thm6} and \\ref{thm5} lies. Nevertheless, their traces are visible in the hard localization to $\\mcD$ (but none to $K$!) for $q=\\pm\\ell$ and the hard localization to $\\mcN$ with soft localization to $\\mcS\\subset K\\subset\\mcN$ for $q=0$.\n\n\\begin{figure}\n\\centering\n\\includegraphics[width=0.24\\textwidth]{Jacobi1.pdf}\n\\includegraphics[width=0.24\\textwidth]{Jacobi2.pdf}\n\\includegraphics[width=0.24\\textwidth]{Jacobi3.pdf}\n\\includegraphics[width=0.24\\textwidth]{Jacobi4.pdf}\n\\caption{Plots of $(\\cos v)^{2q}P_{\\ell-q}^{(0,2q)}(\\cos 2v)$ for $0\\leq v\\leq\\pi$, $\\ell=120$, $q=120$, $q=100$, $q=20$, and $q=0$.}\n\\label{Jacobi-figure}\n\\end{figure}\n\nIn this subsection, we consider in more detail the case $q = 0$. Then \\eqref{keyupperbound} simplifies to\n\\begin{equation}\\label{keyupperbound:q=0}\n\\varphi_{\\nu,\\ell}^{\\ell,0}(g) \\ll_\\Lambda\\sqrt{\\ell}\n\\int_{\\mcM} \\frac{t}{(1+t^2)^2} \\, \\dd \\phi\\, \\dd t + \\ell^{-\\Lambda},\n\\end{equation}\nwhere by \\eqref{eq} and the last paragraph of \\S \\ref{sec:preliminary-computations}, the set $\\mcM$ can be described by the constraints given in \\eqref{r1} and\n\\begin{equation}\\label{eq0}\n\\begin{split}\n2t\\sin 2v_1\\cos(\\phi+\\Delta)&=(1-t^2)\\cos 2v_1 +\\OO_\\Lambda(\\lambda\/\\sqrt{\\ell}),\\\\\n2t\\sin 2v_2\\cos(\\phi-\\Delta)&=(t^2-1)\\cos 2v_2 +\\OO_\\Lambda(\\lambda\/\\sqrt{\\ell}).\\\\\n\\end{split}\n\\end{equation}\nWe shall use the notations\n\\begin{align*}\nP(\\phi) &:= \\max(|\\sin 2v_1 \\cos(\\phi + \\Delta)|, |\\sin 2v_2 \\cos(\\phi-\\Delta)|),\\\\\nR & := \\max(|\\cos 2v_1|, |\\cos2v_2|),\\\\\nN & := \\max(|\\sin(2v_1+2v_2) \\cos\\Delta|, |\\sin(2v_1-2v_2)\\sin\\Delta|).\n\\end{align*}\nRecall also the earlier notations \\eqref{adbc} and \\eqref{Dgdef}. As\n\\[|a|^2 - |d|^2 = \\frac{r^2-r^{-2}}{2}(\\cos 2v_1 + \\cos 2v_2), \\qquad\n|b|^2 - |c|^2 = \\frac{r^2-r^{-2}}{2}(\\cos 2v_1 - \\cos 2v_2),\\]\nwe can identify $\\mcN$ as the set of matrices with $r=1$ or $\\cos 2v_1 = \\cos 2v_2 = 0$. More precisely,\nby \\eqref{eq0} and \\eqref{r1} we have\n\\[D(g)\\ll r(r-1)R\\ll_\\Lambda r(r-1)\\left(t +\\frac{\\lambda}{\\sqrt{\\ell}}\\right)\\ll_\\Lambda\\frac{r^2\\lambda}{\\sqrt{\\ell}},\\]\nso that unless $D(g)\\ll_\\Lambda\\|g\\|^2\\lambda \\ell^{-1\/2}$, we have $\\mcM=\\emptyset$, yielding $\\varphi^{\\ell, 0}_{\\nu, \\ell}(g)\\ll_\\Lambda\\ell^{-\\Lambda}$. Hence we are left with proving \\eqref{thm5boundq=0}.\n\nIn \\eqref{keyupperbound:q=0}, the contribution of the $t$-integral over the interval $[0,\\ell^{-\\Lambda\/2-1\/4}]$ is negligible, and we split the rest of $\\mcM$ in dyadic ranges $\\mcM(\\delta)$ according to $\\ell^{-\\Lambda\/2-1\/4} 1\/2$, then for any fixed $t$, \\eqref{eq0} localizes $\\phi$ to a set of measure $\\OO_{\\Lambda}(\\lambda\/\\sqrt{\\ell})$. Otherwise, for any fixed $\\phi$, \\eqref{eq0} localizes $t$ to a set of measure $\\OO_{\\Lambda}(\\lambda\/\\sqrt{\\ell})$. We conclude that\n\\begin{equation}\\label{I1}\n\\meas(\\mcM(\\delta))\\ll_\\Lambda\\lambda\/\\sqrt{\\ell}.\n\\end{equation}\n\nNow we prove the alternative bound\n\\begin{equation}\\label{I2b}\n\\meas(\\mcM(\\delta))\\ll_\\Lambda\\frac{\\lambda^4}{N\\ell}.\n\\end{equation}\nWe shall assume that $N\\ell>1$, for otherwise \\eqref{I2b} follows from \\eqref{I1}. Under this assumption, we have $\\max(|\\sin 2v_1|,|\\sin 2v_2|)\\gg\\ell^{-1}$, which implies that\n\\[\n\\meas(\\{(\\phi,t)\\in \\mcM(\\delta):P(\\phi)\\leq \\ell^{-3}\\}) \\ll \\ell^{-1}.\n\\]\nIndeed, if $\\phi$ changes by at least $\\ell^{-1}$ and at most $\\pi\/4$, then $\\cos(\\phi\\pm\\Delta)$ both change by $\\Omega(\\ell^{-2})$, hence $P(\\phi)$ changes by $\\Omega(\\ell^{-3})$. This implies that $P(\\phi)\\leq \\ell^{-3}$ localizes $\\phi$ to a set of measure $\\OO(\\ell^{-1})$.\nTherefore, the contribution of $\\{(\\phi,t)\\in \\mcM(\\delta):P(\\phi)\\leq \\ell^{-3}\\}$ to the left-hand side of \\eqref{I2b} is\n$\\OO_{\\Lambda}(\\delta\/\\sqrt{\\ell})$, which is admissible by $N\\leq 1$. We decompose the rest of $\\mcM(\\delta)$ into dyadic ranges $\\mcM(\\delta,\\mtP)$ according to $\\ell^{-3}\\leq P(\\phi)\\asymp \\mtP\\leq 1$. The number of such ranges is $\\OO(\\log \\ell)$, hence in order to verify \\eqref{I2b}, it suffices to prove\n\\[\\meas(\\mcM(\\delta,\\mtP))\\ll_\\Lambda\\frac{\\lambda^2}{N\\ell}.\\]\nThe proof of this estimate immediately reduces to the following two localizations:\n\\begin{equation}\\label{phi-loc}\n\\meas(\\{\\phi\\in[0,2\\pi]:(\\phi,t)\\in\\mcM(\\delta,\\mtP)\\text{ for some $t\\asymp \\delta$}\\}) \\ll_{\\Lambda} \\frac{(\\mtP+R)\\lambda}{N\\sqrt{\\ell}},\n\\end{equation}\nand for any $\\phi\\in[0,2\\pi]$,\n\\begin{equation}\\label{t-loc}\n\\meas(\\{t\\in[0,1]:(\\phi,t)\\in\\mcM(\\delta,\\mtP)\\}) \\ll_{\\Lambda} \\frac{\\lambda}{(\\mtP+R)\\sqrt{\\ell}}.\n\\end{equation}\nNow we prove these localizations.\n\nStarting out from \\eqref{eq0}, we execute two eliminations: one to eliminate the main terms of the right-hand sides, and the other one to eliminate the left-hand sides. Introducing\n\\[\nF(\\phi):= \\cos \\phi \\cos \\Delta \\sin(2v_1+2v_2) - \\sin \\phi \\sin \\Delta \\sin(2v_1-2v_2),\n\\]\nthese give\n\\[\ntF(\\phi) \\ll_{\\Lambda} R \\lambda\/\\sqrt{\\ell}\\qquad\\text{and}\\qquad (1-t^2) F(\\phi) \\ll_{\\Lambda} \\mtP \\lambda \/\\sqrt{\\ell}.\n\\]\nIn particular, we obtain both for $t>1\/2$ and $t\\leq 1\/2$ that\n\\begin{equation}\\label{bound-on-Fphi}\nF(\\phi) \\ll_{\\Lambda} (\\mtP+R) \\lambda \/\\sqrt{\\ell}.\n\\end{equation}\nLetting\n\\[\nN':= \\sqrt{\\sin^2(2v_1+2v_2)\\cos^2(\\Delta) + \\sin^2(2v_1-2v_2)\\sin^2(\\Delta)} \\asymp N,\n\\]\nand choosing $\\psi\\in [0,2\\pi)$ such that\n\\[\n\\cos\\psi = \\frac{\\sin(2v_1+2v_2)\\cos\\Delta}{N'},\\qquad\n\\sin\\psi = - \\frac{\\sin(2v_1-2v_2)\\sin \\Delta}{N'},\n\\]\n\\eqref{bound-on-Fphi} gives rise to\n\\[\n\\cos(\\phi-\\psi) \\ll_{\\Lambda} \\frac{(\\mtP+R) \\lambda }{N\\sqrt{\\ell}}.\n\\]\nThis localizes $\\phi$ to a set of measure $\\OO_{\\Lambda}((\\mtP+R)\\lambda\/N\\sqrt{\\ell})$. Indeed, if the right-hand side is very small in terms of the implied constant, then $\\phi-\\psi$ is bounded away from $\\pi\\ZZ$, hence the derivative $\\cos'(\\phi-\\psi)$ is bounded away from zero, while otherwise the claimed localization is trivial. This gives \\eqref{phi-loc}. Fixing $\\phi\\in[0,2\\pi]$, and solving under \\eqref{eq0} the quadratic equation in $t$ of the larger discriminant, we see by \\eqref{disc-lower-bound} that $t$ is localized to a set of measure $\\OO_{\\Lambda}(\\lambda\/(\\mtP+R)\\sqrt{\\ell})$. This gives \\eqref{t-loc}. Altogether, the proof of \\eqref{I2b} is complete.\n\nCombining \\eqref{I1} and \\eqref{I2b}, we obtain\n\\[\\meas(\\mcM(\\delta))\\ll_{\\eps,\\Lambda}\\ell^{\\eps-1}\\mu,\\qquad\\mu:=\\min(\\sqrt{\\ell},N^{-1}).\\]\nWe claim that \n\\begin{equation}\\label{toprovedelta-b}\n\\dist(g,\\mcS)\\ll_{\\Lambda}\\lambda\\delta^{-1}\\mu^{-1},\\qquad \\text{if $\\mcM(\\delta)\\neq\\emptyset$.}\n\\end{equation}\nThis implies the inequality\n\\[\\sqrt{\\ell}\\int_{\\mcM(\\delta)} t\\, \\dd \\phi\\, \\dd t\\ll_{\\eps,\\Lambda}\\ell^{\\eps-1\/2}\\delta\\mu\n\\ll_{\\eps,\\Lambda}\\frac{\\ell^\\eps}{\\sqrt{\\ell}\\dist(g,\\mcS)},\\]\nwhich, summed over the $\\OO(\\log\\ell)$ dyadic ranges for $\\delta$, suffices for the proof of \\eqref{thm5boundq=0}. Note that the bound $\\varphi_{\\nu,\\ell}^{\\ell,q}(g)\\ll_\\eps\\ell^{\\eps}$ is already covered by Theorem~\\ref{thm6}.\n\nTo complete the proof of Theorem~\\ref{thm5}\\ref{thm5-a}, it remains to show \\eqref{toprovedelta-b}. For this final argument, we can and we shall assume that $-\\pi\/8\\leq v_1,v_2\\leq 3\\pi\/8$, because replacing $(u_1,v_1)$ by $(-u_1,v_1+\\pi\/2)$, or $(v_2,w_2)$ by $(v_2+\\pi\/2,-w_2)$, has the effect of multiplying $g$ by $\\left(\\begin{smallmatrix}&i\\\\i&\\end{smallmatrix}\\right)$ from either side without altering $\\Delta$ or the statement \\eqref{toprovedelta-b}. We fix a pair $(\\phi,t)\\in\\mcM(\\delta)$.\n\nNow, $N\\leq \\mu^{-1}$ implies that\n\\begin{equation}\\label{eq:toprovedelta-c}\nv_1+v_2\\in\\frac{\\pi}2\\ZZ+\\OO\\left(\\frac1{\\mu}\\right)\\qquad\\text{and}\\qquad\nv_1-v_2\\in\\frac{\\pi}2\\ZZ+\\OO\\left(\\frac1{\\mu|\\Delta|}\\right).\n\\end{equation}\nLet us introduce the short-hand notation\n\\[m[v]:=\\begin{pmatrix}\\cos v&i\\sin v\\\\i\\sin v&\\cos v\\end{pmatrix},\\qquad v\\in\\RR.\\]\nKeeping \\eqref{decomp-K} and \\eqref{g} in mind, we observe initially that\n\\begin{equation}\\label{initialdistance}\nm[v_1]\\diag\\left(re^{i\\Delta},r^{-1}e^{-i\\Delta}\\right)m[v_2]=m[v_1+v_2]+\\OO\\bigl(r-1+|\\Delta|\\bigr).\n\\end{equation}\nOn the right-hand side, we have $\\dist(m[v_1+v_2],\\mcS)\\ll\\mu^{-1}$ by \\eqref{eq:toprovedelta-c}, and also\n\\begin{equation}\\label{rbound}\nr-1\\ll_\\Lambda\\frac{\\lambda}{t\\sqrt{\\ell}}\\ll\\frac{\\lambda}{\\delta\\mu}\n\\end{equation}\nby \\eqref{r1} and $\\mu\\leq\\sqrt{\\ell}$. Hence \\eqref{toprovedelta-b} follows from \\eqref{initialdistance} as long as $\\Delta\\ll_\\Lambda\\lambda\\delta^{-1}\\mu^{-1}$. In other words, we can and we shall assume that $|\\Delta|\\gg_\\Lambda\\lambda\\delta^{-1}\\mu^{-1}$ holds with a sufficiently large implied constant depending on $\\Lambda$. In particular, we shall assume that the error terms in \\eqref{eq:toprovedelta-c}, and similar error terms for angles in the rest of this subsection, are less than $\\pi\/8$ in size. Under this assumption, \\eqref{eq:toprovedelta-c} breaks into two cases.\n\n\\emph{Case 1:} $v_1,v_2\\ll\\mu^{-1}|\\Delta|^{-1}$ and $v_1+v_2\\ll\\mu^{-1}$. In this case, we refine \\eqref{initialdistance} to\n\\begin{align*}\n&m[v_1]\\diag\\left(re^{i\\Delta},r^{-1}e^{-\\Delta}\\right)m[v_2]\\\\\n&=m[v_1+v_2]+m[v_1]\\diag\\left(re^{i\\Delta}-1,r^{-1}e^{-i\\Delta}-1\\right)m[v_2]\\\\\n&=m[v_1+v_2]+\\diag\\left(re^{i\\Delta}-1,r^{-1}e^{-i\\Delta}-1\\right)+\\OO\\bigl(r-1+\\mu^{-1}\\bigr)\\\\\n&=\\diag\\left(e^{i\\Delta},e^{-i\\Delta}\\right)+\\OO\\bigl(r-1+\\mu^{-1}\\bigr).\n\\end{align*}\nThe main term $\\diag\\left(e^{i\\Delta},e^{-i\\Delta}\\right)$ lies in $\\mcS$, hence \\eqref{toprovedelta-b} follows by \\eqref{rbound}.\n\n\\emph{Case 2:} $v_1,v_2=\\pi\/4+\\OO(\\mu^{-1}|\\Delta|^{-1})$ and $v_1+v_2=\\pi\/2+\\OO(\\mu^{-1})$. As we shall see, this case does not occur. The assumptions imply that $\\sin 2v_1$ and $\\sin 2v_2$ exceed $1\/2$. We multiply the second equation in \\eqref{eq0} by $\\sin 2v_1$, and the first equation in \\eqref{eq0} by $\\sin 2v_2$. Adding and subtracting the resulting two equations, we obtain\n\\begin{align*}\n4t\\sin 2v_1\\sin 2v_2\\cos\\phi\\cos\\Delta&=(t^2-1)\\sin(2v_1-2v_2)+\\OO_\\Lambda(\\lambda\/\\sqrt{\\ell}),\\\\\n4t\\sin 2v_1\\sin 2v_2\\sin\\phi\\sin\\Delta&=(t^2-1)\\sin(2v_1+2v_2)+\\OO_\\Lambda(\\lambda\/\\sqrt{\\ell}).\n\\end{align*}\nWe infer that\n\\[\\delta\\ll|t\\cos\\phi|+|t\\sin\\phi|\n\\ll_\\Lambda|\\sin(2v_1-2v_2)|+\\frac{|\\sin(2v_1+2v_2)|}{|\\Delta|}+\\frac{\\lambda}{\\sqrt{\\ell}|\\Delta|}\n\\ll_\\Lambda\\frac{\\lambda}{\\mu|\\Delta|}.\\]\nThis contradicts our earlier assumption that $\\Delta\\gg_\\Lambda\\lambda\\delta^{-1}\\mu^{-1}$ holds with a sufficiently large implied constant depending on $\\Lambda$.\n\nThe proof of Theorem~\\ref{thm5}\\ref{thm5-a} is complete.\n\n\\subsection{Proof of Theorem~\\ref{thm5}\\ref{thm5-b}}\nWe finally consider the case $q = \\pm \\ell$. By the symmetries \\eqref{distinvariance} and \\eqref{eq:averaged-spherical-function-symmetry}, we can restrict to $q = \\ell$. We have already shown the bound $\\varphi^{\\ell,\\ell}_{\\nu,\\ell}(g)\\ll_\\eps\\ell^{\\eps}$ in greater generality in Theorem~\\ref{thm6}. As a first step, we complement this with a stronger bound for $r \\geq 2$. To this end, we return to \\eqref{post-expansion}. As $q=\\ell$, the binomial coefficient and the $J$-factor disappear. When $\\overline{I}^{2\\ell}$ is expanded, we see a Laurent polynomial of $e^{2iu}$. When we integrate in $u$ from $0$ to $\\pi$, all the terms but the constant one vanish.\nWe calculate the constant term using the binomial theorem and the original product definition of $I$. This way we see that\n\\begin{align*}\n\\varphi_{\\nu,\\ell}^{ \\ell,\\ell}(g) = \\ & d_{\\ell} e^{2i\\ell(u_1-u_2-w_1+w_2)} r^{2\\ell}\n\\sum_{m=0}^{2\\ell}\\binom{2\\ell}{m}^2 (r^{-2}e^{2iu_2+2iw_1}\\cos v_1\\cos v_2)^m\\\\\n&(-\\sin v_1\\sin v_2)^{2\\ell-m}\n\\int_0^{\\pi\/2} (\\sin^2 v)^m (\\cos^2 v)^{2\\ell-m} \\frac{\\sin 2v}{h(r,v)^{\\ell+1-\\nu}}\\,\\dd v.\n\\end{align*}\nUsing the variable $x:=\\sin^2 v$, we rewrite this as\n\\begin{align*}\n\\varphi_{\\nu,\\ell}^{ \\ell,\\ell}(g) = \\ & d_{\\ell} e^{2i\\ell(u_1-u_2-w_1+w_2)} r^{2\\nu-2}\n\\sum_{m=0}^{2\\ell}\\binom{2\\ell}{m}^2\n(r^{-2}e^{2iu_2+2iw_1}\\cos v_1\\cos v_2)^m\\\\\n&(-\\sin v_1\\sin v_2)^{2\\ell-m}\\int_0^1 \\frac{x^m (1-x)^{2\\ell-m}}{(1-x+r^{-4}x)^{\\ell+1-\\nu}}\\,\\dd x.\n\\end{align*}\nWith the short-hand notation\n\\[U:=r^{-1}e^{iu_2+iw_1}\\sqrt{x\\cos v_1\\cos v_2}\\qquad\\text{and}\\qquad V:=i\\sqrt{(1-x)\\sin v_1\\sin v_2},\\]\nwe obtain finally\n\\begin{align}\\label{eq:phi-ell-ell-ell-bound}\n\\begin{split}\n\\bigl|\\varphi_{\\nu,\\ell}^{\\ell,\\ell}(g)\\bigr| \\leq &\\ \\frac{2\\ell+1}{r^2}\\left|\n\\int_0^1\\sum_{m=0}^{2\\ell}\\binom{2\\ell}{m}^2\\frac{U^{2m}V^{4\\ell-2m}}{(1-x+r^{-4}x)^{\\ell+1-\\nu}}\\,\\dd x \\right|\\\\[4pt]\n=&\\ \\frac{2\\ell+1}{r^2} \\left|\\int_0^1\\frac{1}{2\\pi}\\int_0^{2\\pi}\n\\frac{(Ue^{i\\phi}+V)^{2\\ell}(Ue^{-i\\phi}+V)^{2\\ell}}{(1-x+r^{-4}x)^{\\ell+1-\\nu}}\\,\\dd\\phi\\,\\dd x\\right|.\n\\end{split}\n\\end{align}\nUsing that $(Ue^{i\\phi}+V)(Ue^{-i\\phi}+V)=U^2+V^2+2UV\\cos\\phi$ is on the line segment connecting $(U+V)^2$ and $(U-V)^2$, we observe that\n\\[\\frac{|(Ue^{i\\phi}+V)(Ue^{-i\\phi}+V)|^2}{1-x+r^{-4}x}\\leq \\max_\\pm \\frac{|U\\pm V|^4}{1-x+r^{-4}x},\\]\nwhich by the Cauchy--Schwarz inequality can be further upper bounded by\n\\[\\leq\\frac{(1-x+r^{-2}x)^2}{1-x+r^{-4}x}=1-\\frac{x}{1+\\frac{2}{r^2-1}+\\frac{1}{\\left(r^2-1\\right)^2 (1-x)}}.\\]\nHence the contribution to the rightmost expression in \\eqref{eq:phi-ell-ell-ell-bound} of $x\\in[0,1]$ satisfying\n\\[x>\\delta\\left(1+\\frac{2}{r^2-1}+\\frac{1}{\\left(r^2-1\\right)^2 (1-x)}\\right),\\qquad\\delta:=\\frac{\\log\\ell}{\\ell},\\]\nis admissible for \\eqref{thm5boundq=ell}. By $r\\geq 2$, the remaining values $x\\in[0,1]$ satisfy\n\\[x<3\\delta\\qquad\\text{or}\\qquad x(1-x)<\\frac{3\\delta}{(r^2-1)^2},\\]\nhence also $x<3\\delta$ or $1-x<8\\delta\/r^4$. So the remaining contribution is\n\\[\\leq\\frac{2\\ell+1}{r^2}\\int_{[0,3\\delta)\\cup(1-8\\delta\/r^4,1]}\\frac{\\dd x}{1-x+r^{-4}x}\\ll\\frac{\\log\\ell}{r^2},\\]\nwhich is again admissible for \\eqref{thm5boundq=ell}.\n\nBy \\eqref{keyupperbound}, it remains to show that\n\\begin{equation}\\label{toprovedelta-a}\n\\dist(g, \\mcD) \\ll_\\Lambda\\| g \\|\\lambda\/\\sqrt{\\ell},\\qquad \\text{if $\\mcM\\neq\\emptyset$.}\n\\end{equation}\nIn the present case $q=\\ell$, the condition \\eqref{eq} simplifies to\n\\begin{equation}\\label{eqell}\n\\begin{split}\n2t\\sin 2v_1\\cos(\\phi+\\Delta)&=(1-t^2)\\cos 2v_1 + (1 + t^2)+\\OO_\\Lambda(\\lambda^2\/\\ell),\\\\\n2t\\sin 2v_2\\cos(\\phi-\\Delta)&=(t^2-1)\\cos 2v_2 - (1 + t^2)+\\OO_\\Lambda(\\lambda^2\/\\ell),\n\\end{split}\n\\end{equation}\nhence for the proof of \\eqref{toprovedelta-a} we can and we shall assume that $|v_1+v_2|\\leq\\pi\/2$. Indeed, replacing $v_1$ by $v_1+\\pi$ has the effect of replacing $g$ by $-g$ without altering $\\Delta$ or the statement \\eqref{toprovedelta-a}. We fix a pair $(\\phi,t)\\in\\mcM$.\n\nThe two equations in \\eqref{eqell} yield readily that\n\\[(\\sin 2v_j)^2 \\leq 2+2\\cos 2v_j\\ll_\\Lambda t^2+t|\\sin 2v_j|+\\lambda^2\/\\ell.\\]\nHence $\\sin 2v_j \\ll_\\Lambda t+\\lambda\/\\sqrt{\\ell}$, that is,\n\\begin{equation}\\label{pi-coset}\nv_1, v_2 \\in \\frac{\\pi}{2}\\ZZ +\\OO_\\Lambda\\left(t+\\frac{\\lambda}{\\sqrt{\\ell}}\\right).\n\\end{equation}\nCombining \\eqref{eqell} with the Cauchy--Schwarz inequality, we also get\n\\[ (1+t^2)^2+\\OO_\\Lambda(\\lambda^2\/\\ell)\\leq (1-t^2)^2+4t^2\\cos^2(\\phi\\pm\\Delta).\\]\nEquivalently,\n\\[\\sin(\\phi\\pm\\Delta)\\ll_\\Lambda \\frac{\\lambda}{t\\sqrt{\\ell}}.\\]\nUsing also our initial assumption $|\\Delta|\\leq\\pi\/4$, we conclude that\n\\begin{equation}\\label{cos-ess-1}\n\\Delta\\ll_\\Lambda\\frac{\\lambda}{t\\sqrt{\\ell}}\\qquad\\text{and}\n\\qquad\\phi\\in\\pi\\ZZ+\\OO_\\Lambda\\left(\\frac{\\lambda}{t\\sqrt{\\ell}}\\right).\n\\end{equation}\nIn particular, $\\cos(\\phi\\pm\\Delta)=\\epsilon+\\OO_\\Lambda(\\lambda^2\/t^2\\ell)$ for some $\\epsilon\\in\\{\\pm 1\\}$. Plugging this back to \\eqref{eqell}, and using also \\eqref{pi-coset} along with\n\\[t \\left(t+\\frac{\\lambda}{\\sqrt{\\ell}}\\right) \\min\\left(1, \\frac{\\lambda^2}{t^2\\ell}\\right) \\ll \\frac{\\lambda^2}{\\ell},\\]\nwe obtain\n\\begin{equation}\\label{eqell-rewrite}\n\\begin{split}\n2t\\epsilon\\sin 2v_1&=(1-t^2)\\cos 2v_1 + (1 + t^2)+\\OO_\\Lambda(\\lambda^2\/\\ell),\\\\\n2t\\epsilon\\sin 2v_2&=(t^2-1)\\cos 2v_2 - (1 + t^2)+\\OO_\\Lambda(\\lambda^2\/\\ell).\n\\end{split}\n\\end{equation}\nNow consider the following three unit vectors in $\\RR^2$:\n\\[\\mbv_1:=(\\cos 2v_1,\\sin 2v_1),\\qquad \\mbv_2:=(\\cos 2v_2,-\\sin 2v_2),\\qquad\n\\mbt:=\\left(\\frac{t^2-1}{t^2+1},\\frac{2t\\epsilon}{t^2+1}\\right).\\]\nBy \\eqref{eqell-rewrite}, the scalar products $\\mbv_j\\mbt$ are $1+\\OO_\\Lambda(\\lambda^2\/\\ell)$, hence the directed angles $\\arg(\\mbv_j)-\\arg(\\mbt)$ lie in $2\\pi\\ZZ+\\OO_\\Lambda(\\lambda\/\\sqrt{\\ell})$. It follows that\n\\[\\arg(\\mbv_1)-\\arg(\\mbv_2)\\in2\\pi\\ZZ+\\OO_\\Lambda(\\lambda\/\\sqrt{\\ell}),\\]\nand then the assumption $|v_1+v_2|\\leq\\pi\/2$ forces that\n\\begin{equation}\\label{eps}\nv_1+v_2\\ll_\\Lambda\\lambda\/\\sqrt{\\ell}.\n\\end{equation}\n\nWe are now ready to complete the proof of Theorem~\\ref{thm5}\\ref{thm5-b}. By \\eqref{pi-coset} and \\eqref{eps}, there exists a multiple $v$ of $\\pi\/2$ such that\n\\begin{align*}\nm[v_1]&=m[v]+\\OO_\\Lambda\\bigl(t+\\lambda\/\\sqrt{\\ell}\\bigr),\\\\\nm[v_2]&=m[-v]+\\OO_\\Lambda\\bigl(t+\\lambda\/\\sqrt{\\ell}\\bigr),\\\\\nm[v_1+v_2]&=\\id+\\OO_\\Lambda\\bigl(\\lambda\/\\sqrt{\\ell}\\bigr).\n\\end{align*}\nTherefore, using also \\eqref{r1} and \\eqref{cos-ess-1}, we conclude that\n\\begin{align*}\n&m[v_1]\\diag\\left(re^{i\\Delta},r^{-1}e^{-\\Delta}\\right)m[v_2]\\\\\n&=m[v_1+v_2]+m[v_1]\\diag\\left(re^{i\\Delta}-1,r^{-1}e^{-i\\Delta}-1\\right)m[v_2]\\\\\n&=m[v_1+v_2]+m[v]\\diag\\left(re^{i\\Delta}-1,r^{-1}e^{-i\\Delta}-1\\right)m[-v]\n+\\OO_\\Lambda\\bigl(r\\lambda\/\\sqrt{\\ell}\\bigr)\\\\\n&=m[v]\\diag\\left(re^{i\\Delta},r^{-1}e^{-i\\Delta}\\right)m[-v]\n+\\OO_\\Lambda\\bigl(r\\lambda\/\\sqrt{\\ell}\\bigr).\n\\end{align*}\nThe main term $m[v]\\diag\\left(re^{i\\Delta},r^{-1}e^{-i\\Delta}\\right)m[-v]$ lies in $\\mcD$, hence \\eqref{toprovedelta-a} follows.\n\nThe proof of Theorem~\\ref{thm5}\\ref{thm5-b} is complete.\n\n\\section{Proof of Theorem~\\ref{thm1}}\\label{thm1-proof-sec}\nIn this section, we prove Theorem~\\ref{thm1}. Lemma~\\ref{APTI-done-lemma}, which results from the amplified pre-trace inequality and estimates on the spherical trace function, proves an estimate on $|\\Phi(g)|^2$ for $g\\in\\Omega$ in terms of the Diophantine counts $M(g,L,\\mcL,\\vec{\\delta})$. We begin with the key remaining step of estimating these counts.\n\nWe allow all implied constants within this section to depend on $\\Omega$, and we drop the subscript from notation. Moreover, we adopt the notation $A\\preccurlyeq B$ to mean that $|A|\\ll_{\\eps}\\ell^\\eps L^\\eps B$, where $\\eps>0$ is fixed but may be taken as small as desired at each step, and the implied constant is allowed to depend on $\\eps$. \n\nFor each $\\mcL\\in\\{1,L^2,L^4\\}$ and $\\vec{\\delta}=(\\delta_1,\\delta_2)$ with $0<\\delta_1,\\delta_2\\leq\\ell^\\eps$, we will estimate the count $M(g,L,\\mcL,\\vec{\\delta})$ of matrices\n\\begin{align}\\label{detgamma}\n\\begin{aligned}\n&\\gamma=\\begin{pmatrix}a&b\\\\c&d\\end{pmatrix}\\in\\MM_2(\\ZZ[i]),\n\\qquad&&\\det\\gamma=n\\in D(L,\\mcL),\\qquad |n|\\asymp\\mcL^{1\/2},\\\\\n&g^{-1}\\tilde{\\gamma}g=k\\begin{pmatrix} z&u\\\\&z^{-1}\\end{pmatrix}k^{-1}\n&&\\text{for some $k\\in K$ such that}\\\\\n&&&\\text{$|z|\\geq 1$, $\\min|z\\pm 1|\\leq\\delta_1$, $|u|\\leq\\delta_2$,}\n\\end{aligned}\n\\end{align}\nwhere as before $\\tilde{\\gamma} = \\gamma\/\\sqrt{n}$. By the symmetry $\\gamma\\leftrightarrow -\\gamma$, we can and we shall assume that $|z-1|\\leq|z+1|$. Then the conditions imply that both $|z-1|$ and $|z^{-1}-1|$ are at most $\\delta_1$, hence\n\\[\\left|\\frac{a+d}{\\sqrt{n}}-2\\right|=|\\tr\\tilde\\gamma-2|=|z+z^{-1}-2|=|z-1||z^{-1}-1|\\leq\\delta_1^2.\\]\nOn the other hand, since $\\|g\\|\\asymp_{\\Omega}1$, we also have that\n\\[ \\|\\tilde{\\gamma}-\\id\\|=\\left\\|gk\\begin{pmatrix}z-1&u\\\\&z^{-1}-1\\end{pmatrix}k^{-1}g^{-1}\\right\\|\n\\ll\\delta_1+\\delta_2. \\]\nSummarizing, we need to estimate the number of matrices $\\gamma$ as in \\eqref{detgamma} such that\n\\begin{equation}\\label{abcd-conditions}\n\\left|a+d-2\\sqrt{n}\\right|\\leq\\delta_1^2\\sqrt{|n|},\\qquad |a-d|,|b|,|c|\\ll(\\delta_1+\\delta_2)\\sqrt{|n|}.\n\\end{equation}\nIn particular, we have $|a+d|\\preccurlyeq\\sqrt{|n|}$ and\n\\begin{equation}\\label{trace-cor}\n(a-d)^2+4bc=(a+d)^2-4n\\preccurlyeq\\delta_1^2|n|.\n\\end{equation}\n\nAs is often the case, parabolic matrices $\\gamma$ (those with trace $\\pm 2\\sqrt{n}$) play a distinctive role in this counting problem, and we split the count accordingly into the parabolic and non-parabolic subcounts as\n\\[ M(g,L,\\mcL,\\vec{\\delta})=M^{\\pp}(g,L,\\mcL,\\vec{\\delta})+M^{\\np}(g,L,\\mcL,\\vec{\\delta}). \\]\nWe shall prove the following result using \\eqref{detgamma}, \\eqref{abcd-conditions}, and \\eqref{trace-cor}.\n\n\\begin{lemma}\\label{counting-for-thm1}\nLet $\\Omega\\subset G$ be a compact subset, $L\\geq 1$, and $\\mcL\\in\\{1,L^2,L^4\\}$. For $g\\in\\Omega$ and $\\vec{\\delta}=(\\delta_1,\\delta_2)$ with $0<\\delta_1,\\delta_2\\preccurlyeq 1$, we have the following bounds.\n\\begin{align}\n\\label{Mbound1}M(g,L,1,\\vec{\\delta})&\\preccurlyeq_{\\Omega}1,\\\\\n\\label{Mbound2}M^{\\pp}(g,L,\\mcL,\\vec{\\delta})&\\preccurlyeq_{\\Omega} \\mcL^{1\/2}+\\mcL\\delta_2^2,\\\\\n\\label{Mbound3}M^{\\np}(g,L,L^2,\\vec{\\delta})&\\preccurlyeq_{\\Omega} L^4\\delta_1^4(\\delta_1^2+\\delta_2^2),\\\\\n\\label{Mbound4}M^{\\np}(g,L,L^4,\\vec{\\delta})&\\preccurlyeq_{\\Omega} L^6\\delta_1^4(\\delta_1^2+\\delta_2^2).\n\\end{align}\nMoreover,\n\\begin{equation}\\label{otherwise-vanishes}\nM^{\\np}(g,L,\\mcL,\\vec{\\delta})=0\\qquad\\text{unless}\\qquad\\delta_1\\succcurlyeq\\mcL^{-1\/4}.\n\\end{equation}\n\\end{lemma}\n\n\\begin{proof}\nThe bound \\eqref{Mbound1} is immediate from \\eqref{abcd-conditions}. We turn to the bound \\eqref{Mbound2}, which counts parabolic matrices $\\gamma$. In this case, we have $(a-d)^2+4bc=0$ and $z=1$, hence in particular \\eqref{abcd-conditions} holds with $0$ in place of $\\delta_1$. If $bc\\neq 0$, then there are $\\ll\\mcL^{1\/2}$ choices for $a+d=2\\sqrt{n}$, and $\\ll\\mcL^{1\/2}\\delta_2^2$ choices for $a-d\\neq 0$. The difference $a-d$ determines the product $bc$ uniquely, hence by the divisor bound, there are $\\preccurlyeq 1$ choices for $(b,c)$. This is admissible for \\eqref{Mbound2}. If $bc=0$, then there are $\\ll\\mcL^{1\/2}$ choices for $a=d=\\sqrt{n}$, and $\\ll 1+\\mcL^{1\/2}\\delta_2^2$ choices for $(b,c)$. This is again admissible for \\eqref{Mbound2}.\n\nFrom now on we count non-parabolic matrices $\\gamma$, in which case $(a-d)^2+4bc\\neq 0$.\nThe statement \\eqref{otherwise-vanishes} is immediate from \\eqref{trace-cor}, so we are left with proving \\eqref{Mbound3} and \\eqref{Mbound4}. If $bc\\neq 0$, then there are $\\preccurlyeq\\mcL^{1\/2}$ choices for $a+d$, and $\\ll 1+\\mcL^{1\/2}(\\delta_1^2+\\delta_2^2)$ choices for $a-d$. For given $a-d$, there are $\\preccurlyeq 1+\\mcL\\delta_1^4$ choices for $(b,c)$ by \\eqref{trace-cor} and the divisor bound. This is admissible for \\eqref{Mbound3} in the light of \\eqref{otherwise-vanishes}.\nIf $bc=0$, then there are $\\preccurlyeq\\mcL^{1\/2}$ choices for $a+d$, $\\preccurlyeq\\mcL^{1\/2}\\delta_1^2$ choices for $a-d\\neq 0$ by \\eqref{trace-cor}, and $\\ll 1+\\mcL^{1\/2}(\\delta_1^2+\\delta_2^2)$ choices for $(b,c)$. This is again admissible for \\eqref{Mbound3} in the light of \\eqref{otherwise-vanishes}. In the high range $\\mcL=L^4$, this argument gives the bound\n\\[M^{\\np}(g,L,L^4,\\vec{\\delta})\\preccurlyeq_{\\Omega} L^8\\delta_1^4(\\delta_1^2+\\delta_2^2),\\]\nwhich is weaker than \\eqref{Mbound4} by a factor of $L^2$. However, we can save a factor of $L^2=\\mcL^{1\/2}$ as follows. In the high range, $n=l_1^2l_2^2$ is a square, and $(a-d)^2+4bc\\neq 0$ factors as $(a+d+2l_1l_2)(a+d-2l_1l_2)$. Hence the triple $(a-d,b,c)$ determines $a+d$ up to $\\preccurlyeq 1$ possibilities by the divisor bound, while earlier we considered $\\preccurlyeq\\mcL^{1\/2}$ possibilities for $a+d$.\n\\end{proof}\n\nCombining Lemmata~\\ref{APTI-done-lemma} and \\ref{counting-for-thm1}, we obtain that\n\\[\\sum_{\\phi\\in\\mfB}|\\phi(g)|^2\\preccurlyeq_{I,\\Omega}\\ell^3\n\\left(\\frac1L+S^{\\pp}(L)+S^{\\np}(L,L^2)+S^{\\np}(L,L^4)\\right)+L^{2}\\ell^{-48},\\]\nwhere\n\\begin{alignat*}{3}\nS^{\\pp}(L)&:=\\sum_{\\substack{\\vec{\\delta}\\text{ dyadic}\\\\1\/\\sqrt{\\ell}\\leq\\delta_j\\preccurlyeq 1}}\\frac1{\\sqrt{\\ell}\\delta_2}\\left(\\frac{L+L^2\\delta_2^2}{L^3}+\\frac{L^2+L^4\\delta_2^2}{L^4}\\right)&&\\preccurlyeq\\frac1{L^2}+\\frac1{\\sqrt{\\ell}},\\\\\nS^{\\np}(L,L^2)&:=\\sum_{\\substack{\\vec{\\delta}\\text{ dyadic}\\\\1\/\\sqrt{\\ell}\\leq\\delta_j\\preccurlyeq 1}}\n\\frac1{\\ell\\delta_1^2}\\cdot\\frac{L^4\\delta_1^4(\\delta_1^2+\\delta_2^2)}{L^3}&&\\preccurlyeq\\frac{L}{\\ell},\\\\\nS^{\\np}(L,L^4)&:=\\sum_{\\substack{\\vec{\\delta}\\text{ dyadic}\\\\1\/\\sqrt{\\ell}\\leq\\delta_j\\preccurlyeq 1}}\\frac1{\\ell\\delta_1^2}\\cdot\\frac{L^6\\delta_1^4(\\delta_1^2+\\delta_2^2)}{L^4}&&\\preccurlyeq\\frac{L^2}{\\ell}.\n\\end{alignat*}\nPutting everything together, we conclude that\n\\[\\sum_{\\phi\\in\\mfB}|\\phi(g)|^2\\preccurlyeq_{I,\\Omega}\\ell^3\n\\left(\\frac1L+\\frac1{\\sqrt{\\ell}}+\\frac{L^2}{\\ell}\\right)+L^2\\ell^{-48}\\ll\\ell^{8\/3}, \\]\nby making the essentially optimal choice $L:=7\\ell^{1\/3}$ (which satisfies our earlier\ncondition $L\\geq 7$).\n\nThe proof of Theorem~\\ref{thm1} is complete.\n\n\\section{Proof of Theorem~\\ref{thm3}}\\label{thm2proof-sec}\nIn this section, we prove Theorem~\\ref{thm3}. For $q= 0$, Lemma~\\ref{APTI-done-lemma-single-form} provides an estimate on $|\\phi_q(g)|^2$ for $g\\in\\Omega$ in terms of the Diophantine count $M_0^{\\ast}(g,L,\\mcL,\\delta)$, while for $q = \\pm \\ell$ we need to analyze $Q(g, L, H_1,H_2)$ as follows from Lemma~\\ref{q=ell-case}. We begin by estimating these counts. We keep the notational conventions from \\S\\ref{thm1-proof-sec}.\n\n\\subsection{A comparison lemma}\nThe Diophantine counts in Lemmata~\\ref{APTI-done-lemma-single-form} and \\ref{q=ell-case} involve the positioning relative to certain special sets of the matrix $g^{-1}\\tilde{\\gamma}g$, which we now explicate in preparation for a counting argument. Using $g\\in\\Omega$, we may write explicitly\n\\[ g=\\begin{pmatrix} g_1&g_2\\\\g_3&g_4\\end{pmatrix},\\qquad g_j\\ll 1. \\]\nAn explicit calculation shows that\n\\[ g^{-1}\\begin{pmatrix} a&b\\\\c&d\\end{pmatrix}g=\\begin{pmatrix}\\frac{a+d}{2}+L_1&L_2\\\\L_3&\\frac{a+d}{2}-L_1\\end{pmatrix}, \\]\nwhere\n\\begin{equation}\\label{coordinates}\n\\begin{alignedat}{7}\nL_1&=\\hphantom{-}(a-d)\\big(\\tfrac12+g_2g_3\\big)&&+bg_3g_4&&-cg_1g_2, \\\\\nL_2&=\\hphantom{-}(a-d)g_2g_4&&+bg_4^2&&-cg_2^2,\\\\\nL_3&=-(a-d)g_1g_3&&-bg_3^2&&+cg_1^2.\n\\end{alignedat}\n\\end{equation}\nWe record the following simple but effective result, which will be used in both parts of Theorem~\\ref{thm3}.\n\n\\begin{lemma}\\label{l2l3-small}\nLet $\\Omega\\subset G$ be a compact subset, and $g\\in\\Omega$. Let $a,b,c,d\\in\\CC$ and $\\Delta>0$ be such that\n$L_2,L_3\\ll\\Delta$.\n\\begin{enumerate}[(a)]\n\\item\\label{1213-a}\nFor at least one $s\\in\\{a-d,b,c\\}$, we have\n\\[\\begin{bmatrix} a-d&b&c\\end{bmatrix}^{\\top}\n=\\begin{bmatrix}\\lambda_1&\\lambda_2&\\lambda_3\\end{bmatrix}^{\\top}s+\\OO(\\Delta)\\]\nwith $\\lambda_1,\\lambda_2,\\lambda_3\\ll 1$ depending only on $g$.\n\\item\\label{1213-b}\nFor the same choice of $s\\in\\{a-d,b,c\\}$, we have\n\\[ (a-d)^2+4bc=\\mu s^2+\\OO(\\Delta |s|+\\Delta^2), \\]\nwith $\\mu=\\lambda_1^2+4\\lambda_2\\lambda_3\\gg 1$. If additionally $(a-d)^2+4bc=0$, then $a-d,b,c\\ll\\Delta$.\n\\end{enumerate}\n\\end{lemma}\n\n\\begin{proof}\nWe may write the defining equations for $L_2$ and $L_3$ as $\\begin{bmatrix} L_2&L_3\\end{bmatrix}^{\\top}=M\\begin{bmatrix} a-d&b&c\\end{bmatrix}^{\\top}$ for a $2\\times 3$ matrix $M$ whose $2\\times 2$ minors we compute to be\n\\[ \\begin{vmatrix}g_4^2&-g_2^2\\\\-g_3^2&g_1^2\\end{vmatrix}=g_1g_4+g_2g_3,\\quad \\begin{vmatrix} g_2g_4&-g_2^2\\\\-g_1g_3&g_1^2\\end{vmatrix}=g_1g_2,\\quad \\begin{vmatrix} g_2g_4&g_4^2\\\\-g_1g_3&-g_3^2\\end{vmatrix}=g_3g_4. \\]\nAt least one of these minors exceeds $1\/3$ in absolute value, since\n\\[(g_1g_4+g_2g_3)^2-4g_1g_2g_3g_4=1.\\]\nConsider the case when $|g_1g_4+g_2g_3|>1\/3$. Then we may solve the latter two equations in \\eqref{coordinates} for $b$, $c$, which yields\n\\[ \\begin{bmatrix} b\\\\c\\end{bmatrix}=\\begin{bmatrix}-g_1g_2\\\\g_3g_4\\end{bmatrix}\\frac{a-d}{g_1g_4+g_2g_3}+\\OO(\\Delta).\\]\nThis settles the first claim in the lemma with $s=a-d$. The second claim follows from\n\\[ (a-d)^2+4bc=\\frac{(a-d)^2}{(g_1g_4+g_2g_3)^2}+\\OO\\big(\\Delta|a-d|+\\Delta^2\\big). \\]\nThe other cases (of which it suffices to consider one) are similar. For example, under $|g_1g_2|>1\/3$ we have\n\\[ \\begin{bmatrix}a-d\\\\c\\end{bmatrix}=\\begin{bmatrix}-g_1g_4-g_2g_3\\\\-g_3g_4\\end{bmatrix}\\frac{b}{g_1g_2}+\\OO(\\Delta),\\quad (a-d)^2+4bc=\\frac{b^2}{(g_1g_2)^2}+\\OO\\big(\\Delta|b|+\\Delta^2\\big), \\]\nfrom which the lemma follows.\n\\end{proof}\n\n\\subsection{Second moment count for $q=\\pm\\ell$}\nWe will now establish an upper bound for the quantity $Q(g,L, H_1, H_2)$ counting pairs of matrices $(\\gamma_1,\\gamma_2)$ such that\n\\begin{equation}\\label{thm2a-KS-conditions}\n\\begin{gathered}\n\\gamma_j=\\begin{pmatrix} a_j&b_j\\\\c_j&d_j\\end{pmatrix}\\in\\MM_2(\\ZZ[i]),\n\\qquad \\det\\gamma_1=\\det\\gamma_2=n,\\qquad L \\leq |n|\\leq 2 L,\\\\\n\\|g^{-1}\\tilde{\\gamma}_jg\\|\\leq\\sqrt{\\frac{H_j}{L}},\\qquad\n\\dist(g^{-1}\\tilde{\\gamma}_jg,\\mcD)\\ll\\sqrt{\\frac{H_j\\log\\ell}{L\\ell}}.\n\\end{gathered}\n\\end{equation}\nWe denote the quantities in \\eqref{coordinates} corresponding to $\\gamma_j$ as\n$L_{1j}$, $L_{2j}$, $L_{3j}$. From \\eqref{coordinates} and \\eqref{thm2a-KS-conditions} we deduce that\n\\begin{equation}\\label{2a-KS-immediate}\n\\|\\gamma_j\\|\\ll\\sqrt{H_j},\\qquad L_{2j},L_{3j}\\preccurlyeq\\sqrt{H_j\/\\ell},\n\\end{equation}\nand\n\\begin{equation}\\label{det-cond}\n(a_1+d_1)^2-(a_2+d_2)^2=(a_1-d_1)^2+4b_1c_1-(a_2-d_2)^2-4b_2c_2.\n\\end{equation}\nWe shall prove the following result using \\eqref{thm2a-KS-conditions}, \\eqref{2a-KS-immediate}, and \\eqref{det-cond}.\n\n\\begin{lemma}\\label{lemma-ell-count}\nLet $\\Omega\\subset G$ be a compact subset and $L\\geq 1$. For $g\\in\\Omega$ and\n$1\\leq H_1, H_2\\preccurlyeq\\ell$, we have\n\\begin{equation}\\label{Qbound}\nQ(g,L,H_1, H_2)\\preccurlyeq_\\Omega H_1H_2.\n\\end{equation}\n\\end{lemma}\n\n\\begin{proof} We shall use that the entries $a_j,b_j,c_j,d_j\\in\\ZZ[i]$ of each participating $\\gamma_j$ satisfy the conditions of Lemma~\\ref{l2l3-small} with $\\Delta_j\\preccurlyeq 1$ in the role of $\\Delta$. Indeed, this follows from \\eqref{2a-KS-immediate} and $H_1, H_2\\preccurlyeq\\ell$.\n\nLet $s_j\\in\\{a_j-d_j,b_j,c_j\\}$ be as in Lemma~\\ref{l2l3-small}\\ref{1213-a}. By Lemma~\\ref{l2l3-small}\\ref{1213-a} and \\eqref{2a-KS-immediate}, for a given pair $(s_1,s_2)$, there are $\\preccurlyeq 1$ choices for the two triples $(a_j-d_j,b_j,c_j)$, which then determine both sides of \\eqref{det-cond}. Using this preliminary observation, we do the counting in two steps.\n\nFirst we count $(\\gamma_1,\\gamma_2)$ satisfying \\eqref{thm2a-KS-conditions} and $(a_1+d_1)^2\\neq(a_2+d_2)^2$. By \\eqref{2a-KS-immediate}, there are $\\ll H_1H_2$ choices for the pair $(s_1, s_2)$, hence $\\preccurlyeq H_1H_2$ choices for the two triples $(a_j-d_j,b_j,c_j)$. Given the triples, by \\eqref{2a-KS-immediate}--\\eqref{det-cond} and the divisor bound, there are $\\preccurlyeq 1$ choices for $(a_1+d_1,a_2+d_2)$. This is admissible for \\eqref{Qbound}.\n\nNow we count $(\\gamma_1,\\gamma_2)$ satisfying \\eqref{thm2a-KS-conditions} and $(a_1+d_1)^2=(a_2+d_2)^2$.\nIn this case, Lemma~\\ref{l2l3-small}\\ref{1213-b} coupled with \\eqref{2a-KS-immediate}--\\eqref{det-cond} shows that\n$s_1^2-s_2^2\\preccurlyeq\\sqrt{H_1}+\\sqrt{H_2}$. Hence, by the divisor bound (separating the case when $s_1^2=s_2^2$), there are $\\preccurlyeq\\max(H_1,H_2)$ choices for the pair $(s_1, s_2)$ and same for the two triples $(a_j-d_j,b_j,c_j)$. Independently of the triples, by \\eqref{2a-KS-immediate}, there are $\\ll\\min(H_1,H_2)$ choices for $(a_1+d_1,a_2+d_2)$. This is again admissible for \\eqref{Qbound}.\n\\end{proof}\n\n\\subsection{Interlude: a first moment count}\\label{thm2a-first-moment-sec}\nFor the proof of Theorem~\\ref{thm2} in \\S \\ref{sec-proof2} below, we need a variation of the previous Diophantine argument that is most conveniently stated and proved at this point. \nFor $\\mcL\\in\\{1,L^2,L^4\\}$ and every $0<\\delta\\preccurlyeq 1$, we will establish an upper bound on the quantity\n\\begin{equation}\\label{thm2a-conditions}\nM_\\mcD(g,L,\\mcL,\\eps,\\delta):=\\sum_{n\\in D(L,\\mcL)}\n\\#\\left\\{\\gamma\\in\\Gamma_n:\\|g^{-1}\\tilde\\gamma g\\|\\ll\\ell^{\\eps},\\,\\,\\dist(g^{-1}\\tilde\\gamma g,\\mcD)\\leq\\delta\\right\\},\n\\end{equation}\nwhere the implied constant is absolute. As before, we conclude from the conditions in \\eqref{thm2a-conditions} and the explicit description in \\eqref{coordinates} that\n\\begin{equation}\\label{coeff-bound-2a_l2l3-delta0}\n\\|\\gamma\\|\\preccurlyeq\\mcL^{1\/4}\\qquad\\text{and}\\qquad L_2,L_3\\ll\\mcL^{1\/4}\\delta.\n\\end{equation}\nWe shall prove the following result using \\eqref{coeff-bound-2a_l2l3-delta0} and the identity\n\\begin{equation}\\label{parabolicidentity}\n(a-d)^2+4bc=(a+d)^2-4n.\n\\end{equation}\n\n\\begin{lemma}\\label{first-moment-count-lemma}\nLet $\\Omega\\subset G$ be a compact subset, $L\\geq 1$, and $\\eps>0$. For $g\\in\\Omega$ and $0<\\delta\\preccurlyeq 1$, we have the following bounds.\n\\begin{align}\n\\label{Nbound1}M_{\\mcD}(g,L,1,\\eps,\\delta)&\\preccurlyeq_{\\Omega} 1,\\\\\n\\label{Nbound2}M_{\\mcD}(g,L,L^2,\\eps,\\delta)&\\preccurlyeq_{\\Omega} L^2+L^4\\delta^4,\\\\\n\\label{Nbound3}M_{\\mcD}(g,L,L^4,\\eps,\\delta)&\\preccurlyeq_{\\Omega} L^2+L^6\\delta^4.\n\\end{align}\n\\end{lemma}\n\n\\begin{proof}\nThe bound \\eqref{Nbound1} corresponds to $\\mcL=1$, and it is immediate from \\eqref{coeff-bound-2a_l2l3-delta0}. Hence we focus on the bounds \\eqref{Nbound2}--\\eqref{Nbound3} that correspond to $\\mcL\\in\\{L^2,L^4\\}$. We shall use that the entries $a,b,c,d\\in\\ZZ[i]$ of each participating $\\gamma$ satisfy the conditions of Lemma~\\ref{l2l3-small} with $\\Delta=\\mcL^{1\/4}\\delta$, as follows from \\eqref{coeff-bound-2a_l2l3-delta0}.\n\nFirst we count parabolic matrices $\\gamma$. In this case, we have $(a-d)^2+4bc=0$, hence also $a-d,b,c\\ll\\mcL^{1\/4}\\delta$ by Lemma~\\ref{l2l3-small}\\ref{1213-b}. If $bc\\neq 0$, then there are $\\ll\\mcL^{1\/2}$ choices for $a+d=\\pm 2\\sqrt{n}$, and $\\ll\\mcL^{1\/2}\\delta^2$ choices for $a-d\\neq 0$. The difference $a-d$ determines the product $bc$ uniquely, hence by the divisor bound, there are $\\preccurlyeq 1$ choices for $(b,c)$. This is admissible for \\eqref{Nbound2}--\\eqref{Nbound3}. If $bc=0$, then there are $\\ll\\mcL^{1\/2}$ choices for $a=d=\\pm\\sqrt{n}$, and $\\ll 1+\\mcL^{1\/2}\\delta^2$ choices for $(b,c)$. This is again admissible for \\eqref{Nbound2}--\\eqref{Nbound3}.\n\nNow we count non-parabolic matrices $\\gamma$, in which case $(a-d)^2+4bc\\neq 0$. Let $s\\in\\{a-d,b,c\\}$ be as in Lemma~\\ref{l2l3-small}\\ref{1213-a}. There are $\\preccurlyeq\\mcL^{1\/2}$ choices both for $s$ and for $a+d$. For a given $s$, by Lemma~\\ref{l2l3-small}\\ref{1213-a}, there are $\\ll 1+\\mcL\\delta^4$ choices for the triple $(a-d,b,c)$. This is admissible for \\eqref{Nbound2}. In the high range $\\mcL=L^4$, this argument gives the bound $\\preccurlyeq L^4+L^8\\delta^4$ for the relevant count, which is weaker than \\eqref{Nbound3} by a factor of $L^2$. However, we can save a factor of $L^2=\\mcL^{1\/2}$ as follows. In the high range, $n=l_1^2l_2^2$ is a square, and $(a-d)^2+4bc\\neq 0$ factors as $(a+d+2l_1l_2)(a+d-2l_1l_2)$. Hence the triple $(a-d,b,c)$ determines $a+d$ up to $\\preccurlyeq 1$ possibilities by the divisor bound, while earlier we considered $\\preccurlyeq\\mcL^{1\/2}$ possibilities for $a+d$.\n\\end{proof}\n\n\\subsection{Counting setup for $q=0$}\nFor each $\\mcL\\in\\{1,L^2,L^4\\}$ and $0<\\delta\\preccurlyeq 1$, we will establish an upper bound on the quantity $M_0^{\\ast}(g,L,\\mcL,\\delta)$ consisting of matrices\n\\begin{equation}\\label{thm2b-conditions}\n\\begin{gathered}\n\\gamma=\\begin{pmatrix}a&b\\\\c&d\\end{pmatrix}\\in\\MM_2(\\ZZ[i]),\n\\qquad\\det\\gamma=n\\in D(L,\\mcL),\\qquad |n|\\asymp\\mcL^{1\/2}\\\\\n\\dist(g^{-1}\\tilde{\\gamma}g,\\mcS)\\leq\\delta,\\qquad\\frac{D(g^{-1}\\tilde\\gamma g)}{\\|g^{-1}\\tilde\\gamma g\\|^2}\\ll\\frac{\\log\\ell}{\\sqrt{\\ell}}.\n\\end{gathered}\n\\end{equation}\nFrom the first distance condition in \\eqref{thm2b-conditions} we conclude that\n\\begin{equation}\\label{coeff-bound}\na,b,c,d\\preccurlyeq\\mcL^{1\/4}.\n\\end{equation}\nUsing the description in \\eqref{coordinates}, the distance conditions in \\eqref{thm2b-conditions} imply that\n\\begin{gather}\n\\label{cond1} \\left\\{\\begin{aligned} &L_2,L_3\\ll\\delta\\sqrt{|n|}\\\\ &\\left|\\tfrac{a+d}{2}\\pm L_1\\right|=(1+\\OO(\\delta))\\sqrt{|n|}\\end{aligned}\\right. \\qquad\\text{or}\\qquad\n\\left\\{\\begin{aligned} &a+d,L_1\\ll\\delta\\sqrt{|n|}\\\\ &|L_2|,|L_3|=(1+\\OO(\\delta))\\sqrt{|n|};\\end{aligned}\\right.\\\\\n\\label{cond0} \\left|\\tfrac{a+d}{2}+L_1\\right|^2-\\left|\\tfrac{a+d}{2}-L_1\\right|^2\n\\preccurlyeq\\sqrt{\\mcL\/\\ell}\\qquad\\text{and}\\qquad|L_2|^2-|L_3|^2\\preccurlyeq\\sqrt{\\mcL\/\\ell}.\n\\end{gather}\nAs in \\S\\ref{thm1-proof-sec}, we split the count into the parabolic and non-parabolic subcounts as\n\\[ M_0^{\\ast}(g,L,\\mcL,\\delta)=M_0^{\\ast\\pp}(g,L,\\mcL,\\delta)+M_0^{\\ast\\np}(g,L,\\mcL,\\delta). \\]\nWe shall prove the following result using \\eqref{thm2b-conditions}--\\eqref{cond0} and \\eqref{parabolicidentity}.\n\n\\begin{lemma}\\label{counting-for-thm2}\nLet $\\Omega\\subset G$ be a compact subset, $L\\geq 1$, and $\\mcL\\in\\{L^2,L^4\\}$. For $g\\in\\Omega$ and $0<\\delta\\preccurlyeq 1$, we have the following bounds.\n\\begin{align}\n\\label{Rbound1} M_0^{\\ast}(g,L,1,\\delta)&\\preccurlyeq_{\\Omega} 1,\\\\\n\\label{Rbound2} M_0^{\\ast\\pp}(g,L,\\mcL,\\delta)&\\preccurlyeq_{\\Omega}\\mcL^{1\/2}+\\mcL\\delta^2,\\\\\n\\label{Rbound3} M_0^{\\ast}(g,L,L^2,\\delta)&\\preccurlyeq_{\\Omega} L^{3\/2}+L^3\\delta^3+\\frac{L^2+L^{7\/2}\\delta^2}{\\sqrt{\\ell}}+\\frac{L^4\\delta^2}{\\ell},\\\\[4pt]\n\\label{Rbound4} M_0^{\\ast\\np}(g,L,L^4,\\delta)&\\preccurlyeq_{\\Omega} L^3+L^5\\delta^2+\\frac{L^4+L^6\\delta^2}{\\sqrt{\\ell}}.\n\\end{align}\n\\end{lemma}\n\n\\begin{proof}\nThe bound \\eqref{Rbound1} is immediate from \\eqref{coeff-bound}. For the proof of \\eqref{Rbound2}, we observe that, in the parabolic case, \\eqref{cond1} implies $L_2,L_3\\ll\\mcL^{1\/4}\\delta$. Indeed, this is clear when the first half of \\eqref{cond1} holds. Otherwise, the conditions $a+d=\\pm 2\\sqrt{n}$ and $a+d\\ll\\delta\\sqrt{|n|}$ force $\\delta\\gg 1$, so the claimed bound is clear again. Applying Lemma~\\ref{l2l3-small}\\ref{1213-b}, we infer that $a-d,b,c\\ll\\mcL^{1\/4}\\delta$ holds in the parabolic case. From here \\eqref{Rbound2} follows readily, as in the second paragraph of the proof of Lemma~\\ref{first-moment-count-lemma}. Finally, we shall prove \\eqref{Rbound3} and \\eqref{Rbound4} in the next two subsections.\n\\end{proof}\n\n\\subsection{Volume argument}\\label{subsec:volume-argument}\nHere, we present a volume argument that we will use repeatedly to estimate the number of lattice points satisfying \\eqref{thm2b-conditions}--\\eqref{cond0}. The symbol $\\vol$ will refer to the Lebesgue measure in $\\CC^m\\simeq\\RR^{2m}$, with $m$ being clear from the context.\n\nThe explicit expressions for the linear forms in \\eqref{coordinates} may be rewritten as \n\\begin{equation}\\label{Ag3}\n\\begin{bmatrix} L_1&L_2&L_3\\end{bmatrix}^{\\top}=A_0(g)\\begin{bmatrix}a-d&b&c\\end{bmatrix}^{\\top},\n\\end{equation}\nwhere $A_0:\\Omega\\to\\GL_3(\\CC)$ is a continuous function.\nIt is straightforward to verify that $\\det A_0(g)=1\/2$ holds identically. \nWe shall also use the $4$-dimensional variant\n\\begin{equation}\\label{Ag4}\n\\begin{bmatrix} a+d&L_1&L_2&L_3\\end{bmatrix}^{\\top}=\\diag(1,A_0(g))\\begin{bmatrix} a+d&a-d&b&c\\end{bmatrix}^{\\top}.\n\\end{equation}\n\nNow, let $m\\geq 1$ be a fixed integer ($m\\in\\{2,3,4\\}$ in our applications), and let $A:\\Omega\\to\\GL_m(\\CC)$ be a fixed continuous function. As $\\Omega$ is compact, there exists a fixed compact subset $K=K(A,\\Omega)\\subset\\CC^m$ such that each $2m$-dimensional lattice $A(g)\\ZZ[i]^m\\subset\\CC^m$ ($g\\in\\Omega)$ has a fundamental parallelepiped lying in $K$ and of volume $\\asymp 1$. It follows by a standard volume argument that for any compact subset $V\\subset\\CC^m$ and $g\\in\\Omega$ we have\n\\begin{equation}\\label{volume-bound}\n\\#\\bigl(V\\cap A(g)\\ZZ[i]^m\\bigr)\\ll\\vol V^\\bullet\\qquad\\text{where}\\qquad V^\\bullet:=V+K.\n\\end{equation}\n\nWe also record for repeated reference a simple volume computation. For $r,\\Delta>0$, we define the sets\n\\begin{align*}\nW_1(r,\\Delta)&:=\\bigl\\{(z_1,z_2)\\in\\CC^2:|z_1|,|z_2|\\leq r,\\,\\,\\Re(z_1\\overline{z_2})\\leq\\Delta\\bigr\\},\\\\\nW_2(r,\\Delta)&:=\\bigl\\{(z_1,z_2)\\in\\CC^2:|z_1|,|z_2|\\leq r,\\,\\,\\bigl||z_1|^2-|z_2|^2\\bigr|\\leq\\Delta\\bigr\\}.\n\\end{align*}\nCutting these into two parts according to whether $|z_2|\\leq |z_1|$ or $|z_2|>|z_1|$, we obtain readily by Fubini's theorem that\n\\[\\vol W_j(r,\\Delta)\\ll\\min(r^4,r^2\\Delta).\\]\nOn the other hand, we have\n\\[W_j(r,\\Delta)^\\bullet\\subset W_j\\bigl(r+\\OO(1),\\Delta+\\OO(r+1)\\bigr)\\]\nwith implied constants depending only on $A$ and $\\Omega$, hence\n\\begin{equation}\\label{volW}\n\\vol W_j(r,\\Delta)^{\\bullet}\\ll\\min\\bigl((r+1)^4,(r+1)^2(\\Delta+r+1)\\bigr)\\ll 1+r^2\\Delta+r^3.\n\\end{equation}\n\n\\subsection{Middle and high range for $q=0$}\nWe now estimate the count $M_0^{\\ast}(g,L,\\mcL,\\delta)$ in the ``middle range'' $\\mcL=L^2$ and the ``high range'' $\\mcL=L^4$. In the high range, we shall focus on the non-parabolic contribution $M_0^{\\ast\\np}(g,L,L^4,\\delta)$, since \nwe have already proved \\eqref{Rbound2}, and here we shall profit substantially from the fact that $\\det\\gamma$ is a square.\n\n\\subsubsection{Middle range}\nIn the middle range $\\mcL=L^2$, we estimate the number of choices in $M_0^{\\ast}(g,L,L^2,\\delta)$ as follows.\n\nFor the case when the first half of \\eqref{cond1} holds, we introduce the set\n\\begin{align*}\nV_1(\\delta):=\\big\\{(z_0,z_1,z_2,z_3)\\in\\CC^4:\\ &z_0,z_1\\preccurlyeq\\mcL^{1\/4},\\,\\,\n\\Re(z_0\\overline{z_1})\\preccurlyeq\\sqrt{\\mcL\/\\ell},\\\\\n&z_2,z_3\\ll\\mcL^{1\/4}\\delta,\\,\\,|z_2|^2-|z_3|^2\\preccurlyeq \\sqrt{\\mcL\/\\ell}\\big\\},\n\\end{align*}\nsuppressing from notation the dependence implicit in $\\preccurlyeq$. Then we have by \\eqref{volW}\n\\begin{align}\n\\nonumber\\vol V_1(\\delta)^{\\bullet}&\\preccurlyeq\n\\vol W_1(\\mcL^{1\/4},\\sqrt{\\mcL\/\\ell})^{\\bullet}\\cdot \n\\vol W_2(\\mcL^{1\/4}\\delta,\\sqrt{\\mcL\/\\ell})^{\\bullet}\\\\\n\\label{V1bound}&\\ll (\\mcL^{3\/4}+\\mcL\/\\sqrt{\\ell})(1+\\mcL^{3\/4}\\delta^3+\\mcL\\delta^2\/\\sqrt{\\ell}).\n\\end{align}\nFor the case when the second half of \\eqref{cond1} holds, we introduce the set\n\\begin{align*}\nV_2(\\delta)=\\big\\{(z_0,z_1,z_2,z_3)\\in\\CC^4:\\ &z_0,z_1\\ll\\mcL^{1\/4}\\delta,\\,\\,\n\\Re(z_0\\overline{z_1})\\preccurlyeq\\sqrt{\\mcL\/\\ell},\\\\\n&z_2,z_3\\preccurlyeq\\mcL^{1\/4},\\,\\,|z_2|^2-|z_3|^2\\preccurlyeq\\sqrt{\\mcL\/\\ell}\\big\\},\n\\end{align*}\nsuppressing from notation the dependence implicit in $\\preccurlyeq$. Then we have by \\eqref{volW}\n\\begin{align}\n\\nonumber\\vol V_2(\\delta)^{\\bullet}&\\preccurlyeq\n\\vol W_1(\\mcL^{1\/4}\\delta,\\sqrt{\\mcL\/\\ell})^{\\bullet}\\cdot \n\\vol W_2(\\mcL^{1\/4},\\sqrt{\\mcL\/\\ell})^{\\bullet}\\\\\n\\label{V2bound}&\\ll (\\mcL^{3\/4}+\\mcL\/\\sqrt{\\ell})(1+\\mcL^{3\/4}\\delta^3+\\mcL\\delta^2\/\\sqrt{\\ell}).\n\\end{align}\n\nUsing \\eqref{thm2b-conditions}--\\eqref{cond0}, \\eqref{Ag4}--\\eqref{volume-bound}, and \\eqref{V1bound}--\\eqref{V2bound}, we conclude \\eqref{Rbound3} in the form\n\\[ M_0^{\\ast}(g,L,L^2,\\delta)\\preccurlyeq (L^{3\/2}+L^2\/\\sqrt{\\ell})(1+L^{3\/2}\\delta^3+L^2\\delta^2\/\\sqrt{\\ell}). \\]\n\n\\subsubsection{High range}\nAs in the proof of Lemmata~\\ref{counting-for-thm1} and \\ref{first-moment-count-lemma}, in the high range $\\mcL=L^4$, once the triple $(a-d,b,c)$ is determined for a non-parabolic matrix $\\gamma$ (so that \\eqref{parabolicidentity} holds), $a+d$ and along with it $\\gamma$ is determined up to $\\preccurlyeq 1$ choices by the divisor bound, using that $n=l_1^2l_2^2$ is a square. We now estimate the number of choices in $M_0^{\\ast\\np}(g,L,L^4,\\delta)$ as follows.\n\nFor the case when the first half of \\eqref{cond1} holds, we introduce the set\n\\[ V_3(\\delta):=\\big\\{(z_1,z_2,z_3)\\in\\CC^3:\nz_1\\preccurlyeq\\mcL^{1\/4},\\,\\,z_2,z_3\\ll\\mcL^{1\/4}\\delta,\\,\\,|z_2|^2-|z_3|^2\\preccurlyeq\\sqrt{\\mcL\/\\ell}\\big\\}, \\]\nsuppressing from notation the dependence implicit in $\\preccurlyeq$. Then we have by \\eqref{volW}\n\\begin{equation}\\label{V3bound}\n\\vol V_3(\\delta)^{\\bullet}\\preccurlyeq\n\\sqrt{\\mcL}\\cdot\\vol W_2(\\mcL^{1\/4}\\delta,\\sqrt{\\mcL\/\\ell})^{\\bullet}\n\\ll \\sqrt{\\mcL}(1+\\mcL\\delta^2\/\\sqrt{\\ell}+\\mcL^{3\/4}\\delta^3).\n\\end{equation}\nFor the case when the second half of \\eqref{cond1} holds, we introduce the set\n\\[ V_4(\\delta):=\\big\\{(z_1,z_2,z_3)\\in\\CC^3:z_1\\ll\\mcL^{1\/4}\\delta,\\,\\,z_2,z_3\\preccurlyeq\\mcL^{1\/4},\\,\\,|z_2|^2-|z_3|^2\\preccurlyeq\\sqrt{\\mcL\/\\ell}\\big\\}, \\]\nsuppressing from notation the dependence implicit in $\\preccurlyeq$. Then we have by \\eqref{volW}\n\\begin{equation}\\label{V4bound}\n\\vol V_4(\\delta)^{\\bullet}\\preccurlyeq\n(1+\\mcL^{1\/4}\\delta)^2\\cdot\\vol W_2(\\mcL^{1\/4},\\sqrt{\\mcL\/\\ell})^{\\bullet}\n\\ll(1+\\sqrt{\\mcL}\\delta^2)(\\mcL^{3\/4}+\\mcL\/\\sqrt{\\ell}).\n\\end{equation}\n\nUsing \\eqref{parabolicidentity}, \\eqref{thm2b-conditions}--\\eqref{cond0}, \\eqref{Ag3}, \\eqref{volume-bound}, and \\eqref{V3bound}--\\eqref{V4bound}, we conclude \\eqref{Rbound4} in the form\n\\[ M_0^{\\ast\\np}(g,L,L^4,\\delta)\\preccurlyeq\nL^2(1+L^4\\delta^2\/\\sqrt{\\ell}+L^3\\delta^3)+(1+L^2\\delta^2)(L^3+L^4\/\\sqrt{\\ell}). \\]\n\nThe proof of Lemma~\\ref{counting-for-thm2} is complete.\n\n\\subsection{Proof of Theorem~\\ref{thm3}}\n\nIn the case $q=0$, we combine Lemmata~\\ref{APTI-done-lemma-single-form} and \\ref{counting-for-thm2} to see that\n\\[ |\\phi_0(g)|^2\\preccurlyeq_{I,\\Omega}\\ell^2\n\\left(\\frac1L+S^{\\ast}_0(L,L^2)+S^{\\ast}_0(L,L^4)\\right)+L^{2}\\ell^{-48}, \\]\nwhere\n\\begin{alignat*}{3}\nS_0^{\\ast}(L,L^2)&:=\\sum_{\\substack{\\delta\\text{ dyadic}\\\\1\/\\sqrt{\\ell}\\leq\\delta\\preccurlyeq 1}}\n\\frac1{\\sqrt{\\ell}\\delta L^3}\n\\left(L^{3\/2}+L^3\\delta^3+\\frac{L^2+L^{7\/2}\\delta^2}{\\sqrt{\\ell}}+\\frac{L^4\\delta^2}{\\ell}\\right)\n&&\\preccurlyeq\\frac1{L^{3\/2}}+\\frac1{\\sqrt{\\ell}}+\\frac{L}{\\ell^{3\/2}},\\\\\nS_0^{\\ast}(L,L^4)&:=\\sum_{\\substack{\\delta\\text{ dyadic}\\\\1\/\\sqrt{\\ell}\\leq\\delta\\preccurlyeq 1}}\n\\frac1{\\sqrt{\\ell}\\delta L^4}\n\\left(L^3+L^5\\delta^2+\\frac{L^4+L^6\\delta^2}{\\sqrt{\\ell}}\\right)\n&&\\preccurlyeq\\frac1L+\\frac{L}{\\sqrt{\\ell}}+\\frac{L^2}{\\ell}.\n\\end{alignat*}\nPutting everything together, we conclude that\n\\[ |\\phi_0(g)|^2\\preccurlyeq_{I,\\Omega}\\ell^2\\left(\\frac1L+\\frac{L}{\\sqrt{\\ell}}+\\frac{L^2}{\\ell}\\right)+L^2\\ell^{-48}\\ll \\ell^{7\/4}, \\]\nby making the essentially optimal choice $L:=7\\ell^{1\/4}$ (which satisfies our earlier\ncondition $L\\geq 7$).\n\nThe case $q = \\pm \\ell$ is immediate from Lemmata~\\ref{q=ell-case} and \\ref{lemma-ell-count}, hence the proof of Theorem~\\ref{thm3} is complete.\n\n\\section{Proof of Theorem~\\ref{thm2}}\\label{sec-proof2}\nIn this section, we prove Theorem~\\ref{thm2}. Here we take the aim of the softest possible proof based on the localization properties of the averaged spherical trace function (proved in Theorem~\\ref{thm6} and then encoded in the form of the amplified pre-trace inequality in Lemma~\\ref{APTI-done-lemma-single-form}) and the already available ingredients for the counting problem.\n\nFor each $\\mcL\\in\\{1,L^2,L^4\\}$ and $\\vec{\\delta}=(\\delta_1,\\delta_2)$ with $0<\\delta_1,\\delta_2\\leq\\ell^\\eps$, the count $M^\\ast(g,L,\\mcL,\\vec{\\delta})$ in Lemma~\\ref{APTI-done-lemma-single-form} may be estimated in a split fashion as\n\\[ M^\\ast(g,L,\\mcL,\\vec{\\delta})\\leq \\min\\big(M_K(g,L,\\mcL,\\delta_1),M_\\mcD(g,L,\\mcL,\\eps,\\delta_2)\\big), \\]\nwhere\n\\[M_K(g,L,\\mcL,\\delta):=\\sum_{n\\in D(L,\\mcL)}\\#\\left\\{\\gamma\\in\\Gamma_n:\\dist\\left(g^{-1}\\tilde\\gamma g,K\\right)\\leq\\delta\\right\\},\\]\nand $M_{\\mcD}(g,L,\\mcL,\\eps,\\delta)$ is as in \\eqref{thm2a-conditions}. The quantity $M_K(g,L,\\mcL,\\delta)$ is the classical Diophantine count in the spherical sup-norm problem in the eigenvalue aspect, which in the present context\nwas treated in detail in \\cite{BlomerHarcosMilicevic2016}. In the notation of that paper, we have:\n\\begin{itemize}\n\\item $u(\\tilde\\gamma gK,gK)\\asymp\\dist(g^{-1}\\tilde\\gamma g,K)^2$ in \\cite[(5.3)]{BlomerHarcosMilicevic2016};\n\\item $N=1$, and $r\\asymp_{\\Omega}1$ for $g\\in\\Omega$, in \\cite[(6.2)]{BlomerHarcosMilicevic2016}.\n\\end{itemize}\nThus the count $M_K(g,L,\\mcL,\\delta_1)$ agrees with $M(gK,L,\\mcL,\\OO(\\delta_1^2))$ in \\cite[(5.17)--(5.18)]{BlomerHarcosMilicevic2016}. Importing estimates \\cite[(7.1), (7.2), (7.5), (11.1), (11.6)]{BlomerHarcosMilicevic2016}, we conclude that\n\\[M_K(g,L,1,\\delta_1)\\preccurlyeq_{\\Omega} 1,\\quad\nM_K(g,L,L^2,\\delta_1)\\preccurlyeq_{\\Omega} L^2+L^4\\delta_1,\\quad\nM_K(g,L,L^4,\\delta_1)\\preccurlyeq_{\\Omega} L^3+L^6\\delta_1.\\]\n\nThe count $M_{\\mcD}(g,L,\\mcL,\\eps,\\delta)$ was estimated in Lemma~\\ref{first-moment-count-lemma}. Combining everything, we obtain the following lemma.\n\n\\begin{lemma}\\label{soft-counting-for-general-q}\nFor $g\\in\\Omega$, $L>0$, and arbitrary $\\eps>0$ and $\\vec{\\delta}=(\\delta_1,\\delta_2)$ with $0<\\delta_{j}\\preccurlyeq 1$, the quantity $M^\\ast(g,L,\\mcL,\\vec{\\delta})$ in Lemma~\\ref{APTI-done-lemma-single-form} satisfies\n\\begin{align*}\nM^\\ast(g,L,1,\\vec{\\delta})&\\preccurlyeq_{\\Omega} 1,\\\\\nM^\\ast(g,L,L^2,\\vec{\\delta})&\\preccurlyeq_{\\Omega}\\min\\big(L^2+L^4\\delta_1,L^2+L^4\\delta_2^4\\big),\\\\\nM^\\ast(g,L,L^4,\\vec{\\delta})&\\preccurlyeq_{\\Omega}\\min\\big(L^3+L^6\\delta_1,L^2+L^6\\delta_2^4\\big).\n\\end{align*}\n\\end{lemma}\n\nWe are now ready for the proof of Theorem~\\ref{thm2}. From Lemma~\\ref{soft-counting-for-general-q}, we have for every pair $\\vec{\\delta}=(\\delta_1,\\delta_2)$ with $0<\\delta_1,\\delta_2\\leq\\ell^{\\eps}$ that\n\\[\\frac{M^\\ast(g,L,1,\\vec{\\delta})}{L}+\\frac{M^\\ast(g,L,L^2,\\vec{\\delta})}{L^3}+\\frac{M^\\ast(g,L,L^4,\\vec{\\delta})}{L^4}\n\\preccurlyeq_{\\Omega} \\left(\\frac1L+L^2\\min\\left(\\delta_1,\\delta_2^4\\right)\\right).\\]\nInserting this into Lemma~\\ref{APTI-done-lemma-single-form}, we find that\n\\begin{align*}\n|\\phi_q(g)|^2&\\preccurlyeq_{I,\\Omega}\\ell^{2}\n\\sum_{\\substack{\\vec{\\delta}\\textnormal{ dyadic},\\,\\,\\delta_j\\preccurlyeq 1\\\\\\delta_1^2\\delta_2\\geq 1\/\\sqrt{\\ell}}}\n\\frac{1}{\\sqrt{\\ell}\\delta_1^2\\delta_2}\n\\left(\\frac1L+ L^2 \\min\\left(\\delta_1,\\delta_2^4\\right)\\right)+L^{2}\\ell^{-48}\\\\\n&\\preccurlyeq \\ell^{2} \\Biggl(\\frac1L+\n\\sum_{\\substack{\\vec{\\delta}\\textnormal{ dyadic},\\,\\,\\delta_j\\preccurlyeq 1\\\\\\delta_1^2\\delta_2\\geq 1\/\\sqrt{\\ell}}}\nL^2 \\min\\left(\\frac{1}{\\sqrt{\\ell}\\delta_1\\delta_2}, \\delta_1, \\delta_2^4\\right)\\Biggr)\n\\preccurlyeq \\ell^{2} \\left(\\frac1L + \\frac{L^2}{\\ell^{2\/9}}\\right),\n\\end{align*}\nwhere we used $\\min(A, B, C) \\leq A^{4\/9}B^{4\/9} C^{1\/9}$ in the last step.\nThe choice $L:=7\\ell^{2\/27}$ is optimal up to a constant, and it satisfies our earlier\ncondition $L\\geq 7$, hence we obtain Theorem~\\ref{thm2} in the form\n\\[{\\|\\phi_q|_{\\Omega}\\|}_\\infty\\preccurlyeq_{I,\\Omega}\\ell^{26\/27}.\\qedhere \\]\n\nThe proof of Theorem~\\ref{thm2} is complete.\n\n\\bibliographystyle{amsalpha}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} {"text":"\\section{Introduction}\nFrom AlexNet \\citep{krizhevsky2012imagenet}, VGG \\citep{simonyan2014very}, ResNet \\citep{he2016deep}, to SENet \\citep{hu2018squeeze}, tremendous research effort has been put in efficient deep learning model designs, leading to state-of-the-art performance for various machine learning tasks, including image recognition, object detection, and image segmentation \\citep{ren2015faster, long2015fully}. The success of deep learning models relies on sufficient training on a vast amount of data with correct labels, which however are difficult to acquire in practice. In particular, the privacy issue, which has attracted much attention recently, makes data collection from clients much more challenging \\citep{pmlr-v54-mcmahan17a}.\n\nTo train deep learning models adequately while protecting the privacies of clients, federated learning has come up as the major driving force to enhance the data security of deep learning methods \\citep{pmlr-v54-mcmahan17a}. Instead of training models using collected data from clients, federated learning needs no data collection. Instead, each client trains the machine learning model on its local edge device and then uploads the model parameters to the central server. Since only machine learning models are exchanged in the air, the risk of the client's data leakage becomes much smaller \\citep{truex2019hybrid}. Although straightforward as it may seem, integrating machine learning training methods into the framework of federated learning while with indistinguishable performance loss is of no simple matter. This has triggered recent theoretical research in both machine learning and optimizations \\cite{li2020on}. \n\nTherefore, in federated learning, it is crucial to think about how to use automated machine learning to search for neural architectures directly from the clients' data.\nThanks to gradient-based neural architecture search \\citep{liu2018darts, cai2018proxylessnas}, the model search can be represented as updating architecture parameters. \nSome NAS methods search for backbone cells on proxy data to trim down computational cost \\citep{liu2018darts, xu2020pcdarts}. \nHowever, these proxy strategies do not guarantee that the backbone cells have optimal performance on the target data\\citep{yang2019evaluation}. \nMore importantly, in federated learning, the difference in distribution between proxy data and target data will be larger due to the presence of non-iid data.\nTherefore, there are enough reasons to propose a non-proxy, gradient-based Federated Direct Neural Architecture Search (\\textbf{FDNAS}), with a feature of no data exchange. The first contribution of this paper is to propose such a scheme. \n\nOn the other hand, due to prevalent human biases, preferences, habits, etc., clients are divided into different groups, in each of which the clients are similar to each other in terms of both data and hardware.\nTherefore, instead of looking for an architecture that is too dense to suit each client, we expect that FDNAS should allow each client to use a lightweight architecture that fits their individual tasks.\nTo achieve this goal, We treat different clients' models as a large ensemble, in which the models are \\textit{highly diverse and client-specific}.\nThen, our \\textbf{primary question} is: how can we effectively search for these clusters' diverse models that are near-optimal on their respective tasks in a federated manner, while their weights are entangled? To exploit the model diversity in such a complex ensemble, we resort to the fundamental idea of meta-learning. \n\nParticularly, in meta-learning, the model's weights that have been already meta-trained can be very efficient when they are adapted to different tasks via meta-test \\citep{chen2019closerfewshot}.\nTherefore, we propose to use the SuperNet in a meta-test-like manner in order to obtain all client-specific neural architectures in federated learning. In the order of ``meta-train\" to ``meta-test\", the SuperNet trained on all clients in the first phase are considered as the meta-training model for the next ``meta-test\" client-specific adaptation. Following this idea, we propose the Cluster Federated Direct Neural Architecture Search (\\textbf{CFDNAS}) that divides all clients into groups by data similarity, and each group is trained using the SuperNet from the previous phase. In turn, each group utilizes the previous SuperNet and can adjust the architecture to fit their own client data after only a few rounds of updates like a meta-test. Consequently, CFDNAS can quickly generate a specific architecture for each client's data in parallel, under the framework of federated learning.\nThe contributions of our FDNAS are summarized below: \n\\begin{itemize}\n\\item[1.] \nWe have integrated federated learning with gradient-based and proxy-less NAS. This allows federated learning not only to train weights but also to search model architectures directly from the clients' data.\n\\item[2.] \nInspired by meta-learning, we extended FDNAS to CFDNAS to exploit the model diversity so that client-specific models can be quickly searched at very low computational cost.\n\\end{itemize}\n\n\\section{Related Work}\n\\textbf{Efficient neural architecture} designing is important for the practical deployment.\nMobileNetV2 \\citep{sandler2018mobilenetv2} proposes MBconv blocks, which largely reduce the model's FLOPs. Besides, efficient neural architecture search has recently gained increasing attention.\nTo speed up the NAS, the one-shot NAS approaches treat all normal nets as different subnets of the SuperNet and share weights among the operation candidates \\citep{brock2018smash}.\nENAS \\citep{pham2018efficient} uses the RNN controller to sample subnets in SuperNet and uses reinforce method to obtain approximate gradients of architecture.\nDARTS \\citep{liu2018darts} improves the search efficiency by representing each edge as a mixture of candidate operations and optimizing the weights of operation candidates in continuous relaxations.\nRecently, hardware-aware NAS methods like ProxylessNAS, incorporate the latency feedback in search as the joint optimization task without any expensive manual attempts. \\citep{wu2019fbnet, wan2020fbnetv2, cai2018proxylessnas}.\nAt the same time, some NAS methods search for the best backbone cells and transfer them to other target tasks by stacking them layer by layer \\citep{liu2018darts, xu2020pcdarts}. \nHowever, there is a big difference between the proxy and the target here: typically, the distribution of proxy data differs from the target data, and the best block searched by the proxy method differs from the optimal normal net after stacked \\citep{ yang2019evaluation}.\nTheir motivations and approaches are very different from our FDNAS, where our goal is to search the neural architecture without the gap between proxy task and clients' data, but directly on clients' data in a privacy-preserving way and automatically design a variety of client-specific models that satisfy clients' diversity.\n\n\\noindent \\textbf{Federated learning} commonly deploys predefined neural architectures on the client. They then use FedAvg as a generic algorithm to optimize the model \\citep{pmlr-v54-mcmahan17a}.\nThere are some fundamental challenges associated with the research topic of federated learning \\citep{li2019federated}: communication overhead, statistical heterogeneity of data(non-iid), client privacy.\nThe communication between the central server and the client is a bottleneck due to frequent weights exchange. So some studies aim to design more efficient communication strategies \\citep{konevcny2016federated, 45672, fedpaq19}.\nIn practice, the data is usually non-iid distributed. So the hyper-parameter settings of FedAvg (e.g., learning rate decay) are analyzed to study their impacts on non-iid data \\citep{li2020on}. In addition, a global data-sharing strategy is proposed to improve the accuracy of the algorithm on non-iid data \\citep{zhao2018federated}.\nOther research efforts have focused on privacy security \\citep{agarwal2018cpsgd}. For example, differential privacy is applied to federated training, thus preserving the privacy of the client \\citep{article17eth, 9069945}. Recently, FedNAS searches out the cell architecture and stacks it \\citep{he2020fednas}.\nNote that all of the above techniques are deploying pre-defined network architectures, or only searching for backbone cells for stacking using proxy strategies. However, our FDNAS can search the complete model architecture directly from clients' data and allow the model to better adapt to the clients' data distribution while protecting privacy. Also, with CFDNAS, it is able to provide multiple suitable networks for diverse clients at a very low computational cost.\n\\section{Preliminary}\nTo motivate the idea of this paper, we briefly review the basics of federated learning and ProxylessNAS in this section. \n\\subsection{Federated Learning}\n\\label{sec:FedAvg}\n\nAs an emerging privacy-preserving technology, federated learning (FedAvg) enables edge devices to collaboratively train a shared global model without uploading their private data to a central server \\citep{pmlr-v54-mcmahan17a}. In particular, in the training round $t+1$, an edge device $k\\in S$ downloads the shared machine learning model $\\mathbf w^{k}_{t}$ (e.g., a CNN model) from the central server, and utilizes its local data to update the model parameters. Then, each edge device sends its updated model $\\{\\mathbf w^{k}_{t} \\}_{k \\in S}$ to the central server for aggregation. \n\n\n\n\\subsection{ProxylessNAS}\n\\label{sec:plnas}\n\nIn ProxylessNAS, a SuperNet (over-parameterized net) is firstly constructed, which is denoted by a directed acyclic graph (DAG) with $N$ nodes. Each node $x^{(i)}$ represents a latent representation (e.g., a feature map), and each directed edge $e^{(i,j )}$ that connects node $x^{(i)}$ and $x^{(j)}$ defines the following operation:\n\\begin{align}\nx^{(j)} = \\sum_{n=1}^N b_n^{(i \\rightarrow j)} o_n \\left[ x^{(i)} \\rightarrow x^{(j)} \\right],\n\\end{align}\nwhere $o_n\\left[x^{(i)} \\rightarrow x^{(j)}\\right] \\in \\mathcal O$ denotes a operation candidate (e.g., convolution, pooling, identity, ect.) that transforms $x^{(i)}$to $x^{(j)}$, and vector $\\mathbf b^{(i \\rightarrow j)} = [b_1^{(i \\rightarrow j)}, \\cdots, b_N^{(i \\rightarrow j)}]$ is a binary gate that takes values as one hot vector which only set $b_n^{(i \\rightarrow j)}=1$ with a probability $p_n^{(i \\rightarrow j)}$ and other elements are 0 in forwarding.\nRather than computing all the operations in the operation set $\\mathcal O$ \\citep{liu2018darts}, there is only one operation $o_n \\left[ x^{(i)} \\rightarrow x^{(j)}\\right]$ that is utilized to transform each node $x^{(i)}$ to one of its neighbors $x^{(j)}$ with a probability $p_n^{(i \\rightarrow j)}$ at each run-time, thus greatly saving the memory and computations for training.\nSo it opens the door to directly learn the optimal architecture from large-scale datasets without resorting to proxy tasks. Furthermore, it applies the incorporation of hardware latency loss term into the NAS for reducing the inference latency on devices.\n\n\n\n\n\\section{Federated Neural Architecture Search}\n\\subsection{Motivation and Problem Formulation}\nIn the last section, ProxylessNAS is introduced as an efficient framework of great value for real-world applications since it is more efficient to use models directly searched from diverse daily data.\nHowever, the training of ProxylessNAS needs to collect all target data in advance, which inevitably limits its practical use due to the privacy concern of clients. In contrast, FedAvg trains a neural network without exchanging any data and thus can protect the data privacy of clients. However, it usually does not take the NAS into account, and therefore requires cumbersome manual architecture design (or hyperparameter tuning) for the best performance. \n\nTo integrate the merits from ProxylessNAS and FedAvg while overcoming their shortcomings, we develop a federated ProxylessNAS algorithm in this section. In particular, we propose a novel problem formulation as follows:\n\\begin{align}\n \\min_{\\pmb {\\alpha}} \\quad & \\sum_{k=1}^K\\mathcal{L}_{val}^{k}(\\mathbf w^*(\\pmb {\\alpha}), \\pmb {\\alpha}) \\label{eq:outerfednasFormulation}\\\\\n \\text{s.t.} \\quad &\\mathbf w^*(\\pmb {\\alpha}) = \\mathrm{argmin}_{\\mathbf w} \\enskip \\sum_{k=1}^K\\mathcal{L}_{train}^{k}(\\mathbf w, \\pmb {\\alpha}), \\label{eq:innerfednasFormulation}\n\\end{align}\nwhere $\\mathcal{L}_{val}^{k}(\\cdot, \\cdot)$ denotes the validation loss function of client $k$, and $\\mathcal{L}_{train}^{k}(\\cdot, \\cdot)$ denotes its training loss function. Vector $\\pmb {\\alpha}$ collects all architecture parameters $\\{\\alpha_n^{i \\rightarrow j}, \\forall i \\rightarrow j, \\forall n\\}$ and $\\mathbf w$ collects all weights $\\{\\mathbf w^{i\\rightarrow j}, \\forall i\\rightarrow j\\}$. This nested bilevel optimization formulation is inspired by those proposed in ProxylessNAS \\citep{cai2018proxylessnas} and FedAvg \\citep{pmlr-v54-mcmahan17a}. More specifically, for each client, the goal is to search the optimal architecture $\\pmb {\\alpha}$ that gives the best performance on its local validation dataset, while with the optimal model weights $\\mathbf w^*(\\pmb {\\alpha})$ learnt from its local training dataset.\n\n\n\\subsection{Federated Algorithm Development}\n\\begin{figure*}[htbp]\n \\centering\n \\includegraphics[width=0.825\\linewidth]{illustration-fed-search.pdf}\n \\caption{Illustration of FDNAS among clients.}\n \\label{fig:fdnas}\n\\end{figure*}\n\nTo optimize $\\pmb {\\alpha}$ and $\\mathbf w$ while protecting the privacy of client data, the FDNAS is developed in this subsection. \n\nFollowing the set-up of federated learning, assume that there are $K$ clients in the set $S$ and one central server. In communication round $t$, each client downloads global parameters $\\pmb {\\alpha}^g_t$ and $\\mathbf w^g_t$ from the server, and update these parameters using its local validation dataset and training dataset, respectively. With global parameters $\\pmb {\\alpha}^g_t$ and $\\mathbf w^g_t$ as initial values, the updates follow the steps in {\\bf Algorithm \\ref{alg:fdnas}}, i.e., \n\\begin{align}\n \\mathbf w_{t+1}^k, \\pmb \\alpha_{t+1}^k \\leftarrow \\text{ProxylessNAS}( \\mathbf w_t^{g}, \\pmb \\alpha_t^{g}), \\forall k \\in S. \\label{eq:w-alpha-from-single-client}\n\\end{align}\nThen, each edge device sends their updated parameters $\\{\\mathbf w^{k}_{t+1},\\pmb \\alpha^{k}_{t+1} \\}_{k \\in S}$ to the central server for aggregation. Central server aggregates these parameters to update global parameters $\\pmb {\\alpha}^g_{t+1}$ and $\\mathbf w^g_{t+1}$:\n\\begin{align}\n \\mathbf w_{t+1}^{g}, \\pmb \\alpha_{t+1}^{g} \\leftarrow \\sum_{k=1}^K \\frac{N_k}{N} \\mathbf w_{t+1}^k, \\sum_{k=1}^K \\frac{N_k}{N} \\pmb \\alpha_{t+1}^k, \\label{eq:sum-params-from-clients}\n\\end{align}\nwhere $N_k$ is the size of local dataset in client $k$, and $N$ is the sum of all client's data size (i.e., $N = \\sum_{k=1}^K N_k)$. \n\nAfter $T$ communication rounds, each client downloads the learnt global parameters $\\pmb {\\alpha}^g_t$ and $\\mathbf w^g_t$ from the server, from which the optimized neural network architecture and model parameters can be obtained, as introduced in Section Preliminary. Furthermore, with the learnt neural network architecture, the weights $\\mathbf w^k$ in each client could be further refined by the conventional FedAvg algorithm for better validation performance. The proposed algorithm is summarized in {\\bf Algorithm \\ref{alg:cfdnas}} and illustrated in Figure \\ref{fig:fdnas}.\n\n\n\\begin{algorithm}[!h]\n\\caption{FDNAS: Federated Direct Neural Architecture Search}\n\\label{alg:fdnas}\n\n\\begin{algorithmic}\n\\SUB{Central server:}\n \\STATE Initialize $\\mathbf w_0^{g}$ and $\\pmb \\alpha_0^{g}$.\n \\FOR{each communication round $t = 1, 2, \\dots, T$}\n \n \n \\FOR{each client $k \\in S$ \\textbf{in parallel}}\n \\STATE $\\mathbf w_{t+1}^k, \\pmb \\alpha_{t+1}^k \\leftarrow \\textbf{ClientUpdate}(\\mathbf w_t^{g}, \\pmb \\alpha_t^{g})$\n \\ENDFOR\n \\STATE $\\mathbf w_{t+1}^{g}, \\pmb \\alpha_{t+1}^{g} \\leftarrow \\sum_{k=1}^K \\frac{N_k}{N} \\mathbf w_{t+1}^k, \\sum_{k=1}^K \\frac{N_k}{N} \\pmb \\alpha_{t+1}^k$\n \n \\ENDFOR\n \\STATE\n \n \\SUB{ClientUpdate($\\mathbf w, \\pmb \\alpha$):} \/\/ \\emph{On client platform.}\n \\FOR{each local epoch $i$ from $1$ to $E$}\n \\STATE update $\\mathbf w, \\pmb \\alpha$ by ProxylessNAS\n \\ENDFOR\n \\STATE return $\\mathbf w, \\pmb \\alpha$ to server\n\\end{algorithmic}\n\\end{algorithm}\n\n\\subsection{Further Improvement and Insights}\n\\subsubsection{Clustering-aided model compression}\n\\begin{algorithm}[tb]\n\\caption{CFDNAS: Cluster Federated Direct Neural Architecture Search}\n\\label{alg:cfdnas}\n\n\\begin{algorithmic}\n\\SUB{Cluster server:}\n \\STATE load $\\mathbf w_0^{g}, \\pmb \\alpha_0^{g}$ by central server.\n \\STATE $\\{S_{1},\\cdots,S_{P}\\} \\leftarrow$ (split $S_{all}$ into clusters by users' tag.)\n \\FOR {cluster $S_{tag} \\in \\{S_{1},\\cdots,S_{P}\\}$ \\textbf{in parallel}}\n \\FOR{each round $t = 1, 2, \\dots$}\n \n \n \\FOR{each sampled client $k \\in S_{tag}$ \\textbf{in parallel}}\n \\STATE $\\mathbf w_{t+1}^k, \\pmb \\alpha_{t+1}^k \\leftarrow \\text{ClientUpdate}_k(\\mathbf w_t^{g}, \\pmb \\alpha_t^{g})$ \n \\ENDFOR\n \\STATE $\\mathbf w_{t+1}^{g}, \\pmb \\alpha_{t+1}^{g} \\leftarrow \\sum_{k=1}^K \\frac{n_k}{n_{all}} \\mathbf w_{t+1}^k, \\sum_{k=1}^K \\frac{n_k}{n_{all}} \\pmb \\alpha_{t+1}^k$\n \\ENDFOR\n \\ENDFOR\n \\STATE\n\n\\SUB{ClientUpdate($\\mathbf w, \\pmb \\alpha$):} \/\/ \\emph{On client platform.}\n \\FOR{each local epoch $i$ from $1$ to $E$}\n \\STATE update $\\mathbf w, \\pmb \\alpha$ by ProxylessNAS\n \\ENDFOR\n \\STATE return $\\mathbf w, \\pmb \\alpha$ to server\n\\end{algorithmic}\n\\end{algorithm}\n\nAt the end of the proposed algorithm (i.e., {\\bf Algorithm \\ref{alg:cfdnas}}), the neural network architecture is learnt from the datasets of all the clients in a federated way. Although it enables the the knowledge transfer, accounting for every piece of information might result in structure redundancy for a particular group of clients. More specifically, assume that 10 clients are collaborated together to train a model for image classification. Some clients are with images about \\textit{birds, cats, and deer} and thus can form a ``animal\" group, while other clients in the ``transportation\" group are with images about \\textit{airplanes, cars, ships, and trucks}. Although these images all contribute to the neural network structure learning in {\\bf Algorithm \\ref{alg:cfdnas}}, the operations tailored for ``animal\" group might not help the knowledge extraction from the ``transportation\" group significantly. Therefore, an immediate idea is: could we further refine the model architecture by utilizing the clustering information of clients?\n\nTo achieve this, we further propose a clustering-aided refinement scheme into the proposed FDNAS. In particular, after $\\pmb \\alpha^{g}$converges, each client could send a tag about its data to the server, e.g., \\textit{animal, transportation}, which are not sensitive about its privacy. Then the server gets the clustering information about the clients: which ones are with similar data distributions, based on which the clients' set $S$ can be divided into several groups:\n\\begin{align}\n S \\rightarrow \\{S_{1},\\cdots,S_{P}\\}.\n \\label{eq:s-to-si}\n\\end{align}\nFinally, the clients in the same group could further refine their SuperNet by re-executing the proposed FDNAS algorithm. The proposed clustering-aided refinement scheme labeled as \\textbf{CFDNAS} is summarized in {\\bf Algorithm \\ref{alg:cfdnas}}. \n\n\\subsubsection{Hardware-tailored model compression}\nClients might deploy models in different devices, such as mobile phone, CPU, and GPU. Previous studies show that taking hardware-ware loss into account could guide the NAS to the most efficient one in terms of the inference speed. \nFor example, ProxylessNAS uses hardware-aware loss to \\textit{avoid} $\\pmb\\alpha$ convergence to the heaviest operations at each layer.\nThe proposed FDNAS and CFDNAS could naturally integrate the hardware information into its search scheme. In particular, we could let each device send their hardware information such as \\textit{GPU, CPU} to the server. Then, the server divides these clients into several groups according to their hardware type. For the clients in the same group, a hardware-ware loss term is added to the training loss. By taking this hardware-ware loss term into the training process, the proposed algorithm will drive the SuperNet to a compact one that gives the fastest inference speed for the particular hardware-platform. The details of hardware-ware loss term refer to ProxylessNAS.\n\n\\begin{table*}[!htbp]\n\\centering\n\\begin{tabular}{lcccc}\n\\toprule\n\\textbf{\\multirow{2}{*}{Architecture}} &\\textbf{\\multirow{2}{*}{Test Acc. (\\%)}} & \\textbf{Params} & \\textbf{Search Cost} & \\textbf{\\multirow{2}{*}{Method}} \\\\\n\\cmidrule(lr){3-4} &\n & \\textbf{(M)} & \\textbf{(GPU hours)} &\\\\\n\\hline\nDenseNet-BC~ \\citep{densenet} & 94.81 & 15.3 & - & manual \\\\\nMobileNetV2 ~ \\citep{sandler2018mobilenetv2} & 96.05 & 2.5 & - & manual \\\\\n\\hline\nNASNet-A ~ \\citep{zoph2018learning} & 97.35 & 3.3 & 43.2K & RL \\\\\nAmoebaNet-A ~ \\citep{amoebanet} & 96.66 & 3.2 & 75.6K & evolution \\\\\nHireachical Evolution~ \\citep{liu2018hierarchical} & 96.25 & 15.7 & 7.2K & evolution \\\\\nPNAS~ \\citep{liu2018progressive} & 96.59 & 3.2 & 5.4K & SMBO \\\\\nENAS~ \\citep{pham2018efficient} & 97.11 & 4.6 & 12 & RL \\\\\n\\hline\nDARTS~ \\citep{liu2018darts} & 97.24 & 3.3 & 72 & gradient \\\\\nSNAS ~ \\citep{xie2018snas} & 97.02 & 2.9 & 36 & gradient \\\\\nP-DARTS C10~ \\citep{chen2019progressive} & 97.50 & 3.4 & 7.2 & gradient \\\\\nP-DARTS C100~ \\citep{chen2019progressive} & 97.38 & 3.6 & 7.2 & gradient \\\\\nPC-DARTS ~ \\cite{xu2020pcdarts} & 97.39 &3.6 &2.5 & gradient\\\\\nGDAS ~ \\citep{dong2019searching} & 97.07 & 3.4 & 5 & gradient \\\\\n\\hline\n\\textbf{FDNAS(ours)} & \\textbf{78.75$^*$\/97.25$\\dag$} & \\textbf{3.4} & \\textbf{59} & \\textbf{gradient \\& federated} \\\\\n\\bottomrule\n\\end{tabular}\n\\caption{\\textbf{CIFAR-10 performance.} $^*$: The federated averaged model's accuracy. $\\dag$: mean local accuracy, i.e., Each client completes training local epochs after downloading the server model, and then averages the local accuracy obtained by testing inference on the local test data.}\n\\label{tab_ev_cifar}\n\\end{table*}\n\n\\section{Experiments}\n\n\\subsection{Implementation Details}\nWe use PyTorch \\citep{paszke2019pytorch} to implement FDNAS and CFDNAS.\nWe searched on CIFAR-10 \\citep{cifar10} and then trained normal networks from scratch. CIFAR-10 has 50K training images, 10K test images, and 10 classes of labels. To simulate a federation scenario, we set up 10 clients. The first 3 classes of images are randomly and evenly assigned to the first 3 clients. Then, the middle 3 classes of images were randomly assigned to the middle 3 clients, and the last 4 classes of images were randomly and evenly assigned to the last 4 clients. \nEach client has 4500 images as a training set for learning $\\mathbf w$ and 500 images as a validation set for learning $\\pmb \\alpha$.\nBesides, to test the transferability of the architecture searched out by FDNAS, we used it to train on ImageNet\\citep{5206848}.\n\n\\subsection{Image Classification on CIFAR-10}\n\\subsubsection{Training Settings}\nWe use a total batch size of 256 and set the initial learning rate to $0.05$. Then, we use the cosine rule as a decay strategy for the learning rate. When training SuperNet, we use Adam to optimize $\\pmb \\alpha$ and momentum SGD to optimize $\\mathbf w$. The weight decay of $\\mathbf w$ is $3e-4$, while we do not use weight decay on $\\pmb \\alpha$.\nThe SuperNet has 19 searchable layers, each consisting of MBconv blocks, the same as ProxylessNAS \\citep{cai2018proxylessnas}.\nWe train the FDNAS SuperNet with 10 clients for a total of 125 rounds. Meanwhile, the local epoch of each client is 5. \nWe assume that all clients can always be online during the training procedure.\nAfter that, CFDNAS clusters clients-0, 1, and 2 into the GPU group to train CFDNAS-G SuperNet, and clients-3, 4, and 5 into the CPU group to train CFDNAS-C SuperNet. CFDNAS SuperNets are all searched separately for 25 rounds.\nAfter training the SuperNet, we derive the normal net from the SuperNet and then run 250 rounds of scratch training on clients via FedAvg.\nGPU latency is measured on a TITAN Xp GPU with a batch size of 128 in order to avoid severe underutilization of the GPU due to small batches. CPU latency is measured on two 2.20GHz Intel(R) Xeon(R) E5-2650 v4 servers with a batch size of 128.\nBesides, the random number seeds were set to the same value for all experiments to ensure that the data allocation remained consistent for each training.\n\n\n\\subsubsection{Results}\nSince our FDNAS is based on FedAvg and protects the privacy of clients' data, we put the federated averaged model's accuracy and clients' models mean local accuracy in the Table~\\ref{tab_ev_cifar}.\nAs demonstrated, our FDNAS normal net achieves $78.75\\%$ federated averaged accuracy and $97.25\\%$ mean local accuracy. \nIt costs 59 GPU hours. However, the federated learning framework is naturally suited to distributed training. During training, all clients can be trained simultaneously. \nOur FDNAS outperforms both evolution-based NAS and gradient-based DARTS in terms of search time cost, and our clients'local accuracy is higher than their central accuracy.\nIn addition, we use MobileNetV2 as a predefined, hand-crafted model trained under FedAvg for a fairer comparison with FDNAS. In Table~\\ref{ablation1}, our FDNAS outperforms MobileNetV2 in terms of federated averaged accuracy and mean local accuracy. See ablation study~\\ref{alation-sec} subsection for more analysis and CFDNAS's performance.\n\n\n\\subsection{Image Classification on ImageNet}\n\\begin{table*} [!t]\n\\centering\n\\begin{tabular}{lcccccc}\n\\toprule\n\\textbf{\\multirow{2}{*}{Architecture}} & \\multicolumn{2}{c}{\\textbf{Test Acc. (\\%)}} & \\textbf{Params} & $\\times+$ & \\textbf{Search Cost} & \\textbf{\\multirow{2}{*}{Search Method}} \\\\\n\\cmidrule(lr){2-3}\n& \\textbf{top-1} & \\textbf{top-5} & \\textbf{(M)} & \\textbf{(M)} & \\textbf{(GPU hours)} &\\\\\n\\hline\nMobileNet~ \\citep{howard2017mobilenets} & 70.6 & 89.5 & 4.2 & 569 & - & manual \\\\\nShuffleNet 2$\\times$ (v2)~ \\citep{ma2018shufflenet} & 74.9 & - & $\\sim$5 & 591 & - & manual \\\\\nMobileNetV2~ \\citep{sandler2018mobilenetv2} & 72.0 & 90.4 & 3.4 & 300 & - & manual \\\\\n\n\\hline\nNASNet-A~ \\citep{zoph2018learning} & 74.0 & 91.6 & 5.3 & 564 & 43.2K & RL \\\\\nNASNet-B~ \\citep{zoph2018learning} & 72.8 & 91.3 & 5.3 & 488 & 43.2K & RL \\\\\nAmoebaNet-A~ \\citep{amoebanet} & 74.5 & 92.0 & 5.1 & 555 & 75.6K & evolution \\\\\nAmoebaNet-B~ \\citep{amoebanet} & 74.0 & 91.5 & 5.3 & 555 & 75.6K & evolution \\\\\nPNAS~ \\citep{liu2018progressive} & 74.2 & 91.9 & 5.1 & 588 & 5.4K & SMBO \\\\\nMnasNet~ \\citep{tan2019mnasnet} & 74.8 & 92.0 & 4.4 & 388 & - & RL \\\\\n\\hline\nDARTS ~ \\citep{liu2018darts} & 73.3 & 91.3 & 4.7 & 574 & 96 & gradient \\\\\nSNAS ~ \\citep{xie2018snas} & 72.7 & 90.8 & 4.3 & 522 & 36 & gradient \\\\\nProxylessNAS ~ \\citep{cai2018proxylessnas} & 75.1 & 92.5 & 7.1 & 465 & 200 & gradient \\\\\nP-DARTS-C10~ \\citep{chen2019progressive} & 75.6 & 92.6 & 4.9 & 557 & 7.2 & gradient \\\\\nP-DARTS-C100 ~ \\citep{chen2019progressive} & 75.3 & 92.5 & 5.1 & 577 & 7.2 & gradient \\\\\nGDAS ~ \\citep{dong2019searching} & 74.0 & 91.5 & 5.3 & 581 & 5 & gradient \\\\\\hline\n\n\\textbf{FDNAS(ours)} & \\textbf{75.3} & \\textbf{92.9} & \\textbf{5.1} & \\textbf{388} & \\textbf{59} & \\textbf{gradient~ \\& federated} \\\\\n\n\\bottomrule\n\\end{tabular}\n\\caption{\\textbf{ImageNet performance.} $\\times+$ denotes the number of multiply-add operations(FLOPs).}\n\\label{ev_imagenet}\n\\end{table*}\n\\subsubsection{Training Settings}\nTo test the generality on larger image classification tasks, we moved the FDNAS general net to ImageNet for training. Following the general mobile setting \\citep{liu2018darts}, we set the input image size to $224\\times224$ and the model's FLOPs were constrained to below 600M.\nWe use an SGD optimizer with a momentum of 0.9. The initial learning rate is 0.4 and decays to 0 by the cosine decay rule. Then the weight decay is 4e-5. The dropout rate is 0.2.\nIn order to fit the FDNAS net to ImageNet's image size, Layer 1, 3, 6, 8, and 16 are set to the downsampling layers.\n\n\\subsubsection{Results}\nAs shown in Table~\\ref{ev_imagenet}, we achieved SOTA performance compared to other methods. FDNAS test accuracy is $75.3\\%$, which is better than GDAS, ProxylessNAS, SNAS, and AmoebaNet. Besides, our FLOPs are 388M, which is also smaller than them. The search cost is only 59 GPU hours, which is smaller than ProxylessNAS and makes sense in real-world deployments.\nAlso, for a fairer comparison, we compare FDNAS to MobileNetV2 since they are both composed of MBconv blocks.\nOur FDNAS normal net's $75.3\\%$ accuracy outperforms MobileNetV2 by $3.3\\%$. Moreover, the MobileNetV2(1.4)'s FLOPs is 585M which is quite more dense than FDNAS 388M. but our FDNAS's accuracy still outperforms its $0.6\\%$. \nSumming up the above analysis, the model searched by our FDNAS in a privacy-preserving manner is highly transferable and it has an outstanding trade-off between accuracy and FLOPs. These show that learning the neural architecture from the data can do away with the bias caused by human effort and attain better efficiency.\n\n\n\\subsection{Ablation study}\n\\label{alation-sec}\n\\begin{table*}[!t]\n\\centering\n\\begin{tabular}{lcccccc}\n\\toprule\n\\textbf{\\multirow{2}{*}{Architecture}} & \\multicolumn{2}{c}{\\textbf{Latency (ms})} & \\textbf{Params} & \\textbf{$\\times+$} & \\textbf{Search Cost} & \\textbf{\\multirow{2}{*}{Test Acc.(\\%)}} \\\\ \n\\cmidrule(lr){2-3}\n& \\textbf{GPU} & \\textbf{CPU} & \\textbf{(M)} & \\textbf{(M)} & \\textbf{(GPU hours)} &\\\\ \\hline\n MobileNetV2 & 52.31 & 890.69 &2.5 &296.5 & - & 68.45$\\ddag$\/96.51$\\dag$\\\\ \\hline\n\n FDNAS & 52.78 & 600.17 & 3.4 &346.6 & 59.00 & 78.75$\\ddag$\/97.25$\\dag$\\\\ \\hline\n CFDNAS-G & 40.33 & 463.86 & 3.3 &318.4 & 3.53 & 73.60$\\ddag$\/ 98.93$\\dag$\\\\\n CFDNAS-C & 31.00 & 186.52 & 2.0 &169.3 & 3.46 & 71.29$\\ddag$\/ 93.01$\\dag$\\\\\n\\bottomrule\n\\end{tabular}\n\\caption{\\textbf{A comparison between MobileNetV2, FDNAS and CFDNAS on CIFAR-10}: \n$\\dag$ and $\\ddag$ is explained in Table~\\ref{tab_ev_cifar}.}\n\n\\label{ablation1}\n\\end{table*}\n\\begin{table*}[!t]\n\\centering\n\\begin{tabular}{lccccccc}\n\\toprule\n\\textbf{\\multirow{2}{*}{Architecture}} &\\multirow{2}{*}{\\textbf{Client ID}} & \\textbf{Params} & \\textbf{$\\times+$} &\\textbf{Search Cost} &{\\textbf{Client Local}} &\\textbf{Mean Local} \\\\ \n& & \\textbf{(M)} & \\textbf{(M)} &\\textbf{(GPU hours)}&\\textbf{Acc.(\\%)} & \\textbf{Acc.(\\%)} &\\\\ \\hline\n\nFDNAS \n &0,1,2 & 3.38 & 346.64 &59 & 98.14\/99.35\/98.90 & 98.79 \\\\ \n \nnaive-CFDNAS-G \n &0,1,2 & 3.70 & 356.83 &18 &97.56\/98.11\/97.36 &97.67 \\\\ \n\\textbf{CFDNAS-G} \n &0,1,2 & \\textbf{3.33} & \\textbf{318.44} &\\textbf{3.53} &\\textbf{98.39\/99.02\/99.38} &\\textbf{98.93} \\\\ \\hline\nFDNAS \n &3,4,5 &3.38 &346.64 &59 & 94.20\/91.81\/93.04 & 93.01 \\\\ \n \nnaive-CFDNAS-C \n &3,4,5 & 1.92 & 187.89 &18 &88.61\/89.88\/90.25 &89.58 \\\\ \n\\textbf{CFDNAS-C} \n &3,4,5 & \\textbf{2.03} & \\textbf{169.35} &\\textbf{3.46} &\\textbf{93.21\/92.73\/93.12} &\\textbf{93.02} \\\\\n\\bottomrule\n\n\\end{tabular}\n\\caption{\\textbf{Enhancement by CFDNAS}. ``naive-CFDNAS'' means that SuperNet for CFDNAS is not inherited from FDNAS, but is searched directly in the cluster group from scratch.}\n\\label{ablation3}\n\\end{table*}\n\\begin{table*}[!t]\n\\centering\n\\begin{tabular}{lccccc}\n\\toprule\n\\textbf{\\multirow{2}{*}{Architecture}} & \\textbf{Params} & \\textbf{$\\times+$} &\\textbf{Search Cost} & \\textbf{Test Acc.} \\\\ \n& \\textbf{(M)} & \\textbf{(M)} &\\textbf{(GPU hours)}& \\textbf{(\\%)} \\\\ \\hline\nDNAS(on client-0) & 2.54 & 264.35 &6.4 & 95.83 \\\\ \nDNAS(on client-1) & 3.50 & 330.58 &6.5 & 97.04 \\\\ \nDNAS(on client-2) & 2.85 & 269.76 &8.4 & 97.55 \\\\ \nDNAS(on client-3) & 2.77 & 258.90 &9.9 & 87.33 \\\\ \nDNAS(on client-4) & 2.28 & 233.99 &6.7 & 88.38 \\\\ \nDNAS(on client-5) & 3.27 & 299.63 &7.5 & 87.53 \\\\ \nDNAS(on client-6) & 2.78 & 297.03 &7.7 & 97.83 \\\\ \nDNAS(on client-7) & 3.25 & 336.20 &7.1 & 96.83 \\\\ \nDNAS(on client-8) & 2.68 & 263.89 &8.8 & 97.38 \\\\ \nDNAS(on client-9) & 2.80 & 286.46 &7.8 & 97.47 \\\\ \nmean & 2.87 & 284.08 &7.7 & 94.31 \\\\ \\hline\n\nDNAS(on collected CIFAR-10) & 5.02 & 500.71 &24.5 & 96.71 \\\\ \\hline\nFDNAS(on all clients) & 3.38 & 346.64 &59.0 & 78.75$\\ddag$\/97.25$\\dag$\\\\ \\hline\nCFDNAS-G(on client-0, 1, 2) & 3.33 & 318.44 &3.53 & 73.60$\\ddag$\/98.93$\\dag$\\\\\nCFDNAS-C(on client-3, 4, 5) & 2.03 & 169.35 &3.46 & 71.29$\\ddag$\/93.01$\\dag$\\\\\n\\bottomrule\n\\end{tabular}\n\\caption{\\textbf{Compared with conventional DNAS.} $\\dag$ and $\\ddag$ is explained in Table~\\ref{tab_ev_cifar}. The DNAS search algorithm is ProxylessNAS like FDNAS, but uses well-collected data rather than federated learning.\n}\n\\label{ablation2}\n\\end{table*}\n\n\\subsubsection{Effectiveness of CFDNAS}\nFrom the Table~\\ref{ablation1}, we demonstrate CFDNAS for comparison.\nCFDNAS-G (GPU platform) and CFDNAS-C (CPU platform) are trained for 25 epochs each based on the inherited FDNAS SuperNet.\nBoth CFDNAS normal nets have smaller FLOPs than FDNAS. Both nets also have lower GPU\/CPU inference latencies than FDNAS and the hand-crafted MobileNetV2.\nWe then study the improvement in accuracy by CFDNAS in Table~\\ref{ablation3}.\nBenefiting from the clustering approach, for the GPU group (including clients-0, 1, and 2), our CFDNAS-G search model achieves $98.92\\%$ accuracy. It is more accurate than the original FDNAS on clients of the same GPU group and requires only 3.53 GPU hours of SuperNet adaptation, which is a negligible additional cost.\nThe ``naive-CFDNAS'' has no inheritance parameters ($\\mathbf w$ and $\\pmb \\alpha$) and no SuperNet's ``meta-test'' adaptation. As a result, the convergence time of naive-CFDNAS takes 18 GPU hours, which is 5.1 times that of CFDNAS. In the same GPU group, our CFDNAS-G is $1.26\\%$ more accurate than naive-CFDNAS, while its FLOPs are smaller.\nFor the CPU group (including clients-3, 4, and 5), our CFDNAS-C also outperforms FDNAS and naive-CFDNAS-G in terms of accuracy and FLOPs.\nCPU group's data is harder than others, but our CFDNAS-C is still more accurate than naive-CFDNAS-C and more stable than FDNAS.\n\nCompared to FDNAS, CFDNAS gets a better trade-off between accuracy and latency due to the meta-learning mechanism.\nCompared to naive-CFDNAS, CFDNAS gets better performance because it inherits $\\mathbf w$ and $\\pmb \\alpha$ from the FDNAS SuperNet, which is fully trained with data from all clients.\nAlso, because the FDNAS-based ``meta-trained\" SuperNet performs the search, it helps meta-adaptation cost less than naive-CFDNAS.\n\n\\subsubsection{Contributions of federated mechanism}\nIn Table~\\ref{ablation2}, we show the effects of using a traditional DNAS with collected data (including all data) and a single-client DNAS (including only local data, with no federated training).\nDNAS searches the model directly on the clients' data but requires data collection in advance, and it achieves a central accuracy of $96.71\\%$. However, our FDNAS still has higher local accuracy than DNAS while protecting data privacy.\nBesides, our FDNAS has smaller FLOPs than single-client conventional DNAS results. Our federated averaged accuracy is $78.75\\%$, and local accuracy is $97.25\\%$ which is $2.94\\%$ higher than single-client local average accuracy. Thanks to the federated mechanism, FDNAS can use data from a wide range of clients to search for more efficient models. At the same time, it trains models with higher accuracy. Privacy protection and efficiency will be beneficial for the social impacts and effectiveness of actual machine learning deployments.\n\n\\subsubsection{Contributions of directly search}\nFor a fairer comparison, we use MobileNetV2, which is also composed of MBconv blocks, as a predefined hand-crafted neural architecture trained in FedAvg.\nWe train the normal net of FDNAS with the collected data from all clients and obtain an accuracy of $96.03\\%$ in a centralized way, a negligible difference compared to the centralized results of MobileNetV2.\nThen we present the FedAvg results for FDNAS and MobileNetV2 in Table~\\ref{ablation1}. \nOur FDNAS federated averaged accuracy and local accuracy are $6.63\\%$ and $1.4\\%$ higher than MobileNetV2, respectively.\nAlso, although both have similar GPU latency, FDNAS can be faster than MobileNetV2 on the CPU platform. So compared to the FDNAS, MobileNetV2 is not optimal for diverse clients in federated scenarios.\nThe FDNAS search architecture from the dataset is superior to hand-crafted models, and it demonstrates that the NAS approach can provide a significant improvement over human design in federated learning.\n\n\\section{Discussion and Future Work}\nWe propose FDNAS, a privacy-preserving neural architecture search scheme that directly searches models from clients' data under the framework of federated learning. Different from previous federated learning approaches, the complete neural architecture is sought from clients' data automatically without any manual attempts. Extensive numerical results have shown that our FDNAS greatly improves the model's performance and efficiency compared to predefined hand-crafted neural architectures in federated learning.\nOn the other hand, our FDNAS model achieves state-of-the-art results on ImageNet in a mobile setting, which demonstrates the transferability of FDNAS. Moreover, inspired by meta-learning, CFDNAS, an extension to FDNAS, can discover diverse high-accuracy and low-latency models adapted from a SuperNet of FDNAS at a very low computational cost. In future work, we will extend our FDNAS to search for different tasks such as object detection, semantic segmentation, model compression, etc., as well as larger-scale datasets with more categories.\n\\newpage\n\\section{Ethical Impact}\nAutoML has been widely used in many fields, such as searching deep neural networks and tuning hyper-parameters in computer vision and natural language processing. \nIn general, NAS brings some important implications for the neural network design, and here we focus on the use of FDNAS to provide a NAS solution in a better privacy-preserving way and the use of CFDNAS to provide a suitable neural network architecture for each client. There are many benefits of the schemes, such as exploiting the diversity of models, respecting the diversity of clients, and reducing risks of privacy and security. \n\nNowadays, there is a lot of research about federated learning for improving deep learning's fairness, safety, and trustworthiness. \nTo liberate expensive manual attempts in federated learning, we believe that the impacts of FDNAS in real-world scenarios are worthy of attention. In addition, privacy leak from the gradient update is still an open problem in machine learning. \nIt is worth exploring a more secure AutoML system combining with some potential privacy protection methods such as differential privacy, homomorphic encryption, and secure multi-party computing.\n\\input{ref.bbl}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} {"text":"\\section{Introduction}\n\nThe sources of majority of cosmic rays (CRs) are believed to be supernovae\n(SNe) and supernova remnants (SNRs), which are capable of accelerating\nparticles to multi-PeV energies. As CRs propagate through the interstellar\nmedium (ISM) they scatter off the magnetic turbulences in a process that on large\nscales can be described with a diffusive transport equation\n\\citep[][]{1964ocr..book.....G,1990acr..book.....B}. The spectrum of\nturbulence controls the value of the diffusion coefficient and its energy\ndependence because the CR particles most efficiently scatter on turbulence that is\ncomparable in size to their gyroradii. The turbulence is\nassumed to initially form at large scales and then cascade down to smaller\nscales thus affecting particles at all rigidities. The power-law shape of the\nenergy spectrum of turbulence\n\\citep{1941DoSSR..30..301K,1964SvA.....7..566I,1965PhFl....8.1385K} translates\ninto a power-law rigidity dependence of the diffusion coefficient with the\nindex taking a value between 0.3 and 0.6. Observations of the ratios of stable secondary to\nprimary species in CRs and the abundances of radioactive secondaries are\nusually employed to determine both the power-law index and normalization of\nthe diffusion coefficient averaged over a significant volume of the\ninterstellar space surrounding the Solar system\n\\citep[e.g.,][]{1998ApJ...509..212S,2007ARNPS..57..285S,JohannessonEtAl:2016},\ntypically several kpc in radius. Recent estimates of the power-law index are\nclustered around 0.35 with a normalization of about $4\\times10^{28}$ cm$^2$\ns$^{-1}$ at a rigidity of 4 GV \\citep[e.g.,][]{BoschiniEtAl:2018b}.\n\nPulsars are rapidly spinning and strongly magnetized neutron stars that are at\nthe final stage of the stellar evolution. They are formed in SN explosions\nand can often be found inside their associated SNR. \nPulsars represent a class of CR sources that has not been considered as extensively as the more usual scenario of acceleration in SNR shocks, but the fact that they may produce CRs is well-known \\citep{1981IAUS...94..175A,1987ICRC....2...92H,1989ApJ...342..807B}. However,\nrecent measurements of positrons in CRs \n\\citep{AdrianiEtAl:2009, AckermannEtAl:2012, AguilarEtAl:2014}\nin excess of predictions of propagation models\n\\citep{1982ApJ...254..391P,1998ApJ...493..694M}, made under an assumption of\ntheir entirely secondary production in the ISM, elevated\npulsars to be one of the primary candidate sources responsible for this excess\n\\citep[e.g.,][]{2009JCAP...01..025H,2009PhRvL.103e1101Y,2009PhRvD..80f3005M}.\nThe magnetospheres of rapidly\nrotating neutron stars are capable of producing electrons and positrons in\nsignificant numbers and accelerating them to very high energies resulting in a\npulsar wind nebula (PWN) that is observable from radio to high-energy $\\gamma$-ray{s} \\citep{GaenslerSlane:2006}; an archetypical example of such a source is the Crab pulsar and its PWN. The accelerated particles eventually escape from the PWN into the ISM and some of them can reach the Solar system. Therefore, PWNe can\nbe natural candidates responsible for the puzzling excess in CR positrons\nobserved by several experiments.\n\nRecent observations of the extended TeV emission around Geminga and PSR~B0656+14\nPWN by the High Altitude Water Cherenkov (HAWC) telescope constrain the\ndiffusion coefficient in their vicinities to be about two orders of\nmagnitude smaller than the average value derived from observations of CRs\n\\citep{AbeysekaraEtAl:2017}. Application of such slow diffusion to the local\nMilky Way results in a contradiction with other CR observations, in particular\nobservations of high-energy CR electrons and positrons. Fast energy losses of\nTeV particles through inverse Compton (IC) scattering and synchrotron emission\nlimits their lifetime to $\\sim$100~ky \\citep{1998ApJ...509..212S}.\nIf such slow diffusion is representative for the ISM\nwithin about a few hundred pc of the Solar system, the sources of the TeV particles detected at Earth also need to be within a few 10s of pc.\n\\citet{ProfumoEtAl:2018} highlighted that such nearby sources have\nnot been identified and proposed a\ntwo-zone diffusion model with the slow diffusion confined to a small region\naround the PWN. Other authors have considered similar scenarios with varying\ndetails \\citep{TangPiran:2018,FangEtAl:2018,EvoliEtAl:2018}. Interestingly, a\nsimilar suppression of the CR diffusion was observed in the Large Magellanic\nCloud around the 30 Doradus star-forming region, where an analysis of combined\n$\\gamma$-ray{} \nand radio observations \nyielded a diffusion coefficient, averaged over a region with radius\n200--300 pc, an order of magnitude smaller than the typical value in the Milky\nWay \\citep{2012ApJ...750..126M}. Meanwhile, a strong suppression of the\ndiffusion coefficient around a SNR due to excitation of magnetic\nturbulence by escaping CRs\nwas predicted some time before the HAWC observations were reported \\citep[e.g.,][see also references therein]{2008AdSpR..42..486P,MalkovEtAl:2013,2016PhRvD..94h3003D}. A similar mechanism may also be at work in PWN.\n\nIn this paper the two-zone diffusion model is explored using the latest\nversion of the GALPROP\\footnote{\\url{http:\/\/galprop.stanford.edu} \\label{url}}\npropagation code \\citep{PorterEtAl:2017,JohannessonEtAl:2018}. The results indicate that such a model is a viable interpretation for the HAWC observations and confirm similar conclusions made by other authors. Predictions for lower-energy $\\gamma$-ray{} emission that can be observed with the {\\it Fermi} Large Area Telescope\n({\\em Fermi}-LAT) are made and the contribution of energetic positrons coming from Geminga to the\nobserved CR positron flux in different scenarios is studied. Effects of the\nsize of the slower diffusion zone (SDZ) and the properties of the accelerated electrons\/positrons are taken into\naccount as is the effect of the proper motion of Geminga. Unless\nboth Geminga and PSR~B0656+14 are special cases there are expectations for more regions of\nslower diffusion around other PWNe in the Milky Way. The implications that\nsuch inhomogeneity of the diffusion in the ISM can have on the CR distribution\nthroughout the Milky Way is also explored.\n\n\\section{A Model for Geminga}\n\n\\subsection{Physical Setup}\n\nIt is assumed that the Geminga pulsar is injecting accelerated electrons and\npositrons into the ISM in equal numbers with a fraction $\\eta$ of its\nspin-down power converted to pairs. After injection the particles\npropagate via a diffusive process. The pulsar\nparameters used for this paper are identical to those from\n\\citet{AbeysekaraEtAl:2017} and the\nenergy distribution of the injected electrons\/positrons is described with a\nsmoothly joined broken power-law\n\\begin{equation}\n \\frac{dn}{dp} \\propto E_k^{-\\gamma_0}\\left[ 1 + \\left( \\frac{E_k}{E_b}\n \\right)^\\frac{\\gamma_1-\\gamma_0}{s} \\right]^{-s}.\n \\label{eq:injectionSpectrum}\n\\end{equation}\nHere $n$ is the number density of electrons\/positrons, $p$ is the particle\nmomentum, $E_k$ is the particle kinetic energy, and $\\gamma_1$ is a\npower-law index at high energies. The smoothness parameter $s=0.5$ is assumed\nconstant and so is the low-energy index $\\gamma_0 = -1$ and the break energy\n$E_b=10$~GeV. This low-energy break effectively truncates the injected particle spectrum that is not expected to extend unbroken to lower energies \\citep[e.g.,][]{Amato:2014}. The break is required to keep the value of $\\eta$ below 1 for the largest values of $\\gamma_0$ considered. The truncation occurs at energies below that explored in this paper and has no effect on the results.\nThe injection spectrum is normalized so that the total power injected is given by the expression\n\\begin{equation}\n L(t) = \\eta \\dot{E}_0 \\left( 1 + \\frac{t}{\\tau_0} \\right)^{-2},\n \\label{eq:PulsarPower}\n\\end{equation}\nwhere $\\dot{E}_0$ is the initial spin-down power of the pulsar, and $\\tau_0 =\n13$~kyr. The initial spin-down power is calculated using the current\nspin-down power of $\\dot{E}=3.26\\times10^{34}$ erg s$^{-1}$ assuming that the\npulsar age is $T_p = 340$~kyr. The distance to Geminga has been determined to\nbe 250~pc \\citep{FahertyEtAl:2007}. The spatial grid for the propagation\ncalculations with GALPROP is right handed with the Galactic centre (GC) at the origin, the Sun\nat $(x,y,z)=(8.5, 0, 0)$~kpc, and the $z$-axis oriented toward the Galactic\nnorth pole. This coordinate system places Geminga at $(8.7407, 0.0651, 0.0186)$~kpc at the current epoch.\n\nPrevious interpretations of the HAWC observations have assumed that the Geminga\npulsar is a stationary object\n\\citep{ProfumoEtAl:2018,TangPiran:2018,FangEtAl:2018,EvoliEtAl:2018}. Only\n\\citet{TangPiran:2018} discussed the effect of the proper motion of Geminga,\nbut concluded that it has little effect on electrons generating the observed\nTeV $\\gamma$-ray{} emission because of their short cooling timescale.\n\\citet{FahertyEtAl:2007} measured the proper motion of Geminga to be 107.5 mas\nyr$^{-1}$ in right ascension and 142.1 mas yr$^{-1}$ in declination. Transforming this into\nGalactic coordinates leads to $-80.0$ mas yr$^{-1}$ in longitude and 156.0 mas\nyr$^{-1}$ in latitude.\nAssuming a constant proper velocity that is currently\nperpendicular to the line-of-sight, the corresponding velocity in the spatial\ngrid coordinate system is $(v_x, v_y, v_z) = (24.3, -89.9,\n182.6)$~km s$^{-1}$ with Geminga originally located at $(8.7320, 0.0963, -0.0449)$~kpc. \nIn this case, Geminga was born in a SN explosion of a star that\nhas travelled from the direction of the Orion OB1a association\n\\citep{SmithEtAl:1994}. While the TeV $\\gamma$-ray{} emission is not significantly\naffected by the proper motion, the large traveled distance and proximity of\nGeminga to the Sun should produce a ``trailing'' tail of CRs whose $\\gamma$-ray{} emissions may be observable\nat lower energies with {\\em Fermi}-LAT.\n\nFor the two-zone diffusion model, the diffusion coefficient in a confined\nregion around the pulsar is assumed to be lower than that in the ISM due to\nthe increased turbulence of the magnetic field.\nThis region will hereafter be called a ``slower diffusion zone'' (SDZ). \nIt is also assumed that the stronger turbulence does not change the power\nspectrum and hence the rigidity dependence of the diffusion coefficient is the\nsame for the SDZ and the ISM. Let $r$ be the distance from the center of the\nSDZ, then the spatial dependence of the diffusion coefficient is given by\n\\begin{equation}\n D\\!=\\!\\beta \\left( \\frac{R}{R_0} \\right)^\\delta\n \\begin{cases}\n \\displaystyle D_z, & r < r_z, \\\\\n \\displaystyle D_z \\left[ \\frac{D_0}{D_z} \\right]^{\\frac{r-r_z}{r_t-r_z}}, & r_z \\le r \\le r_t, \\\\\n D_0, & r > r_t. \n \\end{cases} \n \\label{eq:diffusion}\n\\end{equation}\nHere $\\beta$ is the particle velocity in units of the speed of light,\n$D_0$ is the normalization of the diffusion coefficient in the general ISM,\n$D_z$ is the normalization of the diffusion coefficient within the SDZ\nwith radius $r_z$, $R$ is the particle rigidity, and $R_0=4$ GV is the normalization (reference) rigidity. In the transitional layer between $r_z$ and $r_t$, the\nnormalization of the diffusion coefficient increases exponentially with $r$\nfrom $D_z$ to the interstellar value $D_0$. Depending on the exact origin of\nthe SDZ, its radius can be time dependent as can its location. To be\nconsistent with the HAWC observations, both $r_z$ and $r_t$ have to be of the\norder of a few tens of pc at the current time.\n\nThe effect of the SDZ around the PWN on the spectra and distribution of\ninjected electrons\/positrons and their emission may depend on its origin. \nTwo general categories distinguished by the origin of the SDZ are\nconsidered. For the first category the SDZ is due to events external to the PWN itself (external SDZ) that may be related to the\nprogenitor SNR, or surrounding environment. It is assumed that the\nparticle propagation time in the zone is much longer than the time necessary\nto generate such a zone itself (``instant'' generation) and its location is\nfixed. For the second category, the SDZ is assumed to be associated with and\ngenerated by the PWN itself (PWN SDZ).\nTherefore, the SDZ is moving with the Geminga pulsar and its size increases\nproportionally to the square root of time. This is in qualitative\nagreement with the evolution of a PWN as determined from simulations\n\\citep[e.g.][]{vanderSwaluw:2003}.\n\nFor the PWN SDZ, the expectation is that there may be a link\nbetween the pulsar that is generating the magnetic turbulence and the surrounding\ninterstellar plasma. In this case, the pulsar would transfer a momentum to the medium within the SDZ.\nTo estimate the evolution of the velocity of Geminga a simple model is put forward. It is assumed that\nthe radius of the SDZ region $r_z$ around Geminga is increasing in a diffusive manner so that $r_z(t) = \\mu \\sqrt{t}$, where $\\mu$ is a constant. It is further assumed that a fraction $f$ of the ISM within\n$r_z$ is swept by the PWN and sped up to the velocity $v$ of the pulsar. Using conservation of momentum $dp = -v dM$ gives\n$v=v_0 (M_0\/M)^2$, where $v_0$ and $M_0\\approx M_\\odot$ are the initial velocity and mass of the system, respectively.\nSubstitution of $r_z(t)$ and $v(M)$ into the mass conservation formula $dM = f \\pi \\rho r_z^2 v dt$, yields the time evolution of the velocity of Geminga:\n\\begin{equation}\n v = \\frac{v_0}{\\left(3 A_d v_0 t^2 \/2 + 1\\right)^{2\/3}}.\n \\label{eq:vDiffusion}\n\\end{equation}\nHere $A_d = f \\pi \\rho \\mu^2 \/ M_0$ is the drag coefficient and $\\rho \\approx\n0.03$~$M_\\odot$~pc$^{-3}$ is the mass density of the ISM.\nEq.~(\\ref{eq:vDiffusion}) can be integrated to get the full traveled distance:\n\\begin{equation}\n \\lambda(t) = v_0 t\\ _2F_1\\left( \\frac{1}{2}, \\frac{2}{3}; \\frac{3}{2}; -\\frac{3 A_d v_0 t^2}{2} \\right),\n \\label{eq:lDiffusion}\n\\end{equation}\nwhere $_2F_1$ is the hypergeometric function. Further assuming that $r_z(T_p)\n\\approx 30$~pc and that $f\\approx 10^{-3}$, the distance traveled by Geminga\nis $\\lambda(T_p) \\approx 330$~pc and its initial velocity is $v_0 \\approx\n4300$~km s$^{-1}$. This places the birth of Geminga at the location of Orion\nOB1a, which is at a distance of 330~pc from its current location. \nThis is a very intriguing possibility, but in this case $v_0$ is much higher\nthan the observed velocities of any other neutron stars that reach only up to\n1000~km s$^{-1}$ \\citep[e.g.,][]{HobbsEtAl:2005}. Assuming $f\\approx 10^{-4}$\nresults in a more reasonable speed of $v_0 \\approx 400$~km s$^{-1}$ and a\ntotal distance traveled of $\\lambda(T_p) \\approx 100$~pc. A moderate slow\ndown agrees with observations of older pulsars having, on average, smaller velocities than young pulsars \\citep{HobbsEtAl:2005}.\n\n\n\\subsection{Calculation Setup}\n\nThe calculations are made using the latest release of the GALPROP\ncode\\textsuperscript{\\ref{url}} \\citep{PorterEtAl:2017,\nJohannessonEtAl:2018}. The GALPROP code solves the diffusion-advection\nequation in three spatial dimensions allowing for diffusive re-acceleration in\nthe ISM -- see the website and GALPROP team papers for full details. Of major\nrelevance for this paper, the code fully accounts for energy losses due to synchrotron\nradiation and inverse Compton (IC) scattering. The resulting synchrotron and\nIC emission is calculated for an observer located at the position of the Solar\nsystem. The IC calculations \\citep{2000ApJ...528..357M} take into account the\nanisotropy of the interstellar radiation field (ISRF). The current\ncalculations employ the magnetic field model of \\citet{SunEtAl:2008} described\nby their Eq.~(7) and the R12 model for the ISRF developed by\n\\citet{PorterEtAl:2017}. While the turbulent magnetic field\nis expected to be larger in the SDZ, the magnetic field model is not updated\nto account for this. The expected increase in the synchrotron cooling rate and\ncorresponding electromagnetic emissions will not significantly affect the results presented below.\n\nThe code has also been enhanced to use\nnon-equidistant grids to allow for increased resolution in particular areas of\nthe Milky Way, in this case around Geminga.\nThis improvement to {\\it GALPROP}\\ is inspired by the the Pencil Code\\footnote{See Section 5.4 of\n \\url{http:\/\/pencil-code.nordita.org\/doc\/manual.pdf}}\n\\citep{BrandenburgDobler:2002}, where the usage of analytic functions can have advantages in terms of speed and memory usage compared to purely numerical implementations for non-uniform grid spacing.\nThe current run uses the grid function\n\\begin{equation}\n z(\\zeta) = \\frac{\\epsilon}{a}\\tan\\left[ a\\left( \\zeta - \\zeta_0 \\right) \\right] + z_0\n \\label{eq:gridFunction}\n\\end{equation}\nfor all spatial coordinates $\\zeta = x, y, z$, where $\\epsilon, a, \\zeta_0, z_0$\nare parameters. This function maps from the linear grid $\\zeta$ to the\nnon-linear grid in each of the spatial coordinates $x, y, z$. The equations are solved on the $\\zeta$ grid after the\ndifferential equations have been updated to account for the change in first\nand second derivatives.\n\nThe parameters of the grid function are chosen such that the resolution is 2\npc at a central location that is defined below for each calculation, but goes\nup to $0.1$\\,kpc at a distance of $700$\\,pc from the grid center. This setup\nprovides about 0.2 degree resolution on the sky for objects\nlocated at a distance of 250~pc along the line of sight towards the center of the\ngrid. To minimize artificial asymmetry, the grid\nhas the current location of Geminga close to the center of\na pixel and close enough to the center of the non-equidistant grid so that\nthere is little distortion due to the variable pixel size. For the chosen\nparameters the grid size is approximately uniform within a box having a width of\n$\\sim60$~pc, which is not enough to enclose the entire evolution of the\nGeminga PWN. The resolution and size of the grid is bounded by computation costs; the selected parameters are a result of a compromise\nbetween accuracy, memory requirements, and computation speed. This\nnecessarily means that the start and (or) the end of the evolution of Geminga are (is) not fully resolved. Because the diffusion process smooths the distribution of particles as time evolves, the grid is chosen such that the current location of Geminga, and hence the TeV $\\gamma$-ray{} emission, is\nalways well resolved, but sometimes this may come with a small decrease of spatial resolution at its birth place.\n\nThe calculations are performed in a square box with a width of 8~kpc.\nThis is wide enough so that the CR propagation calculations in the Solar neighborhood are not affected by the boundary conditions. The non-equidistant grid allows the boundaries to be extended this far without imposing large computational\ncosts. A fixed timestep of 50 years is\nused for the calculations. This is small enough to capture the propagation and\nenergy losses near the upper boundary of the energy grid, which is 1~PeV. The\nupper energy boundary is chosen to be well above that for the particles\nproducing the HAWC data. The lower energy\nboundary is set at 100 MeV, much lower than the cutoff in the injection\nspectrum. The energy grid is logarithmic with 16 bins per decade.\n\nThe values of $D_0 = 4.5 \\times 10^{28}$ cm$^2$ s$^{-1}$ and $\\delta=0.35$ are\nchosen to match the latest AMS-02 data on secondary CR species (see Section~\\ref{sec:MW}). The SDZ diffusion coefficient of $D_z = 1.3 \\times 10^{26}$ cm$^2$ s$^{-1}$ at $R_0=4$ GV corresponds to the value derived from the HAWC observations at higher energies \\citet{AbeysekaraEtAl:2017}. No attempt is made to independently fit the latter to the HAWC observations because each propagation calculation is\ncomputationally expensive, taking $\\sim$ 24\nhours to complete on a modern 40 core CPU. The calculations also include\ndiffusive re-acceleration with an Alfv{\\'e}n speed $v_A = 17$~km s$^{-1}$, as determined from the fit to the secondary-to-primary data. \nTo save CPU time the calculations are made using electrons only,\nbecause the energy losses and propagation of positrons and electrons are\nidentical. When comparing to the measured positron flux at Earth, the\ncalculated particle flux is simply divided by two. The IC emission is\ncalculated on a HEALPix \\citep{GorskiEtAl:2005} grid having an order of 9\ngiving a resolution of about 0.1 degrees. The IC emission is evaluated on a\nlogarithmic grid in energy from 10~GeV to 40~TeV with 32 energy planes.\n\n\\subsection{Results}\n\n\\begin{figure}[tb]\n \\centering\n \\includegraphics[width=0.48\\textwidth]{fig1a}\\\\\n \\includegraphics[width=0.48\\textwidth]{fig1b}\n \\caption{Surface brightness of the modelled IC emission shown as a function\n of angular distance from the current location of Geminga. The models shown\n here assume Geminga is stationary, $\\gamma_1=2.0$, and the SDZ is\n stationary and centered at Geminga. The top panel shows the energy range\n 8~TeV to 40~TeV compared to the observations of HAWC\n \\citep{AbeysekaraEtAl:2017}. The bottom panel shows the model predictions\n for the energy range 10~GeV to 30~GeV. The different curves represent\ndifferent assumptions about the size of the SDZ, encoded as SDZ($r_z$, $r_t$)\nin the legend.}\n \\label{fig:StationarySB}\n\\end{figure}\n\n\nFor a comparison with results of previous studies the first set of calculations is performed\nassuming that there is no proper motion of Geminga. The index of the injection spectrum is\nfixed to $\\gamma_1 = 2.0$ and the efficiency parameter is $\\eta=0.26$. The SDZ\nis centered at the current location of Geminga $(l_G, b_G) = (195.\\!\\!^\\circ14, 4.\\!\\!^\\circ26)$ and is static in size. The spatial grid is also centered\nat the same location. Several combinations of $(r_z,r_t)$ are used,\ncovering a range \nfrom 30~pc to 50~pc for $r_z$ and from 50~pc to 70~pc for $r_t$. \nCalculations are also made using a model with $(r_z,r_t) =\n(\\infty, \\infty)$ for a comparison with the results from\n\\citet{AbeysekaraEtAl:2017}. Figure~\\ref{fig:StationarySB} (top panel) shows the angular\nprofile of the surface brightness of the modeled IC emission evaluated over the\nenergy range from 8~TeV to 40~TeV and compared with the data from HAWC. The\nresulting profile is clearly independent of the size of the SDZ,\nbecause the cooling time limits the diffusion length at the corresponding CR\nelectron energies ($\\gtrsim 100$~TeV) to be $\\lesssim 10$~pc. The same cannot be said for the IC emission evaluated\nfor the energy range from 10~GeV to 30~GeV, which is also shown in\nFigure~\\ref{fig:StationarySB} (bottom panel). Because of the longer cooling timescales the\nemission profile is highly sensitive to the size of the SDZ, via both $r_z$\nand $r_t$. A smaller SDZ\nsize leads to a correspondingly lower number density of CR electrons\/positrons within the zone, which produces a flatter profile and fainter emission in the GeV energy\nrange.\n\n\\begin{figure}[tb]\n \\centering\n \\includegraphics[width=0.48\\textwidth]{fig2a}\\\\\n \\includegraphics[width=0.48\\textwidth]{fig2b}\n \\caption{Spectrum of IC emission averaged over a $10^\\circ$ wide region\n around the current location of Geminga. The models shown here assume\n Geminga is stationary and that the SDZ is stationary and centered at\n Geminga. The top panel shows the spectrum for different values of\n $\\gamma_1$ as indicated in the legend, but using fixed values of $(r_z,\n r_t)=(30,50)$~pc. The bottom panel shows the spectrum for models with\n different pairs of $(r_z, r_t)$, but fixed value of $\\gamma_1=2.0$. The\n green shaded region corresponds to HAWC observations assuming a diffusion\n profile for the spatial distribution \\citep{AbeysekaraEtAl:2017} and the\n magenta arrow is the upper limit from observations with the MAGIC telescope\n corrected for the diffusion profile \\citep{TangPiran:2018}.}\n \\label{fig:StationarySpectrum}\n\\end{figure}\n\nCalculations with different values of $\\gamma_1=1.8$ and 2.2 \nare made using $(r_z, r_t)=(30,50)$~pc. The conversion efficiency, $\\eta$, is\ncorrespondingly updated for these models to provide consistency with the HAWC data. The values are\n$\\eta = 0.18$ and $\\eta = 0.75$ for $\\gamma_1=1.8$ and $\\gamma_1=2.2$,\nrespectively. The average spectrum of the IC emission over a circular region\nof $10^\\circ$ in radius around the current location of Geminga is shown in\nFigure~\\ref{fig:StationarySpectrum}. The models are all tuned to agree\nwith the HAWC data and, therefore, the predicted profiles differ significantly at lower energies.\nAlso shown is the prediction made using the isotropic assumption for the IC\ncross section (dotted curve in upper panel), which is a commonly used approximation that ignores the angular dependence of the ISRF.\nUsing the isotropic approximation under-predicts the emission by $\\sim$10\\% at 10~TeV, and $\\sim25$\\% at 10~GeV. The discrepancy between the IC\nemission calculated with the realistic angular distribution of the ISRF and\nwith the isotropic distribution depends on the adopted electron injection spectrum\nand the size of the SDZ, with softer injection spectra and larger SDZs producing larger differences. \n\nKinematically, the energy dependence of the discrepancy can be understood where the very highest energy $\\gamma$-ray{s} are produced in head-on collisions from back-scattered soft photons, where the ultrarelativistic electrons ``see'' the angular distribution of soft photons concentrated in a narrow (head on) beam. Meanwhile, for lower electron energies the angular distribution of the background photons is considerably more important and more significantly affects the energy of the upscattered $\\gamma$-ray{s}. \nThe softer injection spectra have more low-energy electrons and there is more confinement for low-energy electrons for larger sizes of the SDZ. \nThe surface brightness profile is also slightly affected\nby the isotropic assumption of the IC emission as shown in Figure~\\ref{fig:StationarySB} (bottom panel).\nThe profile is more peaked\nunder the isotropic assumption; the under-prediction in the wings of the\nprofile is $\\sim$ 10\\% deeper than near the center.\nConsequently, using the averaging made for the isotropic approximation has some effect that can produce an incorrect determination of the diffusion coefficient from the shape of the profile.\n\nAlso shown in\nFigure~\\ref{fig:StationarySpectrum} is the effect of the size of the SDZ on\nthe average spectrum. A larger SDZ size results in a larger electron number density that, in turn, leads to an increased emission in the GeV energy range. The observations made with the MAGIC telescope\n(\\citealp{AhnenEtAl:2016}, updated to match the diffusion profile by\n\\citealp{TangPiran:2018}) constrain both the particle injection spectrum and\nthe size of the SDZ. A smaller SDZ and\/or harder particle injection spectrum\nis required by the observations.\nThe perceived degeneracy between the size of the SDZ and the\ninjected spectrum of the particles from this Figure is broken when the angular\nprofile of the low-energy emission is taken into account. Changing the injection spectrum\nwill not affect the shape of the angular profile while changing the SDZ size does. The angular extent of the emission should therefore\nbe a good indicator of the size of the SDZ.\n\n\\begin{figure}[tb]\n \\centering\n \\includegraphics[width=0.48\\textwidth]{fig3a}\\\\\n \\includegraphics[width=0.48\\textwidth]{fig3b}\n \\caption{\nPredicted flux of positrons at Earth. The models shown here assume Geminga is\nstationary and that the SDZ is stationary and centered at the current location\nof Geminga. The top panel shows the spectrum for different values of\n$\\gamma_1$ as indicated in the legend, but using a fixed SDZ size $(r_z,\nr_t)=(30,50)$~pc. The bottom panel shows the spectrum for models with different\npairs of $(r_z, r_t)$, but fixed value of $\\gamma_1=2.0$. The points are\nAMS-02 data \\citep{AguilarEtAl:2014}.}\n \\label{fig:StationaryPositronSpectrum}\n\\end{figure}\n\nOne of the main conclusions of the study by \\citet{AbeysekaraEtAl:2017} is\nthat the unexpected rise in the positron fraction as measured by PAMELA\n\\citep{AdrianiEtAl:2009}, {\\em Fermi}-LAT{} \\citep{AckermannEtAl:2012}, and AMS-02\n\\citep{2013PhRvL.110n1102A,AguilarEtAl:2014,2014PhRvL.113l1101A} cannot be due\nto the positrons accelerated by the Geminga PWN. This conclusion is based on a\none-zone diffusion model constructed to agree with the HAWC data. For a two-zone diffusion model the\nconclusion can be quite different. \\citet{ProfumoEtAl:2018} and\n\\citet{FangEtAl:2018} found that the positron excess could easily be\nreproduced with such a model using a power-law injection spectrum for\npositrons (and electrons) with index of $2.34$ and $2.2$, respectively.\n\\citet{TangPiran:2018} also used data from the MAGIC telescope to\nconstrain the model and found\nthat a harder particle injection spectrum below a break energy of 30~TeV was\nnecessary, which \nresulted in a calculated positron flux at Earth that did not fully explain the rise in the positron fraction.\n\nFigure~\\ref{fig:StationaryPositronSpectrum} shows the positron flux at Earth as predicted by the models considered in this paper,\nwhere the top and bottom panels illustrate models with different SDZ sizes, and the effect of changing $\\gamma_1$, respectively. The results clearly show a strong\nvariation in the expected positron flux at Earth. A smaller SDZ\nleads to larger flux of positrons at Earth because of the larger\n\\emph{effective} diffusion coefficient. Only if the SDZ extends all the way to\nthe Solar system are the results of \\citet{AbeysekaraEtAl:2017} reproduced. Larger\nvalues of $\\gamma_1$ also results in a larger positron flux at Earth in the observed\nenergy range, meanwhile values larger than $\\gamma_1 \\approx 2.2$ are excluded\nas the predicted positron flux would exceed the data for a \nSDZ of size $(r_z,r_t)=(30,50)$~pc.\n\nSo far the calculations have been made considering a\nstationary source located at the current position of Geminga $(l_G, b_G)$.\nHowever, such an approximation is not supported by its observed large proper motion.\nIn the following analysis, the proper motion is taken into account, but different\nassumptions are made on the origin of the SDZ and the value of\nthe drag coefficient $A_d$ introduced in Eq.~(\\ref{eq:vDiffusion}). The\ndifferent assumptions are referred to as scenarios A to D and detailed below.\nFor scenarios A and B, the SDZ is assumed to be stationary and is unrelated to\nGeminga. In both scenarios, $A_d=0$ and the pulsar velocity is constant.\nScenario A assumes that the SDZ is centered on the current position of\nGeminga by chance,\nand that the parameters of the zone are:\n$(r_z,r_t)=(30,50)$~pc. Scenario B assumes that the SDZ is centered at the\nbirth place of Geminga. In this scenario\nthe SDZ has to be much larger to extend from the birth place of Geminga to its\ncurrent location, $(r_z,r_t)=(90,110)$~pc. The\ncenter of the spatial grid is placed at $(8.7358, 0.0962,\n-0.0124)$~kpc for both these scenarios. This is about half-way between the birth place and the current\nlocation of Geminga for the $x$- and $y$-axes, but only a quarter of the way\nfor the $z$-axis. As described earlier, the location of the center of the grid is set to give the current location of Geminga preference over its birth location.\n\n\\begin{figure}[tb]\n \\centering\n \\includegraphics[width=0.48\\textwidth]{fig4}\n \\caption{\nSurface brightness of the modeled IC emission for scenarios A through D shown as a function of the angular distance from the current location of Geminga. Also shown is the profile for the model with a stationary Geminga PWN with $(r_z,r_t)=(30,50)$~pc and $\\gamma_1=2.0$. The data points show the profile observed by HAWC \\citep{AbeysekaraEtAl:2017}.}\n \\label{fig:ProfilesScenarios}\n\\end{figure}\n\n\\begin{figure*}[tb]\n \\centering\n \\includegraphics[width=0.49\\textwidth]{fig5a}\n \\includegraphics[width=0.49\\textwidth]{fig5b}\\\\\n \\includegraphics[width=0.49\\textwidth]{fig5c}\n \\includegraphics[width=0.49\\textwidth]{fig5d}\n \\caption{\nIC intensity maps evaluated at 10~GeV around the current location of Geminga. Shown are maps for scenarios A (top left), B (top right), C (bottom left), and D (bottom right). The maps are displayed using the colormap bgyw from the colorcet package \\citep{Kovesi:2015}.\n }\n \\label{fig:Maps10GeV}\n\\end{figure*}\n\n\\begin{figure}[tb]\n \\centering\n \\includegraphics[width=0.48\\textwidth]{fig6}\n \\caption{\nPredicted positron fluxes at Earth for scenarios A through D. Also shown are the results for a model where Geminga is stationary with $(r_z,r_t)=(30,50)$~pc and $\\gamma_1=2.0$. The points are AMS-02 data \\citep{AguilarEtAl:2014}.}\n \\label{fig:PositronsScenarios}\n\\end{figure}\n\n\\begin{figure}[tb]\n \\centering\n \\includegraphics[width=0.48\\textwidth]{fig7}\n \\caption{\nSynchrotron intensity averaged over a region around the current location of Geminga with a radius of $1^\\circ$ for scenarios A through D. Also shown are the\nresults for a model where Geminga is stationary with $(r_z,r_t)=(30,50)$~pc\nand $\\gamma_1=2.0$.}\n \\label{fig:SynchrotronScenarios}\n\\end{figure}\n\nFor scenarios C and D, the center of the SDZ follows the location of Geminga\nand its size increases proportionally to the square root of time, normalized such that the final size of the SDZ is\n$(r_z,r_t)=(30,50)$~pc. The difference between these two scenarios is the value\nof the drag coefficient, $A_d$. In scenario C, $A_d=0$ and the velocity is\nconstant over time, while in scenario D,\n$A_d=2.636\\times10^{-8}$~pc$^{-1}$~yr$^{-1}$ giving Geminga an initial\nvelocity of $410$~km~s$^{-1}$ at a\nposition of $(8.72775, 0.113017, -0.0787255)$~kpc.\nFor numerical stability the gradient of the diffusion coefficient is limited to be less than one order of magnitude per grid pixel.\nBecause the ratio $D_0\/D_z \\sim 300$, it is necessary to increase $D_z$ initially for scenarios C and D to fulfill this condition\nuntil the difference between $r_t$ and $r_z$ corresponds to the size of 2 pixels in all directions of the grid. Correspondingly, $D_z$\nis increased by up to an order of magnitude for the first few thousand years\nonly, but this stability requirement does not significantly affect the results.\nThe center of the spatial grid in scenario C is the same as that in\nscenarios A and B, while in scenario D the center of the grid is at $(8.7300,\n0.1075, -0.0213)$~kpc to better resolve the entire evolution of Geminga.\nAgain the center is about half-way between the origin\nand current location of Geminga for $x$- and $y$-axes, but only a quarter of\nthe way for the $z$-axis. For scenarios A through D the variables $(r_t,\nr_z)$ are fixed to the values provided above and $\\gamma_1=2.0$. \n\nFigure~\\ref{fig:ProfilesScenarios} shows the angular profile of the surface\nbrightness in the energy range 8~TeV to 40~TeV compared to the HAWC\nobservations \\citep{AbeysekaraEtAl:2017}. For comparison the results of the\nmodel with stationary Geminga, $(r_z,r_t)=(30,50)$~pc and $\\gamma_1=2.0$ are\nalso shown. As expected, all models agree well with the data and\nsignificantly overlap. Though it is not seen in the Figure, the emission is\nstill reasonably symmetric around the current location of Geminga. To\n quantify the symmetry, the standard deviation of the distribution of\nintensities of pixels in the calculated HEALPix maps within each angular bin\nis calculated. The\nstandard deviation in each angular bin is of the order of 5\\% to 10\\% only.\nMeanwhile, some differences between models are also noticeable: the largest\nstandard deviation of the emission core is seen in scenario D because of the\nlarger proper velocity of the PWN, while the largest deviation in the tail is\nseen in scenario B with the largest SDZ size.\n\nIn contrast, at lower energies all models produce quite different\ndistributions of the surface brightness. In particular, considerable asymmetry in the intensity maps around 10 GeV is seen in\nFigure~\\ref{fig:Maps10GeV}, especially for scenario B with the largest SDZ.\nAll scenarios where Geminga is moving show a distinctive tail in the low\nenergy range. In the extreme case of scenario B the tail is exceptionally\nbroad and the emission of the tail is, in fact, much brighter than that at the\ncurrent location of Geminga. The differences between other scenarios are small\nand hard to distinguish in these maps. The tail in scenario C is slightly\nmore extended than in scenarios A and D. Observations of the Geminga PWN at\n10 GeV will thus hardly be able to distinguish between these scenarios,\nbut may be able to verify the presence of the tail in Scenario B.\n\nDespite their similar $\\gamma$-ray{} emission maps (with exception of\nscenario B), all scenarios predict different positron fluxes at Earth\n(Figure~\\ref{fig:PositronsScenarios}). For energies below 1 TeV, the positron\nflux in scenario A is about a factor of 5 larger than that predicted for\nscenarios C and D. The difference between scenarios C and D is much smaller\nand mostly at the highest energies where scenario D produces a higher flux.\nThis is due to the faster movement of the diffusion zone in scenario D that\nallows the CR particles to escape quickly once the diffusion zone has left\nthem behind. This is somewhat idealized and it is more likely that the SDZ\nwill have a shape elongated along the direction of motion. For such a case\nthe results would become closer to scenario B, with a longer IC emission tail\nat low energies and smaller flux of positrons at low and high energies, but\nwith a larger peak at around 300~GeV.\n\nIn addition to IC emission, GALPROP can calculate the predicted synchrotron emission from the models. In a magnetic field with a strength of several $\\mu$G, as is expected in the vicinity of Geminga, the particles responsible for the TeV $\\gamma$-ray-emission will also emit synchrotron photons with energies of $\\sim$ keV. Because of the shape of the electron\/positron spectrum of the injected particles from Geminga, the emission in radio and mm wavelengths is significantly dimmer than that from CR electrons from the Milky Way at large. At keV energies the synchrotron emission follows a profile similar to that of the TeV IC emission, being peaked at the current location of Geminga with a half-width of about a degree. Figure~\\ref{fig:SynchrotronScenarios} shows the spectrum of the average intensity of the synchrotron emission within a degree of the current location of Geminga. All the models considered predict a similar intensity level of the emission that approximately follows a power-law $I\\propto E^{-1.8}$. The calculations are cut off at few 10s of keV because the electron spectrum can only be reliably determined up to the energies corresponding to the HAWC observations, anything beyond that is an extrapolation. This energy is reached already at a few keV in the synchrotron spectrum. The synchrotron emission is close to the level of the diffuse X-ray emission observed in the Milky Way ridge \\citep{2000ApJ...534..277V}, but significantly less intense than that observed from the Geminga pulsar and the apparent nearby tails \\citep{2010ApJ...715...66P}.\n\n\n\n\\section{Implications for Propagation Throughout the Milky Way}\n\\label{sec:MW}\n\nIf the result for the two PWNe reported in \\citet{AbeysekaraEtAl:2017} are not special cases, then it is likely that there are similar pockets of slow diffusion around many CR sources elsewhere in the Milky Way. The effective diffusion coefficient would thus be smaller in regions where the number density of CR sources is higher. \nSecondary CR species with different inelastic production cross sections (e.g., $\\bar{p}$ vs.\\ B) probe different propagation distances. Interpretations of their data would yield different average diffusion coefficients as was indeed found by \\citet{JohannessonEtAl:2016}. \nStarburst galaxies with large star formation rate are expected to have very slow diffusion and should exhibit an energy-loss-dominated spectrum of $\\gamma$-ray{} emission that is much flatter than that observed from galaxies where the leakage of CRs dominates the energy losses. Interestingly, exactly such evolution of the spectral shape is observed when galaxies with different star formation rate, such as the Magellanic Clouds, Milky Way, M31 vs.\\ NGC 253, NGC 4945, M82, NGC 1068, are compared \\citep[][and references therein]{2012ApJ...755..164A}.\n\nHere it is assumed that the distribution of SDZs follows that of the CR sources, while the exact origin of these SDZs is not essential. With current CR propagation codes and reasonable resources resolving the entire Milky Way with a few pc grid size on short time scales is intractable.\nA simpler approach must, therefore, be taken to explore the effects such SDZs have on the propagation of CRs throughout the Milky Way. Assuming that the properties of CR propagation and the distribution of CR sources vary on-average very little over the residence time of CRs in the Milky Way, a steady-state model can be used. Also assuming that the residence time of CRs in the Milky Way is larger than the active injection time of the CR sources, the CR source distribution can be assumed smooth with injected power that approximates as constant with time.\nThese two approximations have been extensively used in the past and are the starting point of almost all studies on CR propagation across the Milky Way.\n\nAs was shown in the previous Section, the effect of an SDZ is a local increase of the density of CRs for a certain period of time, leading to an increase of CR reaction rates with the ISM contained within the SDZ. CRs thus spend more time in the vicinity of their sources compared to a model with a homogeneous diffusion. This is equivalent to an effective decrease of the diffusion coefficient averaged over a larger volume. Even though, such an approximation does not account for the detailed spatial distribution of the individual SDZs, it does account for the increased interaction rate with the ISM, such as cooling and generation of secondary CR particles. Therefore, this approximation should still provide for the correct spectra and abundances of CR species. \n\nAssuming that CRs first propagate through a SDZ with diffusion coefficient $D_z$ and\nradius $x_z$ that is embedded in a region with diffusion\ncoefficient $D_0$ and radius $x_0 \\gg x_z$, their residence time in the total volume can be estimated as\n\\begin{equation}\n \\tau \\sim \\frac{x_0^2}{D_0} + \\frac{x_z^2}{D_z}.\n \\label{eq:resTimeTwoZone}\n\\end{equation}\nAssuming a single average diffusion coefficient $D$, the residence time can also be expressed as \n\\begin{equation}\n \\tau \\sim \\frac{x_0^2}{D}.\n \\label{eq:resTimeAv}\n\\end{equation}\nCombining the two equations results in\n\\begin{equation}\n D \\approx D_0 \\left[ 1 + \\left( \\frac{x_z}{x_0} \\right)^{2} \\frac{D_0}{D_z}\\right]^{-1}.\n \\label{eq:avDiffusion}\n\\end{equation}\n\nAssuming that there is a SDZ around each CR source, the density of SDZs is\nthe same as the CR source number density, $q(\\vec{x})$, where $\\vec{x}$ is the spatial coordinate. Let $V_z$ be the volume of each SDZ and $\\Delta V$ be the volume of an element in the spatial grid used in the calculation. Then for each volume element\n\\begin{equation}\n \\frac{x_z}{x_0} \\approx \\left[\\frac{V_z}{\\Delta V} \\int_{\\Delta V} q(\\vec{x}) dV\\right]^{1\/3} \\approx \\left[q_x V_z\\right]^{1\/3},\n \\label{eq:xzx0approx}\n\\end{equation}\nwhere $q_x$ is the CR source number density at the center of the volume element. The value $ Q=\\int_V q(\\vec{x}) dV$ is the total number of active CR sources in the Galaxy at any given time, and $QV_z$ is then the combined volume of all SDZs in the Galaxy. \nAssuming that the SN rate is 0.01 year$^{-1}$, and each source continuously accelerates particles for $\\sim$$10^5$ years, there are $\\sim$$10^3$ active CR sources at any given time. Assuming a radius of $x_z\\sim 30$~pc for each source, the combined volume of all SDZs is $QV_z \\approx 0.1$~kpc$^3$.\nThis value is in good agreement with estimates from \\citet{HooperEtAl:2017} and\n\\citet{ProfumoEtAl:2018}.\nThe ratio $x_z\/x_0$ in Eq.~(\\ref{eq:xzx0approx}) depends on the product of the number of SDZs and their sizes.\nBecause of this, equivalent results can be obtained also for, e.g., fewer SDZs of larger sizes, provided that the total occupied volume is the same and their distribution follows $q(\\vec{x})$.\nEq.~(\\ref{eq:avDiffusion}) also depends on the value of $D_0\/D_z$ which is set to 300 in the following calculations, which is similar to the value used in the Geminga calculations. The results described below, therefore, are valid across different model assumptions provided they are consistent with Eq.~(\\ref{eq:avDiffusion}).\n\n\\begin{figure*}[tb]\n \\centering\n \\includegraphics[width=0.49\\textwidth]{fig8a}\n \\includegraphics[width=0.49\\textwidth]{fig8b}\n \\caption{Diffusion coefficient evaluated in the Galactic plane at the normalization rigidity $R_0=4$~GV for a model where the effective diffusion coefficient is given by Eq.~(\\ref{D_distr}). The left panel shows the distribution of the diffusion coefficient for the SA0 model while the right panel for the SA50 model. The location of the Sun is marked as a white star and the GC is at (0,0). The maps are displayed using the colormap bgyw from the colorcet package \\citep{Kovesi:2015}.\n }\n \\label{fig:DiffusionPlane}\n\\end{figure*}\n\nThe modified diffusion described above has been implemented in the\nGALPROP code to test its effect on the propagation of CR species in the Milky Way.\nWith a switch in the configuration file it is now possible to change to a diffusion configuration such that\n\\begin{equation}\n D(\\vec{x}) = D_0 \\left\\{1 + \\left[q\\left( \\vec{x} \\right) V_z \\right]^{2\/3} \\frac{D_0}{D_z} \\right\\}^{-1}.\n \\label{D_distr}\n\\end{equation}\nTherefore, even with $D_0$ and $D_z$ fixed the {\\it effective} diffusion coefficient is still spatially varying, where the total volume of SDZs in the Milky Way is a normalization parameter $QV_z\\approx 0.1$ kpc$^{3}$, as explained above. In principle, the number distribution of CR sources can be different from the distribution of their injected power into CRs in the Milky Way, but here they are assumed identical.\nTwo models SA0 and SA50 are used for the CR source density distribution\n\\citep{PorterEtAl:2017}. The SA0 model is a 2D axisymmetric pulsar-like\ndistribution \\citep{2004A&A...422..545Y} for the CR source density in the disk. The\nSA50 model has half of the injected CR luminosity distributed as the SA0\ndensity and the other half distributed as the spiral arms for the R12 ISRF\nmodel. Each CR source model is\npaired with both a constant homogeneous diffusion and the modified diffusion\ndescribed above resulting in a total of four models. The model calculations are performed on a 3D spatial grid that now includes the whole Milky Way using the grid function defined in Eq.~(\\ref{eq:gridFunction}). The parameters of the grid function are chosen such that the resolution in the $x$- and $y$-coordinates is 200~pc at the GC, increasing to 1 kpc at a distance of 20 kpc which is also the boundary of the grid. At the distance of the Solar system the resolution is about 350~pc in the $x$-direction and the Sun is located at the center of a volume element. In the $z$-direction the resolution is 50~pc in the plane, increasing to 200~pc at the boundary of the grid at $|z|=6$~kpc. The energy grid is logarithmic, ranging from 3~MeV to 30~TeV with 112 energy planes.\n\nThe distribution of the effective diffusion coefficient $D(\\vec{x})$ in the Galactic plane is shown in Figure~\\ref{fig:DiffusionPlane}, where the numbers correspond to its value at the normalization rigidity $R_0=4$~GV.\nThe spiral arm structure of the SA50 model is clearly visible.\nThe maximum change in the effective diffusion coefficient is about a factor of 3, which corresponds to a peak value of $x_z\/x_0 \\sim 10^{-3}$.\nAll models employ the R12 ISRF from \\citet{PorterEtAl:2017} and the 3D gas distributions from \\citet{JohannessonEtAl:2018}.\nThe same standard procedure for parameter adjustment to match\nthe recent observations of CR species listed in Table~\\ref{tab:CRdata} is followed for all source density models.\nSolar modulation is treated using the force-field approximation \\citep{1968ApJ...154.1011G}, one\nmodulation potential value for each observational period. The use of the latter is justified by the available resources and the main objective of this paper, i.e.\\ to study the effect of the modified CR diffusion in a self-consistent manner, rather than to update the local interstellar spectra of CR species or to accurately determine the propagation parameters\\footnote{For a detailed treatment of heliospheric propagation of CRs, see, e.g.,\n \\citet{BoschiniEtAl:2017,BoschiniEtAl:2018b,BoschiniEtAl:2018a} and references therein.}.\nThe procedure for parameter tuning is the same as used by \\citet{PorterEtAl:2017} and \\citet{JohannessonEtAl:2018}.\nThe propagation parameters are first determined by fitting the models to the observed spectra of CR species, Be, B, C, O, Mg, Ne, and Si. These are then\nkept fixed and the injection spectra for electrons, protons, and He fitted\nseparately. To reduce the number of parameters, only the most relevant primary abundances are fitted simultaneously with the propagation parameters while the rest are kept fixed. Because the injection spectra of all CR species are normalized relative to the proton spectrum at normalization energy 100 GeV\/nucleon the procedure is repeated to ensure consistency. One iteration provides a satisfactory accuracy in all cases. The only difference from the procedure described in \\citet{PorterEtAl:2017} and \\citet{JohannessonEtAl:2018} is the inclusion of elemental spectra of Be, C, and O from AMS-02 and the elemental spectra from ACE\/CRIS, while the data from HEAO-C3 and PAMELA has been removed.\n\n\\begin{deluxetable}{lll}[tb!]\n\\tablecolumns{3}\n\\tablewidth{0pc}\n\\tablecaption{Datasets used to derive propagation parameters\n \\label{tab:CRdata}}\n\\tablehead{\n\\multicolumn{1}{l}{Instrument} &\n\\multicolumn{1}{l}{Datasets} &\n\\colhead{Refs.\\tablenotemark{a}}\n}\n\\startdata\nAMS-02 (2011-2016) & Be, B, Be\/B, Be\/C, B\/C, Be\/O, B\/O & I \\\\\nAMS-02 (2011-2016) & C, O, C\/O & II \\\\\nAMS-02 (2011-2013) & e$^-$ & III \\\\\nAMS-02 (2011-2013) & H & IV \\\\\nAMS-02 (2011-2013) & He & V \\\\\nACE\/CRIS (1997-1998) & B, C, O, Ne, Mg, Si & VI \\\\\nVoyager 1 (2012-2015) & H, He, Be, B, C, O, Ne, Mg, Si & VII \n\\enddata\n\\tablenotetext{a}{I: \\citet{AguilarEtAl:2018}, II: \\citet{AguilarEtAl:2017}, III:\n\\citet{AguilarEtAl:2014}, IV: \\citet{AguilarEtAl:2015a}, V:\n\\citet{AguilarEtAl:2015b}, VI: \\citet{GeorgeEtAl:2009}, VII:\n\\citet{CummingsEtAl:2016}}\n\\end{deluxetable}\n\n\\begin{deluxetable}{lcccc}[tb!]\n\\tablecolumns{5}\n\\tablewidth{0pc}\n\\tablecaption{Final propagation model parameters. \\label{tab:CRparameters} }\n\\tablehead{\n & \\multicolumn{2}{l}{Homogeneous diffusion} & \\multicolumn{2}{l}{Modified diffusion} \\\\\n\\multicolumn{1}{l}{Parameter} & \n\\colhead{SA0} & \n\\colhead{SA50} &\n\\colhead{SA0} & \n\\colhead{SA50} \n}\n\\startdata\n\\tablenotemark{a}$D_{0,xx}$ [$10^{28}$cm$^2$\\,s$^{-1}$] & $4.36$ & $4.55$ \n & $4.41$ & $4.78$ \\\\\n\\tablenotemark{a}$\\delta$ & $0.354$ & $0.344$ \n & $0.358$ & $0.360$ \\\\\n$v_{A}$ [km s$^{-1}$] & $17.8$ & $18.1$ \n & $15.7$ & $17.6$ \\smallskip\\\\\n\\tablenotemark{b}$\\gamma_0$ & $1.33$ & $1.43$ \n & $1.40$ & $1.47$ \\\\\n\\tablenotemark{b}$\\gamma_1$ & $2.377$ & $2.399$ \n & $2.403$ & $2.381$ \\\\\n\\tablenotemark{b}$R_1$ [GV] & $3.16$ & $3.44$ \n & $3.80$ & $3.82$ \\\\\n\\tablenotemark{b}$\\gamma_{0,p}$ & $1.96$ & $1.99$ \n & $1.92$ & $1.93$ \\\\\n\\tablenotemark{b}$\\gamma_{1,p}$ & $2.450$ & $2.466$ \n & $2.469$ & $2.453$ \\\\\n\\tablenotemark{b}$\\gamma_{2,p}$ & $2.391$ & $2.355$ \n & $2.359$ & $2.321$ \\\\\n\\tablenotemark{b}$R_{1,p}$ [GV] & $12.0$ & $12.2$ \n & $11.3$ & $11.3$ \\\\\n\\tablenotemark{b}$R_{2,p}$ [GV] & $202$ & $266$ \n & $213$ & $371$ \\\\\n$\\Delta_{\\rm He}$ & $0.033$ & $0.035$ \n & $0.039$ & $0.032$ \\smallskip\\\\\n\\tablenotemark{b} $\\gamma_{0,e}$ & $1.62$ & $1.49$ \n & $1.46$ & $1.46$ \\\\\n\\tablenotemark{b} $\\gamma_{1,e}$ & $2.843$ & $2.766$ \n & $2.787$ & $2.762$ \\\\\n\\tablenotemark{b} $\\gamma_{2,e}$ & $2.494$ & $2.470$ \n & $2.506$ & $2.480$ \\\\\n\\tablenotemark{b} $R_{1,e}$ [GV] & $6.72$ & $5.14$ \n & $5.03$ & $5.13$ \\\\\n\\tablenotemark{b} $R_{2,e}$ [GV] & $52$ & $69$ \n & $69$ & $69$ \\smallskip\\\\\n\\tablenotemark{c}$J_p$ & $4.096$ & $4.113$ \n & $4.102$ & $4.099$ \\\\\n\\tablenotemark{c}$J_e$ & $2.386$ & $2.362$ \n & $2.288$ & $2.345$ \\smallskip\\\\\n\\tablenotemark{d}$q_{0,^{4}\\rm He} \\hfill [10^{-6}]\\qquad\\qquad$ & $ 92495$ & $ 91918$ \n & $ 92094$ & $ 93452$ \\\\\n\\tablenotemark{d}$q_{0,^{12}\\rm C} \\hfill [10^{-6}]\\qquad\\qquad$ & $ 2978$ & $ 2915$ \n & $ 2912$ & $ 2986$ \\\\\n\\tablenotemark{d}$q_{0,^{16}\\rm O} \\hfill [10^{-6}]\\qquad\\qquad$ & $ 3951$ & $ 3852$ \n & $ 3842$ & $ 3956$ \\\\\n\\tablenotemark{d}$q_{0,^{20}\\rm Ne} \\hfill [10^{-6}]\\qquad\\qquad$ & $ 358$ & $ 327$ \n & $ 322$ & $ 359$ \\\\\n\\tablenotemark{d}$q_{0,^{24}\\rm Mg} \\hfill [10^{-6}]\\qquad\\qquad$ & $ 690$ & $ 704$ \n & $ 681$ & $ 744$ \\\\\n\\tablenotemark{d}$q_{0,^{28}\\rm Si} \\hfill [10^{-6}]\\qquad\\qquad$ & $ 801$ & $ 786$ \n & $ 762$ & $ 833$ \\smallskip\\\\\n\\tablenotemark{e}$\\Phi_{\\rm AMS,I}$ [MV] & $ 729$ & $ 741$ \n & $ 709$ & $ 729$ \\\\\n\\tablenotemark{e}$\\Phi_{\\rm AMS,II}$ [MV] & $ 709$ & $ 729$ \n & $ 696$ & $ 729$ \\\\\n\\tablenotemark{e}$\\Phi_{\\rm ACE\/CRIS}$ [MV] & $ 359$ & $ 370$ \n & $ 345$ & $ 354$ \n\\enddata\n\\tablenotetext{a}{$D(R) \\propto \\beta R^{\\delta}$, $D_0$ is the normalization at $R_0=4$~GV. \n}\n\\tablenotetext{b}{The injection spectrum is parameterized as $q(R) \\propto R^{-\\gamma_0}$ for $R \\le R_1$, $q(R) \\propto R^{-\\gamma_1}$ for $R_1 < R \\le R_2$, and $q(r) \\propto R^{-\\gamma_2}$ for $R > R_2$. The spectral shape of the injection spectrum is\nthe same for all species except CR $p$ and He. $R_1$, and $R_2$ are the same for $p$\nand He and $\\gamma_{i,\\rm He} = \\gamma_{i,p}-\\Delta_{\\rm He}$}\n\\tablenotetext{c}{The CR $p$ and e$^-$ fluxes are normalized at the Solar\nlocation at a kinetic energy of 100~GeV. $J_p$ is in units of $10^{-9}$\ncm$^{-2}$ s$^{-1}$ sr$^{-1}$ MeV$^{-1}$ and $J_e$ is in units of $10^{-11}$ cm$^{-2}$ s$^{-1}$ sr$^{-1}$ MeV$^{-1}$.}\n\\tablenotetext{d}{The injection spectra for isotopes are normalized relative to the proton injection spectrum at 100~GeV\/nuc. \nThe normalization constants for isotopes not listed here are the same as given in \\citet{JohannessonEtAl:2016}.}\n\\tablenotetext{e}{The force-field approximation is used for calculations of the solar\nmodulation and is determined independently for each model and each\nobserving period. $\\Phi_{\\rm AMS,I}$ and $\\Phi_{\\rm AMS,II}$ correspond\nto the 2011-2016 and 2011-2013 observing periods for the AMS-02\ninstrument, respectively.}\n\\end{deluxetable}\n\nTable~\\ref{tab:CRparameters} lists the best-fit parameters for the four models\nconsidered. The parameters are similar for all models and the modified\ndiffusion and different source distributions only slightly affect the best-fit\nvalues.\nMost interestingly, despite the fact that the value of the effective diffusion coefficient exhibits strong spatial variations in the Galactic plane including at the Solar system location, where it is about a factor of 2 smaller compared to that in the model with homogeneous diffusion (Fig.~\\ref{fig:DiffusionPlane}), the value of $D_0$ is not significantly different from that obtained for the homogeneous model.\nThis is connected with the relatively small volume affected by the modified diffusion regions because they are associated with the CR sources, which have a relatively narrow distribution about the Galactic plane with exponential $z$ scale-height 200~pc.\nThe modified diffusion slightly affects the low-energy part of the spectrum, resulting in smaller\nmodulation potentials and Alfv{\\'e}n speeds.\nOverall the addition of the SDZs does not significantly alter the global diffusive properties of the ISM.\n\n\\begin{figure*}[tb]\n \\centering\n \\includegraphics[width=0.49\\textwidth]{fig9a}\n \\includegraphics[width=0.49\\textwidth]{fig9b}\\\\\n \\includegraphics[width=0.49\\textwidth]{fig9c}\n \\includegraphics[width=0.49\\textwidth]{fig9d}\\\\\n \\includegraphics[width=0.49\\textwidth]{fig9e}\n \\includegraphics[width=0.49\\textwidth]{fig9f}\\\\\n \\caption{A comparison between the best-fit model predictions and observation of CR species\nnear the Solar system. The bottom panel of each subfigure shows the data subtracted from the model in units of data flux. References to the data are provided in Table~\\ref{tab:CRdata}. For uniformity of the presentation, AMS-02 data has been converted from rigidity to kinetic energy per nucleon units using isotopic composition of each element as measured by ACE\/CRIS, but the likelihood in the fitting procedure is calculated using rigidity. Different curves represent the four different models considered. SA0 and SA50 cases with the homogeneous diffusion are shown as solid and dotted lines, respectively, while SA0 and SA50 cases with the modified diffusion are show as dashed and dash-dotted lines, respectively. Note that there is significant overlap between the lines for the different models for the top panels of the subfigures.\n }\n \\label{fig:CRelements}\n\\end{figure*}\n\nA comparison between the calculated spectra of CR species and data is shown in Figure~\\ref{fig:CRelements}. The\nmodels agree reasonably well with the data and deviate less than 10\\% from the\nmeasurements for most elements. The largest systematic deviations\nshown are at around 10~GeV for B and C where the relative residuals are as large as\n$\\sim$20\\%. The residuals for Be and O are similar (not shown). These\nare likely caused by the lack of freedom in the injection spectra for the\nprimaries, because the deviations are hardly visible in the secondary-to-primary \nratios of which B\/C is shown in the Figure for illustration. If the deviations were caused by propagation\neffects they would be stronger in the secondary component and be\ncorrespondingly more\nprominent in the secondary-to-primary ratios. Deviations from the H\nand He data are smaller and the feature at 10~GeV is not visible.\nFigure~\\ref{fig:CRelements} also shows that the models agree with each other to\nwithin 5\\% for all elements, and this further illustrates that the addition of the SDZ pockets does not strongly affect predictions for the local spectra of CR species.\n\n\n\\section{Discussion}\n\nObservations of $\\gamma$-ray{} emission from two PWNe made by HAWC \\citep{AbeysekaraEtAl:2017} provide a direct insight into the diffusive properties of the ISM on small scales. Combined with direct measurements of the spectra of CR species in the Solar neighborhood, the HAWC observations point to quite different diffusion coefficients in space surrounding the Geminga and PSR~B0656+14 PWNe compared to the ISM at large, with that associated with the former (SDZs) about two orders of magnitude smaller than the latter. The size of the SDZs is constrained by the upper limits of $\\gamma$-ray{} emission at lower energies obtained by the MAGIC telescope to be $\\lesssim 100$~pc \\citep{AhnenEtAl:2016, TangPiran:2018}. Observations by the {\\em Fermi}-LAT{} may be used to further constrain the properties of the SDZs, although it may be difficult to break a degeneracy between the size of the diffusion zone and the shape of the injection spectra of CR electrons and positrons. This is particularly true for PWNe with a large proper motion, like the case of Geminga, which significantly affects the shape of the IC emission in the energy range of the {\\em Fermi}-LAT.\n\nOne of the main claims of \\citet{AbeysekaraEtAl:2017} is that positrons produced by Geminga provide a negligible fraction of the positrons observed by the AMS-02 instrument \\citep{AguilarEtAl:2014}. This statement is correct only if the diffusion coefficient is small in the entire region between Geminga and the Solar system. Using a two-zone model consistent with both HAWC and MAGIC observations of Geminga, the predicted positron flux can vary over a wide range from a small fraction to almost the entire observed positron flux, dependent on the assumed properties of the SDZ and the injection spectrum. Even if the $\\gamma$-ray{} emission can be constrained with the {\\em Fermi}-LAT{} observations, changing the SDZ properties can result in a variation of the predicted flux by a factor of few. This is illustrated by Scenarios A and C shown in Figures~\\ref{fig:Maps10GeV} and~\\ref{fig:PositronsScenarios}: while the predicted $\\gamma$-ray{} emission differs only marginally, the predicted positron flux differs by about a factor of 5.\n\nIf the result for the two PWNe reported in \\citet{AbeysekaraEtAl:2017} are not special cases, then it is likely that there are similar pockets of slow diffusion around many CR sources elsewhere in the Milky Way. In the likely case that the distribution of the SDZs follows the distribution of CR sources, CRs spend more time in the inner Milky Way and generally in the plane than in the outer Milky Way or its halo.\nDespite this the predicted fluxes of secondary CR species near the Solar system are not strongly affected (see Figure~\\ref{fig:CRelements}), and the propagation model parameters obtained with SDZs included are very close to those determined for models using homogeneous diffusion (see Table~\\ref{tab:CRparameters}). This is a non-trivial result because the production rate of secondary CR species may also increase in the same regions of slow diffusion provided there is enough interstellar gas there. Compared to a model with homogeneous diffusion, the density of CRs should increase towards the inner Milky Way where the distribution of CR sources peaks. Correspondingly, the interstellar high-energy $\\gamma$-ray{} emission (IEM) should also be brighter in the direction of the inner Milky Way. At the same time, this differs from the results of the analysis of the {\\em Fermi}-LAT{} data which indicate that the gradient is even smaller than predicted by models with two-dimensional axisymmetric geometry and homogeneous diffusion \\citep[e.g.][]{AbdoEtAl:2010,AckermannEtAl:2011}. An updated analysis that uses three-dimensional spatial models and includes localized propagation effects may lead to a new interpretation of the distribution of the diffuse emission and of the {\\em Fermi}-LAT{} data.\n\nIn this study the GALPROP framework has been used, which is fully capable of calculating the spectrum and distribution of the expected interstellar diffuse $\\gamma$-ray{} emission, but because of the assumptions incorporated into the modified diffusion model, the predictions of the diffuse emission would be impractical. The sources of CRs are transient in nature and spatially localized and so are the potential SDZs associated with them. Depending on the exact nature of the SDZs, CR particles may be confined within these regions for a significant fraction of their residence time in the Milky Way, contrary to the assumption made in Eqs.~(\\ref{eq:avDiffusion}) and (\\ref{eq:xzx0approx}). This may lead to the incorrect brightness distribution of the predicted $\\gamma$-ray{} emission, which is sensitive to the details of CR distribution throughout the Milky Way. Properly accounting for the transient nature of CR sources in the entire Milky Way is beyond the scope of this work, but will be addressed by a forthcoming paper.\n\nOne plausible explanation for the generation of SDZs near CR sources is the self-excitation of Alfv{\\'e}n waves by the CRs themselves as they stream out into the ISM. Such streaming instabilities have been discussed since the early 70s \\citep{Skilling:1971} and are reviewed in \\citet{AmatoBlasi:2018}. The size and magnitude of the effect of streaming depends on the gradient of the CR distribution and the properties of the ISM, in particular the number density of neutrals and the Alfv{\\'e}n speed. Numerical studies of CR diffusion near SNRs reveal that lower number densities lead to smaller sizes for the SDZ, but also smaller change in the diffusion constant \\citep{NavaEtAl:2016,NavaEtAl:2019}. It is also expected that the injection spectrum is time dependent and may lead to an energy dependence of the diffusion coefficient in SDZs that is quite different from that in the ISM. Such models for the SDZ around Geminga would be in agreement with the HAWC observation that only constrains the diffusion at the highest energies, but produce a wide range of predictions for the expected flux of CR positrons near the Solar system as well as for the expected spectrum of IC emission at low energies. In turn, this would result in an increased CR flux in the inner Galaxy that is dominated by the high-energy particles, leading to a hardening of the spectrum that has been indeed observed by the {\\em Fermi}-LAT{} \\citep{SeligEtAl:2015,AjelloEtAl:2016}. Exploration of these effects is deferred to future work.\n\nTo summarize, observations of the SDZs made by HAWC provide an interesting opportunity to get insight into the fairly complex details of the CR propagation phenomenon. Extension of these observation onto the whole Milky Way \\emph{in specialibus generalia quaerimus} is, however, a non-trivial task \nand further understanding of the origin and properties of the SDZs are necessary to get a correct picture. \n\n\n\\acknowledgements\nT.A.P. and I.V.M. acknowledge partial support from NASA grant NNX17AB48G.\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}}